commit
stringlengths
40
40
old_file
stringlengths
4
150
new_file
stringlengths
4
150
old_contents
stringlengths
0
3.26k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
501
message
stringlengths
15
4.06k
lang
stringclasses
4 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
diff
stringlengths
0
4.35k
80d671aa79f306bb17eed006bc99eaa6e6a17bd5
molecule/default/tests/test_default.py
molecule/default/tests/test_default.py
import datetime import os import pytest import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') @pytest.mark.parametrize("name", [ "lorem", "ipsum", ]) @pytest.mark.parametrize("dir", [ ".vimrc", ...
import os import pytest import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') @pytest.mark.parametrize("name", [ "lorem", "ipsum", ]) @pytest.mark.parametrize("file", [ ".vimrc", ]) def test_back...
Simplify backup-file test (and rename)
Simplify backup-file test (and rename)
Python
mit
ctorgalson/ansible-role-janus,ctorgalson/ansible-role-janus
--- +++ @@ -1,5 +1,3 @@ -import datetime - import os import pytest @@ -14,19 +12,13 @@ "lorem", "ipsum", ]) -@pytest.mark.parametrize("dir", [ +@pytest.mark.parametrize("file", [ ".vimrc", ]) -def test_backup_dirs(host, name, dir): - t = datetime.datetime.today().isoformat()[:10] - c = "fin...
64b3c094187b629e81a743c51a7a7849444b8920
app/PRESUBMIT.py
app/PRESUBMIT.py
#!/usr/bin/python # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Makes sure that the app/ code is cpplint clean.""" INCLUDE_CPP_FILES_ONLY = ( r'.*\.cc$', r'.*\.h$' ) EXCLUDE = ( # Autogener...
#!/usr/bin/python # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Makes sure that the app/ code is cpplint clean.""" INCLUDE_CPP_FILES_ONLY = ( r'.*\.cc$', r'.*\.h$' ) EXCLUDE = ( # Autogener...
Make all changes to app/ run on all trybot platforms, not just the big three. Anyone who's changing a header here may break the chromeos build.
Make all changes to app/ run on all trybot platforms, not just the big three. Anyone who's changing a header here may break the chromeos build. BUG=none TEST=none Review URL: http://codereview.chromium.org/2838027 git-svn-id: http://src.chromium.org/svn/trunk/src@51000 4ff67af0-8c30-449e-8e8b-ad334ec8d88c Former-co...
Python
bsd-3-clause
meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-u...
--- +++ @@ -23,3 +23,6 @@ results.extend(input_api.canned_checks.CheckChangeLintsClean( input_api, output_api, sources)) return results + +def GetPreferredTrySlaves(): + return ['win', 'linux', 'linux_view', 'linux_chromeos', 'mac']
affc010ccb741bbaba3b63eb565844a090bab51f
distarray/tests/test_client.py
distarray/tests/test_client.py
import unittest from IPython.parallel import Client from distarray.client import DistArrayContext class TestDistArrayContext(unittest.TestCase): def setUp(self): self.client = Client() self.dv = self.client[:] def test_create_DAC(self): '''Can we create a plain vanilla context?''' ...
import unittest from IPython.parallel import Client from distarray.client import DistArrayContext class TestDistArrayContext(unittest.TestCase): def setUp(self): self.client = Client() self.dv = self.client[:] def test_create_DAC(self): '''Can we create a plain vanilla context?''' ...
Test indexing for block and cyclic dist types.
Test indexing for block and cyclic dist types.
Python
bsd-3-clause
RaoUmer/distarray,enthought/distarray,enthought/distarray,RaoUmer/distarray
--- +++ @@ -27,8 +27,8 @@ self.dv = self.client[:] self.dac = DistArrayContext(self.dv) - def test_set_and_getitem_(self): - dap = self.dac.empty((100,)) + def test_set_and_getitem_block_dist(self): + dap = self.dac.empty((100,), dist={0: 'b'}) for val in xrange(100)...
dae6cf8ebe2c2eb0f7c004190c9a3d76a65df918
django_enumfield/validators.py
django_enumfield/validators.py
from django.utils.translation import gettext as _ import six from django_enumfield.exceptions import InvalidStatusOperationError def validate_valid_transition(enum, from_value, to_value): """ Validate that to_value is a valid choice and that to_value is a valid transition from from_value. """ validat...
from django.utils.translation import gettext as _ from django.utils import six from django_enumfield.exceptions import InvalidStatusOperationError def validate_valid_transition(enum, from_value, to_value): """ Validate that to_value is a valid choice and that to_value is a valid transition from from_value. ...
Use Django's bundled six version instead of requiring to install another one.
Use Django's bundled six version instead of requiring to install another one.
Python
mit
jessamynsmith/django-enumfield,5monkeys/django-enumfield,lamby/django-enumfield,lamby/django-enumfield,joar/django-enumfield,fcurella/django-enumfield
--- +++ @@ -1,5 +1,5 @@ from django.utils.translation import gettext as _ -import six +from django.utils import six from django_enumfield.exceptions import InvalidStatusOperationError
9b82ab1ad03c758b6f33e1e5ff6a2b73ff68fccc
tests/test_core_lexer.py
tests/test_core_lexer.py
# -*- coding: utf-8 -*- import sshrc.core.lexer as lexer import pytest @pytest.mark.parametrize("input_, output_", ( ("", ""), (" ", ""), (" #", ""), ("# ", ""), (" # dsfsdfsdf sdfsdfsd", ""), (" a", " a"), (" a# sdfsfdf", " a"), (" a # sdfsfsd x xxxxxxx # sdfs...
# -*- coding: utf-8 -*- import sshrc.core.lexer as lexer import pytest @pytest.mark.parametrize("input_, output_", ( ("", ""), (" ", ""), (" #", ""), ("# ", ""), (" # dsfsdfsdf sdfsdfsd", ""), (" a", " a"), (" a# sdfsfdf", " a"), (" a # sdfsfsd x xxxxxxx # sdfs...
Add tests for get/split indent
Add tests for get/split indent
Python
mit
9seconds/sshrc,9seconds/concierge
--- +++ @@ -33,3 +33,24 @@ )) def test_reindent_line(input_, output_): assert lexer.reindent_line(input_) == output_ + + +@pytest.mark.parametrize("indent_", ( + "", + " ", + " ", + "\t", + "\t\t", + "\t \t", + "\t\t ", + " \t\t" +)) +@pytest.mark.parametrize("content_", ( + "", +...
2fc71f9b83db5d0ff9e73572ceb49011f916bcf5
calebasse/views.py
calebasse/views.py
# -*- coding: utf-8 -*- from django.shortcuts import render, redirect from django.template.defaultfilters import slugify from cbv import HOME_SERVICE_COOKIE, TemplateView from calebasse.ressources.models import Service APPLICATIONS = ( (u'Gestion des dossiers', 'dossiers'), (u'Agenda', 'agenda'), ...
# -*- coding: utf-8 -*- from django.shortcuts import render, redirect from django.template.defaultfilters import slugify from cbv import HOME_SERVICE_COOKIE, TemplateView from calebasse.ressources.models import Service APPLICATIONS = ( (u'Gestion des dossiers', 'dossiers'), (u'Agenda', 'agenda'), ...
Reorder the service buttons display.
Reorder the service buttons display.
Python
agpl-3.0
ZTH1970/alcide,ZTH1970/alcide,ZTH1970/alcide,ZTH1970/alcide,ZTH1970/alcide
--- +++ @@ -25,6 +25,7 @@ def get_context_data(self, **kwargs): services = Service.objects.values_list('name', 'slug') + services = sorted(services, key=lambda tup: tup[0]) ctx = super(Homepage, self).get_context_data(**kwargs) ctx.update({ 'applications': APPLICA...
4848baf76e4972401530b624816ba48cb08d9398
appconf/utils.py
appconf/utils.py
import sys def import_attribute(import_path, exception_handler=None): from django.utils.importlib import import_module module_name, object_name = import_path.rsplit('.', 1) try: module = import_module(module_name) except: # pragma: no cover if callable(exception_handler): ...
import sys def import_attribute(import_path, exception_handler=None): try: from importlib import import_module except ImportError: from django.utils.importlib import import_module module_name, object_name = import_path.rsplit('.', 1) try: module = import_module(module_name) ...
Use import_module from standard library if exists
Use import_module from standard library if exists Django 1.8+ drops `django.utils.importlib`. I imagine because that is because an older version of Python (either 2.5 and/or 2.6) is being dropped. I haven't checked older versions but `importlib` exists in Python 2.7.
Python
bsd-3-clause
diox/django-appconf,carltongibson/django-appconf,django-compressor/django-appconf,jezdez/django-appconf,jessehon/django-appconf,treyhunner/django-appconf,jezdez-archive/django-appconf
--- +++ @@ -2,7 +2,10 @@ def import_attribute(import_path, exception_handler=None): - from django.utils.importlib import import_module + try: + from importlib import import_module + except ImportError: + from django.utils.importlib import import_module module_name, object_name = impor...
cdaf1c4a9a99a7f089470e8ceaaa226124a42cf0
digdag-cli/src/main/resources/digdag/cli/tasks/__init__.py
digdag-cli/src/main/resources/digdag/cli/tasks/__init__.py
class MyWorkflow(object): def __init__(self): pass def step3(self, session_time = None): print "Step3 of session %s" % session_time
class MyWorkflow(object): def __init__(self): pass def step3(self, session_time = None): print("Step3 of session {0}".format(session_time))
Fix an example of python task
Fix an example of python task The original python print method doesn't work on python3. print(format) method works on python2 and python 3.
Python
apache-2.0
treasure-data/digdag,treasure-data/digdag,treasure-data/digdag,treasure-data/digdag,treasure-data/digdag,KimuraTakaumi/digdag,KimuraTakaumi/digdag,treasure-data/digdag,KimuraTakaumi/digdag,treasure-data/digdag,KimuraTakaumi/digdag,KimuraTakaumi/digdag,KimuraTakaumi/digdag
--- +++ @@ -4,5 +4,5 @@ pass def step3(self, session_time = None): - print "Step3 of session %s" % session_time + print("Step3 of session {0}".format(session_time))
62ba442ac447dbb4482dd15f70075d224d0e5a0e
scripts/test_conda_build_log.py
scripts/test_conda_build_log.py
import pytest import log_parser import os @pytest.fixture def parsed_log(): logname = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'build.log') gen = list(log_parser.read_log_from_script(logname)) parsed = {built_name: log_parser.parse_conda_build(lines) ...
import pytest import log_parser import os @pytest.fixture def parsed_log(): logname = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'build.log') gen = list(log_parser.read_log_from_script(logname)) parsed = {built_name: log_parser.parse_conda_build(lines) ...
Make sure there is an error field
TST: Make sure there is an error field
Python
bsd-3-clause
NSLS-II/lightsource2-recipes,NSLS-II/auto-build-tagged-recipes,NSLS-II/lightsource2-recipes,NSLS-II/auto-build-tagged-recipes,NSLS-II/lightsource2-recipes,NSLS-II/lightsource2-recipes
--- +++ @@ -23,6 +23,7 @@ for pkg_name, parsed in parsed_log.items(): parsed_init = log_parser.parse_init(parsed['init']) assert 'build_command' in parsed_init + assert 'err' in parsed_init def test_parse_build(parsed_log): # make sure we are getting either an error or the build ...
cad7093a3175868944acf1d2f62bad523e4f8a41
tests/unit/utils/test_thin.py
tests/unit/utils/test_thin.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Bo Maryniuk <bo@suse.de>` ''' from __future__ import absolute_import, print_function, unicode_literals import datetime from tests.support.unit import TestCase, skipIf from tests.support.mock import ( NO_MOCK, NO_MOCK_REASON, MagicMock, patch) from s...
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Bo Maryniuk <bo@suse.de>` ''' from __future__ import absolute_import, print_function, unicode_literals import datetime from tests.support.unit import TestCase, skipIf from tests.support.mock import ( NO_MOCK, NO_MOCK_REASON, MagicMock, patch) from s...
Add unit test for missing dependencies on get_ext_tops
Add unit test for missing dependencies on get_ext_tops
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
--- +++ @@ -15,7 +15,7 @@ from salt.ext.six.moves import zip from salt.ext import six -import salt.utils.ssdp as ssdp +from salt.utils import thin import salt.utils.stringutils try: @@ -24,15 +24,34 @@ pytest = None +class SaltSyetemExitException(Exception): + ''' + System + ''' + def __i...
cb073dc49efffad56d880f63fd709e5a803e7cf6
blog/admin.py
blog/admin.py
from django.contrib import admin # Register your models here. from .models import Post from .models import UserProfile from .models import SocialMedia class ArticleAdmin(admin.ModelAdmin): list_display = ("title", "category", "created", "updated", "status") search_fields = ("title", "category", "content") ...
from django.contrib import admin # Register your models here. from .models import Post from .models import UserProfile from .models import SocialMedia class PostAdmin(admin.ModelAdmin): list_display = ("title", "category", "created", "updated", "status") search_fields = ("title", "category", "content") ...
Rename model Article to Post
Rename model Article to Post
Python
apache-2.0
andreztz/DjangoBlog,andreztz/DjangoBlog,andreztz/DjangoBlog
--- +++ @@ -7,7 +7,7 @@ from .models import SocialMedia -class ArticleAdmin(admin.ModelAdmin): +class PostAdmin(admin.ModelAdmin): list_display = ("title", "category", "created", "updated", "status") search_fields = ("title", "category", "content") list_filter = ("created",) @@ -24,6 +24,6 @@ ...
8d04b93852a578cec556607af4ea298ffa95e0dd
examples/makebs.config.py
examples/makebs.config.py
#!/usr/bin/env python2 # # You may want to alter these before running ./makebuildserver # Name of the base box to use basebox = "testing32" # Location where raring32.box can be found, if you don't already have # it. For security reasons, it's recommended that you make your own # in a secure environment using trusted ...
#!/usr/bin/env python2 # # You may want to alter these before running ./makebuildserver # Name of the base box to use basebox = "testing32" # Location where testing32.box can be found, if you don't already have # it. For security reasons, it's recommended that you make your own # in a secure environment using trusted...
Update comment referring to old "raring32.box" image
Update comment referring to old "raring32.box" image
Python
agpl-3.0
matlink/fdroidserver,matlink/fdroidserver,f-droid/fdroidserver,f-droid/fdroid-server,f-droid/fdroid-server,fdroidtravis/fdroidserver,matlink/fdroidserver,f-droid/fdroidserver,OneEducation/AppUniverse_Server,fdroidtravis/fdroidserver,f-droid/fdroid-server,fdroidtravis/fdroidserver,matlink/fdroidserver,f-droid/fdroid-ser...
--- +++ @@ -5,7 +5,7 @@ # Name of the base box to use basebox = "testing32" -# Location where raring32.box can be found, if you don't already have +# Location where testing32.box can be found, if you don't already have # it. For security reasons, it's recommended that you make your own # in a secure environment...
ec44992c82d25eb865f25c76adc1cace8bd8815a
dags/euctr.py
dags/euctr.py
from datetime import datetime from airflow.models import DAG from airflow.operators.latest_only_operator import LatestOnlyOperator import utils.helpers as helpers args = { 'owner': 'airflow', 'depends_on_past': False, 'start_date': datetime(2016, 12, 1), 'retries': 1, } dag = DAG( dag_id='euctr', ...
from datetime import datetime from airflow.models import DAG from airflow.operators.latest_only_operator import LatestOnlyOperator import utils.helpers as helpers args = { 'owner': 'airflow', 'depends_on_past': False, 'start_date': datetime(2016, 12, 1), 'retries': 1, } dag = DAG( dag_id='euctr', ...
Change EUCTR schedule to @weekly
Change EUCTR schedule to @weekly
Python
mpl-2.0
opentrials/opentrials-airflow,opentrials/opentrials-airflow
--- +++ @@ -14,7 +14,7 @@ dag_id='euctr', default_args=args, max_active_runs=1, - schedule_interval='@monthly' + schedule_interval='@weekly' ) latest_only_task = LatestOnlyOperator(
158eb354c4860456bf12910c5f737b07c0a313a3
.meta_yaml_replacer.py
.meta_yaml_replacer.py
#!/usr/bin/env python # Copyright (c) 2016, Michael Boyle # See LICENSE file for details: <https://github.com/moble/quaternion/blob/master/LICENSE> from __future__ import print_function import fileinput from auto_version import calculate_version version_string = calculate_version() f = fileinput.FileInput('meta.ya...
#!/usr/bin/env python # Copyright (c) 2016, Michael Boyle # See LICENSE file for details: <https://github.com/moble/quaternion/blob/master/LICENSE> from __future__ import print_function import fileinput from auto_version import calculate_version version_string = calculate_version().replace('+dirty', '') f = filein...
Remove "+dirty" from conda versions
Remove "+dirty" from conda versions
Python
mit
moble/quaternion,moble/quaternion
--- +++ @@ -8,7 +8,7 @@ import fileinput from auto_version import calculate_version -version_string = calculate_version() +version_string = calculate_version().replace('+dirty', '') f = fileinput.FileInput('meta.yaml', inplace=True) for line in f:
117b202a1c28282a2c27a545c3da29df9e5675ec
ds_unordered_list.py
ds_unordered_list.py
from __future__ import print_function class List(object): """List class.""" def __init__(self): pass def add(self, item): pass def remove(self, item): pass def search(self, item): pass def is_empty(self): pass def length(self): pass ...
from __future__ import print_function class Node(object): """Node class as building block for unordered list.""" def __init__(self, init_data): pass def get_data(self): pass def get_next(self): pass def set_data(self, new_data): pass def set_next(self, new_n...
Add node class for unordered list building block
Add node class for unordered list building block
Python
bsd-2-clause
bowen0701/algorithms_data_structures
--- +++ @@ -1,8 +1,39 @@ from __future__ import print_function +class Node(object): + """Node class as building block for unordered list.""" + def __init__(self, init_data): + pass + + def get_data(self): + pass + + def get_next(self): + pass + + def set_data(self, new_data): ...
65a6f21e992cc51238c6916895e9cf2f2b2bab21
driver_code_test.py
driver_code_test.py
import SimpleCV as scv from SimpleCV import Image import cv2 import time from start_camera import start_camera import threading def take_50_pictures(): camera_thread = threading.Thread(target=start_camera) camera_thread.start() from get_images_from_pi import get_image, valid_image time.sleep(2) count = 0 w...
import SimpleCV as scv from SimpleCV import Image import cv2 import time from start_camera import start_camera import threading def take_50_pictures(): camera_thread = threading.Thread(target=start_camera) camera_thread.start() from get_images_from_pi import get_image, valid_image time.sleep(2) count = 0 w...
Make detect stop sign function for Henry to add into class
Make detect stop sign function for Henry to add into class
Python
mit
jwarshaw/RaspberryDrive
--- +++ @@ -17,23 +17,19 @@ def detect_stop_sign(image): reds = image.hueDistance(color=scv.Color.RED) - stretch = reds.stretch(20,21) - invert = stretch.invert() - blobs = invert.findBlobs(minsize=2000) + stretched_image = reds.stretch(20,21) + inverted_image = stretched_image.invert() + blobs = inverted...
c84c4ce448f367be0d1759ad20fc8dc58de8fc89
requests_aws_sign/requests_aws_sign.py
requests_aws_sign/requests_aws_sign.py
try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse from botocore.auth import SigV4Auth from botocore.awsrequest import AWSRequest import requests class AWSV4Sign(requests.auth.AuthBase): """ AWS V4 Request Signer for Requests. """ def __init__(self, crede...
try: from urllib.parse import urlparse, urlencode, parse_qs except ImportError: from urlparse import urlparse, parse_qs from urllib import urlencode from botocore.auth import SigV4Auth from botocore.awsrequest import AWSRequest import requests class AWSV4Sign(requests.auth.AuthBase): """ AWS V4 Re...
Handle special characters by urlencode, like 'q=id:123'
Handle special characters by urlencode, like 'q=id:123'
Python
isc
jmenga/requests-aws-sign
--- +++ @@ -1,7 +1,8 @@ try: - from urllib.parse import urlparse + from urllib.parse import urlparse, urlencode, parse_qs except ImportError: - from urlparse import urlparse + from urlparse import urlparse, parse_qs + from urllib import urlencode from botocore.auth import SigV4Auth from botocore....
0a2e0798dcd257d1c0f3b9cf923af38487d3adde
setup.py
setup.py
from setuptools import setup # To set __version__ __version__ = '0.0.2' setup(name="socketconsole", version=__version__, py_modules=['socketconsole'], description="Unix socket access to python thread dump", zip_safe=False, entry_points={ 'console_scripts': [ 'socketreader=sock...
from setuptools import setup # To set __version__ __version__ = '0.0.3' setup(name="socketconsole", version=__version__, py_modules=['socketconsole', 'socketreader'], description="Unix socket access to python thread dump", zip_safe=False, entry_points={ 'console_scripts': [ 's...
Make sure script is included
Make sure script is included
Python
bsd-3-clause
robotadam/socketconsole
--- +++ @@ -2,11 +2,11 @@ # To set __version__ -__version__ = '0.0.2' +__version__ = '0.0.3' setup(name="socketconsole", version=__version__, - py_modules=['socketconsole'], + py_modules=['socketconsole', 'socketreader'], description="Unix socket access to python thread dump", zip_safe=Fa...
f453181fd28f914c285a0cdc6d066c740206ea3d
setup.py
setup.py
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ from setuptools import setup, find_packages setup( name='integrate', version='1.1.0', description='Test framework for integration tests with dependencies', url='https://githu...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ from setuptools import setup, find_packages setup( name='integrate', version='1.1.1', description='Test framework for integration tests with dependencies', url='https://githu...
Increment patch version for Readme update
Increment patch version for Readme update
Python
bsd-3-clause
anfema/integrate
--- +++ @@ -8,7 +8,7 @@ setup( name='integrate', - version='1.1.0', + version='1.1.1', description='Test framework for integration tests with dependencies', url='https://github.com/anfema/integrate', author='Johannes Schriewer',
6107e4d6b2d437c2762b2b93071e44ccdb508948
setup.py
setup.py
#!/usr/bin/env python3 """ Dispatch your torrents into multiple watchdirs See: https://github.com/Anthony25/torrents_dispatcher """ from os import path from setuptools import setup here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, "README.mkd")...
#!/usr/bin/env python3 """ Dispatch your torrents into multiple watchdirs See: https://github.com/Anthony25/torrents_dispatcher """ from os import path from setuptools import setup here = path.abspath(path.dirname(__file__)) setup( name="torrents_dispatcher", version="0.0.1", description="Dispatch ...
Fix build failure with pip
Fix build failure with pip
Python
bsd-2-clause
Anthony25/torrents_dispatcher
--- +++ @@ -11,17 +11,11 @@ here = path.abspath(path.dirname(__file__)) -# Get the long description from the README file -with open(path.join(here, "README.mkd"), encoding="utf-8") as f: - long_description = f.read() - - setup( name="torrents_dispatcher", version="0.0.1", description="Dispat...
d506ceb3e3327f086b79cf38d39b34d5825132d0
dynamite/message.py
dynamite/message.py
import enum class Opcode(enum.IntEnum): QUERY = 0 IQUERY = 1 STATUS = 2 class ResponseCode(enum.IntEnum): NO_ERROR = 0 FORMAT_ERROR = 1 SERVER_ERROR = 2 NAME_ERROR = 3 NOT_IMPLEMENTED = 4 REFUSED = 5 class Message: def to_bytes(): return b'' class MessageParser: ...
import enum class OPCode(enum.IntEnum): QUERY = 0 IQUERY = 1 STATUS = 2 class RCode(enum.IntEnum): NO_ERROR = 0 FORMAT_ERROR = 1 SERVER_ERROR = 2 NAME_ERROR = 3 NOT_IMPLEMENTED = 4 REFUSED = 5 class Message: def to_bytes(): return b'' class MessageParser: de...
Use names as indicated in RFC 1035
Use names as indicated in RFC 1035
Python
apache-2.0
svisser/dynamite
--- +++ @@ -1,13 +1,13 @@ import enum -class Opcode(enum.IntEnum): +class OPCode(enum.IntEnum): QUERY = 0 IQUERY = 1 STATUS = 2 -class ResponseCode(enum.IntEnum): +class RCode(enum.IntEnum): NO_ERROR = 0 FORMAT_ERROR = 1 SERVER_ERROR = 2
895652eabfd8313b15015969dc9b7459d9c890d5
setup.py
setup.py
from setuptools import setup import codecs import schema setup( name=schema.__name__, version=schema.__version__, author="Vladimir Keleshev", author_email="vladimir@keleshev.com", description="Simple data validation library", license="MIT", keywords="schema json validation", url="http...
from setuptools import setup import codecs import schema setup( name=schema.__name__, version=schema.__version__, author="Vladimir Keleshev", author_email="vladimir@keleshev.com", description="Simple data validation library", license="MIT", keywords="schema json validation", url="http...
Add Python 3.7 to the list of Trove classifiers
Add Python 3.7 to the list of Trove classifiers
Python
mit
keleshev/schema
--- +++ @@ -25,6 +25,7 @@ "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: PyPy", "License :: OS...
4bb450a883ba0a851c823491540dd7294216c2d0
setup.py
setup.py
# -*- coding: utf-8 -*- import os from setuptools import setup, find_packages from hsync._version import __version__ setup( name = 'hsync', version = __version__, author = 'André Lucas', author_email = 'andre.lucas@devinfotech.co.uk', license = 'BSD', packages = [ 'hsy...
# -*- coding: utf-8 -*- import os from setuptools import setup, find_packages from hsync._version import __version__ setup( name = 'hsync', version = __version__, author = 'Andre Lucas', author_email = 'andre.lucas@devinfotech.co.uk', license = 'BSD', packages = [ 'hsy...
Remove the non-ASCII character. Safer.
Remove the non-ASCII character. Safer. Works fine with setup.py, but py2dsc gets upset.
Python
bsd-3-clause
andrelucas/hsync
--- +++ @@ -8,7 +8,7 @@ setup( name = 'hsync', version = __version__, - author = 'André Lucas', + author = 'Andre Lucas', author_email = 'andre.lucas@devinfotech.co.uk', license = 'BSD', packages = [ 'hsync', ],
fbbdef69f8c234926d644d1c5c77dc1bae1c4a21
setup.py
setup.py
from __future__ import unicode_literals from codecs import open as codecs_open from setuptools import setup, find_packages # Get the long description from the relevant file with codecs_open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name='geog', version='0.0.1', descrip...
from __future__ import unicode_literals from codecs import open as codecs_open from setuptools import setup, find_packages # Get the long description from the relevant file with codecs_open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name='geog', version='0.0.1', descrip...
Add tox to test extras
Add tox to test extras
Python
mit
jwass/geog
--- +++ @@ -26,6 +26,6 @@ 'numpy', ], extras_require={ - 'test': ['pytest'], + 'test': ['pytest', 'tox'], }, )
69a94a60d04991ba5f8c25276455dedc3a0b898c
setup.py
setup.py
from distutils.core import setup setup( name='pypicache', version='0.1', description='PyPI caching and proxying server', author='Michael Twomey', author_email='mick@twomeylee.name', url='http://readthedocs.org/projects/pypicache/', packages=['pypicache'], )
from distutils.core import setup setup( name='pypicache', version='0.1', description='PyPI caching and proxying server', author='Michael Twomey', author_email='mick@twomeylee.name', url='http://readthedocs.org/projects/pypicache/', packages=['pypicache'], package_data={ 'pypicac...
Install assets when installing the package.
Install assets when installing the package.
Python
bsd-2-clause
micktwomey/pypicache
--- +++ @@ -8,4 +8,10 @@ author_email='mick@twomeylee.name', url='http://readthedocs.org/projects/pypicache/', packages=['pypicache'], + package_data={ + 'pypicache': [ + 'static/*/*', + 'templates/*.html', + ] + } )
15e7e578a211d9af4ed68ccf02361c06308c7d4e
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup long_description = open('README.rst').read() setup(name="quik", version="0.2.2-dev", description="A fast and lightweight Python template engine", long_description=long_description, author="Thiago Avelino", author_email="thiago@avelino.x...
#!/usr/bin/env python from setuptools import setup long_description = open('README.rst').read() setup(name="quik", version="0.2.2-dev", description="A fast and lightweight Python template engine", long_description=long_description, author="Thiago Avelino", author_email="thiago@avelino.x...
Change lincense, BSD to MIT
Change lincense, BSD to MIT
Python
mit
avelino/quik
--- +++ @@ -18,7 +18,7 @@ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Intended Audience :: Developers', - 'License :: OSI Approved :: BSD License', + 'License :: OSI Approved :: MIT License', 'Operating System :: OS In...
384fd7ba49ad0cfcb173656a5e31475e8c9b49b3
setup.py
setup.py
from distutils.core import setup import nagios setup(name='nagios-api', version=nagios.version, description='Control nagios using an API', author='Mark Smith', author_email='mark@qq.is', license='BSD New (3-clause) License', long_description=open('README.md').read(), url='http...
from distutils.core import setup import nagios setup(name='nagios-api', version=nagios.version, description='Control nagios using an API', author='Mark Smith', author_email='mark@qq.is', license='BSD New (3-clause) License', long_description=open('README.md').read(), url='http...
Use install_requires arg so dependencies are installed
Use install_requires arg so dependencies are installed
Python
bsd-3-clause
zorkian/nagios-api,zorkian/nagios-api
--- +++ @@ -11,9 +11,9 @@ url='https://github.com/xb95/nagios-api', packages=['nagios'], scripts=['nagios-cli', 'nagios-api'], - requires=[ - 'diesel(>=3.0)', - 'greenlet(==0.3.4)', + install_requires=[ + 'diesel>=3.0', + 'greenlet==0.3.4', 'requests...
4bfd4d32f41e173944bbf76d35c3d88a96930013
setup.py
setup.py
#!/usr/bin/env python import sys from setuptools import setup VERSION = (0, 3) VERSION_STR = ".".join(map(str, VERSION)) url = 'https://github.com/mila/spadl' try: if sys.version_info >= (3,): long_description = open('README.rst', 'rb').read().decode('utf-8') else: long_description = open('...
#!/usr/bin/env python import sys from setuptools import setup VERSION = (0, 4) VERSION_STR = ".".join(map(str, VERSION)) url = 'https://github.com/mila/spadl' try: if sys.version_info >= (3,): long_description = open('README.rst', 'rb').read().decode('utf-8') else: long_description = open('...
Increment the version to realease README with notice about archiving.
Increment the version to realease README with notice about archiving.
Python
bsd-3-clause
mila/spadl
--- +++ @@ -3,7 +3,7 @@ import sys from setuptools import setup -VERSION = (0, 3) +VERSION = (0, 4) VERSION_STR = ".".join(map(str, VERSION))
993414b8c0e99bf88285dd7c3f0fa0e41ab7d0d9
setup.py
setup.py
#!/usr/bin/python from setuptools import setup, find_packages EXTRAS_REQUIRES = dict( web=[ 'bottle>=0.11', ], test=[ 'pytest>=2.2.4', 'mock>=0.8.0', ], dev=[ 'ipython>=0.13', ], ) # Tests always depend on all other requirements, except dev for k...
#!/usr/bin/python from setuptools import setup, find_packages EXTRAS_REQUIRES = dict( web=[ 'bottle>=0.11', 'paste>=1.7.5.1', ], mongo=[ 'pymongo>=2.3', ], test=[ 'pytest>=2.2.4', 'mock>=0.8.0', ], dev=[ 'ipython>=0.13', ], ) ...
Add paste and pymongo dependencies
Add paste and pymongo dependencies
Python
mit
thelinuxkid/gumjabi
--- +++ @@ -4,7 +4,11 @@ EXTRAS_REQUIRES = dict( web=[ 'bottle>=0.11', - ], + 'paste>=1.7.5.1', + ], + mongo=[ + 'pymongo>=2.3', + ], test=[ 'pytest>=2.2.4', 'mock>=0.8.0',
a79a55502d4b4e4867d997cb80630181444a3274
setup.py
setup.py
from setuptools import setup setup( name='feature-extraction', author='Liam Marshall', author_email='limarshall@wisc.edu', version='0.1', license='Apache', packages=['feature_extraction'], install_requires=['numpy', 'Pillow', 'Click', 'scikit-image', 'centrosome'], entry_points=''' [console_scripts] extrac...
from setuptools import setup setup( name='feature-extraction', author='Liam Marshall', author_email='limarshall@wisc.edu', version='0.1', license='Apache', packages=['feature_extraction'], install_requires=['PyYAML', 'numpy', 'Pillow', 'Click', 'scikit-image', 'centrosome'], entry_points=''' [console_script...
Add PyYAML as a dep in preparation for pipeline manifests
Add PyYAML as a dep in preparation for pipeline manifests
Python
apache-2.0
widoptimization-willett/feature-extraction
--- +++ @@ -8,7 +8,7 @@ license='Apache', packages=['feature_extraction'], - install_requires=['numpy', 'Pillow', 'Click', 'scikit-image', 'centrosome'], + install_requires=['PyYAML', 'numpy', 'Pillow', 'Click', 'scikit-image', 'centrosome'], entry_points=''' [console_scripts]
632c13c31e915a36b81fc60e305dd168bb4e679f
setup.py
setup.py
from distutils.core import setup setup( name = "linode-python", version = "1.1", description = "Python bindings for Linode API", author = "TJ Fontaine", author_email = "tjfontaine@gmail.com", url = "https://github.com/tjfontaine/linode-python", packages = ['linode'], )
from distutils.core import setup setup( name = "linode-python", version = "1.1", description = "Python bindings for Linode API", author = "TJ Fontaine", author_email = "tjfontaine@gmail.com", url = "https://github.com/tjfontaine/linode-python", packages = ['linode'], extras_require = { ...
Add an extra_requires for requests
Add an extra_requires for requests This will let folks do: pip install linode-python[requests] ... to install requests alongside linode-python. Fixes #23 comment 2
Python
mit
ryanshawty/linode-python,tjfontaine/linode-python
--- +++ @@ -8,4 +8,7 @@ author_email = "tjfontaine@gmail.com", url = "https://github.com/tjfontaine/linode-python", packages = ['linode'], + extras_require = { + 'requests': ["requests"], + }, )
a399f9c81b4ad145ebe653bd6c9e8f9396b705f9
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages dev_requires = [ 'Sphinx==1.2.2', ] install_requires = [ 'nodeconductor>=0.78.0', ] setup( name='nodeconductor-saltstack', version='0.1.1', author='OpenNode Team', author_email='info@opennodecloud.com', url='http://nodec...
#!/usr/bin/env python from setuptools import setup, find_packages dev_requires = [ 'Sphinx==1.2.2', ] install_requires = [ 'nodeconductor>=0.79.0', ] setup( name='nodeconductor-saltstack', version='0.1.1', author='OpenNode Team', author_email='info@opennodecloud.com', url='http://nodec...
Upgrade required version of nodeconductor (NC-909)
Upgrade required version of nodeconductor (NC-909)
Python
mit
opennode/nodeconductor-saltstack
--- +++ @@ -8,7 +8,7 @@ ] install_requires = [ - 'nodeconductor>=0.78.0', + 'nodeconductor>=0.79.0', ]
479972b027c1571be1a3b0c7659c7e3ccf12939e
setup.py
setup.py
from setuptools import setup, find_packages setup( name='zeit.objectlog', version='0.11dev', author='Christian Zagrodnick', author_email='cz@gocept.com', description="""\ """, packages=find_packages('src'), package_dir = {'': 'src'}, include_package_data = True, zip_safe=False, ...
from setuptools import setup, find_packages setup( name='zeit.objectlog', version='0.11dev', author='Christian Zagrodnick', author_email='cz@gocept.com', description="""\ """, packages=find_packages('src'), package_dir = {'': 'src'}, include_package_data = True, zip_safe=False, ...
Declare dependency on zeit.cms (for testing)
Declare dependency on zeit.cms (for testing)
Python
bsd-3-clause
ZeitOnline/zeit.objectlog
--- +++ @@ -18,6 +18,7 @@ 'pytz', 'setuptools', 'zc.sourcefactory', + 'zeit.cms', 'zope.app.component', 'zope.app.form', 'zope.app.generations',
9cf9a1d70a5d453dfd217c1ba148eccdc630912e
FetchStats/Plugins/Facter.py
FetchStats/Plugins/Facter.py
from FetchStats import Fetcher class Facter(Fetcher): import yaml def __init__(self): self.context = 'facter' self._load_data() def _load_data(self): try: output = self._exec('facter -p --yaml') self.facts = self.yaml.load(output) self._loaded(T...
from FetchStats import Fetcher class Facter(Fetcher): import yaml def __init__(self): self.context = 'facter' self._load_data() def _load_data(self): try: output = self._exec('facter -p --yaml') self.facts = self.yaml.load(output) self._loaded(T...
Watch for missing facter command
Watch for missing facter command
Python
mit
pombredanne/jsonstats,pombredanne/jsonstats,RHInception/jsonstats,RHInception/jsonstats
--- +++ @@ -12,7 +12,11 @@ output = self._exec('facter -p --yaml') self.facts = self.yaml.load(output) self._loaded(True) + except OSError, e: + # Couldn't find facter command, most likely + self._loaded(False, msg=str(e)) except Exception, ...
d65549b33fca6516436864c44ba3de459d68e679
setup.py
setup.py
# coding=utf-8 from __future__ import absolute_import, division, print_function import sys from setuptools import setup VERSION='0.1.0' ANTLR4 = 'antlr4-python{}-runtime'.format(sys.version_info.major) setup( name='vfp2py', version=VERSION, description='Convert foxpro code to python', author='Michae...
# coding=utf-8 from __future__ import absolute_import, division, print_function import sys from setuptools import setup VERSION='0.1.0' ANTLR4 = 'antlr4-python{}-runtime'.format(sys.version_info.major) setup( name='vfp2py', version=VERSION, description='Convert foxpro code to python', author='Michae...
Change pyodbc requirement to >= version
Change pyodbc requirement to >= version
Python
mit
mwisslead/vfp2py,mwisslead/vfp2py
--- +++ @@ -24,7 +24,7 @@ "Programming Language :: Foxpro", "Topic :: Software Development :: Libraries :: Python Modules", ], - install_requires=[ANTLR4 + '==4.8', 'dbf==0.97.2', 'autopep8==1.2.4', 'isort==4.3.4', 'python-dateutil==2.7.2', 'pyodbc==4.0.23'], + install_requires=[ANTLR4 + ...
4b418cee7bcf1f2d47674a94c5070f40771f54f5
BayesClassification.py
BayesClassification.py
#!/usr/bin/python # coding: latin-1 #------------------------------------------------------------------------------# # Artificial Intelligence - Bayes Classification Algorithms # # ============================================================================ # # Organization: HE-Arc Engineering ...
#!/usr/bin/python # coding: latin-1 #------------------------------------------------------------------------------# # Artificial Intelligence - Bayes Classification Algorithms # # ============================================================================ # # Organization: HE-Arc Engineering ...
Add DataFile class to split words of a line and count it
Add DataFile class to split words of a line and count it
Python
apache-2.0
Chavjoh/BayesClassificationPython
--- +++ @@ -27,6 +27,41 @@ #------------------------------------------------------------------------------# +class DataFile: + + def __init__(self, fileLine, isGood): + """ + + :rtype : object + """ + self.isGood = isGood + self.fileLine = fileLine + self.wordsCount =...
4797197ae4f53c4de46083d330654cf74849cf26
setup.py
setup.py
from setuptools import setup, find_packages version = '0.1' install_requires = [ 'SQLAlchemy>=0.7.8' ] setup_requires = [ 'nose' ] tests_require = install_requires + [ 'coverage', 'psycopg2', ] setup(name='GeoAlchemy2', version=version, description="Using SQLAlchemy with S...
from setuptools import setup, find_packages version = '0.1' install_requires = [ 'SQLAlchemy>0.7' ] setup_requires = [ 'nose' ] tests_require = install_requires + [ 'coverage', 'psycopg2', ] setup(name='GeoAlchemy2', version=version, description="Using SQLAlchemy with Spat...
Revert "require SQLAlchemy>=0.7.8 for readthedocs"
Revert "require SQLAlchemy>=0.7.8 for readthedocs" This reverts commit 689712e7ec4035e03934a4f32e788c133fa7a13c.
Python
mit
geoalchemy/geoalchemy2
--- +++ @@ -4,7 +4,7 @@ version = '0.1' install_requires = [ - 'SQLAlchemy>=0.7.8' + 'SQLAlchemy>0.7' ]
3997dc74b50e83a661dc3efa2adf8355466133ac
setup.py
setup.py
try: from setuptools import setup except ImportError: from distutils.core import setup CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Program...
try: from setuptools import setup except ImportError: from distutils.core import setup from code_formatter import __version__ CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating...
Define version in one place
Define version in one place
Python
bsd-3-clause
paluh/code-formatter
--- +++ @@ -3,6 +3,8 @@ except ImportError: from distutils.core import setup + +from code_formatter import __version__ CLASSIFIERS = [ 'Development Status :: 4 - Beta', @@ -28,5 +30,5 @@ scripts=[], test_suite='code_formatter.tests.test_suite', zip_safe=False, - version = '0.1.0c1', ...
39dcf1965aa286881f556b65b781decf9835605b
setup.py
setup.py
from setuptools import setup setup(name='fortdepend', version='0.1.0', description='Automatically generate Fortran dependencies', author='Peter Hill', author_email='peter@fusionplasma.co.uk', url='https://github.com/ZedThree/fort_depend.py/', download_url='https://github.com/ZedThre...
from setuptools import setup setup(name='fortdepend', version='0.1.0', description='Automatically generate Fortran dependencies', author='Peter Hill', author_email='peter@fusionplasma.co.uk', url='https://github.com/ZedThree/fort_depend.py/', download_url='https://github.com/ZedThre...
Use latest version of pcpp that's actually on pypi
Use latest version of pcpp that's actually on pypi
Python
mit
ZedThree/fort_depend.py,ZedThree/fort_depend.py
--- +++ @@ -21,7 +21,7 @@ packages=['fortdepend'], install_requires=[ 'colorama >= 0.3.9', - 'pcpp >= 1.1.1' + 'pcpp >= 1.1.0' ], extras_requires={ 'tests': ['pytest >= 3.3.0'],
9ee6b2e61fccf7ebc6b3e90370f78ffcf948969d
webserver/home/views.py
webserver/home/views.py
from django.views.generic import TemplateView from competition.models import Competition class HomePageView(TemplateView): template_name = "home/home.html" def get_context_data(self, **kwargs): context = super(HomePageView, self).get_context_data(**kwargs) my_competitions = Competition.objec...
from django.views.generic import TemplateView from competition.models import Competition class HomePageView(TemplateView): template_name = "home/home.html" def get_context_data(self, **kwargs): context = super(HomePageView, self).get_context_data(**kwargs) if not self.request.user.is_an...
Check if user is not anonymous on homepage
Check if user is not anonymous on homepage
Python
bsd-3-clause
siggame/webserver,siggame/webserver,siggame/webserver
--- +++ @@ -7,9 +7,11 @@ template_name = "home/home.html" def get_context_data(self, **kwargs): - context = super(HomePageView, self).get_context_data(**kwargs) - my_competitions = Competition.objects.user_registered(self.request.user) - context["registered_competitions"] = my_competiti...
c9a93f6ba48c05438c83738f1729ee7e4b4fd346
setup.py
setup.py
from setuptools import setup setup( name='libgen.py', version='0.1.0', license='MIT', author='Adolfo Silva', author_email='code@adolfosilva.org', url='https://github.com/adolfosilva/libgen.py', description='A script to download books from gen.lib.rus.ec', classifiers=[ 'License ...
from setuptools import setup setup( name='libgen.py', version='0.1.0', license='MIT', author='Adolfo Silva', author_email='code@adolfosilva.org', url='https://github.com/adolfosilva/libgen.py', description='A script to download books from gen.lib.rus.ec', classifiers=[ 'License ...
Package requires at least Python 3.5
Package requires at least Python 3.5
Python
mit
adolfosilva/libgen.py
--- +++ @@ -15,6 +15,7 @@ include_package_data=True, # include files listed in MANIFEST.in tests_requires=['pytest'], py_modules=['libgen'], + python_requires='~=3.5', entry_points={ 'console_scripts': ['libgen=libgen:main'], },
db20e918844890979a6af6bfa3b3e74c09914728
utilities/test_find_pairs_pt.py
utilities/test_find_pairs_pt.py
# Test code for find_pairs_pt.py import pytest import find_pairs_pt as fp def test_one_pair(): assert fp.find_pairs_simple([1,9]) == [(1,9)] assert fp.find_pairs([1,9]) == [(1,9)] ''' >>> find_pairs_simple([9]) >>> find_pairs_simple([1,9]) 1,9 >>> find_pairs_simple([9,1]) ...
# Test code for find_pairs_pt.py import pytest import find_pairs_pt as fp def test_no_pairs(): test_array = [9] response = [] assert fp.find_pairs_simple(test_array) == response assert fp.find_pairs(test_array) == response def test_one_pair(): test_array = [1,9] response = [(...
Simplify format for test creation
Simplify format for test creation
Python
mit
daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various
--- +++ @@ -3,21 +3,42 @@ import pytest import find_pairs_pt as fp + +def test_no_pairs(): + test_array = [9] + response = [] + assert fp.find_pairs_simple(test_array) == response + assert fp.find_pairs(test_array) == response + + def test_one_pair(): - assert fp.find_pairs_simple([1,9]) == [(1,9)...
dbb9becd09bbb9808060272b74e664afc354dfa8
modeltranslation/tests/settings.py
modeltranslation/tests/settings.py
# -*- coding: utf-8 -*- """ Settings overrided for test time """ from django.conf import settings INSTALLED_APPS = tuple(settings.INSTALLED_APPS) + ( 'modeltranslation.tests', ) LANGUAGES = (('de', 'Deutsch'), ('en', 'English')) LANGUAGE_CODE = 'de' MODELTRANSLATION_DEFAULT_LANGUAGE = 'de' USE_I18N...
# -*- coding: utf-8 -*- """ Settings overrided for test time """ import django from django.conf import settings INSTALLED_APPS = tuple(settings.INSTALLED_APPS) + ( 'modeltranslation.tests', ) LANGUAGES = (('de', 'Deutsch'), ('en', 'English')) LANGUAGE_CODE = 'de' MODELTRANSLATION_DEFAULT_LANGUAGE = ...
Set empty MIGRATION_MODULES setting for Django 1.11. Should make the tests run again.
Set empty MIGRATION_MODULES setting for Django 1.11. Should make the tests run again.
Python
bsd-3-clause
deschler/django-modeltranslation,deschler/django-modeltranslation
--- +++ @@ -2,6 +2,7 @@ """ Settings overrided for test time """ +import django from django.conf import settings @@ -23,4 +24,8 @@ ROOT_URLCONF = 'modeltranslation.tests.urls' -MIGRATION_MODULES = {'auth': 'modeltranslation.tests.auth_migrations'} +if django.VERSION < (1, 11): + # TODO: Check what thi...
f3bf773868b17f1928167787e783e5b2b70d7ed0
setup.py
setup.py
from setuptools import setup import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'hellosign_sdk')) def readme(): with open('README.md') as f: return f.read() setup(name='hellosign-python-sdk', version='3.0', description="An API wrapper written in Python to interact...
from setuptools import setup import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'hellosign_sdk')) def readme(): with open('README.md') as f: return f.read() setup(name='hellosign-python-sdk', version='3.0', description="A Python wrapper for the HelloSign API (http...
Copy changes for the sdk package description
Copy changes for the sdk package description
Python
mit
arshsingh/hellosign-python-sdk,HelloFax/hellosign-python-sdk
--- +++ @@ -10,10 +10,10 @@ setup(name='hellosign-python-sdk', version='3.0', - description="An API wrapper written in Python to interact with HelloSign's API (http://www.hellosign.com)", + description="A Python wrapper for the HelloSign API (http://www.hellosign.com/api)", long_description...
f8c8c14e0ca6f8e3174a14f519b395a4e0bfe043
setup.py
setup.py
from setuptools import setup from setuptools.command.test import test as TestCommand class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): #import here, cause outside the eggs a...
from setuptools import setup from setuptools.command.test import test as TestCommand class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): #import here, cause outside the eggs a...
Install requirements now include SciPy.
Install requirements now include SciPy. Used in the operators subpackage, and will likely be used elsewhere due to the sparse package being inside scipy.
Python
bsd-3-clause
ryanorendorff/pyop
--- +++ @@ -36,7 +36,11 @@ , 'Topic :: Software Development :: Libraries :: Python Modules' ] , packages = ['pyop'] - , install_requires = ['six >= 1.6', 'numpy >= 1.8'] + , install_requires = + [ 'six >= 1.6' + , 'numpy >= 1.8' + , 'scipy >= 0.14.0' + ...
4efdee1f93e85b96607a21c0d8f79343ef989697
setup.py
setup.py
from setuptools import setup, find_packages setup( name = 'compdb', version = '0.1', package_dir = {'': 'src'}, packages = find_packages('src'), author = 'Carl Simon Adorf', author_email = 'csadorf@umich.edu', description = "Computational Database.", keywords = 'simulation tools mc md ...
from setuptools import setup, find_packages setup( name = 'compdb', version = '0.1', package_dir = {'': 'src'}, packages = find_packages('src'), author = 'Carl Simon Adorf', author_email = 'csadorf@umich.edu', description = "Computational Database.", keywords = 'simulation tools mc md ...
Make mpi4py required for this package.
Make mpi4py required for this package.
Python
bsd-3-clause
csadorf/signac,csadorf/signac
--- +++ @@ -18,7 +18,7 @@ "Topic :: Scientific/Engineering :: Physics", ], - install_requires=['pymongo'], + install_requires=['pymongo', 'mpi4py'], entry_points = { 'console_scripts': [
53b176674f1d72396b066705e502b5fcbee16a91
vulyk/plugins/dummy/__init__.py
vulyk/plugins/dummy/__init__.py
import json import logging from werkzeug.utils import import_string logger = logging.getLogger(__name__) def get_task(request): return json.dumps({}) def configure(self_settings): """ Getting plugin's default settings, overwriting them with settings from local_settings.py, returns list of setting...
import json import logging from werkzeug.utils import import_string logger = logging.getLogger(__name__) def get_task(request): return json.dumps({}) def configure(self_settings): """ Getting plugin's default settings, overwriting them with settings from local_settings.py, returns dict of setting...
Fix return format of plugin's settings
Fix return format of plugin's settings
Python
bsd-3-clause
mrgambal/vulyk,mrgambal/vulyk,mrgambal/vulyk
--- +++ @@ -14,14 +14,17 @@ def configure(self_settings): """ Getting plugin's default settings, overwriting them with settings - from local_settings.py, returns list of settings + from local_settings.py, returns dict of settings """ + settings = {} try: local_settings = import_...
7b634eb825e2e102caf862e8753012c35f14ee3f
yerba/__init__.py
yerba/__init__.py
# -*- coding: utf-8 -*- """ yerba: ------ A is a distributed job management framework copyright: (c) 2014 by Evan Briones license: MIT, refer to LICENSE for details """ __version__ = "0.4-dev"
# -*- coding: utf-8 -*- """ yerba: ------ A is a distributed job management framework Copyright (c) 2014 CoGe License: MIT, refer to LICENSE for details """ __version__ = "0.4-dev"
Change copyright holder to "CoGe"
Change copyright holder to "CoGe"
Python
bsd-2-clause
LyonsLab/Yerba,LyonsLab/Yerba
--- +++ @@ -5,8 +5,8 @@ A is a distributed job management framework - copyright: (c) 2014 by Evan Briones - license: MIT, refer to LICENSE for details + Copyright (c) 2014 CoGe + License: MIT, refer to LICENSE for details """ __version__ = "0.4-dev"
72d89466e40fadeb246b6d69ab0e7035f6bcc8da
gql/transport/requests.py
gql/transport/requests.py
from __future__ import absolute_import import requests from graphql.execution import ExecutionResult from graphql.language.printer import print_ast from .http import HTTPTransport class RequestsHTTPTransport(HTTPTransport): def __init__(self, auth=None, *args, **kwargs): super(RequestsHTTPTransport, sel...
from __future__ import absolute_import import requests from graphql.execution import ExecutionResult from graphql.language.printer import print_ast from .http import HTTPTransport class RequestsHTTPTransport(HTTPTransport): def __init__(self, auth=None, *args, **kwargs): super(RequestsHTTPTransport, sel...
Raise exception if HTTP request failed
Raise exception if HTTP request failed
Python
mit
graphql-python/gql
--- +++ @@ -23,6 +23,8 @@ headers=self.client_headers, auth=self.auth ) + request.raise_for_status() + result = request.json() assert 'errors' in result or 'data' in result, 'Received non-compatible response "{}"'.format(result) return ExecutionResu...
6b4e73a386ae0b4b904c32554cbdfba17aa2997a
workers/data_refinery_workers/downloaders/test_utils.py
workers/data_refinery_workers/downloaders/test_utils.py
import os from django.test import TestCase, tag from typing import List from unittest.mock import patch, call from urllib.error import URLError from data_refinery_workers.downloaders import utils class UtilsTestCase(TestCase): @tag('downloaders') def test_no_jobs_to_create(self): """Make sure this fu...
import os from django.test import TestCase, tag from typing import List from unittest.mock import patch, call from urllib.error import URLError from data_refinery_workers.downloaders import utils class UtilsTestCase(TestCase): @tag('downloaders') def test_no_jobs_to_create(self): """Make sure this fu...
Fix test for no download jobs.
Fix test for no download jobs.
Python
bsd-3-clause
data-refinery/data_refinery,data-refinery/data_refinery,data-refinery/data_refinery
--- +++ @@ -11,6 +11,6 @@ @tag('downloaders') def test_no_jobs_to_create(self): """Make sure this function doesn't raise an exception with no files.""" - create_processor_job_for_original_files([]) + utils.create_processor_job_for_original_files([]) self.assertTrue(True)
c72f021248eaf2b969967eb8663e72f888c5fba7
admin/preprints/serializers.py
admin/preprints/serializers.py
from website.project.taxonomies import Subject from admin.nodes.serializers import serialize_node def serialize_preprint(preprint): return { 'id': preprint._id, 'date_created': preprint.date_created, 'modified': preprint.date_modified, 'provider': preprint.provider, 'node'...
from website.project.taxonomies import Subject from admin.nodes.serializers import serialize_node def serialize_preprint(preprint): return { 'id': preprint._id, 'date_created': preprint.date_created, 'modified': preprint.date_modified, 'provider': preprint.provider, 'node'...
Add a bit of subject error handling just in case
Add a bit of subject error handling just in case
Python
apache-2.0
cslzchen/osf.io,Johnetordoff/osf.io,hmoco/osf.io,adlius/osf.io,pattisdr/osf.io,icereval/osf.io,cslzchen/osf.io,chrisseto/osf.io,mfraezz/osf.io,brianjgeiger/osf.io,HalcyonChimera/osf.io,chennan47/osf.io,Johnetordoff/osf.io,cwisecarver/osf.io,Nesiehr/osf.io,caseyrollins/osf.io,crcresearch/osf.io,HalcyonChimera/osf.io,bin...
--- +++ @@ -19,9 +19,11 @@ def serialize_subjects(subjects): serialized_subjects = [] for subject in subjects: - subject = Subject.load(subject[0]) - serialized_subjects.append({ - 'id': subject._id, - 'text': subject.text - }) + if len(subject) == 1: + ...
ae21969815351e84912d1d69be77e20450619acf
pyconll/conllable.py
pyconll/conllable.py
""" Holds the Conllable interface, which is a marker interface to show that a class is a Conll object, such as a treebank, sentence, or token, and therefore has a conll method. """ class Conllable: """ A Conllable mixin to indicate that the component can be converted into a CoNLL representation. """ ...
""" Holds the Conllable interface, which is a marker interface to show that a class is a Conll object, such as a treebank, sentence, or token, and therefore has a conll method. """ import abc class Conllable: """ A Conllable mixin to indicate that the component can be converted into a CoNLL representatio...
Define Conllable with an abstract method.
Define Conllable with an abstract method.
Python
mit
pyconll/pyconll,pyconll/pyconll
--- +++ @@ -3,6 +3,8 @@ is a Conll object, such as a treebank, sentence, or token, and therefore has a conll method. """ + +import abc class Conllable: @@ -11,6 +13,9 @@ CoNLL representation. """ + __metaclass__ = abc.ABCMeta + + @abc.abstractmethod def conll(self): """ ...
173f874c4cf911fc9a35e0e039f164cb625fdccc
imager/ImagerProfile/models.py
imager/ImagerProfile/models.py
from django.db import models from django.contrib.auth.models import User class ImagerProfile(models.Model): user = models.OneToOneField(User) profile_picture = models.ImageField(null=True) picture_privacy = models.BooleanField(default=False) phone_number = models.CharField(max_length=15) # X(XXX) X...
from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class ImagerProfile(models.Model): user = models.OneToOneField(User, related_name='profile') profile_pict...
Add string representation of class, is_active method, and first draft of active class method
Add string representation of class, is_active method, and first draft of active class method
Python
mit
nbeck90/django-imager,nbeck90/django-imager
--- +++ @@ -1,9 +1,12 @@ +from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User +from django.utils.encoding import python_2_unicode_compatible +@python_2_unicode_compatible class ImagerProfile(models.Model): - user = models.OneToOneField(User) + ...
e049017d8abfdee80a0d825af996cb5de2d63657
commands/seen.py
commands/seen.py
#*Flays seen function @command("seen") def seen(nick,user,channel,message): with db as conn: with conn.cursor() as cursor: cursor.execute("SELECT time, nick, message, channel from log where nick = %s order by time desc limit 1;", (message,)) row = cursor.fetchone() if row == None: say(channel, "No rec...
#*Flays seen function @command("seen") def seen(nick,user,channel,message): if db == None: return with db as conn: with conn.cursor() as cursor: cursor.execute("SELECT time, nick, message, channel from log where nick = %s order by time desc limit 1;", (message,)) row = cursor.fetchone() if row == None: ...
Handle case where db is not connected
Handle case where db is not connected
Python
unlicense
ccowmu/botler
--- +++ @@ -2,6 +2,7 @@ @command("seen") def seen(nick,user,channel,message): + if db == None: return with db as conn: with conn.cursor() as cursor: cursor.execute("SELECT time, nick, message, channel from log where nick = %s order by time desc limit 1;", (message,))
58cd5650900a426363c7e0b8fb9bf7d2f881f95b
quickadmin/config.py
quickadmin/config.py
from distutils.version import StrictVersion from django import get_version QADMIN_DEFAULT_EXCLUDES = [ 'django.contrib.sessions', 'django.contrib.admin', 'django.contrib.contenttypes', 'django.contrib.messages', 'django.contrib.comments', 'django.contrib.flatpages', 'django.contrib.sitema...
from distutils.version import StrictVersion from django import get_version QADMIN_DEFAULT_EXCLUDES = [ 'django.contrib.sessions', 'django.contrib.auth', 'django.contrib.admin', 'django.contrib.contenttypes', 'django.contrib.messages', 'django.contrib.comments', 'django.contrib.flatpages',...
Add Django auth as a stock application
Add Django auth as a stock application
Python
mit
zniper/django-quickadmin
--- +++ @@ -5,6 +5,7 @@ QADMIN_DEFAULT_EXCLUDES = [ 'django.contrib.sessions', + 'django.contrib.auth', 'django.contrib.admin', 'django.contrib.contenttypes', 'django.contrib.messages',
88221a3afbf8daa692a344ab7bb7f8d396d547f8
basis_set_exchange/__init__.py
basis_set_exchange/__init__.py
''' Basis Set Exchange Contains utilities for reading, writing, and converting basis set information ''' # Just import the basic user API from .api import (get_basis, lookup_basis_by_role, get_metadata, get_reference_data, get_all_basis_names, get_references, get_basis_family, filter_basis_sets, get...
''' Basis Set Exchange Contains utilities for reading, writing, and converting basis set information ''' # Just import the basic user API from .api import (get_basis, lookup_basis_by_role, get_metadata, get_reference_data, get_all_basis_names, get_references, get_basis_family, filter_basis_sets, get...
Make get_archive_types visible to top-level
Make get_archive_types visible to top-level
Python
bsd-3-clause
MOLSSI-BSE/basis_set_exchange
--- +++ @@ -9,7 +9,7 @@ from .api import (get_basis, lookup_basis_by_role, get_metadata, get_reference_data, get_all_basis_names, get_references, get_basis_family, filter_basis_sets, get_families, get_family_notes, get_basis_notes, get_schema, get_formats, get_reference_formats,...
1ea64f77c3fd3c779c8da43d68c282946a654771
sbt-client.py
sbt-client.py
#!/bin/env python import socket import sys from sys import argv from os import getcwd if len(argv) < 2: print "Usage: client <command>" sys.exit(-1) try: f = file("%s/target/sbt-server-port" % getcwd(), "r") port = int(f.read()) f.close() s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ...
#!/bin/env python import socket import sys from sys import argv from os import getcwd if len(argv) < 2: print "Usage: client <command>" sys.exit(-1) try: f = file("%s/target/sbt-server-port" % getcwd(), "r") port = int(f.read()) f.close() s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ...
Fix client script exit on exception
Fix client script exit on exception
Python
mit
pfn/sbt-simple-server
--- +++ @@ -21,3 +21,4 @@ sys.exit(int(r)) except Exception as e: print "sbt server not running in the current project: %s" % e + sys.exit(-2)
90860fbe9d5b21b51ade753bdc6dfefc15cb31ac
menpodetect/pico/conversion.py
menpodetect/pico/conversion.py
from menpo.shape import PointDirectedGraph import numpy as np def pointgraph_from_circle(fitting): y, x = fitting.center radius = fitting.diameter / 2.0 return PointDirectedGraph(np.array(((y, x), (y + radius, x), (y + radius,...
from menpo.shape import PointDirectedGraph import numpy as np def pointgraph_from_circle(fitting): diameter = fitting.diameter radius = diameter / 2.0 y, x = fitting.center y -= radius x -= radius return PointDirectedGraph(np.array(((y, x), (y + diameter...
Fix the circle to rectangle code
Fix the circle to rectangle code Was totally incorrect previously
Python
bsd-3-clause
jabooth/menpodetect,jabooth/menpodetect,yuxiang-zhou/menpodetect,yuxiang-zhou/menpodetect
--- +++ @@ -3,10 +3,13 @@ def pointgraph_from_circle(fitting): + diameter = fitting.diameter + radius = diameter / 2.0 y, x = fitting.center - radius = fitting.diameter / 2.0 + y -= radius + x -= radius return PointDirectedGraph(np.array(((y, x), - ...
7bb4e910ae8869c1108e306ee418b2c2bce8aa88
flask_app.py
flask_app.py
from flask import Flask from flask_caching import Cache import main app = Flask(__name__) cache = Cache(app, config={'CACHE_TYPE': 'simple'}) @app.route('/') def display_available(): content = ('<html>' + '<head>' + '<title>Restaurant Menu Parser</title>' + '</head>'...
from flask import Flask from flask_caching import Cache import main app = Flask(__name__) cache = Cache(app, config={'CACHE_TYPE': 'simple'}) @app.route('/') def display_available(): content = ('<html>' + '<head>' + '<title>Restaurant Menu Parser</title>' + '</head>...
Add request handler for specific restaurant.
Add request handler for specific restaurant.
Python
bsd-3-clause
talavis/kimenu
--- +++ @@ -6,6 +6,7 @@ app = Flask(__name__) cache = Cache(app, config={'CACHE_TYPE': 'simple'}) + @app.route('/') def display_available(): @@ -20,16 +21,28 @@ '</html>') return content + @app.route('/api/restaurants') @cache.cached(timeout=3600) def api_list_restaurants(): ret...
7f7d986471a413b5118db72546aafd24b3d454ca
SmartRemoteControl/www/server.py
SmartRemoteControl/www/server.py
import socket import time from flask import * import config # TCP port the Yun console listens for connections on. CONSOLE_PORT = 6571 # Create flask application. app = Flask(__name__) # Get activity configuration. activities = config.get_activities() @app.route('/') def root(): return render_template('index.h...
import socket import time from flask import * import config # TCP port the Yun console listens for connections on. CONSOLE_PORT = 6571 # Create flask application. app = Flask(__name__) # Get activity configuration. activities = config.get_activities() @app.route('/') def root(): return render_template('index.h...
Add socket shutdown to prevent bridge from crashing on connection reset.
Add socket shutdown to prevent bridge from crashing on connection reset.
Python
mit
Nosskirneh/SmartRemoteControl,punker76/SmartRemoteControl,Nosskirneh/SmartRemoteControl,punker76/SmartRemoteControl,tdicola/SmartRemoteControl,Nosskirneh/SmartRemoteControl,Nosskirneh/SmartRemoteControl,Nosskirneh/SmartRemoteControl
--- +++ @@ -29,6 +29,7 @@ console.sendall(code + '\n') # Wait ~500 milliseconds between codes. time.sleep(0.5) + console.shutdown(socket.SHUT_RDWR) console.close() return 'OK'
db3700382cf14b73b9ddbcb3a35fafd92910dcbf
gridfill/__init__.py
gridfill/__init__.py
"""Fill missing values in a grid.""" # Copyright (c) 2012-2014 Andrew Dawson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # ...
"""Fill missing values in a grid.""" # Copyright (c) 2012-2014 Andrew Dawson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # ...
Reset version number after v1.0.0 release tag
Reset version number after v1.0.0 release tag
Python
mit
ajdawson/gridfill
--- +++ @@ -24,7 +24,7 @@ # Define a version string. -__version__ = '1.0.0' +__version__ = '1.0.dev1' # Define the objects to be imported by imports of the form: # from gridfill import *
4494f4835245990ed5380cbf9800eef5d74986e6
utils.py
utils.py
#!/usr/bin/env python import argparse import sys def parse_basic_args(args=sys.argv[1:]): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( '--input', '-i', metavar='FILE', default=sys.stdin, type=argparse.FileType('r'), help='the file to process (default: std...
#!/usr/bin/env python import argparse import sys def parse_basic_args(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( '--input', '-i', metavar='FILE', default=sys.stdin, type=argparse.FileType('r'), help='the file to process (default: stdin)', ) p...
Remove args parameter from parse_basic_args
Remove args parameter from parse_basic_args This is already handled by argparse.
Python
mit
cdown/srt
--- +++ @@ -4,7 +4,7 @@ import sys -def parse_basic_args(args=sys.argv[1:]): +def parse_basic_args(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( '--input', '-i', metavar='FILE',
345a8e338e1c5256bc8e5e78d0595a76d1ceff84
nbtutor/__init__.py
nbtutor/__init__.py
# -*- coding: utf-8 -*- """ nbtutor - a small utility to indicate which cells should be cleared (exercises). """ try: from nbconvert.preprocessors.base import Preprocessor except ImportError: from IPython.nbconvert.preprocessors.base import Preprocessor class ClearExercisePreprocessor(Preprocessor): def...
# -*- coding: utf-8 -*- """ nbtutor - a small utility to indicate which cells should be cleared (exercises). """ import os try: from nbconvert.preprocessors.base import Preprocessor except ImportError: from IPython.nbconvert.preprocessors.base import Preprocessor class ClearExercisePreprocessor(Preprocessor...
Fix the output file name for solution
Fix the output file name for solution
Python
bsd-2-clause
jorisvandenbossche/nbtutor,jorisvandenbossche/nbtutor
--- +++ @@ -2,6 +2,8 @@ """ nbtutor - a small utility to indicate which cells should be cleared (exercises). """ + +import os try: from nbconvert.preprocessors.base import Preprocessor @@ -14,12 +16,12 @@ def preprocess_cell(self, cell, resources, index): if 'clear_cell' in cell.metadata an...
9977960046198626d266197bd9f6c4245e1897d6
byceps/blueprints/orga_admin/forms.py
byceps/blueprints/orga_admin/forms.py
""" byceps.blueprints.orga_admin.forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2018 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from wtforms import StringField from wtforms.validators import InputRequired, ValidationError from ...services.user import service as user_service ...
""" byceps.blueprints.orga_admin.forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2018 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from wtforms import StringField from wtforms.validators import InputRequired, ValidationError from ...services.user import service as user_service ...
Fix typo in validator function name
Fix typo in validator function name
Python
bsd-3-clause
homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps
--- +++ @@ -13,7 +13,7 @@ from ...util.l10n import LocalizedForm -def validate_user_scren_name(form, field): +def validate_user_screen_name(form, field): screen_name = field.data.strip() user = user_service.find_user_by_screen_name(screen_name) @@ -25,4 +25,4 @@ class OrgaFlagCreateForm(Localize...
493aef6b9965bd4fd83fac8a4cdd790b2d8010e2
chainercv/links/connection/seblock.py
chainercv/links/connection/seblock.py
import chainer import chainer.functions as F import chainer.links as L class SEBlock(chainer.Chain): """A squeeze-and-excitation block. This block is part of squeeze-and-excitation networks. Channel-wise multiplication weights are inferred from and applied to input feature map. Please refer to `the ...
import chainer import chainer.functions as F import chainer.links as L class SEBlock(chainer.Chain): """A squeeze-and-excitation block. This block is part of squeeze-and-excitation networks. Channel-wise multiplication weights are inferred from and applied to input feature map. Please refer to `the ...
Simplify SEBlock by broadcast of binary op
Simplify SEBlock by broadcast of binary op instead of explicit broadcast_to. The main motivation of this change is to simplify the exported ONNX, but this would also improve performance.
Python
mit
chainer/chainercv,pfnet/chainercv,chainer/chainercv
--- +++ @@ -37,8 +37,6 @@ z = F.average(u, axis=(2, 3)) x = F.relu(self.down(z)) x = F.sigmoid(self.up(x)) - - x = F.broadcast_to(x, (H, W, B, C)) - x = x.transpose((2, 3, 0, 1)) - + x = F.reshape(x, x.shape[:2] + (1, 1)) + # Spatial axes of `x` will be broadcast...
16f7e964341b2a0861011b33d3e4aedd937cead5
usr/examples/14-WiFi-Shield/fw_update.py
usr/examples/14-WiFi-Shield/fw_update.py
# WINC Firmware Update Script # # To start have a successful firmware update create a "firmware" folder on the # uSD card and but a bin file in it. The firmware update code will load that # new firmware onto the WINC module. import network # Init wlan module in Download mode. wlan = network.WINC(True) #print("Firmwar...
# WINC Firmware Update Script # # To start have a successful firmware update create a "firmware" folder on the # uSD card and but a bin file in it. The firmware update code will load that # new firmware onto the WINC module. import network # Init wlan module in Download mode. wlan = network.WINC(mode=network.WINC.MOD...
Fix WINC fw update script.
Fix WINC fw update script.
Python
mit
iabdalkader/openmv,kwagyeman/openmv,kwagyeman/openmv,openmv/openmv,kwagyeman/openmv,openmv/openmv,iabdalkader/openmv,openmv/openmv,iabdalkader/openmv,kwagyeman/openmv,iabdalkader/openmv,openmv/openmv
--- +++ @@ -7,9 +7,9 @@ import network # Init wlan module in Download mode. -wlan = network.WINC(True) -#print("Firmware version:", wlan.fw_version()) +wlan = network.WINC(mode=network.WINC.MODE_FIRMWARE) +print("Firmware version:", wlan.fw_version()) # Start the firmware update process. wlan.fw_update() -#pr...
29974fba6810e1be7e8a2ba8322bd8c78a9012d0
numpy/_array_api/_dtypes.py
numpy/_array_api/_dtypes.py
import numpy as np # Note: we use dtype objects instead of dtype classes. The spec does not # require any behavior on dtypes other than equality. int8 = np.dtype('int8') int16 = np.dtype('int16') int32 = np.dtype('int32') int64 = np.dtype('int64') uint8 = np.dtype('uint8') uint16 = np.dtype('uint16') uint32 = np.dtype...
import numpy as np # Note: we use dtype objects instead of dtype classes. The spec does not # require any behavior on dtypes other than equality. int8 = np.dtype('int8') int16 = np.dtype('int16') int32 = np.dtype('int32') int64 = np.dtype('int64') uint8 = np.dtype('uint8') uint16 = np.dtype('uint16') uint32 = np.dtype...
Use tuples for internal type lists in the array API
Use tuples for internal type lists in the array API These are easier for type checkers to handle.
Python
bsd-3-clause
pdebuyl/numpy,rgommers/numpy,jakirkham/numpy,endolith/numpy,charris/numpy,mattip/numpy,mhvk/numpy,pdebuyl/numpy,seberg/numpy,simongibbons/numpy,seberg/numpy,mattip/numpy,jakirkham/numpy,pdebuyl/numpy,mhvk/numpy,simongibbons/numpy,numpy/numpy,jakirkham/numpy,rgommers/numpy,charris/numpy,simongibbons/numpy,anntzer/numpy,...
--- +++ @@ -15,10 +15,10 @@ # Note: This name is changed bool = np.dtype('bool') -_all_dtypes = [int8, int16, int32, int64, uint8, uint16, uint32, uint64, - float32, float64, bool] -_boolean_dtypes = [bool] -_floating_dtypes = [float32, float64] -_integer_dtypes = [int8, int16, int32, int64, uint8, ...
0599961b1509d7b8e0bec310b40a62f11a55cc8f
src/tagversion/entrypoints.py
src/tagversion/entrypoints.py
""" tagversion Entrypoints """ import logging import sys from tagversion.argparse import ArgumentParser from tagversion.git import GitVersion from tagversion.write import WriteFile def main(): logging.basicConfig(level=logging.WARNING) parser = ArgumentParser() subcommand = parser.add_subparsers(dest='s...
""" tagversion Entrypoints """ import logging import os import sys from tagversion.argparse import ArgumentParser from tagversion.git import GitVersion from tagversion.write import WriteFile LOG_LEVEL = os.environ.get('LOG_LEVEL', 'warning') def main(): logging.basicConfig(level=getattr(logging, LOG_LEVEL.upper...
Allow log level to be changed via environment variable
Allow log level to be changed via environment variable
Python
bsd-2-clause
rca/tag-version,rca/tag-version
--- +++ @@ -2,15 +2,18 @@ tagversion Entrypoints """ import logging +import os import sys from tagversion.argparse import ArgumentParser from tagversion.git import GitVersion from tagversion.write import WriteFile +LOG_LEVEL = os.environ.get('LOG_LEVEL', 'warning') + def main(): - logging.basicConfig...
da353acf45de9159cb5d05e5bd3b6d7bff6d0840
tests/functional/test_examples.py
tests/functional/test_examples.py
# -*- coding: utf-8 -*- ####################################################################### # Name: test_examples # Purpose: Test that examples run without errors. # Author: Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com> # Copyright: # (c) 2014-2015 Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com...
# -*- coding: utf-8 -*- ####################################################################### # Name: test_examples # Purpose: Test that examples run without errors. # Author: Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com> # Copyright: # (c) 2014-2015 Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com...
Remove `render_all_grammars` example from tests
Remove `render_all_grammars` example from tests
Python
mit
igordejanovic/textX,igordejanovic/textX,igordejanovic/textX
--- +++ @@ -19,8 +19,9 @@ examples_pat = os.path.join(os.path.abspath(os.path.dirname(__file__)), '../../examples/*/*.py') - # Filter out __init__.py - examples = [f for f in glob.glob(examples_pat) if f != '__init__.py'] + examples = [f for f in glob.glob(examples_pat...
eee5018475e01286be3ee5b396e213762923484e
announcements/forms.py
announcements/forms.py
from django import forms from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ try: from notification import models as notification except ImportError: notification = None from announcements.models import Announcement class AnnouncementAdminForm(forms.ModelForm)...
from django import forms from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ try: from notification import models as notification except ImportError: notification = None from announcements.models import Announcement class AnnouncementAdminForm(forms.ModelForm)...
Use the new interface to notification.send to explicitly override the default behavior and queue notifications for announcements.
Use the new interface to notification.send to explicitly override the default behavior and queue notifications for announcements. git-svn-id: 0d26805d86c51913b6a91884701d7ea9499c7fc0@37 4e50ab13-fc4d-0410-b010-e1608ea6a288
Python
mit
pinax/django-announcements,pinax/pinax-announcements,arthur-wsw/pinax-announcements,edx/django-announcements,percipient/django-announcements,ntucker/django-announcements,brosner/django-announcements,datafyit/django-announcements,datafyit/django-announcements,GeoNode/geonode-announcements,rizumu/django-announcements,sta...
--- +++ @@ -31,7 +31,7 @@ if self.cleaned_data["send_now"]: if notification: users = User.objects.all() - notification.queue(users, "announcement", { + notification.send(users, "announcement", { "announcement": announcement, - ...
edf67fb99af11fbf9b62b1a67dd9992a247fe326
setup_directory.py
setup_directory.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import import argparse import os import subprocess as sp from contextlib import contextmanager import tempfile try: import urllib.request as urllib2 except ImportError: import urllib2 MINICONDA_URL = 'https...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import import argparse import os import subprocess as sp from contextlib import contextmanager import tempfile try: import urllib.request as urllib2 except ImportError: import urllib2 MINICONDA_URL = 'https...
Add change directory context manager
Add change directory context manager
Python
mit
NGTS/pipeline-output-analysis-setup-script
--- +++ @@ -15,6 +15,16 @@ MINICONDA_URL = 'https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh' +@contextmanager +def change_directory(path): + old_cwd = os.getcwd() + try: + os.chdir(path) + yield + finally: + os.chdir(old_cwd) + + def main(args): pass
ff85fc05e179e451dabb1f20781dfc5a90314d71
scripts/adb-wrapper.py
scripts/adb-wrapper.py
import subprocess import sys import re # Note: no output will be printed until the entire test suite has finished result = subprocess.run(sys.argv[1], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) successRegex = re.compile('OK \(\d+ tests\)') print(result.stderr) print(result.s...
import subprocess import sys import re # Note: no output will be printed until the entire test suite has finished p = subprocess.Popen(sys.argv[1], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) stdoutResult, stderrResult = p.communicate() successRegex = re.compile('OK \(\d+ test...
Refactor the python wrapper script because apparently apt-get doesn't install 3.5, and subprocess.run() is only in 3.5
Refactor the python wrapper script because apparently apt-get doesn't install 3.5, and subprocess.run() is only in 3.5
Python
apache-2.0
sbosley/squidb,yahoo/squidb,yahoo/squidb,sbosley/squidb,sbosley/squidb,sbosley/squidb,sbosley/squidb,yahoo/squidb,yahoo/squidb,yahoo/squidb
--- +++ @@ -3,14 +3,15 @@ import re # Note: no output will be printed until the entire test suite has finished -result = subprocess.run(sys.argv[1], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) +p = subprocess.Popen(sys.argv[1], shell=True, stdout=subprocess.PIPE, stderr=su...
7d79c6072482d7a2de515d7ca567225100e7b6e9
tests/test_stock.py
tests/test_stock.py
import unittest from datetime import datetime from stock import Stock class StockTest(unittest.TestCase): def test_new_stock_price(self): """A new stock should have a price that is None. """ stock = Stock("GOOG") self.assertIsNone(stock.price) def test_stock_update(self): ...
import unittest from datetime import datetime from stock import Stock class StockTest(unittest.TestCase): def test_new_stock_price(self): """A new stock should have a price that is None. """ stock = Stock("GOOG") self.assertIsNone(stock.price) def test_stock_update(self): ...
Update negative price exception test to use assertRaises.
Update negative price exception test to use assertRaises.
Python
mit
bsmukasa/stock_alerter
--- +++ @@ -27,11 +27,7 @@ """ stock = Stock("GOOG") - try: - stock.update(datetime(2014, 2, 12), price=-10) - except ValueError: - return - self.fail("ValueError was not raised") + self.assertRaises(ValueError, stock.update, datetime(2014, 2, 13),...
1e31f9bda61c6421a3788f28d75ba45c4838b1bd
bin/isbn_format.py
bin/isbn_format.py
#!/usr/bin/env python import sys import os import yaml import isbnlib metafile = sys.argv[1] metadata = open(metafile, 'r').read() yamldata = yaml.load(metadata) identifier = {} for id in yamldata["identifier"]: if "key" in id: isbnlike = isbnlib.get_isbnlike(id["text"])[0] if isbnlib.is_isbn13(...
#!/usr/bin/env python import sys import os import yaml import isbnlib metafile = sys.argv[1] metadata = open(metafile, 'r').read() yamldata = yaml.load(metadata) identifier = {} if "identifier" in yamldata: for id in yamldata["identifier"]: if "key" in id: isbnlike = isbnlib.get_isbnlike(id[...
Handle case of no identifiers at all in meta data
Handle case of no identifiers at all in meta data
Python
agpl-3.0
alerque/casile,alerque/casile,alerque/casile,alerque/casile,alerque/casile
--- +++ @@ -11,11 +11,12 @@ identifier = {} -for id in yamldata["identifier"]: - if "key" in id: - isbnlike = isbnlib.get_isbnlike(id["text"])[0] - if isbnlib.is_isbn13(isbnlike): - identifier[id["key"]] = isbnlib.EAN13(isbnlike) +if "identifier" in yamldata: + for id in yamldata["...
68c47089e8f50aa518816ea9099ef038055af53f
sparkxarray/tests/test_reader.py
sparkxarray/tests/test_reader.py
from pyspark.sql import SparkSession from sparkxarray.reader import ncread import os spark = SparkSession.builder.appName('hi').getOrCreate() sc = spark.sparkContext print(os.getcwd()) filename = os.path.abspath('sparkxarray/tests/data/air.sig995.2012.nc') print(filename) rdd1 = ncread(sc, filename, mode='single', ...
from pyspark.sql import SparkSession from sparkxarray.reader import ncread import os spark = SparkSession.builder.appName('hi').getOrCreate() sc = spark.sparkContext print(os.getcwd()) filename = os.path.abspath('sparkxarray/tests/data/air.sig995.2012.nc') print(filename) rdd1 = ncread(sc, filename, mode='single', ...
Increase number of partitions for test purposes
Increase number of partitions for test purposes
Python
apache-2.0
andersy005/spark-xarray,andersy005/spark-xarray
--- +++ @@ -20,7 +20,7 @@ print(rdd2.first()) -rdd3 = ncread(sc, filename, mode='single', partition_on=['time', 'lat', 'lon'], partitions=800) +rdd3 = ncread(sc, filename, mode='single', partition_on=['time', 'lat', 'lon'], partitions=50000) print(rdd3.count()) print(rdd3.first())
e880522e226b593be2985cdc85cb0ebd87e53a98
astral/models/tests/factories.py
astral/models/tests/factories.py
import factory import faker import random import uuid from astral.models.stream import Stream from astral.models.node import Node from astral.models.ticket import Ticket ELIXIR_CREATION = lambda class_to_create, **kwargs: class_to_create(**kwargs) factory.Factory.set_creation_function(ELIXIR_CREATION) class Stream...
import factory import faker import random import uuid from astral.models.stream import Stream from astral.models.node import Node from astral.models.ticket import Ticket ELIXIR_CREATION = lambda class_to_create, **kwargs: class_to_create(**kwargs) factory.Factory.set_creation_function(ELIXIR_CREATION) class Stream...
Make sure streams always have a source.
Make sure streams always have a source.
Python
mit
peplin/astral
--- +++ @@ -15,6 +15,7 @@ class StreamFactory(factory.Factory): id = factory.Sequence(lambda n: int(n) + 1) name = factory.LazyAttribute(lambda a: ' '.join(faker.lorem.words())) + source = factory.LazyAttribute(lambda a: NodeFactory()) class NodeFactory(factory.Factory):
623c56c14aa1d1c47b081f607701323d00903dc9
gather/topic/api.py
gather/topic/api.py
# -*- coding:utf-8 -*- from gather.api import need_auth, EXCLUDE_COLUMNS from gather.extensions import api_manager from gather.topic.models import Topic, Reply bp = api_manager.create_api_blueprint( Topic, methods=["GET", "POST"], preprocessors={ 'POST': [need_auth], }, include_methods=[...
# -*- coding:utf-8 -*- from flask import g, jsonify from gather.api import need_auth, EXCLUDE_COLUMNS from gather.extensions import api_manager from gather.topic.models import Topic, Reply bp = api_manager.create_api_blueprint( Topic, methods=["GET", "POST"], preprocessors={ 'POST': [need_auth],...
Add API to mark topic as reader
Add API to mark topic as reader
Python
mit
whtsky/Gather,whtsky/Gather
--- +++ @@ -1,4 +1,5 @@ # -*- coding:utf-8 -*- +from flask import g, jsonify from gather.api import need_auth, EXCLUDE_COLUMNS @@ -15,6 +16,14 @@ include_methods=["have_read"], exclude_columns=EXCLUDE_COLUMNS ) + + +@bp.route("/topic/<int:topic_id>/mark_read") +def _mark_read_for_topic(topic_id): + ...
1e5c593ef0dc38c12bd987f9b2f37f9bfc3c71e1
api/base/pagination.py
api/base/pagination.py
from rest_framework import pagination from rest_framework.response import Response class JSONAPIPagination(pagination.PageNumberPagination): def get_paginated_response(self, data): return Response({ 'links': { 'next': self.get_next_link(), 'previous': self.get_p...
from collections import OrderedDict from rest_framework import pagination from rest_framework.response import Response class JSONAPIPagination(pagination.PageNumberPagination): """Custom paginator that formats responses in a JSON-API compatible format.""" def get_paginated_response(self, data): respo...
Make paginated response items ordered
Make paginated response items ordered
Python
apache-2.0
wearpants/osf.io,mluke93/osf.io,chennan47/osf.io,mluo613/osf.io,billyhunt/osf.io,monikagrabowska/osf.io,danielneis/osf.io,mluo613/osf.io,dplorimer/osf,jinluyuan/osf.io,cslzchen/osf.io,ZobairAlijan/osf.io,emetsger/osf.io,HarryRybacki/osf.io,emetsger/osf.io,cosenal/osf.io,amyshi188/osf.io,brianjgeiger/osf.io,HarryRybacki...
--- +++ @@ -1,14 +1,18 @@ +from collections import OrderedDict + from rest_framework import pagination from rest_framework.response import Response class JSONAPIPagination(pagination.PageNumberPagination): + """Custom paginator that formats responses in a JSON-API compatible format.""" def get_paginate...
70bfa7096fd64e6aea6f849d63878b1c8d6c6427
fjord/urls.py
fjord/urls.py
from django.conf import settings from django.conf.urls.defaults import patterns, include, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.http import HttpResponse from funfactory.monkeypatches import patch patch() from django.contrib import admin from adminplus import AdminSitePlus...
from django.conf import settings from django.conf.urls.defaults import patterns, include, url from django.contrib.auth.decorators import login_required from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.http import HttpResponse from funfactory.monkeypatches import patch patch() from djang...
Fix site so there is no more admin login page
Fix site so there is no more admin login page If you logged in with persona, went to the admin, then clicked on "logout", you'd end up on the admin login page which you had to manually leave by typing a url in the urlbar. This fixes that.
Python
bsd-3-clause
hoosteeno/fjord,lgp171188/fjord,Ritsyy/fjord,rlr/fjord,DESHRAJ/fjord,rlr/fjord,Ritsyy/fjord,Ritsyy/fjord,DESHRAJ/fjord,lgp171188/fjord,lgp171188/fjord,rlr/fjord,staranjeet/fjord,rlr/fjord,hoosteeno/fjord,mozilla/fjord,hoosteeno/fjord,staranjeet/fjord,mozilla/fjord,hoosteeno/fjord,mozilla/fjord,staranjeet/fjord,lgp17118...
--- +++ @@ -1,5 +1,6 @@ from django.conf import settings from django.conf.urls.defaults import patterns, include, url +from django.contrib.auth.decorators import login_required from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.http import HttpResponse @@ -11,6 +12,7 @@ admin.sit...
69ec6586cd9ce9c8bda5b9c2f6f76ecd4a43baca
chessfellows/chess/models.py
chessfellows/chess/models.py
from django.db import models from django.contrib.auth.models import User class Match(models.Model): white = models.ForeignKey(User, related_name="White") black = models.ForeignKey(User, related_name="Black") moves = models.TextField() class Player(models.Model): user = models.OneToOneField(User) ...
import os from django.db import models from django.contrib.auth.models import User def get_file_owner_username(instance, filename): parts = [instance.user.username] parts.append(os.path.basename(filename)) path = u"/".join(parts) return path class Match(models.Model): white = models.ForeignKey(U...
Add get_file_owner_username() to return a file path for a player's profile picture; add photo attribute to Player() model
Add get_file_owner_username() to return a file path for a player's profile picture; add photo attribute to Player() model
Python
mit
EyuelAbebe/gamer,EyuelAbebe/gamer
--- +++ @@ -1,11 +1,20 @@ +import os from django.db import models from django.contrib.auth.models import User + + +def get_file_owner_username(instance, filename): + parts = [instance.user.username] + parts.append(os.path.basename(filename)) + path = u"/".join(parts) + return path class Match(model...
7d5c43e0c811bc45daee6e478e67e3c33b497033
core/templatetags/git_revno.py
core/templatetags/git_revno.py
from subprocess import check_output from django import template register = template.Library() @register.simple_tag def git_revno(): return check_output(['git', 'rev-parse', '--verify', 'HEAD']).strip()[-7:]
from subprocess import ( PIPE, Popen, ) from django import template from django.conf import settings register = template.Library() @register.simple_tag def git_revno(): p = Popen(['git', 'rev-parse', '--verify', 'HEAD'], stdout=PIPE, cwd=settings.BASE_DIR) out, _ = p.communicate() ...
Fix git-revno to always run in one dir
Fix git-revno to always run in one dir
Python
mit
makyo/honeycomb,makyo/honeycomb,OpenFurry/honeycomb,makyo/honeycomb,OpenFurry/honeycomb,OpenFurry/honeycomb,makyo/honeycomb,OpenFurry/honeycomb
--- +++ @@ -1,10 +1,17 @@ -from subprocess import check_output +from subprocess import ( + PIPE, + Popen, +) from django import template +from django.conf import settings register = template.Library() @register.simple_tag def git_revno(): - return check_output(['git', 'rev-parse', '--verify', 'HE...
26b9592780f09714b36a49424ee84698e1bb8ad5
var/spack/packages/atlas/package.py
var/spack/packages/atlas/package.py
from spack import * from spack.util.executable import Executable import os class Atlas(Package): """ Automatically Tuned Linear Algebra Software, generic shared ATLAS is an approach for the automatic generation and optimization of numerical software. Currently ATLAS supplies optimized versions for the ...
from spack import * from spack.util.executable import Executable import os class Atlas(Package): """ Automatically Tuned Linear Algebra Software, generic shared ATLAS is an approach for the automatic generation and optimization of numerical software. Currently ATLAS supplies optimized versions for the ...
Add disablement of cpu throttle check.
Add disablement of cpu throttle check.
Python
lgpl-2.1
matthiasdiener/spack,iulian787/spack,LLNL/spack,TheTimmy/spack,skosukhin/spack,krafczyk/spack,krafczyk/spack,TheTimmy/spack,matthiasdiener/spack,LLNL/spack,LLNL/spack,matthiasdiener/spack,iulian787/spack,krafczyk/spack,skosukhin/spack,lgarren/spack,iulian787/spack,lgarren/spack,EmreAtes/spack,TheTimmy/spack,lgarren/spa...
--- +++ @@ -16,10 +16,22 @@ version('3.10.2', 'a4e21f343dec8f22e7415e339f09f6da') + def patch(self): + # Disable thraed check. LLNL's environment does not allow + # disabling of CPU throttling in a way that ATLAS actually + # understands. + filter_file(r'^\s+if \(thrchk\) exit...
3f0deec0ca0566fb411f98ec5940590b8dc8002a
optimize/py/main.py
optimize/py/main.py
from scipy import optimize as o import numpy as np import clean as c def minimize_scalar(func, options): bracket = options['bracket'] bounds = options['bounds'] method = options['method'] tol = options['tol'] options = options['options'] try: return o.minimize_scalar(func, bracke...
from scipy import optimize as o import numpy as np import clean as c def local_minimize(func, options): bracket = options['bracket'] bounds = options['bounds'] method = options['method'] tol = options['tol'] options = options['options'] try: return o.minimize_scalar(func, bracket...
Add basinhopping function for global min
Add basinhopping function for global min
Python
mit
acjones617/scipy-node,acjones617/scipy-node
--- +++ @@ -2,7 +2,7 @@ import numpy as np import clean as c -def minimize_scalar(func, options): +def local_minimize(func, options): bracket = options['bracket'] bounds = options['bounds'] method = options['method'] @@ -11,6 +11,31 @@ try: return o.minimize_scalar(func, bracket=b...
ba72f7177a713d4e9b468c005f6c4306cbca5cc5
dev/__init__.py
dev/__init__.py
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import os package_name = "asn1crypto" other_packages = [ "oscrypto", "certbuilder", "certvalidator", "crlbuilder", "csrbuilder", "ocspbuilder" ] package_root = os.path.abspath(os.path.join(os....
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import os package_name = "asn1crypto" other_packages = [ "oscrypto", "certbuilder", "certvalidator", "crlbuilder", "csrbuilder", "ocspbuilder" ] package_root = os.path.abspath(os.path.join(os....
Add package dev vars for compat with modularcrypto dev scripts
Add package dev vars for compat with modularcrypto dev scripts
Python
mit
wbond/asn1crypto
--- +++ @@ -17,3 +17,7 @@ package_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) build_root = os.path.abspath(os.path.join(package_root, '..')) + +md_source_map = {} + +definition_replacements = {}
d4b9b9875ce1ccf3934dba648f4422f4147cc87b
spoppy/__init__.py
spoppy/__init__.py
import logging try: import click from lockfile import LockFile, LockTimeout except ImportError: click = None logger = logging.getLogger('spoppy.main') def get_version(): return '1.2.2' if click: @click.command() @click.argument('username', required=False) @click.argument('password', req...
import logging try: import click from lockfile import LockFile, LockTimeout except ImportError: click = None logger = logging.getLogger('spoppy.main') def get_version(): return '1.2.2' if click: @click.command() @click.argument('username', required=False) @click.argument('password', req...
Add error info when lock exists
Add error info when lock exists
Python
mit
sindrig/spoppy,sindrig/spoppy
--- +++ @@ -22,12 +22,16 @@ from .navigation import Leifur from .config import get_config, set_config, get_config_from_user - lock = LockFile('/tmp/spoppy.lock') + lock = LockFile('/tmp/spoppy') try: # Try for 5s to acquire the lock lock.acquire(5) ...
e96387d98c2b7c4ffd9ccd75fe081a7b54e563d9
disco/constants.py
disco/constants.py
import re SPOTIFY_SERVICE = 1 SOUNDCLOUD_SERVICE = 2 VALID_ATTACHMENT_TYPES = ('.ogg',) # Regular expressions RE_ATTACHMENT_URI = re.compile('^disco:\/\/(.*)\/(.*)$')
import re SPOTIFY_SERVICE = 1 SOUNDCLOUD_SERVICE = 2 VALID_ATTACHMENT_TYPES = ('.opus', '.weba', '.ogg', '.wav', '.mp3', '.flac') # Regular expressions RE_ATTACHMENT_URI = re.compile('^disco:\/\/(.*)\/(.*)$')
Add more valid attachment types
disco: Add more valid attachment types
Python
mit
pythonology/discobot,chandler14362/disco
--- +++ @@ -3,7 +3,7 @@ SPOTIFY_SERVICE = 1 SOUNDCLOUD_SERVICE = 2 -VALID_ATTACHMENT_TYPES = ('.ogg',) +VALID_ATTACHMENT_TYPES = ('.opus', '.weba', '.ogg', '.wav', '.mp3', '.flac') # Regular expressions RE_ATTACHMENT_URI = re.compile('^disco:\/\/(.*)\/(.*)$')
05c5ef7f2c9be3a2365c6fb80e0ef28093ffd769
pombola/country/__init__.py
pombola/country/__init__.py
from django.conf import settings # Add to this list anything country-specific you want to be available # through an import from pombola.country. imports_and_defaults = ( ('significant_positions_filter', lambda qs: qs), ) # Note that one could do this without the dynamic import and use of # globals() by switching...
from django.conf import settings # Add to this list anything country-specific you want to be available # through an import from pombola.country. imports_and_defaults = ( ('significant_positions_filter', lambda qs: qs), ) # Note that one could do this without the dynamic import and use of # globals() by switching...
Fix the syntax for catching multiple exceptions
Fix the syntax for catching multiple exceptions Previously, this would only catch ImportError exceptions, due to the way the amiguity described here: http://legacy.python.org/dev/peps/pep-3110/#rationale ... is resolved.
Python
agpl-3.0
ken-muturi/pombola,ken-muturi/pombola,patricmutwiri/pombola,hzj123/56th,ken-muturi/pombola,hzj123/56th,hzj123/56th,mysociety/pombola,geoffkilpin/pombola,patricmutwiri/pombola,patricmutwiri/pombola,mysociety/pombola,hzj123/56th,ken-muturi/pombola,geoffkilpin/pombola,hzj123/56th,patricmutwiri/pombola,hzj123/56th,ken-mutu...
--- +++ @@ -22,7 +22,7 @@ getattr(__import__('pombola.' + settings.COUNTRY_APP + '.lib', fromlist=[name_to_import]), name_to_import) - except ImportError, AttributeError: + except (ImportError, AttributeError): globals()[...
57a3391c391cf55bf70e781453faa69d223161f4
tests/test_problem.py
tests/test_problem.py
import unittest import theano.tensor as T from pymanopt import Problem from pymanopt.manifolds import Sphere class TestProblem(unittest.TestCase): def setUp(self): self.X = X = T.vector() self.cost = T.exp(T.sum(X**2)) n = self.n = 15 self.man = Sphere(n) def test_prepare(...
import unittest import numpy as np from numpy import random as rnd import numpy.testing as np_testing import theano.tensor as T from pymanopt import Problem, TheanoFunction from pymanopt.manifolds import Sphere class TestProblem(unittest.TestCase): def setUp(self): self.X = X = T.vector() self.c...
Replace failing unit test due to backend changes
Replace failing unit test due to backend changes Signed-off-by: Niklas Koep <342d5290239d9c5264c8f98185afedb99596601a@gmail.com>
Python
bsd-3-clause
nkoep/pymanopt,nkoep/pymanopt,nkoep/pymanopt,pymanopt/pymanopt,pymanopt/pymanopt
--- +++ @@ -1,15 +1,18 @@ import unittest +import numpy as np +from numpy import random as rnd +import numpy.testing as np_testing import theano.tensor as T -from pymanopt import Problem +from pymanopt import Problem, TheanoFunction from pymanopt.manifolds import Sphere class TestProblem(unittest.TestCase...
2cd4e6f021e576a17a3f8f40122775baee9e8889
server/run.py
server/run.py
from eve import Eve app = Eve() if __name__ == '__main__': app.run()
import json import settings from flask import request, session from requests import HTTPError from requests_oauthlib import OAuth2Session from eve import Eve from flask_login import LoginManager app = Eve() login_manager = LoginManager(app) login_manager.login_view = "login" login_manager.session_protection = "stron...
Add initial views for google login.
Add initial views for google login.
Python
mit
mattiaslundberg/typer,mattiaslundberg/typer,mattiaslundberg/typer,mattiaslundberg/typer
--- +++ @@ -1,5 +1,85 @@ +import json +import settings +from flask import request, session +from requests import HTTPError +from requests_oauthlib import OAuth2Session from eve import Eve +from flask_login import LoginManager + + app = Eve() + +login_manager = LoginManager(app) +login_manager.login_view = "login" +...
154632b0ab27d36b63c302a550589a182a319ef8
distance_matrix.py
distance_matrix.py
from GamTools import corr import numpy as np import argparse parser = argparse.ArgumentParser(description='Calculate coverage over different window sizes for a list of bam files.') parser.add_argument('npz_frequencies_file', help='An npz file containing co-segregation frequencies to convert to correlations') args = p...
from GamTools import corr import numpy as np import argparse parser = argparse.ArgumentParser(description='Calculate coverage over different window sizes for a list of bam files.') parser.add_argument('npz_frequencies_file', help='An npz file containing co-segregation frequencies to convert to correlations') args = p...
Change how/where to save the file
Change how/where to save the file
Python
apache-2.0
pombo-lab/gamtools,pombo-lab/gamtools
--- +++ @@ -8,7 +8,8 @@ args = parser.parse_args() correlation_file = args.npz_frequencies_file.split('.') -correlation_file = correlation_file[0] + '.correlations.npz' +correlation_file[correlation_file.index('chrom')] = "corr" +correlation_file = '.'.join(correlation_file) freqs = np.load(args.npz_frequencie...
ee22ba999deb9213445112f4486a6080834ba036
django/__init__.py
django/__init__.py
VERSION = (1, 0, 'post-release-SVN') def get_version(): "Returns the version as a human-format string." v = '.'.join([str(i) for i in VERSION[:-1]]) if VERSION[-1]: from django.utils.version import get_svn_revision v = '%s-%s-%s' % (v, VERSION[-1], get_svn_revision()) return v
VERSION = (1, 1, 0, 'alpha', 0) def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) if VERSION[2]: version = '%s.%s' % (version, VERSION[2]) if VERSION[3:] == ('alpha', 0): version = '%s pre-alpha' % version else: version = '%s %s' % (version, VERSION[3]) if ...
Update django.VERSION in trunk per previous discussion
Update django.VERSION in trunk per previous discussion --HG-- extra : convert_revision : svn%3Abcc190cf-cafb-0310-a4f2-bffc1f526a37/django/trunk%409103
Python
bsd-3-clause
adieu/django-nonrel,adieu/django-nonrel,adieu/django-nonrel
--- +++ @@ -1,9 +1,17 @@ -VERSION = (1, 0, 'post-release-SVN') +VERSION = (1, 1, 0, 'alpha', 0) def get_version(): - "Returns the version as a human-format string." - v = '.'.join([str(i) for i in VERSION[:-1]]) - if VERSION[-1]: - from django.utils.version import get_svn_revision - v = '%s-...
8e5fa91de34ec2556459b6b58e6733390762a7f8
jyven_test.py
jyven_test.py
import unittest import logging from jyven import maven class TestJyven(unittest.TestCase): """Run as e.g. `jython -m unittest jyven_test`.""" def test_load(self): logging.basicConfig(level=logging.DEBUG) maven('commons-lang:commons-lang:2.6') from org.apache.commons.lang.math import J...
import unittest import logging from jyven import maven logging.basicConfig(level=logging.DEBUG) class TestJyven(unittest.TestCase): """Run as e.g. `jython -m unittest jyven_test`.""" def test_load(self): maven('commons-lang:commons-lang:2.6') from org.apache.commons.lang.math import JVMRando...
Move test logging config to top of module
Move test logging config to top of module
Python
mit
amake/jyven
--- +++ @@ -1,13 +1,14 @@ import unittest import logging from jyven import maven + +logging.basicConfig(level=logging.DEBUG) class TestJyven(unittest.TestCase): """Run as e.g. `jython -m unittest jyven_test`.""" def test_load(self): - logging.basicConfig(level=logging.DEBUG) maven(...
3d0acf0c8b04d97732d5f69e1ebf6de6fc0dea4e
doc/sphinx-conf.py
doc/sphinx-conf.py
# Configuration file for the Sphinx documentation generator. # This picks up values from ../documentation_configuration.py. # This gets copied to conf.py in the output directory and then picked up by # Sphinx. import sys, os sys.path.insert (1, '../..') import documentation_configuration # To install Breathe, by dow...
# Configuration file for the Sphinx documentation generator. # This picks up values from ../documentation_configuration.py. # This gets copied to conf.py in the output directory and then picked up by # Sphinx. import sys, os sys.path.insert (1, '../..') import documentation_configuration # To install Breathe, by dow...
Allow templates for Sphinx documentation
Allow templates for Sphinx documentation
Python
apache-2.0
rogiervd/flipsta-build
--- +++ @@ -25,6 +25,7 @@ pygments_style = 'sphinx' html_theme = 'nature' +templates_path = ['_templates'] # Options for Breathe. breathe_projects = { documentation_configuration.mainProject: "../doxygen/xml" }
57fd8c49de7ef6e09a4f0fbd6b39c87127e91f9a
toggle_rspec_focus.py
toggle_rspec_focus.py
import sublime, sublime_plugin, re class ToggleRspecFocusCommand(sublime_plugin.TextCommand): def run(self, edit, surplus=False): for region in self.view.sel(): line = self.view.line(region) line_contents = self.view.substr(line) focus_regex = r'.*(?:it|describe|context...
import sublime, sublime_plugin, re class ToggleRspecFocusCommand(sublime_plugin.TextCommand): def run(self, edit, surplus=False): for region in self.view.sel(): line = self.view.line(region) line_contents = self.view.substr(line) focus_regex = r'.*(?:it|describe|context...
Add support for 'scenario' blocks
Add support for 'scenario' blocks
Python
mit
axsuul/sublime-toggle-rspec-focus,axsuul/sublime-toggle-rspec-focus,axsuul/sublime-toggle-rspec-focus
--- +++ @@ -6,7 +6,7 @@ line = self.view.line(region) line_contents = self.view.substr(line) - focus_regex = r'.*(?:it|describe|context)\s+(?:\"[^\"]+\"|\'[^\']+\'|.+)(\,\s\:focus)(.+)do' + focus_regex = r'.*(?:it|describe|context|scenario)\s+(?:\"[^\"]+\"|\'[^\']+\'|...
50889a2d9a70efa8685dbb3ed9c60b05d4ecf4c1
backend/unpp_api/apps/partner/migrations/0043_auto_20171220_1311.py
backend/unpp_api/apps/partner/migrations/0043_auto_20171220_1311.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-12-20 13:11 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('partner', '0042_auto_20171220_1305'), ] operations...
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-12-20 13:11 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('partner', '0042_auto_20171220_1305'), ] operations...
Change migration so newly added field is nullable
Change migration so newly added field is nullable
Python
apache-2.0
unicef/un-partner-portal,unicef/un-partner-portal,unicef/un-partner-portal,unicef/un-partner-portal
--- +++ @@ -28,6 +28,6 @@ migrations.AddField( model_name='partnerauditreport', name='created_by', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='audit_reports', to='account.User'), + field=models.ForeignKey(blank=True, nul...
b9f136e2bb1f163d455295d824a548a36170586a
books/CrackingCodesWithPython/Chapter20/vigenereDictionaryHacker.py
books/CrackingCodesWithPython/Chapter20/vigenereDictionaryHacker.py
# Vigenère Cipher Dictionary Hacker # https://www.nostarch.com/crackingcodes/ (BSD Licensed) import detectEnglish, vigenereCipher, pyperclip def main(): ciphertext = """Tzx isnz eccjxkg nfq lol mys bbqq I lxcz.""" hackedMessage = hackVigenereDictionary(ciphertext) if hackedMessage != None: print...
# Vigenère Cipher Dictionary Hacker # https://www.nostarch.com/crackingcodes/ (BSD Licensed) import detectEnglish, vigenereCipher, pyperclip def main(): ciphertext = """Tzx isnz eccjxkg nfq lol mys bbqq I lxcz.""" hackedMessage = hackVigenereDictionary(ciphertext) if hackedMessage != None: print...
Update vigenereDicitonaryHacker: fixed error reported in forum
Update vigenereDicitonaryHacker: fixed error reported in forum
Python
mit
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
--- +++ @@ -21,7 +21,7 @@ words = fo.readlines() fo.close() - for word in lines: + for word in words: word = word.strip() # Remove the newline at the end. decryptedText = vigenereCipher.decryptMessage(word, ciphertext) if detectEnglish.isEnglish(decryptedText, wordPercent...
cafd737dc5b9cabb2b4629eb5741bba337f884f9
project/app/main.py
project/app/main.py
# -*- coding: utf-8 -*- """WSGI app setup.""" import os import sys if 'lib' not in sys.path: # Add lib as primary libraries directory, with fallback to lib/dist # and optionally to lib/dist.zip, loaded using zipimport. sys.path[0:0] = ['lib', 'lib/dist', 'lib/dist.zip'] from tipfy import Tipfy from config...
# -*- coding: utf-8 -*- """WSGI app setup.""" import os import sys if 'lib' not in sys.path: # Add lib as primary libraries directory, with fallback to lib/dist # and optionally to lib/dist.zip, loaded using zipimport. sys.path[0:0] = ['lib', 'lib/dist', 'lib/dist.zip'] from tipfy import Tipfy from config...
Enable appstats by default in dev too.
Enable appstats by default in dev too.
Python
bsd-3-clause
moraes/tipfy,moraes/tipfy,moraes/tipfy
--- +++ @@ -15,10 +15,8 @@ def enable_appstats(app): """Enables appstats middleware.""" - if debug: - return - - from google.appengine.ext.appstats.recording import appstats_wsgi_middleware + from google.appengine.ext.appstats.recording import \ + appstats_wsgi_middleware app.wsgi_...
879bdbcddb582d5f4768fe7042380397514767d3
servo.py
servo.py
################################################################# ## SERVO LIB for SMART TOLLBOOTH PROJECT ## ################################################################# import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) SERVO = 17 GPIO.setup(SERVO, GPIO.OUT) def moveDeg(i): va...
################################################################# ## SERVO LIB for SMART TOLLBOOTH PROJECT ## ################################################################# import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARDs) SERVO = 11 GPIO.setup(SERVO, GPIO.OUT) def moveDeg(i):...
Update pin to gpio.board (from gpio.bcm)
fix: Update pin to gpio.board (from gpio.bcm)
Python
mit
DreamN/Smart-Tollbooth,DreamN/Smart-Tollbooth,DreamN/Smart-Tollbooth,DreamN/Smart-Tollbooth
--- +++ @@ -1,13 +1,13 @@ -################################################################# + ################################################################# ## SERVO LIB for SMART TOLLBOOTH PROJECT ## ################################################################# import RPi.GPIO as G...
4c40dc904792ca037c4f71ca4a0546229ae0cb20
setup.py
setup.py
from setuptools import ( setup, find_packages, ) from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, "README.md")) as rdme: with open(path.join(here, "CHANGELOG.md")) as chlog: readme = rdme.read() changes = chlog.read() long_description = read...
from setuptools import ( setup, find_packages, ) from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, "README.md")) as rdme: with open(path.join(here, "CHANGELOG.md")) as chlog: readme = rdme.read() changes = chlog.read() long_description = read...
Bump version number for next release
Bump version number for next release
Python
mit
zekna/py-types
--- +++ @@ -15,7 +15,7 @@ setup( name="py_types", - version="0.1.0a", + version="0.1.1a", description="Gradual typing for python 3.", long_description=long_description, url="https://github.com/zekna/py-types",
7a42318ca7d8d8f59e30b23b8e507410e9e4868b
setup.py
setup.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from setuptools import setup, find_packages from os.path import dirname, join def main(): base_dir = dirname(__file__) setup( name='rotunicode', version='0.1.0', description='RotUnicode', long_description=open(joi...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from setuptools import setup, find_packages from os.path import dirname, join def main(): base_dir = dirname(__file__) setup( name='rotunicode', version='0.1.0', description='RotUnicode', long_description=open(joi...
Fix long_description to read README.rst.
Fix long_description to read README.rst.
Python
apache-2.0
box/rotunicode,box/rotunicode
--- +++ @@ -11,7 +11,7 @@ name='rotunicode', version='0.1.0', description='RotUnicode', - long_description=open(join(base_dir, 'README.md')).read(), + long_description=open(join(base_dir, 'README.rst')).read(), author='Kunal Parmar', author_email='kunalparmar...