commit
stringlengths
40
40
subject
stringlengths
1
1.49k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
new_contents
stringlengths
1
29.8k
old_contents
stringlengths
0
9.9k
lang
stringclasses
3 values
proba
float64
0
1
912b1e33eff873a07ca089c69fef51bf05e79051
Add User and Group to admin custom site
ideas/admin.py
ideas/admin.py
from .models import Idea, Outstanding from django.contrib import admin from django.contrib.admin import AdminSite from django.contrib.auth.models import User, Group class MyAdminSite(AdminSite): site_header = "Hackatrix Backend" site_title = "Hackatrix Backend" index_title = "Administrator" class IdeaAd...
from .models import Idea, Outstanding from django.contrib import admin from django.contrib.admin import AdminSite class MyAdminSite(AdminSite): site_header = "Hackatrix Backend" site_title = "Hackatrix Backend" index_title = "Administrator" class IdeaAdmin(admin.ModelAdmin): list_display = ('name', ...
Python
0
c0fc14f3f9f33e20650113803f8a0a81dd49f3ec
generate result.json
example_config.py
example_config.py
import os import logging from apscheduler.triggers.cron import CronTrigger if __name__ == "__main__": raise SystemExit("Not meant to be run directly!") def _rsync_cmd(dest): cmd = ("rsync --delete-delay --recursive --times --stats " "'{output}/' '{dest}'") return cmd.format(dest=dest, output="{...
import os import logging from apscheduler.triggers.cron import CronTrigger if __name__ == "__main__": raise SystemExit("Not meant to be run directly!") def _rsync_cmd(dest): cmd = ("rsync --delete-delay --recursive --times --stats " "'{output}/' '{dest}'") return cmd.format(dest=dest, output="{...
Python
0.998579
1db8627731a2e23693cd9fe38a455956b783c0cd
Update NoticiasTecnologicas.py
03-RSSTelegram/NoticiasTecnologicas.py
03-RSSTelegram/NoticiasTecnologicas.py
#!/usr/bin/env python3 # -*- coding: iso-8859-1 -*- """ Ejemplo: Leer Noticias RSS en Telegram (II) Libreria: pyTelegramBotAPI 1.4.2 [ok] Libreria: pyTelegramBotAPI 2.0 [ok] Python: 3.5.1 """ import telebot import sys import feedparser url = "http://blog.bricogeek.com/noticias/arduino/rss/" rss = feedparser.par...
#!/usr/bin/env python3 # -*- coding: iso-8859-1 -*- """ Ejemplo: Leer Noticias RSS en Telegram (III) Libreria: pyTelegramBotAPI 1.4.2 [ok] Libreria: pyTelegramBotAPI 2.0 [ok] Python: 3.5.1 """ import telebot import sys import feedparser url = "http://blog.bricogeek.com/noticias/arduino/rss/" rss = feedparser.pa...
Python
0
f68a10fec5d4dbc743c5d84f8b26d122e81b26e4
Use standard urlencode() for encoding URLs
derpibooru/request.py
derpibooru/request.py
# Copyright (c) 2014, Joshua Stone # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the ...
# Copyright (c) 2014, Joshua Stone # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the ...
Python
0.000006
8188008cf1bd41c1cbe0452ff635dd0319dfecd9
Add trailing slash to url
derrida/books/urls.py
derrida/books/urls.py
from django.conf.urls import url from django.contrib.admin.views.decorators import staff_member_required from derrida.books.views import ( PublisherAutocomplete, LanguageAutocomplete, InstanceDetailView, InstanceListView ) urlpatterns = [ # TODO: come up with cleaner url patterns/names for autocomplete v...
from django.conf.urls import url from django.contrib.admin.views.decorators import staff_member_required from derrida.books.views import ( PublisherAutocomplete, LanguageAutocomplete, InstanceDetailView, InstanceListView ) urlpatterns = [ # TODO: come up with cleaner url patterns/names for autocomplete v...
Python
0.000004
66568b681307835aa36da291581eea7e29d22d54
Fix BUG in backfill
backfill.py
backfill.py
import titanic import requests import json import time ''' Status new updated building running done ''' server = 'http://0.0.0.0:8314/' auth = None # auth = ('<username>@mozilla.com', '<password>') def updateJob(jobID, branch, buildername, revision, delta=7): revList, buildList = titanic.runA...
import titanic import requests import json import time ''' Status new updated building running done ''' server = 'http://0.0.0.0:8314/' auth = None # auth = ('<username>@mozilla.com', '<password>') def updateJob(jobID, branch, buildername, revision, delta=7): revList, buildList = titanic.runA...
Python
0.000073
76e73fd9502dbd6f179dcea2fb4fd4d3ef6c913c
make fabfile working correctly
deploy/fabfile.py
deploy/fabfile.py
from fabric.api import sudo, cd, task, prompt, run from fabric.contrib import files from fabtools import require, python, supervisor # Variables newebe_dir = "/home/newebe/newebe" newebe_process = newebe_user = "newebe" newebe_user_dir = "/home/newebe/" python_exe = newebe_dir + "/virtualenv/bin/python" newebe_exe = n...
from fabric.api import sudo, cd, task, settings from fabtools import require, python, supervisor newebe_dir = "/home/newebe/newebe" newebe_process = newebe_user = "newebe" newebe_user_dir = "/home/newebe/" def newebedo(cmd): sudo(cmd, user=newebe_user) @task def setup(timezone="Europe/Paris"): install_deb_pa...
Python
0.000001
c4ea3ce306d4464ac0bc80286a60689972c7bc63
Test isolation.
agon/tests.py
agon/tests.py
from threading import Thread from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.contrib.auth.models import User from agon.models import award_points, points_awarded class PointsTestCase(TestCase): def setUp(self): self....
from threading import Thread from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.contrib.auth.models import User from agon.models import award_points, points_awarded class PointsTestCase(TestCase): def setUp(self): self....
Python
0
ac084c574b58771bd240af3fa4b4a000fc742229
update to handle different kinds of files
projects/allan_cont/showlog_long.py
projects/allan_cont/showlog_long.py
import numpy as np import pylab as pl from ourgui import openFile def plotline(maxx, minx=0, value=0, style="k-", plotfunc=pl.plot): plotfunc([minx, maxx], [value, value], style) def quickplot(filename): alldata = np.loadtxt(filename, comments="#", delimiter=",") datashape = np.shape(alldata) ...
import numpy as np import pylab as pl from ourgui import openFile def plotline(maxx, minx=0, value=0, style="k-", plotfunc=pl.plot): plotfunc([minx, maxx], [value, value], style) def quickplot(filename): data = np.loadtxt(filename, comments="#") maxdata, mindata, stddata, meandata = np.max(data),...
Python
0
c206936120519912762f30eb269f1733b5593bf8
fix window edges
contrib/spryte/balls.py
contrib/spryte/balls.py
import random from pyglet import window, clock, gl, event from pyglet.window import key import spryte win = window.Window(vsync=False) fps = clock.ClockDisplay(color=(1, 1, 1, 1)) layer = spryte.Layer() balls = [] for i in range(200): balls.append(spryte.Sprite('ball.png', layer, (win.width - 64) * ran...
import random from pyglet import window, clock, gl, event from pyglet.window import key import spryte win = window.Window(vsync=False) fps = clock.ClockDisplay(color=(1, 1, 1, 1)) layer = spryte.Layer() balls = [] for i in range(200): balls.append(spryte.Sprite('ball.png', layer, win.width * random.ran...
Python
0.000001
b77cb1ac7524e76fd1f29ee6c8e214d12d04226f
Improve variable names.
scripts/gen_regex.py
scripts/gen_regex.py
import unicodedata from ftfy import chardata import pathlib from pkg_resources import resource_filename CATEGORIES = [unicodedata.category(chr(i)) for i in range(0x110000)] DATA_PATH = pathlib.Path(resource_filename('wordfreq', 'data')) def func_to_regex(accept_func): """ Given a function that returns True ...
import unicodedata from ftfy import chardata import pathlib from pkg_resources import resource_filename CATEGORIES = [unicodedata.category(chr(i)) for i in range(0x110000)] DATA_PATH = pathlib.Path(resource_filename('wordfreq', 'data')) def func_to_regex(func): """ Given a function that returns True or Fals...
Python
0.999999
960618782d81035dd9671c973ad6d95c55ff6534
Use the firefox capabilities if wires exist
tests/functional_tests_gerrit.py
tests/functional_tests_gerrit.py
#!/bin/env python import unittest import os import yaml from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions from selenium.webdriver.common.desired_capabilities import DesiredCap...
#!/bin/env python import unittest import os import yaml from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions from selenium.webdriver.common.desired_capabilities import DesiredCap...
Python
0.000001
5ff27451b55cdd03fa7913aee9e0762297341e29
make image printer thingy iterable, and optimize output data
fabulous/image.py
fabulous/image.py
"""Print Images to a 256-Color Terminal """ import sys import fcntl import struct import termios import itertools from PIL import Image as Pills from grapefruit import Color from fabulous.xterm256 import rgb_to_xterm class Image(object): def __init__(self, path, width=None, bgcolor='black'): self.bgcol...
import sys from PIL import Image # from fabulous.ansi import fg from fabulous.test_xterm256 import fg def image(path, resize=None, resize_antialias=None): im = Image.open(path) if resize: im = im.resize(resize) elif resize_antialias: im = im.resize(resize, Image.ANTIALIAS) pix = im....
Python
0.000001
439b977b14b12d42ee886a432f3a4af555d8de10
add storage stuctures
minMaxCalc.py
minMaxCalc.py
import pandas as pd # read in dataset xl = pd.ExcelFile("data/130N_Cycles_1-47.xlsx") df = xl.parse("Specimen_RawData_1") df """ This is what the dataset currently looks like - it has 170,101 rows and two columns. The dataset contains data from 47 cycles following an experiment. The output of these experiments form...
import pandas as pd # read in dataset xl = pd.ExcelFile("data/130N_Cycles_1-47.xlsx") df = xl.parse("Specimen_RawData_1") df """ This is what the dataset currently looks like - it has 170,101 rows and two columns. The dataset contains data from 47 cycles following an experiment. The output of these experiments form...
Python
0
642cd34041a579fa37ea3790143d79842c7141f3
add implementation for all makers
ismrmrdpy/backend/acquisition.py
ismrmrdpy/backend/acquisition.py
# -*- coding: utf-8 -*- # # Copyright (c) 2014-2015, Ghislain Antony Vaillant # All rights reserved. # # This file is distributed under the BSD License, see the LICENSE file or # checkout the license terms at http://opensource.org/licenses/BSD-2-Clause). from __future__ import absolute_import, division, print_function...
# -*- coding: utf-8 -*- # # Copyright (c) 2014-2015, Ghislain Antony Vaillant # All rights reserved. # # This file is distributed under the BSD License, see the LICENSE file or # checkout the license terms at http://opensource.org/licenses/BSD-2-Clause). from __future__ import absolute_import, division, print_function...
Python
0
72067069138ce9568c06140d23bd07cc6741a30e
Test case can't throw away windows, it needs shared context space to continue. XXX fix this in pyglet, ideally.
tests/resource/RES_LOAD_IMAGE.py
tests/resource/RES_LOAD_IMAGE.py
#!/usr/bin/python # $Id:$ import os import sys import unittest from pyglet.gl import * from pyglet import image from pyglet import resource from pyglet import window __noninteractive = True # Test image is laid out # M R # B G # In this test the image is sampled at four points from top-right cloc...
#!/usr/bin/python # $Id:$ import os import sys import unittest from pyglet.gl import * from pyglet import image from pyglet import resource from pyglet import window __noninteractive = True # Test image is laid out # M R # B G # In this test the image is sampled at four points from top-right cloc...
Python
0.000001
a80e063a4afb65018a8b137f1909956839f42767
Test default search context
tests/sentry/interfaces/tests.py
tests/sentry/interfaces/tests.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import pickle from sentry.interfaces import Interface, Message, Query, Stacktrace from sentry.models import Event from sentry.testutils import TestCase, fixture class InterfaceBase(TestCase): @fixture def event(self): return Event( ...
# -*- coding: utf-8 -*- from __future__ import absolute_import import pickle from sentry.interfaces import Interface, Message, Query, Stacktrace from sentry.models import Event from sentry.testutils import TestCase, fixture class InterfaceBase(TestCase): @fixture def event(self): return Event( ...
Python
0.000001
59ba038f117744ca0c5fe8c24b97b64830f8e7ec
Put bulk data into db
court_bulk_collector.py
court_bulk_collector.py
from courtreader import readers from courtutils.logger import get_logger from datetime import datetime, timedelta import pymongo import os import sys import time # configure logging log = get_logger() log.info('Worker running') def get_db_connection(): return pymongo.MongoClient(os.environ['MONGO_DB'])['va_court_...
from courtreader import readers from courtutils.logger import get_logger from datetime import datetime, timedelta import pymongo import os import sys import time # configure logging log = get_logger() log.info('Worker running') def get_db_connection(): return pymongo.MongoClient(os.environ['MONGO_DB'])['va_court_...
Python
0.000004
8c0dc68c41137cd809d4403045834ab4f876294c
Add small test for parsing the Var datashape
tests/test_datashape_creation.py
tests/test_datashape_creation.py
import blaze from blaze import datashape import numpy as np import unittest class TestDatashapeCreation(unittest.TestCase): def test_raise_on_bad_input(self): # Make sure it raises exceptions on a few nonsense inputs self.assertRaises(TypeError, blaze.dshape, None) self.assertRaises(TypeEr...
import blaze from blaze import datashape import numpy as np import unittest class TestDatashapeCreation(unittest.TestCase): def test_raise_on_bad_input(self): # Make sure it raises exceptions on a few nonsense inputs self.assertRaises(TypeError, blaze.dshape, None) self.assertRaises(TypeEr...
Python
0.000001
55bff70c3dabe5251ed23720c9f2491cc8bd1ed1
Add support for django 1.8+
favit/managers.py
favit/managers.py
# -*- coding: utf-8 -*- from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models import get_model def _get_content_type_and_obj(obj, model=None): if isinstance(model, basestring): model = get_model(*model.split(".")) if isinstance(obj, (int, long))...
# -*- coding: utf-8 -*- from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models import get_model def _get_content_type_and_obj(obj, model=None): if isinstance(model, basestring): model = get_model(*model.split(".")) if isinstance(obj, (int, long))...
Python
0.000007
e3a9db58f03eb73635a94ed6249e3c2a308f4ad0
Fix some typos found in staging.
fedmsg_genacls.py
fedmsg_genacls.py
# -*- coding: utf-8 -*- """ A fedmsg consumer that listens to pkgdb messages to update gitosis acls Authors: Janez Nemanič <janez.nemanic@gmail.com> Ralph Bean <rbean@redhat.com> """ import pprint import subprocess import os import fedmsg.consumers import moksha.hub.reactor class GenACLsConsumer(fed...
# -*- coding: utf-8 -*- """ A fedmsg consumer that listens to pkgdb messages to update gitosis acls Authors: Janez Nemanič <janez.nemanic@gmail.com> Ralph Bean <rbean@redhat.com> """ import pprint import subprocess import os import fedmsg.consumers import moksha.hub.reactor class GenACLsConsumer(fed...
Python
0.000004
d5e418e24990c2b7294f3fd6fd8ef94819ddfe66
Allow regular users to view any feedback issue that is public.
feedback/views.py
feedback/views.py
from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.views.generic import ListView, DetailView, CreateView, UpdateView from django.db.models import Q from .forms import IssueForm, IssueUpdateStatusForm, CommentForm from .models import Issue, Discussion cl...
from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.views.generic import ListView, DetailView, CreateView, UpdateView from .forms import IssueForm, IssueUpdateStatusForm, CommentForm from .models import Issue, Discussion class LoginRequiredMixin(object):...
Python
0
d6342967598ae7fa822592b42e0f85de2beaf916
use constants
tests/twisted/test-self-alias.py
tests/twisted/test-self-alias.py
# # Test alias setting for the self handle # from sofiatest import exec_test import constants as cs import dbus def test(q, bus, conn, sip_proxy): conn.Connect() q.expect('dbus-signal', signal='StatusChanged', args=[0, 1]) self_handle = conn.GetSelfHandle() default_alias = conn.Aliasing.GetAliases(...
# # Test alias setting for the self handle # from sofiatest import exec_test from servicetest import tp_name_prefix import dbus TEXT_TYPE = tp_name_prefix + '.Channel.Type.Text' ALIASING_INTERFACE = tp_name_prefix + '.Connection.Interface.Aliasing' CONTACTS_INTERFACE = tp_name_prefix + '.Connection.Interface.Contact...
Python
0.00001
16abb3720d9c41b130ea83a4b678ec99521567eb
Fix Grid unit test
tests/unit/analysis/test_grid.py
tests/unit/analysis/test_grid.py
# """Unit tests for cartoframes.analysis.grid""" import os import pytest import numpy as np from pandas import read_csv from geopandas import GeoDataFrame from shapely.geometry import box, shape from cartoframes.utils import set_geometry from cartoframes.analysis.grid import QuadGrid from geopandas.testing import a...
# """Unit tests for cartoframes.analysis.grid""" import os import pytest import numpy as np from pandas import read_csv from geopandas import GeoDataFrame from shapely.geometry import box, shape from cartoframes.utils import decode_geometry from cartoframes.analysis.grid import QuadGrid from geopandas.testing impor...
Python
0
ae896f3c8eaa7fa9863a862f0679065348a7b971
Remove obsolete argument from workflow cli
src/tmlib/tmaps/args.py
src/tmlib/tmaps/args.py
from ..args import Args class TmapsSubmitArgs(Args): def __init__(self, **kwargs): ''' Initialize an instance of class TmapsSubmitArgs. Parameters ---------- **kwargs: dict arguments as key-value pairs ''' self.stage = self._stage_params['defau...
from ..args import Args class TmapsSubmitArgs(Args): def __init__(self, **kwargs): ''' Initialize an instance of class TmapsSubmitArgs. Parameters ---------- **kwargs: dict arguments as key-value pairs ''' self.stage = self._stage_params['defau...
Python
0.000003
82921fb53db2b6e7fdd731f23addd413a6f87673
Add function to sign SSH key
misc/sshca.py
misc/sshca.py
#!/usr/bin/python import confluent.collective.manager as collective import eventlet.green.subprocess as subprocess import glob import os import shutil import tempfile def normalize_uid(): curruid = os.getuid() neededuid = os.stat('/etc/confluent').st_uid if curruid != neededuid: os.setuid(neededui...
#!/usr/bin/python import confluent.collective.manager as collective import eventlet.green.subprocess as subprocess import glob import os def normalize_uid(): curruid = os.getuid() neededuid = os.stat('/etc/confluent').st_uid if curruid != neededuid: os.setuid(neededuid) if os.getuid() != n...
Python
0
0a57bcc2faca88d0527bb1f14dae2b0b9b5168f2
bump filer version to 0.9pbs.54
filer/__init__.py
filer/__init__.py
#-*- coding: utf-8 -*- # version string following pep-0396 and pep-0386 __version__ = '0.9pbs.54' # pragma: nocover
#-*- coding: utf-8 -*- # version string following pep-0396 and pep-0386 __version__ = '0.9pbs.53' # pragma: nocover
Python
0
006cbb88f2a06cd1411f88126ccf4a43121aa858
Update app startup process with new servicemanager and websocket communication.
app/main.py
app/main.py
""" The main module for HomePiServer. Initializes SocketIO, ServiceManager, NavigationChannel, View Manager. """ import signal from threading import Thread from gevent import monkey from flask import Flask from flask_socketio import SocketIO from .controllers import CONTROLLERS from .core.logger import configure_lo...
""" The main module for HomePiServer. Initializes SocketIO, ServiceManager, NavigationChannel, View Manager. """ import signal from threading import Thread from gevent import monkey from flask import Flask from flask_socketio import SocketIO from .controllers import CONTROLLERS from .core.socketchannel import Navig...
Python
0
a0a92e237ca91dc8f0318a27dfeec9b9c8e95de5
Add utility to guess livelock file for an owner
lib/utils/livelock.py
lib/utils/livelock.py
# # # Copyright (C) 2014 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed ...
# # # Copyright (C) 2014 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed ...
Python
0.000116
f431f2408ca1e1a38479a9ac1224bd608df1c0d4
Test build.source rather than legacy attributes
changes/listeners/green_build.py
changes/listeners/green_build.py
import logging import requests from datetime import datetime from flask import current_app from changes.config import db from changes.constants import Result from changes.db.utils import create_or_update from changes.models import ( Build, Event, EventType, ProjectOption, RepositoryBackend ) from changes.utils.ht...
import logging import requests from datetime import datetime from flask import current_app from changes.config import db from changes.constants import Result from changes.db.utils import create_or_update from changes.models import ( Build, Event, EventType, ProjectOption, RepositoryBackend ) from changes.utils.ht...
Python
0
a281fd3c49b86012fd370ae82df19525af89ff1c
Disable swift test
parsl/tests/test_swift.py
parsl/tests/test_swift.py
import pytest import parsl from parsl import * parsl.set_stream_logger() from parsl.executors.swift_t import * def foo(x, y): return x * y def slow_foo(x, y): import time time.sleep(x) return x * y def bad_foo(x, y): time.sleep(x) return x * y @pytest.mark.skip('fails intermittently')...
import pytest import parsl from parsl import * parsl.set_stream_logger() from parsl.executors.swift_t import * def foo(x, y): return x * y def slow_foo(x, y): import time time.sleep(x) return x * y def bad_foo(x, y): time.sleep(x) return x * y @pytest.mark.local def test_simple(): ...
Python
0.000004
e9980d7498c0889ecd795a4d2977c1893e0ad7e3
comment on md5 usage
app/util.py
app/util.py
import bcrypt import md5 def hash_pwd(password): return bcrypt.hashpw(password, bcrypt.gensalt()) def check_pwd(password, hashed): return bcrypt.hashpw(password, hashed) == hashed def validate_time(time): return True # XXX md5 module deprecated, use hashlib def gravatar_html(email): h = md5.md5(em...
import bcrypt import md5 def hash_pwd(password): return bcrypt.hashpw(password, bcrypt.gensalt()) def check_pwd(password, hashed): return bcrypt.hashpw(password, hashed) == hashed def validate_time(time): return True def gravatar_html(email): h = md5.md5(email.lower()).hexdigest() html = '<img...
Python
0
1d443973e8db6265268dd2afe6b6ad7748526335
Add _read_test_file() function.
ipymd/utils.py
ipymd/utils.py
# -*- coding: utf-8 -*- """Utils""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import os import os.path as op import difflib from .six import exec_ #--------------------------------------...
# -*- coding: utf-8 -*- """Utils""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import os import os.path as op import difflib from .six import exec_ #--------------------------------------...
Python
0.000001
95ad2c65fb1b4aacea668c8d9474183b4f107d56
Test with multi args
paver/tests/test_shell.py
paver/tests/test_shell.py
import sys from paver.deps.six import b from mock import patch, Mock from paver import easy from subprocess import PIPE, STDOUT @patch('subprocess.Popen') def test_sh_raises_BuildFailure(popen): popen.return_value.returncode = 1 popen.return_value.communicate.return_value = [b('some stderr')] try: ...
import sys from paver.deps.six import b from mock import patch, Mock from paver import easy from subprocess import PIPE, STDOUT @patch('subprocess.Popen') def test_sh_raises_BuildFailure(popen): popen.return_value.returncode = 1 popen.return_value.communicate.return_value = [b('some stderr')] try: ...
Python
0
d329787dc6f862e749ca6f490a155186b48553a7
Fix one more bug; interpreter still broken
bfinterp.py
bfinterp.py
import sys import collections import getch from parser import parse, optimize from parser import OUTPUT, INPUT, LOOPSTART, LOOPEND, MOVE from parser import ADD, SET, MULCOPY, SCAN BUFSIZE = 8192 def interp(code): tokens = parse(code) tokens = optimize(tokens) i = 0 loops = [] mem = bytearray(BUF...
import sys import collections import getch from parser import parse, optimize from parser import OUTPUT, INPUT, LOOPSTART, LOOPEND, MOVE from parser import ADD, SET, MULCOPY, SCAN BUFSIZE = 8192 def interp(code): tokens = parse(code) tokens = optimize(tokens) i = 0 loops = [] mem = bytearray(BUF...
Python
0
4cd44a177147569767a8f53aed67cbee0f759667
bump verion to 3.0.0-alpha
pyani/__init__.py
pyani/__init__.py
# python package version # should match r"^__version__ = '(?P<version>[^']+)'$" for setup.py """Module with main code for pyani application/package.""" __version__ = '0.3.0-alpha'
# python package version # should match r"^__version__ = '(?P<version>[^']+)'$" for setup.py """Module with main code for pyani application/package.""" __version__ = '0.3.0.dev'
Python
0.000001
3fda8faef7dccaefc29bb9c4a84fce4819141118
update some comments and names for readability
src/watchdog/observers/inotify_buffer.py
src/watchdog/observers/inotify_buffer.py
# -*- coding: utf-8 -*- # # Copyright 2014 Thomas Amland <thomas.amland@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
# -*- coding: utf-8 -*- # # Copyright 2014 Thomas Amland <thomas.amland@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
Python
0
f52bec382965e166b86821938da07c9dbc80c9de
Switch to Roster implementation with DB backend
pyfire/contact.py
pyfire/contact.py
""" pyfire.contact ~~~~~~~~~~ Handles Contact ("roster item") interpretation as per RFC-6121 :copyright: 2011 by the pyfire Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import xml.etree.ElementTree as ET from sqlalchemy import Table, Column, Boolean, Integ...
""" pyfire.contact ~~~~~~~~~~ Handles Contact ("roster item") interpretation as per RFC-6121 :copyright: 2011 by the pyfire Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from pyfire.jid import JID import xml.etree.ElementTree as ET class Contact(object): ...
Python
0
3066837091621720be0b0338d12ed66fd24a86b1
bump version
pyiso/__init__.py
pyiso/__init__.py
import imp import os.path __version__ = '0.2.7' BALANCING_AUTHORITIES = { 'BPA': {'module': 'bpa', 'class': 'BPAClient'}, 'CAISO': {'module': 'caiso', 'class': 'CAISOClient'}, 'ERCOT': {'module': 'ercot', 'class': 'ERCOTClient'}, 'ISONE': {'module': 'isone', 'class': 'ISONEClient'}, 'MISO': {'mo...
import imp import os.path __version__ = '0.2.6' BALANCING_AUTHORITIES = { 'BPA': {'module': 'bpa', 'class': 'BPAClient'}, 'CAISO': {'module': 'caiso', 'class': 'CAISOClient'}, 'ERCOT': {'module': 'ercot', 'class': 'ERCOTClient'}, 'ISONE': {'module': 'isone', 'class': 'ISONEClient'}, 'MISO': {'mo...
Python
0
76c8096b3aed79391614b32608ab446613c42034
Add LOG_LEVEL global set by DEBUG=True in environment
pyiso/__init__.py
pyiso/__init__.py
import imp import os.path from os import environ from logging import DEBUG, INFO ######################################### # For Testing Purposes # Add caching to unittesting # Print every time the testing hits the cache successfully import requests import requests_cache requests_cache.install_cache(expire_after=60*10...
import imp import os.path __version__ = '0.2.11' BALANCING_AUTHORITIES = { 'AZPS': {'module': 'sveri', 'class': 'SVERIClient'}, 'BPA': {'module': 'bpa', 'class': 'BPAClient'}, 'CAISO': {'module': 'caiso', 'class': 'CAISOClient'}, 'DEAA': {'module': 'sveri', 'class': 'SVERIClient'}, 'ELE': {'modu...
Python
0.000064
42ea9fef4203d5acd73e732dbe0e4d8672e81d17
bump version for pypi
jax/version.py
jax/version.py
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0
bcc8164f2e6ed4401dc5ecb74a28ebe8554f7b82
Add Windows support.
binding.gyp
binding.gyp
{ 'targets': [{ 'target_name': 'robotjs', 'include_dirs': [ 'node_modules/nan/' ], 'cflags': [ '-Wall', '-Wparentheses', '-Winline', '-Wbad-function-cast', '-Wdisabled-optimization' ], 'conditions': [ ['OS == "mac"', { 'include_dirs...
{ 'targets': [{ 'target_name': 'robotjs', 'include_dirs': [ '<!(node -e \'require("nan")\')' ], 'cflags': [ '-Wall', '-Wparentheses', '-Winline', '-Wbad-function-cast', '-Wdisabled-optimization' ], 'conditions': [ ['OS == "mac"', { ...
Python
0
c5da75e3acb4ba4c69204ff1ad3e7e89d6710001
Add whitespace in tests
client/tests/framework_test.py
client/tests/framework_test.py
#!/usr/bin/python3 import unittest import ok class TestProtocol(ok.Protocol): name = "test" def __init__(self, args, src_files): ok.Protocol.__init__(args, src_files) self.called_start = 0 self.called_interact = 0 def on_start(self, buf): self.called_start += 1 def ...
#!/usr/bin/python3 import unittest import ok class TestProtocol(ok.Protocol): name = "test" def __init__(self, args, src_files): ok.Protocol.__init__(args, src_files) self.called_start = 0 self.called_interact = 0 def on_start(self, buf): self.called_start += 1 def o...
Python
0.999029
c552dc428b78fae168d59d3ff5af1818cf56f0e2
use DNSServiceGetAddrInfo(…) on Mac OS
binding.gyp
binding.gyp
{ 'targets': [ { 'target_name': 'dns_sd_bindings' , 'sources': [ 'src/dns_sd.cpp' , 'src/dns_service_browse.cpp' , 'src/dns_service_enumerate_domains.cpp' , 'src/dns_service_get_addr_info.cpp' , 'src/dns_service_process_result.cpp' ...
{ 'targets': [ { 'target_name': 'dns_sd_bindings' , 'sources': [ 'src/dns_sd.cpp' , 'src/dns_service_browse.cpp' , 'src/dns_service_enumerate_domains.cpp' , 'src/dns_service_get_addr_info.cpp' , 'src/dns_service_process_result.cpp' ...
Python
0
c7764ac8c1363701b4e7fab1d8ae0e3197853b48
Update __init__.py
pylsy/__init__.py
pylsy/__init__.py
#__init__.py from .pylsy import PylsyTable __version__="1.003"
#__init__.py from .pylsy import PylsyTable __version__="1.001"
Python
0.000072
8eae324c0030221a93b202a419db3f7301ad486c
read config only if file exists
pymzn/__init__.py
pymzn/__init__.py
""" PyMzn is a Python library that wraps and enhances the MiniZinc tools for CSP modelling and solving. It is built on top of the libminizinc library (version 2.0) and provides a number of off-the-shelf functions to readily solve problems encoded in MiniZinc and parse the solutions into Python objects. """ import ast i...
""" PyMzn is a Python library that wraps and enhances the MiniZinc tools for CSP modelling and solving. It is built on top of the libminizinc library (version 2.0) and provides a number of off-the-shelf functions to readily solve problems encoded in MiniZinc and parse the solutions into Python objects. """ import ast i...
Python
0.000001
45141fe7f34e0522b2270047af796644406213dc
Add user help text to error output of do_fish_indent
do_fish_indent.py
do_fish_indent.py
import sublime, sublime_plugin import os.path import subprocess # Only a TextCommand can use replace() class DoFishIndentCommand(sublime_plugin.TextCommand): def is_enabled(self): # We are very incompatible with ST1 and probably ST4 one day return 2 <= int(sublime.version()[0]) <= 3 def is_visible(self): ...
import sublime, sublime_plugin import os.path import subprocess # Only a TextCommand can use replace() class DoFishIndentCommand(sublime_plugin.TextCommand): def is_enabled(self): # We are very incompatible with ST1 and probably ST4 one day return 2 <= int(sublime.version()[0]) <= 3 def is_visible(self): ...
Python
0.000009
eaa17491581cbb52242fbe543dd09929f537a8bc
Add option to ignore static.
mysettings.py
mysettings.py
from src.markdown.makrdown import jinja_aware_markdown PREFERRED_URL_SCHEME = 'http' SERVER_NAME = 'localhost:5000' FLATPAGES_EXTENSION = '.md' FLATPAGES_HTML_RENDERER = jinja_aware_markdown FREEZER_IGNORE_404_NOT_FOUND = True FLATPAGES_AUTO_RELOAD = True FREEZER_STATIC_IGNORE = ["*"] GITHUB_URL = 'https://github.com/...
from src.markdown.makrdown import jinja_aware_markdown PREFERRED_URL_SCHEME = 'http' SERVER_NAME = 'localhost:5000' FLATPAGES_EXTENSION = '.md' FLATPAGES_HTML_RENDERER = jinja_aware_markdown FREEZER_IGNORE_404_NOT_FOUND = True FLATPAGES_AUTO_RELOAD = True GITHUB_URL = 'https://github.com/JetBrains/kotlin' TWITTER_URL ...
Python
0
9a40bd0d82c5215a8978a7d1c95f2910ee8f7f09
add UserToken model
api/models.py
api/models.py
from django.db import models from django.db.models import Q from django.utils import timezone from django.contrib.auth.models import User class MaintenanceRecord(models.Model): start_date = models.DateTimeField() end_date = models.DateTimeField(blank=True, null=True) title = models.CharField(max_length=25...
from django.db import models from django.db.models import Q from django.utils import timezone class MaintenanceRecord(models.Model): start_date = models.DateTimeField() end_date = models.DateTimeField(blank=True, null=True) title = models.CharField(max_length=256) message = models.TextField() disa...
Python
0
379068d31623662c0b349f26d1cd610612963b82
add re module to be more reliable
joinstsfile.py
joinstsfile.py
#!/usr/bin/env python3 import os, re path=r'/home/ruan/git/stm/' namespace={} data=[] for file in os.listdir(path): if re.match('A\d{6}\.\d{6}\.L\d{4}\.VERT',file): namespace[int(file.split('.')[2][2:])]=file keys=sorted([x for x in namespace.keys()]) with open(os.path.join(path,namespace[keys[0]]),'rb') as fo: ...
#!/usr/bin/env python3 import os path='/home/ruan/git/stm/' #path为文件所在目录,windows下如‘D:\\data\\’,直接覆盖源文件,请注意保存原始数据 for file in os.listdir(path): os.rename(os.path.join(path,file),os.path.join(path,file.split('.')[2][2:])) filenu = len(os.listdir(path)) + 1 data=[] with open(os.path.join(path,'001'),'rb') as fo: f...
Python
0
85d5712fa1dde952783cbc8d78f904e08cfc9b50
Remove duplicated dependency
server/setup.py
server/setup.py
from pathlib import Path from setuptools import Command, find_packages, setup class GenerateCommand(Command): description = "generates manticore_server server protobuf + grpc code from protobuf specification file" user_options = [] def initialize_options(self): pass def finalize_options(sel...
from pathlib import Path from setuptools import Command, find_packages, setup class GenerateCommand(Command): description = "generates manticore_server server protobuf + grpc code from protobuf specification file" user_options = [] def initialize_options(self): pass def finalize_options(sel...
Python
0
ba43de958266a2906f3ee4cad23b20361db2637a
Add arguments to job
scripts/submitJob.py
scripts/submitJob.py
#!/usr/bin/env python # SIM-CITY client # # Copyright 2015 Netherlands eScience Center # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
#!/usr/bin/env python # SIM-CITY client # # Copyright 2015 Netherlands eScience Center # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
Python
0.00008
8d56a45d0b01dff3e8cd041e7ba09c882d7cbb30
add logging to file and stdout
phabricator-proxy/main.py
phabricator-proxy/main.py
from cmath import log from flask.logging import default_handler from urllib.parse import urlparse, parse_qs import flask import json import logging import logging.handlers import os import requests buildkite_api_token = os.getenv("BUILDKITE_API_TOKEN", "") app = flask.Flask(__name__) app.config["DEBUG"] = False form...
import flask import requests import os from urllib.parse import urlparse, parse_qs import json app = flask.Flask(__name__) app.config["DEBUG"] = False buildkite_api_token = os.getenv("BUILDKITE_API_TOKEN", "") @app.route('/', methods=['GET']) def home(): return "Hi LLVM!" @app.route('/build', methods=['POST', ...
Python
0
c90dbc5007b5627b264493c2d16af79cff9c2af0
Add better custom has_permission check.
joku/checks.py
joku/checks.py
""" Specific checks. """ from discord.ext.commands import CheckFailure, check def is_owner(ctx): if not ctx.bot.owner_id == ctx.message.author.id: raise CheckFailure(message="You are not the owner.") return True def has_permissions(**perms): def predicate(ctx): if ctx.bot.owner_id == ctx...
""" Specific checks. """ from discord.ext.commands import CheckFailure def is_owner(ctx): if not ctx.bot.owner_id == ctx.message.author.id: raise CheckFailure(message="You are not the owner.") return True
Python
0
f9a827b41ed925e22bf1e873e5989bdd327fabbf
Add RefugeeCamp name formatting
api/models.py
api/models.py
from django.db import models class RefugeeCamp(models.Model): # Location city = models.CharField(max_length=64) postcode = models.CharField(max_length=16) street = models.CharField(max_length=128) streetnumber = models.CharField(max_length=32) def __str__(self): return "{0} {1}: {2} {3...
from django.db import models class RefugeeCamp(models.Model): # Location city = models.CharField(max_length=64) postcode = models.CharField(max_length=16) street = models.CharField(max_length=128) streetnumber = models.CharField(max_length=32) class ObjectCategory(models.Model): title = models...
Python
0.000001
c720f9c385a785b8905991465fb74c75fca42220
fix bug
cloudify_cloudinit/__init__.py
cloudify_cloudinit/__init__.py
# Copyright (c) 2017-2018 Cloudify Platform Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
# Copyright (c) 2017-2018 Cloudify Platform Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
Python
0.000001
ee1f958cb3611ecc3af0329deda7fde5d5281c32
remove obsolete model creation
core/models/__init__.py
core/models/__init__.py
# -*- coding: utf-8 -*- # flake8: noqa """ Collection of models """ from core.models.allocation_strategy import Allocation, AllocationStrategy from core.models.application import Application, ApplicationMembership,\ ApplicationScore, ApplicationBookmark from core.models.application_tag import ApplicationTag from co...
from core.models.allocation_strategy import Allocation, AllocationStrategy from core.models.application import Application, ApplicationMembership,\ ApplicationScore, ApplicationBookmark from core.models.application_tag import ApplicationTag from core.models.application_version import ApplicationVersion, Application...
Python
0.000003
1c3e8def9f46ee0f21d1172287af0b4fadf67884
Add some more backwards compatibility: also add intent to outcome
src/wit_ros/wit_node.py
src/wit_ros/wit_node.py
#!/usr/bin/env python """ROS node for the Wit.ai API""" global APIKEY APIKEY = None import rospy import requests import json from wit import Wit from wit_ros.srv import Interpret, InterpretResponse, ListenAndInterpret, ListenAndInterpretResponse from wit_ros.msg import Outcome, Entity class WitRos(object): def ...
#!/usr/bin/env python """ROS node for the Wit.ai API""" global APIKEY APIKEY = None import rospy import requests import json from wit import Wit from wit_ros.srv import Interpret, InterpretResponse, ListenAndInterpret, ListenAndInterpretResponse from wit_ros.msg import Outcome, Entity class WitRos(object): def ...
Python
0
1b2f0be67a8372a652b786c8b183cd5edf1807cd
Swap back to Fuzzer, no monkey patching
config/fuzz_pox_mesh.py
config/fuzz_pox_mesh.py
from experiment_config_lib import ControllerConfig from sts.topology import MeshTopology from sts.control_flow import Fuzzer, Interactive from sts.input_traces.input_logger import InputLogger from sts.invariant_checker import InvariantChecker from sts.simulation_state import SimulationConfig # Use POX as our controlle...
from experiment_config_lib import ControllerConfig from sts.topology import MeshTopology from sts.control_flow import Fuzzer from sts.input_traces.input_logger import InputLogger from sts.invariant_checker import InvariantChecker from sts.simulation_state import SimulationConfig # Use POX as our controller command_lin...
Python
0
ffd14af829bd3f7bf52cb0af5306550b51ab8712
Remove mox from tests/unit/compute/test_compute_xen.py
nova/tests/unit/compute/test_compute_xen.py
nova/tests/unit/compute/test_compute_xen.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
Python
0.000002
6eeadf2246c5aa09bbec6fd5b6bb0d9fde25d348
Remove dots from rendered maze
bin/maze.py
bin/maze.py
# Use case: A randomly generated maze won when the user reaches the end # Example: from vengeance.game import Direction from vengeance.game import Game from vengeance.game import Location import random width = 8 height = 8 north = Direction('north') south = Direction('south') north.opposite = south east = Direction('...
# Use case: A randomly generated maze won when the user reaches the end # Example: from vengeance.game import Direction from vengeance.game import Game from vengeance.game import Location import random width = 8 height = 8 north = Direction('north') south = Direction('south') north.opposite = south east = Direction('...
Python
0.000002
d0ca9aa6cf39c4743e398f65e4c7f5bbc3c03d78
Clarify API sample
api_sample.py
api_sample.py
# Add ./lib to the path for importing nassl import os import sys sys.path.insert(1, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lib')) from sslyze.plugins_finder import PluginsFinder from sslyze.plugins_process_pool import PluginsProcessPool from sslyze.server_connectivity import ServerConnectivityInfo,...
# Add ./lib to the path for importing nassl import os import sys sys.path.insert(1, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lib')) from sslyze.plugins_finder import PluginsFinder from sslyze.plugins_process_pool import PluginsProcessPool from sslyze.server_connectivity import ServerConnectivityInfo,...
Python
0.000003
0e2548637d9726dc549b13abc3a6b38c51e300bd
not count , and . values in allele count
franklin/snv/readers.py
franklin/snv/readers.py
''' Created on 2011 aza 21 @author: peio ''' class VcfParser(object): 'A vcf reader' def __init__(self, fpath): 'Class initiator' self._fpath = fpath self.header = None self._get_header() self._index = None def _get_version(self): 'version of the vcf' ...
''' Created on 2011 aza 21 @author: peio ''' class VcfParser(object): 'A vcf reader' def __init__(self, fpath): 'Class initiator' self._fpath = fpath self.header = None self._get_header() self._index = None def _get_version(self): 'version of the vcf' ...
Python
0.999987
b47143d38027a7bafc73376de01bd2fa2196ac60
Add test for file interface in put_attachment
couchdb/tests/client.py
couchdb/tests/client.py
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Christopher Lenz # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. import doctest import os import unittest import StringIO from couchdb import client class DatabaseTest...
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Christopher Lenz # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. import doctest import os import unittest from couchdb import client class DatabaseTestCase(unittest.Te...
Python
0.000001
43f67a09d0e194ef3012bad97e0cb45db7c34d35
test travis
binding.gyp
binding.gyp
{ "targets": [ { "target_name": "addon", "sources": [ "src/addon.cc", "src/object.cc", "src/async.cc", "src/engine.cc", "src/results.cc" ], #"cflags": [ "-Werror", "-Wall", "-Wextra", "-Wpedantic", "-Wunused-parameter", "-funroll-loops", "-Ofast" ],#targets all...
{ "targets": [ { "target_name": "addon", "sources": [ "src/addon.cc", "src/object.cc", "src/async.cc", "src/engine.cc", "src/results.cc" ], #"cflags": [ "-Werror", "-Wall", "-Wextra", "-Wpedantic", "-Wunused-parameter", "-funroll-loops", "-Ofast" ],#targets all...
Python
0.000002
ff9822c7776cdef1e14e80a2cc56700bbc4f24f2
Fix Mac OS build warnings on old node versions
binding.gyp
binding.gyp
{ "targets": [ { "target_name": "anitomy-js", "sources": [ "lib/anitomy/anitomy/anitomy.cpp", "lib/anitomy/anitomy/anitomy.h", "lib/anitomy/anitomy/element.cpp", "lib/anitomy/anitomy/element.h", "lib/anit...
{ "targets": [ { "target_name": "anitomy-js", "sources": [ "lib/anitomy/anitomy/anitomy.cpp", "lib/anitomy/anitomy/anitomy.h", "lib/anitomy/anitomy/element.cpp", "lib/anitomy/anitomy/element.h", "lib/anit...
Python
0
a57e38233679bf6d95dad533d87ce1c69c00cc26
Include process name
docker-memusage.py
docker-memusage.py
#!/usr/bin/env python from collections import OrderedDict import os.path import re def parse_mem_file(filename): data = OrderedDict() with open(filename, 'rb') as f: for line in f: splittage = line.split(':') data[splittage[0]] = splittage[1].strip() return data def get_s...
#!/usr/bin/env python from collections import OrderedDict from pprint import pprint import os.path import re import sys def parse_mem_file(filename): data = OrderedDict() with open(filename, 'rb') as f: for line in f: splittage = line.split(':') data[splittage[0]] = splittage[1...
Python
0.000002
57b707b7f7e7076f8c1f84e57ba3a3db45135340
Fix compilations for macos mountain lion
binding.gyp
binding.gyp
{ "targets": [ { "target_name": "protobuf_for_node", "include_dirs": ["protobuf/src"], "dependencies": ["protobuf/protobuf.gyp:protobuf_full_do_not_use"], "sources": [ "protobuf_for_node.cc", "addon.cc" ], 'conditions': [ [ 'OS =="mac"',{ 'xcode_settings':{ 'OTHER_CFLAGS'...
{ "targets": [ { "target_name": "protobuf_for_node", "include_dirs": ["protobuf/src"], "dependencies": ["protobuf/protobuf.gyp:protobuf_full_do_not_use"], "sources": [ "protobuf_for_node.cc", "addon.cc" ] } ] }
Python
0.000006
644fbef7030f0685be7dd056606ab23daaefdc72
Fix typo in error message variable
app/gitlab.py
app/gitlab.py
from __future__ import absolute_import from __future__ import unicode_literals from .webhooks import WebHook from werkzeug.exceptions import BadRequest, NotImplemented EVENTS = { 'Push Hook': 'push', 'Tag Push Hook': 'tag_push', 'Issue Hook': 'issue', 'Note Hook': 'note', 'Merge Request Hook': 'me...
from __future__ import absolute_import from __future__ import unicode_literals from .webhooks import WebHook from werkzeug.exceptions import BadRequest, NotImplemented EVENTS = { 'Push Hook': 'push', 'Tag Push Hook': 'tag_push', 'Issue Hook': 'issue', 'Note Hook': 'note', 'Merge Request Hook': 'me...
Python
0.000178
893b9947ef8d884ff67c84a60ea2c251b408a6d0
update build_db.py script
build_db.py
build_db.py
import json import os import sqlite3 WEEKDAYS = 0x1 SATURDAY = 0x2 SUNDAY = 0x3 def setup(conn): cursor = conn.cursor() cursor.execute( ''' CREATE TABLE IF NOT EXISTS visit ( stop_num text, visit_day_type integer, route_num integer, ho...
import json import os import sqlite3 WEEKDAYS = 0x1 SATURDAY = 0x2 SUNDAY = 0x3 def setup(conn): cursor = conn.cursor() cursor.execute( ''' CREATE TABLE IF NOT EXISTS visit ( stop_num text, visit_day_type integer, route_num integer, ho...
Python
0.000001
7f01aa6deaa9a13ca388fb4c84849bce53d34d5f
Make sure C++11 is used under Mac OS
binding.gyp
binding.gyp
{ "targets": [{ "target_name": "mmap-io", "sources": [ "src/mmap-io.cc" ], "include_dirs": [ "<!(node -e \"require('nan')\")" ], "cflags_cc": [ "-std=c++11" ], "conditions": [ [ 'OS=="mac"', { "xcode_settings...
{ "targets": [{ "target_name": "mmap-io", "sources": [ "src/mmap-io.cc" ], "include_dirs": [ "<!(node -e \"require('nan')\")" ], "cflags_cc": [ "-std=c++11" ] }] }
Python
0
6b6948b4dcf7400eefcfb2a499c0180d03052550
Remove unnecessary string formatting
sympy/matrices/expressions/dotproduct.py
sympy/matrices/expressions/dotproduct.py
from __future__ import print_function, division from sympy.core import Basic from sympy.core.sympify import _sympify from sympy.matrices.expressions.transpose import transpose from sympy.matrices.expressions.matexpr import MatrixExpr class DotProduct(MatrixExpr): """ Dot Product of vector matrices ""...
from __future__ import print_function, division from sympy.core import Basic from sympy.core.sympify import _sympify from sympy.matrices.expressions.transpose import transpose from sympy.matrices.expressions.matexpr import MatrixExpr class DotProduct(MatrixExpr): """ Dot Product of vector matrices ""...
Python
0.005099
a6dff532d75d0a63c59db0cbf800587845d587a1
add compiler flag
binding.gyp
binding.gyp
{ "targets": [ { "target_name": "addon", "sources": [ "src/addon.cc", "src/object.cc", "src/async.cc", "src/engine.cc", "src/results.cc" ], "cflags": [ "-O2", "-Wendif-labels", "-Werror", "-Wpedantic", "-Wunused-parameter", "-finline-functions", "-funswitch-lo...
{ "targets": [ { "target_name": "addon", "sources": [ "src/addon.cc", "src/object.cc", "src/async.cc", "src/engine.cc", "src/results.cc" ], "cflags": [ "-O2", "-Wendif-labels", "-Werror", "-Wpedantic", "-Wunused-parameter", "-finline-functions", "-funswitch-lo...
Python
0.000002
5e2ef9885a65d61edcdffaef9e4f8a960bef567e
Refactor CAS tests.
fridge/test/test_cas.py
fridge/test/test_cas.py
import pytest from fridge.cas import ContentAddressableStorage from fridge.fstest import ( assert_file_content_equal, assert_open_raises, write_file) from fridge.memoryfs import MemoryFS @pytest.fixture def fs(): return MemoryFS() @pytest.fixture def cas(fs): return ContentAddressableStorage('cas', fs)...
import pytest from fridge.cas import ContentAddressableStorage from fridge.memoryfs import MemoryFS class TestContentAddressableStorage(object): def create_cas(self, fs=None, path='cas'): if fs is None: fs = MemoryFS() return ContentAddressableStorage(path, fs) def has_root_prope...
Python
0
167101baa4d57d22bc6a40d7ff8afd3688e23580
fix ControlText focusout bug
pyforms/gui/Controls/ControlText.py
pyforms/gui/Controls/ControlText.py
#!/usr/bin/python # -*- coding: utf-8 -*- ''' @author: Ricardo Ribeiro @credits: Ricardo Ribeiro @license: MIT @version: 0.0 @maintainer: Ricardo Ribeiro @email: ricardojvr@gmail.com @status: Development @lastEditedBy: Carlos Mão de Ferro (carlos.maodeferro@neuro.fchampalimaud.org) ''' from pyforms.gui.Controls.Contro...
#!/usr/bin/python # -*- coding: utf-8 -*- ''' @author: Ricardo Ribeiro @credits: Ricardo Ribeiro @license: MIT @version: 0.0 @maintainer: Ricardo Ribeiro @email: ricardojvr@gmail.com @status: Development @lastEditedBy: Carlos Mão de Ferro (carlos.maodeferro@neuro.fchampalimaud.org) ''' from pyforms.gui.Controls.Contro...
Python
0
22cf663731bc556ef625695ab3213e87432ed4f9
fix docs link
pyvex/__init__.py
pyvex/__init__.py
""" PyVEX provides an interface that translates binary code into the VEX intermediate represenation (IR). For an introduction to VEX, take a look here: https://docs.angr.io/advanced-topics/ir """ __version__ = (8, 19, 4, 5) if bytes is str: raise Exception("This module is designed for python 3 only. Please instal...
""" PyVEX provides an interface that translates binary code into the VEX intermediate represenation (IR). For an introduction to VEX, take a look here: https://docs.angr.io/docs/ir.html """ __version__ = (8, 19, 4, 5) if bytes is str: raise Exception("This module is designed for python 3 only. Please install an o...
Python
0
d9a034e74bf03a5a9837201d2e358d51e759f112
add dc_aware_policy
binding.gyp
binding.gyp
{ "targets": [ { "target_name": "cassandra-native", "sources": [ "cpp-driver/src/address.cpp", "cpp-driver/src/auth.cpp", "cpp-driver/src/auth_requests.cpp", "cpp-driver/src/auth_responses.cpp", "cpp-driver/src/batch_request.cpp", "cpp-driver/src/buffer....
{ "targets": [ { "target_name": "cassandra-native", "sources": [ "cpp-driver/src/address.cpp", "cpp-driver/src/auth.cpp", "cpp-driver/src/auth_requests.cpp", "cpp-driver/src/auth_responses.cpp", "cpp-driver/src/batch_request.cpp", "cpp-driver/src/buffer....
Python
0.000039
73b66a32763b7efe36612db7f3a3b4566d8e44a2
set uid=197610(OIdiot) gid=197610 groups=197610 as primary_key instead of
app/models.py
app/models.py
from django.db import models # Create your models here. class Person(models.Model): id = models.AutoField(verbose_name = '索引', primary_key = True, unique = True) student_number = models.CharField(verbose_name = '学号', max_length = 12, unique = True) name = models.CharField(verbose_name = '姓名', max_length = 10) pi...
from django.db import models # Create your models here. class Person(models.Model): student_number = models.CharField(verbose_name = '学号', max_length = 12, unique = True, primary_key = True) name = models.CharField(verbose_name = '姓名', max_length = 10) pinyin = models.CharField(verbose_name = '拼音', max_length = 2...
Python
0.000001
68170652d104873ea4fa210daaedb05ba9bf3b44
Wrong syntax
config/gunicorn_conf.py
config/gunicorn_conf.py
import os import psutil import math GIGS_OF_MEMORY = psutil.virtual_memory().total/1024/1024/1024. NUM_CPUS = psutil.cpu_count() bind = "0.0.0.0:8000" pidfile = "/srv/newsblur/logs/gunicorn.pid" logfile = "/srv/newsblur/logs/production.log" accesslog = "/srv/newsblur/logs/production.log" errorlog = "/srv/newsblur/log...
import os import psutil import math GIGS_OF_MEMORY = psutil.virtual_memory().total/1024/1024/1024. NUM_CPUS = psutil.cpu_count() bind = "0.0.0.0:8000" pidfile = "/srv/newsblur/logs/gunicorn.pid" logfile = "/srv/newsblur/logs/production.log" accesslog = "/srv/newsblur/logs/production.log" errorlog = "/srv/newsblur/log...
Python
0.930983
c908db488f3e1d7aab0993780b38baaf4c995eb1
add docstrings
Lib/fontelemetry/datastructures/source.py
Lib/fontelemetry/datastructures/source.py
# Copyright 2019 Fontelemetry Authors and Contributors # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
# Copyright 2019 Fontelemetry Authors and Contributors # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
Python
0
0e913b3fc20e69a6ff77bafcc144e00175f8ed83
Put new classes to submodule level import
indra/assemblers/english/__init__.py
indra/assemblers/english/__init__.py
from .assembler import EnglishAssembler, AgentWithCoordinates, SentenceBuilder
from .assembler import EnglishAssembler
Python
0.000001
6566ef14ff19640c238ba935ff21643d554b4654
Fix breakage when celery is running
indico/core/celery/__init__.py
indico/core/celery/__init__.py
# This file is part of Indico. # Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN). # # Indico is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (a...
# This file is part of Indico. # Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN). # # Indico is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (a...
Python
0.000172
a8e3a0b7896403d5d9de9edf147693befc90493d
Use SSL.
securelayer/views.py
securelayer/views.py
# -*- coding: utf-8 -*- # (c) 2010-2011 Ruslan Popov <ruslan.popov@gmail.com> from django.conf import settings from django import forms from django.http import Http404 from django.utils import simplejson from django.utils.translation import ugettext_lazy as _ from django.shortcuts import redirect from securelayer.htt...
# -*- coding: utf-8 -*- # (c) 2010-2011 Ruslan Popov <ruslan.popov@gmail.com> from django.conf import settings from django import forms from django.http import Http404 from django.utils import simplejson from django.utils.translation import ugettext_lazy as _ from django.shortcuts import redirect from securelayer.htt...
Python
0
36608c6bd0035e4a78da2cd30d9fcca2c660ec3a
Add prepare in rpc client
common/numeter/queue/client.py
common/numeter/queue/client.py
from oslo import messaging from oslo.config import cfg import logging LOG = logging.getLogger(__name__) class BaseAPIClient(messaging.RPCClient): def __init__(self, transport): target = messaging.Target(topic='default_topic') super(BaseAPIClient, self).__init__(transport, target) def ping(sel...
from oslo import messaging from oslo.config import cfg import logging LOG = logging.getLogger(__name__) class BaseAPIClient(messaging.RPCClient): def __init__(self, transport): target = messaging.Target(topic='default_topic') super(BaseAPIClient, self).__init__(transport, target) def ping(sel...
Python
0
bead9f9051ca1ca9b1823547732e847dd86e1ea1
Add verbose
pysteps/advection/semilagrangian.py
pysteps/advection/semilagrangian.py
"""Implementation of the semi-Lagrangian method of Germann et al (2002). """ import numpy as np import scipy.ndimage.interpolation as ip import time def extrapolate(R, V, num_timesteps, outval=np.nan, **kwargs): """Apply semi-Lagrangian extrapolation to a two-dimensional precipitation field. Paramet...
"""Implementation of the semi-Lagrangian method of Germann et al (2002). """ import numpy as np import scipy.ndimage.interpolation as ip def extrapolate(R, V, num_timesteps, outval=np.nan, **kwargs): """Apply semi-Lagrangian extrapolation to a two-dimensional precipitation field. Parameters ----...
Python
0.999999
34a811429e2025f396f8997aeb628253487537fb
Change Sparser call pattern along with actual exec
indra/sources/sparser/sparser_api.py
indra/sources/sparser/sparser_api.py
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import os import json import logging import subprocess import xml.etree.ElementTree as ET from indra.util import UnicodeXMLTreeBuilder as UTB from .processor import SparserXMLProcessor, SparserJSONProcessor logger =...
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import os import logging import subprocess import xml.etree.ElementTree as ET from indra.util import UnicodeXMLTreeBuilder as UTB from .processor import SparserProcessor logger = logging.getLogger('sparser') sparse...
Python
0
9271eea8191a5be0fd74d9b3be72acf1f3d6a213
Store challenge, signature as str/unicode for JSON serialization
crossbar/router/auth.py
crossbar/router/auth.py
##################################################################################### # # Copyright (C) Tavendo GmbH # # Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you # have purchased a commercial license), the license terms below apply. # # Should you enter into a separate licen...
##################################################################################### # # Copyright (C) Tavendo GmbH # # Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you # have purchased a commercial license), the license terms below apply. # # Should you enter into a separate licen...
Python
0
a9365aa4a32fbe358a6f74b5730a7a3a0a8b3cda
Convert journal to pickled extra
qualia/journal.py
qualia/journal.py
import base64 import datetime import pickle import sqlite3 class Journal: def __init__(self, filename): self.db = sqlite3.connect( filename, detect_types = sqlite3.PARSE_DECLTYPES ) self.upgrade_if_needed() self.f = open(filename, 'ab') def upgrade_if_needed(self): version = self.db.execute('PRAGMA ...
import datetime import sqlite3 class Journal: def __init__(self, filename): self.db = sqlite3.connect( filename, detect_types = sqlite3.PARSE_DECLTYPES ) self.upgrade_if_needed() self.f = open(filename, 'ab') def upgrade_if_needed(self): version = self.db.execute('PRAGMA user_version').fetchone()[0]...
Python
0.999999
ce6e67890b5860d89e9c3ea6628a7a94ad9e10b3
Update Default_Settings.py
components/Default_Settings.py
components/Default_Settings.py
#Sequences of actual rotors used in WWII, format is name, sequences, turnover notch(es) rotor_sequences = { 'I': ('EKMFLGDQVZNTOWYHXUSPAIBRCJ', ('Q')), 'II': ('AJDKSIRUXBLHWTMCQGZNPYFVOE', ('E')), 'III': ('BDFHJLCPRTXVZNYEIWGAKMUSQO', ('V')), 'IV': ('ESOVPZJAYQUIRHXLNFTGKDCMWB', ('J')), 'V': ('VZ...
#Sequences of actual rotors used in WWII, format is name, sequences, turnover notch(es) rotor_sequences = { 'I': ('EKMFLGDQVZNTOWYHXUSPAIBRCJ', ('Q')), 'II': ('AJDKSIRUXBLHWTMCQGZNPYFVOE', ('E')), 'III': ('BDFHJLCPRTXVZNYEIWGAKMUSQO', ('V')), 'IV': ('ESOVPZJAYQUIRHXLNFTGKDCMWB', ('J')), 'V': ('VZ...
Python
0.000001
64bd44d4338d57a68ff07527d1d2c3b37960c63b
call parent filter, cleanup
web/impact/impact/v1/views/mentor_program_office_hour_list_view.py
web/impact/impact/v1/views/mentor_program_office_hour_list_view.py
# MIT License # Copyright (c) 2019 MassChallenge, Inc. from django.db.models import Value as V from django.db.models.functions import Concat from impact.v1.views.base_list_view import BaseListView from impact.v1.helpers import ( MentorProgramOfficeHourHelper, ) ID_FIELDS = ['mentor_id', 'finalist_id'] NAME_FIELDS...
# MIT License # Copyright (c) 2019 MassChallenge, Inc. from django.db.models import Value as V from django.db.models.functions import Concat from impact.v1.views.base_list_view import BaseListView from impact.v1.helpers import ( MentorProgramOfficeHourHelper, ) ID_FIELDS = ['mentor_id', 'finalist_id'] NAME_FIELDS...
Python
0
30e2ab7568dc00b9a8617c87269310691c19ed95
variable-length fields are initialized with a width of None
serial/core/_util.py
serial/core/_util.py
""" Private utility functions. """ from collections import namedtuple Field = namedtuple("Field", ("name", "pos", "dtype", "width")) def field_type(name, pos, dtype): """ Create a Field tuple. """ try: pos = slice(*pos) except TypeError: # pos is an int width = 1 else: ...
""" Private utility functions. """ from collections import namedtuple Field = namedtuple("Field", ("name", "pos", "dtype", "width")) def field_type(name, pos, dtype): """ Create a Field tuple. """ try: pos = slice(*pos) width = pos.stop - pos.start except TypeError: # pos is an...
Python
0.998252
abb00ac993154071776488b5dcaef32cc2982f4c
Fix broken functional tests on windows
test/functional/master/test_endpoints.py
test/functional/master/test_endpoints.py
import os import tempfile import yaml from test.framework.functional.base_functional_test_case import BaseFunctionalTestCase from test.functional.job_configs import BASIC_JOB class TestMasterEndpoints(BaseFunctionalTestCase): def setUp(self): super().setUp() self._project_dir = tempfile.Tempora...
import os import yaml from test.framework.functional.base_functional_test_case import BaseFunctionalTestCase from test.functional.job_configs import BASIC_JOB class TestMasterEndpoints(BaseFunctionalTestCase): def _start_master_only_and_post_a_new_job(self): master = self.cluster.start_master() ...
Python
0.000002
2a243c893ac8a4ddadd98f6fbb4ef5628a6d7607
Support single-ended slices on Tries
dispatch/util/trie.py
dispatch/util/trie.py
from ..constructs import Instruction class Trie(object): BUCKET_LEN = 1 BUCKET_MASK = (2**BUCKET_LEN)-1 def __init__(self): self.children = [None for _ in range(2**Trie.BUCKET_LEN)] self.value = None def __setitem__(self, key, value): assert type(value) == Instruction ...
from ..constructs import Instruction class Trie(object): BUCKET_LEN = 1 BUCKET_MASK = (2**BUCKET_LEN)-1 def __init__(self): self.children = [None for _ in range(2**Trie.BUCKET_LEN)] self.value = None def __setitem__(self, key, value): assert type(value) == Instruction ...
Python
0
8d4c7c94dba6708758732d74228e1337bd9f0b83
raise version number
yam/__init__.py
yam/__init__.py
__version__ = '0.2.2-dev' from yam.main import run from yam.commands import read_dicts
__version__ = '0.2.1' from yam.main import run from yam.commands import read_dicts
Python
0.000006
ce6a23206271f4e9a0dfd54e7a2663789d5237de
update test
accelerator_abstract/tests/test_startup_progress.py
accelerator_abstract/tests/test_startup_progress.py
from django.test import TestCase from accelerator.tests.factories import ( BusinessPropositionFactory, StartupFactory ) from accelerator.models import BusinessProposition from accelerator_abstract.models.base_startup import ( APPLICATION_READY, PROFILE_COMPLETE, ) from accelerator_abstract.models impor...
from django.test import TestCase from accelerator.tests.factories import ( BusinessPropositionFactory, StartupFactory ) from accelerator.models import BusinessProposition from accelerator_abstract.models.base_startup import ( APPLICATION_READY, PROFILE_COMPLETE, ) from accelerator_abstract.models impor...
Python
0
3ea84302368818133b045d56a0c8c798872eedd1
Add default logger and log exception
influxdb_metrics/middleware.py
influxdb_metrics/middleware.py
"""Middlewares for the influxdb_metrics app.""" from django import VERSION as DJANGO_VERSION import inspect import time import logging try: from urllib import parse except ImportError: import urlparse as parse from django.conf import settings try: from django.utils.deprecation import MiddlewareMixin excep...
"""Middlewares for the influxdb_metrics app.""" from django import VERSION as DJANGO_VERSION import inspect import time try: from urllib import parse except ImportError: import urlparse as parse from django.conf import settings try: from django.utils.deprecation import MiddlewareMixin except ImportError: ...
Python
0
71d0f02e1274829a302cdd6f716f2fc0680cce49
Update fab.py
ydcommon/fab.py
ydcommon/fab.py
from fabric.api import local, sudo, run from fabric.operations import prompt from fabric.colors import red from fabric.contrib.console import confirm def get_branch_name(on_local=True): cmd = "git branch --no-color 2> /dev/null | sed -e '/^[^*]/d'" if on_local: name = local(cmd, capture=True).replace(...
from fabric.api import local, sudo, run from fabric.operations import prompt from fabric.colors import red from fabric.contrib.console import confirm def get_branch_name(on_local=True): cmd = "git branch --no-color 2> /dev/null | sed -e '/^[^*]/d'" if on_local: name = local(cmd, capture=True).replace(...
Python
0
95aa4c210c735bd9ac74a65cdbef418d99beb319
Bump to v0.2.0
sii/__init__.py
sii/__init__.py
# -*- coding: utf-8 -*- __LIBRARY_VERSION__ = '0.2.0' __SII_VERSION__ = '0.7'
# -*- coding: utf-8 -*- __LIBRARY_VERSION__ = '0.1.0alpha' __SII_VERSION__ = '0.7'
Python
0.000001
c273fa5ba0ae43cc5979f1076349edf737a67710
Add reserved words to custom data field validation
corehq/apps/custom_data_fields/models.py
corehq/apps/custom_data_fields/models.py
from dimagi.ext.couchdbkit import (Document, StringProperty, BooleanProperty, SchemaListProperty, StringListProperty) from dimagi.ext.jsonobject import JsonObject from django.core.exceptions import ValidationError from django.utils.translation import ugettext as _ from .dbaccessors import * CUSTOM_DATA_FIELD_PRE...
from dimagi.ext.couchdbkit import (Document, StringProperty, BooleanProperty, SchemaListProperty, StringListProperty) from dimagi.ext.jsonobject import JsonObject from django.core.exceptions import ValidationError from django.utils.translation import ugettext as _ from .dbaccessors import * CUSTOM_DATA_FIELD_PRE...
Python
0
510e04dfd68eeca2e940487eeca9e7474e7f2383
Fix methodcheck.py for the new API documentation style (split into subsections)
linode/methodcheck.py
linode/methodcheck.py
#!/usr/bin/python """ A quick script to verify that api.py is in sync with Linode's published list of methods. Copyright (c) 2010 Josh Wright <jshwright@gmail.com> Copyright (c) 2009 Ryan Tucker <rtucker@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and assoc...
#!/usr/bin/python """ A quick script to verify that api.py is in sync with Linode's published list of methods. Copyright (c) 2010 Josh Wright <jshwright@gmail.com> Copyright (c) 2009 Ryan Tucker <rtucker@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and assoc...
Python
0