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
30e1e82573437cfaf8b75ec9f42c520a5f4f60d5
ibmcnx/doc/DataSources.py
ibmcnx/doc/DataSources.py
###### # Check ExId (GUID) by Email through JDBC # # Author: Christoph Stoettner # Mail: christoph.stoettner@stoeps.de # Documentation: http://scripting101.stoeps.de # # Version: 2.0 # Date: 2014-06-04 # # License: Apache 2.0 # # Check ExId of a User in all Connections Appli...
###### # Check ExId (GUID) by Email through JDBC # # Author: Christoph Stoettner # Mail: christoph.stoettner@stoeps.de # Documentation: http://scripting101.stoeps.de # # Version: 2.0 # Date: 2014-06-04 # # License: Apache 2.0 # # Check ExId of a User in all Connections Appli...
Create documentation of DataSource Settings
8: Create documentation of DataSource Settings Task-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/8
Python
apache-2.0
stoeps13/ibmcnx2,stoeps13/ibmcnx2
<REPLACE_OLD> db <REPLACE_NEW> dbname <REPLACE_END> <REPLACE_OLD> db: <REPLACE_NEW> dbname: <REPLACE_END> <REPLACE_OLD> dblist.append(str(i).replace('"','')) <REPLACE_NEW> dblist.append(str(db).replace('"','')) <REPLACE_END> <REPLACE_OLD> t1 <REPLACE_NEW> #t1 <REPLACE_END> <REPLACE_OLD> t1 # <REPLACE_NEW> db # <REP...
8: Create documentation of DataSource Settings Task-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/8 ###### # Check ExId (GUID) by Email through JDBC # # Author: Christoph Stoettner # Mail: christoph.stoettner@stoeps.de # Documentation: http://scripting101.stoeps.de # # Version: 2.0 #...
cdfd38a552f0f1bf0738e8c2d02f40c44db3fee3
setup.py
setup.py
### -*- coding: utf-8 -*- ### ### © 2012 Krux Digital, Inc. ### Author: Paul Lathrop <paul@krux.com> ### from setuptools import setup, find_packages setup(name='pysecurity-groups', version="0.0.1", description='Library for working with EC2 security groups in bulk.', author='Paul Lathrop', auth...
### -*- coding: utf-8 -*- ### ### © 2012 Krux Digital, Inc. ### Author: Paul Lathrop <paul@krux.com> ### from setuptools import setup, find_packages setup(name='pysecurity-groups', version="1.0.0", description='Library for working with EC2 security groups in bulk.', author='Paul Lathrop', auth...
Update release version to 1.0.0
Update release version to 1.0.0
Python
mit
krux/pysecurity-groups
<REPLACE_OLD> version="0.0.1", <REPLACE_NEW> version="1.0.0", <REPLACE_END> <|endoftext|> ### -*- coding: utf-8 -*- ### ### © 2012 Krux Digital, Inc. ### Author: Paul Lathrop <paul@krux.com> ### from setuptools import setup, find_packages setup(name='pysecurity-groups', version="1.0.0", description='Lib...
Update release version to 1.0.0 ### -*- coding: utf-8 -*- ### ### © 2012 Krux Digital, Inc. ### Author: Paul Lathrop <paul@krux.com> ### from setuptools import setup, find_packages setup(name='pysecurity-groups', version="0.0.1", description='Library for working with EC2 security groups in bulk.', ...
2261a15132a0b98821cb3e5614c044f1b41fbc73
smsgateway/__init__.py
smsgateway/__init__.py
__version__ = '2.0.0' def get_account(using=None): from django.conf import settings accounts = settings.SMSGATEWAY_ACCOUNTS if using is not None: return accounts[using] else: return accounts[accounts['__default__']] def send(to, msg, signature, using=None, reliable=False): """ ...
__version__ = '2.0.0' def get_account(using=None): from django.conf import settings accounts = settings.SMSGATEWAY_ACCOUNTS if using is not None: return accounts[using] else: return accounts[accounts['__default__']] def send(to, msg, signature, using=None, reliable=False): """ ...
Add priority option to send_queued
Add priority option to send_queued
Python
bsd-3-clause
peterayeni/django-smsgateway,mvpoland/django-smsgateway,peterayeni/django-smsgateway,mvpoland/django-smsgateway,peterayeni/django-smsgateway,peterayeni/django-smsgateway,mvpoland/django-smsgateway
<REPLACE_OLD> reliable=False): <REPLACE_NEW> reliable=False, priority=None): <REPLACE_END> <REPLACE_OLD> QueuedSMS.objects.create( <REPLACE_NEW> queued_sms = QueuedSMS( <REPLACE_END> <INSERT> if priority is not None: queued_sms.priority = priority queued_sms.save() <INSERT_END> <|endoftext|> __versi...
Add priority option to send_queued __version__ = '2.0.0' def get_account(using=None): from django.conf import settings accounts = settings.SMSGATEWAY_ACCOUNTS if using is not None: return accounts[using] else: return accounts[accounts['__default__']] def send(to, msg, signature, using...
5d8a37cdbd41af594f03d78092b78a22afc53c05
__main__.py
__main__.py
#!/usr/bin/env python import argparse from githublist.parser import main as get_data from githublist.serve import serve_content parser = argparse.ArgumentParser(description='View repositories for any GitHub account.') parser.add_argument('user', type=str, help='GitHub user handle') parser.add_argument('-f', '--forma...
#!/usr/bin/env python import argparse from githublist.parser import main as get_data from githublist.serve import serve_content parser = argparse.ArgumentParser(description='View repositories for any GitHub account.') parser.add_argument('user', type=str, nargs='+', help='GitHub user handle') parser.add_argument('-f...
Add support for multiple users, format types
Add support for multiple users, format types
Python
mit
kshvmdn/github-list,kshvmdn/github-list,kshvmdn/github-list
<INSERT> nargs='+', <INSERT_END> <INSERT> nargs='+', <INSERT_END> <REPLACE_OLD> 'tbl.txt'], <REPLACE_NEW> 'tbl.txt', 'all'], <REPLACE_END> <REPLACE_OLD> user, <REPLACE_NEW> user = args.user <REPLACE_END> <REPLACE_OLD> args.user, <REPLACE_NEW> ['json', 'csv', 'md', 'raw.txt', 'tbl.txt'] if 'all...
Add support for multiple users, format types #!/usr/bin/env python import argparse from githublist.parser import main as get_data from githublist.serve import serve_content parser = argparse.ArgumentParser(description='View repositories for any GitHub account.') parser.add_argument('user', type=str, help='GitHub us...
4e5ef4a04fd0b3b354b187ee6e8e8ef27337ad6f
xclib/dbmops.py
xclib/dbmops.py
import sys import bsddb3 from xclib.utf8 import utf8, unutf8 def perform(args): domain_db = bsddb3.hashopen(args.domain_db, 'c', 0o600) if args.get: print(unutf8(domain_db[utf8(args.get)])) elif args.put: domain_db[utf8(args.put[0])] = args.put[1] elif args.delete: del domain_db...
import sys import bsddb3 from xclib.utf8 import utf8, unutf8 def perform(args): domain_db = bsddb3.hashopen(args.domain_db, 'c', 0o600) if args.get: print(unutf8(domain_db[utf8(args.get)], 'illegal')) elif args.put: domain_db[utf8(args.put[0])] = args.put[1] elif args.delete: de...
Allow dumping illegal utf-8 contents
Allow dumping illegal utf-8 contents
Python
mit
jsxc/xmpp-cloud-auth,jsxc/xmpp-cloud-auth,jsxc/xmpp-cloud-auth,jsxc/xmpp-cloud-auth
<REPLACE_OLD> print(unutf8(domain_db[utf8(args.get)])) <REPLACE_NEW> print(unutf8(domain_db[utf8(args.get)], 'illegal')) <REPLACE_END> <REPLACE_OLD> (unutf8(k), unutf8(domain_db[k]))) <REPLACE_NEW> (unutf8(k, 'illegal'), unutf8(domain_db[k], 'illegal'))) <REPLACE_END> <|endoftext|> import sys import bsddb3 from xcl...
Allow dumping illegal utf-8 contents import sys import bsddb3 from xclib.utf8 import utf8, unutf8 def perform(args): domain_db = bsddb3.hashopen(args.domain_db, 'c', 0o600) if args.get: print(unutf8(domain_db[utf8(args.get)])) elif args.put: domain_db[utf8(args.put[0])] = args.put[1] e...
deef4ac0d34409727d36f273cc63420deae982f7
setup.py
setup.py
from setuptools import setup, find_packages import sys reqs = [ "decorator>=3.3.2", "Pillow>=2.5.0" ] if sys.version_info[0] == 2: # simplejson is not python3 compatible reqs.append("simplejson>=2.0.9") if [sys.version_info[0], sys.version_info[1]] < [2, 7]: reqs.append("argparse>=1.2") setup( ...
from setuptools import setup, find_packages import sys install_reqs = [ "decorator>=3.3.2" ] test_reqs = [ "Pillow>=2.5.0" ] if sys.version_info[0] == 2: # simplejson is not python3 compatible install_reqs.append("simplejson>=2.0.9") if [sys.version_info[0], sys.version_info[1]] < [2, 7]: instal...
Move Pillow to tests requirements
Move Pillow to tests requirements
Python
bsd-3-clause
DataDog/dogapi,DataDog/dogapi
<REPLACE_OLD> sys reqs <REPLACE_NEW> sys install_reqs <REPLACE_END> <REPLACE_OLD> "decorator>=3.3.2", <REPLACE_NEW> "decorator>=3.3.2" ] test_reqs = [ <REPLACE_END> <REPLACE_OLD> "Pillow>=2.5.0" ] if <REPLACE_NEW> "Pillow>=2.5.0" ] if <REPLACE_END> <REPLACE_OLD> reqs.append("simplejson>=2.0.9") if <REPLACE_NEW> ...
Move Pillow to tests requirements from setuptools import setup, find_packages import sys reqs = [ "decorator>=3.3.2", "Pillow>=2.5.0" ] if sys.version_info[0] == 2: # simplejson is not python3 compatible reqs.append("simplejson>=2.0.9") if [sys.version_info[0], sys.version_info[1]] < [2, 7]: reqs...
b8d824b5355bcabd6a1bdcf7d8af39076ce75bb6
examples/workspace_renumber.py
examples/workspace_renumber.py
#!/usr/bin/env python3 import i3ipc # make connection to i3 ipc i3 = i3ipc.Connection() # check if workspaces are all in order def workspaces_ordered(i3conn): last_workspace_number = 0 for i in sorted(i3conn.get_workspaces(), key=lambda x: x['num']): if i['num'] != last_workspace_number+1: ...
Add script that makes sure workspace numbers are always in consecutive order by moving windows on out of order workspaces to the appropriate workspace
Add script that makes sure workspace numbers are always in consecutive order by moving windows on out of order workspaces to the appropriate workspace
Python
bsd-3-clause
acrisci/i3ipc-python
<REPLACE_OLD> <REPLACE_NEW> #!/usr/bin/env python3 import i3ipc # make connection to i3 ipc i3 = i3ipc.Connection() # check if workspaces are all in order def workspaces_ordered(i3conn): last_workspace_number = 0 for i in sorted(i3conn.get_workspaces(), key=lambda x: x['num']): if i['num'] != last_...
Add script that makes sure workspace numbers are always in consecutive order by moving windows on out of order workspaces to the appropriate workspace
7183edee23f715d225b7dc506746e3b7a96d7d6b
gmql/dataset/loaders/__init__.py
gmql/dataset/loaders/__init__.py
""" Loader settings: we use the GMQL scala class CombineTextFileWithPathInputFormat in order to load the region and metadata files with the same id_sample based on the hash of the file name """ inputFormatClass = 'it.polimi.genomics.spark.implementation.loaders.Loaders$CombineTextFileWithPathInputFormat' keyFormatClas...
import os """ Loader settings: we use the GMQL scala class CombineTextFileWithPathInputFormat in order to load the region and metadata files with the same id_sample based on the hash of the file name """ inputFormatClass = 'it.polimi.genomics.spark.implementation.loaders.Loaders$CombineTextFileWithPathInputFormat' ke...
Use only the base file name for key
Use only the base file name for key Former-commit-id: 3acbf9e93d3d501013e2a1b6aa9631bdcc663c66 [formerly eea949727d3693aa032033d84dcca3790d9072dd] [formerly ca065bc9f78b1416903179418d64b3273d437987] Former-commit-id: 58c1d18e8960ad3236a34b8080b18ccff5684eaa Former-commit-id: 6501068cea164df37ec055c3fb8baf8c89fc7823
Python
apache-2.0
DEIB-GECO/PyGMQL,DEIB-GECO/PyGMQL
<REPLACE_OLD> """ Loader <REPLACE_NEW> import os """ Loader <REPLACE_END> <REPLACE_OLD> } def <REPLACE_NEW> } """ Generation of the index of the pandas dataframe. This can be done in different ways: - hashing the complete file name - using directly the file as index (this is visually appealing :) )...
Use only the base file name for key Former-commit-id: 3acbf9e93d3d501013e2a1b6aa9631bdcc663c66 [formerly eea949727d3693aa032033d84dcca3790d9072dd] [formerly ca065bc9f78b1416903179418d64b3273d437987] Former-commit-id: 58c1d18e8960ad3236a34b8080b18ccff5684eaa Former-commit-id: 6501068cea164df37ec055c3fb8baf8c89fc7823 "...
5a4d9255c59be0d5dda8272e0e7ced71822f4d40
prime-factors/prime_factors.py
prime-factors/prime_factors.py
import sieve def prime_factors(n): primes = sieve.sieve(n) factors = [] for p in primes: while n % p == 0: factors += [p] n //= p return factors
def prime_factors(n): factors = [] factor = 2 while n != 1: while n % factor == 0: factors += [factor] n //= factor factor += 1 return factors
Fix memory issues by just trying every number
Fix memory issues by just trying every number
Python
agpl-3.0
CubicComet/exercism-python-solutions
<REPLACE_OLD> import sieve def <REPLACE_NEW> def <REPLACE_END> <DELETE> primes = sieve.sieve(n) <DELETE_END> <REPLACE_OLD> for p in primes: <REPLACE_NEW> factor = 2 while n != 1: <REPLACE_END> <REPLACE_OLD> p <REPLACE_NEW> factor <REPLACE_END> <REPLACE_OLD> [p] <REPLACE_NEW> [factor] <REPLACE_END> <REPLAC...
Fix memory issues by just trying every number import sieve def prime_factors(n): primes = sieve.sieve(n) factors = [] for p in primes: while n % p == 0: factors += [p] n //= p return factors
6ca530abba63376dab254d649ab568895917bfbd
tests/example.py
tests/example.py
import unittest class ExampleTest(unittest.TestCase): def test_xample(self): self.assertEqual(1, 1) if __name__ == '__main__': unittest.main()
import unittest class ExampleTest(unittest.TestCase): def test_example(self): self.assertEqual(1, 1) if __name__ == '__main__': unittest.main()
Fix typo in method name
Fix typo in method name
Python
mit
pawel-lewtak/coding-dojo-template-python
<REPLACE_OLD> test_xample(self): <REPLACE_NEW> test_example(self): <REPLACE_END> <|endoftext|> import unittest class ExampleTest(unittest.TestCase): def test_example(self): self.assertEqual(1, 1) if __name__ == '__main__': unittest.main()
Fix typo in method name import unittest class ExampleTest(unittest.TestCase): def test_xample(self): self.assertEqual(1, 1) if __name__ == '__main__': unittest.main()
dd7686b609245c4c37364167603a7b5b0165ebbc
migrations/versions/588336e02ca_use_native_postgres_json_type_for_entry_.py
migrations/versions/588336e02ca_use_native_postgres_json_type_for_entry_.py
"""Use native postgres JSON type for Entry.content Revision ID: 588336e02ca Revises: 2b7f5e38dd73 Create Date: 2014-01-09 22:40:07.690000 """ # revision identifiers, used by Alembic. revision = '588336e02ca' down_revision = '2b7f5e38dd73' from alembic import op import sqlalchemy as sa def upgrade(): ### comma...
Add migration for native postgres JSON type
Add migration for native postgres JSON type
Python
mit
streamr/marvin,streamr/marvin,streamr/marvin
<INSERT> """Use native postgres JSON type for Entry.content Revision ID: 588336e02ca Revises: 2b7f5e38dd73 Create Date: 2014-01-09 22:40:07.690000 """ # revision identifiers, used by Alembic. revision = '588336e02ca' down_revision = '2b7f5e38dd73' from alembic import op import sqlalchemy as sa def upgrade(): <IN...
Add migration for native postgres JSON type
1a8bdb4afcdb268af09df1a1abf2ef09f45176f1
setup.py
setup.py
from setuptools import setup setup( name='tangled.contrib', version='0.1a4.dev0', description='Tangled namespace for contributed packages', long_description=open('README.rst').read(), url='http://tangledframework.org/', download_url='https://github.com/TangledWeb/tangled.contrib/tags', aut...
from setuptools import setup setup( name='tangled.contrib', version='0.1a4.dev0', description='Tangled namespace for contributed packages', long_description=open('README.rst').read(), url='http://tangledframework.org/', download_url='https://github.com/TangledWeb/tangled.contrib/tags', aut...
Upgrade tangled from 0.1a5 to 0.1a8
Upgrade tangled from 0.1a5 to 0.1a8
Python
mit
TangledWeb/tangled.contrib
<REPLACE_OLD> 'tangled>=0.1a5', <REPLACE_NEW> 'tangled>=0.1a8', <REPLACE_END> <REPLACE_OLD> 'tangled[dev]>=0.1a5', <REPLACE_NEW> 'tangled[dev]>=0.1a8', <REPLACE_END> <|endoftext|> from setuptools import setup setup( name='tangled.contrib', version='0.1a4.dev0', description='Tangled namespace for contr...
Upgrade tangled from 0.1a5 to 0.1a8 from setuptools import setup setup( name='tangled.contrib', version='0.1a4.dev0', description='Tangled namespace for contributed packages', long_description=open('README.rst').read(), url='http://tangledframework.org/', download_url='https://github.com/Tang...
3bf0c34c256e0c94475283bbeffdbc8fb384aa25
tests/test_tool_placement.py
tests/test_tool_placement.py
import pytest from gi.repository import Gtk from gaphas.item import Element from gaphas.tool.placement import PlacementState, on_drag_begin, placement_tool @pytest.fixture def tool_factory(connections): def tool_factory(): return Element(connections) return tool_factory def test_can_create_placeme...
Add some extra tests for placement
Add some extra tests for placement
Python
lgpl-2.1
amolenaar/gaphas
<INSERT> import pytest from gi.repository import Gtk from gaphas.item import Element from gaphas.tool.placement import PlacementState, on_drag_begin, placement_tool @pytest.fixture def tool_factory(connections): <INSERT_END> <INSERT> def tool_factory(): return Element(connections) return tool_factory...
Add some extra tests for placement
bd11c37a8669bdae2d4561483f50da0891b82627
monsetup/detection/plugins/zookeeper.py
monsetup/detection/plugins/zookeeper.py
import logging import os import yaml import monsetup.agent_config import monsetup.detection log = logging.getLogger(__name__) class Zookeeper(monsetup.detection.Plugin): """Detect Zookeeper daemons and setup configuration to monitor them. """ def _detect(self): """Run detection, set self.ava...
import logging import os import yaml import monsetup.agent_config import monsetup.detection log = logging.getLogger(__name__) class Zookeeper(monsetup.detection.Plugin): """Detect Zookeeper daemons and setup configuration to monitor them. """ def _detect(self): """Run detection, set self.ava...
Fix detection of Zookeeper in monasca-setup
Fix detection of Zookeeper in monasca-setup The Zookeeper detection plugin was looking for zookeeper in the process command-line. This was producing false positives in the detection process because storm uses the zookeeper library and it shows up the command-line for storm. Change-Id: I764a3064003beec55f0e589272855d...
Python
bsd-3-clause
sapcc/monasca-agent,sapcc/monasca-agent,sapcc/monasca-agent
<REPLACE_OLD> monsetup.detection.find_process_cmdline('zookeeper') <REPLACE_NEW> monsetup.detection.find_process_cmdline('org.apache.zookeeper') <REPLACE_END> <|endoftext|> import logging import os import yaml import monsetup.agent_config import monsetup.detection log = logging.getLogger(__name__) class Zookeeper(...
Fix detection of Zookeeper in monasca-setup The Zookeeper detection plugin was looking for zookeeper in the process command-line. This was producing false positives in the detection process because storm uses the zookeeper library and it shows up the command-line for storm. Change-Id: I764a3064003beec55f0e589272855d...
606cb3475e2e4220822f924d13881dfaefb51aa4
teryt_tree/rest_framework_ext/viewsets.py
teryt_tree/rest_framework_ext/viewsets.py
import django_filters from django.shortcuts import get_object_or_404 try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_framework import viewsets from teryt_tree.models import JednostkaA...
import django_filters from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext_lazy as _ try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_framework...
Update JednostkaAdministracyjnaFilter for new django-filters
Update JednostkaAdministracyjnaFilter for new django-filters
Python
bsd-3-clause
ad-m/django-teryt-tree
<REPLACE_OLD> get_object_or_404 try: <REPLACE_NEW> get_object_or_404 from django.utils.translation import ugettext_lazy as _ try: <REPLACE_END> <INSERT> \ <INSERT_END> <REPLACE_OLD> django_filters.CharFilter(action=custom_area_filter) <REPLACE_NEW> django_filters.CharFilter( method=custom_area_filter, ...
Update JednostkaAdministracyjnaFilter for new django-filters import django_filters from django.shortcuts import get_object_or_404 try: from django_filters import rest_framework as filters except ImportError: # Back-ward compatible for django-rest-framework<3.7 from rest_framework import filters from rest_fram...
fe5100f5d13ed7461619c8beff791d40306f83ff
addons/document/migrations/8.0.2.1/pre-migration.py
addons/document/migrations/8.0.2.1/pre-migration.py
# -*- coding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License...
Remove annoying SQL view that prevents some operations
[IMP] document: Remove annoying SQL view that prevents some operations
Python
agpl-3.0
blaggacao/OpenUpgrade,kirca/OpenUpgrade,csrocha/OpenUpgrade,bwrsandman/OpenUpgrade,Endika/OpenUpgrade,grap/OpenUpgrade,bwrsandman/OpenUpgrade,pedrobaeza/OpenUpgrade,sebalix/OpenUpgrade,mvaled/OpenUpgrade,pedrobaeza/OpenUpgrade,OpenUpgrade/OpenUpgrade,sebalix/OpenUpgrade,OpenUpgrade/OpenUpgrade,mvaled/OpenUpgrade,blagga...
<INSERT> # -*- coding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the #...
[IMP] document: Remove annoying SQL view that prevents some operations
ebfb9290f5afdc07489be117f9ccb6df34e4023a
src/sentry/web/frontend/generic.py
src/sentry/web/frontend/generic.py
""" sentry.web.frontend.generic ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from django.views.generic import TemplateView as BaseTemplateView from sentry.web.helpers imp...
""" sentry.web.frontend.generic ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from django.views.generic import TemplateView as BaseTemplateView from sentry.web.helpers imp...
Add CORS headers to js files for local dev
Add CORS headers to js files for local dev
Python
bsd-3-clause
alexm92/sentry,daevaorn/sentry,ifduyue/sentry,daevaorn/sentry,mvaled/sentry,gencer/sentry,looker/sentry,beeftornado/sentry,ifduyue/sentry,zenefits/sentry,zenefits/sentry,gencer/sentry,looker/sentry,daevaorn/sentry,JackDanger/sentry,looker/sentry,mitsuhiko/sentry,looker/sentry,ifduyue/sentry,zenefits/sentry,jean/sentry,...
<REPLACE_OLD> '.woff')): <REPLACE_NEW> '.woff', '.js')): <REPLACE_END> <|endoftext|> """ sentry.web.frontend.generic ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from dj...
Add CORS headers to js files for local dev """ sentry.web.frontend.generic ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from django.views.generic import TemplateView as B...
89bc764364137d18d825d316f5433e25cf9c4ceb
jungle/cli.py
jungle/cli.py
# -*- coding: utf-8 -*- import click class JungleCLI(click.MultiCommand): """Jangle CLI main class""" def list_commands(self, ctx): """return available modules""" return ['ec2', 'elb'] def get_command(self, ctx, name): """get command""" mod = __import__('jungle.' + name,...
# -*- coding: utf-8 -*- import click from jungle import __version__ class JungleCLI(click.MultiCommand): """Jangle CLI main class""" def list_commands(self, ctx): """return available modules""" return ['ec2', 'elb'] def get_command(self, ctx, name): """get command""" mo...
Add version number to help text
Add version number to help text
Python
mit
achiku/jungle
<REPLACE_OLD> click class <REPLACE_NEW> click from jungle import __version__ class <REPLACE_END> <REPLACE_OLD> JungleCLI(help='aws <REPLACE_NEW> JungleCLI(help="aws <REPLACE_END> <REPLACE_OLD> cli') if <REPLACE_NEW> cli (v{})".format(__version__)) if <REPLACE_END> <|endoftext|> # -*- coding: utf-8 -*- import c...
Add version number to help text # -*- coding: utf-8 -*- import click class JungleCLI(click.MultiCommand): """Jangle CLI main class""" def list_commands(self, ctx): """return available modules""" return ['ec2', 'elb'] def get_command(self, ctx, name): """get command""" m...
298d9fc5264fc80089034c4770369d65e898e3e0
anillo/middlewares/cors.py
anillo/middlewares/cors.py
import functools def wrap_cors( func=None, *, allow_origin='*', allow_headers=set(["Origin", "X-Requested-With", "Content-Type", "Accept"])): """ A middleware that allow CORS calls, by adding the headers Access-Control-Allow-Origin and Access-Control-Allow-Headers. This middlware accept...
import functools DEFAULT_HEADERS = frozenset(["origin", "x-requested-with", "content-type", "accept"])): def wrap_cors(func=None, *, allow_origin='*', allow_headers=DEFAULT_HEADERS): """ A middleware that allow CORS calls, by adding the headers Access-Control-Allow-Origin and Access-Control-Allow-Headers....
Put default headers as constant and make it immutable.
Put default headers as constant and make it immutable. With additional cosmetic fixes.
Python
bsd-2-clause
jespino/anillo,hirunatan/anillo,jespino/anillo,hirunatan/anillo
<REPLACE_OLD> functools def wrap_cors( func=None, *, allow_origin='*', allow_headers=set(["Origin", "X-Requested-With", "Content-Type", "Accept"])): <REPLACE_NEW> functools DEFAULT_HEADERS = frozenset(["origin", "x-requested-with", "content-type", "accept"])): def wrap_cors(func=None, *, allow_origi...
Put default headers as constant and make it immutable. With additional cosmetic fixes. import functools def wrap_cors( func=None, *, allow_origin='*', allow_headers=set(["Origin", "X-Requested-With", "Content-Type", "Accept"])): """ A middleware that allow CORS calls, by adding the header...
a3c3a6ed4d01f1857fc4728b10505e330af9e6ae
code/helper/easierlife.py
code/helper/easierlife.py
#! /usr/bin/env python3 """ Helper functions to make our life easier. Originally obtained from the 'pharm' repository, but modified. """ import fileinput import json import os.path from dstruct import Sentence ## BASE_DIR denotes the application directory BASE_DIR, throwaway = os.path.split(os.path.realpath(__file_...
#! /usr/bin/env python3 """ Helper functions to make our life easier. Originally obtained from the 'pharm' repository, but modified. """ import fileinput import json import os.path import sys from dstruct.Sentence import Sentence ## BASE_DIR denotes the application directory BASE_DIR, throwaway = os.path.split(os.p...
Fix import, use fileinput.iput as context, and fix its argument
Fix import, use fileinput.iput as context, and fix its argument
Python
apache-2.0
amwenger/dd-genomics,rionda/dd-genomics,HazyResearch/dd-genomics,amwenger/dd-genomics,HazyResearch/dd-genomics,HazyResearch/dd-genomics,HazyResearch/dd-genomics,rionda/dd-genomics,amwenger/dd-genomics,HazyResearch/dd-genomics
<REPLACE_OLD> os.path from dstruct <REPLACE_NEW> os.path import sys from dstruct.Sentence <REPLACE_END> <REPLACE_OLD> get_input_sentences(input_files=[]): <REPLACE_NEW> get_input_sentences(input_files=sys.argv[1:]): with fileinput.input(files=input_files) as f: <REPLACE_END> <REPLACE_OLD> fileinput.input(in...
Fix import, use fileinput.iput as context, and fix its argument #! /usr/bin/env python3 """ Helper functions to make our life easier. Originally obtained from the 'pharm' repository, but modified. """ import fileinput import json import os.path from dstruct import Sentence ## BASE_DIR denotes the application direc...
1a534acf6038b35c8bba125c277d349ec967d5bd
lc0246_strobogrammatic_number.py
lc0246_strobogrammatic_number.py
"""Leetcode 246. Strobogrammatic Number Easy URL: https://leetcode.com/problems/strobogrammatic-number/A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a function to determine if a number is strobogrammatic. The number is represented as a string. Exampl...
"""Leetcode 246. Strobogrammatic Number Easy URL: https://leetcode.com/problems/strobogrammatic-number/A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a function to determine if a number is strobogrammatic. The number is represented as a string. Exampl...
Complete map dict sol w/ time/space complexity
Complete map dict sol w/ time/space complexity
Python
bsd-2-clause
bowen0701/algorithms_data_structures
<REPLACE_OLD> Solution(object): <REPLACE_NEW> SolutionMapDictIter(object): <REPLACE_END> <REPLACE_OLD> bool <REPLACE_NEW> bool Time complexity: O(n). Space complexity: O(n). <REPLACE_END> <REPLACE_OLD> pass def <REPLACE_NEW> # Reverse num. rev_num = num[::-1] # Convert to mapped ...
Complete map dict sol w/ time/space complexity """Leetcode 246. Strobogrammatic Number Easy URL: https://leetcode.com/problems/strobogrammatic-number/A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a function to determine if a number is strobogrammatic...
b49c40dddb5b90881f9f86872cb6a3b6044e1637
djpg/signals.py
djpg/signals.py
import logging logger = logging.getLogger('djpg') from django.dispatch import Signal from .codes import codes notification_received = Signal(providing_args=['notification']) transaction_received = Signal(providing_args=['transaction']) transaction_waiting = Signal() transaction_analysis = Signal() transaction_paid =...
import logging logger = logging.getLogger('djpg') from django.dispatch import Signal from .codes import codes notification_received = Signal(providing_args=['notification']) transaction_received = Signal(providing_args=['transaction']) transaction_waiting = Signal() transaction_analysis = Signal() transaction_paid =...
Fix bug when trying to convert transaction code to int
Fix bug when trying to convert transaction code to int
Python
mit
mstrcnvs/djpg
<REPLACE_OLD> int(transaction['code']) <REPLACE_NEW> transaction['code'] <REPLACE_END> <|endoftext|> import logging logger = logging.getLogger('djpg') from django.dispatch import Signal from .codes import codes notification_received = Signal(providing_args=['notification']) transaction_received = Signal(providing_a...
Fix bug when trying to convert transaction code to int import logging logger = logging.getLogger('djpg') from django.dispatch import Signal from .codes import codes notification_received = Signal(providing_args=['notification']) transaction_received = Signal(providing_args=['transaction']) transaction_waiting = Sig...
aae994402b1b16a2bca4a486dad4bb452770eb26
tests/pipeline/test_provider_healthcheck.py
tests/pipeline/test_provider_healthcheck.py
"""Test Provider Health Check setting.""" from foremast.pipeline.construct_pipeline_block import check_provider_healthcheck TEST_SETTINGS = {'app': {'eureka_enabled': False}, 'asg': {'provider_healthcheck': {}}} def test_provider_healthcheck(): """Make sure default Provider Health Check works.""" provider_he...
"""Test Provider Health Check setting.""" from foremast.pipeline.construct_pipeline_block import check_provider_healthcheck TEST_SETTINGS = {'app': {'eureka_enabled': False}, 'asg': {'provider_healthcheck': {}}} def test_provider_healthcheck(): """Make sure default Provider Health Check works.""" health_chec...
Update Provider Health Check sanity
test: Update Provider Health Check sanity See also: PSOBAT-2465
Python
apache-2.0
gogoair/foremast,gogoair/foremast
<REPLACE_OLD> provider_healthcheck, has_provider_healthcheck <REPLACE_NEW> health_checks <REPLACE_END> <REPLACE_OLD> provider_healthcheck <REPLACE_NEW> health_checks.providers <REPLACE_END> <REPLACE_OLD> has_provider_healthcheck <REPLACE_NEW> health_checks.has_healthcheck <REPLACE_END> <|endoftext|> """Test Provider He...
test: Update Provider Health Check sanity See also: PSOBAT-2465 """Test Provider Health Check setting.""" from foremast.pipeline.construct_pipeline_block import check_provider_healthcheck TEST_SETTINGS = {'app': {'eureka_enabled': False}, 'asg': {'provider_healthcheck': {}}} def test_provider_healthcheck(): ""...
9c9cdd1f1979aa880726fc0039255ed7f7ea2f6d
tests/test_simpleflow/swf/test_task.py
tests/test_simpleflow/swf/test_task.py
from sure import expect from simpleflow import activity from simpleflow.swf.task import ActivityTask @activity.with_attributes() def show_context_func(): return show_context_func.context @activity.with_attributes() class ShowContextCls(object): def execute(self): return self.context def test_tas...
Add tests to ensure ActivityTask attaches the context
Add tests to ensure ActivityTask attaches the context
Python
mit
botify-labs/simpleflow,botify-labs/simpleflow
<INSERT> from sure import expect from simpleflow import activity from simpleflow.swf.task import ActivityTask @activity.with_attributes() def show_context_func(): <INSERT_END> <INSERT> return show_context_func.context @activity.with_attributes() class ShowContextCls(object): def execute(self): retu...
Add tests to ensure ActivityTask attaches the context
d8f1b1151ff917cad924bd6f8fac330602c259c9
warreport/__main__.py
warreport/__main__.py
import asyncio import logging from warreport import battle_monitor, battle_reporting logger = logging.getLogger("warreport") def main(): logger.info("Starting main loop.") logger.debug("Debug logging enabled.") loop = asyncio.get_event_loop() loop.run_until_complete(asyncio.gather( battle_mo...
import asyncio import logging import os from warreport import battle_monitor, battle_reporting logger = logging.getLogger("warreport") def main(): logger.info("Starting main loop.") logger.debug("Debug logging enabled.") loop = asyncio.get_event_loop() gathered_future = asyncio.gather( batt...
Make another try at graceful exiting.
Make another try at graceful exiting. This still does use os._exit() after all coroutines have finished, but it's significantly less spaghetti code, and it makes it nicer to exit the program.
Python
mit
daboross/screeps-warreport
<REPLACE_OLD> logging from <REPLACE_NEW> logging import os from <REPLACE_END> <REPLACE_OLD> loop.run_until_complete(asyncio.gather( <REPLACE_NEW> gathered_future = asyncio.gather( <REPLACE_END> <REPLACE_OLD> )) if <REPLACE_NEW> loop=loop, ) try: loop.run_until_complete(gathered_future) ex...
Make another try at graceful exiting. This still does use os._exit() after all coroutines have finished, but it's significantly less spaghetti code, and it makes it nicer to exit the program. import asyncio import logging from warreport import battle_monitor, battle_reporting logger = logging.getLogger("warreport")...
93057b0bf30e1d4c4449fb5f3322042bf74d76e5
satchmo/shop/management/commands/satchmo_copy_static.py
satchmo/shop/management/commands/satchmo_copy_static.py
from django.core.management.base import NoArgsCommand import os import shutil class Command(NoArgsCommand): help = "Copy the satchmo static directory and files to the local project." def handle_noargs(self, **options): import satchmo static_src = os.path.join(satchmo.__path__[0],'static') ...
from django.core.management.base import NoArgsCommand import os import shutil class Command(NoArgsCommand): help = "Copy the satchmo static directory and files to the local project." def handle_noargs(self, **options): import satchmo static_src = os.path.join(satchmo.__path__[0],'static') ...
Add an error check to static copying
Add an error check to static copying
Python
bsd-3-clause
grengojbo/satchmo,grengojbo/satchmo
<INSERT> if os.path.exists(static_dest): print "Static directory exists. You must manually copy the files you need." else: <INSERT_END> <INSERT> <INSERT_END> <|endoftext|> from django.core.management.base import NoArgsCommand import os import shutil class Command(NoArgsCommand): ...
Add an error check to static copying from django.core.management.base import NoArgsCommand import os import shutil class Command(NoArgsCommand): help = "Copy the satchmo static directory and files to the local project." def handle_noargs(self, **options): import satchmo static_src = os.path.j...
c6de39b01b8eac10edbb6f95d86285075bf8a9ab
conanfile.py
conanfile.py
from conans import ConanFile class ArgsConan(ConanFile): name = "cfgfile" version = "0.2.8.2" url = "https://github.com/igormironchik/cfgfile.git" license = "MIT" description = "Header-only library for reading/saving configuration files with schema defined in sources." exports = "cfgfile/*", "...
from conans import ConanFile, CMake class ArgsConan(ConanFile): name = "cfgfile" version = "0.2.8.2" url = "https://github.com/igormironchik/cfgfile.git" license = "MIT" description = "Header-only library for reading/saving configuration files with schema defined in sources." exports = "cfgfil...
Add build step into Conan recipe.
Add build step into Conan recipe.
Python
mit
igormironchik/cfgfile
<REPLACE_OLD> ConanFile class <REPLACE_NEW> ConanFile, CMake class <REPLACE_END> <REPLACE_OLD> "3rdparty/Args/Args/*.hpp" <REPLACE_NEW> "3rdparty/Args/Args/*.hpp" def build(self): cmake = CMake(self) cmake.configure(source_folder="generator") cmake.build() <REPLACE_END> <|endoft...
Add build step into Conan recipe. from conans import ConanFile class ArgsConan(ConanFile): name = "cfgfile" version = "0.2.8.2" url = "https://github.com/igormironchik/cfgfile.git" license = "MIT" description = "Header-only library for reading/saving configuration files with schema defined in sou...
8692eef51cf9b77aa0d6d09eec4bc4f36850d902
setup.py
setup.py
from setuptools import setup, find_packages setup( name='django-force-logout', url="https://chris-lamb.co.uk/projects/django-force-logout", version='2.0.0', description="Framework to be able to forcibly log users out of Django projects", author="Chris Lamb", author_email='chris@chris-lamb.co....
from setuptools import setup, find_packages setup( name='django-force-logout', url="https://chris-lamb.co.uk/projects/django-force-logout", version='2.0.0', description="Framework to be able to forcibly log users out of Django projects", author="Chris Lamb", author_email='chris@chris-lamb.co....
Update Django requirement to latest LTS
Update Django requirement to latest LTS
Python
bsd-3-clause
lamby/django-force-logout
<REPLACE_OLD> packages=find_packages(), ) <REPLACE_NEW> packages=find_packages(), install_requires=( 'Django>=1.8', ), ) <REPLACE_END> <|endoftext|> from setuptools import setup, find_packages setup( name='django-force-logout', url="https://chris-lamb.co.uk/projects/django-force-logout", ...
Update Django requirement to latest LTS from setuptools import setup, find_packages setup( name='django-force-logout', url="https://chris-lamb.co.uk/projects/django-force-logout", version='2.0.0', description="Framework to be able to forcibly log users out of Django projects", author="Chris Lamb...
fbaa823a58d20e6a6755382139d66bb962b4f181
fix_tags.py
fix_tags.py
import codecs from lxml import etree from bs4 import BeautifulSoup from emotools.bs4_helpers import act, sentence, word, speaker_turn, note import argparse import os import re import sys if __name__ == '__main__': folia = '/home/jvdzwaan/data/embem-annotatie/vinc001pefr02_01.xml' tag = '/home/jvdzwaan/data/em...
Add a script that fixes tag files
Add a script that fixes tag files The kaf files used for annotation were generated using folia files contain strange ids (starting with lg-added). Unfortunately, these folia files were not saved. Therefore, the word ids in the kaf files must be updated to the word ids in the new folia files. This script does that for ...
Python
apache-2.0
NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts
<REPLACE_OLD> <REPLACE_NEW> import codecs from lxml import etree from bs4 import BeautifulSoup from emotools.bs4_helpers import act, sentence, word, speaker_turn, note import argparse import os import re import sys if __name__ == '__main__': folia = '/home/jvdzwaan/data/embem-annotatie/vinc001pefr02_01.xml' ...
Add a script that fixes tag files The kaf files used for annotation were generated using folia files contain strange ids (starting with lg-added). Unfortunately, these folia files were not saved. Therefore, the word ids in the kaf files must be updated to the word ids in the new folia files. This script does that for ...
aada9a317eb8aed5dcd8ff6731692ef25ff52a67
packtets/graph/generator.py
packtets/graph/generator.py
import igraph def packing_graph(tets, vx, vy, vz, independent = 0): N = len(tets) g = igraph.Graph() g.add_vertices(N) for i in range(N): for j in range(max(i, independent),N): for s in tets[j].get_symetry(vx, vy, vz, include_self=(i != j)): if tets[i].collision(s): ...
import igraph def packing_graph(tets, vx, vy, vz, independent = 0): N = len(tets) for i in range(N-1, independent-1, -1): for s in tets[i].get_symetry(vx, vy, vz, include_self=False): if tets[i].collision(s): del tets[i] break N = len(tets) g = igraph.Graph...
Remove self-touching tets first to reduce collision load.
Remove self-touching tets first to reduce collision load.
Python
mit
maxhutch/packtets,maxhutch/packtets
<INSERT> N = len(tets) for i in range(N-1, independent-1, -1): for s in tets[i].get_symetry(vx, vy, vz, include_self=False): if tets[i].collision(s): del tets[i] break <INSERT_END> <REPLACE_OLD> break edges = g.get_edgelist() for i in range(N, -1, -1): ...
Remove self-touching tets first to reduce collision load. import igraph def packing_graph(tets, vx, vy, vz, independent = 0): N = len(tets) g = igraph.Graph() g.add_vertices(N) for i in range(N): for j in range(max(i, independent),N): for s in tets[j].get_symetry(vx, vy, vz, includ...
06a052c7f60fd413f39b8e313e44bfeea970896a
work/admin.py
work/admin.py
# -*- coding: utf-8 -*- from django.contrib import admin from django import forms from django.utils.translation import ugettext_lazy as _ from parler.admin import TranslatableTabularInline from adminsortable.admin import SortableTabularInline from cms.admin.placeholderadmin import PlaceholderAdminMixin from allink_cor...
# -*- coding: utf-8 -*- from django.contrib import admin from django import forms from parler.admin import TranslatableTabularInline from adminsortable.admin import SortableTabularInline from cms.admin.placeholderadmin import PlaceholderAdminMixin from allink_core.allink_base.admin import AllinkBaseAdminSortable from...
TEST allink_apps subtree - pulling
TEST allink_apps subtree - pulling
Python
bsd-3-clause
allink/allink-apps,allink/allink-apps
<REPLACE_OLD> forms from django.utils.translation import ugettext_lazy as _ from <REPLACE_NEW> forms from <REPLACE_END> <|endoftext|> # -*- coding: utf-8 -*- from django.contrib import admin from django import forms from parler.admin import TranslatableTabularInline from adminsortable.admin import SortableTabularInl...
TEST allink_apps subtree - pulling # -*- coding: utf-8 -*- from django.contrib import admin from django import forms from django.utils.translation import ugettext_lazy as _ from parler.admin import TranslatableTabularInline from adminsortable.admin import SortableTabularInline from cms.admin.placeholderadmin import P...
eb2f061574dadaa141047ad27a016ec96b36cf54
setup.py
setup.py
#!/usr/bin/env python try: from setuptools import setup extra = dict(test_suite="tests.test.suite", include_package_data=True) except ImportError: from distutils.core import setup extra = {} long_description = \ ''' A python library for console-based raw input-based questions with answers and extensiv...
#!/usr/bin/env python try: from setuptools import setup extra = dict(test_suite="tests.test.suite", include_package_data=True) except ImportError: from distutils.core import setup extra = {} long_description = \ ''' A python library for console-based raw input-based questions with answers and extensiv...
Update the project URL to point to github.
Update the project URL to point to github.
Python
lgpl-2.1
UMIACS/qav,raushan802/qav
<REPLACE_OLD> url='https://gitlab.umiacs.umd.edu/staff/qav', <REPLACE_NEW> url='https://github.com/UMIACS/qav', <REPLACE_END> <|endoftext|> #!/usr/bin/env python try: from setuptools import setup extra = dict(test_suite="tests.test.suite", include_package_data=True) except ImportError: from distutils.cor...
Update the project URL to point to github. #!/usr/bin/env python try: from setuptools import setup extra = dict(test_suite="tests.test.suite", include_package_data=True) except ImportError: from distutils.core import setup extra = {} long_description = \ ''' A python library for console-based raw inp...
d054180fe1ff5ff7f4a0bc5b62f8dfcbb15a9c09
winthrop/people/admin.py
winthrop/people/admin.py
from django.contrib import admin from .models import Person, Residence, RelationshipType, Relationship admin.site.register(Person) admin.site.register(Residence) admin.site.register(RelationshipType) admin.site.register(Relationship)
from django.contrib import admin from .models import Person, Residence, RelationshipType, Relationship class ResidenceInline(admin.TabularInline): '''Inline class for Residence''' model = Residence class PersonAdmin(admin.ModelAdmin): inlines = [ ResidenceInline ] admin.site.register(Pers...
Add residence as an inline to person/people
Add residence as an inline to person/people
Python
apache-2.0
Princeton-CDH/winthrop-django,Princeton-CDH/winthrop-django,Princeton-CDH/winthrop-django
<REPLACE_OLD> Relationship admin.site.register(Person) admin.site.register(Residence) admin.site.register(RelationshipType) admin.site.register(Relationship) <REPLACE_NEW> Relationship class ResidenceInline(admin.TabularInline): '''Inline class for Residence''' model = Residence class PersonAdmin(admin.M...
Add residence as an inline to person/people from django.contrib import admin from .models import Person, Residence, RelationshipType, Relationship admin.site.register(Person) admin.site.register(Residence) admin.site.register(RelationshipType) admin.site.register(Relationship)
f2ca059d6e3e9e593b053e6483ad071d58cc99d2
tests/core/admin.py
tests/core/admin.py
from django.contrib import admin from import_export.admin import ImportExportMixin from .models import Book, Category, Author class BookAdmin(ImportExportMixin, admin.ModelAdmin): pass admin.site.register(Book, BookAdmin) admin.site.register(Category) admin.site.register(Author)
from django.contrib import admin from import_export.admin import ImportExportMixin from .models import Book, Category, Author class BookAdmin(ImportExportMixin, admin.ModelAdmin): list_filter = ['categories', 'author'] admin.site.register(Book, BookAdmin) admin.site.register(Category) admin.site.register(Auth...
Add BookAdmin options in test app
Add BookAdmin options in test app
Python
bsd-2-clause
PetrDlouhy/django-import-export,copperleaftech/django-import-export,Akoten/django-import-export,daniell/django-import-export,pajod/django-import-export,piran/django-import-export,bmihelac/django-import-export,sergei-maertens/django-import-export,bmihelac/django-import-export,PetrDlouhy/django-import-export,copperleafte...
<REPLACE_OLD> pass admin.site.register(Book, <REPLACE_NEW> list_filter = ['categories', 'author'] admin.site.register(Book, <REPLACE_END> <|endoftext|> from django.contrib import admin from import_export.admin import ImportExportMixin from .models import Book, Category, Author class BookAdmin(ImportExportMixin,...
Add BookAdmin options in test app from django.contrib import admin from import_export.admin import ImportExportMixin from .models import Book, Category, Author class BookAdmin(ImportExportMixin, admin.ModelAdmin): pass admin.site.register(Book, BookAdmin) admin.site.register(Category) admin.site.register(Aut...
bcbe4f9d91ef386b5a09d99e9c0c22b4dfcdc09b
dmf_device_ui/__init__.py
dmf_device_ui/__init__.py
# -*- coding: utf-8 -*- import gtk import uuid def gtk_wait(wait_duration_s): gtk.main_iteration_do() def generate_plugin_name(prefix='plugin-'): ''' Generate unique plugin name. ''' return prefix + str(uuid.uuid4()).split('-')[0]
# -*- coding: utf-8 -*- from pygtkhelpers.utils import refresh_gui import uuid def gtk_wait(wait_duration_s): refresh_gui() def generate_plugin_name(prefix='plugin-'): ''' Generate unique plugin name. ''' return prefix + str(uuid.uuid4()).split('-')[0]
Use pygtkhelpers refresh_gui in gtk_wait
Use pygtkhelpers refresh_gui in gtk_wait
Python
lgpl-2.1
wheeler-microfluidics/dmf-device-ui
<REPLACE_OLD> -*- import gtk import <REPLACE_NEW> -*- from pygtkhelpers.utils import refresh_gui import <REPLACE_END> <REPLACE_OLD> gtk.main_iteration_do() def <REPLACE_NEW> refresh_gui() def <REPLACE_END> <|endoftext|> # -*- coding: utf-8 -*- from pygtkhelpers.utils import refresh_gui import uuid def gtk_wait(wa...
Use pygtkhelpers refresh_gui in gtk_wait # -*- coding: utf-8 -*- import gtk import uuid def gtk_wait(wait_duration_s): gtk.main_iteration_do() def generate_plugin_name(prefix='plugin-'): ''' Generate unique plugin name. ''' return prefix + str(uuid.uuid4()).split('-')[0]
ceb848021d5323b5bad8518ac7ed850a51fc89ca
raco/myrial/myrial_test.py
raco/myrial/myrial_test.py
import collections import math import unittest import raco.fakedb import raco.myrial.interpreter as interpreter import raco.myrial.parser as parser class MyrialTestCase(unittest.TestCase): def setUp(self): self.db = raco.fakedb.FakeDatabase() self.parser = parser.Parser() self.processor ...
import collections import math import unittest import raco.fakedb import raco.myrial.interpreter as interpreter import raco.myrial.parser as parser from raco.myrialang import compile_to_json class MyrialTestCase(unittest.TestCase): def setUp(self): self.db = raco.fakedb.FakeDatabase() self.parse...
Add compile_to_json invocation in Myrial test fixture
Add compile_to_json invocation in Myrial test fixture
Python
bsd-3-clause
uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco
<REPLACE_OLD> parser class <REPLACE_NEW> parser from raco.myrialang import compile_to_json class <REPLACE_END> <REPLACE_OLD> self.db.evaluate(plan) <REPLACE_NEW> json = compile_to_json(query, '', [('A', plan)]) self.db.evaluate(plan) <REPLACE_END> <|endoftext|> import collections import math import...
Add compile_to_json invocation in Myrial test fixture import collections import math import unittest import raco.fakedb import raco.myrial.interpreter as interpreter import raco.myrial.parser as parser class MyrialTestCase(unittest.TestCase): def setUp(self): self.db = raco.fakedb.FakeDatabase() ...
6b01cdc18fce9277991fc5628f1d6c904ad47ee6
BuildAndRun.py
BuildAndRun.py
import os import subprocess name = "gobuildmaster" current_hash = "" if os.path.isfile('hash'): current_hash = open('hash').readlines()[0] new_hash = os.popen('git rev-parse HEAD').readlines()[0] open('hash','w').write(new_hash) # Move the old version over for line in os.popen('cp ' + name + ' old' + name).r...
import os import subprocess name = "gobuildmaster" current_hash = "" if os.path.isfile('hash'): current_hash = open('hash').readlines()[0] new_hash = os.popen('git rev-parse HEAD').readlines()[0] open('hash','w').write(new_hash) # Move the old version over for line in os.popen('cp ' + name + ' old' + name).r...
Fix running detection for master
Fix running detection for master
Python
apache-2.0
brotherlogic/gobuildmaster,brotherlogic/gobuildmaster,brotherlogic/gobuildmaster
<REPLACE_OLD> name) running = len(os.popen('ps <REPLACE_NEW> name) lines = os.popen('ps <REPLACE_END> <REPLACE_OLD> name).readlines()) > 3 <REPLACE_NEW> name).readlines() running = False for line in lines: if "./" + name in line: running = True <REPLACE_END> <|endoftext|> import os import subprocess ...
Fix running detection for master import os import subprocess name = "gobuildmaster" current_hash = "" if os.path.isfile('hash'): current_hash = open('hash').readlines()[0] new_hash = os.popen('git rev-parse HEAD').readlines()[0] open('hash','w').write(new_hash) # Move the old version over for line in os.pop...
45ec0f85bf4b244738220b920dc2046183ba707e
setup.py
setup.py
""" Package configuration """ # pylint:disable=no-name-in-module, import-error from distutils.core import setup from setuptools import find_packages setup( name='IXWSAuth', version='0.1.1', author='Infoxchanhe Australia dev team', author_email='devs@infoxchange.net.au', packages=find_packages(), ...
""" Package configuration """ # pylint:disable=no-name-in-module, import-error from distutils.core import setup from setuptools import find_packages setup( name='IXWSAuth', version='0.1.1', author='Infoxchanhe Australia dev team', author_email='devs@infoxchange.net.au', packages=find_packages(), ...
Downgrade tastypie to test-only dependency
Downgrade tastypie to test-only dependency
Python
mit
infoxchange/ixwsauth
<DELETE> 'django-tastypie', <DELETE_END> <INSERT> 'django-tastypie', <INSERT_END> <|endoftext|> """ Package configuration """ # pylint:disable=no-name-in-module, import-error from distutils.core import setup from setuptools import find_packages setup( name='IXWSAuth', version='0.1.1', autho...
Downgrade tastypie to test-only dependency """ Package configuration """ # pylint:disable=no-name-in-module, import-error from distutils.core import setup from setuptools import find_packages setup( name='IXWSAuth', version='0.1.1', author='Infoxchanhe Australia dev team', author_email='devs@infoxchan...
cf2615c2488198bd9f904a4e65ac4fc0e0d6c475
insertion.py
insertion.py
import timeit def insertion(_list): '''Sorts a list via the insertion method.''' if type(_list) is not list: raise TypeError('Entire list must be numbers') for i in range(1, len(_list)): key = _list[i] if not isinstance(key, int): raise TypeError('Entire list must be nu...
import time def timed_func(func): """Decorator for timing our traversal methods.""" def timed(*args, **kwargs): start = time.time() result = func(*args, **kwargs) elapsed = time.time() - start # print "time expired: %s" % elapsed return (result, elapsed) return time...
Add timing to show time complexity.
Add timing to show time complexity.
Python
mit
bm5w/second_dataS
<REPLACE_OLD> timeit def <REPLACE_NEW> time def timed_func(func): """Decorator for timing our traversal methods.""" def timed(*args, **kwargs): start = time.time() result = func(*args, **kwargs) elapsed = time.time() - start # print "time expired: %s" % elapsed return ...
Add timing to show time complexity. import timeit def insertion(_list): '''Sorts a list via the insertion method.''' if type(_list) is not list: raise TypeError('Entire list must be numbers') for i in range(1, len(_list)): key = _list[i] if not isinstance(key, int): ra...
dbaf49af9553257c63f3374103ccdc1e6c40f20c
test/integration/ggrc_basic_permissions/test_undeleteable.py
test/integration/ggrc_basic_permissions/test_undeleteable.py
# Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: andraz@reciprocitylabs.com # Maintained By: andraz@reciprocitylabs.com """ Test that some objects cannot be deleted by anyone. """ from integratio...
Add a test for objects that cannot be deleted
Add a test for objects that cannot be deleted
Python
apache-2.0
josthkko/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,NejcZupec/ggrc-core,NejcZupec/ggrc-core,edofic/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,j0gurt/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,andrei-karaliona...
<REPLACE_OLD> <REPLACE_NEW> # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: andraz@reciprocitylabs.com # Maintained By: andraz@reciprocitylabs.com """ Test that some objects cannot be deleted by...
Add a test for objects that cannot be deleted
ee9b869f2bb43e00da7c208cc2cfc9641d631b1a
examples/canvas/repeat_texture.py
examples/canvas/repeat_texture.py
''' Demonstrate repeating textures ============================== This was a test to fix an issue with repeating texture and window reloading. ''' from kivy.app import App from kivy.uix.image import Image from kivy.properties import ObjectProperty from kivy.lang import Builder kv = ''' FloatLayout: canvas.before...
''' Demonstrate repeating textures ============================== This was a test to fix an issue with repeating texture and window reloading. ''' from kivy.app import App from kivy.uix.image import Image from kivy.uix.label import Label from kivy.properties import ObjectProperty, ListProperty from kivy.lang import B...
Add background color to size message.
Add background color to size message. Added a colored background to the label because it kept getting lost in the white ‘K’ field. Also changed the label color to cyan for readability.
Python
mit
jkankiewicz/kivy,bob-the-hamster/kivy,KeyWeeUsr/kivy,LogicalDash/kivy,ernstp/kivy,yoelk/kivy,jegger/kivy,LogicalDash/kivy,darkopevec/kivy,akshayaurora/kivy,gonzafirewall/kivy,rafalo1333/kivy,thezawad/kivy,bhargav2408/kivy,aron-bordin/kivy,Cheaterman/kivy,andnovar/kivy,MiyamotoAkira/kivy,youprofit/kivy,VinGarcia/kivy,el...
<INSERT> kivy.uix.label import Label from <INSERT_END> <REPLACE_OLD> ObjectProperty from <REPLACE_NEW> ObjectProperty, ListProperty from <REPLACE_END> <REPLACE_OLD> ''' FloatLayout: <REPLACE_NEW> ''' <LabelOnBackground>: canvas.before: Color: rgb: self.background Rectangle: ...
Add background color to size message. Added a colored background to the label because it kept getting lost in the white ‘K’ field. Also changed the label color to cyan for readability. ''' Demonstrate repeating textures ============================== This was a test to fix an issue with repeating texture and window...
f3a4a21b7e8c4b9d2c1983aec77c91f5193146a2
exp/recommendexp/SparsityExp.py
exp/recommendexp/SparsityExp.py
#Test if we can easily get the SVD of a set of matrices with low rank but under #a fixed structure import numpy import scipy.sparse from exp.util.SparseUtils import SparseUtils numpy.set_printoptions(suppress=True, precision=3, linewidth=150) shape = (15, 20) r = 10 k = 50 X, U, s, V = SparseUtils.generateSpar...
Test SVD of sparse matrix
Test SVD of sparse matrix
Python
bsd-3-clause
charanpald/APGL
<INSERT> #Test if we can easily get the SVD of a set of matrices with low rank but under #a fixed structure import numpy import scipy.sparse from exp.util.SparseUtils import SparseUtils numpy.set_printoptions(suppress=True, precision=3, linewidth=150) shape = (15, 20) r = 10 k = 50 X, U, s, V = SparseUtils.gen...
Test SVD of sparse matrix
f5b33f7e80176efeb0eb0d0ea6fc8a8c7463a429
corehq/motech/repeaters/management/commands/delete_duplicate_cancelled_records.py
corehq/motech/repeaters/management/commands/delete_duplicate_cancelled_records.py
import csv import datetime from collections import defaultdict from django.core.management.base import BaseCommand from corehq.util.couch import IterDB from corehq.motech.repeaters.const import RECORD_CANCELLED_STATE from corehq.motech.repeaters.models import RepeatRecord from corehq.motech.repeaters.dbaccessors impo...
Add management command to delete duplicate cancelled repeat records
Add management command to delete duplicate cancelled repeat records
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
<REPLACE_OLD> <REPLACE_NEW> import csv import datetime from collections import defaultdict from django.core.management.base import BaseCommand from corehq.util.couch import IterDB from corehq.motech.repeaters.const import RECORD_CANCELLED_STATE from corehq.motech.repeaters.models import RepeatRecord from corehq.mote...
Add management command to delete duplicate cancelled repeat records
1263bf8dd374afe04735948e767bb31813d99077
test/on_yubikey/cli_piv/test_read_write_object.py
test/on_yubikey/cli_piv/test_read_write_object.py
import os import unittest from ..framework import cli_test_suite from ykman.piv import OBJ from .util import DEFAULT_MANAGEMENT_KEY @cli_test_suite def additional_tests(ykman_cli): class ReadWriteObject(unittest.TestCase): def setUp(cls): ykman_cli('piv', 'reset', '-f') pass ...
Add test of PIV read/write object cycle
Add test of PIV read/write object cycle
Python
bsd-2-clause
Yubico/yubikey-manager,Yubico/yubikey-manager
<REPLACE_OLD> <REPLACE_NEW> import os import unittest from ..framework import cli_test_suite from ykman.piv import OBJ from .util import DEFAULT_MANAGEMENT_KEY @cli_test_suite def additional_tests(ykman_cli): class ReadWriteObject(unittest.TestCase): def setUp(cls): ykman_cli('piv', 'reset'...
Add test of PIV read/write object cycle
9aeebde15b5ad2d6526c9b62ab37cf0d890d167d
pbs/gen.py
pbs/gen.py
#!/usr/bin/env python3 #============================================================================== # author : Pavel Polishchuk # date : 19-08-2018 # version : # python_version : # copyright : Pavel Polishchuk 2018 # license : #===========================================...
Add script to run PBS jobs to create fragment database
Add script to run PBS jobs to create fragment database
Python
bsd-3-clause
DrrDom/crem,DrrDom/crem
<REPLACE_OLD> <REPLACE_NEW> #!/usr/bin/env python3 #============================================================================== # author : Pavel Polishchuk # date : 19-08-2018 # version : # python_version : # copyright : Pavel Polishchuk 2018 # license : #==============...
Add script to run PBS jobs to create fragment database
c252281ab4ba9570c8f54f3fff6e173cf4d60866
learning_journal/scripts/initializedb.py
learning_journal/scripts/initializedb.py
import os import sys import transaction from sqlalchemy import engine_from_config from pyramid.paster import ( get_appsettings, setup_logging, ) from pyramid.scripts.common import parse_vars from ..models import ( DBSession, Entry, Base, ) def usage(argv): cmd = os.path.basename(ar...
import os import sys import transaction from sqlalchemy import engine_from_config from pyramid.paster import ( get_appsettings, setup_logging, ) from pyramid.scripts.common import parse_vars from ..models import ( DBSession, Entry, Base, ) def usage(argv): cmd = os.path.basename(ar...
Remove multiple users capability from initailize_db
Remove multiple users capability from initailize_db
Python
mit
DZwell/learning_journal,DZwell/learning_journal,DZwell/learning_journal
<REPLACE_OLD> sys.exit(1) with transaction.manager: password = os.environ.get('ADMIN_PASSWORD', 'admin') encrypted = password_context.encrypt(password) admin = User(name=u'admin', password=encrypted) DBSession.add(admin) def <REPLACE_NEW> sys.exit(1) def <REPLACE_END> <|endoftext|> import os impo...
Remove multiple users capability from initailize_db import os import sys import transaction from sqlalchemy import engine_from_config from pyramid.paster import ( get_appsettings, setup_logging, ) from pyramid.scripts.common import parse_vars from ..models import ( DBSession, Entry, Base, ...
5b23140f2b9e6f24ddf6162cb0b110640bc3b203
Primes/pollard_rho.py
Primes/pollard_rho.py
import random def gcd( a, b): if(b == 0): return a; return gcd(b, a % b); def pollardRho(N): if N%2==0: return 2 x = random.randint(1, N-1) y = x c = random.randint(1, N-1) g = 1 while g==1: x = ((x*x)%N+c)%N ...
Add implementation pollardrho in python.
Add implementation pollardrho in python.
Python
mit
xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book
<INSERT> import random def gcd( a, b): <INSERT_END> <INSERT> if(b == 0): return a; return gcd(b, a % b); def pollardRho(N): if N%2==0: return 2 x = random.randint(1, N-1) y = x c = random.randint(1, N-1) g = 1 while g==1: ...
Add implementation pollardrho in python.
f34d0d43311e51bcb04c5cbdf5bb31b7a8093feb
pyconde/tagging.py
pyconde/tagging.py
""" This abstracts some of the functionality provided by django-taggit in order to normalize the tags provided by the users. """ from taggit import managers as taggit_managers def _normalize_tag(t): if isinstance(t, unicode): return t.lower() return t class _TaggableManager(taggit_managers._Taggabl...
""" This abstracts some of the functionality provided by django-taggit in order to normalize the tags provided by the users. """ from taggit import managers as taggit_managers def _normalize_tag(t): if isinstance(t, unicode): return t.lower() return t class _TaggableManager(taggit_managers._Taggabl...
Fix regression introduced by updating taggit (27971d6eed)
Fix regression introduced by updating taggit (27971d6eed) django-taggit 0.11+ introduced support for prefetch_related which breaks our taggit wrapping: alex/django-taggit@4f2e47f833
Python
bsd-3-clause
pysv/djep,pysv/djep,EuroPython/djep,pysv/djep,pysv/djep,pysv/djep,EuroPython/djep,EuroPython/djep,EuroPython/djep
<REPLACE_OLD> through=self.through, model=model, instance=instance <REPLACE_NEW> through=self.through, model=model, instance=instance, prefetch_cache_name=self.name <REPLACE_END> <|endoftext|> """ This abstracts some of the functionality provided by django-taggit in order to normal...
Fix regression introduced by updating taggit (27971d6eed) django-taggit 0.11+ introduced support for prefetch_related which breaks our taggit wrapping: alex/django-taggit@4f2e47f833 """ This abstracts some of the functionality provided by django-taggit in order to normalize the tags provided by the users. """ from t...
fb7754f15a8f0803c5417782e87d6fe153bf6d20
migrations/versions/201503061726_573faf4ac644_added_end_date_to_full_text_index_events.py
migrations/versions/201503061726_573faf4ac644_added_end_date_to_full_text_index_events.py
"""Added end_date to full text index events Revision ID: 573faf4ac644 Revises: 342fa3076650 Create Date: 2015-03-06 17:26:54.718493 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = '573faf4ac644' down_revision = '342fa3076650' def upgrade(): op.alter_colum...
"""Added end_date to full text index events Revision ID: 573faf4ac644 Revises: 342fa3076650 Create Date: 2015-03-06 17:26:54.718493 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = '573faf4ac644' down_revision = '342fa3076650' def upgrade(): op.alter_colum...
Use index name matching the current naming schema
Use index name matching the current naming schema
Python
mit
OmeGak/indico,mvidalgarcia/indico,pferreir/indico,indico/indico,DirkHoffmann/indico,indico/indico,mic4ael/indico,ThiefMaster/indico,ThiefMaster/indico,mvidalgarcia/indico,mic4ael/indico,DirkHoffmann/indico,ThiefMaster/indico,OmeGak/indico,indico/indico,OmeGak/indico,DirkHoffmann/indico,mvidalgarcia/indico,DirkHoffmann/...
<REPLACE_OLD> op.create_index('ix_start_date', <REPLACE_NEW> op.create_index('ix_events_event_index_start_date', <REPLACE_END> <REPLACE_OLD> op.create_index('ix_end_date', <REPLACE_NEW> op.create_index('ix_events_event_index_end_date', <REPLACE_END> <REPLACE_OLD> op.drop_index('ix_start_date', <REPLACE_NEW> op.drop_ind...
Use index name matching the current naming schema """Added end_date to full text index events Revision ID: 573faf4ac644 Revises: 342fa3076650 Create Date: 2015-03-06 17:26:54.718493 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = '573faf4ac644' down_revision =...
da6e9416e12ce71cd3f23ded9bd75dccc62d26fe
fcn/config.py
fcn/config.py
import os.path as osp def get_data_dir(): this_dir = osp.dirname(osp.abspath(__file__)) return osp.realpath(osp.join(this_dir, '../data')) def get_logs_dir(): this_dir = osp.dirname(osp.abspath(__file__)) return osp.realpath(osp.join(this_dir, '../logs'))
import os.path as osp def get_data_dir(): this_dir = osp.dirname(osp.abspath(__file__)) return osp.realpath(osp.join(this_dir, '_data'))
Move data directory in package
Move data directory in package
Python
mit
wkentaro/fcn
<REPLACE_OLD> '../data')) def get_logs_dir(): this_dir = osp.dirname(osp.abspath(__file__)) return osp.realpath(osp.join(this_dir, '../logs')) <REPLACE_NEW> '_data')) <REPLACE_END> <|endoftext|> import os.path as osp def get_data_dir(): this_dir = osp.dirname(osp.abspath(__file__)) return osp.real...
Move data directory in package import os.path as osp def get_data_dir(): this_dir = osp.dirname(osp.abspath(__file__)) return osp.realpath(osp.join(this_dir, '../data')) def get_logs_dir(): this_dir = osp.dirname(osp.abspath(__file__)) return osp.realpath(osp.join(this_dir, '../logs'))
85d71d8a5d7cdf34c12791b84c9f1bdec4ad1ed1
partner_compassion/wizards/portal_wizard.py
partner_compassion/wizards/portal_wizard.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __manifest__.py...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __manifest__.py...
Fix bug, set notify_email to always after create portal user
Fix bug, set notify_email to always after create portal user
Python
agpl-3.0
ecino/compassion-switzerland,CompassionCH/compassion-switzerland,ecino/compassion-switzerland,CompassionCH/compassion-switzerland,CompassionCH/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,ecino/compassion-switzerland
<INSERT> res = res_users.create(values) res.notify_email = 'always' <INSERT_END> <REPLACE_OLD> res_users.create(values) <REPLACE_NEW> res <REPLACE_END> <|endoftext|> # -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compa...
Fix bug, set notify_email to always after create portal user # -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@c...
68a61404105bff4e08a7d20a148da1107a8f27f0
learnwithpeople/urls.py
learnwithpeople/urls.py
from django.conf.urls import patterns, include, url from django.conf.urls.i18n import i18n_patterns from django.conf import settings from django.contrib import admin from django.views.generic import TemplateView urlpatterns = i18n_patterns('', url(r'^', include('studygroups.urls')), url(r'^interest/', include...
from django.conf.urls import patterns, include, url from django.conf.urls.i18n import i18n_patterns from django.conf import settings from django.contrib import admin from django.views.generic import TemplateView urlpatterns = i18n_patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^interest/', incl...
Fix custom URLs masking admin URL
Fix custom URLs masking admin URL
Python
mit
p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles
<REPLACE_OLD> url(r'^', include('studygroups.urls')), <REPLACE_NEW> url(r'^admin/', include(admin.site.urls)), <REPLACE_END> <DELETE> url(r'^admin/', include(admin.site.urls)), <DELETE_END> <REPLACE_OLD> include('uxhelpers.urls')) ) if <REPLACE_NEW> include('uxhelpers.urls')), url(r'^', include('studygroups....
Fix custom URLs masking admin URL from django.conf.urls import patterns, include, url from django.conf.urls.i18n import i18n_patterns from django.conf import settings from django.contrib import admin from django.views.generic import TemplateView urlpatterns = i18n_patterns('', url(r'^', include('studygroups.urls...
c18f21995ff76681fdfa7e511019f5f27bfea749
playserver/trackchecker.py
playserver/trackchecker.py
from threading import Timer from . import track _listeners = [] class TrackChecker(): def __init__(self, interval = 5): self.listeners = [] self.CHECK_INTERVAL = interval self.currentSong = "" self.currentArtist = "" self.currentAlbum = "" self.timer = None def checkSong(self): song = track.getCurren...
from threading import Timer from . import track _listeners = [] class TrackChecker(): def __init__(self, interval = 5): self.listeners = [] self.CHECK_INTERVAL = interval self.currentSong = "" self.currentArtist = "" self.currentAlbum = "" self.timer = None def checkSong(self): song = track.getCurren...
Send data in trackChecker callbacks
Send data in trackChecker callbacks
Python
mit
ollien/playserver,ollien/playserver,ollien/playserver
<REPLACE_OLD> _callListeners(self): for <REPLACE_NEW> _callListeners(self): data = { "song": track.getCurrentSong(), "artist": track.getCurrentArtist(), "album": track.getCurrentAlbum() } for <REPLACE_END> <REPLACE_OLD> _listeners: listener() def <REPLACE_NEW> _listeners: listener(data) def ...
Send data in trackChecker callbacks from threading import Timer from . import track _listeners = [] class TrackChecker(): def __init__(self, interval = 5): self.listeners = [] self.CHECK_INTERVAL = interval self.currentSong = "" self.currentArtist = "" self.currentAlbum = "" self.timer = None def chec...
e86901ac2b074d42d2e388353bbe60fcdd8f0240
wagtail/contrib/postgres_search/apps.py
wagtail/contrib/postgres_search/apps.py
from django.apps import AppConfig from django.core.checks import Error, Tags, register from .utils import get_postgresql_connections, set_weights class PostgresSearchConfig(AppConfig): name = 'wagtail.contrib.postgres_search' def ready(self): @register(Tags.compatibility, Tags.database) def ...
from django.apps import AppConfig from django.core.checks import Error, Tags, register from .utils import get_postgresql_connections, set_weights class PostgresSearchConfig(AppConfig): name = 'wagtail.contrib.postgres_search' default_auto_field = 'django.db.models.AutoField' def ready(self): @re...
Set default_auto_field in wagtail.contrib.postgres_search AppConfig
Set default_auto_field in wagtail.contrib.postgres_search AppConfig Add default_auto_field = 'django.db.models.AutoField' Co-authored-by: Nick Moreton <7f1a4658c80dbc9331efe1b3861c4063f4838748@torchbox.com>
Python
bsd-3-clause
jnns/wagtail,zerolab/wagtail,gasman/wagtail,gasman/wagtail,gasman/wagtail,rsalmaso/wagtail,rsalmaso/wagtail,thenewguy/wagtail,thenewguy/wagtail,jnns/wagtail,jnns/wagtail,rsalmaso/wagtail,wagtail/wagtail,mixxorz/wagtail,torchbox/wagtail,jnns/wagtail,gasman/wagtail,thenewguy/wagtail,thenewguy/wagtail,wagtail/wagtail,mixx...
<REPLACE_OLD> 'wagtail.contrib.postgres_search' <REPLACE_NEW> 'wagtail.contrib.postgres_search' default_auto_field = 'django.db.models.AutoField' <REPLACE_END> <|endoftext|> from django.apps import AppConfig from django.core.checks import Error, Tags, register from .utils import get_postgresql_connections, set...
Set default_auto_field in wagtail.contrib.postgres_search AppConfig Add default_auto_field = 'django.db.models.AutoField' Co-authored-by: Nick Moreton <7f1a4658c80dbc9331efe1b3861c4063f4838748@torchbox.com> from django.apps import AppConfig from django.core.checks import Error, Tags, register from .utils import ge...
ce29f011a72bf695c9b0840ad4c121f85c9fcad1
mica/stats/tests/test_guide_stats.py
mica/stats/tests/test_guide_stats.py
import tempfile import os from .. import guide_stats def test_calc_stats(): guide_stats.calc_stats(17210) def test_make_gui_stats(): """ Save the guide stats for one obsid into a newly-created table """ # Get a temporary file, but then delete it, because _save_acq_stats will only # make a n...
import tempfile import os from .. import guide_stats def test_calc_stats(): guide_stats.calc_stats(17210) def test_calc_stats_with_bright_trans(): s = guide_stats.calc_stats(17472) # Assert that the std on the slot 7 residuals are reasonable # even in this obsid that had a transition to BRIT ass...
Add test to confirm more reasonable residual std on one obsid/slot
Add test to confirm more reasonable residual std on one obsid/slot
Python
bsd-3-clause
sot/mica,sot/mica
<REPLACE_OLD> guide_stats.calc_stats(17210) def <REPLACE_NEW> guide_stats.calc_stats(17210) def test_calc_stats_with_bright_trans(): s = guide_stats.calc_stats(17472) # Assert that the std on the slot 7 residuals are reasonable # even in this obsid that had a transition to BRIT assert s[1][7]['dr_std...
Add test to confirm more reasonable residual std on one obsid/slot import tempfile import os from .. import guide_stats def test_calc_stats(): guide_stats.calc_stats(17210) def test_make_gui_stats(): """ Save the guide stats for one obsid into a newly-created table """ # Get a temporary file, ...
1696a97a735b3eb26ddaf445c4258e0faac880a4
lintcode/Medium/098_Sort_List.py
lintcode/Medium/098_Sort_List.py
""" Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next """ class Solution: """ @param head: The first node of the linked list. @return: You should return the head of the sorted linked list, using constant ...
Add solution to lintcode question 98
Add solution to lintcode question 98
Python
mit
Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode
<REPLACE_OLD> <REPLACE_NEW> """ Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next """ class Solution: """ @param head: The first node of the linked list. @return: You should return the head of the sorted linked list, ...
Add solution to lintcode question 98
9db5e0d8a17f250e0d1a9acbcd070876a418c228
aleph/migrate/versions/af9b37868cf3_remove_doc_tables.py
aleph/migrate/versions/af9b37868cf3_remove_doc_tables.py
"""Remove document-related tables Revision ID: af9b37868cf3 Revises: 284a9ec16306 Create Date: 2019-06-13 17:45:43.310462 """ from alembic import op # revision identifiers, used by Alembic. revision = 'af9b37868cf3' down_revision = '284a9ec16306' def upgrade(): op.drop_index('ix_document_tag_document_id', table...
Remove document tables and audit table
Remove document tables and audit table
Python
mit
alephdata/aleph,pudo/aleph,alephdata/aleph,pudo/aleph,pudo/aleph,alephdata/aleph,alephdata/aleph,alephdata/aleph
<INSERT> """Remove document-related tables Revision ID: af9b37868cf3 Revises: 284a9ec16306 Create Date: 2019-06-13 17:45:43.310462 """ from alembic import op # revision identifiers, used by Alembic. revision = 'af9b37868cf3' down_revision = '284a9ec16306' def upgrade(): <INSERT_END> <INSERT> op.drop_index('ix_do...
Remove document tables and audit table
6ef190887b38df4f5212a8a7017e002051734c9f
lokar/bib.py
lokar/bib.py
# coding=utf-8 from __future__ import unicode_literals from .marc import Record from .util import etree, parse_xml, show_diff class Bib(object): """ An Alma Bib record """ def __init__(self, alma, xml): self.alma = alma self.orig_xml = xml.encode('utf-8') self.init(xml) def in...
# coding=utf-8 from __future__ import unicode_literals from io import BytesIO from .marc import Record from .util import etree, parse_xml, show_diff class Bib(object): """ An Alma Bib record """ def __init__(self, alma, xml): self.alma = alma self.orig_xml = xml.encode('utf-8') sel...
Add xml header and post data as stream-like object just to be sure
Add xml header and post data as stream-like object just to be sure
Python
agpl-3.0
scriptotek/almar,scriptotek/lokar
<REPLACE_OLD> unicode_literals from <REPLACE_NEW> unicode_literals from io import BytesIO from <REPLACE_END> <INSERT> ('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'.encode('utf-8') + <INSERT_END> <REPLACE_OLD> encoding='UTF-8') <REPLACE_NEW> encoding='UTF-8')) <REPLACE_END> <REP...
Add xml header and post data as stream-like object just to be sure # coding=utf-8 from __future__ import unicode_literals from .marc import Record from .util import etree, parse_xml, show_diff class Bib(object): """ An Alma Bib record """ def __init__(self, alma, xml): self.alma = alma se...
6f103bd78f188c2a090c6dd522884c361e85d832
cyder/cydhcp/validation.py
cyder/cydhcp/validation.py
# encoding: utf-8 from django.core.exceptions import ValidationError import re ERROR_TOO_LONG = 'MAC address is too long' mac_pattern = re.compile(r'^([0-9a-f]{2}:){5}[0-9a-f]{2}$') def validate_mac(mac): if mac == ERROR_TOO_LONG: raise ValidationError(ERROR_TOO_LONG) elif mac == '00:00:00:00:00:00...
# encoding: utf-8 from django.core.exceptions import ValidationError import re ERROR_TOO_LONG = 'MAC address is too long' mac_pattern = re.compile(r'^([0-9a-f]{2}:){5}[0-9a-f]{2}$') def validate_mac(mac): if mac == ERROR_TOO_LONG: raise ValidationError(ERROR_TOO_LONG) elif mac == '00:00:00:00:00:00...
Validate dynamic interface's range's container, not dynamic interface's range's domain's container.
Validate dynamic interface's range's container, not dynamic interface's range's domain's container.
Python
bsd-3-clause
drkitty/cyder,akeym/cyder,OSU-Net/cyder,akeym/cyder,OSU-Net/cyder,akeym/cyder,akeym/cyder,drkitty/cyder,drkitty/cyder,OSU-Net/cyder,drkitty/cyder,OSU-Net/cyder
<REPLACE_OLD> dynamic.range.domain.ctnr_set.all(): <REPLACE_NEW> dynamic.range.ctnr_set.all(): <REPLACE_END> <DELETE> domain's <DELETE_END> <|endoftext|> # encoding: utf-8 from django.core.exceptions import ValidationError import re ERROR_TOO_LONG = 'MAC address is too long' mac_pattern = re.compile(r'^([0-9a-f]{2...
Validate dynamic interface's range's container, not dynamic interface's range's domain's container. # encoding: utf-8 from django.core.exceptions import ValidationError import re ERROR_TOO_LONG = 'MAC address is too long' mac_pattern = re.compile(r'^([0-9a-f]{2}:){5}[0-9a-f]{2}$') def validate_mac(mac): if ma...
f574a74f99d1b8aa0fa107ba2416699104d1f36d
inspector/cbv/templatetags/cbv_tags.py
inspector/cbv/templatetags/cbv_tags.py
from django import template from django.conf import settings register = template.Library() @register.filter def called_same(qs, name): return [item for item in qs if item.name==name]
Add filter that gets items with the same .name from a list.
Add filter that gets items with the same .name from a list.
Python
bsd-2-clause
abhijo89/django-cbv-inspector,refreshoxford/django-cbv-inspector,abhijo89/django-cbv-inspector,abhijo89/django-cbv-inspector,refreshoxford/django-cbv-inspector,refreshoxford/django-cbv-inspector,refreshoxford/django-cbv-inspector,abhijo89/django-cbv-inspector
<INSERT> from django import template from django.conf import settings register = template.Library() @register.filter def called_same(qs, name): <INSERT_END> <INSERT> return [item for item in qs if item.name==name] <INSERT_END> <|endoftext|> from django import template from django.conf import settings register =...
Add filter that gets items with the same .name from a list.
5a7bf12879c637f72c78d5f0a3e45915dd08711a
setup.py
setup.py
#!/usr/bin/env python import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist bdist_wininst upload -r pypi') sys.exit() with open('README.rst') as f: readme = f.read() with open('LI...
#!/usr/bin/env python import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist bdist_wininst upload -r pypi') sys.exit() with open('README.rst') as f: readme = f.read() with open('LI...
Add django-filter to the required packages
Add django-filter to the required packages
Python
mit
danxshap/django-rest-surveys
<REPLACE_OLD> 'djangorestframework>=3.0', <REPLACE_NEW> 'django-inline-ordering', <REPLACE_END> <REPLACE_OLD> 'django-inline-ordering', <REPLACE_NEW> 'django-filter<=0.11.0', 'djangorestframework>=3.0', <REPLACE_END> <|endoftext|> #!/usr/bin/env python import os import sys try: from setuptools import ...
Add django-filter to the required packages #!/usr/bin/env python import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist bdist_wininst upload -r pypi') sys.exit() with open('README.rst...
c1e3024527c372c09b77a97befbdf5a3d39a69ac
tests/test_status.py
tests/test_status.py
from ophyd.controls.ophydobj import StatusBase def _setup_st(): st = StatusBase() state = {} def cb(): state['done'] = True return st, state, cb def test_status_post(): st, state, cb = _setup_st() assert 'done' not in state st.finished_cb = cb assert 'done' not in state ...
from ophyd.ophydobj import StatusBase def _setup_st(): st = StatusBase() state = {} def cb(): state['done'] = True return st, state, cb def test_status_post(): st, state, cb = _setup_st() assert 'done' not in state st.finished_cb = cb assert 'done' not in state st._fin...
Remove new instnace of 'controls' from status test.
FIX: Remove new instnace of 'controls' from status test.
Python
bsd-3-clause
dchabot/ophyd,dchabot/ophyd
<REPLACE_OLD> ophyd.controls.ophydobj <REPLACE_NEW> ophyd.ophydobj <REPLACE_END> <|endoftext|> from ophyd.ophydobj import StatusBase def _setup_st(): st = StatusBase() state = {} def cb(): state['done'] = True return st, state, cb def test_status_post(): st, state, cb = _setup_st() ...
FIX: Remove new instnace of 'controls' from status test. from ophyd.controls.ophydobj import StatusBase def _setup_st(): st = StatusBase() state = {} def cb(): state['done'] = True return st, state, cb def test_status_post(): st, state, cb = _setup_st() assert 'done' not in state...
139675bc644b796f4b472b3a8d9abd90205204c4
bands_inspect/__init__.py
bands_inspect/__init__.py
# -*- coding: utf-8 -*- # (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik # Author: Dominik Gresch <greschd@gmx.ch> """ A tool for modifying, comparing and plotting electronic bandstructures. """ from . import kpoints from . import eigenvals from . import compare from . import lattice from . import plot ...
# -*- coding: utf-8 -*- # (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik # Author: Dominik Gresch <greschd@gmx.ch> """ A tool for modifying, comparing and plotting electronic bandstructures. """ from . import kpoints from . import eigenvals from . import compare from . import lattice from . import plot ...
Change version number to 0.2.2.
Change version number to 0.2.2.
Python
apache-2.0
Z2PackDev/bands_inspect,Z2PackDev/bands_inspect
<REPLACE_OLD> '0.2.1' <REPLACE_NEW> '0.2.2' <REPLACE_END> <|endoftext|> # -*- coding: utf-8 -*- # (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik # Author: Dominik Gresch <greschd@gmx.ch> """ A tool for modifying, comparing and plotting electronic bandstructures. """ from . import kpoints from . import...
Change version number to 0.2.2. # -*- coding: utf-8 -*- # (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik # Author: Dominik Gresch <greschd@gmx.ch> """ A tool for modifying, comparing and plotting electronic bandstructures. """ from . import kpoints from . import eigenvals from . import compare from . i...
b84105415cf074e76cb2c227e81287e853acb451
tdt/__init__.py
tdt/__init__.py
import logging logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) from dsp_project import DSPProject from dsp_process import DSPProcess from dsp_circuit import DSPCircuit from dsp_buffer import DSPBuffer from dsp_error import DSPError
import logging # Although Python 2.7+ has a logging.NullHandler class available, we should at # least maintain backwards-compatibility with Python 2.6 so that ReadTheDocs.org # can generate our autodocumentation. class NullHandler(logging.Handler): def emit(self, record): pass logger = logging.getL...
Switch to built-in NullHandler class for Python 2.6 compatibility
Switch to built-in NullHandler class for Python 2.6 compatibility
Python
bsd-3-clause
LABSN/tdtpy
<REPLACE_OLD> logging logger <REPLACE_NEW> logging # Although Python 2.7+ has a logging.NullHandler class available, we should at # least maintain backwards-compatibility with Python 2.6 so that ReadTheDocs.org # can generate our autodocumentation. class NullHandler(logging.Handler): def emit(self, record):...
Switch to built-in NullHandler class for Python 2.6 compatibility import logging logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) from dsp_project import DSPProject from dsp_process import DSPProcess from dsp_circuit import DSPCircuit from dsp_buffer import DSPBuffer from dsp_erro...
fc3f2e2f9fdf8a19756bbf8b5bd1442b71ac3a87
scrapi/settings/__init__.py
scrapi/settings/__init__.py
import logging from raven import Client from fluent import sender from raven.contrib.celery import register_signal from scrapi.settings.defaults import * from scrapi.settings.local import * logging.basicConfig(level=logging.INFO) logging.getLogger('requests.packages.urllib3.connectionpool').setLevel(logging.WARNING...
import logging from raven import Client from fluent import sender from raven.contrib.celery import register_signal from scrapi.settings.defaults import * from scrapi.settings.local import * logging.basicConfig(level=logging.INFO) logging.getLogger('requests.packages.urllib3.connectionpool').setLevel(logging.WARNING...
Add new place to look for celery tasks
Add new place to look for celery tasks
Python
apache-2.0
CenterForOpenScience/scrapi,erinspace/scrapi,felliott/scrapi,mehanig/scrapi,fabianvf/scrapi,mehanig/scrapi,felliott/scrapi,jeffreyliu3230/scrapi,erinspace/scrapi,CenterForOpenScience/scrapi,alexgarciac/scrapi,fabianvf/scrapi,ostwald/scrapi,icereval/scrapi
<REPLACE_OLD> ) <REPLACE_NEW> 'scrapi.migrations') <REPLACE_END> <|endoftext|> import logging from raven import Client from fluent import sender from raven.contrib.celery import register_signal from scrapi.settings.defaults import * from scrapi.settings.local import * logging.basicConfig(level=logging.INFO) loggi...
Add new place to look for celery tasks import logging from raven import Client from fluent import sender from raven.contrib.celery import register_signal from scrapi.settings.defaults import * from scrapi.settings.local import * logging.basicConfig(level=logging.INFO) logging.getLogger('requests.packages.urllib3.c...
8c528fb604c67a06ec8babb0ad595a9693993451
api/projects/tasks.py
api/projects/tasks.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import logging from api.settings import CeleryTasks, Intervals from api.celery_api import app as celery_app from experiments.tasks import build_experiment from projects.models import ExperimentGroup logger = logging.getLogger('p...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import logging from api.settings import CeleryTasks, Intervals from api.celery_api import app as celery_app from experiments.tasks import build_experiment from projects.models import ExperimentGroup logger = logging.getLogger('p...
Fix issue with celery rescheduling task
Fix issue with celery rescheduling task
Python
apache-2.0
polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon
<REPLACE_OLD> start_group_experiments(task, <REPLACE_NEW> start_group_experiments(self, <REPLACE_END> <REPLACE_OLD> task.apply_async(experiment_group_id, countdown=Intervals.EXPERIMENTS_SCHEDULER) <REPLACE_NEW> self.retry(countdown=Intervals.EXPERIMENTS_SCHEDULER) <REPLACE_END> <|endoftext|> # -*- coding: utf-8 -*- f...
Fix issue with celery rescheduling task # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import logging from api.settings import CeleryTasks, Intervals from api.celery_api import app as celery_app from experiments.tasks import build_experiment from projects.models import Exper...
42bd3f35445e5995b0affc61c4b5a4c226587ae4
debugtools/__init__.py
debugtools/__init__.py
# following PEP 440 __version__ = "1.5" VERSION = (1, 5) import django if django.VERSION < (1,9): # Make sure the ``{% print %}`` is always available, even without a {% load debugtools_tags %} call. # This feature is no longer available in Django 1.9, which adds an explicit configuration for it: # see: ht...
# following PEP 440 __version__ = "1.5" VERSION = (1, 5) import django if django.VERSION < (1,9): # Make sure the ``{% print %}`` is always available, even without a {% load debugtools_tags %} call. # This feature is no longer available in Django 1.9, which adds an explicit configuration for it: # see: ht...
Fix own deprecation warning for django < 1.9
Fix own deprecation warning for django < 1.9
Python
apache-2.0
edoburu/django-debugtools,edoburu/django-debugtools,edoburu/django-debugtools
<REPLACE_OLD> add_to_builtins("debugtools.templatetags.debug_tags") <REPLACE_NEW> add_to_builtins("debugtools.templatetags.debugtools_tags") <REPLACE_END> <|endoftext|> # following PEP 440 __version__ = "1.5" VERSION = (1, 5) import django if django.VERSION < (1,9): # Make sure the ``{% print %}`` is always ava...
Fix own deprecation warning for django < 1.9 # following PEP 440 __version__ = "1.5" VERSION = (1, 5) import django if django.VERSION < (1,9): # Make sure the ``{% print %}`` is always available, even without a {% load debugtools_tags %} call. # This feature is no longer available in Django 1.9, which adds a...
74e75cba3c923bc4aea9a7f1c4f387d29227f003
pyramid_jsonapi/version.py
pyramid_jsonapi/version.py
#!/usr/bin/env python # Source: https://github.com/Changaco/version.py from os.path import dirname, isdir, join import re from subprocess import CalledProcessError, check_output PREFIX = '' tag_re = re.compile(r'\btag: %s([0-9][^,]*)\b' % PREFIX) version_re = re.compile('^Version: (.+)$', re.M) def get_version():...
#!/usr/bin/env python # Source: https://github.com/Changaco/version.py from os.path import dirname, isdir, join import re from subprocess import CalledProcessError, check_output PREFIX = '' tag_re = re.compile(r'\btag: %s([0-9][^,]*)\b' % PREFIX) version_re = re.compile('^Version: (.+)$', re.M) def get_version():...
Make inbetween tag releases 'dev', not 'post'.
Make inbetween tag releases 'dev', not 'post'.
Python
agpl-3.0
colinhiggs/pyramid-jsonapi,colinhiggs/pyramid-jsonapi
<REPLACE_OLD> '.post'.join(version.split('-')[:2]) <REPLACE_NEW> '.dev'.join(version.split('-')[:2]) <REPLACE_END> <|endoftext|> #!/usr/bin/env python # Source: https://github.com/Changaco/version.py from os.path import dirname, isdir, join import re from subprocess import CalledProcessError, check_output PREFIX...
Make inbetween tag releases 'dev', not 'post'. #!/usr/bin/env python # Source: https://github.com/Changaco/version.py from os.path import dirname, isdir, join import re from subprocess import CalledProcessError, check_output PREFIX = '' tag_re = re.compile(r'\btag: %s([0-9][^,]*)\b' % PREFIX) version_re = re.compi...
8b538c452242050e468b71ca937e3d4feb57887b
mopidy/backends/stream/__init__.py
mopidy/backends/stream/__init__.py
from __future__ import unicode_literals import mopidy from mopidy import ext __doc__ = """A backend for playing music for streaming music. This backend will handle streaming of URIs in :attr:`mopidy.settings.STREAM_PROTOCOLS` assuming the right plugins are installed. **Issues:** https://github.com/mopidy/mopidy/i...
from __future__ import unicode_literals import mopidy from mopidy import ext from mopidy.utils import config, formatting default_config = """ [ext.stream] # If the stream extension should be enabled or not enabled = true # Whitelist of URI schemas to support streaming from protocols = http https mms ...
Add default config and config schema
stream: Add default config and config schema
Python
apache-2.0
tkem/mopidy,jcass77/mopidy,jmarsik/mopidy,ZenithDK/mopidy,swak/mopidy,vrs01/mopidy,diandiankan/mopidy,quartz55/mopidy,adamcik/mopidy,abarisain/mopidy,liamw9534/mopidy,vrs01/mopidy,tkem/mopidy,dbrgn/mopidy,liamw9534/mopidy,SuperStarPL/mopidy,diandiankan/mopidy,abarisain/mopidy,glogiotatidis/mopidy,hkariti/mopidy,mopidy/...
<REPLACE_OLD> ext __doc__ <REPLACE_NEW> ext from mopidy.utils import config, formatting default_config = """ [ext.stream] # If the stream extension should be enabled or not enabled = true # Whitelist of URI schemas to support streaming from protocols = http https mms rtmp rtmps rtsp """ _...
stream: Add default config and config schema from __future__ import unicode_literals import mopidy from mopidy import ext __doc__ = """A backend for playing music for streaming music. This backend will handle streaming of URIs in :attr:`mopidy.settings.STREAM_PROTOCOLS` assuming the right plugins are installed. *...
fe54d298fb3a922d28934b8fa2cdc863334b35b3
src/webassets/filter/stylus.py
src/webassets/filter/stylus.py
from webassets.filter import ExternalTool, option __all__ = ('Stylus',) class Stylus(ExternalTool): """Converts `Stylus <http://learnboost.github.com/stylus/>`_ markup to CSS. Requires the Stylus executable to be available externally. You can install it using the `Node Package Manager <http://npmjs.org...
import os from webassets.filter import ExternalTool, option __all__ = ('Stylus',) class Stylus(ExternalTool): """Converts `Stylus <http://learnboost.github.com/stylus/>`_ markup to CSS. Requires the Stylus executable to be available externally. You can install it using the `Node Package Manager <http:/...
Update Stylus filter with include paths
Update Stylus filter with include paths Since the Stylus filter works with stdin, the compiler doesn't know the source directory, and thus can't resolve any imports. This adds the source directory to the include path using the `--include` option, and also adds the `STYLUS_EXTRA_PATHS` option to configure any extra ...
Python
bsd-2-clause
glorpen/webassets,florianjacob/webassets,scorphus/webassets,aconrad/webassets,heynemann/webassets,wijerasa/webassets,scorphus/webassets,john2x/webassets,florianjacob/webassets,heynemann/webassets,JDeuce/webassets,john2x/webassets,aconrad/webassets,wijerasa/webassets,JDeuce/webassets,0x1997/webassets,glorpen/webassets,0...
<REPLACE_OLD> from <REPLACE_NEW> import os from <REPLACE_END> <INSERT> STYLUS_EXTRA_PATHS A Python list of any additional import paths. <INSERT_END> <INSERT> type=list), 'extra_paths': option('STYLUS_EXTRA_PATHS', <INSERT_END> <INSERT> source_dir = os.path.dirname(kwargs['source_path...
Update Stylus filter with include paths Since the Stylus filter works with stdin, the compiler doesn't know the source directory, and thus can't resolve any imports. This adds the source directory to the include path using the `--include` option, and also adds the `STYLUS_EXTRA_PATHS` option to configure any extra ...
f4f4d799409e4869276b84f032e60cdf516fcaf6
src/subcmds/init.py
src/subcmds/init.py
#! /usr/bin/env python import os import subprocess import config NAME="init" HELP="give git issues" def execute(args): # Check to see if the .ghi directories have already been created # If it doesn't exist, create it. if os.path.isdir(config.GHI_DIR) == False: os.makedirs(config.GHI_DIR) os.makedirs(config.IS...
#! /usr/bin/env python import config import os NAME="init" HELP="give git issues" def execute(args): # Check to see if the .ghi directories have already been created # If it doesn't exist, create it. if os.path.isdir(config.GHI_DIR) == False: os.makedirs(config.GHI_DIR) os.makedirs(config.ISSUES_DIR) elif os...
Remove no longer needed import
Remove no longer needed import
Python
apache-2.0
lorneliechty/ghi,lorneliechty/ghi
<REPLACE_OLD> os import subprocess import config NAME="init" HELP="give <REPLACE_NEW> config import os NAME="init" HELP="give <REPLACE_END> <|endoftext|> #! /usr/bin/env python import config import os NAME="init" HELP="give git issues" def execute(args): # Check to see if the .ghi directories have already been cr...
Remove no longer needed import #! /usr/bin/env python import os import subprocess import config NAME="init" HELP="give git issues" def execute(args): # Check to see if the .ghi directories have already been created # If it doesn't exist, create it. if os.path.isdir(config.GHI_DIR) == False: os.makedirs(config....
45bbd9c64fb19d22a04b19c3bc61081e38e154a3
mail_corpus.py
mail_corpus.py
import sys import mailbox import mail_parser import nltk import itertools try: import cPickle as pickle except ImportError: import pickle def main(): """Extract the texts of emails from a specified mailbox and from a specified set of senders and write corpus.txt. Usage: python mail_corpus.py outpu...
import sys import mailbox import mail_parser import nltk import itertools try: import cPickle as pickle except ImportError: import pickle def main(): """Extract the texts of emails from a specified mailbox and from a specified set of senders and write corpus.txt. Usage: python mail_corpus.py mboxf...
Switch back to always write corpus.txt
Switch back to always write corpus.txt
Python
mit
RawPlutonium/BaymaxKE
<DELETE> output <DELETE_END> <REPLACE_OLD> mailbox.mbox(sys.argv[2]) <REPLACE_NEW> mailbox.mbox(sys.argv[1]) <REPLACE_END> <REPLACE_OLD> set(sys.argv[3:]) <REPLACE_NEW> set(sys.argv[2:]) <REPLACE_END> <REPLACE_OLD> open(sys.argv[1], <REPLACE_NEW> open("corpus.txt", <REPLACE_END> <|endoftext|> import sys import mail...
Switch back to always write corpus.txt import sys import mailbox import mail_parser import nltk import itertools try: import cPickle as pickle except ImportError: import pickle def main(): """Extract the texts of emails from a specified mailbox and from a specified set of senders and write corpus.txt....
d9351b85301e701b7054acf57fb3be6b1a6cac01
build_recipes.py
build_recipes.py
import argparse import subprocess parser = argparse.ArgumentParser() parser.add_argument("package_list", help="List of packages for which" + " recipies will be created") args = parser.parse_args() package_names = [package.strip() for package in open(args.package_list, 'r').readlin...
Add script to build conda recipes
Add script to build conda recipes Signed-off-by: Harsh Gupta <c4bd8559369e527b4bb1785ff84e8ff50fde87c0@gmail.com>
Python
bsd-3-clause
ContinuumIO/pypi-conda-builds
<REPLACE_OLD> <REPLACE_NEW> import argparse import subprocess parser = argparse.ArgumentParser() parser.add_argument("package_list", help="List of packages for which" + " recipies will be created") args = parser.parse_args() package_names = [package.strip() for package in open(ar...
Add script to build conda recipes Signed-off-by: Harsh Gupta <c4bd8559369e527b4bb1785ff84e8ff50fde87c0@gmail.com>
d03d4bf0ca7ec4d66868f384d6864c9fb456cb84
src/test_io.py
src/test_io.py
import RPi.GPIO as GPIO import time # This test is made for a quick check of the gpios # List of the in channels to test. When pressed they output a message. in_chanels = [] # A list of output channels to test. These whill be switched on and off in a pattern. out_chanels = [] def switch_called(channel): print 'Edg...
Test for rudimentary io tests added
Test for rudimentary io tests added
Python
apache-2.0
baumartig/vpn_switcher,baumartig/vpn_switcher
<INSERT> import RPi.GPIO as GPIO import time # This test is made for a quick check of the gpios # List of the in channels to test. When pressed they output a message. in_chanels = [] # A list of output channels to test. These whill be switched on and off in a pattern. out_chanels = [] def switch_called(channel): p...
Test for rudimentary io tests added
1738872044ce26576b50895bee32a9933a5787cc
tools/touch_all_files.py
tools/touch_all_files.py
#!/usr/bin/python """ This script touches all files known to the database, creating a skeletal mirror for local development. """ import sys, os import store def get_paths(cursor, prefix=None): store.safe_execute(cursor, "SELECT python_version, name, filename FROM release_files") for type, name, filename in c...
Add script to synthesize all uploaded files. Patch by Dan Callahan.
Add script to synthesize all uploaded files. Patch by Dan Callahan.
Python
bsd-3-clause
pydotorg/pypi,pydotorg/pypi,pydotorg/pypi,pydotorg/pypi
<REPLACE_OLD> <REPLACE_NEW> #!/usr/bin/python """ This script touches all files known to the database, creating a skeletal mirror for local development. """ import sys, os import store def get_paths(cursor, prefix=None): store.safe_execute(cursor, "SELECT python_version, name, filename FROM release_files") ...
Add script to synthesize all uploaded files. Patch by Dan Callahan.
a54be407e4b18250f24a256fe6d615f25d42a7ee
pubrunner/snakemake.py
pubrunner/snakemake.py
import pubrunner import os import shlex import subprocess def launchSnakemake(snakeFilePath,useCluster=True,parameters={}): globalSettings = pubrunner.getGlobalSettings() clusterFlags = "" if useCluster and "cluster" in globalSettings: clusterSettings = globalSettings["cluster"] jobs = 1 if "jobs" in globa...
import pubrunner import os import shlex import subprocess def launchSnakemake(snakeFilePath,useCluster=True,parameters={}): globalSettings = pubrunner.getGlobalSettings() clusterFlags = "" if useCluster and "cluster" in globalSettings: clusterSettings = globalSettings["cluster"] jobs = 1 if "jobs" in globa...
Fix for non-DRMAA cluster run
Fix for non-DRMAA cluster run
Python
mit
jakelever/pubrunner,jakelever/pubrunner
<REPLACE_OLD> = "--cluster <REPLACE_NEW> += " --cluster <REPLACE_END> <|endoftext|> import pubrunner import os import shlex import subprocess def launchSnakemake(snakeFilePath,useCluster=True,parameters={}): globalSettings = pubrunner.getGlobalSettings() clusterFlags = "" if useCluster and "cluster" in globalSet...
Fix for non-DRMAA cluster run import pubrunner import os import shlex import subprocess def launchSnakemake(snakeFilePath,useCluster=True,parameters={}): globalSettings = pubrunner.getGlobalSettings() clusterFlags = "" if useCluster and "cluster" in globalSettings: clusterSettings = globalSettings["cluster"] ...
768ba3ef82df95e308c1431d17e7173e4ecd2861
vumi/blinkenlights/__init__.py
vumi/blinkenlights/__init__.py
"""Vumi monitoring and control framework.""" from vumi.blinkenlights.metrics_workers import (MetricTimeBucket, MetricAggregator, GraphiteMetricsCollector) __all__ = ["MetricTimeBucket", "MetricAggregator", "GraphiteMetrics...
Add blinkenlights metrics workers to vumi.blinkenlights package namespace (for convenience).
Add blinkenlights metrics workers to vumi.blinkenlights package namespace (for convenience).
Python
bsd-3-clause
vishwaprakashmishra/xmatrix,TouK/vumi,TouK/vumi,TouK/vumi,vishwaprakashmishra/xmatrix,vishwaprakashmishra/xmatrix,harrissoerja/vumi,harrissoerja/vumi,harrissoerja/vumi
<INSERT> """Vumi monitoring and control framework.""" from vumi.blinkenlights.metrics_workers import (MetricTimeBucket, <INSERT_END> <INSERT> MetricAggregator, GraphiteMetricsCollector) __all__ = ["MetricTimeBucket", "Metri...
Add blinkenlights metrics workers to vumi.blinkenlights package namespace (for convenience).
1e010e940390ae5b650224363e4acecd816b2611
settings_dev.py
settings_dev.py
import sublime_plugin from .sublime_lib.path import root_at_packages, get_package_name PLUGIN_NAME = get_package_name() SETTINGS_SYNTAX = ("Packages/%s/Package/Sublime Text Settings/Sublime Settings.tmLanguage" % PLUGIN_NAME) TPL = "{\n\t$0\n}" class NewSettingsCommand(sublime_plugin.WindowComm...
import sublime_plugin from .sublime_lib.path import root_at_packages, get_package_name PLUGIN_NAME = get_package_name() SETTINGS_SYNTAX = ("Packages/%s/Package/Sublime Text Settings/Sublime Text Settings.sublime-syntax" % PLUGIN_NAME) TPL = '''\ { "$1": $0 }'''.replace(" " * 4, "\t") class ...
Update syntax path for new settings file command
Update syntax path for new settings file command
Python
mit
SublimeText/AAAPackageDev,SublimeText/AAAPackageDev,SublimeText/PackageDev
<REPLACE_OLD> Settings.tmLanguage" <REPLACE_NEW> Text Settings.sublime-syntax" <REPLACE_END> <REPLACE_OLD> "{\n\t$0\n}" class <REPLACE_NEW> '''\ { "$1": $0 }'''.replace(" " * 4, "\t") class <REPLACE_END> <|endoftext|> import sublime_plugin from .sublime_lib.path import root_at_packages, get_package_name PL...
Update syntax path for new settings file command import sublime_plugin from .sublime_lib.path import root_at_packages, get_package_name PLUGIN_NAME = get_package_name() SETTINGS_SYNTAX = ("Packages/%s/Package/Sublime Text Settings/Sublime Settings.tmLanguage" % PLUGIN_NAME) TPL = "{\n\t$0\n}" ...
2f0a12dd4c0c9e344bee6f478c5de99511e77c1a
datastreams/dictstreams.py
datastreams/dictstreams.py
from datastreams import DataStream, DataSet class DictStream(DataStream): @staticmethod def Stream(iterable, transform=lambda row: row, predicate=lambda row: True): return DictStream(iterable, transform=transform, predicate=predicate) @staticmethod def Set(itera...
from datastreams import DataStream, DataSet class DictStream(DataStream): @staticmethod def Stream(iterable, transform=lambda row: row, predicate=lambda row: True): return DictStream(iterable, transform=transform, predicate=predicate) @staticmethod def Set(itera...
Fix DictStream join precedence (right was overriding left improperly)
Fix DictStream join precedence (right was overriding left improperly)
Python
mit
StuartAxelOwen/datastreams
<INSERT> joined.update(right.items()) <INSERT_END> <DELETE> joined.update(right.items()) <DELETE_END> <|endoftext|> from datastreams import DataStream, DataSet class DictStream(DataStream): @staticmethod def Stream(iterable, transform=lambda row: row, predicate=l...
Fix DictStream join precedence (right was overriding left improperly) from datastreams import DataStream, DataSet class DictStream(DataStream): @staticmethod def Stream(iterable, transform=lambda row: row, predicate=lambda row: True): return DictStream(iterable, transfo...
16b3cc9be877710c80146a439b74d46987859771
ui_devel/discover.py
ui_devel/discover.py
from django.conf import settings from django.utils.importlib import import_module class InvalidTemplateFixture(Exception): pass # holds all the fixtures template_fixtures = {} def get_template_fixtures(): """ Return the list of all available template fixtures. Caches the result for faster access. ...
from django.conf import settings from importlib import import_module class InvalidTemplateFixture(Exception): pass # holds all the fixtures template_fixtures = {} def get_template_fixtures(): """ Return the list of all available template fixtures. Caches the result for faster access. Code modif...
Use Python importlib instead of sjango.utils.importlib
Use Python importlib instead of sjango.utils.importlib
Python
bsd-3-clause
alexkasina/django-ui-devel,atul-bhouraskar/django-ui-devel,atul-bhouraskar/django-ui-devel,alexkasina/django-ui-devel
<REPLACE_OLD> django.utils.importlib <REPLACE_NEW> importlib <REPLACE_END> <|endoftext|> from django.conf import settings from importlib import import_module class InvalidTemplateFixture(Exception): pass # holds all the fixtures template_fixtures = {} def get_template_fixtures(): """ Return the list of a...
Use Python importlib instead of sjango.utils.importlib from django.conf import settings from django.utils.importlib import import_module class InvalidTemplateFixture(Exception): pass # holds all the fixtures template_fixtures = {} def get_template_fixtures(): """ Return the list of all available templat...
9931bd1d5459a983717fb502826f3cca87225b96
src/qrl/services/grpcHelper.py
src/qrl/services/grpcHelper.py
# coding=utf-8 # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. from grpc import StatusCode from qrl.core.misc import logger class GrpcExceptionWrapper(object): def __init__(self, response_type, state_code=StatusCode.UNKNOWN):...
# coding=utf-8 # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. from grpc import StatusCode from qrl.core.misc import logger class GrpcExceptionWrapper(object): def __init__(self, response_type, state_code=StatusCode.UNKNOWN):...
Set code to Invalid argument for ValueErrors
Set code to Invalid argument for ValueErrors
Python
mit
jleni/QRL,cyyber/QRL,jleni/QRL,cyyber/QRL,theQRL/QRL,randomshinichi/QRL,theQRL/QRL,randomshinichi/QRL
<INSERT> context.set_code(StatusCode.INVALID_ARGUMENT) <INSERT_END> <|endoftext|> # coding=utf-8 # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. from grpc import StatusCode from qrl.core.misc import logger class G...
Set code to Invalid argument for ValueErrors # coding=utf-8 # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. from grpc import StatusCode from qrl.core.misc import logger class GrpcExceptionWrapper(object): def __init__(self,...
b11a53464b2bcdf5ba26f43dbdb81e0a0fde44d7
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name="pbs", version="1.0", author="Daniel Lombraña González", author_email="info@pybossa.com", description="PyBossa command line client", license="AGPLv3", url="https://github.com/PyBossa/pbs", classifier...
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup try: from pypandoc import convert read_md = lambda f: convert(f, 'rst') except ImportError: print("warning: pypandoc module not found, could not convert Markdown to RST") read_md = lambda f: open(f, 'r').read() setup( name...
Use pandoc to convert from Markdown to RST for pypi
Use pandoc to convert from Markdown to RST for pypi
Python
agpl-3.0
PyBossa/pbs,PyBossa/pbs,PyBossa/pbs
<REPLACE_OLD> setup setup( name="pbs", <REPLACE_NEW> setup try: from pypandoc import convert read_md = lambda f: convert(f, 'rst') except ImportError: print("warning: pypandoc module not found, could not convert Markdown to RST") read_md = lambda f: open(f, 'r').read() setup( name="pybossa-p...
Use pandoc to convert from Markdown to RST for pypi #!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name="pbs", version="1.0", author="Daniel Lombraña González", author_email="info@pybossa.com", description="PyBossa command line client", license="AGPLv3", ...
4b8fbe2914aec5ddcf7f63c6b7ca2244ec022084
tests/test_crossbuild.py
tests/test_crossbuild.py
from mock import patch from unittest import TestCase from crossbuild import ( main, ) class CrossBuildTestCase(TestCase): def test_main_setup(self): with patch('crossbuild.setup_cross_building') as mock: main(['-d', '-v', 'setup', '--build-dir', './foo']) args, kwargs = mock.call...
from mock import patch from unittest import TestCase from crossbuild import ( main, ) class CrossBuildTestCase(TestCase): def test_main_setup(self): with patch('crossbuild.setup_cross_building') as mock: main(['-d', '-v', 'setup', '--build-dir', './foo']) args, kwargs = mock.call...
Add main osx-client command test.
Add main osx-client command test.
Python
agpl-3.0
mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju
<REPLACE_OLD> test_main_win_client(self): with patch('crossbuild.build_win_client') as mock: main(['win-client', <REPLACE_NEW> test_main_osx_clientt(self): with patch('crossbuild.build_osx_client') as mock: main(['osx-client', <REPLACE_END> <INSERT> kwargs) def test_main_win...
Add main osx-client command test. from mock import patch from unittest import TestCase from crossbuild import ( main, ) class CrossBuildTestCase(TestCase): def test_main_setup(self): with patch('crossbuild.setup_cross_building') as mock: main(['-d', '-v', 'setup', '--build-dir', './foo']...
bdadf9b67b6f35566d7ff874522aeaf4ee519e24
tests/test_configure_alt_name.py
tests/test_configure_alt_name.py
from __future__ import unicode_literals, division, absolute_import from tests import FlexGetBase #todo: merge into test_series def age_series(**kwargs): from flexget.plugins.filter.series import Release from flexget.manager import Session import datetime session = Session() session.query(Release)....
Test for series configure loading alternate name
Test for series configure loading alternate name
Python
mit
jawilson/Flexget,poulpito/Flexget,dsemi/Flexget,tarzasai/Flexget,X-dark/Flexget,jawilson/Flexget,antivirtel/Flexget,antivirtel/Flexget,vfrc2/Flexget,Flexget/Flexget,thalamus/Flexget,LynxyssCZ/Flexget,ianstalk/Flexget,spencerjanssen/Flexget,patsissons/Flexget,ratoaq2/Flexget,malkavi/Flexget,xfouloux/Flexget,tvcsantos/Fl...
<REPLACE_OLD> <REPLACE_NEW> from __future__ import unicode_literals, division, absolute_import from tests import FlexGetBase #todo: merge into test_series def age_series(**kwargs): from flexget.plugins.filter.series import Release from flexget.manager import Session import datetime session = Session(...
Test for series configure loading alternate name
ab627a078eee3000806bfd0abcd01dc89e85d93c
src/test_read+write.py
src/test_read+write.py
#!/usr/bin/env python from bioc import BioCReader from bioc import BioCWriter test_file = '../test_input/PMID-8557975-simplified-sentences.xml' dtd_file = '../test_input/BioC.dtd' def main(): bioc_reader = BioCReader(test_file, dtd_valid_file=dtd_file) bioc_reader.read() ''' sentences = bioc_reader.c...
#!/usr/bin/env python from bioc import BioCReader from bioc import BioCWriter test_file = '../test_input/bcIVLearningCorpus.xml' dtd_file = '../test_input/BioC.dtd' def main(): bioc_reader = BioCReader(test_file, dtd_valid_file=dtd_file) bioc_reader.read() ''' sentences = bioc_reader.collection.docum...
Add BioC.dtd one level up
Add BioC.dtd one level up
Python
bsd-2-clause
SuLab/PyBioC
<REPLACE_OLD> '../test_input/PMID-8557975-simplified-sentences.xml' dtd_file <REPLACE_NEW> '../test_input/bcIVLearningCorpus.xml' dtd_file <REPLACE_END> <|endoftext|> #!/usr/bin/env python from bioc import BioCReader from bioc import BioCWriter test_file = '../test_input/bcIVLearningCorpus.xml' dtd_file = '../test_in...
Add BioC.dtd one level up #!/usr/bin/env python from bioc import BioCReader from bioc import BioCWriter test_file = '../test_input/PMID-8557975-simplified-sentences.xml' dtd_file = '../test_input/BioC.dtd' def main(): bioc_reader = BioCReader(test_file, dtd_valid_file=dtd_file) bioc_reader.read() ''' ...
edbb4f1f86f1102ce93b9776cddc6aa83c28595e
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages __version__ = '0.50.1' with open("README.md", "r") as fh: long_description = fh.read() setup(name='lcapy', version=__version__, author='Michael Hayes', author_email='michael.hayes@canterbury.ac.nz', description='Symbolic li...
#!/usr/bin/env python from setuptools import setup, find_packages __version__ = '0.50.1' with open("README.md", "r") as fh: long_description = fh.read() setup(name='lcapy', version=__version__, author='Michael Hayes', author_email='michael.hayes@canterbury.ac.nz', description='Symbolic li...
Add wheel as a requirement
Add wheel as a requirement
Python
lgpl-2.1
mph-/lcapy
<REPLACE_OLD> 'setuptools' <REPLACE_NEW> 'setuptools', 'wheel' <REPLACE_END> <|endoftext|> #!/usr/bin/env python from setuptools import setup, find_packages __version__ = '0.50.1' with open("README.md", "r") as fh: long_description = fh.read() setup(name='lcapy', version=__version...
Add wheel as a requirement #!/usr/bin/env python from setuptools import setup, find_packages __version__ = '0.50.1' with open("README.md", "r") as fh: long_description = fh.read() setup(name='lcapy', version=__version__, author='Michael Hayes', author_email='michael.hayes@canterbury.ac.nz', ...
9c52955c7e18987be6131afeb83093060afb4f98
q_learning/main.py
q_learning/main.py
# coding: utf-8 import random import gym import pandas as pd import matplotlib.pyplot as plt import seaborn as sns # noqa env = gym.make('FrozenLake-v0') class Agent(object): def __init__(self, action_space, eps=0.01, alpha=0.1, gamma=0.9): self.action_space = action_space self.eps = eps ...
Add an agent of q-learning
Add an agent of q-learning
Python
apache-2.0
nel215/reinforcement-learning
<REPLACE_OLD> <REPLACE_NEW> # coding: utf-8 import random import gym import pandas as pd import matplotlib.pyplot as plt import seaborn as sns # noqa env = gym.make('FrozenLake-v0') class Agent(object): def __init__(self, action_space, eps=0.01, alpha=0.1, gamma=0.9): self.action_space = action_space ...
Add an agent of q-learning
806b19db6f50d63f5b0893e9d695f32830890dd2
crm/tests/test_contact_user.py
crm/tests/test_contact_user.py
from django.contrib.auth.models import User from django.test import TestCase from crm.tests.model_maker import ( make_contact, make_user_contact, ) from login.tests.model_maker import make_user class TestContactUser(TestCase): def test_link_user_to_contact(self): """Create a contact and link it ...
from django.contrib.auth.models import User from django.db import IntegrityError from django.test import TestCase from crm.tests.model_maker import ( make_contact, make_user_contact, ) from login.tests.model_maker import make_user class TestContactUser(TestCase): def test_link_user_to_contact(self): ...
Make sure a user can only link to one contact
Make sure a user can only link to one contact
Python
apache-2.0
pkimber/crm,pkimber/crm,pkimber/crm
<INSERT> django.db import IntegrityError from <INSERT_END> <REPLACE_OLD> user_contacts[0].contact.name) <REPLACE_NEW> user_contacts[0].contact.name) def test_one_contact_per_user(self): """Make sure a user can only link to one contact""" fred = make_user('fred') jsmith = make_contact('jsmi...
Make sure a user can only link to one contact from django.contrib.auth.models import User from django.test import TestCase from crm.tests.model_maker import ( make_contact, make_user_contact, ) from login.tests.model_maker import make_user class TestContactUser(TestCase): def test_link_user_to_contact(...
e06a766e082f168e0b89776355b622b980a0a735
locations/spiders/learning_experience.py
locations/spiders/learning_experience.py
# -*- coding: utf-8 -*- import scrapy import re from locations.items import GeojsonPointItem class TheLearningExperienceSpider(scrapy.Spider): name = "learning_experience" allowed_domains = ["thelearningexperience.com"] start_urls = ( 'https://thelearningexperience.com/our-centers/directory', ...
Add The Learning Experience spider
Add The Learning Experience spider
Python
mit
iandees/all-the-places,iandees/all-the-places,iandees/all-the-places
<REPLACE_OLD> <REPLACE_NEW> # -*- coding: utf-8 -*- import scrapy import re from locations.items import GeojsonPointItem class TheLearningExperienceSpider(scrapy.Spider): name = "learning_experience" allowed_domains = ["thelearningexperience.com"] start_urls = ( 'https://thelearningexperience.co...
Add The Learning Experience spider
13d1895a979cfb210e097e4d471238bf36c88c65
website/db_create.py
website/db_create.py
#!/usr/bin/env python3 from database import db from database import bdb from database import bdb_refseq from import_data import import_data import argparse def restet_relational_db(): print('Removing relational database...') db.reflect() db.drop_all() print('Removing relational database completed.') ...
#!/usr/bin/env python3 from database import db from database import bdb from database import bdb_refseq from import_data import import_data import argparse def restet_relational_db(): print('Removing relational database...') db.reflect() db.drop_all() print('Removing relational database completed.') ...
Use store true in db creation script
Use store true in db creation script
Python
lgpl-2.1
reimandlab/ActiveDriverDB,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/Visua...
<REPLACE_OLD> default=False, <REPLACE_NEW> action='store_true', <REPLACE_END> <REPLACE_OLD> default=False, <REPLACE_NEW> action='store_true', <REPLACE_END> <|endoftext|> #!/usr/bin/env python3 from database import db from database import bdb from database import bdb_refseq from import_data import import_data import...
Use store true in db creation script #!/usr/bin/env python3 from database import db from database import bdb from database import bdb_refseq from import_data import import_data import argparse def restet_relational_db(): print('Removing relational database...') db.reflect() db.drop_all() print('Remo...
63241b7fb62166f4a31ef7ece38edf8b36129f63
dictionary/management/commands/writeLiblouisTables.py
dictionary/management/commands/writeLiblouisTables.py
from daisyproducer.dictionary.brailleTables import writeWhiteListTables, writeLocalTables from daisyproducer.dictionary.models import Word from daisyproducer.documents.models import Document from django.core.management.base import BaseCommand class Command(BaseCommand): args = '' help = 'Write Liblouis tables ...
from daisyproducer.dictionary.brailleTables import writeWhiteListTables, writeLocalTables from daisyproducer.dictionary.models import Word from daisyproducer.documents.models import Document from django.core.management.base import BaseCommand class Command(BaseCommand): args = '' help = 'Write Liblouis tables ...
Make sure the verbosity stuff actually works
Make sure the verbosity stuff actually works
Python
agpl-3.0
sbsdev/daisyproducer,sbsdev/daisyproducer,sbsdev/daisyproducer,sbsdev/daisyproducer
<INSERT> verbosity = int(options['verbosity']) <INSERT_END> <REPLACE_OLD> options['verbosity'] <REPLACE_NEW> verbosity <REPLACE_END> <REPLACE_OLD> options['verbosity'] <REPLACE_NEW> verbosity <REPLACE_END> <|endoftext|> from daisyproducer.dictionary.brailleTables import writeWhiteListTables, writeLocalTables fr...
Make sure the verbosity stuff actually works from daisyproducer.dictionary.brailleTables import writeWhiteListTables, writeLocalTables from daisyproducer.dictionary.models import Word from daisyproducer.documents.models import Document from django.core.management.base import BaseCommand class Command(BaseCommand): ...
e881465050ef9edbf2b47071b1fa2fc27ac26c1a
tests/Settings/TestExtruderStack.py
tests/Settings/TestExtruderStack.py
# Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. import pytest #This module contains automated tests. import unittest.mock #For the mocking and monkeypatching functionality. import cura.Settings.ExtruderStack #The module we're testing. from cura.Settings.Exceptions impor...
# Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. import pytest #This module contains automated tests. import unittest.mock #For the mocking and monkeypatching functionality. import cura.Settings.ExtruderStack #The module we're testing. from cura.Settings.Exceptions impor...
Add delimiter between global stuff and test cases
Add delimiter between global stuff and test cases Helps provide some oversight since this module is about to explode in size. Contributes to issue CURA-3497.
Python
agpl-3.0
hmflash/Cura,ynotstartups/Wanhao,Curahelper/Cura,ynotstartups/Wanhao,hmflash/Cura,fieldOfView/Cura,fieldOfView/Cura,Curahelper/Cura
<REPLACE_OLD> cura.Settings.ExtruderStack.ExtruderStack ## <REPLACE_NEW> cura.Settings.ExtruderStack.ExtruderStack #############################START OF TEST CASES################################ ## <REPLACE_END> <|endoftext|> # Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or hi...
Add delimiter between global stuff and test cases Helps provide some oversight since this module is about to explode in size. Contributes to issue CURA-3497. # Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. import pytest #This module contains automated tests. import un...
d2699f79e544fdfee1745da00ad16a2950d6ee10
setup.py
setup.py
#! /usr/bin/env python from setuptools import setup PACKAGENAME = 'preconditions' setup( name=PACKAGENAME, description='Flexible, concise preconditions.', url='https://github.com/nejucomo/{0}'.format(PACKAGENAME), license='MIT', version='0.1.dev0', author='Nathan Wilcox', author_email='...
#! /usr/bin/env python import sys from setuptools import setup if 'upload' in sys.argv: if '--sign' not in sys.argv and sys.argv[1:] != ['upload', '--help']: raise SystemExit('Refusing to upload unsigned packages.') PACKAGENAME = 'preconditions' setup( name=PACKAGENAME, description='Flexible, ...
Add a "signature requirement" to the sdist upload command.
Add a "signature requirement" to the sdist upload command.
Python
mit
nejucomo/preconditions
<REPLACE_OLD> python from <REPLACE_NEW> python import sys from <REPLACE_END> <REPLACE_OLD> setup PACKAGENAME <REPLACE_NEW> setup if 'upload' in sys.argv: if '--sign' not in sys.argv and sys.argv[1:] != ['upload', '--help']: raise SystemExit('Refusing to upload unsigned packages.') PACKAGENAME <REPLAC...
Add a "signature requirement" to the sdist upload command. #! /usr/bin/env python from setuptools import setup PACKAGENAME = 'preconditions' setup( name=PACKAGENAME, description='Flexible, concise preconditions.', url='https://github.com/nejucomo/{0}'.format(PACKAGENAME), license='MIT', versio...
9ce5a020ac6e9bbdf7e2fc0c34c98cdfaf9e0a45
tests/formatters/conftest.py
tests/formatters/conftest.py
import npc import pytest @pytest.fixture(scope="module") def character(): char = npc.character.Character() char.append('description', 'Fee fie foe fum') char.append('type', 'human') return char
import npc import pytest @pytest.fixture(scope="module") def character(): char = npc.character.Character() char.tags('description').append('Fee fie foe fum') char.tags('type').append('human') return char
Set up defaults using tag syntax
Set up defaults using tag syntax
Python
mit
aurule/npc,aurule/npc
<REPLACE_OLD> char.append('description', 'Fee <REPLACE_NEW> char.tags('description').append('Fee <REPLACE_END> <REPLACE_OLD> char.append('type', 'human') <REPLACE_NEW> char.tags('type').append('human') <REPLACE_END> <|endoftext|> import npc import pytest @pytest.fixture(scope="module") def character(): char = np...
Set up defaults using tag syntax import npc import pytest @pytest.fixture(scope="module") def character(): char = npc.character.Character() char.append('description', 'Fee fie foe fum') char.append('type', 'human') return char
1ea51baec10ebc76bfb2be88270df2050a29fbb5
http-error-static-pages/5xx-static-html-generator.py
http-error-static-pages/5xx-static-html-generator.py
import os, errno # Create build folder if it doesn't exist try: os.makedirs('build') except OSError as e: if e.errno != errno.EEXIST: raise template = open('./5xx.template.html', 'r') templateString = template.read() template.close() # We only use 0-11 according to # https://en.wikipedia.org/wiki/List...
import os, errno # Create build folder if it doesn't exist def get_path(relative_path): cur_dir = os.path.dirname(__file__) return os.path.join(cur_dir, relative_path) try: os.makedirs(get_path('build')) except OSError as e: if e.errno != errno.EEXIST: raise template = open(get_path('./5xx.template...
Make static http error code generator directory agnostic
Make static http error code generator directory agnostic
Python
mit
thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-front-end,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-front-end
<REPLACE_OLD> exist try: <REPLACE_NEW> exist def get_path(relative_path): cur_dir = os.path.dirname(__file__) return os.path.join(cur_dir, relative_path) try: <REPLACE_END> <REPLACE_OLD> os.makedirs('build') except <REPLACE_NEW> os.makedirs(get_path('build')) except <REPLACE_END> <REPLACE_OLD> open('./5xx.templat...
Make static http error code generator directory agnostic import os, errno # Create build folder if it doesn't exist try: os.makedirs('build') except OSError as e: if e.errno != errno.EEXIST: raise template = open('./5xx.template.html', 'r') templateString = template.read() template.close() # We only ...
c95dc576153f60c8c56b7b2c5bfac467ccd9dd97
gin/__init__.py
gin/__init__.py
# coding=utf-8 # Copyright 2018 The Gin-Config Authors. # # 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 la...
# coding=utf-8 # Copyright 2018 The Gin-Config Authors. # # 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 la...
Add import for constants_from_enum to be able to use @gin.constants_from_enum
Add import for constants_from_enum to be able to use @gin.constants_from_enum PiperOrigin-RevId: 198401971
Python
apache-2.0
google/gin-config,google/gin-config
<INSERT> constants_from_enum from gin.config import <INSERT_END> <|endoftext|> # coding=utf-8 # Copyright 2018 The Gin-Config Authors. # # 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 # # ...
Add import for constants_from_enum to be able to use @gin.constants_from_enum PiperOrigin-RevId: 198401971 # coding=utf-8 # Copyright 2018 The Gin-Config Authors. # # 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 c...
c23e697ccc64340027d3b07728032247bb5b21a4
kerze.py
kerze.py
from turtle import * GROESSE = 0.5 FARBE = "red" FAERBEN = True SHAPE = "turtle" fillcolor(FARBE) shape(SHAPE) def zeichneKerze(brennt): pd() begin_fill() forward(GROESSE*100) left(90) forward(GROESSE*400) left(90) forward(GROESSE*100) right(90) forward(GROESSE*30) back(GROESS...
import turtle as t GROESSE = 0.5 FARBE = "red" FAERBEN = True SHAPE = "turtle" t.fillcolor(FARBE) t.shape(SHAPE) def zeichneKerze(brennt): t.pd() t.begin_fill() t.forward(GROESSE*100) t.left(90) t.forward(GROESSE*400) t.left(90) t.forward(GROESSE*100) t.right(90) t.forward(GROESSE...
Make imports compliant to PEP 8 suggestion
Make imports compliant to PEP 8 suggestion
Python
mit
luforst/adventskranz
<REPLACE_OLD> from <REPLACE_NEW> import <REPLACE_END> <REPLACE_OLD> import * GROESSE <REPLACE_NEW> as t GROESSE <REPLACE_END> <REPLACE_OLD> "turtle" fillcolor(FARBE) shape(SHAPE) def <REPLACE_NEW> "turtle" t.fillcolor(FARBE) t.shape(SHAPE) def <REPLACE_END> <REPLACE_OLD> pd() <REPLACE_NEW> t.pd() <REPLACE_END> ...
Make imports compliant to PEP 8 suggestion from turtle import * GROESSE = 0.5 FARBE = "red" FAERBEN = True SHAPE = "turtle" fillcolor(FARBE) shape(SHAPE) def zeichneKerze(brennt): pd() begin_fill() forward(GROESSE*100) left(90) forward(GROESSE*400) left(90) forward(GROESSE*100) right...
2b99108a817a642c86be06a14ac8d71cdc339555
scripts/speak.py
scripts/speak.py
#!/usr/bin/env python import rospy from sound_play.msg import SoundRequest from sound_play.libsoundplay import SoundClient from std_msgs.msg import String class ChatbotSpeaker: def __init__(self): rospy.init_node('chatbot_speaker') self._client = SoundClient() rospy.Subscriber('chatbot_responses', Strin...
#!/usr/bin/env python import os import rospy from sound_play.msg import SoundRequest from sound_play.libsoundplay import SoundClient from std_msgs.msg import String import urllib tts_cmd = ( 'wget -q -U "Mozilla/5.0" -O - "http://translate.google.com/translate_tts?tl=en-uk&q={}" > /tmp/speech.mp3' ) sox_cmd = 'so...
Use Google Translate API to get a female TTS
Use Google Translate API to get a female TTS
Python
mit
jstnhuang/chatbot
<INSERT> os import <INSERT_END> <REPLACE_OLD> String class <REPLACE_NEW> String import urllib tts_cmd = ( 'wget -q -U "Mozilla/5.0" -O - "http://translate.google.com/translate_tts?tl=en-uk&q={}" > /tmp/speech.mp3' ) sox_cmd = 'sox /tmp/speech.mp3 /tmp/speech.wav' class <REPLACE_END> <REPLACE_OLD> self._client.sa...
Use Google Translate API to get a female TTS #!/usr/bin/env python import rospy from sound_play.msg import SoundRequest from sound_play.libsoundplay import SoundClient from std_msgs.msg import String class ChatbotSpeaker: def __init__(self): rospy.init_node('chatbot_speaker') self._client = SoundClient() ...
86080d1c06637e1d73784100657fc43bd7326e66
tools/conan/conanfile.py
tools/conan/conanfile.py
from conans import ConanFile, CMake, tools class LibWFUTConan(ConanFile): name = "libwfut" version = "0.2.4" license = "GPL-2.0+" author = "Erik Ogenvik <erik@ogenvik.org>" homepage = "https://www.worldforge.org" url = "https://github.com/worldforge/libwfut" description = "A client side C+...
from conans import ConanFile, CMake, tools class LibWFUTConan(ConanFile): name = "libwfut" version = "0.2.4" license = "GPL-2.0+" author = "Erik Ogenvik <erik@ogenvik.org>" homepage = "https://www.worldforge.org" url = "https://github.com/worldforge/libwfut" description = "A client side C+...
Build with PIC by default.
Build with PIC by default.
Python
lgpl-2.1
worldforge/libwfut,worldforge/libwfut,worldforge/libwfut,worldforge/libwfut
<REPLACE_OLD> True]} <REPLACE_NEW> True], "fPIC": [True, False]} <REPLACE_END> <REPLACE_OLD> False} <REPLACE_NEW> False, "fPIC": True} <REPLACE_END> <|endoftext|> from conans import ConanFile, CMake, tools class LibWFUTConan(ConanFile): name = "libwfut" version = "0.2.4" license = "GPL-2.0+" autho...
Build with PIC by default. from conans import ConanFile, CMake, tools class LibWFUTConan(ConanFile): name = "libwfut" version = "0.2.4" license = "GPL-2.0+" author = "Erik Ogenvik <erik@ogenvik.org>" homepage = "https://www.worldforge.org" url = "https://github.com/worldforge/libwfut" des...
f3d3c0ce81ba8717f5839b502e57d75ebbc1f6e7
meetuppizza/views.py
meetuppizza/views.py
from django.contrib.auth import authenticate, login, logout from django.shortcuts import render, redirect from meetuppizza.forms import RegistrationForm from meetup.models import Meetup from meetup.services.meetup_service import MeetupService def index(request): meetups = Meetup.objects.all() meetup_presenters = ...
from django.contrib.auth import authenticate, login, logout from django.shortcuts import render, redirect from meetuppizza.forms import RegistrationForm from meetup.models import Meetup from meetup.services.meetup_service import MeetupService def index(request): meetups = Meetup.objects.all() meetup_presenters = ...
Use list comprehension to generate MeetupPresentor list in index view
Use list comprehension to generate MeetupPresentor list in index view
Python
mit
nicole-a-tesla/meetup.pizza,nicole-a-tesla/meetup.pizza
<REPLACE_OLD> [] <REPLACE_NEW> [MeetupService(meetup).get_decorated_meetup() <REPLACE_END> <REPLACE_OLD> meetups: service = MeetupService(meetup) meetup_presenters.append(service.get_decorated_meetup()) <REPLACE_NEW> meetups] <REPLACE_END> <|endoftext|> from django.contrib.auth import authenticate, login, ...
Use list comprehension to generate MeetupPresentor list in index view from django.contrib.auth import authenticate, login, logout from django.shortcuts import render, redirect from meetuppizza.forms import RegistrationForm from meetup.models import Meetup from meetup.services.meetup_service import MeetupService def ...