commit
stringlengths
40
40
old_file
stringlengths
5
117
new_file
stringlengths
5
117
old_contents
stringlengths
0
1.93k
new_contents
stringlengths
19
3.3k
subject
stringlengths
17
320
message
stringlengths
18
3.28k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
7
42.4k
completion
stringlengths
152
6.66k
prompt
stringlengths
21
3.65k
0748838525cb2c2ee838da3a3e906ebf8dd25a3b
setup.py
setup.py
from setuptools import setup import curtsies setup(name='curtsies', version=curtsies.__version__, description='Curses-like terminal wrapper, with colored strings!', url='https://github.com/thomasballinger/curtsies', author='Thomas Ballinger', author_email='thomasballinger@gmail.com', ...
from setuptools import setup import ast import os def version(): """Return version string.""" with open(os.path.join('curtsies', '__init__.py')) as input_file: for line in input_file: if line.startswith('__version__'): return ast.parse(line).body[0].value.s setup(name='curt...
Fix installation, broken since started doing import in __init__
Fix installation, broken since started doing import in __init__ Thanks @myint for the catch and code suggestion
Python
mit
sebastinas/curtsies,thomasballinger/curtsies,spthaolt/curtsies
<REPLACE_OLD> curtsies setup(name='curtsies', version=curtsies.__version__, <REPLACE_NEW> ast import os def version(): """Return version string.""" with open(os.path.join('curtsies', '__init__.py')) as input_file: for line in input_file: if line.startswith('__version__'): ...
Fix installation, broken since started doing import in __init__ Thanks @myint for the catch and code suggestion from setuptools import setup import curtsies setup(name='curtsies', version=curtsies.__version__, description='Curses-like terminal wrapper, with colored strings!', url='https://github.co...
ee85d2fffc0e42022be66bf667005eb44391cb9e
django/similarities/utils.py
django/similarities/utils.py
import echonest from artists.models import Artist from echonest.models import SimilarResponse from users.models import User from .models import (GeneralArtist, UserSimilarity, Similarity, update_similarities) def add_new_similarities(artist, force_update=False): similarities = [] response...
from django.db.models import Q import echonest from artists.models import Artist from echonest.models import SimilarResponse from users.models import User from .models import (GeneralArtist, UserSimilarity, Similarity, update_similarities) def add_new_similarities(artist, force_update=False): ...
Order similar artist results properly
Order similar artist results properly
Python
bsd-3-clause
FreeMusicNinja/freemusic.ninja,FreeMusicNinja/freemusic.ninja
<REPLACE_OLD> import <REPLACE_NEW> from django.db.models import Q import <REPLACE_END> <INSERT> similar = Q(similarity__other_artist=artist, similarity__weight__gt=0) <INSERT_END> <REPLACE_OLD> Artist.objects.filter(similarity__other_artist=artist, similarity__weight__gt=0) <REPLA...
Order similar artist results properly import echonest from artists.models import Artist from echonest.models import SimilarResponse from users.models import User from .models import (GeneralArtist, UserSimilarity, Similarity, update_similarities) def add_new_similarities(artist, force_update=Fal...
041123e7348cf05dd1432d8550cc497a1995351d
setup.py
setup.py
try: from setuptools import setup except ImportError: from distutils.core import setup import os.path ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) README_FILE = os.path.join(ROOT_DIR, "README.rst") with open(README_FILE) as f: long_description = f.read() setup( name="xutils", version="0...
try: from setuptools import setup except ImportError: from distutils.core import setup import os.path ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) README_FILE = os.path.join(ROOT_DIR, "README.rst") with open(README_FILE) as f: long_description = f.read() setup( name="xutils", version="0...
Set the version to 0.9
Set the version to 0.9
Python
mit
xgfone/xutils,xgfone/pycom
<REPLACE_OLD> version="0.8.2", <REPLACE_NEW> version="0.9", <REPLACE_END> <|endoftext|> try: from setuptools import setup except ImportError: from distutils.core import setup import os.path ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) README_FILE = os.path.join(ROOT_DIR, "README.rst") with open(RE...
Set the version to 0.9 try: from setuptools import setup except ImportError: from distutils.core import setup import os.path ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) README_FILE = os.path.join(ROOT_DIR, "README.rst") with open(README_FILE) as f: long_description = f.read() setup( name=...
7be606951b22d77a53274d014cd94aae30af93f5
samples/oauth2_for_devices.py
samples/oauth2_for_devices.py
# -*- coding: utf-8 -*- # See: https://developers.google.com/accounts/docs/OAuth2ForDevices import httplib2 from six.moves import input from oauth2client.client import OAuth2WebServerFlow from googleapiclient.discovery import build CLIENT_ID = "some+client+id" CLIENT_SECRET = "some+client+secret" SCOPES = ("https:/...
# -*- coding: utf-8 -*- # See: https://developers.google.com/accounts/docs/OAuth2ForDevices import httplib2 from six.moves import input from oauth2client.client import OAuth2WebServerFlow from googleapiclient.discovery import build CLIENT_ID = "some+client+id" CLIENT_SECRET = "some+client+secret" SCOPES = ("https:/...
Fix example to be Python3 compatible, use format()
Fix example to be Python3 compatible, use format() Both print() and format() are compatible from 2.6. Also, format() is much nicer to use for internationalization since you can define the location of your substitutions. It works similarly to Java and .net's format() as well. Great stuff! Should I tackle the other e...
Python
apache-2.0
googleapis/oauth2client,jonparrott/oauth2client,google/oauth2client,jonparrott/oauth2client,clancychilds/oauth2client,googleapis/oauth2client,google/oauth2client,clancychilds/oauth2client
<REPLACE_OLD> flow.step1_get_device_and_user_codes() print "Enter <REPLACE_NEW> flow.step1_get_device_and_user_codes() print("Enter <REPLACE_END> <REPLACE_OLD> %s: %s" % (flow_info.verification_url, <REPLACE_NEW> {0}: {1}".format(flow_info.verification_url, <REPLACE_END> <REPLACE_OLD> flow_info.user_code) print "Then...
Fix example to be Python3 compatible, use format() Both print() and format() are compatible from 2.6. Also, format() is much nicer to use for internationalization since you can define the location of your substitutions. It works similarly to Java and .net's format() as well. Great stuff! Should I tackle the other e...
04182bff7a097b8842073f96bac834abb34f7118
setup.py
setup.py
from setuptools import setup, find_packages long_description = ( open('README.rst').read() + '\n' + open('CHANGES.txt').read()) setup( name='more.static', version='0.10.dev0', description="BowerStatic integration for Morepath", long_description=long_description, author="Martijn Faassen...
import io from setuptools import setup, find_packages long_description = '\n'.join(( io.open('README.rst', encoding='utf-8').read(), io.open('CHANGES.txt', encoding='utf-8').read() )) setup( name='more.static', version='0.10.dev0', description="BowerStatic integration for Morepath", long_descr...
Use io.open with encoding='utf-8' and flake8 compliance
Use io.open with encoding='utf-8' and flake8 compliance
Python
bsd-3-clause
morepath/more.static
<REPLACE_OLD> from <REPLACE_NEW> import io from <REPLACE_END> <REPLACE_OLD> ( <REPLACE_NEW> '\n'.join(( <REPLACE_END> <REPLACE_OLD> open('README.rst').read() <REPLACE_NEW> io.open('README.rst', encoding='utf-8').read(), <REPLACE_END> <REPLACE_OLD> + '\n' + open('CHANGES.txt').read()) setup( <REPLACE_NEW> io.o...
Use io.open with encoding='utf-8' and flake8 compliance from setuptools import setup, find_packages long_description = ( open('README.rst').read() + '\n' + open('CHANGES.txt').read()) setup( name='more.static', version='0.10.dev0', description="BowerStatic integration for Morepath", long_...
4a817aff14ca6bc9717bd617d5bc49d15e698272
teuthology/orchestra/test/test_console.py
teuthology/orchestra/test/test_console.py
from teuthology.config import config as teuth_config from .. import console class TestConsole(object): pass class TestPhysicalConsole(TestConsole): klass = console.PhysicalConsole def setup(self): teuth_config.ipmi_domain = 'ipmi_domain' teuth_config.ipmi_user = 'ipmi_user' teu...
Add some tests for the console module
Add some tests for the console module ... better late than never? Signed-off-by: Zack Cerza <d7cdf09fc0f0426e98c9978ee42da5d61fa54986@redhat.com>
Python
mit
ceph/teuthology,dmick/teuthology,SUSE/teuthology,dmick/teuthology,SUSE/teuthology,ktdreyer/teuthology,dmick/teuthology,ktdreyer/teuthology,ceph/teuthology,SUSE/teuthology
<REPLACE_OLD> <REPLACE_NEW> from teuthology.config import config as teuth_config from .. import console class TestConsole(object): pass class TestPhysicalConsole(TestConsole): klass = console.PhysicalConsole def setup(self): teuth_config.ipmi_domain = 'ipmi_domain' teuth_config.ipmi_u...
Add some tests for the console module ... better late than never? Signed-off-by: Zack Cerza <d7cdf09fc0f0426e98c9978ee42da5d61fa54986@redhat.com>
c41115875ce46be3eacc1ec7c539010b430b0374
kegg_adapter/kegg.py
kegg_adapter/kegg.py
import urllib2 import json #response = urllib2.urlopen('http://rest.kegg.jp/list/pathway/ath') #html = response.read() #lines = html.split('\n'); #data = {}; #for line in lines: # parts = line.split('\t'); # if len(parts) >= 2: # data[parts[0]] = parts[1] #json_data = json.dumps(data) #print json_data ...
import urllib2 import json #response = urllib2.urlopen('http://rest.kegg.jp/list/pathway/ath') #html = response.read() #lines = html.split('\n'); #data = {}; #for line in lines: # parts = line.split('\t'); # if len(parts) >= 2: # data[parts[0]] = parts[1] #json_data = json.dumps(data) #print json_data ...
Remove debugging print statements changed exit status from 1 to 0
Remove debugging print statements changed exit status from 1 to 0
Python
artistic-2.0
Arabidopsis-Information-Portal/Intern-Hello-World,Arabidopsis-Information-Portal/KEGG-Pathway-API
<REPLACE_OLD> exit(1); <REPLACE_NEW> exit(0); <REPLACE_END> <REPLACE_OLD> exit(1); <REPLACE_NEW> exit(0); <REPLACE_END> <DELETE> print "jsonizing" <DELETE_END> <|endoftext|> import urllib2 import json #response = urllib2.urlopen('http://rest.kegg.jp/list/pathway/ath') #html = response.read() #lines = htm...
Remove debugging print statements changed exit status from 1 to 0 import urllib2 import json #response = urllib2.urlopen('http://rest.kegg.jp/list/pathway/ath') #html = response.read() #lines = html.split('\n'); #data = {}; #for line in lines: # parts = line.split('\t'); # if len(parts) >= 2: # data[par...
6358f3fb8a3ece53adeb71f9b59f96a5a3a9ca70
examples/system/ulp_adc/example_test.py
examples/system/ulp_adc/example_test.py
from __future__ import unicode_literals from tiny_test_fw import Utility import re import ttfw_idf @ttfw_idf.idf_example_test(env_tag='Example_GENERIC') def test_examples_ulp_adc(env, extra_data): dut = env.get_dut('ulp_adc', 'examples/system/ulp_adc') dut.start_app() dut.expect_all('Not ULP wakeup', ...
from __future__ import unicode_literals from tiny_test_fw import Utility import re import ttfw_idf @ttfw_idf.idf_example_test(env_tag='Example_GENERIC') def test_examples_ulp_adc(env, extra_data): dut = env.get_dut('ulp_adc', 'examples/system/ulp_adc') dut.start_app() dut.expect_all('Not ULP wakeup', ...
Fix regex in ulp_adc example test
CI: Fix regex in ulp_adc example test
Python
apache-2.0
espressif/esp-idf,espressif/esp-idf,espressif/esp-idf,espressif/esp-idf
<REPLACE_OLD> measurements = int(dut.expect(re.compile(r'ULP <REPLACE_NEW> measurements_str = dut.expect(re.compile(r'ULP <REPLACE_END> <REPLACE_OLD> timeout=5)[0], 10) <REPLACE_NEW> timeout=5)[0] assert measurements_str is not None measurements = int(measurements_str) <REPLACE_END> <INSERT> value_str...
CI: Fix regex in ulp_adc example test from __future__ import unicode_literals from tiny_test_fw import Utility import re import ttfw_idf @ttfw_idf.idf_example_test(env_tag='Example_GENERIC') def test_examples_ulp_adc(env, extra_data): dut = env.get_dut('ulp_adc', 'examples/system/ulp_adc') dut.start_app() ...
a565235303e1f2572ed34490e25c7e0f31aba74c
turngeneration/serializers.py
turngeneration/serializers.py
from django.contrib.contenttypes.models import ContentType from rest_framework import serializers from . import models class ContentTypeField(serializers.Field): def to_representation(self, obj): ct = ContentType.objects.get_for_model(obj) return u'{ct.app_label}.{ct.model}'.format(ct=ct) de...
from django.contrib.contenttypes.models import ContentType from rest_framework import serializers from . import models class ContentTypeField(serializers.Field): def to_representation(self, value): return u'{value.app_label}.{value.model}'.format(value=value) def to_internal_value(self, data): ...
Support nested generator inside the realm.
Support nested generator inside the realm.
Python
mit
jbradberry/django-turn-generation,jbradberry/django-turn-generation
<INSERT> value): return u'{value.app_label}.{value.model}'.format(value=value) def to_internal_value(self, data): app_label, model = data.split('.') return ContentType.objects.get_by_natural_key(app_label, model) class ReadOnlyDefault(object): def set_context(self, serializer_field): ...
Support nested generator inside the realm. from django.contrib.contenttypes.models import ContentType from rest_framework import serializers from . import models class ContentTypeField(serializers.Field): def to_representation(self, obj): ct = ContentType.objects.get_for_model(obj) return u'{ct....
7531ed0c9ae25f04884250c84b39a630ae7ef34b
raiden/storage/migrations/v20_to_v21.py
raiden/storage/migrations/v20_to_v21.py
import json from raiden.storage.sqlite import SQLiteStorage SOURCE_VERSION = 20 TARGET_VERSION = 21 def _transform_snapshot(raw_snapshot: str) -> str: snapshot = json.loads(raw_snapshot) for task in snapshot['payment_mapping']['secrethashes_to_task'].values(): if 'raiden.transfer.state.InitiatorTas...
Move migration 21 to it's proper file
Move migration 21 to it's proper file
Python
mit
hackaugusto/raiden,hackaugusto/raiden
<REPLACE_OLD> <REPLACE_NEW> import json from raiden.storage.sqlite import SQLiteStorage SOURCE_VERSION = 20 TARGET_VERSION = 21 def _transform_snapshot(raw_snapshot: str) -> str: snapshot = json.loads(raw_snapshot) for task in snapshot['payment_mapping']['secrethashes_to_task'].values(): if 'raide...
Move migration 21 to it's proper file
5545bd1df34e6d3bb600b78b92d757ea12e3861b
printer/PlatformPhysicsOperation.py
printer/PlatformPhysicsOperation.py
from UM.Operations.Operation import Operation from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation from UM.Operations.TranslateOperation import TranslateOperation ## A specialised operation designed specifically to modify the previous operation. class PlatformPhysicsOperation(Operation): def __in...
from UM.Operations.Operation import Operation from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation from UM.Operations.TranslateOperation import TranslateOperation from UM.Operations.GroupedOperation import GroupedOperation ## A specialised operation designed specifically to modify the previous operat...
Use GroupedOperation for merging PlatformPhyisicsOperation
Use GroupedOperation for merging PlatformPhyisicsOperation
Python
agpl-3.0
onitake/Uranium,onitake/Uranium
<REPLACE_OLD> TranslateOperation ## <REPLACE_NEW> TranslateOperation from UM.Operations.GroupedOperation import GroupedOperation ## <REPLACE_END> <REPLACE_OLD> self._translation <REPLACE_NEW> self._transform <REPLACE_END> <REPLACE_OLD> translation <REPLACE_NEW> node.getLocalTransformation() self._position =...
Use GroupedOperation for merging PlatformPhyisicsOperation from UM.Operations.Operation import Operation from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation from UM.Operations.TranslateOperation import TranslateOperation ## A specialised operation designed specifically to modify the previous operat...
b1963f00e5290c11654eefbd24fbce185bbcd8b4
packages/Preferences/define.py
packages/Preferences/define.py
import os _CURRENTPATH = os.path.dirname(os.path.realpath(__file__)) preferencesIconPath = os.path.join(_CURRENTPATH, 'static', 'gear.svg') preferencesUIPath = os.path.join(_CURRENTPATH, 'ui', 'preferences.ui') version = '0.1.0'
import os _CURRENTPATH = os.path.dirname(os.path.realpath(__file__)) config_name = 'mantle_config.ini' preferencesIconPath = os.path.join(_CURRENTPATH, 'static', 'gear.svg') preferencesUIPath = os.path.join(_CURRENTPATH, 'ui', 'preferences.ui') version = '0.1.0'
Add config ini file name.
Add config ini file name.
Python
mit
takavfx/Mantle
<REPLACE_OLD> os.path.dirname(os.path.realpath(__file__)) preferencesIconPath <REPLACE_NEW> os.path.dirname(os.path.realpath(__file__)) config_name = 'mantle_config.ini' preferencesIconPath <REPLACE_END> <|endoftext|> import os _CURRENTPATH = os.path.dirname(os.path.realpath(__file__)) config_name = 'mantle_config...
Add config ini file name. import os _CURRENTPATH = os.path.dirname(os.path.realpath(__file__)) preferencesIconPath = os.path.join(_CURRENTPATH, 'static', 'gear.svg') preferencesUIPath = os.path.join(_CURRENTPATH, 'ui', 'preferences.ui') version = '0.1.0'
567e12bfb8d0f4e2a4f6fddf0fab9ffbcbf6d49f
requests/_bug.py
requests/_bug.py
"""Module containing bug report helper(s).""" from __future__ import print_function import json import platform import sys import ssl from . import __version__ as requests_version try: from .packages.urllib3.contrib import pyopenssl except ImportError: pyopenssl = None OpenSSL = None cryptography = N...
Add debugging submodule for bug reporters
Add debugging submodule for bug reporters The suggested usage in a bug report would be python -c 'from requests import _bug; _bug.print_information()' This should generate most of the information we tend to ask for repeatedly from bug reporters.
Python
apache-2.0
psf/requests
<REPLACE_OLD> <REPLACE_NEW> """Module containing bug report helper(s).""" from __future__ import print_function import json import platform import sys import ssl from . import __version__ as requests_version try: from .packages.urllib3.contrib import pyopenssl except ImportError: pyopenssl = None OpenSS...
Add debugging submodule for bug reporters The suggested usage in a bug report would be python -c 'from requests import _bug; _bug.print_information()' This should generate most of the information we tend to ask for repeatedly from bug reporters.
e561c1354d2f9a550f2b27bb88d8e4d0f3f76203
common/djangoapps/student/management/commands/recover_truncated_anonymous_ids.py
common/djangoapps/student/management/commands/recover_truncated_anonymous_ids.py
""" Generate sql commands to fix truncated anonymous student ids in the ORA database """ import sys from django.core.management.base import NoArgsCommand from student.models import AnonymousUserId, anonymous_id_for_user class Command(NoArgsCommand): help = __doc__ def handle_noargs(self, **options): ...
Add managemant command to generate sql to clean up tp truncated student ids in ORA db
Add managemant command to generate sql to clean up tp truncated student ids in ORA db
Python
agpl-3.0
openfun/edx-platform,synergeticsedx/deployment-wipro,shashank971/edx-platform,bigdatauniversity/edx-platform,shabab12/edx-platform,philanthropy-u/edx-platform,openfun/edx-platform,motion2015/edx-platform,ubc/edx-platform,jolyonb/edx-platform,cognitiveclass/edx-platform,ferabra/edx-platform,jswope00/griffinx,proversity-...
<REPLACE_OLD> <REPLACE_NEW> """ Generate sql commands to fix truncated anonymous student ids in the ORA database """ import sys from django.core.management.base import NoArgsCommand from student.models import AnonymousUserId, anonymous_id_for_user class Command(NoArgsCommand): help = __doc__ def handle_no...
Add managemant command to generate sql to clean up tp truncated student ids in ORA db
52189e2161e92b36df47a04c2150dff38f81f5e9
tests/unit/tests/test_activations.py
tests/unit/tests/test_activations.py
from unittest import mock from django.test import TestCase from viewflow import activation, flow from viewflow.models import Task class TestActivations(TestCase): def test_start_activation_lifecycle(self): flow_task_mock = mock.Mock(spec=flow.Start()) act = activation.StartActivation() a...
Add mocked tests for activation
Add mocked tests for activation
Python
agpl-3.0
pombredanne/viewflow,ribeiro-ucl/viewflow,codingjoe/viewflow,codingjoe/viewflow,pombredanne/viewflow,viewflow/viewflow,viewflow/viewflow,viewflow/viewflow,ribeiro-ucl/viewflow,codingjoe/viewflow,ribeiro-ucl/viewflow
<REPLACE_OLD> <REPLACE_NEW> from unittest import mock from django.test import TestCase from viewflow import activation, flow from viewflow.models import Task class TestActivations(TestCase): def test_start_activation_lifecycle(self): flow_task_mock = mock.Mock(spec=flow.Start()) act = activatio...
Add mocked tests for activation
c78c4b4bd56453fe1f3a7db71222c12336c2dcf5
future/tests/test_str_is_unicode.py
future/tests/test_str_is_unicode.py
from __future__ import absolute_import from future import str_is_unicode import unittest class TestIterators(unittest.TestCase): def test_str(self): self.assertIsNot(str, bytes) # Py2: assertIsNot only in 2.7 self.assertEqual(str('blah'), u'blah') # Py3.3 and Py2 only unittest.main()...
Add tests for str_is_unicode module
Add tests for str_is_unicode module
Python
mit
michaelpacer/python-future,michaelpacer/python-future,krischer/python-future,QuLogic/python-future,QuLogic/python-future,PythonCharmers/python-future,PythonCharmers/python-future,krischer/python-future
<INSERT> from __future__ import absolute_import from future import str_is_unicode import unittest class TestIterators(unittest.TestCase): <INSERT_END> <INSERT> def test_str(self): self.assertIsNot(str, bytes) # Py2: assertIsNot only in 2.7 self.assertEqual(str('blah'), u'blah') # Py3.3...
Add tests for str_is_unicode module
83e0394dc837e55a3ed544e54f6e84954f9311b0
onepercentclub/settings/travis.py
onepercentclub/settings/travis.py
# TODO: not sure why but we need to include the SECRET_KEY here - importing from the test_runner file doesn't work SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' from .test_runner import * # Use firefox for running tests on Travis SELENIUM_WEBDRIVER = 'firefox' ROOT_URLCONF = 'onepercentclu...
# TODO: not sure why but we need to include the SECRET_KEY here - importing from the test_runner file doesn't work SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' from .test_runner import * # Use firefox for running tests on Travis SELENIUM_WEBDRIVER = 'remote' SELENIUM_TESTS = False ROOT_UR...
Disable front end tests on Travis for now.
Disable front end tests on Travis for now.
Python
bsd-3-clause
onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site
<REPLACE_OLD> 'firefox' ROOT_URLCONF <REPLACE_NEW> 'remote' SELENIUM_TESTS = False ROOT_URLCONF <REPLACE_END> <|endoftext|> # TODO: not sure why but we need to include the SECRET_KEY here - importing from the test_runner file doesn't work SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' from ....
Disable front end tests on Travis for now. # TODO: not sure why but we need to include the SECRET_KEY here - importing from the test_runner file doesn't work SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' from .test_runner import * # Use firefox for running tests on Travis SELENIUM_WEBDRIVE...
1c397202b6df7b62cbd22509ee7cc366c2c09d6c
setup.py
setup.py
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='debexpo', version="", #description='', #author='', #author_email='', #url='', install_requires=[...
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='debexpo', version="", #description='', #author='', #author_email='', #url='', install_requires=[...
Make library dependencies python-debian a bit more sane
Make library dependencies python-debian a bit more sane
Python
mit
jadonk/debexpo,jonnylamb/debexpo,jadonk/debexpo,jonnylamb/debexpo,swvist/Debexpo,jadonk/debexpo,swvist/Debexpo,swvist/Debexpo,jonnylamb/debexpo
<REPLACE_OLD> "python-debian==0.1.16", <REPLACE_NEW> "python-debian>=0.1.16", <REPLACE_END> <|endoftext|> try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='debexpo', ...
Make library dependencies python-debian a bit more sane try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='debexpo', version="", #description='', #author='', ...
78821f2df84bbb822e076fb1591dfccc09bcb43c
cpm_data/migrations/0004_add_seasons_data.py
cpm_data/migrations/0004_add_seasons_data.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-08-27 22:21 from __future__ import unicode_literals from django.db import migrations def _get_seasons(): return '2012 2013 2014 2015 2016 2017'.split() def add_seasons(apps, schema_editor): Season = apps.get_model('cpm_data.Season') Season.ob...
Add migrations for adding seasons
Add migrations for adding seasons
Python
unlicense
kinaklub/next.filmfest.by,nott/next.filmfest.by,nott/next.filmfest.by,nott/next.filmfest.by,kinaklub/next.filmfest.by,kinaklub/next.filmfest.by,kinaklub/next.filmfest.by,nott/next.filmfest.by
<INSERT> # -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-08-27 22:21 from __future__ import unicode_literals from django.db import migrations def _get_seasons(): <INSERT_END> <INSERT> return '2012 2013 2014 2015 2016 2017'.split() def add_seasons(apps, schema_editor): Season = apps.get_model('cp...
Add migrations for adding seasons
5e9c6c527902fd8361391f111a88a8f4b4ce71df
aospy/proj.py
aospy/proj.py
"""proj.py: aospy.Proj class for organizing work in single project.""" import time from .utils import dict_name_keys class Proj(object): """Project parameters: models, regions, directories, etc.""" def __init__(self, name, vars={}, models={}, default_models={}, regions={}, direc_out='', nc_d...
"""proj.py: aospy.Proj class for organizing work in single project.""" import time from .utils import dict_name_keys class Proj(object): """Project parameters: models, regions, directories, etc.""" def __init__(self, name, vars={}, models={}, default_models={}, regions={}, direc_out='', nc_d...
Delete unnecessary vars attr of Proj
Delete unnecessary vars attr of Proj
Python
apache-2.0
spencerkclark/aospy,spencerahill/aospy
<DELETE> self.vars = dict_name_keys(vars) <DELETE_END> <REPLACE_OLD> (self.vars, self.models, <REPLACE_NEW> (self.models, <REPLACE_END> <|endoftext|> """proj.py: aospy.Proj class for organizing work in single project.""" import time from .utils import dict_name_keys class Proj(object): """Project paramet...
Delete unnecessary vars attr of Proj """proj.py: aospy.Proj class for organizing work in single project.""" import time from .utils import dict_name_keys class Proj(object): """Project parameters: models, regions, directories, etc.""" def __init__(self, name, vars={}, models={}, default_models={}, regions={...
cb08d632fac453403bc8b91391b14669dbe932cc
circonus/__init__.py
circonus/__init__.py
from __future__ import absolute_import __title__ = "circonus" __version__ = "0.0.0" from logging import NullHandler import logging from circonus.client import CirconusClient logging.getLogger(__name__).addHandler(NullHandler())
__title__ = "circonus" __version__ = "0.0.0" from logging import NullHandler import logging from circonus.client import CirconusClient logging.getLogger(__name__).addHandler(NullHandler())
Remove unnecessary absolute import statement.
Remove unnecessary absolute import statement.
Python
mit
monetate/circonus,monetate/circonus
<REPLACE_OLD> from __future__ import absolute_import __title__ <REPLACE_NEW> __title__ <REPLACE_END> <|endoftext|> __title__ = "circonus" __version__ = "0.0.0" from logging import NullHandler import logging from circonus.client import CirconusClient logging.getLogger(__name__).addHandler(NullHandler())
Remove unnecessary absolute import statement. from __future__ import absolute_import __title__ = "circonus" __version__ = "0.0.0" from logging import NullHandler import logging from circonus.client import CirconusClient logging.getLogger(__name__).addHandler(NullHandler())
14d223068e2d8963dfe1f4e71854e9ea9c194bc5
Datasnakes/Tools/sge/qsubber.py
Datasnakes/Tools/sge/qsubber.py
import argparse import textwrap from qstat import Qstat __author__ = 'Datasnakes' parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, description=textwrap.dedent('''\ This is a command line wrapper for the SGE module. ...
Set up shell argparser for sge module
Set up shell argparser for sge module
Python
mit
datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts
<INSERT> import argparse import textwrap from qstat import Qstat __author__ = 'Datasnakes' parser = argparse.ArgumentParser( <INSERT_END> <INSERT> formatter_class=argparse.RawDescriptionHelpFormatter, description=textwrap.dedent('''\ This is a command line wrapper fo...
Set up shell argparser for sge module
59927047347b7db3f46ab99152d2d99f60039043
trac/versioncontrol/web_ui/__init__.py
trac/versioncontrol/web_ui/__init__.py
from trac.versioncontrol.web_ui.browser import * from trac.versioncontrol.web_ui.changeset import * from trac.versioncontrol.web_ui.log import *
from trac.versioncontrol.web_ui.browser import * from trac.versioncontrol.web_ui.changeset import * from trac.versioncontrol.web_ui.log import *
Add missing `svn:eol-style : native` prop, which prevented making clean patches against the early 0.9b1 archives (now both the .zip and the .tar.gz have CRLFs for this file)
Add missing `svn:eol-style : native` prop, which prevented making clean patches against the early 0.9b1 archives (now both the .zip and the .tar.gz have CRLFs for this file) git-svn-id: eda3d06fcef731589ace1b284159cead3416df9b@2214 af82e41b-90c4-0310-8c96-b1721e28e2e2
Python
bsd-3-clause
jun66j5/trac-ja,walty8/trac,netjunki/trac-Pygit2,jun66j5/trac-ja,jun66j5/trac-ja,walty8/trac,walty8/trac,jun66j5/trac-ja,walty8/trac,netjunki/trac-Pygit2,netjunki/trac-Pygit2
<REPLACE_OLD> * from <REPLACE_NEW> * from <REPLACE_END> <REPLACE_OLD> * from <REPLACE_NEW> * from <REPLACE_END> <REPLACE_OLD> * <REPLACE_NEW> * <REPLACE_END> <|endoftext|> from trac.versioncontrol.web_ui.browser import * from trac.versioncontrol.web_ui.changeset import * from trac.versioncontrol.web_ui.log import ...
Add missing `svn:eol-style : native` prop, which prevented making clean patches against the early 0.9b1 archives (now both the .zip and the .tar.gz have CRLFs for this file) git-svn-id: eda3d06fcef731589ace1b284159cead3416df9b@2214 af82e41b-90c4-0310-8c96-b1721e28e2e2 from trac.versioncontrol.web_ui.browser import * ...
f2506c07caf66b3ad42f6f1c09325097edd2e169
src/django_healthchecks/contrib.py
src/django_healthchecks/contrib.py
import uuid from django.core.cache import cache from django.db import connection def check_database(): """Check if the application can perform a dummy sql query""" cursor = connection.cursor() cursor.execute('SELECT 1; -- Healthcheck') row = cursor.fetchone() return row[0] == 1 def check_cache_...
import uuid from django.core.cache import cache from django.db import connection def check_database(): """Check if the application can perform a dummy sql query""" with connection.cursor() as cursor: cursor.execute('SELECT 1; -- Healthcheck') row = cursor.fetchone() return row[0] == 1 d...
Make sure the cursor is properly closed after usage
Make sure the cursor is properly closed after usage
Python
mit
mvantellingen/django-healthchecks
<REPLACE_OLD> cursor = connection.cursor() <REPLACE_NEW> with connection.cursor() as cursor: <REPLACE_END> <INSERT> <INSERT_END> <|endoftext|> import uuid from django.core.cache import cache from django.db import connection def check_database(): """Check if the application can perform a dummy sql query...
Make sure the cursor is properly closed after usage import uuid from django.core.cache import cache from django.db import connection def check_database(): """Check if the application can perform a dummy sql query""" cursor = connection.cursor() cursor.execute('SELECT 1; -- Healthcheck') row = cursor...
54a345eb96bce8c3035b402ce009b1e3fda46a42
quran_text/serializers.py
quran_text/serializers.py
from rest_framework import serializers from .models import Sura, Ayah class SuraSerializer(serializers.ModelSerializer): class Meta: model = Sura fields = ['index', 'name'] class AyahSerializer(serializers.ModelSerializer): class Meta: model = Ayah fields = ['sura', 'numbe...
from rest_framework import serializers from .models import Sura, Ayah class SuraSerializer(serializers.ModelSerializer): class Meta: model = Sura fields = ['index', 'name'] class AyahSerializer(serializers.ModelSerializer): sura_id = serializers.IntegerField(source='sura.pk') sura_name...
Change label and add Sura name to Ayah Serlialzer
Change label and add Sura name to Ayah Serlialzer
Python
mit
EmadMokhtar/tafseer_api
<REPLACE_OLD> AyahSerializer(serializers.ModelSerializer): <REPLACE_NEW> AyahSerializer(serializers.ModelSerializer): sura_id = serializers.IntegerField(source='sura.pk') sura_name = serializers.CharField(source='sura.name') ayah_number = serializers.IntegerField(source='number') <REPLACE_END> <REPLACE_...
Change label and add Sura name to Ayah Serlialzer from rest_framework import serializers from .models import Sura, Ayah class SuraSerializer(serializers.ModelSerializer): class Meta: model = Sura fields = ['index', 'name'] class AyahSerializer(serializers.ModelSerializer): class Meta: ...
e68b8146c6ae509489fde97faf10d5748904a20c
sentrylogs/helpers.py
sentrylogs/helpers.py
""" Helper functions for Sentry Logs """ from sentry_sdk import capture_message, configure_scope from .conf.settings import SENTRY_LOG_LEVEL, SENTRY_LOG_LEVELS def send_message(message, level, data): """Send a message to the Sentry server""" # Only send messages for desired log level if (SENTRY_LOG_LEVEL...
""" Helper functions for Sentry Logs """ from sentry_sdk import capture_message, configure_scope from .conf.settings import SENTRY_LOG_LEVEL, SENTRY_LOG_LEVELS def send_message(message, level, data): """Send a message to the Sentry server""" # Only send messages for desired log level if (SENTRY_LOG_LEVEL...
Use structured context instead of additional data
Use structured context instead of additional data Additional Data is deprecated https://docs.sentry.io/platforms/python/enriching-events/context/#additional-data
Python
bsd-3-clause
mdgart/sentrylogs
<REPLACE_OLD> scope.set_extra(key, <REPLACE_NEW> scope.set_context(key, <REPLACE_END> <|endoftext|> """ Helper functions for Sentry Logs """ from sentry_sdk import capture_message, configure_scope from .conf.settings import SENTRY_LOG_LEVEL, SENTRY_LOG_LEVELS def send_message(message, level, data): """Send a mes...
Use structured context instead of additional data Additional Data is deprecated https://docs.sentry.io/platforms/python/enriching-events/context/#additional-data """ Helper functions for Sentry Logs """ from sentry_sdk import capture_message, configure_scope from .conf.settings import SENTRY_LOG_LEVEL, SENTRY_LOG_LE...
cbe773d051168e05118774708ff7a0ce881617f4
ganglia/settings.py
ganglia/settings.py
DEBUG = True GANGLIA_PATH = '/usr/local/etc' # where gmetad.conf is located API_SERVER = 'http://ganglia-api.example.com:8080' # where ganglia-api.py is hosted BASE_URL = '/ganglia/api/v2' LOGFILE = '/var/log/ganglia-api.log' PIDFILE = '/var/run/ganglia-api.pid'
DEBUG = True GANGLIA_PATH = '/etc/ganglia' # where gmetad.conf is located API_SERVER = 'http://ganglia-api.example.com:8080' # where ganglia-api.py is hosted BASE_URL = '/ganglia/api/v2' LOGFILE = '/var/log/ganglia-api.log' PIDFILE = '/var/run/ganglia-api.pid'
Make GANGLIA_PATH default to /etc/ganglia
Make GANGLIA_PATH default to /etc/ganglia
Python
apache-2.0
guardian/ganglia-api
<REPLACE_OLD> '/usr/local/etc' <REPLACE_NEW> '/etc/ganglia' <REPLACE_END> <|endoftext|> DEBUG = True GANGLIA_PATH = '/etc/ganglia' # where gmetad.conf is located API_SERVER = 'http://ganglia-api.example.com:8080' # where ganglia-api.py is hosted BASE_URL = '/ganglia/api/v2' LOGFILE = '/var/log/ganglia-api.log' PID...
Make GANGLIA_PATH default to /etc/ganglia DEBUG = True GANGLIA_PATH = '/usr/local/etc' # where gmetad.conf is located API_SERVER = 'http://ganglia-api.example.com:8080' # where ganglia-api.py is hosted BASE_URL = '/ganglia/api/v2' LOGFILE = '/var/log/ganglia-api.log' PIDFILE = '/var/run/ganglia-api.pid'
df89f96113d73017a9e18964bfd456b06a2e2a6d
jsk_apc2015_common/scripts/create_mask_applied_dataset.py
jsk_apc2015_common/scripts/create_mask_applied_dataset.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import re import cv2 from jsk_recognition_utils import bounding_rect_of_mask parser = argparse.ArgumentParser() parser.add_argument('container_path') args = parser.parse_args() container_path = args.container_path output_dir = os.path.abspath(...
Add script to create mask applied dataset
Add script to create mask applied dataset
Python
bsd-3-clause
pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc
<INSERT> #!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import re import cv2 from jsk_recognition_utils import bounding_rect_of_mask parser = argparse.ArgumentParser() parser.add_argument('container_path') args = parser.parse_args() container_path = args.container_path output_dir = os.path...
Add script to create mask applied dataset
bd2f5a6c62e446fc8b720b94e75313b5117767cb
trac/upgrades/db11.py
trac/upgrades/db11.py
import os.path import shutil sql = """ -- Remove empty values from the milestone list DELETE FROM milestone WHERE COALESCE(name,'')=''; -- Add a description column to the version table, and remove unnamed versions CREATE TEMP TABLE version_old AS SELECT * FROM version; DROP TABLE version; CREATE TABLE version ( ...
import os.path import shutil sql = """ -- Remove empty values from the milestone list DELETE FROM milestone WHERE COALESCE(name,'')=''; -- Add a description column to the version table, and remove unnamed versions CREATE TEMP TABLE version_old AS SELECT * FROM version; DROP TABLE version; CREATE TABLE version ( ...
Fix typo in upgrade script
Fix typo in upgrade script git-svn-id: 0d96b0c1a6983ccc08b3732614f4d6bfcf9cbb42@1647 af82e41b-90c4-0310-8c96-b1721e28e2e2
Python
bsd-3-clause
rbaumg/trac,rbaumg/trac,rbaumg/trac,rbaumg/trac
<REPLACE_OLD> __default_macro_dir__ <REPLACE_NEW> __default_macros_dir__ <REPLACE_END> <REPLACE_OLD> macro_dir <REPLACE_NEW> macros_dir <REPLACE_END> <REPLACE_OLD> os.listdir(macro_dir): <REPLACE_NEW> os.listdir(macros_dir): <REPLACE_END> <REPLACE_OLD> os.path.join(macro_dir, <REPLACE_NEW> os.path.join(macros_dir, ...
Fix typo in upgrade script git-svn-id: 0d96b0c1a6983ccc08b3732614f4d6bfcf9cbb42@1647 af82e41b-90c4-0310-8c96-b1721e28e2e2 import os.path import shutil sql = """ -- Remove empty values from the milestone list DELETE FROM milestone WHERE COALESCE(name,'')=''; -- Add a description column to the version table, and remo...
6037d11a8da5ea15c8de468dd730670ba10a44c6
setup.py
setup.py
try: from setuptools import setup except ImportError: from distutils.core import setup import toml with open("README.rst") as readme_file: readme_string = readme_file.read() setup( name="toml", version=toml.__version__, description="Python Library for Tom's Obvious, Minimal Language", aut...
try: from setuptools import setup except ImportError: from distutils.core import setup import toml with open("README.rst") as readme_file: readme_string = readme_file.read() setup( name="toml", version=toml.__version__, description="Python Library for Tom's Obvious, Minimal Language", aut...
Add trove classifier for license
Add trove classifier for license The trove classifiers are listed on PyPI to help users know -- at a glance -- what license the project uses. Helps users decide if the library is appropriate for integration. A full list of available trove classifiers can be found at: https://pypi.org/pypi?%3Aaction=list_classifiers ...
Python
mit
uiri/toml,uiri/toml
<REPLACE_OLD> license="License :: OSI Approved :: MIT License", <REPLACE_NEW> license="MIT", <REPLACE_END> <INSERT> 'License :: OSI Approved :: MIT License', <INSERT_END> <|endoftext|> try: from setuptools import setup except ImportError: from distutils.core import setup import toml with open("READM...
Add trove classifier for license The trove classifiers are listed on PyPI to help users know -- at a glance -- what license the project uses. Helps users decide if the library is appropriate for integration. A full list of available trove classifiers can be found at: https://pypi.org/pypi?%3Aaction=list_classifiers ...
1619c955c75f91b9d61c3195704f17fc88ef9e04
aybu/manager/utils/pshell.py
aybu/manager/utils/pshell.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2010 Asidev s.r.l. 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 app...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2010 Asidev s.r.l. 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 app...
Initialize session and environment in shell
Initialize session and environment in shell
Python
apache-2.0
asidev/aybu-manager
<REPLACE_OLD> aybu.core.models.Base.metadata.bind <REPLACE_NEW> aybu.manager.models.Base.metadata.bind <REPLACE_END> <INSERT> aybu.manager.models.Environment.initialize(settings) env['session'] = env['request'].db_session <INSERT_END> <|endoftext|> #!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 20...
Initialize session and environment in shell #!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2010 Asidev s.r.l. 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...
a25e6fb5f9e63ffa30a6c655a6775eead4206bcb
setup.py
setup.py
from distutils.core import setup import os, glob, string, shutil # Packages packages = ['neuroimaging', 'neuroimaging.statistics', 'neuroimaging.image', 'neuroimaging.reference', 'neuroimaging.data', 'neuroimaging.image.formats', 'neuroimaging.image.formats.analyze', 'neuroimaging.fmri', 'neuroimaging.fmri.fmristat',...
import os, glob, string, shutil from distutils.core import setup # Packages packages = ['neuroimaging', 'neuroimaging.statistics', 'neuroimaging.image', 'neuroimaging.reference', 'neuroimaging.data', 'neuroimaging.image.formats', 'neuroimaging.image.formats.analyze', 'neuroimaging.fmri', 'neuroimaging.fmri.fmristat',...
Test edit - to check svn email hook
Test edit - to check svn email hook
Python
bsd-3-clause
gef756/statsmodels,kiyoto/statsmodels,hainm/statsmodels,wdurhamh/statsmodels,detrout/debian-statsmodels,kiyoto/statsmodels,cbmoore/statsmodels,edhuckle/statsmodels,alekz112/statsmodels,hainm/statsmodels,bsipocz/statsmodels,phobson/statsmodels,huongttlan/statsmodels,ChadFulton/statsmodels,wkfwkf/statsmodels,josef-pkt/st...
<DELETE> from distutils.core <DELETE_END> <DELETE> setup import <DELETE_END> <REPLACE_OLD> shutil # <REPLACE_NEW> shutil from distutils.core import setup # <REPLACE_END> <|endoftext|> import os, glob, string, shutil from distutils.core import setup # Packages packages = ['neuroimaging', 'neuroimaging.statistics', '...
Test edit - to check svn email hook from distutils.core import setup import os, glob, string, shutil # Packages packages = ['neuroimaging', 'neuroimaging.statistics', 'neuroimaging.image', 'neuroimaging.reference', 'neuroimaging.data', 'neuroimaging.image.formats', 'neuroimaging.image.formats.analyze', 'neuroimaging....
47dedd31b9ee0f768ca3f9f781133458ddc99f4f
setup.py
setup.py
from setuptools import setup name = 'turbasen' VERSION = '2.5.0' setup( name=name, packages=[name], version=VERSION, description='Client for Nasjonal Turbase REST API', long_description='Documentation: https://turbasenpy.readthedocs.io/', author='Ali Kaafarani', author_email='ali.kaafarani...
from setuptools import setup name = 'turbasen' VERSION = '2.5.0' setup( name=name, packages=[name], version=VERSION, description='Client for Nasjonal Turbase REST API', long_description='Documentation: https://turbasenpy.readthedocs.io/', author='Ali Kaafarani', author_email='ali.kaafarani...
Add sphinx to dev requirements
Add sphinx to dev requirements
Python
mit
Turbasen/turbasen.py
<REPLACE_OLD> ['ipython', <REPLACE_NEW> ['sphinx', 'ipython', <REPLACE_END> <|endoftext|> from setuptools import setup name = 'turbasen' VERSION = '2.5.0' setup( name=name, packages=[name], version=VERSION, description='Client for Nasjonal Turbase REST API', long_description='Documentation: https:...
Add sphinx to dev requirements from setuptools import setup name = 'turbasen' VERSION = '2.5.0' setup( name=name, packages=[name], version=VERSION, description='Client for Nasjonal Turbase REST API', long_description='Documentation: https://turbasenpy.readthedocs.io/', author='Ali Kaafarani',...
01d3027e568bcd191e7e25337c6597eb75b82789
setup.py
setup.py
#!/usr/bin/env python3 from setuptools import setup setup( name='todoman', description='A simple CalDav-based todo manager.', author='Hugo Osvaldo Barrera', author_email='hugo@barrera.io', url='https://github.com/pimutils/todoman', license='MIT', packages=['todoman'], entry_points={ ...
#!/usr/bin/env python3 from setuptools import setup setup( name='todoman', description='A simple CalDav-based todo manager.', author='Hugo Osvaldo Barrera', author_email='hugo@barrera.io', url='https://github.com/pimutils/todoman', license='MIT', packages=['todoman'], entry_points={ ...
Add classifiers for supported python versions
Add classifiers for supported python versions
Python
isc
Sakshisaraswat/todoman,AnubhaAgrawal/todoman,hobarrera/todoman,pimutils/todoman,asalminen/todoman,rimshaakhan/todoman
<INSERT> 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', <INSERT_END> <|endoftext|> #!/usr/bin/env python3 from setuptools i...
Add classifiers for supported python versions #!/usr/bin/env python3 from setuptools import setup setup( name='todoman', description='A simple CalDav-based todo manager.', author='Hugo Osvaldo Barrera', author_email='hugo@barrera.io', url='https://github.com/pimutils/todoman', license='MIT', ...
8147dab8fffb8d9d9753009f43b27afc1729febc
setup.py
setup.py
from setuptools import setup, find_packages import os setup( name="cpgintegrate", version="0.2.17-SNAPSHOT", packages=find_packages(), include_package_data=True, install_requires=[ 'requests>=2.18.4', 'pandas>=0.23.0', 'xlrd', 'sqlalchemy>=1.0', 'beautifulsou...
from setuptools import setup, find_packages import os setup( name="cpgintegrate", version="0.2.17", packages=find_packages(), include_package_data=True, install_requires=[ 'requests>=2.18.4', 'pandas>=0.23.0', 'xlrd', 'sqlalchemy>=1.0', 'beautifulsoup4', ...
Bump version, allow newer lxml
Bump version, allow newer lxml
Python
agpl-3.0
PointyShinyBurning/cpgintegrate
<REPLACE_OLD> version="0.2.17-SNAPSHOT", <REPLACE_NEW> version="0.2.17", <REPLACE_END> <REPLACE_OLD> 'lxml<4.0', <REPLACE_NEW> 'lxml<5.0', <REPLACE_END> <|endoftext|> from setuptools import setup, find_packages import os setup( name="cpgintegrate", version="0.2.17", packages=find_packages(), includ...
Bump version, allow newer lxml from setuptools import setup, find_packages import os setup( name="cpgintegrate", version="0.2.17-SNAPSHOT", packages=find_packages(), include_package_data=True, install_requires=[ 'requests>=2.18.4', 'pandas>=0.23.0', 'xlrd', 'sqlalch...
ab63395c1d8c9ec6bce13811965c8335463b0b78
setup.py
setup.py
from distutils.core import setup, Extension setup(name = "Indexer", version = "0.1", ext_modules = [Extension("rabin", ["src/rabin.c", ])])
from distutils.core import setup, Extension import os os.environ['CFLAGS'] = "-Qunused-arguments" setup(name = "Indexer", version = "0.1", ext_modules = [Extension("rabin", ["src/rabin.c", ])])
Fix compile error on OS X 10.9
Fix compile error on OS X 10.9
Python
apache-2.0
pombredanne/python-rabin-fingerprint,pombredanne/python-rabin-fingerprint,cschwede/python-rabin-fingerprint,cschwede/python-rabin-fingerprint
<REPLACE_OLD> Extension setup(name <REPLACE_NEW> Extension import os os.environ['CFLAGS'] = "-Qunused-arguments" setup(name <REPLACE_END> <|endoftext|> from distutils.core import setup, Extension import os os.environ['CFLAGS'] = "-Qunused-arguments" setup(name = "Indexer", version = "0.1", ext_modules = [Extension("...
Fix compile error on OS X 10.9 from distutils.core import setup, Extension setup(name = "Indexer", version = "0.1", ext_modules = [Extension("rabin", ["src/rabin.c", ])])
638b8be8a07262803c087e796e40a51858c08983
__init__.py
__init__.py
from . import LayerView def getMetaData(): return { "name": "LayerView", "type": "View" } def register(app): return LayerView.LayerView()
from . import LayerView def getMetaData(): return { 'type': 'view', 'plugin': { "name": "Layer View" }, 'view': { 'name': 'Layers' } } def register(app): return LayerView.LayerView()
Update plugin metadata to the new format
Update plugin metadata to the new format
Python
agpl-3.0
totalretribution/Cura,markwal/Cura,quillford/Cura,DeskboxBrazil/Cura,lo0ol/Ultimaker-Cura,senttech/Cura,bq/Ultimaker-Cura,ad1217/Cura,fieldOfView/Cura,fieldOfView/Cura,DeskboxBrazil/Cura,Curahelper/Cura,Curahelper/Cura,hmflash/Cura,bq/Ultimaker-Cura,hmflash/Cura,markwal/Cura,quillford/Cura,derekhe/Cura,totalretribution...
<REPLACE_OLD> { <REPLACE_NEW> { 'type': 'view', 'plugin': { <REPLACE_END> <REPLACE_OLD> "LayerView", "type": "View" <REPLACE_NEW> "Layer View" }, 'view': { 'name': 'Layers' } <REPLACE_END> <|endoftext|> from . import LayerView def getMetaData(): re...
Update plugin metadata to the new format from . import LayerView def getMetaData(): return { "name": "LayerView", "type": "View" } def register(app): return LayerView.LayerView()
ca6891f3b867fd691c0b682566ffec1fd7f0ac2a
pryvate/blueprints/simple/simple.py
pryvate/blueprints/simple/simple.py
"""Simple blueprint.""" import os from flask import Blueprint, current_app, make_response, render_template blueprint = Blueprint('simple', __name__, url_prefix='/simple', template_folder='templates') @blueprint.route('', methods=['POST']) def search_simple(): """Handling pip search.""" re...
"""Simple blueprint.""" import os from flask import Blueprint, current_app, make_response, render_template blueprint = Blueprint('simple', __name__, url_prefix='/simple', template_folder='templates') @blueprint.route('', methods=['POST']) def search_simple(): """Handling pip search.""" re...
Return 404 if package was not found instead of raising an exception
Return 404 if package was not found instead of raising an exception
Python
mit
Dinoshauer/pryvate,Dinoshauer/pryvate
<INSERT> if os.path.isdir(package_path): <INSERT_END> <INSERT> <INSERT_END> <INSERT> <INSERT_END> <INSERT> <INSERT_END> <INSERT> digest_file = os.path.join(package_path, filename) <INSERT_END> <REPLACE_OLD> open(os.path.join(package_path, filename), <REPLACE_NEW> open(digest_file...
Return 404 if package was not found instead of raising an exception """Simple blueprint.""" import os from flask import Blueprint, current_app, make_response, render_template blueprint = Blueprint('simple', __name__, url_prefix='/simple', template_folder='templates') @blueprint.route('', methods...
995f06a33bf92dcff185a50f84743323170a8b7a
setup.py
setup.py
from setuptools import setup, find_packages long_description = ( open('README.rst').read() + '\n' + open('CHANGES.txt').read()) tests_require = [ 'pytest >= 2.0', 'pytest-cov', 'WebTest >= 2.0.14', 'mock', ] setup( name='bowerstatic', version='0.10.dev0', description="A Bo...
import io from setuptools import setup, find_packages long_description = '\n'.join(( io.open('README.rst', encoding='utf-8').read(), io.open('CHANGES.txt', encoding='utf-8').read() )) tests_require = [ 'pytest >= 2.0', 'pytest-cov', 'WebTest >= 2.0.14', 'mock', ] setup( name='bowersta...
Use io.open with encoding='utf-8' and flake8 compliance
Use io.open with encoding='utf-8' and flake8 compliance
Python
bsd-3-clause
faassen/bowerstatic,faassen/bowerstatic
<REPLACE_OLD> from <REPLACE_NEW> import io from <REPLACE_END> <REPLACE_OLD> ( <REPLACE_NEW> '\n'.join(( <REPLACE_END> <REPLACE_OLD> open('README.rst').read() <REPLACE_NEW> io.open('README.rst', encoding='utf-8').read(), <REPLACE_END> <REPLACE_OLD> + '\n' + open('CHANGES.txt').read()) tests_require <REPLACE_NEW...
Use io.open with encoding='utf-8' and flake8 compliance from setuptools import setup, find_packages long_description = ( open('README.rst').read() + '\n' + open('CHANGES.txt').read()) tests_require = [ 'pytest >= 2.0', 'pytest-cov', 'WebTest >= 2.0.14', 'mock', ] setup( name='bow...
3520217e38849ad18b11245c6cac51d79db8422d
pytablereader/loadermanager/_base.py
pytablereader/loadermanager/_base.py
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import absolute_import from ..interface import TableLoaderInterface class TableLoaderManager(TableLoaderInterface): def __init__(self, loader): self.__loader = loader @property def loader...
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import absolute_import from ..interface import TableLoaderInterface class TableLoaderManager(TableLoaderInterface): def __init__(self, loader): self.__loader = loader @property def loader...
Add an interface to change table_name
Add an interface to change table_name
Python
mit
thombashi/pytablereader,thombashi/pytablereader,thombashi/pytablereader
<INSERT> table_name(self): return self.__loader.table_name @table_name.setter def table_name(self, value): self.__loader.table_name = value @property def <INSERT_END> <|endoftext|> # encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future...
Add an interface to change table_name # encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import absolute_import from ..interface import TableLoaderInterface class TableLoaderManager(TableLoaderInterface): def __init__(self, loader): self.__loader...
72a573c24d5234003b9eeb9e0cc487d174908a2e
typeahead_search/trie.py
typeahead_search/trie.py
"""A Trie (prefix tree) class for use in typeahead search. Every node in the TypeaheadSearchTrie is another TypeaheadSearchTrie instance. """ from weakref import WeakSet class TypeaheadSearchTrie(object): def __init__(self): # The children of this node. Because ordered traversals are not # impor...
Add a Trie for storage of data string tokens.
[typeahead_search] Add a Trie for storage of data string tokens.
Python
mit
geekofalltrades/quora-coding-challenges
<REPLACE_OLD> <REPLACE_NEW> """A Trie (prefix tree) class for use in typeahead search. Every node in the TypeaheadSearchTrie is another TypeaheadSearchTrie instance. """ from weakref import WeakSet class TypeaheadSearchTrie(object): def __init__(self): # The children of this node. Because ordered trave...
[typeahead_search] Add a Trie for storage of data string tokens.
a36d3a621cde4a2d19bb0f1169ba707304c5caaf
setup.py
setup.py
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='fabtools', version='0.1', description='Tools for writing awesome Fabric files', author='Ronan Amicel', a...
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='fabtools', version='0.1', description='Tools for writing awesome Fabric files', author='Ronan Amicel', a...
Exclude tests directory from install
Exclude tests directory from install
Python
bsd-2-clause
AMOSoft/fabtools,n0n0x/fabtools-python,pombredanne/fabtools,fabtools/fabtools,ahnjungho/fabtools,bitmonk/fabtools,wagigi/fabtools-python,badele/fabtools,hagai26/fabtools,pahaz/fabtools,sociateru/fabtools,davidcaste/fabtools,prologic/fabtools,ronnix/fabtools
<REPLACE_OLD> packages=find_packages(exclude=['ez_setup']), <REPLACE_NEW> packages=find_packages(exclude=['ez_setup', 'tests']), <REPLACE_END> <|endoftext|> try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import ...
Exclude tests directory from install try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='fabtools', version='0.1', description='Tools for writing awesome Fabric fi...
9037c6c67add92304b6cfdbfb3a79ac1b3e9e64e
test/checker/test_checker_binary.py
test/checker/test_checker_binary.py
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import unicode_literals import itertools import pytest import six from six import MAXSIZE from typepy import Binary, StrictLevel, Typecode nan = float("nan") inf = float("inf") class Test_Binary_is_type(ob...
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import unicode_literals import itertools import pytest from six import MAXSIZE from typepy import Binary, StrictLevel, Typecode nan = float("nan") inf = float("inf") class Test_Binary_is_type(object): ...
Fix test cases for Python2
Fix test cases for Python2
Python
mit
thombashi/typepy
<REPLACE_OLD> pytest import six from <REPLACE_NEW> pytest from <REPLACE_END> <REPLACE_OLD> [six.b("abc"), "いろは".encode("utf_8")], <REPLACE_NEW> ["abc".encode("utf_8"), "いろは".encode("utf_8")], <REPLACE_END> <REPLACE_OLD> StrictLevel.MAX], <REPLACE_NEW> StrictLevel.MAX], [True], ...
Fix test cases for Python2 # encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import unicode_literals import itertools import pytest import six from six import MAXSIZE from typepy import Binary, StrictLevel, Typecode nan = float("nan") inf = float("inf") ...
9f6b12b2579f228fd9d04151771a22474a2744a3
tabula/wrapper.py
tabula/wrapper.py
import subprocess, io, shlex, os import pandas as pd def read_pdf_table(input_path, options=""): jar_path = os.path.abspath(os.path.dirname(__file__)) JAR_NAME = "tabula-0.9.1-jar-with-dependencies.jar" args = ["java", "-jar"] + [jar_path + "/" + JAR_NAME] + shlex.split(options) + [input_path] result = subpro...
import subprocess, io, shlex, os import pandas as pd def read_pdf_table(input_path, options=""): JAR_NAME = "tabula-0.9.1-jar-with-dependencies.jar" jar_dir = os.path.abspath(os.path.dirname(__file__)) jar_path = os.path.join(jar_dir, JAR_NAME) args = ["java", "-jar", jar_path] + shlex.split(options) + [input_...
Use os.path.join for Jar path to make it OS independent
Use os.path.join for Jar path to make it OS independent
Python
mit
chezou/tabula-py
<DELETE> jar_path = os.path.abspath(os.path.dirname(__file__)) <DELETE_END> <INSERT> jar_dir = os.path.abspath(os.path.dirname(__file__)) jar_path = os.path.join(jar_dir, JAR_NAME) <INSERT_END> <REPLACE_OLD> "-jar"] + [jar_path + "/" + JAR_NAME] <REPLACE_NEW> "-jar", jar_path] <REPLACE_END> <|endoftext|> import s...
Use os.path.join for Jar path to make it OS independent import subprocess, io, shlex, os import pandas as pd def read_pdf_table(input_path, options=""): jar_path = os.path.abspath(os.path.dirname(__file__)) JAR_NAME = "tabula-0.9.1-jar-with-dependencies.jar" args = ["java", "-jar"] + [jar_path + "/" + JAR_NAME]...
e056dc3581785fe34123189cccd9901e1e9afe71
pylatex/__init__.py
pylatex/__init__.py
# flake8: noqa """ A library for creating Latex files. .. :copyright: (c) 2014 by Jelte Fennema. :license: MIT, see License for more details. """ from .document import Document from .math import Math, VectorName, Matrix from .package import Package from .section import Section, Subsection, Subsubsection from .t...
# flake8: noqa """ A library for creating Latex files. .. :copyright: (c) 2014 by Jelte Fennema. :license: MIT, see License for more details. """ from .document import Document from .math import Math, VectorName, Matrix from .package import Package from .section import Section, Subsection, Subsubsection from .t...
Add Tabu, LongTable and LongTabu global import
Add Tabu, LongTable and LongTabu global import
Python
mit
sebastianhaas/PyLaTeX,sebastianhaas/PyLaTeX,votti/PyLaTeX,ovaskevich/PyLaTeX,JelteF/PyLaTeX,bjodah/PyLaTeX,votti/PyLaTeX,jendas1/PyLaTeX,bjodah/PyLaTeX,jendas1/PyLaTeX,JelteF/PyLaTeX,ovaskevich/PyLaTeX
<REPLACE_OLD> Tabular from <REPLACE_NEW> Tabular, Tabu, LongTable, \ LongTabu from <REPLACE_END> <|endoftext|> # flake8: noqa """ A library for creating Latex files. .. :copyright: (c) 2014 by Jelte Fennema. :license: MIT, see License for more details. """ from .document import Document from .math import Ma...
Add Tabu, LongTable and LongTabu global import # flake8: noqa """ A library for creating Latex files. .. :copyright: (c) 2014 by Jelte Fennema. :license: MIT, see License for more details. """ from .document import Document from .math import Math, VectorName, Matrix from .package import Package from .section i...
41021030afe45c61d8551128515d7d17ebdd09b8
setup.py
setup.py
import sys from setuptools import find_packages, setup with open('VERSION') as version_fp: VERSION = version_fp.read().strip() install_requires = [ 'django-local-settings>=1.0a13', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils...
import sys from setuptools import find_packages, setup with open('VERSION') as version_fp: VERSION = version_fp.read().strip() install_requires = [ 'django-local-settings>=1.0a13', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils...
Update ldap3 1.0.3 => 1.0.4
Update ldap3 1.0.3 => 1.0.4
Python
mit
wylee/django-arcutils,PSU-OIT-ARC/django-arcutils,wylee/django-arcutils,PSU-OIT-ARC/django-arcutils
<REPLACE_OLD> 'ldap3>=1.0.3', <REPLACE_NEW> 'ldap3>=1.0.4', <REPLACE_END> <|endoftext|> import sys from setuptools import find_packages, setup with open('VERSION') as version_fp: VERSION = version_fp.read().strip() install_requires = [ 'django-local-settings>=1.0a13', 'stashward', ] if sys.version_i...
Update ldap3 1.0.3 => 1.0.4 import sys from setuptools import find_packages, setup with open('VERSION') as version_fp: VERSION = version_fp.read().strip() install_requires = [ 'django-local-settings>=1.0a13', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') set...
bf006aa3dc8ee331eccb4abd8244a134949c8cc0
bawebauth/apps/bawebauth/fields.py
bawebauth/apps/bawebauth/fields.py
# -*- coding: utf-8 -*- from django.db import models class PositiveBigIntegerField(models.PositiveIntegerField): """Represents MySQL's unsigned BIGINT data type (works with MySQL only!)""" empty_strings_allowed = False def get_internal_type(self): return "PositiveBigIntegerField" def db_type(...
# -*- coding: utf-8 -*- from django.db import models class PositiveBigIntegerField(models.PositiveIntegerField): """Represents MySQL's unsigned BIGINT data type (works with MySQL only!)""" empty_strings_allowed = False def db_type(self, connection): if connection.settings_dict['ENGINE'] == 'django...
Fix tests by removing obsolete internal field type declaration
Fix tests by removing obsolete internal field type declaration
Python
mit
mback2k/django-bawebauth,mback2k/django-bawebauth,mback2k/django-bawebauth,mback2k/django-bawebauth
<DELETE> def get_internal_type(self): return "PositiveBigIntegerField" <DELETE_END> <|endoftext|> # -*- coding: utf-8 -*- from django.db import models class PositiveBigIntegerField(models.PositiveIntegerField): """Represents MySQL's unsigned BIGINT data type (works with MySQL only!)""" empty_strin...
Fix tests by removing obsolete internal field type declaration # -*- coding: utf-8 -*- from django.db import models class PositiveBigIntegerField(models.PositiveIntegerField): """Represents MySQL's unsigned BIGINT data type (works with MySQL only!)""" empty_strings_allowed = False def get_internal_type(s...
60a5104f0138af7bbfc5056fae01898c148b10a0
benchmarks/serialization.py
benchmarks/serialization.py
""" Benchmark of message serialization. The goal here is to mostly focus on performance of serialization, in a vaguely realistic manner. That is, mesages are logged in context of a message with a small number of fields. """ from __future__ import unicode_literals import time from eliot import Message, start_action,...
""" Benchmark of message serialization. The goal here is to mostly focus on performance of serialization, in a vaguely realistic manner. That is, mesages are logged in context of a message with a small number of fields. """ from __future__ import unicode_literals import time from eliot import Message, start_action,...
Fix the benchmark so it's not throwing exceptions every time a message is written
Fix the benchmark so it's not throwing exceptions every time a message is written
Python
apache-2.0
ScatterHQ/eliot,ScatterHQ/eliot,ClusterHQ/eliot,ScatterHQ/eliot
<REPLACE_OLD> benchmark: to_file(open("/dev/null")) N <REPLACE_NEW> benchmark: to_file(open("/dev/null", "w")) N <REPLACE_END> <|endoftext|> """ Benchmark of message serialization. The goal here is to mostly focus on performance of serialization, in a vaguely realistic manner. That is, mesages are logged in context ...
Fix the benchmark so it's not throwing exceptions every time a message is written """ Benchmark of message serialization. The goal here is to mostly focus on performance of serialization, in a vaguely realistic manner. That is, mesages are logged in context of a message with a small number of fields. """ from __futur...
039c552b3674531a746c14d1c34bd2f13fd078e5
Cura/util/removableStorage.py
Cura/util/removableStorage.py
import platform import string import glob import os import stat def getPossibleSDcardDrives(): drives = [] if platform.system() == "Windows": from ctypes import windll bitmask = windll.kernel32.GetLogicalDrives() for letter in string.uppercase: if bitmask & 1 and windll.kernel32.GetDriveTypeA(letter + ':/')...
import platform import string import glob import os import stat def getPossibleSDcardDrives(): drives = [] if platform.system() == "Windows": from ctypes import windll import ctypes bitmask = windll.kernel32.GetLogicalDrives() for letter in string.uppercase: if bitmask & 1 and windll.kernel32.GetDriveType...
Enhance the SD card list with more info.
Enhance the SD card list with more info.
Python
agpl-3.0
alephobjects/Cura,alephobjects/Cura,alephobjects/Cura
<REPLACE_OLD> windll bitmask <REPLACE_NEW> windll import ctypes bitmask <REPLACE_END> <REPLACE_OLD> 2: drives.append(letter <REPLACE_NEW> 2: volumeName = '' nameBuffer = ctypes.create_unicode_buffer(1024) if windll.kernel32.GetVolumeInformationW(ctypes.c_wchar_p(letter <REPLACE_END> <REPLACE_OLD> ...
Enhance the SD card list with more info. import platform import string import glob import os import stat def getPossibleSDcardDrives(): drives = [] if platform.system() == "Windows": from ctypes import windll bitmask = windll.kernel32.GetLogicalDrives() for letter in string.uppercase: if bitmask & 1 and wi...
a4dd889a44cf7b4ea4e2e85880343ede234ec60c
geotrek/core/migrations/0017_remove_path_from_factories.py
geotrek/core/migrations/0017_remove_path_from_factories.py
# Generated by Django 2.0.13 on 2020-04-06 13:40 from django.conf import settings from django.contrib.gis.geos import Point, LineString from django.db import migrations def remove_generated_paths_factories(apps, schema_editor): PathModel = apps.get_model('core', 'Path') PathModel.objects.filter(geom=LineStri...
Add migration remove generated paths
Add migration remove generated paths
Python
bsd-2-clause
GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek
<INSERT> # Generated by Django 2.0.13 on 2020-04-06 13:40 from django.conf import settings from django.contrib.gis.geos import Point, LineString from django.db import migrations def remove_generated_paths_factories(apps, schema_editor): <INSERT_END> <INSERT> PathModel = apps.get_model('core', 'Path') PathMode...
Add migration remove generated paths
575f4678b2528bfcfb5d48fdacebd59a2abd9581
tests/slaves_expectations.py
tests/slaves_expectations.py
#!/usr/bin/env python # Copyright (c) 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Dumps a list of known slaves, along with their OS and master.""" import argparse import collections import json import logging ...
Add script for generating slave expectations
Add script for generating slave expectations BUG=489880 R=friedman@chromium.org Review URL: https://codereview.chromium.org/1178383002. git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@295683 0039d316-1c4b-4281-b951-d872f2087c98
Python
bsd-3-clause
eunchong/build,eunchong/build,eunchong/build,eunchong/build
<REPLACE_OLD> <REPLACE_NEW> #!/usr/bin/env python # Copyright (c) 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Dumps a list of known slaves, along with their OS and master.""" import argparse import collection...
Add script for generating slave expectations BUG=489880 R=friedman@chromium.org Review URL: https://codereview.chromium.org/1178383002. git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@295683 0039d316-1c4b-4281-b951-d872f2087c98
5ee94e9a74bc4128ed8e7e10a2106ea422f22757
sandbox/sandbox/polls/serialiser.py
sandbox/sandbox/polls/serialiser.py
from nap import models, fields, api, serialiser, publisher from .models import Choice, Poll class ChoiceSerialiser(models.ModelSerialiser): class Meta: model = Choice exclude = ('poll,') class PollSerialiser(serialiser.Serialiser): api_name = 'poll' question = fields.Field() publ...
from nap import models, fields, api, serialiser, publisher from .models import Choice, Poll class ChoiceSerialiser(models.ModelSerialiser): class Meta: model = Choice exclude = ('poll,') class PollSerialiser(serialiser.Serialiser): api_name = 'poll' question = fields.Field() publ...
Add attribute to choices field declaration
Add attribute to choices field declaration
Python
bsd-3-clause
MarkusH/django-nap,limbera/django-nap
<REPLACE_OLD> fields.ManySerialiserField(serialiser=ChoiceSerialiser()) class <REPLACE_NEW> fields.ManySerialiserField('choices_set.all', serialiser=ChoiceSerialiser()) class <REPLACE_END> <|endoftext|> from nap import models, fields, api, serialiser, publisher from .models import Choice, Poll class ChoiceSeria...
Add attribute to choices field declaration from nap import models, fields, api, serialiser, publisher from .models import Choice, Poll class ChoiceSerialiser(models.ModelSerialiser): class Meta: model = Choice exclude = ('poll,') class PollSerialiser(serialiser.Serialiser): api_name = 'p...
bcc5a9a68f0b97b7e170cf34f9ffea00fb5441f4
version.py
version.py
major = 0 minor=0 patch=25 branch="master" timestamp=1376610207.69
major = 0 minor=0 patch=26 branch="master" timestamp=1376610243.26
Tag commit for v0.0.26-master generated by gitmake.py
Tag commit for v0.0.26-master generated by gitmake.py
Python
mit
ryansturmer/gitmake
<REPLACE_OLD> 0 minor=0 patch=25 branch="master" timestamp=1376610207.69 <REPLACE_NEW> 0 minor=0 patch=26 branch="master" timestamp=1376610243.26 <REPLACE_END> <|endoftext|> major = 0 minor=0 patch=26 branch="master" timestamp=1376610243.26
Tag commit for v0.0.26-master generated by gitmake.py major = 0 minor=0 patch=25 branch="master" timestamp=1376610207.69
57e66ae6cd833b1b0da5b71e1c4b6e223c8ca062
test/test_data.py
test/test_data.py
"""Tests for coverage.data""" import unittest from coverage.data import CoverageData class DataTest(unittest.TestCase): def test_reading(self): covdata = CoverageData() covdata.read() self.assertEqual(covdata.summary(), {})
"""Tests for coverage.data""" from coverage.data import CoverageData from coveragetest import CoverageTest class DataTest(CoverageTest): def test_reading(self): covdata = CoverageData() covdata.read() self.assertEqual(covdata.summary(), {})
Use our CoverageTest base class to get isolation (in a new directory) for the data tests.
Use our CoverageTest base class to get isolation (in a new directory) for the data tests.
Python
apache-2.0
7WebPages/coveragepy,larsbutler/coveragepy,7WebPages/coveragepy,jayhetee/coveragepy,nedbat/coveragepy,7WebPages/coveragepy,blueyed/coveragepy,jayhetee/coveragepy,blueyed/coveragepy,larsbutler/coveragepy,larsbutler/coveragepy,blueyed/coveragepy,larsbutler/coveragepy,7WebPages/coveragepy,hugovk/coveragepy,hugovk/coverage...
<REPLACE_OLD> coverage.data""" import unittest from <REPLACE_NEW> coverage.data""" from <REPLACE_END> <REPLACE_OLD> CoverageData class DataTest(unittest.TestCase): <REPLACE_NEW> CoverageData from coveragetest import CoverageTest class DataTest(CoverageTest): <REPLACE_END> <|endoftext|> """Tests for coverage.data"...
Use our CoverageTest base class to get isolation (in a new directory) for the data tests. """Tests for coverage.data""" import unittest from coverage.data import CoverageData class DataTest(unittest.TestCase): def test_reading(self): covdata = CoverageData() covdata.read() self.assertEqua...
3e03d66c5351ac5e71f82a56aa01ba06865e1c25
conda_verify/cli.py
conda_verify/cli.py
import os import sys from optparse import OptionParser from conda_verify.errors import RecipeError from conda_verify.verify import Verify from conda_verify.utilities import render_metadata, iter_cfgs def cli(): p = OptionParser( usage="usage: %prog [options] <path to recipes or packages>", descr...
import os import sys from optparse import OptionParser from conda_verify.errors import RecipeError from conda_verify.verify import Verify from conda_verify.utilities import render_metadata, iter_cfgs def cli(): p = OptionParser( usage="usage: %prog [options] <path to recipes or packages>", descr...
Change script run message output
Change script run message output
Python
bsd-3-clause
mandeep/conda-verify
<INSERT> meta_file = os.path.join(path, 'meta.yaml') <INSERT_END> <REPLACE_OLD> os.path.isfile(os.path.join(path, 'meta.yaml')): print("==> %s <==" % path) <REPLACE_NEW> os.path.isfile(meta_file): print('Verifying {}...' .format(meta_file)) <REPLACE_END> <|endoftext|> import os import ...
Change script run message output import os import sys from optparse import OptionParser from conda_verify.errors import RecipeError from conda_verify.verify import Verify from conda_verify.utilities import render_metadata, iter_cfgs def cli(): p = OptionParser( usage="usage: %prog [options] <path to re...
6016b6531822615f7c697b0ac380150662d41ba0
setup.py
setup.py
import os import sys from setuptools import setup, find_packages, Command SEP='<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>' class Doctest(Command): if sys.argv[-1] == 'test': print(SEP) print("Running docs make and make doctest") os.system("make doctest -C docs/") ...
import os import sys from setuptools import setup, find_packages, Command class Doctest(Command): if sys.argv[-1] == 'test': print("Running docs make and make doctest") os.system("make doctest -C docs/") class Pep8Test(Command): if sys.argv[-1] == 'test': print("Running pep8 under so...
Enforce python3 on pep8 test (and remove print markers)
Enforce python3 on pep8 test (and remove print markers)
Python
mit
cemsbr/python-openflow,kytos/python-openflow
<REPLACE_OLD> Command SEP='<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>' class <REPLACE_NEW> Command class <REPLACE_END> <DELETE> print(SEP) <DELETE_END> <REPLACE_OLD> docs/") print(SEP) class <REPLACE_NEW> docs/") class <REPLACE_END> <REPLACE_OLD> os.system("python <REPLA...
Enforce python3 on pep8 test (and remove print markers) import os import sys from setuptools import setup, find_packages, Command SEP='<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>' class Doctest(Command): if sys.argv[-1] == 'test': print(SEP) print("Running docs make and ma...
4d4a639ba46cf72454497bc100b3e811e66af4b2
tests/test_deprecations.py
tests/test_deprecations.py
# -*- coding: utf-8 -*- """ tests.deprecations ~~~~~~~~~~~~~~~~~~ Tests deprecation support. Not used currently. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """
# -*- coding: utf-8 -*- """ tests.deprecations ~~~~~~~~~~~~~~~~~~ Tests deprecation support. Not used currently. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import flask class TestRequestDeprecation(object): def test_request_json(...
Add test for deprecated flask.Request properties.
Add test for deprecated flask.Request properties.
Python
bsd-3-clause
moluzhang/flask,karen-wang/flask,happyspace/flask,alanhamlett/flask,kuhli/flask,auready/flask,margguo/flask,tcnoviembre2013/flask,rollingstone/flask,wudafucode/flask,mysweet/flask,drewja/flask,tcnoviembre2013/flask,karen-wang/flask,horica-ionescu/flask,nwags/flask,cgvarela/flask,sam-tsai/flask,postelin/flask,jiimaho/fl...
<REPLACE_OLD> details. """ <REPLACE_NEW> details. """ import pytest import flask class TestRequestDeprecation(object): def test_request_json(self, catch_deprecation_warnings): """Request.json is deprecated""" app = flask.Flask(__name__) app.testing = True @app.route('/', metho...
Add test for deprecated flask.Request properties. # -*- coding: utf-8 -*- """ tests.deprecations ~~~~~~~~~~~~~~~~~~ Tests deprecation support. Not used currently. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """
4a7b0fb482011400da0b3e760cde2d6f294d168f
sysrev/models.py
sysrev/models.py
from django.db import models from django.contrib.auth.models import User class Review(models.Model): user = models.ForeignKey(User, default=None) title = models.CharField(max_length=128) description = models.TextField() date_created = models.DateTimeField(auto_now_add=True) last_modified = models....
from django.db import models from django.contrib.auth.models import User class Review(models.Model): user = models.ForeignKey(User, default=None) title = models.CharField(max_length=128) description = models.TextField() date_created = models.DateTimeField(auto_now_add=True) last_modified = models....
Add completed field to review
Add completed field to review
Python
mit
iliawnek/SystematicReview,iliawnek/SystematicReview,iliawnek/SystematicReview,iliawnek/SystematicReview
<REPLACE_OLD> models.DateTimeField(auto_now=True) <REPLACE_NEW> models.DateTimeField(auto_now=True) completed = models.BooleanField(default=False) <REPLACE_END> <|endoftext|> from django.db import models from django.contrib.auth.models import User class Review(models.Model): user = models.ForeignKey(User,...
Add completed field to review from django.db import models from django.contrib.auth.models import User class Review(models.Model): user = models.ForeignKey(User, default=None) title = models.CharField(max_length=128) description = models.TextField() date_created = models.DateTimeField(auto_now_add=Tr...
bce11d469177eb4287d9d926b9880e7528bd53c0
thumbnails/cache_backends.py
thumbnails/cache_backends.py
# -*- coding: utf-8 -*- class BaseCacheBackend(object): def get(self, thumbnail_name): if isinstance(thumbnail_name, list): thumbnail_name = ''.join(thumbnail_name) return self._get(thumbnail_name) def set(self, thumbnail): thumbnail_name = thumbnail.name if isins...
# -*- coding: utf-8 -*- class BaseCacheBackend(object): def get(self, thumbnail_name): if isinstance(thumbnail_name, list): thumbnail_name = ''.join(thumbnail_name) return self._get(thumbnail_name) def set(self, thumbnail): return self._set(thumbnail.name, thumbnail) ...
Remove unecessary code in cache backend _set
Remove unecessary code in cache backend _set
Python
mit
python-thumbnails/python-thumbnails,relekang/python-thumbnails
<REPLACE_OLD> thumbnail_name = thumbnail.name if isinstance(thumbnail_name, list): thumbnail_name = ''.join(thumbnail_name) return self._set(thumbnail_name, <REPLACE_NEW> return self._set(thumbnail.name, <REPLACE_END> <|endoftext|> # -*- coding: utf-8 -*- class BaseCacheBackend(object): ...
Remove unecessary code in cache backend _set # -*- coding: utf-8 -*- class BaseCacheBackend(object): def get(self, thumbnail_name): if isinstance(thumbnail_name, list): thumbnail_name = ''.join(thumbnail_name) return self._get(thumbnail_name) def set(self, thumbnail): th...
a20c88da5eb0b763072cc7bcba138983fe63ae31
django_fsm_log/apps.py
django_fsm_log/apps.py
from __future__ import unicode_literals from django.apps import AppConfig from django.conf import settings from django.utils.module_loading import import_string from django_fsm.signals import pre_transition, post_transition class DjangoFSMLogAppConfig(AppConfig): name = 'django_fsm_log' verbose_name = "Djang...
from __future__ import unicode_literals from django.apps import AppConfig from django.conf import settings from django.utils.module_loading import import_string from django_fsm.signals import pre_transition, post_transition class DjangoFSMLogAppConfig(AppConfig): name = 'django_fsm_log' verbose_name = "Djang...
Solve warning coming from django 4.0
Solve warning coming from django 4.0
Python
mit
ticosax/django-fsm-log,gizmag/django-fsm-log
<REPLACE_OLD> Log" <REPLACE_NEW> Log" default_auto_field = 'django.db.models.BigAutoField' <REPLACE_END> <|endoftext|> from __future__ import unicode_literals from django.apps import AppConfig from django.conf import settings from django.utils.module_loading import import_string from django_fsm.signals import ...
Solve warning coming from django 4.0 from __future__ import unicode_literals from django.apps import AppConfig from django.conf import settings from django.utils.module_loading import import_string from django_fsm.signals import pre_transition, post_transition class DjangoFSMLogAppConfig(AppConfig): name = 'dja...
2d8ddb4ab59bc7198b637bcc9e51914379ff408b
tests/test_i18n.py
tests/test_i18n.py
import datetime as dt import humanize def test_i18n(): three_seconds = dt.timedelta(seconds=3) assert humanize.naturaltime(three_seconds) == "3 seconds ago" humanize.i18n.activate("ru_RU") assert humanize.naturaltime(three_seconds) == "3 секунды назад" humanize.i18n.deactivate() assert hum...
import datetime as dt import humanize def test_i18n(): three_seconds = dt.timedelta(seconds=3) assert humanize.naturaltime(three_seconds) == "3 seconds ago" assert humanize.ordinal(5) == "5th" try: humanize.i18n.activate("ru_RU") assert humanize.naturaltime(three_seconds) == "3 секу...
Add i18n test for humanize.ordinal
Add i18n test for humanize.ordinal
Python
mit
jmoiron/humanize,jmoiron/humanize
<REPLACE_OLD> ago" <REPLACE_NEW> ago" assert humanize.ordinal(5) == "5th" try: <REPLACE_END> <INSERT> <INSERT_END> <REPLACE_OLD> назад" <REPLACE_NEW> назад" assert humanize.ordinal(5) == "5ый" finally: <REPLACE_END> <INSERT> <INSERT_END> <INSERT> assert humanize.ordinal...
Add i18n test for humanize.ordinal import datetime as dt import humanize def test_i18n(): three_seconds = dt.timedelta(seconds=3) assert humanize.naturaltime(three_seconds) == "3 seconds ago" humanize.i18n.activate("ru_RU") assert humanize.naturaltime(three_seconds) == "3 секунды назад" human...
2585b44484b175bb116c228496069cc4269440c0
hoomd/md/test-py/test_angle_cosinesq.py
hoomd/md/test-py/test_angle_cosinesq.py
# -*- coding: iso-8859-1 -*- # Maintainer: joaander from hoomd import * from hoomd import md context.initialize() import unittest import os import numpy # tests md.angle.cosinesq class angle_cosinesq_tests (unittest.TestCase): def setUp(self): print snap = data.make_snapshot(N=40, ...
Add python tests for cosine squared angles
Add python tests for cosine squared angles
Python
bsd-3-clause
joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue
<REPLACE_OLD> <REPLACE_NEW> # -*- coding: iso-8859-1 -*- # Maintainer: joaander from hoomd import * from hoomd import md context.initialize() import unittest import os import numpy # tests md.angle.cosinesq class angle_cosinesq_tests (unittest.TestCase): def setUp(self): print snap = data.make_sn...
Add python tests for cosine squared angles
ed97a1f811f04693203f6d1c0e9b64649a3da152
coney/exceptions.py
coney/exceptions.py
class ConeyException(Exception): def __repr__(self): return 'An unspecified error has occurred' class CallTimeoutException(ConeyException): def __repr__(self): return 'An RPC call did not return before the time out period' class MalformedRequestException(ConeyException): def __init__(s...
class ConeyException(Exception): def __repr__(self): return 'An unspecified error has occurred' class CallTimeoutException(ConeyException): def __repr__(self): return 'An RPC call did not return before the time out period' class MalformedRequestException(ConeyException): def __init__(s...
Add a new exception to handle a non-callable handler.
Add a new exception to handle a non-callable handler.
Python
mit
cbigler/jackrabbit
<REPLACE_OLD> dispatch'.format(self.code) <REPLACE_NEW> dispatch'.format(self.code) class HandlerNotCallableException(ConeyException): def __repr__(self): return 'Handler provided a non-callable object' <REPLACE_END> <|endoftext|> class ConeyException(Exception): def __repr__(self): return...
Add a new exception to handle a non-callable handler. class ConeyException(Exception): def __repr__(self): return 'An unspecified error has occurred' class CallTimeoutException(ConeyException): def __repr__(self): return 'An RPC call did not return before the time out period' class Malfor...
51760a4cf96074b9d2eb609451512b3fafff7aaa
make_test_data.py
make_test_data.py
import sqlite3 INSERT_SONG = ''' INSERT INTO jukebox_song_queue VALUES (?) ''' TEST_URIS = [ 'spotify:track:5lB3bZKPhng9s4hKB1sSIe', 'spotify:track:5MSfgtOBZkbxlcwsI9XNpf', 'spotify:track:1shuGbTnKx4AXjlx7IauM5' ] if __name__ == '__main__': conn = sqlite3.connect('jukebox.db') cursor = conn.c...
Add script to make some test data
Add script to make some test data
Python
mit
projectweekend/Pi-Jukebox,projectweekend/Pi-Jukebox,projectweekend/Pi-Jukebox
<INSERT> import sqlite3 INSERT_SONG = ''' INSERT INTO jukebox_song_queue VALUES (?) ''' TEST_URIS = [ <INSERT_END> <INSERT> 'spotify:track:5lB3bZKPhng9s4hKB1sSIe', 'spotify:track:5MSfgtOBZkbxlcwsI9XNpf', 'spotify:track:1shuGbTnKx4AXjlx7IauM5' ] if __name__ == '__main__': conn = sqlite3.connect('ju...
Add script to make some test data
77ae27596c96ef5b8c05fcd02448576b419de074
config.py
config.py
class Config: SECRET_KEY = 'jsA5!@z1' class DevelopmentConfig(Config): DEBUG = True SQLALCHEMY_DATABASE_URI = "postgresql://admin:adminpass@localhost/fastmonkeys" config = { 'development': DevelopmentConfig }
class Config: SECRET_KEY = 'jsA5!@z1' class DevelopmentConfig(Config): DEBUG = True SQLALCHEMY_DATABASE_URI = "postgresql://admin:adminpass@localhost/fastmonkeys" SQLALCHEMY_COMMIT_ON_TEARDOWN = True config = { 'development': DevelopmentConfig }
Add SQLAlchemy commit on after request end
Add SQLAlchemy commit on after request end
Python
mit
timzdevz/fm-flask-app
<REPLACE_OLD> "postgresql://admin:adminpass@localhost/fastmonkeys" config <REPLACE_NEW> "postgresql://admin:adminpass@localhost/fastmonkeys" SQLALCHEMY_COMMIT_ON_TEARDOWN = True config <REPLACE_END> <|endoftext|> class Config: SECRET_KEY = 'jsA5!@z1' class DevelopmentConfig(Config): DEBUG = True SQLA...
Add SQLAlchemy commit on after request end class Config: SECRET_KEY = 'jsA5!@z1' class DevelopmentConfig(Config): DEBUG = True SQLALCHEMY_DATABASE_URI = "postgresql://admin:adminpass@localhost/fastmonkeys" config = { 'development': DevelopmentConfig }
cee38843bcf4c628b1c1adc6014dbae7ad2e60c0
acq4/devices/Scanner/scan_program/tests/test_spiral.py
acq4/devices/Scanner/scan_program/tests/test_spiral.py
from __future__ import division import numpy as np from acq4.devices.Scanner.scan_program.spiral import SpiralScan def test_spiral(): r1 = 10e-6 r2 = 20e-6 a1 = 1. a2 = 30. ss = SpiralScan((r1, r2), (a1, a2)) # check that analytically computed path length matches numerically computed ...
Add unit tests for spiral scan
Add unit tests for spiral scan
Python
mit
acq4/acq4,mgraupe/acq4,campagnola/acq4,meganbkratz/acq4,meganbkratz/acq4,acq4/acq4,acq4/acq4,mgraupe/acq4,tropp/acq4,mgraupe/acq4,meganbkratz/acq4,pbmanis/acq4,pbmanis/acq4,acq4/acq4,pbmanis/acq4,mgraupe/acq4,campagnola/acq4,tropp/acq4,campagnola/acq4,pbmanis/acq4,tropp/acq4,campagnola/acq4,meganbkratz/acq4,tropp/acq4,...
<INSERT> from __future__ import division import numpy as np from acq4.devices.Scanner.scan_program.spiral import SpiralScan def test_spiral(): <INSERT_END> <INSERT> r1 = 10e-6 r2 = 20e-6 a1 = 1. a2 = 30. ss = SpiralScan((r1, r2), (a1, a2)) # check that analytically computed path length mat...
Add unit tests for spiral scan
4a6eb1059f2321b2e54edc6bb614dca7d06c186f
CodeFights/isIPv4Address.py
CodeFights/isIPv4Address.py
#!/usr/local/bin/python # Code Fights Is IPv4 Address Problem def isIPv4Address(inputString): import re pattern = re.compile(r'^\d{1,3}(?:\.\d{1,3}){3}$') match = re.search(pattern, inputString) if match: segments = inputString.split(".") return sum([int(x) >= 0 and int(x) <= 255 for x...
Solve Code Fights is IPv4 address problem
Solve Code Fights is IPv4 address problem
Python
mit
HKuz/Test_Code
<REPLACE_OLD> <REPLACE_NEW> #!/usr/local/bin/python # Code Fights Is IPv4 Address Problem def isIPv4Address(inputString): import re pattern = re.compile(r'^\d{1,3}(?:\.\d{1,3}){3}$') match = re.search(pattern, inputString) if match: segments = inputString.split(".") return sum([int(x)...
Solve Code Fights is IPv4 address problem
896c287ad6a5d927febaca4fa957708f783fd51a
shinken/modules/logstore_null.py
shinken/modules/logstore_null.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you can redis...
Add a null LogStore backend for livestatus broker
Add a null LogStore backend for livestatus broker
Python
agpl-3.0
claneys/shinken,KerkhoffTechnologies/shinken,Simage/shinken,Simage/shinken,claneys/shinken,dfranco/shinken,gst/alignak,h4wkmoon/shinken,mohierf/shinken,geektophe/shinken,KerkhoffTechnologies/shinken,geektophe/shinken,mohierf/shinken,titilambert/alignak,tal-nino/shinken,staute/shinken_package,lets-software/shinken,geekt...
<REPLACE_OLD> <REPLACE_NEW> #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is...
Add a null LogStore backend for livestatus broker
f59f94cae98030172024013faccabaddc031b845
frontends/etiquette_flask/etiquette_flask/decorators.py
frontends/etiquette_flask/etiquette_flask/decorators.py
import flask from flask import request import functools from etiquette import jsonify def required_fields(fields, forbid_whitespace=False): ''' Declare that the endpoint requires certain POST body fields. Without them, we respond with 400 and a message. forbid_whitespace: If True, then provi...
import flask from flask import request import functools from . import jsonify def required_fields(fields, forbid_whitespace=False): ''' Declare that the endpoint requires certain POST body fields. Without them, we respond with 400 and a message. forbid_whitespace: If True, then providing the...
Fix required_fields looking at wrong jsonify file.
Fix required_fields looking at wrong jsonify file.
Python
bsd-3-clause
voussoir/etiquette,voussoir/etiquette,voussoir/etiquette
<REPLACE_OLD> etiquette <REPLACE_NEW> . <REPLACE_END> <|endoftext|> import flask from flask import request import functools from . import jsonify def required_fields(fields, forbid_whitespace=False): ''' Declare that the endpoint requires certain POST body fields. Without them, we respond with 400 and a ...
Fix required_fields looking at wrong jsonify file. import flask from flask import request import functools from etiquette import jsonify def required_fields(fields, forbid_whitespace=False): ''' Declare that the endpoint requires certain POST body fields. Without them, we respond with 400 and a message....
230d7745f2f1bbc5099e1288ab482c92262e4126
examples/ndbc/buoy_type_request.py
examples/ndbc/buoy_type_request.py
# Copyright (c) 2018 Siphon Contributors. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ NDBC Buoy Data Request (of any type) ==================================== The NDBC keeps a 40-day recent rolling file for each buoy. This examples shows how to access the oth...
# Copyright (c) 2018 Siphon Contributors. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ NDBC Buoy Data Request (of any type) ==================================== The NDBC keeps a 40-day recent rolling file for each buoy. This examples shows how to access the oth...
Update NDBC example for removed buoy
MNT: Update NDBC example for removed buoy
Python
bsd-3-clause
Unidata/siphon
<REPLACE_OLD> NDBC.buoy_data_types('41002') print(data_aval) #################################################### # <REPLACE_NEW> NDBC.buoy_data_types('42002') print(data_aval) #################################################### # <REPLACE_END> <REPLACE_OLD> NDBC.realtime_observations('41002', <REPLACE_NEW> NDBC.rea...
MNT: Update NDBC example for removed buoy # Copyright (c) 2018 Siphon Contributors. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ NDBC Buoy Data Request (of any type) ==================================== The NDBC keeps a 40-day recent rolling file for each buoy...
a4013c7f33226915b3c1fb7863f3e96b24413591
main.py
main.py
# Copyright 2015, Google, Inc. # 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...
# Copyright 2015, Google, Inc. # 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...
Add Error Message To Server
Add Error Message To Server
Python
apache-2.0
bshaffer/appengine-python-vm-hello,googlearchive/appengine-python-vm-hello,bshaffer/appengine-python-vm-hello,googlearchive/appengine-python-vm-hello
<INSERT> print ('Received error from Books API {}'.format(contents)) <INSERT_END> <|endoftext|> # Copyright 2015, Google, Inc. # 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...
Add Error Message To Server # Copyright 2015, Google, Inc. # 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 agr...
c6a65af70acfed68036914b983856e1cbe26a235
session2/translate_all.py
session2/translate_all.py
import argparse, logging, codecs from translation_model import TranslationModel def setup_args(): parser = argparse.ArgumentParser() parser.add_argument('model', help='trained model') parser.add_argument('input', help='input sentences') parser.add_argument('out', help='translated sentences') args ...
import argparse, logging, codecs from translation_model import TranslationModel from nltk.translate.bleu_score import sentence_bleu as bleu def setup_args(): parser = argparse.ArgumentParser() parser.add_argument('model', help='trained model') parser.add_argument('input', help='input sentences') parser...
Add option to check among 20 translations
Add option to check among 20 translations
Python
bsd-3-clause
vineetm/dl4mt-material,vineetm/dl4mt-material,vineetm/dl4mt-material,vineetm/dl4mt-material,vineetm/dl4mt-material
<REPLACE_OLD> TranslationModel def <REPLACE_NEW> TranslationModel from nltk.translate.bleu_score import sentence_bleu as bleu def <REPLACE_END> <INSERT> parser.add_argument('--all', dest='all', action='store_true', help='Check all translations') <INSERT_END> <INSERT> find_best_translation(input_line, results): ...
Add option to check among 20 translations import argparse, logging, codecs from translation_model import TranslationModel def setup_args(): parser = argparse.ArgumentParser() parser.add_argument('model', help='trained model') parser.add_argument('input', help='input sentences') parser.add_argument('o...
a8f152e9a6a2db98305ee84dfb5b3be3cee91a84
us_ignite/apps/management/commands/app_import.py
us_ignite/apps/management/commands/app_import.py
import requests from django.core.management.base import BaseCommand, CommandError from us_ignite.apps import importer class Command(BaseCommand): help = 'Import the given JSON file.' def handle(self, url, *args, **options): response = requests.get(url) if not response.status_code == 200: ...
Implement importer as a management command.
Implement importer as a management command. Heroku has limitations on the ammount of time that a request should take. By using a management command the application can workaround the time it takes to perform the import.
Python
bsd-3-clause
us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite
<INSERT> import requests from django.core.management.base import BaseCommand, CommandError from us_ignite.apps import importer class Command(BaseCommand): <INSERT_END> <INSERT> help = 'Import the given JSON file.' def handle(self, url, *args, **options): response = requests.get(url) if not r...
Implement importer as a management command. Heroku has limitations on the ammount of time that a request should take. By using a management command the application can workaround the time it takes to perform the import.
e913ed7d5643c4acc85ed7ec82a70c235053360f
tests/test_token.py
tests/test_token.py
""" NOTE: There are no tests that check for data validation at this point since the interpreter doesn't have any data validation as a feature. """ import pytest from calc import INTEGER, Token def test_no_defaults(): # There's no valid defaults at the moment. with pytest.raises(TypeError): Token() ...
import pytest from calc import INTEGER, Token def test_token_cannot_be_instantiated_with_no_defaults(): """ Test that there are currently no valid defaults for a :class:`Token`. More simply, ensure that a :class:`Token` cannot be instantiated without any arguments. """ with pytest.raises(Type...
Improve documentation in token tests. Rename functions to be more clear
Improve documentation in token tests. Rename functions to be more clear
Python
isc
bike-barn/red-green-refactor
<REPLACE_OLD> """ NOTE: There are no tests that check for data validation at this point since the interpreter doesn't have any data validation as a feature. """ import <REPLACE_NEW> import <REPLACE_END> <REPLACE_OLD> test_no_defaults(): <REPLACE_NEW> test_token_cannot_be_instantiated_with_no_defaults(): <REPLACE_END...
Improve documentation in token tests. Rename functions to be more clear """ NOTE: There are no tests that check for data validation at this point since the interpreter doesn't have any data validation as a feature. """ import pytest from calc import INTEGER, Token def test_no_defaults(): # There's no valid def...
2d616924f7dc02458bf0b13a396f3f91b039d321
hub/views.py
hub/views.py
from rest_framework.decorators import api_view from rest_framework.response import Response from .models import FormBuilderPreference from django.http import HttpResponseRedirect from django.core.management import call_command @api_view(['GET']) def switch_builder(request): ''' very un-restful, but for ease o...
from .models import FormBuilderPreference from django.http import HttpResponseRedirect from django.core.management import call_command from django.contrib.auth.decorators import login_required @login_required def switch_builder(request): ''' very un-restful, but for ease of testing, a quick 'GET' is hard to b...
Use `login_required` decorator on `switch_builder` view
Use `login_required` decorator on `switch_builder` view
Python
agpl-3.0
kobotoolbox/kpi,onaio/kpi,kobotoolbox/kpi,onaio/kpi,onaio/kpi,onaio/kpi,kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi
<DELETE> rest_framework.decorators import api_view from rest_framework.response import Response from <DELETE_END> <REPLACE_OLD> call_command @api_view(['GET']) def <REPLACE_NEW> call_command from django.contrib.auth.decorators import login_required @login_required def <REPLACE_END> <DELETE> if not request.user.i...
Use `login_required` decorator on `switch_builder` view from rest_framework.decorators import api_view from rest_framework.response import Response from .models import FormBuilderPreference from django.http import HttpResponseRedirect from django.core.management import call_command @api_view(['GET']) def switch_buil...
86678fce3817388641db3d0f4002b3f8d409377d
pdcupdater/tests/handler_tests/test_kerberos_auth.py
pdcupdater/tests/handler_tests/test_kerberos_auth.py
import pytest import requests_kerberos from mock import patch, Mock import pdcupdater.utils from test.test_support import EnvironmentVarGuard import os class TestKerberosAuthentication(object): @patch('os.path.exists', return_value=True) @patch('requests_kerberos.HTTPKerberosAuth') @patch('requests.get') def test...
import os from mock import patch, Mock import pdcupdater.utils class TestKerberosAuthentication(object): @patch('os.path.exists', return_value=True) @patch('requests_kerberos.HTTPKerberosAuth') @patch('requests.get') def test_get_token(self, requests_get, kerb_auth, os_path): self.url = 'htt...
Remove invalid imports for TestKerberosAuthentication and fix its styling
Remove invalid imports for TestKerberosAuthentication and fix its styling
Python
lgpl-2.1
fedora-infra/pdc-updater
<REPLACE_OLD> pytest import requests_kerberos from <REPLACE_NEW> os from <REPLACE_END> <REPLACE_OLD> Mock import pdcupdater.utils from test.test_support import EnvironmentVarGuard import os class TestKerberosAuthentication(object): @patch('os.path.exists', return_value=True) @patch('requests_kerberos.HTTPKerberosA...
Remove invalid imports for TestKerberosAuthentication and fix its styling import pytest import requests_kerberos from mock import patch, Mock import pdcupdater.utils from test.test_support import EnvironmentVarGuard import os class TestKerberosAuthentication(object): @patch('os.path.exists', return_value=True) @pa...
c37500894b309a691009b87b1305935ee57648cb
tests/test_test.py
tests/test_test.py
import pytest from web_test_base import * """ A class to test new features without running all of the tests. Usage: py.test tests/test_test.py -rsx """ class TestTest(WebTestBase): urls_to_get = [ "http://aidtransparency.net/" ] text_to_find = [ ("information", '//*[@id="home-strapline...
import pytest from web_test_base import * """ A class to test new features without running all of the tests. Usage: py.test tests/test_test.py -rsx """ class TestTest(WebTestBase): urls_to_get = [ "http://iatistandard.org/" , "http://iatistandard.org/202/namespaces-extensions/" ] text_...
Add test text finding that fails
Add test text finding that fails This indicates that a different method of specifying how and where to find text within a document is required.
Python
mit
IATI/IATI-Website-Tests
<REPLACE_OLD> "http://aidtransparency.net/" <REPLACE_NEW> "http://iatistandard.org/" , "http://iatistandard.org/202/namespaces-extensions/" <REPLACE_END> <REPLACE_OLD> ("information", <REPLACE_NEW> ("technical publishing framework", <REPLACE_END> <|endoftext|> import pytest from web_test_base import * """ A ...
Add test text finding that fails This indicates that a different method of specifying how and where to find text within a document is required. import pytest from web_test_base import * """ A class to test new features without running all of the tests. Usage: py.test tests/test_test.py -rsx """ class TestTest(W...
48081a925d5b69e18a1f04c74cbe98b590e77c5b
tests/unit/test_pylama_isort.py
tests/unit/test_pylama_isort.py
import os from isort.pylama_isort import Linter class TestLinter: instance = Linter() def test_allow(self): assert not self.instance.allow("test_case.pyc") assert not self.instance.allow("test_case.c") assert self.instance.allow("test_case.py") def test_run(self, src_dir, tmpdir...
import os from isort.pylama_isort import Linter class TestLinter: instance = Linter() def test_allow(self): assert not self.instance.allow("test_case.pyc") assert not self.instance.allow("test_case.c") assert self.instance.allow("test_case.py") def test_run(self, src_dir, tmpdir...
Add a test for skip functionality
Add a test for skip functionality
Python
mit
PyCQA/isort,PyCQA/isort
<INSERT> self.instance.run(str(incorrect)) def test_skip(self, src_dir, tmpdir): incorrect = tmpdir.join("incorrect.py") incorrect.write("# isort: skip_file\nimport b\nimport a\n") assert not <INSERT_END> <|endoftext|> import os from isort.pylama_isort import Linter class TestLinter: ...
Add a test for skip functionality import os from isort.pylama_isort import Linter class TestLinter: instance = Linter() def test_allow(self): assert not self.instance.allow("test_case.pyc") assert not self.instance.allow("test_case.c") assert self.instance.allow("test_case.py") ...
87e3e6b4930b73563027cb0e125ddd9b9c787d6d
api_tests/requests/views/test_request_action_list.py
api_tests/requests/views/test_request_action_list.py
import pytest from api.base.settings.defaults import API_BASE from api_tests.requests.mixins import PreprintRequestTestMixin @pytest.mark.django_db class TestPreprintRequestActionList(PreprintRequestTestMixin): def url(self, request): return '/{}requests/{}/actions/'.format(API_BASE, request._id) def...
Add action list permissions tests
Add action list permissions tests
Python
apache-2.0
erinspace/osf.io,caseyrollins/osf.io,pattisdr/osf.io,erinspace/osf.io,aaxelb/osf.io,CenterForOpenScience/osf.io,HalcyonChimera/osf.io,CenterForOpenScience/osf.io,baylee-d/osf.io,HalcyonChimera/osf.io,felliott/osf.io,Johnetordoff/osf.io,pattisdr/osf.io,brianjgeiger/osf.io,brianjgeiger/osf.io,baylee-d/osf.io,Johnetordoff...
<REPLACE_OLD> <REPLACE_NEW> import pytest from api.base.settings.defaults import API_BASE from api_tests.requests.mixins import PreprintRequestTestMixin @pytest.mark.django_db class TestPreprintRequestActionList(PreprintRequestTestMixin): def url(self, request): return '/{}requests/{}/actions/'.format(AP...
Add action list permissions tests
c0a5d8143b87126f78e2c836f9edb5480cb6d317
setup.py
setup.py
#/usr/bin/env python import os from setuptools import setup, find_packages ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) # Dynamically calculate the version based on photologue.VERSION version_tuple = __import__('photologue').VERSION if len(version_tuple) == 3: version = "%d.%d_%s" % ve...
#/usr/bin/env python import os from setuptools import setup, find_packages ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) # Dynamically calculate the version based on photologue.VERSION version_tuple = __import__('photologue').VERSION if len(version_tuple) == 3: version = "%d.%d_%s" % ve...
Add dependency on Django 1.3.
Add dependency on Django 1.3.
Python
bsd-3-clause
rmaceissoft/django-photologue,jlemaes/django-photologue,seedwithroot/django-photologue-clone,rmaceissoft/django-photologue,rmaceissoft/django-photologue,MathieuDuponchelle/my_patched_photologue,RossLYoung/django-photologue,jlemaes/django-photologue,seedwithroot/django-photologue-clone,jlemaes/django-photologue,MathieuD...
<REPLACE_OLD> Utilities'], ) <REPLACE_NEW> Utilities'], install_requires=['Django>=1.3', # Change to class-based views means 1.3 minimum. ], ) <REPLACE_END> <|endoftext|> #/usr/bin/env python import os from setuptools import setup, find_packages ROOT_DIR = os.path.dirname(__file__) SOURCE_...
Add dependency on Django 1.3. #/usr/bin/env python import os from setuptools import setup, find_packages ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) # Dynamically calculate the version based on photologue.VERSION version_tuple = __import__('photologue').VERSION if len(version_tuple) == 3...
3a414d5d4763802bc4bc506a57c1f487655d470a
engineering_project/estimatedtime.py
engineering_project/estimatedtime.py
#!/usr/bin/env python3 import statistics class estimatedtime: def __init__(self, numberofpoints): self.listoftimes = [] self.points = numberofpoints def append(self, timeinseconds, inferprogress=True): # print(timeinseconds) self.listoftimes.append(timeinseconds) ...
#!/usr/bin/env python3 import statistics class ETC: ''' Estimated Time to Completion ''' def __init__(self, numberofpoints): self.listoftimes = [] self.points = numberofpoints + 1 def append(self, timeinseconds, inferprogress=True): # print(timeinseconds) self....
Change estimated time class to ETC
Change estimated time class to ETC
Python
mit
DavidLutton/EngineeringProject
<REPLACE_OLD> estimatedtime: <REPLACE_NEW> ETC: ''' Estimated Time to Completion ''' <REPLACE_END> <REPLACE_OLD> numberofpoints <REPLACE_NEW> numberofpoints + 1 <REPLACE_END> <REPLACE_OLD> ETA(self): <REPLACE_NEW> ETC(self): <REPLACE_END> <|endoftext|> #!/usr/bin/env python3 import statistics ...
Change estimated time class to ETC #!/usr/bin/env python3 import statistics class estimatedtime: def __init__(self, numberofpoints): self.listoftimes = [] self.points = numberofpoints def append(self, timeinseconds, inferprogress=True): # print(timeinseconds) self....
cc21429b99c8dc6a92487081dc8422b16abad85f
zerver/management/commands/dump_messages.py
zerver/management/commands/dump_messages.py
from optparse import make_option from django.core.management.base import BaseCommand from zerver.models import Message, Realm, Stream, Recipient import datetime import time class Command(BaseCommand): default_cutoff = time.time() - 60 * 60 * 24 * 30 # 30 days. option_list = BaseCommand.option_list + ( ...
Add a management command to dump all messages on public streams for a realm.
Add a management command to dump all messages on public streams for a realm. (imported from commit f4f8bfece408b466af4db93b2da15cf69b68e0a3)
Python
apache-2.0
hengqujushi/zulip,stamhe/zulip,wweiradio/zulip,dattatreya303/zulip,ashwinirudrappa/zulip,ikasumiwt/zulip,DazWorrall/zulip,ipernet/zulip,hj3938/zulip,praveenaki/zulip,hackerkid/zulip,mahim97/zulip,so0k/zulip,zofuthan/zulip,babbage/zulip,saitodisse/zulip,joyhchen/zulip,jackrzhang/zulip,Suninus/zulip,dattatreya303/zulip,m...
<REPLACE_OLD> <REPLACE_NEW> from optparse import make_option from django.core.management.base import BaseCommand from zerver.models import Message, Realm, Stream, Recipient import datetime import time class Command(BaseCommand): default_cutoff = time.time() - 60 * 60 * 24 * 30 # 30 days. option_list = BaseC...
Add a management command to dump all messages on public streams for a realm. (imported from commit f4f8bfece408b466af4db93b2da15cf69b68e0a3)
31c7be100ed36a39231b302d6306df51375384d1
setup.py
setup.py
from setuptools import setup setup( name='braubuddy', version='0.2.0', author='James Stewart', author_email='jstewart101@gmail.com', packages=['braubuddy'], scripts=[], url='http://pypi.python.org/pypi/Braubuddy/', license='LICENSE.txt', description='An extensile thermostat framewor...
from setuptools import setup, find_packages setup( name='braubuddy', version='0.2.0', author='James Stewart', author_email='jstewart101@gmail.com', description='An extensile thermostat framework', long_description=open('README.rst').read(), license='LICENSE.txt', packages=find_packages(...
Add automagic package finding and classifiers.
Add automagic package finding and classifiers.
Python
bsd-3-clause
amorphic/braubuddy,amorphic/braubuddy,amorphic/braubuddy
<REPLACE_OLD> setup setup( <REPLACE_NEW> setup, find_packages setup( <REPLACE_END> <DELETE> packages=['braubuddy'], scripts=[], url='http://pypi.python.org/pypi/Braubuddy/', license='LICENSE.txt', <DELETE_END> <INSERT> license='LICENSE.txt', packages=find_packages(), scripts=[], tests='b...
Add automagic package finding and classifiers. from setuptools import setup setup( name='braubuddy', version='0.2.0', author='James Stewart', author_email='jstewart101@gmail.com', packages=['braubuddy'], scripts=[], url='http://pypi.python.org/pypi/Braubuddy/', license='LICENSE.txt', ...
77f820fe1286a5d39f2704c3821251bcbe20a2ba
indra/tests/test_rlimsp.py
indra/tests/test_rlimsp.py
from indra.sources import rlimsp def test_simple_usage(): rp = rlimsp.process_pmc('PMC3717945') stmts = rp.statements assert len(stmts) == 6, len(stmts) def test_ungrounded_usage(): rp = rlimsp.process_pmc('PMC3717945', with_grounding=False) assert len(rp.statements) == 33, len(rp.statements)
from indra.sources import rlimsp def test_simple_usage(): rp = rlimsp.process_pmc('PMC3717945') stmts = rp.statements assert len(stmts) == 6, len(stmts) for s in stmts: assert len(s.evidence) == 1, "Wrong amount of evidence." ev = s.evidence[0] assert ev.annotations, "Missing a...
Make basic test more particular.
Make basic test more particular.
Python
bsd-2-clause
sorgerlab/indra,johnbachman/belpy,pvtodorov/indra,pvtodorov/indra,sorgerlab/indra,pvtodorov/indra,sorgerlab/belpy,johnbachman/indra,bgyori/indra,sorgerlab/belpy,pvtodorov/indra,bgyori/indra,johnbachman/belpy,sorgerlab/indra,bgyori/indra,johnbachman/belpy,sorgerlab/belpy,johnbachman/indra,johnbachman/indra
<REPLACE_OLD> len(stmts) def <REPLACE_NEW> len(stmts) for s in stmts: assert len(s.evidence) == 1, "Wrong amount of evidence." ev = s.evidence[0] assert ev.annotations, "Missing annotations." assert 'agents' in ev.annotations.keys() assert 'trigger' in ev.annotations.keys()...
Make basic test more particular. from indra.sources import rlimsp def test_simple_usage(): rp = rlimsp.process_pmc('PMC3717945') stmts = rp.statements assert len(stmts) == 6, len(stmts) def test_ungrounded_usage(): rp = rlimsp.process_pmc('PMC3717945', with_grounding=False) assert len(rp.statem...
991c6164ac5577ce74754a40a33db878d5cd6a6a
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup setup( name='django-sirtrevor', version= '0.2.0', packages=['sirtrevor'], include_package_data=True, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup setup( name='django-sirtrevor', version= '0.2.1', packages=['sirtrevor'], include_package_data=True, ...
Remove importlib from install_requires because of issues with py3k. This breaks compatibility with Python 2.6, but these users just need to 'pip install importlib' to fix this.
Remove importlib from install_requires because of issues with py3k. This breaks compatibility with Python 2.6, but these users just need to 'pip install importlib' to fix this.
Python
mit
zerc/django-sirtrevor,rense/django-sirtrevor,philippbosch/django-sirtrevor,zerc/django-sirtrevor,rense/django-sirtrevor,zerc/django-sirtrevor,zerc/django-sirtrevor,rense/django-sirtrevor,philippbosch/django-sirtrevor,philippbosch/django-sirtrevor,rense/django-sirtrevor
<REPLACE_OLD> '0.2.0', <REPLACE_NEW> '0.2.1', <REPLACE_END> <REPLACE_OLD> 'six', 'importlib'], <REPLACE_NEW> 'six'], <REPLACE_END> <|endoftext|> #!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from ez_setup import use_setuptools use_setuptools() fr...
Remove importlib from install_requires because of issues with py3k. This breaks compatibility with Python 2.6, but these users just need to 'pip install importlib' to fix this. #!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from ez_setup import use_setuptool...
c93f4ded0b3eb33a9a06c784963845dd80144989
setup.py
setup.py
import multiprocessing # noqa # stop tests breaking tox from setuptools import setup import tvrenamr requires = ['pyyaml', 'requests'] setup_requires = ('minimock', 'mock', 'nose', 'pyyaml') setup( name=tvrenamr.__title__, version=tvrenamr.__version__, description='Rename tv show files using online dat...
import multiprocessing # noqa # stop tests breaking tox from setuptools import setup import tvrenamr requires = ['pyyaml', 'requests'] setup_requires = ('minimock', 'mock', 'nose', 'pyyaml') setup( name=tvrenamr.__title__, version=tvrenamr.__version__, description='Rename tv show files using online dat...
Update trove classifiers with generic language versions
Update trove classifiers with generic language versions
Python
mit
ghickman/tvrenamr,wintersandroid/tvrenamr
<INSERT> 2', 'Programming Language :: Python :: <INSERT_END> <INSERT> 3', 'Programming Language :: Python :: <INSERT_END> <INSERT> 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3', <INSERT_END> <|endoftext|> i...
Update trove classifiers with generic language versions import multiprocessing # noqa # stop tests breaking tox from setuptools import setup import tvrenamr requires = ['pyyaml', 'requests'] setup_requires = ('minimock', 'mock', 'nose', 'pyyaml') setup( name=tvrenamr.__title__, version=tvrenamr.__version_...
e8d99b27864d32ad149ffc276dfa78bfdff22c56
__main__.py
__main__.py
#!/usr/bin/env python3 import token import lexer as l import parser as p import evaluator as e import context as c def main(ctx): string = input(">> ") string = string.replace("\\n", "\n") + ";" tokens = l.lex(string) parser = p.Parser(tokens) program = parser.parse_program() ...
#!/usr/bin/env python3 import token import lexer as l import parser as p import evaluator as e import context as c def main(ctx): string = input("⧫ ") string = string.replace("\\n", "\n") + ";" tokens = l.lex(string) parser = p.Parser(tokens) program = parser.parse_program() ...
Change prompt to a diamond
Change prompt to a diamond
Python
mit
Zac-Garby/pluto-lang
<REPLACE_OLD> input(">> <REPLACE_NEW> input("⧫ <REPLACE_END> <|endoftext|> #!/usr/bin/env python3 import token import lexer as l import parser as p import evaluator as e import context as c def main(ctx): string = input("⧫ ") string = string.replace("\\n", "\n") + ";" tokens = l.lex(string) ...
Change prompt to a diamond #!/usr/bin/env python3 import token import lexer as l import parser as p import evaluator as e import context as c def main(ctx): string = input(">> ") string = string.replace("\\n", "\n") + ";" tokens = l.lex(string) parser = p.Parser(tokens) program ...
01edb715a7716627fe3c73af74fa3c5bdd30995e
acq4/modules/MultiPatch/tests/test_logfile.py
acq4/modules/MultiPatch/tests/test_logfile.py
import numpy as np from acq4.modules.MultiPatch.logfile import MultiPatchLog, IrregularTimeSeries def test_timeseries_index(): ts1 = [ (10, 0.5), (12, 13.4), (29.8, 5), (29.9, 6), (30.0, 7), (30.1, 8), (35, 0), ] ts2 = [ (10, (0.5, ...
Add multipatch logfile unit tests
Add multipatch logfile unit tests
Python
mit
pbmanis/acq4,meganbkratz/acq4,meganbkratz/acq4,meganbkratz/acq4,acq4/acq4,pbmanis/acq4,pbmanis/acq4,pbmanis/acq4,acq4/acq4,campagnola/acq4,acq4/acq4,campagnola/acq4,acq4/acq4,campagnola/acq4,meganbkratz/acq4,campagnola/acq4
<REPLACE_OLD> <REPLACE_NEW> import numpy as np from acq4.modules.MultiPatch.logfile import MultiPatchLog, IrregularTimeSeries def test_timeseries_index(): ts1 = [ (10, 0.5), (12, 13.4), (29.8, 5), (29.9, 6), (30.0, 7), (30.1, 8), (35, 0), ] ...
Add multipatch logfile unit tests
156093f3b4872d68663897b8525f4706ec5a555c
pyfr/template.py
pyfr/template.py
# -*- coding: utf-8 -*- import os import pkgutil from mako.lookup import TemplateLookup from mako.template import Template class DottedTemplateLookup(TemplateLookup): def __init__(self, pkg): self.dfltpkg = pkg def adjust_uri(self, uri, relto): return uri def get_template(self, name):...
# -*- coding: utf-8 -*- import os import pkgutil from mako.lookup import TemplateLookup from mako.template import Template class DottedTemplateLookup(TemplateLookup): def __init__(self, pkg): self.dfltpkg = pkg def adjust_uri(self, uri, relto): return uri def get_template(self, name):...
Enhance the dotted name lookup functionality.
Enhance the dotted name lookup functionality.
Python
bsd-3-clause
tjcorona/PyFR,tjcorona/PyFR,tjcorona/PyFR,BrianVermeire/PyFR,iyer-arvind/PyFR,Aerojspark/PyFR
<REPLACE_OLD> try: tpl <REPLACE_NEW> src <REPLACE_END> <REPLACE_OLD> return Template(tpl, lookup=self) except IOError: <REPLACE_NEW> if not src: <REPLACE_END> <REPLACE_OLD> found'.format(name)) <REPLACE_NEW> found'.format(name)) return Template(src, lookup=self) <REPLACE_END> <|endo...
Enhance the dotted name lookup functionality. # -*- coding: utf-8 -*- import os import pkgutil from mako.lookup import TemplateLookup from mako.template import Template class DottedTemplateLookup(TemplateLookup): def __init__(self, pkg): self.dfltpkg = pkg def adjust_uri(self, uri, relto): ...
621fc3e10ad296c21a27160a8a1263cf69e3079f
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import uuid from pip.req import parse_requirements from setuptools import setup, find_packages requirements = parse_requirements('requirements.txt', session=uuid.uuid1()) reqs = [str(ir.req) for ir in requirements] readme = open('README.rst').read() setup(name='nuts', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import uuid from pip.req import parse_requirements from setuptools import setup, find_packages requirements = parse_requirements('requirements.txt', session=uuid.uuid1()) reqs = [str(ir.req) for ir in requirements] readme = open('README.rst').read() setup(name='nuts', ...
Fix missing testSchema in package
Fix missing testSchema in package
Python
mit
HSRNetwork/Nuts
<REPLACE_OLD> version='1.1', <REPLACE_NEW> version='1.1.1', <REPLACE_END> <INSERT> data_files=[('lib/python2.7/site-packages/nuts/service', ['nuts/service/testSchema.yaml'])], <INSERT_END> <|endoftext|> #!/usr/bin/env python # -*- coding: utf-8 -*- import uuid from pip.req import parse_requirements from setup...
Fix missing testSchema in package #!/usr/bin/env python # -*- coding: utf-8 -*- import uuid from pip.req import parse_requirements from setuptools import setup, find_packages requirements = parse_requirements('requirements.txt', session=uuid.uuid1()) reqs = [str(ir.req) for ir in requirements] readme = open('README...
5e8d64bcbb53da0984ac0b41a470417a05c530d7
microcosm_postgres/factories.py
microcosm_postgres/factories.py
""" Factory that configures SQLAlchemy for PostgreSQL. """ from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from microcosm.api import binding, defaults @binding("postgres") @defaults( host="localhost", port=5432, password="secret", ) def configure_sqlalchemy_engine(graph): ...
""" Factory that configures SQLAlchemy for PostgreSQL. """ from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from microcosm.api import binding, defaults @binding("postgres") @defaults( host="localhost", port=5432, password="secret", ) def configure_sqlalchemy_engine(graph): ...
Rename factory to match what it creates
Rename factory to match what it creates
Python
apache-2.0
globality-corp/microcosm-postgres,globality-corp/microcosm-postgres
<REPLACE_OLD> configure_sqlalchemy_session(graph): <REPLACE_NEW> configure_sqlalchemy_sessionmaker(graph): <REPLACE_END> <|endoftext|> """ Factory that configures SQLAlchemy for PostgreSQL. """ from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from microcosm.api import binding, defaults ...
Rename factory to match what it creates """ Factory that configures SQLAlchemy for PostgreSQL. """ from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from microcosm.api import binding, defaults @binding("postgres") @defaults( host="localhost", port=5432, password="secret", ) d...
55e506489e93bad1d000acd747a272103e789a59
rml/element.py
rml/element.py
''' Representation of an element @param element_type: type of the element @param length: length of the element ''' import pkg_resources from rml.exceptions import ConfigException pkg_resources.require('cothread') from cothread.catools import caget class Element(object): def __init__(self, element_type, length, **...
''' Representation of an element @param element_type: type of the element @param length: length of the element ''' import pkg_resources from rml.exceptions import ConfigException pkg_resources.require('cothread') from cothread.catools import caget class Element(object): def __init__(self, element_type, length, **...
Add support for y field of a pv
Add support for y field of a pv
Python
apache-2.0
willrogers/pml,razvanvasile/RML,willrogers/pml
<REPLACE_OLD> Getting the <REPLACE_NEW> For storing the pv. Dictionary where keys are fields and # values are <REPLACE_END> <REPLACE_OLD> value <REPLACE_NEW> names <REPLACE_END> <REPLACE_OLD> kwargs.get('pv', None) self._field = {} <REPLACE_NEW> dict() <REPLACE_END> <REPLACE_OLD> self._field: <RE...
Add support for y field of a pv ''' Representation of an element @param element_type: type of the element @param length: length of the element ''' import pkg_resources from rml.exceptions import ConfigException pkg_resources.require('cothread') from cothread.catools import caget class Element(object): def __init...
07823ae7f7368f4bc4a4e4436129319f7215150b
faker/utils/distribution.py
faker/utils/distribution.py
# coding=utf-8 import bisect from faker.generator import random def random_sample(): return random.uniform(0.0, 1.0) def cumsum(it): total = 0 for x in it: total += x yield total def choice_distribution(a, p): assert len(a) == len(p) cdf = list(cumsum(p)) normal = cdf[-1] ...
# coding=utf-8 import bisect from sys import version_info from faker.generator import random def random_sample(): return random.uniform(0.0, 1.0) def cumsum(it): total = 0 for x in it: total += x yield total def choice_distribution(a, p): assert len(a) == len(p) if version_inf...
Use random.choices when available for better performance
Use random.choices when available for better performance
Python
mit
joke2k/faker,joke2k/faker,danhuss/faker
<INSERT> sys import version_info from <INSERT_END> <INSERT> if version_info.major >= 3 and version_info.minor >= 6: from random import choices return choices(a, weights=p)[0] else: <INSERT_END> <INSERT> <INSERT_END> <INSERT> <INSERT_END> <INSERT> <INSERT_END> <INSERT> <INSERT...
Use random.choices when available for better performance # coding=utf-8 import bisect from faker.generator import random def random_sample(): return random.uniform(0.0, 1.0) def cumsum(it): total = 0 for x in it: total += x yield total def choice_distribution(a, p): assert len(a) ...
c26ebf61079fc783d23000ee4e023e1111d8a75e
blog/manage.py
blog/manage.py
#!/usr/bin/env python import os import sys if __name__ == "__main__": if socket.gethostname() == 'blog': os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.production") else: os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.local" from django.core.management import execute_...
#!/usr/bin/env python import os import sys if __name__ == "__main__": if socket.gethostname() == 'blog': os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.base") else: os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.base") from django.core.management import execute_from_c...
Switch settings used to just settings/base.py
Switch settings used to just settings/base.py
Python
bsd-3-clause
giovannicode/giovanniblog,giovannicode/giovanniblog
<REPLACE_OLD> "settings.production") <REPLACE_NEW> "settings.base") <REPLACE_END> <REPLACE_OLD> "settings.local" <REPLACE_NEW> "settings.base") <REPLACE_END> <|endoftext|> #!/usr/bin/env python import os import sys if __name__ == "__main__": if socket.gethostname() == 'blog': os.environ.setdefault("D...
Switch settings used to just settings/base.py #!/usr/bin/env python import os import sys if __name__ == "__main__": if socket.gethostname() == 'blog': os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.production") else: os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.local" ...
3b7dcc4d2a19b5ac03eebae35600c25dd038fe33
tests/test_server.py
tests/test_server.py
import hashlib import json from unittest.mock import Mock from unittest.mock import ANY from queue_functions import do_work from server import handle_post from uploaders.s3 import get_url from uploaders.s3 import upload def test_post(): q = Mock() filename = 'afakefilename' files = {'file': [{'body': b'a...
import hashlib import json from unittest.mock import Mock from unittest.mock import ANY from queue_functions import do_work from server import handle_post from uploaders.s3 import get_url from uploaders.s3 import upload def test_post(): q = Mock() filename = 'afakefilename' files = {'file': [{'body': b'a...
Test against dictionary, not a string
Test against dictionary, not a string
Python
bsd-2-clause
algorithmic-music-exploration/amen-server,algorithmic-music-exploration/amen-server
<REPLACE_OLD> json.reads(handle_post(q, <REPLACE_NEW> json.loads(handle_post(q, <REPLACE_END> <|endoftext|> import hashlib import json from unittest.mock import Mock from unittest.mock import ANY from queue_functions import do_work from server import handle_post from uploaders.s3 import get_url from uploaders.s3 impor...
Test against dictionary, not a string import hashlib import json from unittest.mock import Mock from unittest.mock import ANY from queue_functions import do_work from server import handle_post from uploaders.s3 import get_url from uploaders.s3 import upload def test_post(): q = Mock() filename = 'afakefilena...
2ef0571e5468ac72f712a69180fa5dc18652e8d7
app/applier.py
app/applier.py
import random from collections import namedtuple Rule = namedtuple('Rule', ['changes', 'environments']) sonorization = Rule({'p': 'b', 't': 'd', 'ʈ': 'ɖ', 'c':'ɟ', 'k': 'g', 'q': 'ɢ'}, ['^.', 'V.V']) rules = [sonorization] words = ['potato', 'tobado', 'tabasco'] def choose_rule(words, rules): ...
import random from collections import namedtuple Rule = namedtuple('Rule', ['changes', 'environments']) sonorization = Rule({'p': 'b', 't': 'd', 'ʈ': 'ɖ', 'c':'ɟ', 'k': 'g', 'q': 'ɢ'}, ['^.', 'V.V']) rules = [sonorization] words = ['potato', 'tobado', 'tabasco'] def choose_rule(words, rules): ...
Implement rule filtering by phoneme.
Implement rule filtering by phoneme.
Python
mit
kdelwat/LangEvolve,kdelwat/LangEvolve,kdelwat/LangEvolve
<INSERT> # <INSERT_END> <INSERT> intersecting(set_1, set_2): '''Return true if the intersection of the two sets isn't empty, false otherwise. ''' return (len(set_1.intersection(set_2)) != 0) def <INSERT_END> <REPLACE_OLD> pass def <REPLACE_NEW> word_phonemes = set(''.join(words)) return [rule for rul...
Implement rule filtering by phoneme. import random from collections import namedtuple Rule = namedtuple('Rule', ['changes', 'environments']) sonorization = Rule({'p': 'b', 't': 'd', 'ʈ': 'ɖ', 'c':'ɟ', 'k': 'g', 'q': 'ɢ'}, ['^.', 'V.V']) rules = [sonorization] words = ['potato', 'tobado', 'taba...
e2479e3f8748fbfa34c89ecda7d2f3e72e94fa57
pydata/urls.py
pydata/urls.py
from django.conf.urls import url, include from . import views urlpatterns = [ url(r'^events/import/?$', views.ConferenceImport.as_view(), name='event_import'), url(r'^persons/import/?$', views.PersonImport.as_view(), name='person_import'), url(r'^tasks/import/?$', ...
from django.conf.urls import url, include from . import views urlpatterns = [ url(r'^events/import/?$', views.ConferenceImport.as_view(), name='event_import'), url(r'^persons/import/?$', views.PersonImport.as_view(), name='person_import'), url(r'^tasks/import/?$', ...
Fix malformed URLs in bulk import
Fix malformed URLs in bulk import
Python
mit
swcarpentry/amy,vahtras/amy,pbanaszkiewicz/amy,pbanaszkiewicz/amy,swcarpentry/amy,vahtras/amy,swcarpentry/amy,vahtras/amy,pbanaszkiewicz/amy
<REPLACE_OLD> url(r'^bulk-import/?', <REPLACE_NEW> url(r'^bulk-import/', <REPLACE_END> <|endoftext|> from django.conf.urls import url, include from . import views urlpatterns = [ url(r'^events/import/?$', views.ConferenceImport.as_view(), name='event_import'), url(r'^persons/import/?$', ...
Fix malformed URLs in bulk import from django.conf.urls import url, include from . import views urlpatterns = [ url(r'^events/import/?$', views.ConferenceImport.as_view(), name='event_import'), url(r'^persons/import/?$', views.PersonImport.as_view(), name='person_import'), ...
5beba531b85d719039c2faf371d83d2957cea5c3
rpifake/__init__.py
rpifake/__init__.py
from __future__ import print_function import sys is_active = False # After this function, any futher calls to import RPi.GPIO # will instead import .gpio.Gpio instead def patch_fake_gpio(): import sys import mock from .gpio import Gpio as FakeGpio global is_active print('Warning, not in RPi, usi...
from __future__ import print_function import sys is_active = False # After this function, any futher calls to import RPi.GPIO # will instead import .gpio.Gpio instead def patch_fake_gpio(): import sys import mock from .gpio import Gpio as FakeGpio global is_active print('Warning, not in RPi, usi...
Fix bad logic for missing RPi package
Fix bad logic for missing RPi package
Python
mit
rfarley3/lcd-restful,rfarley3/lcd-restful
<REPLACE_OLD> False if <REPLACE_NEW> True if <REPLACE_END> <DELETE> not <DELETE_END> <|endoftext|> from __future__ import print_function import sys is_active = False # After this function, any futher calls to import RPi.GPIO # will instead import .gpio.Gpio instead def patch_fake_gpio(): import sys import m...
Fix bad logic for missing RPi package from __future__ import print_function import sys is_active = False # After this function, any futher calls to import RPi.GPIO # will instead import .gpio.Gpio instead def patch_fake_gpio(): import sys import mock from .gpio import Gpio as FakeGpio global is_act...
212aaed11103a9442745715ae88573fa8fcf3a2c
trac/upgrades/db43.py
trac/upgrades/db43.py
# -*- coding: utf-8 -*- # # Copyright (C) 2017 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.com/license.html. # # This software consists of vo...
Add upgrade script missing from r15749
1.3.2dev: Add upgrade script missing from r15749 Refs #12719. git-svn-id: 0d96b0c1a6983ccc08b3732614f4d6bfcf9cbb42@15765 af82e41b-90c4-0310-8c96-b1721e28e2e2
Python
bsd-3-clause
rbaumg/trac,rbaumg/trac,rbaumg/trac,rbaumg/trac
<REPLACE_OLD> <REPLACE_NEW> # -*- coding: utf-8 -*- # # Copyright (C) 2017 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.com/license.html. # #...
1.3.2dev: Add upgrade script missing from r15749 Refs #12719. git-svn-id: 0d96b0c1a6983ccc08b3732614f4d6bfcf9cbb42@15765 af82e41b-90c4-0310-8c96-b1721e28e2e2
d559edb42f7a60958a4861e1cdb504e658f5f279
python2/setup.py
python2/setup.py
#!/usr/bin/env python from distutils.core import setup setup(name='futures', version='1.0', description='Java-style futures implementation in Python 2.x', author='Brian Quinlan', author_email='brian@sweetapp.com', url='http://code.google.com/p/pythonfutures', download_url='http://p...
#!/usr/bin/env python from distutils.core import setup setup(name='futures', version='2.0', description='Java-style futures implementation in Python 2.x', author='Brian Quinlan', author_email='brian@sweetapp.com', url='http://code.google.com/p/pythonfutures', download_url='http://p...
Bump version number for Python 3.2-matching release
Bump version number for Python 3.2-matching release
Python
bsd-2-clause
danielj7/pythonfutures,danielj7/pythonfutures
<REPLACE_OLD> version='1.0', <REPLACE_NEW> version='2.0', <REPLACE_END> <|endoftext|> #!/usr/bin/env python from distutils.core import setup setup(name='futures', version='2.0', description='Java-style futures implementation in Python 2.x', author='Brian Quinlan', author_email='brian@sweetap...
Bump version number for Python 3.2-matching release #!/usr/bin/env python from distutils.core import setup setup(name='futures', version='1.0', description='Java-style futures implementation in Python 2.x', author='Brian Quinlan', author_email='brian@sweetapp.com', url='http://code.goog...