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
bcd009c442e42065ba1de313f4892c1a57642daa
TeleinfoParser.py
TeleinfoParser.py
#!/usr/bin/env python class TeleinfoParser: integerKeys = [ 'ISOUSC', 'BASE', 'HCHC', 'HCHP', 'EJPHN', 'EJPHPM', 'BBRHCJB', 'BBRHPJB', 'BBRHCJW', 'BBRHPJW', 'BBRHCJR', 'BBRHPJR', 'PEJP', 'IINST', 'IINST1', 'IINST2', 'IINST3', 'ADPS', 'IMAX', 'IMAX1', 'IMAX2', 'IMAX3', 'PAPP', 'ADIR1', 'ADIR2', 'ADIR3' ] de...
#!/usr/bin/env python class TeleinfoParser: integerKeys = [ 'ISOUSC', 'BASE', 'HCHC', 'HCHP', 'EJPHN', 'EJPHPM', 'BBRHCJB', 'BBRHPJB', 'BBRHCJW', 'BBRHPJW', 'BBRHCJR', 'BBRHPJR', 'PEJP', 'IINST', 'IINST1', 'IINST2', 'IINST3', 'ADPS', 'IMAX', 'IMAX1', 'IMAX2', 'IMAX3', 'PAPP', 'ADIR1', 'ADIR2', 'ADIR3' ] de...
Fix incorrect checksum verification when checksum is 32 (0x20, space)
Fix incorrect checksum verification when checksum is 32 (0x20, space)
Python
mit
pyrou/UDPTeleinfoServer
--- +++ @@ -16,7 +16,7 @@ def parse (self, message): """Read and verify Teleinfo datagram and return it as a dict""" - trames = [trame.split(" ") for trame in message.strip("\r\n\x03\x02").split("\r\n")] + trames = [trame.split(" ", 2) for trame in message.strip("\r\n\x03\x02").split("\r\n")] return dict(...
ca96de4c3fdd788833e3f343de2c711c5bf6e40f
packages/dcos-integration-test/extra/get_test_group.py
packages/dcos-integration-test/extra/get_test_group.py
""" Usage: $ python test_group_name.py group_1 test_foo.py test_bar.py::TestClass $ This is used by CI to run only a certain set of tests on a particular builder. See ``test_groups.yaml`` for details. """ import yaml from pathlib import Path from typing import List import click def patterns_from_group(group_name...
""" Usage: $ python get_test_group.py group_1 test_foo.py test_bar.py::TestClass $ This is used by CI to run only a certain set of tests on a particular builder. See ``test_groups.yaml`` for details. """ import yaml from pathlib import Path from typing import List import click def patterns_from_group(group_name:...
Fix usage comment to refer to the correct filename
Fix usage comment to refer to the correct filename
Python
apache-2.0
mesosphere-mergebot/dcos,dcos/dcos,GoelDeepak/dcos,mesosphere-mergebot/mergebot-test-dcos,dcos/dcos,kensipe/dcos,mesosphere-mergebot/mergebot-test-dcos,dcos/dcos,mesosphere-mergebot/dcos,kensipe/dcos,GoelDeepak/dcos,GoelDeepak/dcos,kensipe/dcos,kensipe/dcos,dcos/dcos,mesosphere-mergebot/dcos,mesosphere-mergebot/dcos,me...
--- +++ @@ -1,7 +1,7 @@ """ Usage: -$ python test_group_name.py group_1 +$ python get_test_group.py group_1 test_foo.py test_bar.py::TestClass $
fbad1649e9939a3be4194e0d508ff5889f48bb6f
unleash/plugins/utils_assign.py
unleash/plugins/utils_assign.py
import re # regular expression for finding assignments _quotes = "['|\"|\"\"\"]" BASE_ASSIGN_PATTERN = r'({}\s*=\s*[ubr]?' + _quotes + r')(.*?)(' +\ _quotes + r')' def find_assign(data, varname): """Finds a substring that looks like an assignment. :param data: Source to search in. ...
from unleash.exc import PluginError import re # regular expression for finding assignments _quotes = "['|\"|\"\"\"]" BASE_ASSIGN_PATTERN = r'({}\s*=\s*[ubr]?' + _quotes + r')(.*?)(' +\ _quotes + r')' def find_assign(data, varname): """Finds a substring that looks like an assignment. ...
Raise PluginErrors instead of ValueErrors in versions.
Raise PluginErrors instead of ValueErrors in versions.
Python
mit
mbr/unleash
--- +++ @@ -1,3 +1,5 @@ +from unleash.exc import PluginError + import re @@ -17,10 +19,11 @@ ASSIGN_RE = re.compile(BASE_ASSIGN_PATTERN.format(varname)) if len(ASSIGN_RE.findall(data)) > 1: - raise ValueError('Found multiple {}-strings.'.format(varname)) + raise PluginError('Found multi...
f339af2e48f0e485f13d368dad47f541264c4f58
web/processors/user.py
web/processors/user.py
from django.contrib.auth.models import User from django_countries import countries def get_user(user_id): user = User.objects.get(id=user_id) return user def get_user_profile(user_id): user = User.objects.get(id=user_id) return user.profile def get_ambassadors(): ambassadors = [] aambassadors = Use...
from django.contrib.auth.models import User from django_countries import countries def get_user(user_id): user = User.objects.get(id=user_id) return user def get_user_profile(user_id): user = User.objects.get(id=user_id) return user.profile def get_ambassadors(): ambassadors = [] aambassadors = Use...
Sort listed ambassadors by date_joined
Sort listed ambassadors by date_joined
Python
mit
ercchy/coding-events,michelesr/coding-events,joseihf/coding-events,ioana-chiorean/coding-events,joseihf/coding-events,codeeu/coding-events,michelesr/coding-events,joseihf/coding-events,ercchy/coding-events,codeeu/coding-events,ercchy/coding-events,michelesr/coding-events,ioana-chiorean/coding-events,codeeu/coding-event...
--- +++ @@ -11,7 +11,7 @@ def get_ambassadors(): ambassadors = [] - aambassadors = User.objects.filter(groups__name='ambassadors') + aambassadors = User.objects.filter(groups__name='ambassadors').order_by('date_joined') for ambassador in aambassadors: ambassadors.append(ambassador.profile) return ambassad...
bb2234447039df6bee80842749b0ecdb19fb62fc
aerende/models.py
aerende/models.py
import uuid class Note(object): """ A note. Currently has a title, tags, texr and a priority.""" def __init__(self, title, tags, text, priority=1, unique_id=None): if unique_id is None: self.id = str(uuid.uuid4()) else: self.id = unique_id self.title = ...
import uuid class Note(object): """ A note. Currently has a title, tags, texr and a priority.""" def __init__(self, title, tags, text, priority=1, unique_id=None): if unique_id is None: self.id = str(uuid.uuid4()) else: self.id = unique_id self.title = ...
Remove duplicate tags during init
Remove duplicate tags during init
Python
mit
Autophagy/aerende
--- +++ @@ -12,12 +12,15 @@ else: self.id = unique_id self.title = title - self.tags = tags + self.tags = self.__verify_tags(tags) self.text = text self.priority = priority def __str__(self): return str(self.to_dictionary) + + def __ver...
83919e74b7d20688811a4f782d4fccaf3bc3c055
comics/comics/hijinksensue.py
comics/comics/hijinksensue.py
from comics.aggregator.crawler import CrawlerBase, CrawlerImage from comics.core.comic_data import ComicDataBase class ComicData(ComicDataBase): name = "HijiNKS Ensue" language = "en" url = "http://hijinksensue.com/" start_date = "2007-05-11" rights = "Joel Watson" class Crawler(CrawlerBase): ...
from comics.aggregator.crawler import CrawlerBase, CrawlerImage from comics.core.comic_data import ComicDataBase class ComicData(ComicDataBase): name = "HijiNKS Ensue" language = "en" url = "http://hijinksensue.com/" start_date = "2007-05-11" rights = "Joel Watson" active = False class Crawl...
Update "HijiNKS Ensue" after feed change
Update "HijiNKS Ensue" after feed change
Python
agpl-3.0
datagutten/comics,datagutten/comics,jodal/comics,jodal/comics,jodal/comics,datagutten/comics,datagutten/comics,jodal/comics
--- +++ @@ -8,10 +8,11 @@ url = "http://hijinksensue.com/" start_date = "2007-05-11" rights = "Joel Watson" + active = False class Crawler(CrawlerBase): - history_capable_days = 180 + history_capable_date = '2015-03-11' time_zone = "US/Central" def crawl(self, pub_date): @@ -1...
7e025a5fa40d5f7ba5721ad01951ad2020ed2485
phoxpy/tests/test_client.py
phoxpy/tests/test_client.py
# -*- coding: utf-8 -*- # # Copyright (C) 2011 Alexander Shorin # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # import unittest from phoxpy import client from phoxpy.tests.lisserver import MockHttpSession class Ses...
# -*- coding: utf-8 -*- # # Copyright (C) 2011 Alexander Shorin # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # import unittest from phoxpy import client from phoxpy.server import MockHttpSession, SimpleLISServer ...
Update tests for new environment.
Update tests for new environment.
Python
bsd-3-clause
kxepal/phoxpy
--- +++ @@ -9,22 +9,28 @@ import unittest from phoxpy import client -from phoxpy.tests.lisserver import MockHttpSession +from phoxpy.server import MockHttpSession, SimpleLISServer + class SessionTestCase(unittest.TestCase): + + def setUp(self): + self.server = SimpleLISServer('4.2', '31415') + ...
20b13d500ea1cfa4b06413f0f02114bed60ca98f
apps/challenges/auth.py
apps/challenges/auth.py
OWNER_PERMISSIONS = ['challenges.%s_submission' % v for v in ['edit', 'delete']] class SubmissionBackend(object): """Provide custom permission logic for submissions.""" supports_object_permissions = True supports_anonymous_user = True def authenticate(self): """This backend doesn't pr...
OWNER_PERMISSIONS = ['challenges.%s_submission' % v for v in ['edit', 'delete']] class SubmissionBackend(object): """Provide custom permission logic for submissions.""" supports_object_permissions = True supports_anonymous_user = True def authenticate(self): """This backend doesn't pr...
Remove 'is_live' from draft visibility check.
Remove 'is_live' from draft visibility check.
Python
bsd-3-clause
mozilla/mozilla-ignite,mozilla/mozilla-ignite,mozilla/mozilla-ignite,mozilla/mozilla-ignite
--- +++ @@ -18,6 +18,5 @@ if perm == 'challenges.view_submission' and obj is not None: # Live, non-draft submissions are visible to anyone. Other # submissions are visible only to admins and their owners - return ((obj.is_live and not obj.is_draft) or - ...
ba4c2dc22aae5dd4f862aad7c388eecf36acfbd8
app/main/forms.py
app/main/forms.py
from flask_wtf import Form from wtforms.validators import DataRequired, Email from dmutils.forms import StripWhitespaceStringField class EmailAddressForm(Form): email_address = StripWhitespaceStringField('Email address', validators=[ DataRequired(message="Email can not be empty"), Email(message="P...
from flask_wtf import Form from wtforms import validators from dmutils.forms import StripWhitespaceStringField class EmailAddressForm(Form): email_address = StripWhitespaceStringField('Email address', validators=[ validators.DataRequired(message="Email can not be empty"), validators.Email(message...
Change import to indicate function of imported classes
Change import to indicate function of imported classes
Python
mit
alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend
--- +++ @@ -1,23 +1,24 @@ from flask_wtf import Form -from wtforms.validators import DataRequired, Email +from wtforms import validators + from dmutils.forms import StripWhitespaceStringField class EmailAddressForm(Form): email_address = StripWhitespaceStringField('Email address', validators=[ - Da...
b167b1c8099dc184c366416dab9a7c6e5be7423a
api/base/exceptions.py
api/base/exceptions.py
from rest_framework import status from rest_framework.exceptions import APIException def json_api_exception_handler(exc, context): """ Custom exception handler that returns errors object as an array """ # Import inside method to avoid errors when the OSF is loaded without Django from rest_framework.view...
from rest_framework import status from rest_framework.exceptions import APIException def json_api_exception_handler(exc, context): """ Custom exception handler that returns errors object as an array """ # Import inside method to avoid errors when the OSF is loaded without Django from rest_framework.view...
Handle cases where there are multiple values for a field.
Handle cases where there are multiple values for a field.
Python
apache-2.0
Ghalko/osf.io,caneruguz/osf.io,felliott/osf.io,binoculars/osf.io,icereval/osf.io,ticklemepierce/osf.io,caneruguz/osf.io,mattclark/osf.io,brianjgeiger/osf.io,HalcyonChimera/osf.io,brandonPurvis/osf.io,laurenrevere/osf.io,aaxelb/osf.io,MerlinZhang/osf.io,caseyrygt/osf.io,doublebits/osf.io,Nesiehr/osf.io,kch8qx/osf.io,acs...
--- +++ @@ -22,8 +22,10 @@ errors.append({key: value}) else: if isinstance(value, list): - value = value[0] - errors.append({'detail': value, 'meta': {'field': key}}) + for reason in value: + ...
b9f6939ea0569ecd54141cbee064a3f15fcf1937
arrow/api.py
arrow/api.py
# -*- coding: utf-8 -*- ''' Provides the default implementation of :class:`ArrowFactory <arrow.factory.ArrowFactory>` methods for use as a module API. ''' from __future__ import absolute_import from arrow.factory import ArrowFactory # internal default factory. _factory = ArrowFactory() def get(*args, **kwargs): ...
# -*- coding: utf-8 -*- ''' Provides the default implementation of :class:`ArrowFactory <arrow.factory.ArrowFactory>` methods for use as a module API. ''' from __future__ import absolute_import from arrow.factory import ArrowFactory # internal default factory. _factory = ArrowFactory() def get(*args, **kwargs): ...
Fix typo in reference ":class:`ArrowFactory <...>"
Fix typo in reference ":class:`ArrowFactory <...>"
Python
apache-2.0
crsmithdev/arrow
--- +++ @@ -32,7 +32,7 @@ def now(tz=None): - ''' Implements the default :class:`ArrowFactory <arrow.factory.ArrowFactory> + ''' Implements the default :class:`ArrowFactory <arrow.factory.ArrowFactory>` ``now`` method. '''
0155ed7c37fd4cafa2650911d4f902a3a8982761
test/test_bot.py
test/test_bot.py
import re import unittest from gather.bot import ListenerBot class TestGatherBot(unittest.TestCase): def test_register(self): bot = ListenerBot() self.assertEqual({}, bot.actions) regex = r'^test' action = unittest.mock.Mock() bot.register_action(regex, action) self...
import asyncio import re import unittest from unittest import mock from gather.bot import ListenerBot def async_test(f): # http://stackoverflow.com/a/23036785/304210 def wrapper(*args, **kwargs): coro = asyncio.coroutine(f) future = coro(*args, **kwargs) loop = asyncio.get_event_loop()...
Add a test for on_message
Add a test for on_message
Python
mit
veryhappythings/discord-gather
--- +++ @@ -1,6 +1,18 @@ +import asyncio import re import unittest +from unittest import mock from gather.bot import ListenerBot + + +def async_test(f): + # http://stackoverflow.com/a/23036785/304210 + def wrapper(*args, **kwargs): + coro = asyncio.coroutine(f) + future = coro(*args, **kwargs) ...
158f1101c3c13db5df916329a66517c7bb85e132
plata/context_processors.py
plata/context_processors.py
import plata def plata_context(request): """ Adds a few variables from Plata to the context if they are available: * ``plata.shop``: The current :class:`plata.shop.views.Shop` instance * ``plata.order``: The current order * ``plata.contact``: The current contact instance * ``plata.price_inclu...
import plata def plata_context(request): """ Adds a few variables from Plata to the context if they are available: * ``plata.shop``: The current :class:`plata.shop.views.Shop` instance * ``plata.order``: The current order * ``plata.contact``: The current contact instance * ``plata.price_inclu...
Add current value for price_includes_tax to context
Add current value for price_includes_tax to context
Python
bsd-3-clause
armicron/plata,armicron/plata,armicron/plata
--- +++ @@ -17,4 +17,5 @@ 'order': shop.order_from_request(request), 'contact': (shop.contact_from_user(request.user) if hasattr(request, 'user') else None), + 'price_includes_tax': shop.price_includes_tax(request), }} if shop else {}
22c7da6d3de76cf6c36b4206f204a9ee979ba5f7
strides/graphs.py
strides/graphs.py
import pandas as pd import matplotlib matplotlib.use("pdf") import matplotlib.pyplot as plt import sys import os.path figdir = "figures" df = pd.read_csv(sys.stdin, " ", header=None, index_col=0, names=[2**(i) for i in range(6)]+["rand"]) print(df) #print(df["X2"]/2**df.index) df.plot(logy=True) plt....
import pandas as pd import matplotlib matplotlib.use("pdf") import matplotlib.pyplot as plt import sys df = pd.read_csv(sys.stdin, " ", header=None, index_col=0) print(df) print(df["X2"]/2**df.index) df.plot(logy=True) plt.savefig("graph.pdf")
Add perelement figures write figures into subdirectory
Add perelement figures write figures into subdirectory
Python
bsd-3-clause
jpfairbanks/cse6140,jpfairbanks/cse6140,jpfairbanks/cse6140
--- +++ @@ -3,27 +3,9 @@ matplotlib.use("pdf") import matplotlib.pyplot as plt import sys -import os.path -figdir = "figures" - -df = pd.read_csv(sys.stdin, " ", header=None, index_col=0, - names=[2**(i) for i in range(6)]+["rand"]) +df = pd.read_csv(sys.stdin, " ", header=None, index_col=0) pri...
47e4e74dcf5e2a10f1e231d2fa8af453213e77fb
Lib/test/test_winsound.py
Lib/test/test_winsound.py
# Rediculously simple test of the winsound module for Windows. import winsound for i in range(100, 2000, 100): winsound.Beep(i, 75) print "Hopefully you heard some sounds increasing in frequency!"
# Ridiculously simple test of the winsound module for Windows. import winsound for i in range(100, 2000, 100): winsound.Beep(i, 75) print "Hopefully you heard some sounds increasing in frequency!"
Fix spelling error and remove Windows line endings.
Fix spelling error and remove Windows line endings.
Python
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
--- +++ @@ -1,4 +1,4 @@ -# Rediculously simple test of the winsound module for Windows. +# Ridiculously simple test of the winsound module for Windows. import winsound for i in range(100, 2000, 100):
1579eb8d2de5aa49ad7012ab08350659a20725e1
basis/managers.py
basis/managers.py
from django.db import models class BasisModelManager(models.Manager): def get_query_set(self): return super(BasisModelManager, self).get_query_set().filter(deleted=False)
from django.db import models from .compat import DJANGO16 if DJANGO16: class BasisModelManager(models.Manager): def get_queryset(self): return super(BasisModelManager, self).get_queryset().filter(deleted=False) else: class BasisModelManager(models.Manager): def get_query_set(self):...
Fix deprecation warning for get_query_set
Fix deprecation warning for get_query_set get_query_set was renamed get_queryset in django 1.6
Python
mit
frecar/django-basis
--- +++ @@ -1,6 +1,12 @@ from django.db import models +from .compat import DJANGO16 -class BasisModelManager(models.Manager): - def get_query_set(self): - return super(BasisModelManager, self).get_query_set().filter(deleted=False) +if DJANGO16: + class BasisModelManager(models.Manager): + def...
4b000960edc30d9917b80646a0374fb8bf99efcb
storage/tests/testtools.py
storage/tests/testtools.py
""" Test tools for the storage service. """ import unittest from storage.storage import app as storage_app, db class InMemoryStorageTests(unittest.TestCase): """ Set up and tear down an application with an in memory database for testing. """ def setUp(self): storage_app.config['TESTING'] = ...
""" Test tools for the storage service. """ import unittest from storage.storage import app, db class InMemoryStorageTests(unittest.TestCase): """ Set up and tear down an application with an in memory database for testing. """ def setUp(self): app.config['TESTING'] = True app.config...
Remove unnecessary rename on input
Remove unnecessary rename on input
Python
mit
jenca-cloud/jenca-authentication
--- +++ @@ -4,7 +4,7 @@ import unittest -from storage.storage import app as storage_app, db +from storage.storage import app, db class InMemoryStorageTests(unittest.TestCase): @@ -13,15 +13,15 @@ """ def setUp(self): - storage_app.config['TESTING'] = True - storage_app.config['SQLA...
505456fed7bdbd6b2cd78eae10b3b64657cd377b
tests/unit/test_commands.py
tests/unit/test_commands.py
import pytest from pip._internal.commands import commands_dict, create_command def test_commands_dict__order(): """ Check the ordering of commands_dict. """ names = list(commands_dict) # A spot-check is sufficient to check that commands_dict encodes an # ordering. assert names[0] == 'inst...
import pytest from pip._internal.cli.req_command import ( IndexGroupCommand, RequirementCommand, SessionCommandMixin, ) from pip._internal.commands import commands_dict, create_command def check_commands(pred, expected): """ Check the commands satisfying a predicate. """ commands = [creat...
Test the command class inheritance for each command.
Test the command class inheritance for each command.
Python
mit
pradyunsg/pip,xavfernandez/pip,pfmoore/pip,rouge8/pip,xavfernandez/pip,pypa/pip,sbidoul/pip,pfmoore/pip,pypa/pip,rouge8/pip,rouge8/pip,pradyunsg/pip,xavfernandez/pip,sbidoul/pip
--- +++ @@ -1,6 +1,20 @@ import pytest +from pip._internal.cli.req_command import ( + IndexGroupCommand, + RequirementCommand, + SessionCommandMixin, +) from pip._internal.commands import commands_dict, create_command + + +def check_commands(pred, expected): + """ + Check the commands satisfying a ...
e183578b6211d7311d62100ad643cbaf8408de99
tests/__init__.py
tests/__init__.py
import unittest.mock def _test_module_init(module, main_name="main"): with unittest.mock.patch.object(module, main_name, return_value=0): with unittest.mock.patch.object(module, "__name__", "__main__"): with unittest.mock.patch.object(module.sys, "exit") as exit: module.module_...
import unittest.mock def _test_module_init(module, main_name="main"): with unittest.mock.patch.object( module, main_name, return_value=0 ), unittest.mock.patch.object( module, "__name__", "__main__" ), unittest.mock.patch.object( module.sys, "exit" ) as exit: module.mod...
Use multiple context managers on one with statement (thanks Anna)
Use multiple context managers on one with statement (thanks Anna)
Python
mpl-2.0
rfinnie/2ping,rfinnie/2ping
--- +++ @@ -2,8 +2,12 @@ def _test_module_init(module, main_name="main"): - with unittest.mock.patch.object(module, main_name, return_value=0): - with unittest.mock.patch.object(module, "__name__", "__main__"): - with unittest.mock.patch.object(module.sys, "exit") as exit: - m...
d96e52c346314622afc904a2917416028c6784e3
swampdragon_live/models.py
swampdragon_live/models.py
# -*- coding: utf-8 -*- from django.contrib.contenttypes.models import ContentType from django.db.models.signals import post_save from django.dispatch import receiver from .tasks import push_new_content @receiver(post_save) def post_save_handler(sender, instance, **kwargs): instance_type = ContentType.objects.get_...
# -*- coding: utf-8 -*- from django.contrib.contenttypes.models import ContentType from django.db.models.signals import post_save from django.dispatch import receiver from .tasks import push_new_content @receiver(post_save) def post_save_handler(sender, instance, **kwargs): if ContentType.objects.exists(): ...
Fix initial migration until ContentType is available
Fix initial migration until ContentType is available
Python
mit
mback2k/swampdragon-live,mback2k/swampdragon-live
--- +++ @@ -6,7 +6,8 @@ @receiver(post_save) def post_save_handler(sender, instance, **kwargs): - instance_type = ContentType.objects.get_for_model(instance.__class__) + if ContentType.objects.exists(): + instance_type = ContentType.objects.get_for_model(instance.__class__) - push_new_content.ap...
06d98438f9535a0477cdc85acf4c001fa7657b26
qtpy/tests/test_qtopengl.py
qtpy/tests/test_qtopengl.py
import pytest from qtpy import PYSIDE2, PYSIDE6, PYQT5, PYQT6 def test_qtopengl(): """Test the qtpy.QtOpenGL namespace""" from qtpy import QtOpenGL assert QtOpenGL.QOpenGLBuffer is not None assert QtOpenGL.QOpenGLContext is not None assert QtOpenGL.QOpenGLContextGroup is not None assert QtOpen...
import pytest from qtpy import PYSIDE2, PYSIDE6, PYQT5, PYQT6 def test_qtopengl(): """Test the qtpy.QtOpenGL namespace""" from qtpy import QtOpenGL assert QtOpenGL.QOpenGLBuffer is not None assert QtOpenGL.QOpenGLContext is not None assert QtOpenGL.QOpenGLContextGroup is not None assert QtOpen...
Remove commented code and replace by improved comment
Remove commented code and replace by improved comment
Python
mit
spyder-ide/qtpy
--- +++ @@ -17,11 +17,9 @@ assert QtOpenGL.QOpenGLShaderProgram is not None assert QtOpenGL.QOpenGLTexture is not None assert QtOpenGL.QOpenGLTextureBlitter is not None - # These are not present on some architectures - # assert QtOpenGL.QOpenGLTimeMonitor is not None - # assert QtOpenGL.QOpenG...
1c2b6c0daea1d04985ef6ddff35527ba207ec191
qual/tests/test_calendar.py
qual/tests/test_calendar.py
import unittest from datetime import date import qual class TestProlepticGregorianCalendar(unittest.TestCase): def setUp(self): self.calendar = qual.ProlepticGregorianCalendar() def check_valid_date(self, year, month, day): d = self.calendar.date(year, month, day) self.assertIsNotNon...
import unittest from datetime import date import qual class TestProlepticGregorianCalendar(unittest.TestCase): def setUp(self): self.calendar = qual.ProlepticGregorianCalendar() def check_valid_date(self, year, month, day): d = self.calendar.date(year, month, day) self.assertIsNotNon...
Check that a certain date is invalid.
Check that a certain date is invalid. This distinguishes correctly between the proleptic Gregorian calendar, and the historical or astronomical calendars, where this date would be valid.
Python
apache-2.0
jwg4/calexicon,jwg4/qual
--- +++ @@ -12,6 +12,15 @@ d = self.calendar.date(year, month, day) self.assertIsNotNone(d) + def check_invalid_date(self, year, month, day): + self.assertRaises(Exception, lambda : self.calendar(year, month, day)) + def test_leap_year_from_before_1582(self): """Pope Gregor...
e50655479c0d3a96edd4005f834541889839fca3
binary_to_text.py
binary_to_text.py
#! /usr/bin/env python import Gen.caffe_pb2 as pb2 import google.protobuf.text_format as pb2_text import sys def binary_to_text(binary_file, text_file): msg = pb2.NetParameter() with open(binary_file) as f: msg.ParseFromString(f.read()) with open(text_file, "w") as f: f.write(pb2_text.M...
#! /usr/bin/env python import Gen.caffe_pb2 as pb2 import google.protobuf.text_format as pb2_text import sys class ParameterTypeException(Exception): pass def binary_to_text(binary_file, text_file, parameter_type): if (parameter_type == "Net"): msg = pb2.NetParameter() elif (parameter_type == "Solver...
Add option to process SolverParameters.
Add option to process SolverParameters.
Python
bsd-3-clause
BeautifulDestinations/dnngraph,BeautifulDestinations/dnngraph
--- +++ @@ -4,9 +4,15 @@ import google.protobuf.text_format as pb2_text import sys +class ParameterTypeException(Exception): pass -def binary_to_text(binary_file, text_file): - msg = pb2.NetParameter() +def binary_to_text(binary_file, text_file, parameter_type): + if (parameter_type == "Net"): + ms...
86ac48a3dcb71a4e504dcf04e30a00262d168e5f
test/parseJaguar.py
test/parseJaguar.py
import os from cclib.parser import Jaguar os.chdir(os.path.join("..","data","Jaguar","basicJaguar")) os.chdir("eg01") for file in ["dvb_gopt.out"]: t = Jaguar(file) t.parse() print t.moenergies[0,:] print t.homos[0] print t.moenergies[0,t.homos[0]]
import os from cclib.parser import Jaguar os.chdir(os.path.join("..","data","Jaguar","basicJaguar")) files = [ ["eg01","dvb_gopt.out"], ["eg02","dvb_sp.out"], ["eg03","dvb_ir.out"], ["eg06","dvb_un_sp.out"] ] for f in files: t = Jaguar(os.path.join(f[0],f[1])) t.pars...
Test the parsing of all of the uploaded Jaguar files
Test the parsing of all of the uploaded Jaguar files
Python
bsd-3-clause
jchodera/cclib,ben-albrecht/cclib,Schamnad/cclib,cclib/cclib,berquist/cclib,jchodera/cclib,berquist/cclib,gaursagar/cclib,ben-albrecht/cclib,Clyde-fare/cclib,andersx/cclib,berquist/cclib,andersx/cclib,gaursagar/cclib,ATenderholt/cclib,ghutchis/cclib,Schamnad/cclib,cclib/cclib,langner/cclib,cclib/cclib,Clyde-fare/cclib,...
--- +++ @@ -3,12 +3,13 @@ os.chdir(os.path.join("..","data","Jaguar","basicJaguar")) -os.chdir("eg01") +files = [ ["eg01","dvb_gopt.out"], + ["eg02","dvb_sp.out"], + ["eg03","dvb_ir.out"], + ["eg06","dvb_un_sp.out"] ] -for file in ["dvb_gopt.out"]: - t = Jaguar(file) - t.parse() - -p...
651663d2af72f46e7952d2835126f1512741f635
UserInput.py
UserInput.py
"""Like the raw_input built-in, but with bells and whistles.""" import getpass def user_input(field, default='', choices=None, password=False, empty_ok=False, accept=False): """Prompt user for input until a value is retrieved or default is accepted. Return the input. Arguments: field Descript...
"""Like the input built-in, but with bells and whistles.""" import getpass # Use raw_input for Python 2.x try: input = raw_input except NameError: pass def user_input(field, default='', choices=None, password=False, empty_ok=False, accept=False): """Prompt user for input until a value is retrieved or def...
Fix for Python 2.6 and Python 3.
Fix for Python 2.6 and Python 3.
Python
mit
vmlaker/coils
--- +++ @@ -1,6 +1,12 @@ -"""Like the raw_input built-in, but with bells and whistles.""" +"""Like the input built-in, but with bells and whistles.""" import getpass + +# Use raw_input for Python 2.x +try: + input = raw_input +except NameError: + pass def user_input(field, default='', choices=None, passwo...
b503881ae6229bddd7ef65d95f9c38d6d0ad5ec2
chain/functions/relu.py
chain/functions/relu.py
import numpy import pycuda.gpuarray as gpuarray from chain import Function class ReLU(Function): """Rectified Linear Unit.""" # TODO(beam2d): Implement in-place version. def forward_cpu(self, x): return numpy.maximum(0, x[0]), def forward_gpu(self, x): return gpuarray.maximum(0, x[0]...
import ctypes import libcudnn import numpy import pycuda.gpuarray as gpuarray from chain import Function, cudnn _mode = libcudnn.cudnnActivationMode['CUDNN_ACTIVATION_RELU'] class ReLU(Function): """Rectified Linear Unit.""" # TODO(beam2d): Implement in-place version. def forward_cpu(self, x): re...
Use CuDNN implementation for ReLU on GPU
Use CuDNN implementation for ReLU on GPU
Python
mit
jnishi/chainer,chainer/chainer,masia02/chainer,truongdq/chainer,umitanuki/chainer,cemoody/chainer,ronekko/chainer,ttakamura/chainer,okuta/chainer,laysakura/chainer,kikusu/chainer,keisuke-umezawa/chainer,hvy/chainer,wavelets/chainer,hvy/chainer,niboshi/chainer,ikasumi/chainer,kashif/chainer,wkentaro/chainer,ysekky/chain...
--- +++ @@ -1,7 +1,10 @@ +import ctypes +import libcudnn import numpy import pycuda.gpuarray as gpuarray +from chain import Function, cudnn -from chain import Function +_mode = libcudnn.cudnnActivationMode['CUDNN_ACTIVATION_RELU'] class ReLU(Function): """Rectified Linear Unit.""" @@ -11,14 +14,26 @@ ...
58fc39ae95522ce152b4ff137071f74c5490e14e
chatterbot/constants.py
chatterbot/constants.py
""" ChatterBot constants """ ''' The maximum length of characters that the text of a statement can contain. This should be enforced on a per-model basis by the data model for each storage adapter. ''' STATEMENT_TEXT_MAX_LENGTH = 400 ''' The maximum length of characters that the text label of a conversation can contai...
""" ChatterBot constants """ ''' The maximum length of characters that the text of a statement can contain. The number 255 is used because that is the maximum length of a char field in most databases. This value should be enforced on a per-model basis by the data model for each storage adapter. ''' STATEMENT_TEXT_MAX_...
Change statement text max-length to 255
Change statement text max-length to 255
Python
bsd-3-clause
vkosuri/ChatterBot,gunthercox/ChatterBot
--- +++ @@ -4,10 +4,11 @@ ''' The maximum length of characters that the text of a statement can contain. -This should be enforced on a per-model basis by the data model for each -storage adapter. +The number 255 is used because that is the maximum length of a char field +in most databases. This value should be en...
27021bfa7062219a41ad29c40b97643ecf16f72b
doc/mkapidoc.py
doc/mkapidoc.py
#!/usr/bin/env python # Generates the *public* API documentation. # Remember to hide your private parts, people! import os, re, sys project = 'Exscript' base_dir = os.path.join('..', 'src', project) doc_dir = 'api' # Create the documentation directory. if not os.path.exists(doc_dir): os.makedirs(doc_dir) # Gen...
#!/usr/bin/env python # Generates the *public* API documentation. # Remember to hide your private parts, people! import os, re, sys project = 'Exscript' base_dir = os.path.join('..', 'src', project) doc_dir = 'api' # Create the documentation directory. if not os.path.exists(doc_dir): os.makedirs(doc_dir) # Gen...
Hide AbstractMethod class from the docs.
Hide AbstractMethod class from the docs.
Python
mit
knipknap/exscript,maximumG/exscript,knipknap/exscript,maximumG/exscript
--- +++ @@ -13,6 +13,7 @@ # Generate the API documentation. os.system('epydoc ' + ' '.join(['--name', project, + '--exclude Exscript.AbstractMethod', '--exclude Exscript.AccountManager', '--exclude Exscript.HostAction...
208760340d3314f666d7e6437817cc96e0e16194
organizer/urls/tag.py
organizer/urls/tag.py
from django.conf.urls import url from ..views import ( TagCreate, TagDelete, TagDetail, TagList, TagUpdate) urlpatterns = [ url(r'^$', TagList.as_view(), name='organizer_tag_list'), url(r'^create/$', TagCreate.as_view(), name='organizer_tag_create'), url(r'^(?P<slug...
from django.conf.urls import url from django.contrib.auth.decorators import \ login_required from ..views import ( TagCreate, TagDelete, TagDetail, TagList, TagUpdate) urlpatterns = [ url(r'^$', TagList.as_view(), name='organizer_tag_list'), url(r'^create/$', login_required...
Use login_required decorator in URL pattern.
Ch20: Use login_required decorator in URL pattern.
Python
bsd-2-clause
jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8
--- +++ @@ -1,4 +1,6 @@ from django.conf.urls import url +from django.contrib.auth.decorators import \ + login_required from ..views import ( TagCreate, TagDelete, TagDetail, TagList, @@ -9,7 +11,8 @@ TagList.as_view(), name='organizer_tag_list'), url(r'^create/$', - TagCreat...
1f253c5bdf90055ff2d00a3b8d18c152c3b7031f
versions.py
versions.py
#!/usr/bin/env python import os import warnings warnings.filterwarnings('ignore', category=DeprecationWarning) def test_for_version(filename): stdin, stdout = os.popen4('%s -V' % filename, 'r') response = stdout.read() if response.find('command not found') > 0: return False return '.'.join(res...
#!/usr/bin/env python import os import warnings warnings.filterwarnings('ignore', category=DeprecationWarning) def test_for_version(filename): stdin, stdout = os.popen4('%s -V' % filename, 'r') response = stdout.read() if response.find('command not found') > 0: return False return '.'.join(res...
Check for Python 2.7 as well
Check for Python 2.7 as well
Python
bsd-3-clause
hugoxia/pika,vrtsystems/pika,vitaly-krugl/pika,fkarb/pika-python3,Tarsbot/pika,Zephor5/pika,zixiliuyue/pika,renshawbay/pika-python3,reddec/pika,jstnlef/pika,skftn/pika,pika/pika,shinji-s/pika,knowsis/pika,benjamin9999/pika
--- +++ @@ -11,14 +11,14 @@ return False return '.'.join(response.strip().split(' ')[1].split('.')[:-1]) -versions = ['python', 'python2.4', 'python2.5', 'python2.6'] +versions = ['python', 'python2.4', 'python2.5', 'python2.6', 'python2.7'] valid = {} for filename in versions: version = test_f...
539bd8a9df362f285bda375732ec71b3df1bcaae
orbeon_xml_api/tests/test_runner.py
orbeon_xml_api/tests/test_runner.py
from .test_common import CommonTestCase from ..runner import Runner, RunnerForm from ..utils import xml_from_file class RunnerTestCase(CommonTestCase): def setUp(self): super(RunnerTestCase, self).setUp() self.runner_xml = xml_from_file('tests/data', 'test_controls_runner.xml') self.buil...
from xmlunittest import XmlTestCase from .test_common import CommonTestCase from ..runner import Runner, RunnerForm from ..utils import xml_from_file class RunnerTestCase(CommonTestCase, XmlTestCase): def setUp(self): super(RunnerTestCase, self).setUp() self.runner_xml = xml_from_file('tests/da...
Add Runner unit-tests: constructor with validation.
Add Runner unit-tests: constructor with validation.
Python
mit
bobslee/orbeon-xml-api
--- +++ @@ -1,40 +1,31 @@ +from xmlunittest import XmlTestCase + from .test_common import CommonTestCase from ..runner import Runner, RunnerForm from ..utils import xml_from_file -class RunnerTestCase(CommonTestCase): +class RunnerTestCase(CommonTestCase, XmlTestCase): def setUp(self): super(Ru...
cde7dbd5a1bb83e85e15559120189d108f6f66aa
tortilla/utils.py
tortilla/utils.py
# -*- coding: utf-8 -*- import six from formats import FormatBank, discover_json, discover_yaml formats = FormatBank() discover_json(formats, content_type='application/json') discover_yaml(formats, content_type='application/x-yaml') def run_from_ipython(): return getattr(__builtins__, "__IPYTHON__", False) ...
# -*- coding: utf-8 -*- import six from formats import FormatBank, discover_json, discover_yaml formats = FormatBank() discover_json(formats, content_type='application/json') discover_yaml(formats, content_type='application/x-yaml') def run_from_ipython(): return getattr(__builtins__, "__IPYTHON__", False) ...
Fix super() call for python <= 3.2
Fix super() call for python <= 3.2
Python
mit
redodo/tortilla
--- +++ @@ -21,7 +21,7 @@ kwargs = {} for key, value in six.iteritems(kwargs): kwargs[key] = bunchify(value) - super().__init__(kwargs) + super(Bunch, self).__init__(kwargs) self.__dict__ = self
0de0818e5a0c52dde8c841d8e8254e2f4a3f9633
app/sense.py
app/sense.py
#!/usr/bin/env python3 from Sensor import SenseController from KeyDispatcher import KeyDispatcher from Display import Display from DataLogger import SQLiteLogger import time DEVICE = "PiSense" DELAY = 0.0 class Handler: def __init__(self, display, logger, sensor): self.display = display self.lo...
#!/usr/bin/env python3 from Sensor import SenseController from KeyDispatcher import KeyDispatcher from Display import Display from DataLogger import SQLiteLogger import time DEVICE = "PiSense" DELAY = 0.25 class Handler: def __init__(self, display, logger, sensor): self.display = display self.l...
Allow PiSense readings to be toggled on/off
Allow PiSense readings to be toggled on/off
Python
mit
gizmo-cda/g2x,thelonious/g2x,thelonious/g2x,gizmo-cda/g2x,gizmo-cda/g2x,gizmo-cda/g2x
--- +++ @@ -8,7 +8,7 @@ DEVICE = "PiSense" -DELAY = 0.0 +DELAY = 0.25 class Handler: @@ -16,30 +16,47 @@ self.display = display self.logger = logger self.sensor = sensor + self.recording = False self.logger.log(DEVICE, "running", 1) def read(self): ...
990f4f3ec850525ac4fcb78b33031b60dbe25ce4
versebot/verse.py
versebot/verse.py
""" VerseBot for reddit By Matthieu Grieger verse.py Copyright (c) 2015 Matthieu Grieger (MIT License) """ class Verse: """ Class that holds the properties and methods of a Verse object. """ def __init__(self, book, chapter, verse, translation): """ Initializes a Verse object with book, chapter, v...
""" VerseBot for reddit By Matthieu Grieger verse.py Copyright (c) 2015 Matthieu Grieger (MIT License) """ class Verse: """ Class that holds the properties and methods of a Verse object. """ def __init__(self, book, chapter, verse, translation): """ Initializes a Verse object with book, chapter, v...
Remove spaces and set to lowercase
Remove spaces and set to lowercase
Python
mit
Matthew-Arnold/slack-versebot,Matthew-Arnold/slack-versebot
--- +++ @@ -11,7 +11,7 @@ def __init__(self, book, chapter, verse, translation): """ Initializes a Verse object with book, chapter, verse (if exists), and translation (if exists). """ - self.book = book - self.chapter = chapter - self.verse = verse - self.translation...
fd87d09b03be003dcd13d778c175f796c4fdf7d6
test_http2_server.py
test_http2_server.py
from echo_client import client def test_ok(): response = client('GET a_web_page.html HTTP/1.1').split('\r\n') first_line = response[0] assert first_line == 'HTTP/1.1 200 OK' def test_body(): response = client('GET sample.txt HTTP/1.1').split('\r\n') body = response[4] assert 'This is a very ...
from echo_client import client def test_ok(): response = client('GET a_web_page.html HTTP/1.1').split('\r\n') first_line = response[0] assert first_line == 'HTTP/1.1 200 OK' def test_body(): response = client('GET sample.txt HTTP/1.1').split('\r\n') body = response[4] assert 'This is a very ...
Change directory test to look for link, rather than just file name
Change directory test to look for link, rather than just file name
Python
mit
jwarren116/network-tools,jwarren116/network-tools
--- +++ @@ -16,7 +16,7 @@ def test_directory(): response = client('GET / HTTP/1.1').split('\r\n') body = response[4] - assert 'make_time.py' in body + assert "<a href='make_time.py'>make_time.py</a>" in body def test_404():
e94f2cb6dd144cec7b10aecb29669e7ba2ef98b1
chatterbot/__init__.py
chatterbot/__init__.py
""" ChatterBot is a machine learning, conversational dialog engine. """ from .chatterbot import ChatBot __version__ = '0.6.0' __author__ = 'Gunther Cox' __email__ = 'gunthercx@gmail.com' __url__ = 'https://github.com/gunthercox/ChatterBot' __all__ = ( 'ChatBot', )
""" ChatterBot is a machine learning, conversational dialog engine. """ from .chatterbot import ChatBot __version__ = '0.6.1' __author__ = 'Gunther Cox' __email__ = 'gunthercx@gmail.com' __url__ = 'https://github.com/gunthercox/ChatterBot' __all__ = ( 'ChatBot', )
Update release version to 0.6.1
Update release version to 0.6.1
Python
bsd-3-clause
gunthercox/ChatterBot,vkosuri/ChatterBot
--- +++ @@ -3,7 +3,7 @@ """ from .chatterbot import ChatBot -__version__ = '0.6.0' +__version__ = '0.6.1' __author__ = 'Gunther Cox' __email__ = 'gunthercx@gmail.com' __url__ = 'https://github.com/gunthercox/ChatterBot'
666d9c999ebf0cc388d8f045a04756424c2d9b62
gdemo/util.py
gdemo/util.py
"""Share utility functions.""" from urllib import parse def get_route_value(environ, name): value = environ['wsgiorg.routing_args'][1][name] value = parse.unquote(value) return value.replace('%2F', '/')
"""Share utility functions.""" try: from urllib import parse except ImportError: import urllib as parse def get_route_value(environ, name): value = environ['wsgiorg.routing_args'][1][name] value = parse.unquote(value) return value.replace('%2F', '/')
Make it work for Python 2
Make it work for Python 2 Gabbi is designed to work with both Python 2.7 and 3.4.
Python
apache-2.0
cdent/gabbi-demo,cdent/gabbi-demo
--- +++ @@ -1,6 +1,10 @@ """Share utility functions.""" -from urllib import parse +try: + from urllib import parse +except ImportError: + import urllib as parse + def get_route_value(environ, name):
be3cfd7033097bbc073e05c232f702bbcbfbd4db
xgcm/__init__.py
xgcm/__init__.py
from mdsxray import open_mdsdataset from gridops import GCMDataset from regridding import regrid_vertical
from .mdsxray import open_mdsdataset from .gridops import GCMDataset from .regridding import regrid_vertical
Fix the imports for Python 3
Fix the imports for Python 3
Python
mit
rabernat/xmitgcm,xgcm/xmitgcm,sambarluc/xmitgcm,xgcm/xgcm,rabernat/xgcm
--- +++ @@ -1,3 +1,3 @@ -from mdsxray import open_mdsdataset -from gridops import GCMDataset -from regridding import regrid_vertical +from .mdsxray import open_mdsdataset +from .gridops import GCMDataset +from .regridding import regrid_vertical
f60363b3d24d2f4af5ddb894cc1f6494b371b18e
mass_mailing_switzerland/wizards/mailchimp_export_update_wizard.py
mass_mailing_switzerland/wizards/mailchimp_export_update_wizard.py
############################################################################## # # Copyright (C) 2020 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __manifest__.py # #####################...
############################################################################## # # Copyright (C) 2020 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __manifest__.py # #####################...
FIX opt_out prevention for mailchimp export
FIX opt_out prevention for mailchimp export
Python
agpl-3.0
CompassionCH/compassion-switzerland,eicher31/compassion-switzerland,CompassionCH/compassion-switzerland,CompassionCH/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland
--- +++ @@ -17,10 +17,8 @@ @api.multi def get_mailing_contact_id(self, partner_id, force_create=False): # Avoid exporting opt_out partner - if force_create: - partner = self.env["res.partner"].browse(partner_id) - if partner.opt_out: - return False + ...
3ef1531f6934055a416cdddc694f6ca75694d649
voltron/common.py
voltron/common.py
import logging import logging.config LOG_CONFIG = { 'version': 1, 'formatters': { 'standard': {'format': 'voltron: [%(levelname)s] %(message)s'} }, 'handlers': { 'default': { 'class': 'logging.StreamHandler', 'formatter': 'standard' } }, 'loggers'...
import logging import logging.config LOG_CONFIG = { 'version': 1, 'formatters': { 'standard': {'format': 'voltron: [%(levelname)s] %(message)s'} }, 'handlers': { 'default': { 'class': 'logging.StreamHandler', 'formatter': 'standard' } }, 'loggers'...
Make use of expanduser() more sane
Make use of expanduser() more sane
Python
mit
snare/voltron,snare/voltron,snare/voltron,snare/voltron
--- +++ @@ -21,7 +21,7 @@ } } -VOLTRON_DIR = '~/.voltron/' +VOLTRON_DIR = os.path.expanduser('~/.voltron/') VOLTRON_CONFIG = VOLTRON_DIR + 'config' def configure_logging():
22207247c286ad3c656c3f6b550d869cf92f6e92
fs/sshfs/__init__.py
fs/sshfs/__init__.py
from __future__ import absolute_import from __future__ import unicode_literals from .sshfs import SSHFS
from __future__ import absolute_import from __future__ import unicode_literals from .sshfs import SSHFS from ..opener import Opener, registry @registry.install class SSHOpener(Opener): protocols = ['ssh'] def open_fs(self, fs_url, parse_result, writeable, create, cwd): #from .sshfs import SSHFS ...
Add fs Opener based on the builtin FTPFS opener
Add fs Opener based on the builtin FTPFS opener
Python
lgpl-2.1
althonos/fs.sshfs
--- +++ @@ -2,3 +2,23 @@ from __future__ import unicode_literals from .sshfs import SSHFS + +from ..opener import Opener, registry + + +@registry.install +class SSHOpener(Opener): + protocols = ['ssh'] + + def open_fs(self, fs_url, parse_result, writeable, create, cwd): + #from .sshfs import SSHFS + ...
d0bf235af3742a17c722488fe3679d5b73a0d945
thinc/neural/_classes/softmax.py
thinc/neural/_classes/softmax.py
from .affine import Affine from ... import describe from ...describe import Dimension, Synapses, Biases from ...check import has_shape from ... import check @describe.attributes( W=Synapses("Weights matrix", lambda obj: (obj.nO, obj.nI), lambda W, ops: None) ) class Softmax(Affine): name = 'so...
from .affine import Affine from ... import describe from ...describe import Dimension, Synapses, Biases from ...check import has_shape from ... import check @describe.attributes( W=Synapses("Weights matrix", lambda obj: (obj.nO, obj.nI), lambda W, ops: None) ) class Softmax(Affine): name = 'so...
Fix gemm calls in Softmax
Fix gemm calls in Softmax
Python
mit
spacy-io/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc
--- +++ @@ -23,9 +23,9 @@ output__BO = self.predict(input__BI) @check.arg(0, has_shape(('nB', 'nO'))) def finish_update(grad__BO, sgd=None): - self.d_W += self.ops.batch_outer(grad__BO, input__BI) + self.d_W += self.ops.gemm(grad__BO, input__BI, trans1=True) ...
246971d8dd7d6c5fdc480c55e4e79ffd7a840b9b
Cura/View/View.py
Cura/View/View.py
#Abstract for all views class View(object): def __init__(self): self._renderer = None
#Abstract for all views class View(object): def __init__(self): self._renderer = None def render(self, glcontext): pass
Add a render method to view that should be reimplemented
Add a render method to view that should be reimplemented
Python
agpl-3.0
onitake/Uranium,onitake/Uranium
--- +++ @@ -2,3 +2,6 @@ class View(object): def __init__(self): self._renderer = None + + def render(self, glcontext): + pass
ca674b743b6d48593f45d999335ae893cf2a90d6
base/config/production.py
base/config/production.py
" Production settings must be here. " from .core import * from os import path as op SECRET_KEY = 'SecretKeyForSessionSigning' ADMINS = frozenset([MAIL_USERNAME]) # flask.ext.collect # ----------------- COLLECT_STATIC_ROOT = op.join(op.dirname(ROOTDIR), 'static') # auth.oauth # ---------- OAUTH_TWITTER = dict( ...
" Production settings must be here. " from .core import * from os import path as op SECRET_KEY = 'SecretKeyForSessionSigning' ADMINS = frozenset([MAIL_USERNAME]) # flask.ext.collect # ----------------- COLLECT_STATIC_ROOT = op.join(op.dirname(ROOTDIR), 'static') # auth.oauth # ---------- OAUTH_TWITTER = dict( ...
Add github and facebook oauth credentials.
Add github and facebook oauth credentials.
Python
bsd-3-clause
klen/Flask-Foundation,klen/fquest,klen/tweetchi
--- +++ @@ -14,9 +14,18 @@ # auth.oauth # ---------- OAUTH_TWITTER = dict( - # flask-base-template app - consumer_key='ydcXz2pWyePfc3MX3nxJw', - consumer_secret='Pt1t2PjzKu8vsX5ixbFKu5gNEAekYrbpJrlsQMIwquc' + consumer_key='750sRyKzvdGPJjPd96yfgw', + consumer_secret='UGcyjDCUOb1q44w1nUk8FA7aXxvwwj1BC...
ac50044c16e2302e7543923d562cca5ba715e311
web/impact/impact/v1/events/base_history_event.py
web/impact/impact/v1/events/base_history_event.py
from abc import ( ABCMeta, abstractmethod, ) from impact.v1.helpers import ( STRING_FIELD, ) class BaseHistoryEvent(object): __metaclass__ = ABCMeta CLASS_FIELDS = { "event_type": STRING_FIELD, "datetime": STRING_FIELD, "latest_datetime": STRING_FIELD, "description...
from abc import ( ABCMeta, abstractmethod, ) from impact.v1.helpers import ( STRING_FIELD, ) class BaseHistoryEvent(object): __metaclass__ = ABCMeta CLASS_FIELDS = { "event_type": STRING_FIELD, "datetime": STRING_FIELD, "latest_datetime": STRING_FIELD, "description...
Switch from () to __call__()
[AC-4857] Switch from () to __call__()
Python
mit
masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api
--- +++ @@ -57,7 +57,7 @@ def serialize(self): result = {} for key in self.all_fields().keys(): - value = getattr(self, key)() + value = getattr(self, key).__call__() if value is not None: result[key] = value return result
6722e16aef43f9cfe03e7e76fc578582139721f6
vint/linting/env.py
vint/linting/env.py
import os import os.path import re import logging from pathlib import Path VIM_SCRIPT_FILE_NAME_PATTERNS = r'(?:[\._]g?vimrc|.*\.vim$)' def build_environment(cmdargs): return { 'cmdargs': cmdargs, 'home_path': _get_home_path(cmdargs), 'cwd': _get_cwd(cmdargs), 'file_paths': _get_f...
import os import os.path from pathlib import Path from vint.linting.file_filter import find_vim_script def build_environment(cmdargs): return { 'cmdargs': cmdargs, 'home_path': _get_home_path(cmdargs), 'cwd': _get_cwd(cmdargs), 'file_paths': _get_file_paths(cmdargs) } def _ge...
Split file collecting algorithm to FileFilter
Split file collecting algorithm to FileFilter
Python
mit
Kuniwak/vint,RianFuro/vint,RianFuro/vint,Kuniwak/vint
--- +++ @@ -1,10 +1,7 @@ import os import os.path -import re -import logging from pathlib import Path - -VIM_SCRIPT_FILE_NAME_PATTERNS = r'(?:[\._]g?vimrc|.*\.vim$)' +from vint.linting.file_filter import find_vim_script def build_environment(cmdargs): @@ -28,29 +25,6 @@ if 'files' not in cmdargs: ...
ba8e567592c96dacb697e067004dc71799e4e93f
ctypeslib/test/stdio.py
ctypeslib/test/stdio.py
import os from ctypeslib.dynamic_module import include from ctypes import * if os.name == "nt": _libc = CDLL("msvcrt") else: _libc = CDLL(None) include("""\ #include <stdio.h> #ifdef _MSC_VER # include <fcntl.h> #else # include <sys/fcntl.h> #endif """, persist=False)
import os from ctypeslib.dynamic_module import include from ctypes import * if os.name == "nt": _libc = CDLL("msvcrt") else: _libc = CDLL(None) _gen_basename = include("""\ #include <stdio.h> #ifdef _MSC_VER # include <fcntl.h> #else # include <sys/fcntl.h> #endif /* Silly comment */ """, persist=...
Store the basename of the generated files, to allow the unittests to clean up in the tearDown method.
Store the basename of the generated files, to allow the unittests to clean up in the tearDown method.
Python
mit
sugarmanz/ctypeslib
--- +++ @@ -7,7 +7,7 @@ else: _libc = CDLL(None) -include("""\ +_gen_basename = include("""\ #include <stdio.h> #ifdef _MSC_VER @@ -15,5 +15,7 @@ #else # include <sys/fcntl.h> #endif + +/* Silly comment */ """, persist=False)
1ff4dab34d4aa6935d4d1b54aa354882790b9b44
astroquery/astrometry_net/__init__.py
astroquery/astrometry_net/__init__.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ <Put Your Tool Name Here> ------------------------- :author: <your name> (<your email>) """ # Make the URL of the server, timeout and other items configurable # See <http://docs.astropy.org/en/latest/config/index.html#developer-usage> # for docs and...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ <Put Your Tool Name Here> ------------------------- :author: <your name> (<your email>) """ # Make the URL of the server, timeout and other items configurable # See <http://docs.astropy.org/en/latest/config/index.html#developer-usage> # for docs and...
Add config items for server, timeout
Add config items for server, timeout
Python
bsd-3-clause
imbasimba/astroquery,ceb8/astroquery,ceb8/astroquery,imbasimba/astroquery
--- +++ @@ -14,13 +14,18 @@ from astropy import config as _config + class Conf(_config.ConfigNamespace): """ Configuration parameters for `astroquery.astrometry_net` """ api_key = _config.ConfigItem( '', "The Astrometry.net API key." - ) + ) + server = _config.ConfigIt...
89e3d4ae0a7be5baef6354324b2e7f8623564c94
examples/olfaction/data/gen_olf_input.py
examples/olfaction/data/gen_olf_input.py
#!/usr/bin/env python """ Generate sample olfactory model stimulus. """ import numpy as np import h5py osn_num = 1375 dt = 1e-4 # time step Ot = 2000 # number of data point during reset period Rt = 1000 # number of data point during odor delivery period Nt = 4*Ot + 3*Rt # number of data points in time t = np.arang...
#!/usr/bin/env python """ Generate sample olfactory model stimulus. """ import numpy as np import h5py osn_num = 1375 dt = 1e-4 # time step Ot = 2000 # number of data point during reset period Rt = 1000 # number of data point during odor delivery period Nt = 4*Ot + 3*Rt # number of data points in time t = np.arang...
Use 'array' rather than 'real' for data array name in olfactory stimulus generation script.
Use 'array' rather than 'real' for data array name in olfactory stimulus generation script.
Python
bsd-3-clause
cerrno/neurokernel
--- +++ @@ -23,6 +23,6 @@ u_all = np.transpose(np.kron(np.ones((osn_num, 1)), u)) with h5py.File('olfactory_input.h5', 'w') as f: - f.create_dataset('real', (Nt, osn_num), + f.create_dataset('array', (Nt, osn_num), dtype=np.float64, data=u_all)
87753b0bff057b61879e2dbcc4dceba7aec95451
settings/const.py
settings/const.py
import urllib2 #Database settings database_connect = "dbname='ridprod'" kv1_database_connect = "dbname='kv1tmp'" iff_database_connect = "dbname='ifftmp'" pool_generation_enabled = True #NDOVLoket settings ndovloket_url = "data.ndovloket.nl" ndovloket_user = "voorwaarden" ndovloket_password = "geaccepteerd" auth_handl...
import urllib2 #Database settings database_connect = "dbname='ridprod'" kv1_database_connect = "dbname='kv1tmp'" iff_database_connect = "dbname='ifftmp'" pool_generation_enabled = False #NDOVLoket settings ndovloket_url = "data.ndovloket.nl" ndovloket_user = "voorwaarden" ndovloket_password = "geaccepteerd" auth_hand...
Disable pool generation by default
Disable pool generation by default
Python
bsd-2-clause
bliksemlabs/bliksemintegration,bliksemlabs/bliksemintegration
--- +++ @@ -4,7 +4,7 @@ database_connect = "dbname='ridprod'" kv1_database_connect = "dbname='kv1tmp'" iff_database_connect = "dbname='ifftmp'" -pool_generation_enabled = True +pool_generation_enabled = False #NDOVLoket settings ndovloket_url = "data.ndovloket.nl"
9aa17b90b8f3413f0621cc25a686774dd809dc84
frigg/projects/serializers.py
frigg/projects/serializers.py
from rest_framework import serializers from frigg.builds.serializers import BuildInlineSerializer from .models import Project class ProjectSerializer(serializers.ModelSerializer): builds = BuildInlineSerializer(read_only=True, many=True) class Meta: model = Project fields = ( 'i...
from rest_framework import serializers from frigg.builds.serializers import BuildInlineSerializer from .models import Project class EnvironmentVariableSerializer(serializers.ModelSerializer): def to_representation(self, instance): representation = super().to_representation(instance) if instance...
Add drf serializer for environment variables
feat: Add drf serializer for environment variables
Python
mit
frigg/frigg-hq,frigg/frigg-hq,frigg/frigg-hq
--- +++ @@ -3,6 +3,24 @@ from frigg.builds.serializers import BuildInlineSerializer from .models import Project + + +class EnvironmentVariableSerializer(serializers.ModelSerializer): + + def to_representation(self, instance): + representation = super().to_representation(instance) + if instance.is...
85537b6bee3efdd1862726a7e68bd79f693ecd4f
tornado_menumaker/helper/Page.py
tornado_menumaker/helper/Page.py
#!/usr/bin/python # -*- encoding: utf-8 -*- """ """ import inspect from tornado.web import Application from .Route import Route from .Index import IndexRoute __author__ = 'Martin Martimeo <martin@martimeo.de>' __date__ = '16.06.13 - 23:46' class Page(Route): """ A Page """ def __init__(self, u...
#!/usr/bin/python # -*- encoding: utf-8 -*- """ """ import inspect from tornado.web import Application from .Route import Route from .Index import IndexRoute __author__ = 'Martin Martimeo <martin@martimeo.de>' __date__ = '16.06.13 - 23:46' class Page(Route): """ A Page """ def __init__(self, u...
Make still class available when decorating class with @page
Make still class available when decorating class with @page
Python
agpl-3.0
tornado-utils/tornado-menumaker
--- +++ @@ -40,5 +40,5 @@ for n, method in inspect.getmembers(self.cls, IndexRoute.isindex): self._index = method - return self + return self.cls raise Exception()
4bcf35efcfc751a1c337fdcf50d23d9d06549717
demo/apps/catalogue/models.py
demo/apps/catalogue/models.py
from django.db import models from django.utils.translation import ugettext_lazy as _ from wagtail.wagtailcore.models import Page class Category(Page): """ user oscars category as a wagtail Page. this works becuase they both use treebeard """ name = models.CharField( verbose_name=_('name')...
from django.db import models from django.utils.translation import ugettext_lazy as _ from wagtail.wagtailcore.models import Page class Category(Page): """ The Oscars Category as a Wagtail Page This works because they both use Treebeard """ name = models.CharField( verbose_name=_('name'), ...
Fix typo in doc string
Fix typo in doc string
Python
mit
pgovers/oscar-wagtail-demo,pgovers/oscar-wagtail-demo
--- +++ @@ -6,8 +6,8 @@ class Category(Page): """ - user oscars category as a wagtail Page. - this works becuase they both use treebeard + The Oscars Category as a Wagtail Page + This works because they both use Treebeard """ name = models.CharField( verbose_name=_('name'),
0a69133e44810dd0469555f62ec49eba120e6ecc
apps/storybase/utils.py
apps/storybase/utils.py
"""Shared utility functions""" from django.template.defaultfilters import slugify as django_slugify def slugify(value): """ Normalizes string, converts to lowercase, removes non-alpha characters, converts spaces to hyphens, and truncates to 50 characters. """ slug = django_slugify(value) slug ...
"""Shared utility functions""" from django.conf import settings from django.template.defaultfilters import slugify as django_slugify from django.utils.translation import ugettext as _ def get_language_name(language_code): """Convert a language code into its full (localized) name""" languages = dict(settings.L...
Add utility function to convert a language code to a its full name
Add utility function to convert a language code to a its full name
Python
mit
denverfoundation/storybase,denverfoundation/storybase,denverfoundation/storybase,denverfoundation/storybase
--- +++ @@ -1,6 +1,14 @@ """Shared utility functions""" +from django.conf import settings from django.template.defaultfilters import slugify as django_slugify +from django.utils.translation import ugettext as _ + +def get_language_name(language_code): + """Convert a language code into its full (localized) name...
62b1c49c67c72c36d4177c657df49a4700586c06
djangoTemplate/urls.py
djangoTemplate/urls.py
"""djangoTemplate URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ """ from django.conf.urls import url, include from django.contrib import admin urlpatterns = [ url('', include('base.urls')), url('', ...
"""djangoTemplate URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ """ from django.conf.urls import url, include from django.contrib import admin urlpatterns = [ url('', include('base.urls')), url('', ...
Change the url patters from python_social_auth to social_django
Change the url patters from python_social_auth to social_django
Python
mit
tosp/djangoTemplate,tosp/djangoTemplate
--- +++ @@ -9,7 +9,7 @@ urlpatterns = [ url('', include('base.urls')), - url('', include('social.apps.django_app.urls', namespace='social')), + url('', include('social_django.urls', namespace='social')), url(r'^admin/', admin.site.urls), url(r'^tosp_auth/', include('tosp_auth.urls')) ]
62f4c6b7d24176284054b13c4e1e9b6d631c7b42
basicTest.py
basicTest.py
import slither, pygame, time snakey = slither.Sprite() snakey.setCostumeByName("costume0") SoExcited = slither.Sprite() SoExcited.addCostume("SoExcited.png", "avatar") SoExcited.setCostumeByNumber(0) SoExcited.goTo(300, 300) SoExcited.setScaleTo(0.33) slither.slitherStage.setColor(40, 222, 40) screen = slither.se...
import slither, pygame, time snakey = slither.Sprite() snakey.setCostumeByName("costume0") SoExcited = slither.Sprite() SoExcited.addCostume("SoExcited.png", "avatar") SoExcited.setCostumeByNumber(0) SoExcited.goTo(300, 300) SoExcited.setScaleTo(0.33) slither.slitherStage.setColor(40, 222, 40) screen = slither.se...
Update basic test Now uses the new format by @BookOwl.
Update basic test Now uses the new format by @BookOwl.
Python
mit
PySlither/Slither,PySlither/Slither
--- +++ @@ -15,13 +15,8 @@ screen = slither.setup() # Begin slither -continueLoop = True -while continueLoop: - slither.blit(screen) # Display +def run_a_frame(): snakey.changeXBy(1) SoExcited.changeDirectionBy(1) - # Handle quitting - for event in pygame.event.get(): - if event.type ==...
385f190d782c7d2edbba8b425db2418e6891ea86
framework/mongo/__init__.py
framework/mongo/__init__.py
# -*- coding: utf-8 -*- from flask import request from modularodm.storedobject import StoredObject as GenericStoredObject from modularodm.ext.concurrency import with_proxies, proxied_members from bson import ObjectId from .handlers import client, database, set_up_storage from api.base.api_globals import api_globals...
# -*- coding: utf-8 -*- from flask import request from modularodm.storedobject import StoredObject as GenericStoredObject from modularodm.ext.concurrency import with_proxies, proxied_members from bson import ObjectId from .handlers import client, database, set_up_storage from api.base.api_globals import api_globals...
Consolidate hasattr + getter to single statement with default value.
Consolidate hasattr + getter to single statement with default value.
Python
apache-2.0
kch8qx/osf.io,aaxelb/osf.io,chrisseto/osf.io,baylee-d/osf.io,billyhunt/osf.io,acshi/osf.io,SSJohns/osf.io,kwierman/osf.io,emetsger/osf.io,icereval/osf.io,DanielSBrown/osf.io,mattclark/osf.io,njantrania/osf.io,jmcarp/osf.io,HalcyonChimera/osf.io,emetsger/osf.io,Nesiehr/osf.io,bdyetton/prettychart,doublebits/osf.io,lynds...
--- +++ @@ -25,7 +25,7 @@ try: return request._get_current_object() except RuntimeError: # Not in a flask request context - if hasattr(api_globals, 'request') and api_globals.request is not None: + if getattr(api_globals, 'request', None) is not None: return api_globals....
890190f40b9061f7bfa15bbd7e56abc0f1b7d44a
redmapper/__init__.py
redmapper/__init__.py
from __future__ import division, absolute_import, print_function from ._version import __version__, __version_info__ version = __version__ from .configuration import Configuration from .runcat import RunCatalog from .solver_nfw import Solver from .catalog import DataObject, Entry, Catalog from .redsequence import Re...
from __future__ import division, absolute_import, print_function from ._version import __version__, __version_info__ version = __version__ from .configuration import Configuration from .runcat import RunCatalog from .solver_nfw import Solver from .catalog import DataObject, Entry, Catalog from .redsequence import Re...
Make fitters available at main import level.
Make fitters available at main import level.
Python
apache-2.0
erykoff/redmapper,erykoff/redmapper
--- +++ @@ -20,3 +20,4 @@ from .centering import Centering, CenteringWcenZred, CenteringBCG from .depthmap import DepthMap from .color_background import ColorBackground, ColorBackgroundGenerator +from .fitters import MedZFitter, RedSequenceFitter, RedSequenceOffDiagonalFitter, CorrectionFitter, EcgmmFitter
aa8234d1e6b4916e6945468a2bc5772df2d53e28
bot/admin.py
bot/admin.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from . import models @admin.register(models.Notification) class NotificationAdmin(admin.ModelAdmin): list_display = ('launch', 'last_net_stamp', 'last_twitter_post', 'last_notification_sent', 'las...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from . import models @admin.register(models.Notification) class NotificationAdmin(admin.ModelAdmin): list_display = ('launch', 'last_net_stamp', 'last_twitter_post', 'last_notification_sent', 'las...
Add Discord Admin for debugging.
Add Discord Admin for debugging.
Python
apache-2.0
ItsCalebJones/SpaceLaunchNow-Server,ItsCalebJones/SpaceLaunchNow-Server,ItsCalebJones/SpaceLaunchNow-Server
--- +++ @@ -17,3 +17,8 @@ @admin.register(models.DailyDigestRecord) class DailyDigestRecordAdmin(admin.ModelAdmin): list_display = ('id', 'timestamp', 'messages', 'count', 'data') + + +@admin.register(models.DiscordChannel) +class DiscordBotAdmin(admin.ModelAdmin): + list_display = ('name', 'channel_id', 's...
e9fbd541b3fcb84c6d2de9ba1de53886730a67fa
common.py
common.py
import os def get_project_path(): root_dir = os.path.abspath(os.path.dirname(__file__)) return root_dir
import os def get_project_path(): root_dir = os.path.abspath(os.path.dirname(__file__)) return root_dir def get_yourproject_path(): root_dir = os.path.abspath(os.path.dirname(__file__)) return root_dir
Add new changes to th branch
Add new changes to th branch
Python
mit
nvthanh1/Skypybot
--- +++ @@ -2,3 +2,6 @@ def get_project_path(): root_dir = os.path.abspath(os.path.dirname(__file__)) return root_dir +def get_yourproject_path(): + root_dir = os.path.abspath(os.path.dirname(__file__)) + return root_dir
42a54411634ef395ca3c2dfbfeefd7cea2d55101
auth0plus/exceptions.py
auth0plus/exceptions.py
try: from auth0.v2.exceptions import Auth0Error except ImportError: # pragma: no cover class Auth0Error(Exception): def __init__(self, status_code, error_code, message): self.status_code = status_code self.error_code = error_code self.message = message def ...
try: from auth0.v3.exceptions import Auth0Error except ImportError: # pragma: no cover class Auth0Error(Exception): def __init__(self, status_code, error_code, message): self.status_code = status_code self.error_code = error_code self.message = message def ...
Update to v3 of the auth0 client for the exception handling
Update to v3 of the auth0 client for the exception handling
Python
isc
bretth/auth0plus
--- +++ @@ -1,6 +1,6 @@ try: - from auth0.v2.exceptions import Auth0Error + from auth0.v3.exceptions import Auth0Error except ImportError: # pragma: no cover class Auth0Error(Exception): def __init__(self, status_code, error_code, message):
53ad3866b8dfbd012748e4ad7d7ed7025d491bd0
src/alexa-main.py
src/alexa-main.py
import handlers.events as events APPLICATION_ID = "amzn1.ask.skill.dd677950-cade-4805-b1f1-ce2e3a3569f0" def lambda_handler(event, context): if event['session']['new']: events.on_session_started({'requestId': event['request']['requestId']}, event['session']) request...
import handlers.events as events APPLICATION_ID = "amzn1.ask.skill.dd677950-cade-4805-b1f1-ce2e3a3569f0" def lambda_handler(event, context): # Make sure only this Alexa skill can use this function if event['session']['application']['applicationId'] != APPLICATION_ID: raise ValueError("Invalid Applica...
REVERT remove application id validation
REVERT remove application id validation
Python
mit
mauriceyap/ccm-assistant
--- +++ @@ -4,6 +4,10 @@ def lambda_handler(event, context): + # Make sure only this Alexa skill can use this function + if event['session']['application']['applicationId'] != APPLICATION_ID: + raise ValueError("Invalid Application ID") + if event['session']['new']: events.on_session_s...
5cd674ec764be72bb3e94c0b56fdf733a4a1c885
Discord/utilities/errors.py
Discord/utilities/errors.py
from discord.ext.commands.errors import CommandError class NotServerOwner(CommandError): '''Not Server Owner''' pass class VoiceNotConnected(CommandError): '''Voice Not Connected''' pass class PermittedVoiceNotConnected(VoiceNotConnected): '''Permitted, but Voice Not Connected''' pass class NotPermittedVoice...
from discord.ext.commands.errors import CommandError class NotServerOwner(CommandError): '''Not Server Owner''' pass class VoiceNotConnected(CommandError): '''Voice Not Connected''' pass class PermittedVoiceNotConnected(VoiceNotConnected): '''Permitted, but Voice Not Connected''' pass class NotPermittedVoice...
Remove Audio Already Done error
[Discord] Remove Audio Already Done error
Python
mit
Harmon758/Harmonbot,Harmon758/Harmonbot
--- +++ @@ -38,7 +38,3 @@ '''Audio Not Playing''' pass -class AudioAlreadyDone(AudioError): - '''Audio Already Done playing''' - pass -
737d069c57c3cb2d6305f8e5d1f7d88402ef1327
go/apps/jsbox/definition.py
go/apps/jsbox/definition.py
import json from go.vumitools.conversation.definition import ( ConversationDefinitionBase, ConversationAction) class ViewLogsAction(ConversationAction): action_name = 'view_logs' action_display_name = 'View Sandbox Logs' redirect_to = 'jsbox_logs' class ConversationDefinition(ConversationDefinition...
import json from go.vumitools.conversation.definition import ( ConversationDefinitionBase, ConversationAction) class ViewLogsAction(ConversationAction): action_name = 'view_logs' action_display_name = 'View Sandbox Logs' redirect_to = 'jsbox_logs' class ConversationDefinition(ConversationDefinition...
Add support for v2 endpoints in config.
Add support for v2 endpoints in config.
Python
bsd-3-clause
praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go
--- +++ @@ -25,7 +25,19 @@ raw_js_config = app_config.get("config", {}).get("value", {}) try: js_config = json.loads(raw_js_config) - pool, tag = js_config.get("sms_tag") except Exception: return [] - return ["%s:%s" % (pool, tag)] + + endp...
c97e5cf11fc21e2ef4ee04779a424e4d6a2b96ae
tools/perf/metrics/__init__.py
tools/perf/metrics/__init__.py
# Copyright 2013 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. class Metric(object): """Base class for all the metrics that are used by telemetry measurements. The Metric class represents a way of measuring somethin...
# Copyright 2013 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. class Metric(object): """Base class for all the metrics that are used by telemetry measurements. The Metric class represents a way of measuring somethin...
Add CustomizeBrowserOptions method to Metric base class
Add CustomizeBrowserOptions method to Metric base class BUG=271177 Review URL: https://chromiumcodereview.appspot.com/22938004 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@217198 0039d316-1c4b-4281-b951-d872f2087c98
Python
bsd-3-clause
mogoweb/chromium-crosswalk,Just-D/chromium-1,M4sse/chromium.src,dushu1203/chromium.src,Jonekee/chromium.src,Just-D/chromium-1,ChromiumWebApps/chromium,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,M4sse/chr...
--- +++ @@ -10,6 +10,17 @@ multiple metrics; each metric should be focussed on collecting data about one thing. """ + + def CustomizeBrowserOptions(self, options): + """Add browser options that are required by this metric. + + Some metrics do not have any special browser options that need + to be a...
f9c7a911411429972929bb4372b370192bd4cf8a
altair/examples/interactive_layered_crossfilter.py
altair/examples/interactive_layered_crossfilter.py
""" Interactive Crossfilter ======================= This example shows a multi-panel view of the same data, where you can interactively select a portion of the data in any of the panels to highlight that portion in any of the other panels. """ # category: interactive charts import altair as alt from vega_datasets impor...
""" Interactive Crossfilter ======================= This example shows a multi-panel view of the same data, where you can interactively select a portion of the data in any of the panels to highlight that portion in any of the other panels. """ # category: interactive charts import altair as alt from vega_datasets impor...
Update crossfilter to gray/blue scheme
Update crossfilter to gray/blue scheme Same as in https://vega.github.io/editor/#/examples/vega-lite/interactive_layered_crossfilter
Python
bsd-3-clause
altair-viz/altair,jakevdp/altair
--- +++ @@ -26,13 +26,13 @@ height=130 ) -# blue background with selection -background = base.add_selection(brush) +# gray background with selection +background = base.encode( + color=alt.value('#ddd') +).add_selection(brush) -# yellow highlights on the transformed data -highlight = base.encode( - col...
6064db3000f2aeec66a775345d22b8a2b421497f
astropy/utils/tests/test_gzip.py
astropy/utils/tests/test_gzip.py
import io import os from ...tests.helper import pytest from .. import gzip def test_gzip(tmpdir): fd = gzip.GzipFile(str(tmpdir.join("test.gz")), 'wb') fd = io.TextIOWrapper(fd, encoding='utf8')
import io import os from ...tests.helper import pytest from .. import gzip pytestmark = pytest.mark.skipif("sys.version_info < (3,0)") def test_gzip(tmpdir): fd = gzip.GzipFile(str(tmpdir.join("test.gz")), 'wb') fd = io.TextIOWrapper(fd, encoding='utf8')
Fix gzip test for Python 2.6
Fix gzip test for Python 2.6
Python
bsd-3-clause
tbabej/astropy,bsipocz/astropy,lpsinger/astropy,MSeifert04/astropy,StuartLittlefair/astropy,larrybradley/astropy,DougBurke/astropy,stargaser/astropy,pllim/astropy,stargaser/astropy,MSeifert04/astropy,tbabej/astropy,lpsinger/astropy,joergdietrich/astropy,astropy/astropy,joergdietrich/astropy,dhomeier/astropy,kelle/astro...
--- +++ @@ -4,6 +4,8 @@ from ...tests.helper import pytest from .. import gzip +pytestmark = pytest.mark.skipif("sys.version_info < (3,0)") + def test_gzip(tmpdir): fd = gzip.GzipFile(str(tmpdir.join("test.gz")), 'wb') fd = io.TextIOWrapper(fd, encoding='utf8')
6797c9b705b0cfd5c770f68695402baf044510ff
utils/training_utils/params.py
utils/training_utils/params.py
# Data set split TRAIN_FRACTION = 0.75 VALIDATE_FRACTION = 0.1 TEST_FRACTION = 0.15 TOTAL_NUM_EXAMPLES = 147052 # Total number of tracks assert(TRAIN_FRACTION + VALIDATE_FRACTION + TEST_FRACTION == 1.0) # Validation and check pointing EVALUATION_FREQ = 1000 # Number of mini-batch SGD steps after which an evaluat...
# Data set split TRAIN_FRACTION = 0.75 VALIDATE_FRACTION = 0.1 TEST_FRACTION = 0.15 TOTAL_NUM_EXAMPLES = 147052 # Total number of tracks assert(TRAIN_FRACTION + VALIDATE_FRACTION + TEST_FRACTION == 1.0) # Validation and check pointing EVALUATION_FREQ = 900 # Number of mini-batch SGD steps after which an evaluati...
Change default value of checkpoint frequency
Change default value of checkpoint frequency The default values of evaluation and checkpoint frequency are the same, and they are approximately equal to the number of steps in each epoch.
Python
mit
harpribot/representation-music,harpribot/representation-music
--- +++ @@ -6,8 +6,8 @@ assert(TRAIN_FRACTION + VALIDATE_FRACTION + TEST_FRACTION == 1.0) # Validation and check pointing -EVALUATION_FREQ = 1000 # Number of mini-batch SGD steps after which an evaluation is performed. -CHECKPOINT_FREQ = 1000 # Number of mini-batch SGD steps after which a checkpoint is taken....
f195c01ad6a98b3454880106e95fe40bbeb14da0
tests/test_essentia_dissonance.py
tests/test_essentia_dissonance.py
#! /usr/bin/env python from unit_timeside import unittest, TestRunner from timeside.plugins.decoder.file import FileDecoder from timeside.core import get_processor from timeside.core.tools.test_samples import samples class TestEssentiaDissonance(unittest.TestCase): def setUp(self): self.analyzer = get_...
#! /usr/bin/env python from unit_timeside import unittest, TestRunner from timeside.plugins.decoder.file import FileDecoder from timeside.core import get_processor from timeside.core.tools.test_samples import samples class TestEssentiaDissonance(unittest.TestCase): def setUp(self): self.analyzer = get_...
Fix unit test for essentia dissonance
Fix unit test for essentia dissonance
Python
agpl-3.0
Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide
--- +++ @@ -19,7 +19,7 @@ def tearDown(self): decoder = FileDecoder(self.source) (decoder | self.analyzer).run() - self.assertAlmostEqual(self.analyzer.results['essentia_dissonance'].data_object.value.mean(), 0.18, places=2) + self.assertAlmostEqual(self.analyzer.results['essentia...
853c727c472efc09df90cb016bd05f81d4cf5e8e
beetle_preview/__init__.py
beetle_preview/__init__.py
from http import server from socketserver import TCPServer import os class Server: def __init__(self, own_config, config, builder): self.directory = config.folders['output'] self.port = own_config.get('port', 5000) self.builder = builder def serve(self): os.chdir(self.director...
from http import server from socketserver import TCPServer import os class Server: def __init__(self, own_config, config, builder): self.directory = config.folders['output'] self.port = own_config.get('port', 5000) self.builder = builder def serve(self): os.chdir(self.director...
Print a line telling where the site is available at
Print a line telling where the site is available at
Python
mit
cknv/beetle-preview
--- +++ @@ -16,6 +16,7 @@ httpd = TCPServer(('', self.port), request_handler) try: + print('Preview available at http://0.0.0.0:{}/'.format(self.port)) httpd.serve_forever() except KeyboardInterrupt: httpd.shutdown()
b474c7368f3a8152296acf9cad7459510b71ada5
fs/opener/sshfs.py
fs/opener/sshfs.py
from ._base import Opener from ._registry import registry @registry.install class SSHOpener(Opener): protocols = ['ssh'] @staticmethod def open_fs(fs_url, parse_result, writeable, create, cwd): from ..sshfs import SSHFS ssh_host, _, dir_path = parse_result.resource.partition('/') ...
from ._base import Opener from ._registry import registry from ..subfs import ClosingSubFS @registry.install class SSHOpener(Opener): protocols = ['ssh'] @staticmethod def open_fs(fs_url, parse_result, writeable, create, cwd): from ..sshfs import SSHFS ssh_host, _, dir_path = parse_result....
Fix SSHOpener to use the new ClosingSubFS
Fix SSHOpener to use the new ClosingSubFS
Python
lgpl-2.1
althonos/fs.sshfs
--- +++ @@ -1,6 +1,6 @@ from ._base import Opener from ._registry import registry - +from ..subfs import ClosingSubFS @registry.install class SSHOpener(Opener): @@ -18,4 +18,8 @@ user=parse_result.username, passwd=parse_result.password, ) - return ssh_fs.opendir(dir_pat...
22f305a7cb1daab3dc61b0d22b796916417de9d2
examples/mnist-deepautoencoder.py
examples/mnist-deepautoencoder.py
#!/usr/bin/env python import matplotlib.pyplot as plt import theanets from utils import load_mnist, plot_layers, plot_images train, valid, _ = load_mnist() e = theanets.Experiment( theanets.Autoencoder, layers=(784, 256, 64, 16, 64, 256, 784), train_batches=100, tied_weights=True, ) e.run(train, va...
#!/usr/bin/env python import matplotlib.pyplot as plt import theanets from utils import load_mnist, plot_layers, plot_images train, valid, _ = load_mnist() e = theanets.Experiment( theanets.Autoencoder, layers=(784, 256, 64, 36, 64, 256, 784), train_batches=100, tied_weights=True, ) e.run(train, va...
Increase size of bottleneck layer.
Increase size of bottleneck layer.
Python
mit
lmjohns3/theanets,chrinide/theanets,devdoer/theanets
--- +++ @@ -10,7 +10,7 @@ e = theanets.Experiment( theanets.Autoencoder, - layers=(784, 256, 64, 16, 64, 256, 784), + layers=(784, 256, 64, 36, 64, 256, 784), train_batches=100, tied_weights=True, )
f70bbbdadc044a76f7b90b2cac0191353a6a5048
depfinder.py
depfinder.py
import ast def get_imported_libs(code): tree = ast.parse(code) # ast.Import represents lines like 'import foo' and 'import foo, bar' # the extra for name in t.names is needed, because names is a list that # would be ['foo'] for the first and ['foo', 'bar'] for the second imports = [name.name.split...
import ast import os from collections import deque import sys from stdlib_list import stdlib_list conf = { 'ignore_relative_imports': True, 'ignore_builtin_modules': True, 'pyver': None, } def get_imported_libs(code): tree = ast.parse(code) imports = deque() for t in tree.body: # ast....
Rework the import finding logic
MNT: Rework the import finding logic
Python
bsd-3-clause
ericdill/depfinder
--- +++ @@ -1,13 +1,54 @@ import ast +import os +from collections import deque +import sys +from stdlib_list import stdlib_list + +conf = { + 'ignore_relative_imports': True, + 'ignore_builtin_modules': True, + 'pyver': None, +} def get_imported_libs(code): tree = ast.parse(code) - # ast.Import...
2a8c4790bd432fc4dc0fdda64c0cea4f76fac9ff
feincms/context_processors.py
feincms/context_processors.py
from feincms.module.page.models import Page def add_page_if_missing(request): # If this attribute exists, the a page object has been registered already # by some other part of the code. We let it decide, which page object it # wants to pass into the template if hasattr(request, '_feincms_page'): ...
from feincms.module.page.models import Page def add_page_if_missing(request): # If this attribute exists, the a page object has been registered already # by some other part of the code. We let it decide, which page object it # wants to pass into the template if hasattr(request, '_feincms_page'): ...
Fix add_page_if_missing context processor when no pages exist yet
Fix add_page_if_missing context processor when no pages exist yet
Python
bsd-3-clause
matthiask/feincms2-content,hgrimelid/feincms,nickburlett/feincms,michaelkuty/feincms,michaelkuty/feincms,hgrimelid/feincms,feincms/feincms,pjdelport/feincms,joshuajonah/feincms,pjdelport/feincms,michaelkuty/feincms,joshuajonah/feincms,matthiask/feincms2-content,matthiask/django-content-editor,matthiask/django-content-e...
--- +++ @@ -8,6 +8,9 @@ if hasattr(request, '_feincms_page'): return {} - return { - 'feincms_page': Page.objects.best_match_for_request(request), - } + try: + return { + 'feincms_page': Page.objects.best_match_for_request(request), + } + except Page...
efa36e1013e44fa75f6a77a74bd8bf21f3120976
django_facebook/models.py
django_facebook/models.py
from django.db import models from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect class FacebookProfileModel(models.Model): ''' Abstract class to add to your profile model. NOTE: If you don't use this this abstract class, make sure you copy/paste the fields in....
from django.db import models from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect class FacebookProfileModel(models.Model): ''' Abstract class to add to your profile model. NOTE: If you don't use this this abstract class, make sure you copy/paste the fields in....
Allow for a longer image path
Allow for a longer image path My profile image for example does not fit in the default VARCHAR(100)
Python
bsd-3-clause
fivejjs/Django-facebook,troygrosfield/Django-facebook,danosaure/Django-facebook,rafaelgontijo/Django-facebook-fork,abendleiter/Django-facebook,pjdelport/Django-facebook,fivejjs/Django-facebook,abendleiter/Django-facebook,abendleiter/Django-facebook,andriisoldatenko/Django-facebook,ganescoo/Django-facebook,VishvajitP/Dj...
--- +++ @@ -15,7 +15,7 @@ facebook_profile_url = models.TextField(blank=True, null=True) website_url = models.TextField(blank=True, null=True) blog_url = models.TextField(blank=True, null=True) - image = models.ImageField(blank=True, null=True, upload_to='profile_images') + image = models.ImageFi...
78a03f0b0cbc948a6c9fb215e9051d099c528a82
src/app.py
src/app.py
from flask import Flask from flask import render_template, url_for import parse_data app = Flask(__name__) @app.route("/dashboard") def dashboard(): data = parse_data.load_and_format_data() title = 'Grand Bargain Monitoring' return render_template('dashboard.html', data=data, heading=title, page_title...
from flask import Flask from flask import render_template, url_for import parse_data app = Flask(__name__) @app.route("/dashboard") def dashboard(): data = parse_data.load_and_format_data() title = 'Grand Bargain Transparency Dashboard' return render_template('dashboard.html', data=data, heading=title...
Change page title and heading
Change page title and heading
Python
mit
devinit/grand-bargain-monitoring,devinit/grand-bargain-monitoring,devinit/grand-bargain-monitoring
--- +++ @@ -10,7 +10,7 @@ def dashboard(): data = parse_data.load_and_format_data() - title = 'Grand Bargain Monitoring' + title = 'Grand Bargain Transparency Dashboard' return render_template('dashboard.html', data=data, heading=title, page_title=title)
6b7e32c98fa8a11dcd7bbbadaa2a057e4ff0ce90
f5_os_test/__init__.py
f5_os_test/__init__.py
# Copyright 2016 F5 Networks Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
# Copyright 2016 F5 Networks Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
Add function to create name strings with random characters
Add function to create name strings with random characters Issues: Fixes #48 Problem: Need a function that will generate names with random chars. Analysis: Added new function, random_name(). Tests: test_solution.py
Python
apache-2.0
F5Networks/f5-openstack-test,pjbreaux/f5-openstack-test
--- +++ @@ -12,4 +12,25 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +import random +import string + __version__ = '0.2.0' + + +def random_name(prefix, N): + """Creates a name with random characters. + + Returns a new string created from an in...
1a98b29293ccfab6534a48402414e89726d8e5bb
Python/pomodoro.py
Python/pomodoro.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import subprocess as spr import time def main(): start = datetime.datetime.now() spr.call(['notify-send', 'Started new pomodoro']) time.sleep(30 * 60) end = datetime.datetime.now() duration = (end - start).total_seconds() // 60 fo...
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import subprocess as spr import time def main(): start = datetime.datetime.now() start_str = start.strftime("%H:%M:%S") spr.call(['notify-send', '--app-name', 'POMODORO', '--icon', 'dialog-information', ...
Set icon, summary for notification
Set icon, summary for notification
Python
bsd-2-clause
familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG
--- +++ @@ -8,7 +8,11 @@ def main(): start = datetime.datetime.now() - spr.call(['notify-send', 'Started new pomodoro']) + start_str = start.strftime("%H:%M:%S") + spr.call(['notify-send', + '--app-name', 'POMODORO', + '--icon', 'dialog-information', + 'New pomo...
d9a6071674857ceae566d29c7c77a31a5ed5214d
byceps/blueprints/api/decorators.py
byceps/blueprints/api/decorators.py
""" byceps.blueprints.api.decorators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from functools import wraps from typing import Optional from flask import abort, request from ...services.authentication.api import service as a...
""" byceps.blueprints.api.decorators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from functools import wraps from typing import Optional from flask import abort, request from werkzeug.datastructures import WWWAuthenticate fro...
Return proper WWW-Authenticate header if API authentication fails
Return proper WWW-Authenticate header if API authentication fails
Python
bsd-3-clause
homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps
--- +++ @@ -10,6 +10,7 @@ from typing import Optional from flask import abort, request +from werkzeug.datastructures import WWWAuthenticate from ...services.authentication.api import service as api_service @@ -20,7 +21,8 @@ @wraps(func) def wrapper(*args, **kwargs): if not _has_valid_api_t...
b5653ac28ac8358127943bd1f40c22dfd8a274f3
examples/list_people.py
examples/list_people.py
#! /usr/bin/python # See README.txt for information and build instructions. import addressbook_pb2 import sys # Iterates though all people in the AddressBook and prints info about them. def ListPeople(address_book): for person in address_book.person: print "Person ID:", person.id print " Name:", person.na...
#! /usr/bin/python # See README.txt for information and build instructions. import addressbook_pb2 import sys # Iterates though all people in the AddressBook and prints info about them. def ListPeople(address_book): for person in address_book.person: print "Person ID:", person.id print " Name:", person.na...
Make Python example output identical to C++ and Java by removing redundant spaces.
Make Python example output identical to C++ and Java by removing redundant spaces.
Python
bsd-3-clause
malthe/google-protobuf,malthe/google-protobuf,malthe/google-protobuf,malthe/google-protobuf,malthe/google-protobuf
--- +++ @@ -15,11 +15,11 @@ for phone_number in person.phone: if phone_number.type == addressbook_pb2.Person.MOBILE: - print " Mobile phone #: ", + print " Mobile phone #:", elif phone_number.type == addressbook_pb2.Person.HOME: - print " Home phone #: ", + print " ...
8de8da05bb9461aaa48d3058f5b1e2caab6191f1
openmath/xml.py
openmath/xml.py
from . import openmath as om openmath_ns = "http://www.openmath.org/OpenMath" omtags = { "OMOBJ": om.OMObject, "OMR": om.OMReference, "OMI": om.OMInteger, "OMF": om.OMFloat, "OMSTR": om.OMString, "OMB": om.OMBytes, "OMS": om.OMSymbol, "OMV": om.OMVariable, "OMFOREIGN": om.OMForeign...
from . import openmath as om openmath_ns = "http://www.openmath.org/OpenMath" omtags = { "OMOBJ": om.OMObject, "OMR": om.OMReference, "OMI": om.OMInteger, "OMF": om.OMFloat, "OMSTR": om.OMString, "OMB": om.OMBytes, "OMS": om.OMSymbol, "OMV": om.OMVariable, "OMFOREIGN": om.OMForeign...
Use dict() syntax that works in Python 2.6 onward
Use dict() syntax that works in Python 2.6 onward
Python
mit
OpenMath/py-openmath
--- +++ @@ -19,7 +19,8 @@ "OMBVAR": om.OMBindVariables, "OME": om.OMError } -inv_omtags = {(v,k) for k,v in omtags.items()} + +inv_omtags = dict((v,k) for k,v in omtags.items()) def tag_to_object(tag, ns=True): if ns and not tag.startswith('{%s}' % openmath_ns):
ab4ae040895c50da6cb0827f6461d1733c7fe30a
tests/test_plugin_states.py
tests/test_plugin_states.py
from contextlib import contextmanager from os import path from unittest import TestCase from canaryd_packages import six from dictdiffer import diff from jsontest import JsonTest from mock import patch from canaryd.plugin import get_plugin_by_name @six.add_metaclass(JsonTest) class TestPluginStates(TestCase): j...
from contextlib import contextmanager from os import path from unittest import TestCase from dictdiffer import diff from jsontest import JsonTest from mock import patch from canaryd_packages import six from canaryd.plugin import get_plugin_by_name class TestPluginRealStates(TestCase): def run_plugin(self, plug...
Add real plugin state tests for plugins that always work (meta, containers, services).
Add real plugin state tests for plugins that always work (meta, containers, services).
Python
mit
Oxygem/canaryd,Oxygem/canaryd
--- +++ @@ -2,12 +2,28 @@ from os import path from unittest import TestCase -from canaryd_packages import six from dictdiffer import diff from jsontest import JsonTest from mock import patch +from canaryd_packages import six + from canaryd.plugin import get_plugin_by_name + + +class TestPluginRealStates(Tes...
94a91f128b046a818acb873579c8aadd41aa5c3a
test/streamparse/cli/test_sparse.py
test/streamparse/cli/test_sparse.py
from __future__ import absolute_import, unicode_literals import argparse import unittest from streamparse.cli import sparse from nose.tools import ok_ class SparseTestCase(unittest.TestCase): def test_load_subparsers(self): parser = argparse.ArgumentParser() subparsers = parser.add_subparsers(...
from __future__ import absolute_import, unicode_literals import argparse import unittest from streamparse.cli import sparse from nose.tools import ok_ class SparseTestCase(unittest.TestCase): def test_load_subparsers(self): parser = argparse.ArgumentParser() subparsers = parser.add_subparsers(...
Fix remaining load_suparsers typo instance
Fix remaining load_suparsers typo instance
Python
apache-2.0
msmakhlouf/streamparse,codywilbourn/streamparse,petchat/streamparse,petchat/streamparse,Parsely/streamparse,msmakhlouf/streamparse,petchat/streamparse,petchat/streamparse,msmakhlouf/streamparse,msmakhlouf/streamparse,codywilbourn/streamparse,eric7j/streamparse,petchat/streamparse,crohling/streamparse,hodgesds/streampar...
--- +++ @@ -13,7 +13,7 @@ def test_load_subparsers(self): parser = argparse.ArgumentParser() subparsers = parser.add_subparsers() - sparse.load_suparsers(subparsers) + sparse.load_subparsers(subparsers) # grab subcommands from subparsers subcommands = parser._opt...
26dcd1ce43864de77c1cd26065c09cc2b4c4788e
tests/fuzzer/test_random_content.py
tests/fuzzer/test_random_content.py
# Copyright (c) 2016 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. # This file may not be copied, modified, or distributed except # according to those terms. import pytest import fuzzinator @pytest.mark.parametrize('fuzzer_kwa...
# Copyright (c) 2016-2021 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. # This file may not be copied, modified, or distributed except # according to those terms. import pytest import fuzzinator @pytest.mark.parametrize('fuzze...
Make use of chained comparisons
Make use of chained comparisons
Python
bsd-3-clause
akosthekiss/fuzzinator,akosthekiss/fuzzinator,akosthekiss/fuzzinator,renatahodovan/fuzzinator,renatahodovan/fuzzinator,renatahodovan/fuzzinator,akosthekiss/fuzzinator,renatahodovan/fuzzinator
--- +++ @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Renata Hodovan, Akos Kiss. +# Copyright (c) 2016-2021 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. @@ -19,4 +19,4 @@ for index in range(100): out = fuzzinator.fuzze...
c79cedf826a3b6ee89e6186954185ef3217dd901
tomviz/python/InvertData.py
tomviz/python/InvertData.py
import tomviz.operators NUMBER_OF_CHUNKS = 10 class InvertOperator(tomviz.operators.CancelableOperator): def transform_scalars(self, dataset): from tomviz import utils import numpy as np self.progress.maximum = NUMBER_OF_CHUNKS scalars = utils.get_scalars(dataset) if sca...
import tomviz.operators NUMBER_OF_CHUNKS = 10 class InvertOperator(tomviz.operators.CancelableOperator): def transform_scalars(self, dataset): from tomviz import utils import numpy as np self.progress.maximum = NUMBER_OF_CHUNKS scalars = utils.get_scalars(dataset) if sca...
Add the minimum scalar value to the result of the InvertOperator
Add the minimum scalar value to the result of the InvertOperator Without it, all results would be shifted so the minimum was 0.
Python
bsd-3-clause
OpenChemistry/tomviz,mathturtle/tomviz,OpenChemistry/tomviz,mathturtle/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,mathturtle/tomviz
--- +++ @@ -15,12 +15,13 @@ raise RuntimeError("No scalars found!") result = np.float32(scalars) + min = np.amin(scalars) max = np.amax(scalars) step = 0 for chunk in np.array_split(result, NUMBER_OF_CHUNKS): if self.canceled: ret...
47053a42b9053755aad052159dac845b34195297
config/test/__init__.py
config/test/__init__.py
from SCons.Script import * def run_tests(env): import shlex import subprocess import sys cmd = shlex.split(env.get('TEST_COMMAND')) print('Executing:', cmd) sys.exit(subprocess.call(cmd)) def generate(env): import os import distutils.spawn python = distutils.spawn.find_executab...
from SCons.Script import * import inspect def run_tests(env): import shlex import subprocess import sys cmd = shlex.split(env.get('TEST_COMMAND')) print('Executing:', cmd) sys.exit(subprocess.call(cmd)) def generate(env): import os import distutils.spawn python = distutils.spaw...
Use common testHarness in derived projects
Use common testHarness in derived projects
Python
lgpl-2.1
CauldronDevelopmentLLC/cbang,CauldronDevelopmentLLC/cbang,CauldronDevelopmentLLC/cbang,CauldronDevelopmentLLC/cbang
--- +++ @@ -1,4 +1,5 @@ from SCons.Script import * +import inspect def run_tests(env): @@ -21,8 +22,11 @@ if not python: python = 'python' if env['PLATFORM'] == 'win32': python = python.replace('\\', '\\\\') - cmd = python + ' tests/testHarness -C tests --diff-failed --view-failed ' \ - '-...
37831f549eddc014ab89cc7dba3616a133c774a2
api/BucketListAPI.py
api/BucketListAPI.py
from flask import Flask, jsonify from modals.modals import User, Bucket, Item from api.__init__ import app, db @app.errorhandler(404) def page_not_found(e): response = jsonify({'error': 'The request can not be completed'}) response.status_code = 404 return response if __name__ == '__main__': app.run...
from flask import Flask, jsonify from modals.modals import User, Bucket, Item from api.__init__ import create_app, db app = create_app('DevelopmentEnv') @app.errorhandler(404) def page_not_found(e): response = jsonify({'error': 'The request can not be completed'}) response.status_code = 404 return respon...
Add create_app method to __init__.py
Add create_app method to __init__.py
Python
mit
patlub/BucketListAPI,patlub/BucketListAPI
--- +++ @@ -1,6 +1,8 @@ from flask import Flask, jsonify from modals.modals import User, Bucket, Item -from api.__init__ import app, db +from api.__init__ import create_app, db + +app = create_app('DevelopmentEnv') @app.errorhandler(404)
ffa8f79fe15621081acbb220a2a4dfd3d4d6d500
galton/utils/logger.py
galton/utils/logger.py
# -*- coding: utf-8 -*- import os import os.path as op import yaml import logging.config from .text_files import read from ..config import LOG_LEVEL MODULE_NAME = __name__.split('.')[0] def setup_logging(log_config_file=op.join(op.dirname(__file__), 'logger.yml'), log_default_level=LOG_LEVEL, ...
# -*- coding: utf-8 -*- import os import os.path as op import yaml import logging.config from .text_files import read from ..config import LOG_LEVEL MODULE_NAME = __name__.split('.')[0] def setup_logging(log_config_file=op.join(op.dirname(__file__), 'logger.yml'), log_default_level=LOG_LEVEL, ...
Correct env_key input argument default value
Correct env_key input argument default value
Python
bsd-3-clause
Neurita/galton
--- +++ @@ -12,7 +12,7 @@ def setup_logging(log_config_file=op.join(op.dirname(__file__), 'logger.yml'), log_default_level=LOG_LEVEL, - env_key=MODULE_NAME + '_LOG_CFG'): + env_key=MODULE_NAME.upper() + '_LOG_CFG'): """Setup logging configuration.""" p...
554572f327e4b9c920f65b416bfc6a3a5b549846
numba/tests/npyufunc/test_parallel_env_variable.py
numba/tests/npyufunc/test_parallel_env_variable.py
from numba.np.ufunc.parallel import get_thread_count from os import environ as env from numba.core import config import unittest class TestParallelEnvVariable(unittest.TestCase): """ Tests environment variables related to the underlying "parallel" functions for npyufuncs. """ _numba_parallel_test...
from numba.np.ufunc.parallel import get_thread_count from os import environ as env from numba.core import config import unittest class TestParallelEnvVariable(unittest.TestCase): """ Tests environment variables related to the underlying "parallel" functions for npyufuncs. """ _numba_parallel_test...
Reset the num threads to the env variable, not the default
Reset the num threads to the env variable, not the default
Python
bsd-2-clause
numba/numba,stonebig/numba,cpcloud/numba,gmarkall/numba,sklam/numba,stuartarchibald/numba,seibert/numba,seibert/numba,cpcloud/numba,numba/numba,sklam/numba,IntelLabs/numba,stuartarchibald/numba,IntelLabs/numba,IntelLabs/numba,gmarkall/numba,cpcloud/numba,seibert/numba,stuartarchibald/numba,numba/numba,sklam/numba,seibe...
--- +++ @@ -17,7 +17,7 @@ Tests the NUMBA_NUM_THREADS env variable behaves as expected. """ key = 'NUMBA_NUM_THREADS' - current = str(getattr(env, key, config.NUMBA_DEFAULT_NUM_THREADS)) + current = str(getattr(env, key, config.NUMBA_NUM_THREADS)) threads = "3154" ...
4b5dd61607c9692bb330f89545d5f76d7a1ed221
puzzle/feeds.py
puzzle/feeds.py
""" Generate an RSS feed of published crosswords from staff users. Uses the built-in feed framework. There's no attempt to send the actual crossword, it's just a message indicating that a new one is available. """ from django.contrib.syndication.views import Feed from django.urls import reverse from django.utils impo...
""" Generate an RSS feed of published crosswords from staff users. Uses the built-in feed framework. There's no attempt to send the actual crossword, it's just a message indicating that a new one is available. """ from django.contrib.syndication.views import Feed from django.urls import reverse from django.utils impo...
Fix linkage in the RSS feed
Fix linkage in the RSS feed
Python
mit
jomoore/threepins,jomoore/threepins,jomoore/threepins
--- +++ @@ -29,7 +29,7 @@ return 'Crossword #' + str(item.number) + ' is now available.' def item_link(self, item): - return reverse('puzzle', args=[item.number]) + return reverse('puzzle', kwargs={'author': item.user.username, 'number': item.number}) def item_pubdate(self, item):...
a0ceb84519d1bf735979b3afdfdb8b17621d308b
froide/problem/admin.py
froide/problem/admin.py
from django.contrib import admin from django.utils.html import format_html from django.urls import reverse from django.utils.translation import gettext_lazy as _ from froide.helper.admin_utils import make_nullfilter from .models import ProblemReport class ProblemReportAdmin(admin.ModelAdmin): date_hierarchy = '...
from django.contrib import admin from django.utils.html import format_html from django.urls import reverse from django.utils.translation import gettext_lazy as _ from froide.helper.admin_utils import make_nullfilter from .models import ProblemReport class ProblemReportAdmin(admin.ModelAdmin): date_hierarchy = '...
Fix overwriting resolution with empty text
Fix overwriting resolution with empty text
Python
mit
stefanw/froide,stefanw/froide,stefanw/froide,fin/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide,fin/froide
--- +++ @@ -35,7 +35,7 @@ super().save_model(request, obj, form, change) if 'resolved' in form.changed_data and obj.resolved: - sent = obj.resolve(request.user) + sent = obj.resolve(request.user, resolution=obj.resolution) if sent: self.message_u...
1171ade137c54c778a284ef32fdbdcd9e5c1d828
runcommands/runners/result.py
runcommands/runners/result.py
from ..util import cached_property class Result: def __init__(self, return_code, stdout_data, stderr_data, encoding): self.return_code = return_code self.stdout_data = stdout_data self.stderr_data = stderr_data self.encoding = encoding self.succeeded = self.return_code == ...
from ..util import cached_property class Result: def __init__(self, return_code, stdout_data, stderr_data, encoding): self.return_code = return_code self.stdout_data = stdout_data self.stderr_data = stderr_data self.encoding = encoding self.succeeded = self.return_code == ...
Add __repr__() and __str__() to Result
Add __repr__() and __str__() to Result
Python
mit
wylee/runcommands,wylee/runcommands
--- +++ @@ -39,3 +39,9 @@ def __bool__(self): return self.succeeded + + def __str__(self): + return self.stdout + + def __repr__(self): + return repr(self.stdout)
ed45c8201977aecde226b2e9b060820a8fd677c3
test/functional/rpc_deprecated.py
test/functional/rpc_deprecated.py
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test deprecation of RPC calls.""" from test_framework.test_framework import BitcoinTestFramework from test_f...
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test deprecation of RPC calls.""" from test_framework.test_framework import BitcoinTestFramework class Depr...
Remove test for deprecated createmultsig option
[tests] Remove test for deprecated createmultsig option
Python
mit
guncoin/guncoin,AkioNak/bitcoin,tjps/bitcoin,myriadteam/myriadcoin,tjps/bitcoin,tecnovert/particl-core,vmp32k/litecoin,jamesob/bitcoin,achow101/bitcoin,jtimon/bitcoin,particl/particl-core,DigitalPandacoin/pandacoin,MarcoFalke/bitcoin,kazcw/bitcoin,cdecker/bitcoin,andreaskern/bitcoin,paveljanik/bitcoin,Kogser/bitcoin,an...
--- +++ @@ -4,18 +4,24 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test deprecation of RPC calls.""" from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_raises_rpc_error class DeprecatedRpcTest(BitcoinTestFramework): def set...
09c3b752154478b15a45d11f08d46a5003f174ec
giveaminute/keywords.py
giveaminute/keywords.py
""" :copyright: (c) 2011 Local Projects, all rights reserved :license: Affero GNU GPL v3, see LICENSE for more details. """ from framework.controller import log # find keywords in a string def getKeywords(db, s): """Get all matches for passed in string in keyword tables :param db: database handle ...
""" :copyright: (c) 2011 Local Projects, all rights reserved :license: Affero GNU GPL v3, see LICENSE for more details. """ # find keywords in a string def getKeywords(db, s): sql = "select keyword from keyword" data = list(db.query(sql)) words = [] for d in data: if (d.keywor...
Revert keyword optimization for current release
Revert keyword optimization for current release
Python
agpl-3.0
codeforeurope/Change-By-Us,watchcat/cbu-rotterdam,codeforeurope/Change-By-Us,codeforeurope/Change-By-Us,codeforeurope/Change-By-Us,watchcat/cbu-rotterdam,localprojects/Change-By-Us,watchcat/cbu-rotterdam,watchcat/cbu-rotterdam,watchcat/cbu-rotterdam,localprojects/Change-By-Us,localprojects/Change-By-Us,localprojects/Ch...
--- +++ @@ -2,21 +2,16 @@ :copyright: (c) 2011 Local Projects, all rights reserved :license: Affero GNU GPL v3, see LICENSE for more details. """ -from framework.controller import log # find keywords in a string def getKeywords(db, s): - """Get all matches for passed in string in keyword tables + ...
d7001ccab0879e17308bf2dc945b5fd3b726be27
statblock/dice.py
statblock/dice.py
from random import random class Die: """ Abstracts the random dice throw. Roll will produce the result. The die can be further parametrized by a multiplicator and/or a modifier, like 2 * Die(8) +4. """ def __init__(self, number, multiplicator=1, modifier=0): self.number = number ...
from random import random class Die: """ Abstracts the random dice throw. Roll will produce the result. The die can be further parametrized by a multiplicator and/or a modifier, like 2 * Die(8) +4. """ def __init__(self, number, multiplicator=1, modifier=0): self.number = number ...
Write the critical multiplier or the range when the damage gets converted into a String
Write the critical multiplier or the range when the damage gets converted into a String
Python
mit
bkittelmann/statblock
--- +++ @@ -33,7 +33,10 @@ return cls.__new__() def __repr__(self): - return "%sd%s+%s" % (self.multiplicator, self.number, self.modifier) + base = "%sd%s" % (self.multiplicator, self.number) + if self.modifier > 0: + return base + ("+%s" % self.modifier) + r...
95f7c6cba7c4077053899e3ca01c8ffd3172873c
grouprise/core/views.py
grouprise/core/views.py
import json import django from rules.contrib.views import PermissionRequiredMixin class PermissionMixin(PermissionRequiredMixin): @property def raise_exception(self): return self.request.user.is_authenticated class AppConfig: def __init__(self): self._settings = {} self._defaul...
import json import django from django_filters.views import FilterMixin from rules.contrib.views import PermissionRequiredMixin class PermissionMixin(PermissionRequiredMixin): @property def raise_exception(self): return self.request.user.is_authenticated class TemplateFilterMixin(FilterMixin): ...
Add view mixin for working with filters in templates
Add view mixin for working with filters in templates
Python
agpl-3.0
stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten
--- +++ @@ -1,6 +1,7 @@ import json import django +from django_filters.views import FilterMixin from rules.contrib.views import PermissionRequiredMixin @@ -9,6 +10,19 @@ @property def raise_exception(self): return self.request.user.is_authenticated + + +class TemplateFilterMixin(FilterMixi...
a789e8bf574973259c0461b99fb9a486abed6e23
systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py
systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py
from pprint import pprint from netaddr import * def merge(dbag, ip): added = False for dev in dbag: if dev == "id": continue for address in dbag[dev]: if address['public_ip'] == ip['public_ip']: dbag[dev].remove(address) if ip['add']: ipo = IPNet...
from pprint import pprint from netaddr import * def merge(dbag, ip): added = False for dev in dbag: if dev == "id": continue for address in dbag[dev]: if address['public_ip'] == ip['public_ip']: dbag[dev].remove(address) if ip['add']: ipo = IPNet...
Fix a bug that would add updated control ip address instead of replace
Fix a bug that would add updated control ip address instead of replace
Python
apache-2.0
jcshen007/cloudstack,resmo/cloudstack,resmo/cloudstack,GabrielBrascher/cloudstack,resmo/cloudstack,jcshen007/cloudstack,jcshen007/cloudstack,jcshen007/cloudstack,GabrielBrascher/cloudstack,resmo/cloudstack,GabrielBrascher/cloudstack,GabrielBrascher/cloudstack,wido/cloudstack,resmo/cloudstack,DaanHoogland/cloudstack,Gab...
--- +++ @@ -16,5 +16,8 @@ ip['network'] = str(ipo.network) + '/' + str(ipo.prefixlen) if 'nw_type' not in ip.keys(): ip['nw_type'] = 'public' - dbag.setdefault('eth' + str(ip['nic_dev_id']), []).append( ip ) + if ip['nw_type'] == 'control': + dbag['eth' + str(ip['nic_...
67ebe8da58384529c49673e2314d4fc228aebe9e
python/testData/inspections/PyPackageRequirementsInspection/ImportsNotInRequirementsTxt/test1.py
python/testData/inspections/PyPackageRequirementsInspection/ImportsNotInRequirementsTxt/test1.py
import pip import <weak_warning descr="Package 'opster' is not listed in project requirements">opster</weak_warning> from <weak_warning descr="Package 'clevercss' is not listed in project requirements">clevercss</weak_warning> import convert import <weak_warning descr="Package 'django' is not listed in project requirem...
import pip import <weak_warning descr="Package containing module 'opster' is not listed in project requirements">opster</weak_warning> from <weak_warning descr="Package containing module 'clevercss' is not listed in project requirements">clevercss</weak_warning> import convert import <weak_warning descr="Package contai...
Fix test data for PyPackageRequirementsInspectionTest.testImportsNotInRequirementsTxt.
Fix test data for PyPackageRequirementsInspectionTest.testImportsNotInRequirementsTxt.
Python
apache-2.0
apixandru/intellij-community,da1z/intellij-community,mglukhikh/intellij-community,allotria/intellij-community,ibinti/intellij-community,suncycheng/intellij-community,apixandru/intellij-community,da1z/intellij-community,ibinti/intellij-community,vvv1559/intellij-community,ibinti/intellij-community,ThiagoGarciaAlves/inte...
--- +++ @@ -1,9 +1,9 @@ import pip -import <weak_warning descr="Package 'opster' is not listed in project requirements">opster</weak_warning> -from <weak_warning descr="Package 'clevercss' is not listed in project requirements">clevercss</weak_warning> import convert -import <weak_warning descr="Package 'django' is ...
ed91a6832d459dffa18d1b2d7b827b6aa6da2627
src/sentry/api/endpoints/team_project_index.py
src/sentry/api/endpoints/team_project_index.py
from __future__ import absolute_import from rest_framework import serializers, status from rest_framework.response import Response from sentry.api.bases.team import TeamEndpoint from sentry.api.permissions import assert_perm from sentry.api.serializers import serialize from sentry.constants import MEMBER_ADMIN from s...
from __future__ import absolute_import from rest_framework import serializers, status from rest_framework.response import Response from sentry.api.base import DocSection from sentry.api.bases.team import TeamEndpoint from sentry.api.permissions import assert_perm from sentry.api.serializers import serialize from sent...
Add team project list to docs
Add team project list to docs
Python
bsd-3-clause
BuildingLink/sentry,JamesMura/sentry,mvaled/sentry,beeftornado/sentry,JamesMura/sentry,ngonzalvez/sentry,Kryz/sentry,fuziontech/sentry,nicholasserra/sentry,TedaLIEz/sentry,JackDanger/sentry,songyi199111/sentry,BayanGroup/sentry,songyi199111/sentry,1tush/sentry,kevinlondon/sentry,gg7/sentry,jokey2k/sentry,Natim/sentry,v...
--- +++ @@ -3,6 +3,7 @@ from rest_framework import serializers, status from rest_framework.response import Response +from sentry.api.base import DocSection from sentry.api.bases.team import TeamEndpoint from sentry.api.permissions import assert_perm from sentry.api.serializers import serialize @@ -18,7 +19,17 ...
b04f3bd19b508140b0b4feee46d590b61da46bed
swift/__init__.py
swift/__init__.py
import gettext class Version(object): def __init__(self, canonical_version, final): self.canonical_version = canonical_version self.final = final @property def pretty_version(self): if self.final: return self.canonical_version else: return '%s-dev' ...
import gettext class Version(object): def __init__(self, canonical_version, final): self.canonical_version = canonical_version self.final = final @property def pretty_version(self): if self.final: return self.canonical_version else: return '%s-dev' ...
Switch Swift trunk to 1.4.1, now that the 1.4.0 release branch is branched out.
Switch Swift trunk to 1.4.1, now that the 1.4.0 release branch is branched out.
Python
apache-2.0
mja054/swift_plugin,iostackproject/IO-Bandwidth-Differentiation,williamthegrey/swift,openstack/swift,notmyname/swift,matthewoliver/swift,orion/swift-config,thiagodasilva/swift,zackmdavis/swift,smerritt/swift,bkolli/swift,Em-Pan/swift,Khushbu27/Tutorial,openstack/swift,larsbutler/swift,aerwin3/swift,redhat-openstack/swi...
--- +++ @@ -14,7 +14,7 @@ return '%s-dev' % (self.canonical_version,) -_version = Version('1.4.0', False) +_version = Version('1.4.1', False) __version__ = _version.pretty_version __canonical_version__ = _version.canonical_version