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 |
|---|---|---|---|---|---|---|---|---|---|---|
562a0868b3648e3ba40c29289ba7f4ebd4c75800 | pyinfra/api/__init__.py | pyinfra/api/__init__.py | # pyinfra
# File: pyinfra/api/__init__.py
# Desc: import some stuff
from .config import Config # noqa: F401
from .deploy import deploy # noqa: F401
from .exceptions import ( # noqa: F401
DeployError,
InventoryError,
OperationError,
)
from .facts import FactBase # noqa: F401
from .inventory import Inven... | # pyinfra
# File: pyinfra/api/__init__.py
# Desc: import some stuff
from .config import Config # noqa: F401
from .deploy import deploy # noqa: F401
from .exceptions import ( # noqa: F401
DeployError,
InventoryError,
OperationError,
)
from .facts import FactBase, ShortFactBase # noqa: F401
from .invento... | Add `ShortFactBase` import to `pyinfra.api`. | Add `ShortFactBase` import to `pyinfra.api`.
| Python | mit | Fizzadar/pyinfra,Fizzadar/pyinfra | ---
+++
@@ -9,7 +9,7 @@
InventoryError,
OperationError,
)
-from .facts import FactBase # noqa: F401
+from .facts import FactBase, ShortFactBase # noqa: F401
from .inventory import Inventory # noqa: F401
from .operation import operation # noqa: F401
from .state import State # noqa: F401 |
eebb025f4466a5c26bc99f9a1f24a5f14ca14387 | pycom/tests/test_logging_dict_config.py | pycom/tests/test_logging_dict_config.py | # encoding: utf-8
import unittest
from pycom.logging_dict_config import get_config
class LoggingTests(unittest.TestCase):
def test_get_config_project(self):
config = get_config("project")
left = "/var/log/project/project.log"
right = config["handlers"]["file"]["filename"]
self.as... | Add the test of `logging_dict_config`. | Add the test of `logging_dict_config`.
| Python | mit | xgfone/xutils,xgfone/pycom | ---
+++
@@ -0,0 +1,22 @@
+# encoding: utf-8
+
+import unittest
+from pycom.logging_dict_config import get_config
+
+
+class LoggingTests(unittest.TestCase):
+
+ def test_get_config_project(self):
+ config = get_config("project")
+ left = "/var/log/project/project.log"
+ right = config["handler... | |
6854f128461c5e94e90e12183ab91c4cc4a8724b | tools/grit/grit/extern/FP.py | tools/grit/grit/extern/FP.py | #!/usr/bin/python2.2
# Copyright (c) 2006-2008 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.
import md5
"""64-bit fingerprint support for strings.
Usage:
from extern import FP
print 'Fingerprint is %ld' % FP.Fi... | #!/usr/bin/python
# Copyright (c) 2006-2008 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.
import md5
"""64-bit fingerprint support for strings.
Usage:
from extern import FP
print 'Fingerprint is %ld' % FP.Finge... | Remove version number from Python shebang. | Remove version number from Python shebang.
On special request from someone trying to purge python2.2 from code indexed
internally at Google.
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@7071 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | hgl888/chromium-crosswalk,zcbenz/cefode-chromium,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,keishi/chromium,nacl-webkit/chrome_deps,dednal/chromium.src,ondra-novak/chromium.src,robclark/chromiu... | ---
+++
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.2
+#!/usr/bin/python
# Copyright (c) 2006-2008 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. |
be1199ac1f6c086c17c4c39d54ca1e160d0508cf | test/win/gyptest-link-pdb.py | test/win/gyptest-link-pdb.py | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that the 'Profile' attribute in VCLinker is extracted properly.
"""
import TestGyp
import os
import sys
if sys.platform == ... | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that the 'Profile' attribute in VCLinker is extracted properly.
"""
import TestGyp
import os
import sys
if sys.platform == ... | Insert empty line at to fix patch. | Insert empty line at to fix patch.
gyptest-link-pdb.py was checked in without a blank line. This appears
to cause a patch issue with the try bots. This CL is only a whitespace
change to attempt to fix that problem.
SEE:
patching file test/win/gyptest-link-pdb.py
Hunk #1 FAILED at 26.
1 out of 1 hunk FAILED -- savin... | Python | bsd-3-clause | csulmone/gyp,csulmone/gyp,csulmone/gyp,csulmone/gyp | |
663a61362c30b737f2532de42b5b680795ccf608 | quran_text/models.py | quran_text/models.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.db import models
class Sura(models.Model):
"""
Model to hold the Quran Chapters "Sura"
"""
index = models.PositiveIntegerField(primary_key=True)
name = models.CharFie... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.db import models
class Sura(models.Model):
"""
Model to hold the Quran Chapters "Sura"
"""
index = models.PositiveIntegerField(primary_key=True)
name = models.CharFie... | Add ordering to Ayah model | Add ordering to Ayah model
| Python | mit | EmadMokhtar/tafseer_api | ---
+++
@@ -31,3 +31,4 @@
class Meta:
unique_together = ['number', 'sura']
+ ordering = ['sura', 'number'] |
ddabef55b9dde75af422d4dedb2d5578d7019905 | tests/test_authentication.py | tests/test_authentication.py | import unittest
from flask import json
from api import db
from api.BucketListAPI import app
from instance.config import application_config
class AuthenticationTestCase(unittest.TestCase):
def setUp(self):
app.config.from_object(application_config['TestingEnv'])
self.client = app.test_client()
... | import unittest
from flask import json
from api import db
from api.BucketListAPI import app
from instance.config import application_config
class AuthenticationTestCase(unittest.TestCase):
def setUp(self):
app.config.from_object(application_config['TestingEnv'])
self.client = app.test_client()
... | Add test for invalid email | Add test for invalid email
| Python | mit | patlub/BucketListAPI,patlub/BucketListAPI | ---
+++
@@ -31,6 +31,17 @@
self.assertEqual(response.status_code, 400)
self.assertIn('Missing', response.data.decode())
+ def test_registration_with_invalid_email(self):
+ """Should return invalid email"""
+ user = json.dumps({
+ 'name': 'Patrick',
+ 'email':... |
adcba0285ef700738a63986c7657bd9e5ac85d85 | wikipendium/user/forms.py | wikipendium/user/forms.py | from django.forms import Form, CharField, ValidationError
from django.contrib.auth.models import User
class UserChangeForm(Form):
username = CharField(max_length=30, label='New username')
def clean(self):
cleaned_data = super(UserChangeForm, self).clean()
if User.objects.filter(username=clea... | from django.forms import Form, CharField, EmailField, ValidationError
from django.contrib.auth.models import User
class UserChangeForm(Form):
username = CharField(max_length=30, label='New username')
def clean(self):
cleaned_data = super(UserChangeForm, self).clean()
if User.objects.filter(u... | Use EmailField for email validation | Use EmailField for email validation
| Python | apache-2.0 | stianjensen/wikipendium.no,stianjensen/wikipendium.no,stianjensen/wikipendium.no | ---
+++
@@ -1,4 +1,4 @@
-from django.forms import Form, CharField, ValidationError
+from django.forms import Form, CharField, EmailField, ValidationError
from django.contrib.auth.models import User
@@ -15,4 +15,4 @@
class EmailChangeForm(Form):
- email = CharField(max_length=75, label='New email')
+ e... |
945baec1540ff72b85b3d0563511d93cb33d660e | nbgrader/tests/formgrader/fakeuser.py | nbgrader/tests/formgrader/fakeuser.py | import os
from jupyterhub.auth import LocalAuthenticator
from jupyterhub.spawner import LocalProcessSpawner
from tornado import gen
class FakeUserAuth(LocalAuthenticator):
"""Authenticate fake users"""
@gen.coroutine
def authenticate(self, handler, data):
"""If the user is on the whitelist, authe... | import os
from jupyterhub.auth import LocalAuthenticator
from jupyterhub.spawner import LocalProcessSpawner
from tornado import gen
class FakeUserAuth(LocalAuthenticator):
"""Authenticate fake users"""
@gen.coroutine
def authenticate(self, handler, data):
"""If the user is on the whitelist, authe... | Remove os.setpgrp() from fake spawner | Remove os.setpgrp() from fake spawner
| Python | bsd-3-clause | jhamrick/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,ellisonbg/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,jhamrick/nbgrader,jupyter/nbgrader | ---
+++
@@ -34,8 +34,6 @@
def make_preexec_fn(self, name):
home = os.getcwd()
def preexec():
- # don't forward signals
- os.setpgrp()
# start in the cwd
os.chdir(home)
return preexec |
1bbf986cbde2d0ec8add3ac845cb10fcd061e46d | nodeconductor/server/test_settings.py | nodeconductor/server/test_settings.py | # Django test settings for nodeconductor project.
from nodeconductor.server.doc_settings import *
INSTALLED_APPS += (
'nodeconductor.quotas.tests',
'nodeconductor.structure.tests',
)
ROOT_URLCONF = 'nodeconductor.structure.tests.urls'
| # Django test settings for nodeconductor project.
from nodeconductor.server.doc_settings import *
INSTALLED_APPS += (
'nodeconductor.quotas.tests',
'nodeconductor.structure.tests',
)
ROOT_URLCONF = 'nodeconductor.structure.tests.urls'
# XXX: This option should be removed after itacloud assembly creation.
NO... | Add "IS_ITACLOUD" flag to settings | Add "IS_ITACLOUD" flag to settings
- itacloud-7125
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | ---
+++
@@ -7,3 +7,7 @@
)
ROOT_URLCONF = 'nodeconductor.structure.tests.urls'
+
+
+# XXX: This option should be removed after itacloud assembly creation.
+NODECONDUCTOR['IS_ITACLOUD'] = True |
cdfd622f4e7017ab1860e1f7420d6f26424a69f1 | dashboard_app/extension.py | dashboard_app/extension.py | from lava_server.extension import LavaServerExtension
class DashboardExtension(LavaServerExtension):
@property
def app_name(self):
return "dashboard_app"
@property
def name(self):
return "Dashboard"
@property
def main_view_name(self):
return "dashboard_app.views.bund... | from lava_server.extension import LavaServerExtension
class DashboardExtension(LavaServerExtension):
@property
def app_name(self):
return "dashboard_app"
@property
def name(self):
return "Dashboard"
@property
def main_view_name(self):
return "dashboard_app.views.bund... | Move support for dataview-specific database from lava-server | Move support for dataview-specific database from lava-server
| Python | agpl-3.0 | Linaro/lava-server,Linaro/lava-server,Linaro/lava-server,OSSystems/lava-server,OSSystems/lava-server,OSSystems/lava-server,Linaro/lava-server | ---
+++
@@ -25,19 +25,26 @@
import dashboard_app
return versiontools.format_version(dashboard_app.__version__)
- def contribute_to_settings(self, settings):
- super(DashboardExtension, self).contribute_to_settings(settings)
- settings['INSTALLED_APPS'].extend([
+ def contribut... |
419d2ca4d53e33c58d556b45bcc6910bd28ef91a | djangae/apps.py | djangae/apps.py | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class DjangaeConfig(AppConfig):
name = 'djangae'
verbose_name = _("Djangae")
def ready(self):
from .patches.contenttypes import patch
patch()
from djangae.db.backends.appengine.caching import... | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class DjangaeConfig(AppConfig):
name = 'djangae'
verbose_name = _("Djangae")
def ready(self):
from .patches.contenttypes import patch
patch()
from djangae.db.backends.appengine.caching import... | Make sure we only connect to the signals onces | Make sure we only connect to the signals onces
| Python | bsd-3-clause | kirberich/djangae,asendecka/djangae,asendecka/djangae,SiPiggles/djangae,wangjun/djangae,potatolondon/djangae,kirberich/djangae,SiPiggles/djangae,SiPiggles/djangae,leekchan/djangae,armirusco/djangae,chargrizzle/djangae,trik/djangae,grzes/djangae,armirusco/djangae,jscissr/djangae,trik/djangae,jscissr/djangae,wangjun/djan... | ---
+++
@@ -12,5 +12,5 @@
from djangae.db.backends.appengine.caching import reset_context
from django.core.signals import request_finished, request_started
- request_finished.connect(reset_context)
- request_started.connect(reset_context)
+ request_finished.connect(reset_conte... |
b7bd7a0412566509f55d0cadc422aa8cfc502975 | product_configurator_mrp/models/product.py | product_configurator_mrp/models/product.py | # -*- coding: utf-8 -*-
from openerp import models, api
class ProductTemplate(models.Model):
_inherit = 'product.template'
@api.multi
def create_variant(self, value_ids, custom_values=None):
"""Add bill of matrials to the configured variant."""
if custom_values is None:
custo... | # -*- coding: utf-8 -*-
from openerp import models, api
class ProductTemplate(models.Model):
_inherit = 'product.template'
@api.multi
def create_get_variant(self, value_ids, custom_values=None):
"""Add bill of matrials to the configured variant."""
if custom_values is None:
c... | Fix creation of BOM when create Variant | Fix creation of BOM when create Variant
| Python | agpl-3.0 | pledra/odoo-product-configurator,pledra/odoo-product-configurator,pledra/odoo-product-configurator | ---
+++
@@ -7,12 +7,12 @@
_inherit = 'product.template'
@api.multi
- def create_variant(self, value_ids, custom_values=None):
+ def create_get_variant(self, value_ids, custom_values=None):
"""Add bill of matrials to the configured variant."""
if custom_values is None:
... |
d81a68a46fbdc98f803c94a2123b48cca6f5da31 | tests/aqdb/test_rebuild.py | tests/aqdb/test_rebuild.py | #!/ms/dist/python/PROJ/core/2.5.4-0/bin/python
"""Test module for rebuilding the database."""
import os
import __init__
import aquilon.aqdb.depends
import nose
import unittest
from subprocess import Popen, PIPE
class TestRebuild(unittest.TestCase):
def testrebuild(self):
env = {}
for (key, valu... | #!/ms/dist/python/PROJ/core/2.5.4-0/bin/python
"""Test module for rebuilding the database."""
import os
import __init__
import aquilon.aqdb.depends
import nose
import unittest
from subprocess import Popen, PIPE
from aquilon.config import Config
class TestRebuild(unittest.TestCase):
def testrebuild(self):
... | Fix aqdb rebuild to work when not using AQDCONF env variable. | Fix aqdb rebuild to work when not using AQDCONF env variable.
| Python | apache-2.0 | guillaume-philippon/aquilon,quattor/aquilon,quattor/aquilon,stdweird/aquilon,stdweird/aquilon,guillaume-philippon/aquilon,quattor/aquilon,stdweird/aquilon,guillaume-philippon/aquilon | ---
+++
@@ -10,12 +10,15 @@
from subprocess import Popen, PIPE
+from aquilon.config import Config
+
class TestRebuild(unittest.TestCase):
def testrebuild(self):
env = {}
for (key, value) in os.environ.items():
env[key] = value
+ env["AQDCONF"] = Config().baseconfig
... |
2db81321de1c506d6b61d8851de9ad4794deba3e | lmj/sim/base.py | lmj/sim/base.py | # Copyright (c) 2013 Leif Johnson <leif@leifjohnson.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | # Copyright (c) 2013 Leif Johnson <leif@leifjohnson.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | Allow for World to handle key presses. | Allow for World to handle key presses.
| Python | mit | EmbodiedCognition/pagoda,EmbodiedCognition/pagoda | ---
+++
@@ -39,3 +39,7 @@
def step(self):
'''Advance the world simulation by one time step.'''
raise NotImplementedError
+
+ def on_key_press(self, key, keys):
+ '''Handle an otherwise-unhandled keypress event.'''
+ self.reset() |
df58b36b6f62c39030d6ff28c6fb67c11f112df0 | pyxrf/gui_module/main_window.py | pyxrf/gui_module/main_window.py | from PyQt5.QtWidgets import QMainWindow
_main_window_geometry = {
"initial_height": 800,
"initial_width": 1000,
"min_height": 400,
"min_width": 500,
}
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.initialize()
def initialize(self):
self... | from PyQt5.QtWidgets import QMainWindow
_main_window_geometry = {
"initial_height": 800,
"initial_width": 1000,
"min_height": 400,
"min_width": 500,
}
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.initialize()
def initialize(self):
self... | Test window title on Mac | Test window title on Mac
| Python | bsd-3-clause | NSLS-II-HXN/PyXRF,NSLS-II/PyXRF,NSLS-II-HXN/PyXRF | ---
+++
@@ -22,3 +22,5 @@
self.setMinimumWidth(_main_window_geometry["min_width"])
self.setMinimumHeight(_main_window_geometry["min_height"])
+
+ self.setWindowTitle("PyXRF window title") |
3005b947312c0219c6754e662496c876e46aafc4 | model/openacademy_session.py | model/openacademy_session.py | # -*- coding: utf-8 -*-
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
... | # -*- coding: utf-8 -*-
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
... | Add domain or and ilike | [REF] openacademy: Add domain or and ilike
| Python | apache-2.0 | luisll-vauxoo/openacademy | ---
+++
@@ -8,7 +8,9 @@
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
- instructor_id = fields.Many2one('res.partner', string="instructor")
+ instructor_id = fields.Many2one('res.partner', string="instru... |
7371244c00c94fdc552c5d146ab1a245b643427e | reeprotocol/ip.py | reeprotocol/ip.py | """IP Physical Layer
"""
from __future__ import absolute_import
import socket
from .protocol import PhysicalLayer
class Ip(PhysicalLayer):
"""IP Physical Layer"""
def __init__(self, addr):
"""Create an IP Physical Layer.
:addr tuple: Address tuple (host, port)
"""
self.addr = ... | """IP Physical Layer
"""
from __future__ import absolute_import
import socket
import queue
import threading
from .protocol import PhysicalLayer
class Ip(PhysicalLayer):
"""IP Physical Layer"""
def __init__(self, addr):
"""Create an IP Physical Layer.
:addr tuple: Address tuple (host, port)
... | Implement reading socket with threading | Implement reading socket with threading
| Python | agpl-3.0 | javierdelapuente/reeprotocol | ---
+++
@@ -2,6 +2,8 @@
"""
from __future__ import absolute_import
import socket
+import queue
+import threading
from .protocol import PhysicalLayer
@@ -14,24 +16,39 @@
"""
self.addr = addr
self.connection = None
+ self.connected = False
+ self.queue = queue.Queue()
+ ... |
e2b691810f9d9a33f054bf245f1429d6999338a6 | dataproperty/_interface.py | dataproperty/_interface.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import abc
import six
from ._function import is_nan
from ._typecode import Typecode
@six.add_metaclass(abc.ABCMeta)
class DataPeropertyInterface(object):
__slots__ = ()
@abc.abstractpr... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import abc
import six
from ._function import is_nan
from ._typecode import Typecode
@six.add_metaclass(abc.ABCMeta)
class DataPeropertyInterface(object):
__slots__ = ()
@abc.abstractpr... | Delete property from the interface class | Delete property from the interface class
| Python | mit | thombashi/DataProperty | ---
+++
@@ -28,16 +28,3 @@
@abc.abstractproperty
def typecode(self): # pragma: no cover
pass
-
- @property
- def format_str(self):
- if self.typecode == Typecode.INT:
- return "d"
-
- if self.typecode == Typecode.FLOAT:
- if is_nan(self.decimal_places):
-... |
367d8415773a44356ce604ecfc839117798f7d3a | tests/test_pytestplugin.py | tests/test_pytestplugin.py | from io import FileIO
from six import next
from pkg_resources import resource_filename, working_set
from wex.readable import EXT_WEXIN
from wex.output import EXT_WEXOUT
from wex import pytestplugin
def pytest_funcarg__parent(request):
return request.session
response = b"""HTTP/1.1 200 OK\r
Content-type: applicati... | from io import FileIO
from six import next
import pytest
from pkg_resources import resource_filename, working_set
from wex.readable import EXT_WEXIN
from wex.output import EXT_WEXOUT
from wex import pytestplugin
@pytest.fixture
def parent(request):
return request.session
response = b"""HTTP/1.1 200 OK\r
Content-t... | Replace funcarg with fixture for pytestplugin | Replace funcarg with fixture for pytestplugin
| Python | bsd-3-clause | gilessbrown/wextracto,eBay/wextracto,eBay/wextracto,gilessbrown/wextracto | ---
+++
@@ -1,11 +1,13 @@
from io import FileIO
from six import next
+import pytest
from pkg_resources import resource_filename, working_set
from wex.readable import EXT_WEXIN
from wex.output import EXT_WEXOUT
from wex import pytestplugin
-def pytest_funcarg__parent(request):
+@pytest.fixture
+def parent(requ... |
a0fbf7c19aeebbf1451beab74904ec872c01c9b4 | us_ignite/settings/production.py | us_ignite/settings/production.py | # Production settings for us_ignite
import os
from us_ignite.settings import *
# Sensitive values are saved as env variables:
env = os.getenv
PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__))
# settings is one directory up now
here = lambda *x: os.path.join(PROJECT_ROOT, '..', *x)
SITE_URL = 'http://us-igni... | # Production settings for us_ignite
import os
from us_ignite.settings import *
# Sensitive values are saved as env variables:
env = os.getenv
PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__))
# settings is one directory up now
here = lambda *x: os.path.join(PROJECT_ROOT, '..', *x)
SITE_URL = 'http://us-igni... | Update email username to use the right variable name. | Update email username to use the right variable name.
| Python | bsd-3-clause | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | ---
+++
@@ -23,11 +23,10 @@
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = env('EMAIL_HOST')
EMAIL_PORT = env('EMAIL_PORT')
-EMAIL_HOST_USER = env('EMAIL_HOST_USER')
+EMAIL_HOST_USER = env('HOST_USER')
EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD')
# Settings to use the filesystem
... |
26eaaffb872d7046be9417ae53302e59dbc7b808 | TrainingDataGenerator/Scripts/generateNumberImage.py | TrainingDataGenerator/Scripts/generateNumberImage.py | # -*- coding: utf-8 -*-
import threading
import os
import shutil
from PIL import Image, ImageDraw2, ImageDraw, ImageFont
import random
count = range(0, 200)
path = './generatedNumberImages'
text = '0123456789X'
def start():
if os.path.exists(path):
shutil.rmtree(path)
os.mkdir(path)
for idx in co... | # -*- coding: utf-8 -*-
import threading
import os
import shutil
from PIL import Image, ImageDraw2, ImageDraw, ImageFont, ImageEnhance
import random
count = range(0, 200)
path = './generatedNumberImages'
text = '0123456789X'
def start():
if os.path.exists(path):
shutil.rmtree(path)
os.mkdir(path)
... | Add Image Enhance for generated image. | Add Image Enhance for generated image.
| Python | apache-2.0 | KevinGong2013/ChineseIDCardOCR,KevinGong2013/ChineseIDCardOCR,KevinGong2013/ChineseIDCardOCR | ---
+++
@@ -2,7 +2,7 @@
import threading
import os
import shutil
-from PIL import Image, ImageDraw2, ImageDraw, ImageFont
+from PIL import Image, ImageDraw2, ImageDraw, ImageFont, ImageEnhance
import random
count = range(0, 200)
@@ -24,7 +24,13 @@
drawBrush = ImageDraw.Draw(o_image)
drawBrush.text((1... |
cb321e7cd20123209fbaca610b9511a166cb5c62 | dsub/_dsub_version.py | dsub/_dsub_version.py | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Update dsub version to 0.3.4 | Update dsub version to 0.3.4
PiperOrigin-RevId: 272279225
| Python | apache-2.0 | DataBiosphere/dsub,DataBiosphere/dsub | ---
+++
@@ -26,4 +26,4 @@
0.1.3.dev0 -> 0.1.3 -> 0.1.4.dev0 -> ...
"""
-DSUB_VERSION = '0.3.4.dev0'
+DSUB_VERSION = '0.3.4' |
4f84482803049b40d7b7da26d9d624a6a63b4820 | core/utils.py | core/utils.py | # -*- coding: utf-8 -*-
from django.utils import timezone
def duration_string(duration, precision='s'):
"""Format hours, minutes and seconds as a human-friendly string (e.g. "2
hours, 25 minutes, 31 seconds") with precision to h = hours, m = minutes or
s = seconds.
"""
h, m, s = duration_parts(dur... | # -*- coding: utf-8 -*-
from django.utils import timezone
from django.utils.translation import ngettext
def duration_string(duration, precision='s'):
"""Format hours, minutes and seconds as a human-friendly string (e.g. "2
hours, 25 minutes, 31 seconds") with precision to h = hours, m = minutes or
s = sec... | Add translation support to `duration_string` utility | Add translation support to `duration_string` utility
| Python | bsd-2-clause | cdubz/babybuddy,cdubz/babybuddy,cdubz/babybuddy | ---
+++
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from django.utils import timezone
+from django.utils.translation import ngettext
def duration_string(duration, precision='s'):
@@ -11,13 +12,21 @@
duration = ''
if h > 0:
- duration = '{} hour{}'.format(h, 's' if h > 1 else '')
+ duratio... |
786ebc992ac09cd4b25e90ee2a243447e39c237f | director/accounts/forms.py | director/accounts/forms.py | from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Submit
from django import forms
from accounts.models import Account, Team
from lib.data_cleaning import clean_slug, SlugType
from lib.forms import ModelFormWithCreate
class CleanNameMixin:
def clean_name(self):
return clea... | from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, HTML, Submit
from django import forms
from accounts.models import Account, Team
from lib.data_cleaning import clean_slug, SlugType
from lib.forms import ModelFormWithCreate
from assets.thema import themes
class CleanNameMixin:
... | Add theme and hosts to settings | feat(Accounts): Add theme and hosts to settings
| Python | apache-2.0 | stencila/hub,stencila/hub,stencila/hub,stencila/hub,stencila/hub | ---
+++
@@ -1,26 +1,16 @@
from crispy_forms.helper import FormHelper
-from crispy_forms.layout import Layout, Submit
+from crispy_forms.layout import Layout, Div, HTML, Submit
from django import forms
from accounts.models import Account, Team
from lib.data_cleaning import clean_slug, SlugType
from lib.forms im... |
c3c1b9c6a1d13f38cd50762b451ca19eb0a05ff2 | run_deploy_job_wr.py | run_deploy_job_wr.py | #!/usr/bin/env python
import json
import os
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
command = [
'$HOME/juju-ci-tools/run-deploy-job-remote.bash',
os.environ['revision_build'],
os.environ['JOB_NAME'],
]
command.extend(sys.argv[2:])
wi... | #!/usr/bin/env python
import json
import os
import subprocess
import sys
from tempfile import NamedTemporaryFile
def main():
revision_build = os.environ['revision_build']
job_name = os.environ['JOB_NAME']
build_number = os.environ['BUILD_NUMBER']
prefix='juju-ci/products/version-{}/{}/build-{}'.format... | Update for more artifact support. | Update for more artifact support. | Python | agpl-3.0 | mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju | ---
+++
@@ -7,16 +7,29 @@
def main():
+ revision_build = os.environ['revision_build']
+ job_name = os.environ['JOB_NAME']
+ build_number = os.environ['BUILD_NUMBER']
+ prefix='juju-ci/products/version-{}/{}/build-{}'.format(
+ revision_build, job_name, build_number)
+ s3_config = join(os.en... |
41236c2be66b6f790308cba321cb482807814323 | ubersmith/calls/device.py | ubersmith/calls/device.py | """Device call classes.
These classes implement any response cleaning and validation needed. If a
call class isn't defined for a given method then one is created using
ubersmith.calls.BaseCall.
"""
from ubersmith.calls import BaseCall, GroupCall
from ubersmith.utils import prepend_base
__all__ = [
'GetCall',
... | """Device call classes.
These classes implement any response cleaning and validation needed. If a
call class isn't defined for a given method then one is created using
ubersmith.calls.BaseCall.
"""
from ubersmith.calls import BaseCall, GroupCall
from ubersmith.utils import prepend_base
__all__ = [
'GetCall',
... | Make module graph call return a file. | Make module graph call return a file.
| Python | mit | jasonkeene/python-ubersmith,jasonkeene/python-ubersmith,hivelocity/python-ubersmith,hivelocity/python-ubersmith | ---
+++
@@ -26,3 +26,7 @@
method = _('list')
rename_fields = {'clientid': 'client_id'}
int_fields = ['client_id']
+
+
+class ModuleGraphCall(FileCall):
+ method = _('module_graph') |
61a6d057302767aa49633d6d010f7da583035533 | web/templatetags/getattribute.py | web/templatetags/getattribute.py | import re
from django import template
from django.conf import settings
numeric_test = re.compile("^\d+$")
register = template.Library()
def getattribute(value, arg):
"""Gets an attribute of an object dynamically from a string name"""
if hasattr(value, str(arg)):
return getattr(value, arg)
elif ha... | import re
from django import template
from django.conf import settings
numeric_test = re.compile("^\d+$")
register = template.Library()
def getattribute(value, arg):
"""Gets an attribute of an object dynamically from a string name"""
if hasattr(value, str(arg)):
if callable(getattr(value, arg)):
... | Call objects methods directly from the templates yay | web: Call objects methods directly from the templates yay
| Python | apache-2.0 | SchoolIdolTomodachi/SchoolIdolAPI,laurenor/SchoolIdolAPI,dburr/SchoolIdolAPI,laurenor/SchoolIdolAPI,rdsathene/SchoolIdolAPI,SchoolIdolTomodachi/SchoolIdolAPI,SchoolIdolTomodachi/SchoolIdolAPI,rdsathene/SchoolIdolAPI,rdsathene/SchoolIdolAPI,dburr/SchoolIdolAPI,dburr/SchoolIdolAPI,laurenor/SchoolIdolAPI | ---
+++
@@ -9,6 +9,8 @@
"""Gets an attribute of an object dynamically from a string name"""
if hasattr(value, str(arg)):
+ if callable(getattr(value, arg)):
+ return getattr(value, arg)()
return getattr(value, arg)
elif hasattr(value, 'has_key') and value.has_key(arg):
... |
f4c989567fa77002541c5e5199f2fc3f8e53d6da | test_htmlgen/image.py | test_htmlgen/image.py | from unittest import TestCase
from asserts import assert_equal
from htmlgen import Image
from test_htmlgen.util import parse_short_tag
class ImageTest(TestCase):
def test_attributes(self):
image = Image("my-image.png", "Alternate text")
assert_equal("my-image.png", image.url)
assert_eq... | from unittest import TestCase
from asserts import assert_equal
from htmlgen import Image
from test_htmlgen.util import parse_short_tag
class ImageTest(TestCase):
def test_attributes(self):
image = Image("my-image.png", "Alternate text")
assert_equal("my-image.png", image.url)
assert_eq... | Use public API in tests | [tests] Use public API in tests
| Python | mit | srittau/python-htmlgen | ---
+++
@@ -22,12 +22,12 @@
image = Image("my-image.png", "Alternate text")
tag = parse_short_tag(str(image))
assert_equal("img", tag.name)
- assert_equal("my-image.png", image._attributes["src"])
- assert_equal("Alternate text", image._attributes["alt"])
+ assert_equal... |
8e2b9e1c80e3a91df7e2cce775c19208aa9d4839 | exam/asserts.py | exam/asserts.py | IRRELEVANT = object()
class ChangeWatcher(object):
def __init__(self, thing, *args, **kwargs):
self.thing = thing
self.args = args
self.kwargs = kwargs
self.expected_before = kwargs.pop('before', IRRELEVANT)
self.expected_after = kwargs.pop('after', IRRELEVANT)
def __... | IRRELEVANT = object()
class ChangeWatcher(object):
def __init__(self, thing, *args, **kwargs):
self.thing = thing
self.args = args
self.kwargs = kwargs
self.expected_before = kwargs.pop('before', IRRELEVANT)
self.expected_after = kwargs.pop('after', IRRELEVANT)
def __... | Change __exit__arg names to not be built ins | Change __exit__arg names to not be built ins
| Python | mit | gterzian/exam,Fluxx/exam,Fluxx/exam,gterzian/exam | ---
+++
@@ -17,7 +17,7 @@
check = self.before == self.expected_before
assert check, self.__precondition_failure_msg_for('before')
- def __exit__(self, type, value, traceback):
+ def __exit__(self, exec_type, exac_value, traceback):
self.after = self.__apply()
if n... |
24d67552f1ae16179fb1aa21a06c191c6d596fb1 | akhet/urlgenerator.py | akhet/urlgenerator.py | """
Contributed by Michael Mericikel.
"""
from pyramid.decorator import reify
import pyramid.url as url
class URLGenerator(object):
def __init__(self, context, request):
self.context = context
self.request = request
@reify
def context(self):
return url.resource_url(self.context, s... | """
Contributed by Michael Mericikel.
"""
from pyramid.decorator import reify
import pyramid.url as url
class URLGenerator(object):
def __init__(self, context, request):
self.context = context
self.request = request
@reify
def context(self):
return url.resource_url(self.context, s... | Comment out 'static' and 'deform' methods; disagreements on long-term API. | Comment out 'static' and 'deform' methods; disagreements on long-term API.
| Python | mit | hlwsmith/akhet,hlwsmith/akhet,Pylons/akhet,hlwsmith/akhet,Pylons/akhet | ---
+++
@@ -27,10 +27,19 @@
def current(self, *elements, **kw):
return url.current_route_url(self.request, *elements, **kw)
- @reify
- def static(self):
- return url.static_url('baseline:static/', self.request)
+ ## Commented because I'm unsure of the long-term API.
+ ## If you want... |
d7bec88009b73a57124dbfacc91446927328abf9 | src/command_modules/azure-cli-network/azure/cli/command_modules/network/custom.py | src/command_modules/azure-cli-network/azure/cli/command_modules/network/custom.py | # pylint: disable=no-self-use,too-many-arguments
from azure.mgmt.network.models import Subnet, SecurityRule
from ._factory import _network_client_factory
def create_update_subnet(resource_group_name, subnet_name, virtual_network_name, address_prefix):
'''Create or update a virtual network (VNet) subnet'''
subn... | # pylint: disable=no-self-use,too-many-arguments
from azure.mgmt.network.models import Subnet, SecurityRule
from ._factory import _network_client_factory
def create_update_subnet(resource_group_name, subnet_name, virtual_network_name, address_prefix):
'''Create or update a virtual network (VNet) subnet'''
subn... | Fix broken NSG create command (duplicate --name parameter) | Fix broken NSG create command (duplicate --name parameter)
| Python | mit | QingChenmsft/azure-cli,samedder/azure-cli,BurtBiel/azure-cli,QingChenmsft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,samedder/azure-cli,samedder/azure-cli,QingChenmsft/azure-cli,QingChenmsft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,samedder/azure-cli,yugangw-msft/azure... | ---
+++
@@ -12,13 +12,13 @@
def create_update_nsg_rule(resource_group_name, network_security_group_name, security_rule_name,
protocol, source_address_prefix, destination_address_prefix,
access, direction, source_port_range, destination_port_range,
- ... |
cde815fd3c87cbe000620060f41bf2b29976555d | kindergarten-garden/kindergarten_garden.py | kindergarten-garden/kindergarten_garden.py | CHILDREN = ["Alice", "Bob", "Charlie", "David", "Eve", "Fred",
"Ginny", "Harriet", "Ileana", "Joseph", "Kincaid", "Larry"]
PLANTS = {"C": "Clover", "G": "Grass", "R": "Radishes", "V": "Violets"}
class Garden(object):
def __init__(self, garden, students=CHILDREN):
self.students = sorted(student... | CHILDREN = ["Alice", "Bob", "Charlie", "David", "Eve", "Fred",
"Ginny", "Harriet", "Ileana", "Joseph", "Kincaid", "Larry"]
PLANTS = {"C": "Clover", "G": "Grass", "R": "Radishes", "V": "Violets"}
class Garden(object):
def __init__(self, garden, students=CHILDREN):
self.students = sorted(student... | Use unpacking for simpler code | Use unpacking for simpler code
| Python | agpl-3.0 | CubicComet/exercism-python-solutions | ---
+++
@@ -6,8 +6,8 @@
class Garden(object):
def __init__(self, garden, students=CHILDREN):
self.students = sorted(students)
- rows = garden.split()
- patches = [rows[0][i:i+2] + rows[1][i:i+2]
+ row1, row2 = garden.split()
+ patches = [row1[i:i+2] + row2[i:i+2]
... |
a23edc2bb3caf15160d9b0d311a40cfb7f75131c | tests/test_system.py | tests/test_system.py | import datetime
from decimal import Decimal
from mock import Mock
import ubersmith.order
# TODO: setup/teardown module with default request handler
# TODO: mock out requests library vs mocking out request handler
def test_order_list():
handler = Mock()
response = {
"60": {
"client_id": ... | import datetime
from decimal import Decimal
from mock import Mock
import ubersmith.order
# TODO: setup/teardown module with default request handler
# TODO: mock out requests library vs mocking out request handler
def test_order_list():
handler = Mock()
response = {
"60": {
"client_id": ... | Fix timezone difference with travis. | Fix timezone difference with travis.
| Python | mit | jasonkeene/python-ubersmith,hivelocity/python-ubersmith,hivelocity/python-ubersmith,jasonkeene/python-ubersmith | ---
+++
@@ -24,8 +24,8 @@
expected = {
60: {
u'client_id': 50,
- u'activity': datetime.datetime(2010, 4, 27, 16, 32, 13),
- u'ts': datetime.datetime(2010, 4, 27, 16, 32, 13),
+ u'activity': datetime.datetime.fromtimestamp(float("1272400333")),
+ u... |
31f6cc777054f4b48a37bb93453bcf405a9101a3 | examples/example_import.py | examples/example_import.py | import xkcdpass.xkcd_password as xp
import random
def random_capitalisation(s, chance):
new_str = []
for i, c in enumerate(s):
new_str.append(c.upper() if random.random() < chance else c)
return "".join(new_str)
words = xp.locate_wordfile()
mywords = xp.generate_wordlist(wordfile=words, min_leng... | import xkcdpass.xkcd_password as xp
import random
def random_capitalisation(s, chance):
new_str = []
for i, c in enumerate(s):
new_str.append(c.upper() if random.random() < chance else c)
return "".join(new_str)
def capitalize_first_letter(s):
new_str = []
s = s.split(" ")
for i, c in... | Add "capitalize first letter" function to examples | Add "capitalize first letter" function to examples
| Python | bsd-3-clause | amiryal/XKCD-password-generator,amiryal/XKCD-password-generator | ---
+++
@@ -8,6 +8,13 @@
new_str.append(c.upper() if random.random() < chance else c)
return "".join(new_str)
+def capitalize_first_letter(s):
+ new_str = []
+ s = s.split(" ")
+ for i, c in enumerate(s):
+ new_str.append(c.capitalize())
+ return "".join(new_str)
+
words = xp.loc... |
520487df7b9612e18dc06764ba8632b0ef28aad2 | solvent/bring.py | solvent/bring.py | from solvent import config
from solvent import run
from solvent import requirementlabel
import logging
import os
class Bring:
def __init__(self, repositoryBasename, product, hash, destination):
self._repositoryBasename = repositoryBasename
self._product = product
self._hash = hash
... | from solvent import config
from solvent import run
from solvent import requirementlabel
import logging
import os
class Bring:
def __init__(self, repositoryBasename, product, hash, destination):
self._repositoryBasename = repositoryBasename
self._product = product
self._hash = hash
... | Bring now uses --myUIDandGIDCheckout if root is not the invoker | Bring now uses --myUIDandGIDCheckout if root is not the invoker
| Python | apache-2.0 | Stratoscale/solvent,Stratoscale/solvent | ---
+++
@@ -23,7 +23,8 @@
logging.info("Checking out '%(label)s'", dict(label=label))
if not os.path.isdir(destination):
os.makedirs(destination)
+ myUIDandGID = ["--myUIDandGIDcheckout"] if os.getuid() != 0 else []
run.run([
"osmosis", "checkout", destinati... |
cea212a73e76c1b1e5b4795687e5b2a394614227 | hkisaml/urls.py | hkisaml/urls.py | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.http import HttpResponse
from django.conf.urls.static import static
from django.contrib.staticfiles import views as static_views
from .api import UserView, GetJWTView
from users.views impor... | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.http import HttpResponse
from django.conf.urls.static import static
from django.contrib.staticfiles import views as static_views
from django.views.defaults import permission_denied
from .ap... | Disable application views from oauth2-toolkit | Disable application views from oauth2-toolkit
| Python | mit | mikkokeskinen/tunnistamo,mikkokeskinen/tunnistamo | ---
+++
@@ -4,6 +4,7 @@
from django.http import HttpResponse
from django.conf.urls.static import static
from django.contrib.staticfiles import views as static_views
+from django.views.defaults import permission_denied
from .api import UserView, GetJWTView
from users.views import LoginView
@@ -24,6 +25,7 @@
... |
1be7ac84b951a1e5803bd46de931235e44e40d9a | 2018/covar/covar-typecheck.py | 2018/covar/covar-typecheck.py | from typing import TypeVar, List
class Mammal:
pass
class Cat(Mammal):
pass
T = TypeVar('T')
def count_mammals(seq : List[Mammal]) -> int:
return len(seq)
lst = [1, 2, 3]
mlst = [Mammal(), Mammal()]
clst = [Cat(), Cat()]
print(count_mammals(clst))
| # Sample of using typing.TypeVar with covariant settings.
# Run with python3.6+
#
# For type-checking with mypy:
#
# > mypy covar-typecheck.py
#
# Eli Bendersky [https://eli.thegreenplace.net]
# This code is in the public domain.
from typing import List, TypeVar, Iterable, Generic
class Mammal:
pass
class Cat(Mam... | Update the sample with covariant markings | Update the sample with covariant markings
| Python | unlicense | eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog | ---
+++
@@ -1,4 +1,13 @@
-from typing import TypeVar, List
+# Sample of using typing.TypeVar with covariant settings.
+# Run with python3.6+
+#
+# For type-checking with mypy:
+#
+# > mypy covar-typecheck.py
+#
+# Eli Bendersky [https://eli.thegreenplace.net]
+# This code is in the public domain.
+from typing import ... |
7405bda939632a5f8cac93413b4e99939ef716c2 | ideas/models.py | ideas/models.py | from __future__ import unicode_literals
from django.db import models
class Idea(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
votes = models.IntegerField(default=0)
def __unicode__(self):
return self.name | from __future__ import unicode_literals
from django.db import models
class Idea(models.Model):
name = models.CharField(max_length=200, unique=True)
description = models.TextField()
votes = models.IntegerField(default=0)
def __unicode__(self):
return self.name | Add unique parameter to idea name | Add unique parameter to idea name
| Python | mit | neosergio/vote_hackatrix_backend | ---
+++
@@ -3,7 +3,7 @@
from django.db import models
class Idea(models.Model):
- name = models.CharField(max_length=200)
+ name = models.CharField(max_length=200, unique=True)
description = models.TextField()
votes = models.IntegerField(default=0)
|
18a03c7bdb433e9f75fd93a39735ccb935e0072c | pavement.py | pavement.py | # -*- coding: utf-8 -*-
"""Config-like for paver tool."""
from paver.easy import task, sh, path # noqa
# pylint: disable=invalid-name
cli_command_name = 'serverauditor'
@task
def lint():
"""Check code style and conventions."""
sh('prospector')
@task
def bats():
"""Run tests on CLI usage."""
sh('ba... | # -*- coding: utf-8 -*-
"""Config-like for paver tool."""
from paver.easy import task, sh, path # noqa
# pylint: disable=invalid-name
cli_command_name = 'serverauditor'
@task
def lint():
"""Check code style and conventions."""
sh('prospector')
@task
def bats():
"""Run tests on CLI usage."""
sh('ba... | Add newline between func defs. | Add newline between func defs.
| Python | bsd-3-clause | EvgeneOskin/termius-cli,EvgeneOskin/termius-cli,Crystalnix/serverauditor-sshconfig,Crystalnix/serverauditor-sshconfig,EvgeneOskin/serverauditor-sshconfig | ---
+++
@@ -29,6 +29,7 @@
"""Run integration tests for bash completion."""
sh('nosetests tests/integration/completion/bash/')
+
@task
def coverage():
"""Run test and collect coverage.""" |
7f79645182de6fed4d7f09302cbc31351defe467 | snippet_parser/fr.py | snippet_parser/fr.py | #-*- encoding: utf-8 -*-
import base
def handle_date(template):
year = None
if len(template.params) >= 3:
try:
year = int(unicode(template.params[2]))
except ValueError:
pass
if isinstance(year, int):
# assume {{date|d|m|y|...}}
return ' '.join(map(u... | #-*- encoding: utf-8 -*-
import base
def handle_date(template):
year = None
if len(template.params) >= 3:
try:
year = int(unicode(template.params[2]))
except ValueError:
pass
if isinstance(year, int):
# assume {{date|d|m|y|...}}
return ' '.join(map(u... | Fix params handling in {{s}}. | Fix params handling in {{s}}.
Former-commit-id: 15eae70c91cd08f9028944f8b6a3990d3170aa28 | Python | mit | guilherme-pg/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,eggpi/citationhunt | ---
+++
@@ -17,9 +17,9 @@
return unicode(template.params[0])
def handle_s(template):
- ret = template.params[0]
+ ret = unicode(template.params[0])
if len(template.params) == 2:
- ret += template.params[1]
+ ret += unicode(template.params[1])
if template.name.matches('-s'):
... |
53bb27bd88cb59424e231e7cadbbabcc91cc44e2 | pywikibot/families/commons_family.py | pywikibot/families/commons_family.py | # -*- coding: utf-8 -*-
"""Family module for Wikimedia Commons."""
#
# (C) Pywikibot team, 2005-2017
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
from pywikibot import family
# The Wikimedia Commons family
class Family(family.Wik... | # -*- coding: utf-8 -*-
"""Family module for Wikimedia Commons."""
#
# (C) Pywikibot team, 2005-2018
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
from pywikibot import family
# The Wikimedia Commons family
class Family(family.Wik... | Add Endashcatredirect as a new item in list of category redirect templates | Add Endashcatredirect as a new item in list of category redirect templates
Bug: T183987
Change-Id: I72b6ded1ccab48d5d905f4edd4ce6b9485703563
| Python | mit | magul/pywikibot-core,PersianWikipedia/pywikibot-core,wikimedia/pywikibot-core,wikimedia/pywikibot-core,magul/pywikibot-core | ---
+++
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Family module for Wikimedia Commons."""
#
-# (C) Pywikibot team, 2005-2017
+# (C) Pywikibot team, 2005-2018
#
# Distributed under the terms of the MIT license.
#
@@ -38,6 +38,7 @@
u'Synonym taxon category redirect',
u'Invalid t... |
17fbd2f3fa24da128cb5cabef4a8c94b59b50b0c | sqrl/client/crypt.py | sqrl/client/crypt.py | #!/usr/bin/env python
import ed25519
import hmac
from sqrl.utils import baseconv
class Crypt:
"""
Crypt
- Creating site specific key pair
- Signing SRQL response
- Providing public key
"""
def __init__(self, masterkey):
self.masterkey = masterkey
def _site_key_pair(self, dom... | #!/usr/bin/env python
import ed25519
import hmac
import baseconv
class Crypt:
"""
Crypt
- Creating site specific key pair
- Signing SRQL response
- Providing public key
"""
def __init__(self, masterkey):
self.masterkey = masterkey
def _site_key_pair(self, domain):
se... | Fix up imports after module has moved | Fix up imports after module has moved
| Python | mit | vegarwe/sqrl,vegarwe/sqrl,vegarwe/sqrl,vegarwe/sqrl | ---
+++
@@ -2,7 +2,7 @@
import ed25519
import hmac
-from sqrl.utils import baseconv
+import baseconv
class Crypt: |
a5ce8febd35795a06288291ae67df1a92b4ba664 | test_knot.py | test_knot.py | # -*- coding: utf-8 -*-
import unittest
from flask import Flask
from flask.ext.knot import Knot, get_container
def create_app():
app = Flask(__name__)
app.config['TESTING'] = True
return app
class TestKnot(unittest.TestCase):
def test_acts_like_container(self):
app = create_app()
di... | # -*- coding: utf-8 -*-
import unittest
from flask import Flask
from flask.ext.knot import Knot, get_container
def create_app():
app = Flask(__name__)
app.config['TESTING'] = True
return app
class TestKnot(unittest.TestCase):
def test_acts_like_container(self):
app = create_app()
di... | Add test for required registration. | Add test for required registration. | Python | mit | jaapverloop/flask-knot | ---
+++
@@ -51,6 +51,11 @@
assert dic1 is dic2
+ def test_registration_is_required(self):
+ app = create_app()
+
+ self.assertRaises(RuntimeError, lambda: get_container(app))
+
if __name__ == '__main__':
unittest.main() |
116e9107f8ef9d4e074f17a4445f7b3ecceb7ab1 | sympy/interactive/tests/test_ipython.py | sympy/interactive/tests/test_ipython.py | """Tests of tools for setting up interactive IPython sessions. """
from sympy.interactive.session import init_ipython_session, enable_automatic_symbols
from sympy.core import Symbol
from sympy.external import import_module
from sympy.utilities.pytest import raises
# TODO: The code below could be made more granular w... | """Tests of tools for setting up interactive IPython sessions. """
from sympy.interactive.session import init_ipython_session, enable_automatic_symbols
from sympy.core import Symbol
from sympy.external import import_module
from sympy.utilities.pytest import raises
# TODO: The code below could be made more granular w... | Add some more tests for isympy -a | Add some more tests for isympy -a
| Python | bsd-3-clause | atreyv/sympy,wyom/sympy,Curious72/sympy,jerli/sympy,yashsharan/sympy,dqnykamp/sympy,debugger22/sympy,iamutkarshtiwari/sympy,cswiercz/sympy,AkademieOlympia/sympy,drufat/sympy,kaichogami/sympy,postvakje/sympy,ahhda/sympy,srjoglekar246/sympy,abhiii5459/sympy,cswiercz/sympy,meghana1995/sympy,Titan-C/sympy,ga7g08/sympy,pand... | ---
+++
@@ -31,3 +31,13 @@
app.run_cell(symbol, False)
assert symbol in app.user_ns
assert isinstance(app.user_ns[symbol], Symbol)
+
+ # Check that built-in names aren't overridden
+ app.run_cell("a = all == __builtin__.all", False)
+ assert "all" not in app.user_ns
+ assert app.user_ns['a'... |
3e1f5adf1402d6e9ddd4ef6a08f4a667be950e1d | src/ansible/admin.py | src/ansible/admin.py | from django.contrib import admin
from .models import Playbook, Registry, Repository
admin.site.register(Playbook)
admin.site.register(Registry)
admin.site.register(Repository)
admin.site.site_header = 'Ansible Admin'
| from django.contrib import admin
from .models import Playbook, Registry, Repository
admin.site.register(Playbook)
admin.site.register(Registry)
admin.site.register(Repository)
admin.site.site_header = 'Ansible Admin'
admin.site.site_title = 'Ansible Admin'
admin.site.index_title = 'Admin Tool'
| Add ansible app site title | Add ansible app site title
| Python | bsd-3-clause | lozadaOmr/ansible-admin,lozadaOmr/ansible-admin,lozadaOmr/ansible-admin | ---
+++
@@ -6,3 +6,5 @@
admin.site.register(Registry)
admin.site.register(Repository)
admin.site.site_header = 'Ansible Admin'
+admin.site.site_title = 'Ansible Admin'
+admin.site.index_title = 'Admin Tool' |
98f7c1080765e00954d0c38a98ab1bb3e207c059 | podcoder.py | podcoder.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) Ubuntu Podcast
# http://www.ubuntupodcast.org
# See the file "LICENSE" for the full license governing this code.
from podpublish import configuration
from podpublish import encoder
from podpublish import uploader
def main():
config = configuration.Con... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) Ubuntu Podcast
# http://www.ubuntupodcast.org
# See the file "LICENSE" for the full license governing this code.
from podpublish import configuration
from podpublish import encoder
def main():
config = configuration.Configuration('podcoder.ini')
i... | Determine what to encode based in skip options. | Determine what to encode based in skip options.
| Python | lgpl-2.1 | rikai/podpublish | ---
+++
@@ -6,20 +6,23 @@
from podpublish import configuration
from podpublish import encoder
-from podpublish import uploader
def main():
config = configuration.Configuration('podcoder.ini')
- encoder.audio_encode(config, 'mp3')
- encoder.mp3_tag(config)
- encoder.mp3_coverart(config)
- encod... |
1ea51baec10ebc76bfb2be88270df2050a29fbb5 | http-error-static-pages/5xx-static-html-generator.py | http-error-static-pages/5xx-static-html-generator.py | import os, errno
# Create build folder if it doesn't exist
try:
os.makedirs('build')
except OSError as e:
if e.errno != errno.EEXIST:
raise
template = open('./5xx.template.html', 'r')
templateString = template.read()
template.close()
# We only use 0-11 according to
# https://en.wikipedia.org/wiki/List... | import os, errno
# Create build folder if it doesn't exist
def get_path(relative_path):
cur_dir = os.path.dirname(__file__)
return os.path.join(cur_dir, relative_path)
try:
os.makedirs(get_path('build'))
except OSError as e:
if e.errno != errno.EEXIST:
raise
template = open(get_path('./5xx.template... | Make static http error code generator directory agnostic | Make static http error code generator directory agnostic
| Python | mit | thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-front-end,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-front-end | ---
+++
@@ -1,12 +1,17 @@
import os, errno
# Create build folder if it doesn't exist
+
+def get_path(relative_path):
+ cur_dir = os.path.dirname(__file__)
+ return os.path.join(cur_dir, relative_path)
+
try:
- os.makedirs('build')
+ os.makedirs(get_path('build'))
except OSError as e:
if e.errno != errn... |
c7ef5d2c049beba4bd1b12ec2e62a61446746a8a | unsubscribe/views.py | unsubscribe/views.py | from django import http
from mailgun import utils
import models as unsubscribe_model
def unsubscribe_webhook(request):
verified = utils.verify_webhook(
request.POST.get('token'),
request.POST.get('timestamp'),
request.POST.get('signature')
)
if not verified:
return http.H... | from django import http
from django.views.decorators.csrf import csrf_exempt
from mailgun import utils
import models as unsubscribe_model
@csrf_exempt
def unsubscribe_webhook(request):
verified = utils.verify_webhook(
request.POST.get('token'),
request.POST.get('timestamp'),
request.POST.... | Return http 200 for webhooks | Return http 200 for webhooks
| Python | mit | p2pu/mechanical-mooc,p2pu/mechanical-mooc,p2pu/mechanical-mooc,p2pu/mechanical-mooc | ---
+++
@@ -1,8 +1,10 @@
from django import http
+from django.views.decorators.csrf import csrf_exempt
+
from mailgun import utils
-
import models as unsubscribe_model
+@csrf_exempt
def unsubscribe_webhook(request):
verified = utils.verify_webhook(
request.POST.get('token'),
@@ -15,8 +17,13 @@
... |
c3479ba8d8486ae9a274367b4601e9e4b6699a1a | prj/urls.py | prj/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^djadmin/', include(admin.site.urls)),
)
| from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^djadmin/', include(admin.site.urls)),
# Root
url( r'^$', 'wishlist.views.index' ),
)
| Add root URL (to serve public wishlist) | Add root URL (to serve public wishlist)
| Python | mit | cgarvey/django-mywishlist,cgarvey/django-mywishlist | ---
+++
@@ -3,4 +3,7 @@
urlpatterns = patterns('',
url(r'^djadmin/', include(admin.site.urls)),
+
+ # Root
+ url( r'^$', 'wishlist.views.index' ),
) |
465fd8892c177925d8da3080d08676daad866195 | core/urls.py | core/urls.py | from django.conf.urls import url
from core import views
urlpatterns = [
url(r'^sensors/$', views.SensorList.as_view()),
url(r'^sensors/(?P<pk>[0-9]+)/$', views.SensorDetail.as_view()),
url(r'^stations/$', views.StationList.as_view()),
url(r'^stations/(?P<pk>[0-9]+)/$', views.StationDetail.as_view()),
url(r'^rea... | from django.conf.urls import url
from core import views
urlpatterns = [
url(r'^$', views.api_root),
url(r'^sensors/$', views.SensorList.as_view(), name='sensor-list'),
url(r'^sensors/(?P<pk>[0-9]+)/$', views.SensorDetail.as_view(), name='sensor-detail'),
url(r'^sensors/(?P<pk>[0-9]+)/data/$', views.Se... | Add URLs for previous views. | Add URLs for previous views.
| Python | apache-2.0 | qubs/climate-data-api,qubs/data-centre,qubs/climate-data-api,qubs/data-centre | ---
+++
@@ -2,12 +2,21 @@
from core import views
urlpatterns = [
- url(r'^sensors/$', views.SensorList.as_view()),
- url(r'^sensors/(?P<pk>[0-9]+)/$', views.SensorDetail.as_view()),
+ url(r'^$', views.api_root),
- url(r'^stations/$', views.StationList.as_view()),
- url(r'^stations/(?P<pk>[0-9]+)/$', views.St... |
8255fd2fdee3a7d6b96859eb7b8d1297431c730b | utils/00-cinspect.py | utils/00-cinspect.py | import inspect
from cinspect import getsource, getfile
import IPython.core.oinspect as OI
from IPython.utils.py3compat import cast_unicode
old_find_file = OI.find_file
old_getsource = inspect.getsource
inspect.getsource = getsource
def patch_find_file(obj):
fname = old_find_file(obj)
if fname is None:
... | """ A startup script for IPython to patch it to 'inspect' using cinspect. """
# Place this file in ~/.ipython/<PROFILE_DIR>/startup to patch your IPython to
# use cinspect for the code inspection.
import inspect
from cinspect import getsource, getfile
import IPython.core.oinspect as OI
from IPython.utils.py3compat ... | Add a note for the utility script. | Add a note for the utility script.
| Python | bsd-3-clause | punchagan/cinspect,punchagan/cinspect | ---
+++
@@ -1,3 +1,8 @@
+""" A startup script for IPython to patch it to 'inspect' using cinspect. """
+
+# Place this file in ~/.ipython/<PROFILE_DIR>/startup to patch your IPython to
+# use cinspect for the code inspection.
+
import inspect
from cinspect import getsource, getfile |
41c7d60556dff4be1c5f39cf694470d3af4869f0 | qual/iso.py | qual/iso.py | from datetime import date, timedelta
def iso_to_gregorian(year, week, weekday):
jan_8 = date(year, 1, 8).isocalendar()
offset = (week - jan_8[1]) * 7 + (weekday - jan_8[2])
return date(year, 1, 8) + timedelta(days=offset)
| from datetime import date, timedelta
def iso_to_gregorian(year, week, weekday):
if week < 1 or week > 54:
raise ValueError("Week number %d is invalid for an ISO calendar." % (week, ))
jan_8 = date(year, 1, 8).isocalendar()
offset = (week - jan_8[1]) * 7 + (weekday - jan_8[2])
d = date(year, 1, ... | Add checks for a reasonable week number. | Add checks for a reasonable week number.
| Python | apache-2.0 | jwg4/calexicon,jwg4/qual | ---
+++
@@ -1,7 +1,12 @@
from datetime import date, timedelta
def iso_to_gregorian(year, week, weekday):
+ if week < 1 or week > 54:
+ raise ValueError("Week number %d is invalid for an ISO calendar." % (week, ))
jan_8 = date(year, 1, 8).isocalendar()
offset = (week - jan_8[1]) * 7 + (weekday ... |
09dd2e16ef29b6c79ee344a55bea5bd0e59c7a59 | fireplace/cards/gvg/shaman.py | fireplace/cards/gvg/shaman.py | from ..utils import *
##
# Spells
# Ancestor's Call
class GVG_029:
action = [
ForcePlay(CONTROLLER, RANDOM(CONTROLLER_HAND + MINION)),
ForcePlay(OPPONENT, RANDOM(OPPONENT_HAND + MINION)),
]
| from ..utils import *
##
# Minions
# Vitality Totem
class GVG_039:
OWN_TURN_END = [Heal(FRIENDLY_HERO, 4)]
# Siltfin Spiritwalker
class GVG_040:
def OWN_MINION_DESTROY(self, minion):
if minion.race == Race.MURLOC:
return [Draw(CONTROLLER, 1)]
##
# Spells
# Ancestor's Call
class GVG_029:
action = [
For... | Implement Powermace, Crackle, Vitality Totem and Siltfin Spiritwalker | Implement Powermace, Crackle, Vitality Totem and Siltfin Spiritwalker
| Python | agpl-3.0 | oftc-ftw/fireplace,Meerkov/fireplace,Ragowit/fireplace,butozerca/fireplace,smallnamespace/fireplace,smallnamespace/fireplace,amw2104/fireplace,oftc-ftw/fireplace,NightKev/fireplace,butozerca/fireplace,amw2104/fireplace,beheh/fireplace,liujimj/fireplace,jleclanche/fireplace,Ragowit/fireplace,Meerkov/fireplace,liujimj/fi... | ---
+++
@@ -1,4 +1,19 @@
from ..utils import *
+
+
+##
+# Minions
+
+# Vitality Totem
+class GVG_039:
+ OWN_TURN_END = [Heal(FRIENDLY_HERO, 4)]
+
+
+# Siltfin Spiritwalker
+class GVG_040:
+ def OWN_MINION_DESTROY(self, minion):
+ if minion.race == Race.MURLOC:
+ return [Draw(CONTROLLER, 1)]
##
@@ -10,3 +25,1... |
0d37a94593a7749dca4b2553334f1b67c946d3f8 | ambassador/tests/t_lua_scripts.py | ambassador/tests/t_lua_scripts.py | from kat.harness import Query
from abstract_tests import AmbassadorTest, ServiceType, HTTP
class LuaTest(AmbassadorTest):
target: ServiceType
def init(self):
self.target = HTTP()
def manifests(self) -> str:
return super().manifests() + self.format('''
---
apiVersion: getambassador.io/v1
... | from kat.harness import Query
from abstract_tests import AmbassadorTest, ServiceType, HTTP
class LuaTest(AmbassadorTest):
target: ServiceType
def init(self):
self.target = HTTP()
self.env = ["LUA_SCRIPTS_ENABLED=Processed"]
def manifests(self) -> str:
return super().manifests() +... | Update LUA test to perform interpolation | Update LUA test to perform interpolation
| Python | apache-2.0 | datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador | ---
+++
@@ -7,6 +7,7 @@
def init(self):
self.target = HTTP()
+ self.env = ["LUA_SCRIPTS_ENABLED=Processed"]
def manifests(self) -> str:
return super().manifests() + self.format('''
@@ -20,7 +21,7 @@
config:
lua_scripts: |
function envoy_on_response(response_handle... |
5c7c1155a6bfe0e1dda8def877bcef9d8c528ee3 | vaux/api/__init__.py | vaux/api/__init__.py | import os
from flask import Flask, abort, request
from flask.ext import restful
from vaux.storage import LibreDB
from datetime import datetime
from werkzeug import secure_filename
from cors import crossdomain
app = Flask(__name__)
database = LibreDB('../data', 'localhost', 28015, 'docliber')
from peer import PeerReso... | import os
import ConfigParser
from flask import Flask, abort, request
from flask.ext import restful
from vaux.storage import LibreDB
from datetime import datetime
from werkzeug import secure_filename
from cors import crossdomain
app = Flask(__name__)
config = ConfigParser.SafeConfigParser()
config.read('/etc/vaux.ini... | Read in the database and data options from a config file | Read in the database and data options from a config file
I hope this works.
| Python | mit | VauxIo/core | ---
+++
@@ -1,4 +1,5 @@
import os
+import ConfigParser
from flask import Flask, abort, request
from flask.ext import restful
from vaux.storage import LibreDB
@@ -7,7 +8,15 @@
from cors import crossdomain
app = Flask(__name__)
-database = LibreDB('../data', 'localhost', 28015, 'docliber')
+
+config = ConfigPar... |
0948eced6cd551df7f136614b136378e9864b4eb | forms.py | forms.py | from flask import flash
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField
from wtforms.validators import DataRequired, Email, Length
def flash_errors(form):
""" Universal interface to handle form error.
Handles form error with the help of flash message
"""
for field, error... | from flask import flash
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField
from wtforms.validators import DataRequired, Email, Length, EqualTo
def flash_errors(form):
""" Universal interface to handle form error.
Handles form error with the help of flash message
"""
for fie... | Add input rule for adding employee | Add input rule for adding employee
| Python | mit | openedoo/module_employee,openedoo/module_employee,openedoo/module_employee | ---
+++
@@ -1,7 +1,7 @@
from flask import flash
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField
-from wtforms.validators import DataRequired, Email, Length
+from wtforms.validators import DataRequired, Email, Length, EqualTo
def flash_errors(form):
@@ -21,3 +21,29 @@
... |
848384b0283538556a231a32e4128d52ba9e1407 | direlog.py | direlog.py | #!/usr/bin/env python
# encoding: utf-8
import sys
import re
import argparse
import fileinput
from argparse import RawDescriptionHelpFormatter
from patterns import pre_patterns
def prepare(infile, outfile=sys.stdout):
"""
Apply pre_patterns from patterns to infile
:infile: input file
"""
try:... | #!/usr/bin/env python
# encoding: utf-8
import sys
import re
import argparse
import fileinput
from argparse import RawDescriptionHelpFormatter
from patterns import pre_patterns
def prepare(infile, outfile=sys.stdout):
"""
Apply pre_patterns from patterns to infile
:infile: input file
"""
try:... | Fix args.file and remove stat from argparse | Fix args.file and remove stat from argparse
| Python | mit | abcdw/direlog,abcdw/direlog | ---
+++
@@ -38,11 +38,9 @@
""", formatter_class=RawDescriptionHelpFormatter)
parser.add_argument('file', nargs='*', default=[],
help='file[s] to do some work')
- parser.add_argument('-s', '--stat', action='store_const', const=True,
- help='get statistics')
... |
65d9fcaecaa51d61d330b911342d372c277b1783 | openfisca_web_site/templates/tree/graphe-formules.py | openfisca_web_site/templates/tree/graphe-formules.py | # -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistribute it and/or modify
# it ... | Add missing redirection in empty file. | Add missing redirection in empty file.
| Python | agpl-3.0 | openfisca/openfisca-web-site,openfisca/openfisca-web-site,openfisca/openfisca-web-site,openfisca/openfisca-web-site | ---
+++
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+
+
+# OpenFisca -- A versatile microsimulation software
+# By: OpenFisca Team <contact@openfisca.fr>
+#
+# Copyright (C) 2011, 2012, 2013, 2014 OpenFisca Team
+# https://github.com/openfisca
+#
+# This file is part of OpenFisca.
+#
+# OpenFisca is free software; you ... | |
ef89d3608b9ab54aef105528f2c15fa9cc437bcd | runtests.py | runtests.py | #!/usr/bin/env python
import sys
from os.path import abspath, dirname
from django.conf import settings
sys.path.insert(0, abspath(dirname(__file__)))
if not settings.configured:
settings.configure(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'django.contrib.sessions',
... | #!/usr/bin/env python
import sys
from os.path import abspath, dirname
from django.conf import settings
import django
sys.path.insert(0, abspath(dirname(__file__)))
if not settings.configured:
settings.configure(
INSTALLED_APPS=(
'django.contrib.contenttypes',
'django.contrib.ses... | Fix tests for Django 1.7 | Fix tests for Django 1.7
| Python | mit | treyhunner/django-email-log,treyhunner/django-email-log | ---
+++
@@ -3,6 +3,7 @@
from os.path import abspath, dirname
from django.conf import settings
+import django
sys.path.insert(0, abspath(dirname(__file__)))
@@ -29,8 +30,18 @@
def runtests():
- from django.test.simple import DjangoTestSuiteRunner
- failures = DjangoTestSuiteRunner(failfast=False).r... |
da39bc268e3fe94af348690262fc116e3e0b2c9c | attachments/admin.py | attachments/admin.py | from attachments.models import Attachment
from django.contrib.contenttypes import generic
class AttachmentInlines(generic.GenericStackedInline):
model = Attachment
extra = 1 | from attachments.models import Attachment
from django.contrib.contenttypes import admin
class AttachmentInlines(admin.GenericStackedInline):
model = Attachment
extra = 1 | Fix deprecated modules for content types | Fix deprecated modules for content types
| Python | bsd-3-clause | leotrubach/django-attachments,leotrubach/django-attachments | ---
+++
@@ -1,7 +1,7 @@
from attachments.models import Attachment
-from django.contrib.contenttypes import generic
+from django.contrib.contenttypes import admin
-class AttachmentInlines(generic.GenericStackedInline):
+class AttachmentInlines(admin.GenericStackedInline):
model = Attachment
extra = 1 |
969334fec0822a30d1e5f10a458f79556053836a | fabfile.py | fabfile.py | from fabric.api import *
from fabric.colors import *
env.colorize_errors = True
env.hosts = ['sanaprotocolbuilder.me']
env.user = 'root'
env.virtualenv = 'source /usr/local/bin/virtualenvwrapper.sh'
env.project_root = '/opt/sana.protocol_builder'
def test():
local('python sana_builder... | from fabric.api import *
from fabric.colors import *
env.colorize_errors = True
env.hosts = ['sanaprotocolbuilder.me']
env.user = 'root'
env.virtualenv = 'source /usr/local/bin/virtualenvwrapper.sh'
env.project_root = '/opt/sana.protocol_builder'
def test():
local('python sana_builder... | Update deploy script to support Travis. | Update deploy script to support Travis.
| Python | bsd-3-clause | SanaMobile/sana.protocol_builder,SanaMobile/sana.protocol_builder,SanaMobile/sana.protocol_builder,SanaMobile/sana.protocol_builder,SanaMobile/sana.protocol_builder | ---
+++
@@ -11,9 +11,7 @@
local('python sana_builder/manage.py syncdb')
local('python sana_builder/manage.py test')
-def deploy():
- local('git push origin master')
-
+def update_host():
with cd(env.project_root), prefix(env.virtualenv), prefix('workon sana_protocol_builder'):
print(green... |
8e8370a76c67d7905c73bcb808f89e3cd4b994a3 | runtests.py | runtests.py | #!/usr/bin/env python
import django
from django.conf import settings
from django.core.management import call_command
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
ALLOWED_HOSTS=[
'testserver',
],
INSTALLED_APPS=[
... | #!/usr/bin/env python
import django
from django.conf import settings
from django.core.management import call_command
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
ALLOWED_HOSTS=[
'testserver',
],
INSTALLED_APPS=[
... | Add PERMISSIONS setting to test settings | Add PERMISSIONS setting to test settings
| Python | mit | wylee/django-perms,PSU-OIT-ARC/django-perms | ---
+++
@@ -20,6 +20,9 @@
'permissions.tests',
],
MIDDLEWARE_CLASSES=[],
+ PERMISSIONS={
+ 'allow_staff': False,
+ },
ROOT_URLCONF='permissions.tests.urls',
TEMPLATES=[{
'BACKEND': 'django.template.backends.django.DjangoTemplates', |
40a2faa67a5852ae347ab62f6239edfa6c666a1e | docs/conf.py | docs/conf.py |
source_suffix = '.rst'
master_doc = 'index'
html_theme = 'alabaster'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
]
| import sys
sys.path.append('..')
source_suffix = '.rst'
master_doc = 'index'
html_theme = 'alabaster'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
]
| Add root path to sys.path | Add root path to sys.path
| Python | mit | bureaucratic-labs/yargy | ---
+++
@@ -1,4 +1,6 @@
+import sys
+sys.path.append('..')
source_suffix = '.rst'
master_doc = 'index' |
926731b05f22566e98a02737d673cca3fc0b28ec | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
### General settings
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Firebase Admin SDK for PHP'
author = u'Jérôme Gamez'
copyright = u'Jérôme Gamez'
version = u'4.x'
html_title = u'Firebase Admin SDK for PHP Documentation'
html_short_tit... | # -*- coding: utf-8 -*-
### General settings
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Firebase Admin SDK for PHP'
author = u'Jérôme Gamez'
copyright = u'Jérôme Gamez'
version = u'4.x'
html_title = u'Firebase Admin SDK for PHP Documentation'
html_short_tit... | Fix "Edit on GitHub" links | Fix "Edit on GitHub" links
Using "master" seems to mess it up, see
https://github.com/readthedocs/readthedocs.org/issues/5518
| Python | mit | kreait/firebase-php | ---
+++
@@ -23,6 +23,10 @@
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+html_theme_options = {
+ 'canonical_url': 'https://firebase-php.readthedocs.io',
+ 'analytics_id': 'UA-82654714-3'
+}
### Syntax Highlighting
from sphinx.highlighting import lexers
@@ -... |
7aaa385da78bef57c8b6339f6db04044ace08807 | api/taxonomies/serializers.py | api/taxonomies/serializers.py | from rest_framework import serializers as ser
from api.base.serializers import JSONAPISerializer, LinksField, JSONAPIListField
class TaxonomyField(ser.Field):
def to_representation(self, obj):
if obj is not None:
return {'id': obj._id,
'text': obj.text}
return None
... | from rest_framework import serializers as ser
from api.base.serializers import JSONAPISerializer, LinksField, JSONAPIListField
class TaxonomyField(ser.Field):
def to_representation(self, obj):
if obj is not None:
return {'id': obj._id,
'text': obj.text}
return None
... | Add child_count taken from new Subject property | Add child_count taken from new Subject property
| Python | apache-2.0 | adlius/osf.io,brianjgeiger/osf.io,chrisseto/osf.io,rdhyee/osf.io,sloria/osf.io,brianjgeiger/osf.io,sloria/osf.io,binoculars/osf.io,mattclark/osf.io,saradbowman/osf.io,aaxelb/osf.io,baylee-d/osf.io,Johnetordoff/osf.io,leb2dg/osf.io,laurenrevere/osf.io,samchrisinger/osf.io,binoculars/osf.io,aaxelb/osf.io,rdhyee/osf.io,al... | ---
+++
@@ -21,6 +21,7 @@
id = ser.CharField(source='_id', required=True)
text = ser.CharField(max_length=200)
parents = JSONAPIListField(child=TaxonomyField())
+ child_count = ser.IntegerField()
links = LinksField({
'parents': 'get_parent_urls', |
6c349621dd3331bf92f803d2d66c96868f8e94c6 | src/geelweb/django/editos/runtests.py | src/geelweb/django/editos/runtests.py | import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings'
test_dir = os.path.dirname(__file__)
sys.path.insert(0, test_dir)
from django.test.utils import get_runner
from django.conf import settings
def runtests():
TestRunner = get_runner(settings)
test_runner = TestRunner(verbosity=1, int... | import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings'
test_dir = os.path.dirname(__file__)
sys.path.insert(0, test_dir)
import django
from django.test.utils import get_runner
from django.conf import settings
def runtests():
if django.VERSION[0] == 1 and django.VERSION[1] < 7:
from... | Upgrade to test using django 1.7 and 1.8 | Upgrade to test using django 1.7 and 1.8
| Python | mit | geelweb/django-editos,geelweb/django-editos | ---
+++
@@ -6,12 +6,20 @@
test_dir = os.path.dirname(__file__)
sys.path.insert(0, test_dir)
+import django
from django.test.utils import get_runner
from django.conf import settings
def runtests():
+ if django.VERSION[0] == 1 and django.VERSION[1] < 7:
+ from django.test.utils import setup_test_en... |
de441445dbdade4d937783626f1beeb9f439ee11 | helpers.py | helpers.py | import feedparser
import datetime
from .models import RssEntry
class RssSyncHelper(object):
def __init__(self, feed):
self.feed = feed
def save_entry(self, result):
pub_date = result.updated_parsed
published = datetime.date(pub_date[0], pub_date[1], pub_date[2])
return RssEn... | import feedparser
import datetime
from .models import RssEntry
def add_custom_acceptable_elements(elements):
"""
Add custom acceptable elements so iframes and other potential video
elements will get synched.
"""
elements += list(feedparser._HTMLSanitizer.acceptable_elements)
feedparser._HTMLS... | Allow iframes to be synched | Allow iframes to be synched
| Python | bsd-3-clause | ebrelsford/django-rsssync | ---
+++
@@ -2,6 +2,18 @@
import datetime
from .models import RssEntry
+
+
+def add_custom_acceptable_elements(elements):
+ """
+ Add custom acceptable elements so iframes and other potential video
+ elements will get synched.
+ """
+ elements += list(feedparser._HTMLSanitizer.acceptable_elements)
+... |
fe5eb7db52725f8d136cbeba4341f5c3a33cf199 | tensorflow_model_optimization/python/core/api/quantization/keras/quantizers/__init__.py | tensorflow_model_optimization/python/core/api/quantization/keras/quantizers/__init__.py | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Include AllValuesQuantizer in external APIs | Include AllValuesQuantizer in external APIs
PiperOrigin-RevId: 320104499
| Python | apache-2.0 | tensorflow/model-optimization,tensorflow/model-optimization | ---
+++
@@ -16,6 +16,7 @@
# quantize with custom quantization parameterization or implementation, or
# handle custom Keras layers.
+from tensorflow_model_optimization.python.core.quantization.keras.quantizers import AllValuesQuantizer
from tensorflow_model_optimization.python.core.quantization.keras.quantizers i... |
589e2df8c9af8ce8102904c9cfebbf87ee2df744 | ckanext/orgdashboards/tests/helpers.py | ckanext/orgdashboards/tests/helpers.py | from ckan.tests import factories
def create_mock_data(**kwargs):
mock_data = {}
mock_data['organization'] = factories.Organization()
mock_data['organization_name'] = mock_data['organization']['name']
mock_data['organization_id'] = mock_data['organization']['id']
mock_data['dataset'] = factories.... | ''' Helper methods for tests '''
import string
import random
from ckan.tests import factories
def create_mock_data(**kwargs):
mock_data = {}
mock_data['organization'] = factories.Organization()
mock_data['organization_name'] = mock_data['organization']['name']
mock_data['organization_id'] = mock_da... | Add function for generating random id | Add function for generating random id
| Python | agpl-3.0 | ViderumGlobal/ckanext-orgdashboards,ViderumGlobal/ckanext-orgdashboards,ViderumGlobal/ckanext-orgdashboards,ViderumGlobal/ckanext-orgdashboards | ---
+++
@@ -1,3 +1,8 @@
+''' Helper methods for tests '''
+
+import string
+import random
+
from ckan.tests import factories
@@ -25,3 +30,8 @@
}
return mock_data
+
+def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
+ ''' Create random id which is a combination of letters and ... |
4efbc3278c89355df9076f3caccf1032aae9d930 | setup.py | setup.py | """colorise module setup script for distribution."""
from setuptools import setup
import os
def get_version(filename):
with open(filename) as fh:
for line in fh:
if line.startswith('__version__'):
return line.split('=')[-1].strip()[1:-1]
setup(
name='colorise',
versi... | """colorise module setup script for distribution."""
from setuptools import setup
import os
def get_version(filename):
with open(filename) as fh:
for line in fh:
if line.startswith('__version__'):
return line.split('=')[-1].strip()[1:-1]
setup(
name='colorise',
versi... | Make twine check happy | Make twine check happy [ci skip]
| Python | bsd-3-clause | MisanthropicBit/colorise | ---
+++
@@ -24,6 +24,7 @@
package_data={'colorise': ['tests', 'examples']},
url='https://github.com/MisanthropicBit/colorise',
long_description=open('README.md').read(),
+ long_description_content_type='text/markdown',
classifiers=[
'Development Status :: 5 - Production/Stable',
... |
ff05e249e2ad2d479f6d630049f8693d0ef661e9 | setup.py | setup.py | from setuptools import setup, find_packages
import sys, os
def read(*path):
"""
Read and return content from ``path``
"""
f = open(
os.path.join(
os.path.dirname(__file__),
*path
),
'r'
)
try:
return f.read().decode('UTF-8')
finally:
... | from setuptools import setup, find_packages
import sys, os
def read(*path):
"""
Read and return content from ``path``
"""
f = open(
os.path.join(
os.path.dirname(__file__),
*path
),
'r'
)
try:
return f.read().decode('UTF-8')
finally:
... | Update for compatibility with pesto==14 | Update for compatibility with pesto==14
Ignore-this: 7a596766eb3deedefb2c9ba36ce5ecfc
darcs-hash:20100419210717-8e352-6286dc43ea83998229ccdcd619ff1f4990ff82ee.gz
| Python | mit | Singletoned/testino | ---
+++
@@ -40,7 +40,7 @@
include_package_data=True,
zip_safe=False,
install_requires=[
- 'pesto ==12, ==13',
+ 'pesto ==12, ==13, ==14',
'lxml',
# -*- Extra requirements: -*-
], |
8145850506ba238682f189403f4545183db9bec7 | setup.py | setup.py | from setuptools import setup
import os
PROJECT_ROOT, _ = os.path.split(__file__)
DESCRIPTION = open( os.path.join(PROJECT_ROOT, "README") ).read()
VERSION = REVISION = '0.1.4'
PROJECT_NAME = 'JenkinsAPI'
PROJECT_AUTHORS = "Salim Fadhley, Ramon van Alteren, Ruslan Lutsenko"
PROJECT_EMAILS = 'salimfadhley@gmail.com, ra... | from setuptools import setup
import os
PROJECT_ROOT, _ = os.path.split(__file__)
DESCRIPTION = open(os.path.join(PROJECT_ROOT, "README.rst")).read()
VERSION = REVISION = '0.1.4'
PROJECT_NAME = 'JenkinsAPI'
PROJECT_AUTHORS = "Salim Fadhley, Ramon van Alteren, Ruslan Lutsenko"
PROJECT_EMAILS = 'salimfadhley@gmail.com, r... | Fix pep8 and open file description | Fix pep8 and open file description
| Python | mit | mistermocha/jenkinsapi,jduan/jenkinsapi,mistermocha/jenkinsapi,zaro0508/jenkinsapi,imsardine/jenkinsapi,JohnLZeller/jenkinsapi,mistermocha/jenkinsapi,aerickson/jenkinsapi,EwoutVDC/jenkinsapi,JohnLZeller/jenkinsapi,imsardine/jenkinsapi,salimfadhley/jenkinsapi,imsardine/jenkinsapi,zaro0508/jenkinsapi,zaro0508/jenkinsapi,... | ---
+++
@@ -1,8 +1,8 @@
from setuptools import setup
import os
-PROJECT_ROOT, _ = os.path.split(__file__)
-DESCRIPTION = open( os.path.join(PROJECT_ROOT, "README") ).read()
+PROJECT_ROOT, _ = os.path.split(__file__)
+DESCRIPTION = open(os.path.join(PROJECT_ROOT, "README.rst")).read()
VERSION = REVISION = '0.1.4... |
ce365ef62d26e0555e9a38d152ab6a4f0f96626d | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='gdcdatamodel',
packages=find_packages(),
install_requires=[
'pytz==2016.4',
'graphviz==0.4.2',
'jsonschema==2.5.1',
'python-dateutil==2.4.2',
'psqlgraph',
'gdcdictionary',
'dictionaryutils>=2.0.... | from setuptools import setup, find_packages
setup(
name='gdcdatamodel',
packages=find_packages(),
install_requires=[
'pytz==2016.4',
'graphviz==0.4.2',
'jsonschema==2.5.1',
'python-dateutil==2.4.2',
'psqlgraph',
'gdcdictionary',
'dictionaryutils>=2.0.... | Update to dictionary release tag | chore(pins): Update to dictionary release tag
- Update to dictionary release tag
| Python | apache-2.0 | NCI-GDC/gdcdatamodel,NCI-GDC/gdcdatamodel | ---
+++
@@ -21,7 +21,7 @@
dependency_links=[
'git+https://github.com/NCI-GDC/cdisutils.git@863ce13772116b51bcf5ce7e556f5df3cb9e6f63#egg=cdisutils',
'git+https://github.com/NCI-GDC/psqlgraph.git@1.2.0#egg=psqlgraph',
- 'git+https://github.com/NCI-GDC/gdcdictionary.git@release/jibboo#egg=g... |
57829ac0344df841d6600294dfcd5c745b7ff00b | setup.py | setup.py | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='pyaavso',
version=__import__('pyaavso').__version__,
description='A Python library for working with AAVSO data.',
long_description=read('README.rst... | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='pyaavso',
version=__import__('pyaavso').__version__,
description='A Python library for working with AAVSO data.',
long_description=read('README.rst... | Add classifier for Python 3-only compatibility. | Add classifier for Python 3-only compatibility.
| Python | mit | zsiciarz/pyaavso | ---
+++
@@ -27,6 +27,7 @@
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4'... |
f3c9550ee6719278cba7f4edda26274220e954f3 | setup.py | setup.py | #!/usr/bin/python
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
import re
from setuptools import setup, find_packages
data_files = {
"share/osbs": [
"inputs/prod.json",
... | #!/usr/bin/python
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
import re
from setuptools import setup, find_packages
data_files = {
"share/osbs": [
"inputs/prod.json",
... | Change author and email to the same as atomic-reactor has | Change author and email to the same as atomic-reactor has
| Python | bsd-3-clause | bfontecc007/osbs-client,vrutkovs/osbs-client,twaugh/osbs-client,vrutkovs/osbs-client,jpopelka/osbs-client,DBuildService/osbs-client,projectatomic/osbs-client,bfontecc007/osbs-client,twaugh/osbs-client,pombredanne/osbs-client,jpopelka/osbs-client,DBuildService/osbs-client,projectatomic/osbs-client,pombredanne/osbs-clien... | ---
+++
@@ -36,8 +36,8 @@
name="osbs-client",
description='Python module and command line client for OpenShift Build Service',
version="0.14",
- author='Tomas Tomecek',
- author_email='ttomecek@redhat.com',
+ author='Red Hat, Inc.',
+ author_email='atomic-devel@projectatomic.io',
url='... |
e151a6f85c79821a0e56b6dbdb1e6f2155b725a0 | setup.py | setup.py | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="accelerometer",
version="2.0",
author="Aiden Doherty",
author_email="aiden.doherty@bdi.ox.ac.uk",
description="A package to extract meaningful health information from large accelerometer d... | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="accelerometer",
version="2.0",
author="Aiden Doherty",
author_email="aiden.doherty@bdi.ox.ac.uk",
description="A package to extract meaningful health information from large accelerometer d... | Allow newer versions of sklearn - this will now allow software to be compiled again on OSX. Also tested on Linux. | Allow newer versions of sklearn - this will now allow software to be compiled again on OSX. Also tested on Linux.
| Python | bsd-2-clause | aidendoherty/biobankAccelerometerAnalysis,aidendoherty/biobankAccelerometerAnalysis,computationalEpidemiology/biobankAccelerometerAnalysis,computationalEpidemiology/biobankAccelerometerAnalysis | ---
+++
@@ -20,7 +20,7 @@
'numpy',
'scipy',
'pandas>=0.24',
- 'scikit-learn==0.21.2',
+ 'scikit-learn>=0.21.2',
'sphinx',
'sphinx-rtd-theme',
'statsmodels', |
6fcc0d294f6c501d0926d53c386ddb11cff7db25 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(
name="PyTumblr",
version="0.0.5",
description="A Python API v2 wrapper for Tumblr",
author="John Bunting",
author_email="johnb@tumblr.com",
url="https://github.com/tumblr/pytumblr",
packages = ['pytumblr'],
license = "LICENSE",... | #!/usr/bin/env python
from setuptools import setup
setup(
name="PyTumblr",
version="0.0.5",
description="A Python API v2 wrapper for Tumblr",
author="John Bunting",
author_email="johnb@tumblr.com",
url="https://github.com/tumblr/pytumblr",
packages = ['pytumblr'],
license = "LICENSE",... | Move test dependencies to tests_require. | Move test dependencies to tests_require.
Move nose, nose-cov, and mock to tests_require, since they are only
required for tests and not needed for general package setup.
| Python | apache-2.0 | gcd0318/pytumblr,philgroshens/pytumblr,megacoder/pytumblr,tumblr/pytumblr,dianakhuang/pytumblr,PegasusWang/pytumblr,socrateslee/pytumblr | ---
+++
@@ -20,7 +20,7 @@
'httpretty'
],
- setup_requires=[
+ tests_require=[
'nose',
'nose-cov',
'mock' |
146d71c86c5e58b0ed41e66de7a5c94e937fc6a9 | setup.py | setup.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import find_packages, setup
VERSION = "1.0.0"
with open("requirements.txt", "rt") as f:
requirements= f.read().splitlines()
setup(name="sacad",
version=VERSION,
author="desbma",
packages=find_packages(),
entry_points={"console... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import find_packages, setup
VERSION = "1.0.0"
with open("requirements.txt", "rt") as f:
requirements= f.read().splitlines()
setup(name="sacad",
version=VERSION,
author="desbma",
packages=find_packages(),
entry_points={"console... | Use alternate GitHub download URL | Use alternate GitHub download URL
| Python | mpl-2.0 | desbma/sacad,desbma/sacad | ---
+++
@@ -19,7 +19,7 @@
install_requires=requirements,
description="Search and download music album covers",
url="https://github.com/desbma/sacad",
- download_url="https://github.com/desbma/sacad/tarball/%s" % (VERSION),
+ download_url="https://github.com/desbma/sacad/archive/%s.tar.g... |
77e06add286e2d4544031fd1d9baf4cffcb16359 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import find_packages, setup
setup(
name="pylast",
version="2.2.0.dev0",
author="Amr Hassan <amr.hassan@gmail.com>",
install_requires=['six'],
tests_require=['mock', 'pytest', 'coverage', 'pycodestyle', 'pyyaml',
'pyflakes', 'flaky'],
des... | #!/usr/bin/env python
from setuptools import find_packages, setup
setup(
name="pylast",
version="2.2.0.dev0",
author="Amr Hassan <amr.hassan@gmail.com> and Contributors",
install_requires=['six'],
tests_require=['mock', 'pytest', 'coverage', 'pycodestyle', 'pyyaml',
'pyflakes', ... | Add 'and Contributors' to Author | Add 'and Contributors' to Author
| Python | apache-2.0 | pylast/pylast,hugovk/pylast | ---
+++
@@ -5,7 +5,7 @@
setup(
name="pylast",
version="2.2.0.dev0",
- author="Amr Hassan <amr.hassan@gmail.com>",
+ author="Amr Hassan <amr.hassan@gmail.com> and Contributors",
install_requires=['six'],
tests_require=['mock', 'pytest', 'coverage', 'pycodestyle', 'pyyaml',
... |
efb8b12eb92d51cddee8e24d569a4c85227cd15a | setup.py | setup.py | from setuptools import setup, find_packages
def listify(filename):
return filter(None, open(filename,'r').read().split('\n'))
def remove_externals(requirements):
return filter(lambda e: not e.startswith('-e'), requirements)
setup(
name = "vumi",
version = "0.1.0",
url = 'http://github.com/praekel... | from setuptools import setup, find_packages
def listify(filename):
return filter(None, open(filename,'r').read().split('\n'))
def remove_externals(requirements):
return filter(lambda e: not e.startswith('-e'), requirements)
setup(
name = "vumi",
version = "0.2.0a",
url = 'http://github.com/praeke... | Set initial version for series 0.2.x | Set initial version for series 0.2.x
| Python | bsd-3-clause | vishwaprakashmishra/xmatrix,vishwaprakashmishra/xmatrix,harrissoerja/vumi,harrissoerja/vumi,TouK/vumi,TouK/vumi,vishwaprakashmishra/xmatrix,TouK/vumi,harrissoerja/vumi | ---
+++
@@ -8,7 +8,7 @@
setup(
name = "vumi",
- version = "0.1.0",
+ version = "0.2.0a",
url = 'http://github.com/praekelt/vumi',
license = 'BSD',
description = "Super-scalable messaging engine for the delivery of SMS, " |
b3e14ce837cf9b90f5f7633e028408e21cc48bb6 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='osmviz',
version='1.1.0',
description='OSMViz is a small set of Python tools for retrieving '
'and using Mapnik tiles from a Slippy Map server '
'(you may know these as OpenStreetMap images).',
long_description=ope... | from setuptools import setup, find_packages
setup(
name='osmviz',
version='1.1.0',
description='OSMViz is a small set of Python tools for retrieving '
'and using Mapnik tiles from a Slippy Map server '
'(you may know these as OpenStreetMap images).',
long_description=ope... | Add python_requires to help pip | Add python_requires to help pip
| Python | mit | hugovk/osmviz,hugovk/osmviz | ---
+++
@@ -7,6 +7,7 @@
'and using Mapnik tiles from a Slippy Map server '
'(you may know these as OpenStreetMap images).',
long_description=open('README.md', 'r').read(),
+ python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
classifiers=[
# 'Developmen... |
9fe6b64f83b17e1fe8f9a8d70cddcd8bf438e385 | setup.py | setup.py | #!/usr/bin/env python
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name = "cmdparse",
version = "0.9",
author = "Peter Teichman",
license = "MIT",
packages = find_packages(exclude="tests"),
test_suite = "tests.cmdparse_suite",
)
| #!/usr/bin/env python
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name = "cmdparse",
version = "0.9",
author = "Peter Teichman",
license = "MIT",
packages = find_packages(exclude=["tests"]),
test_suite = "tests.cmdparse_suite",
)
| Fix find_packages excludes to contain a list rather than a bare string | Fix find_packages excludes to contain a list rather than a bare string
| Python | mit | pteichman/python-cmdparse | ---
+++
@@ -9,6 +9,6 @@
version = "0.9",
author = "Peter Teichman",
license = "MIT",
- packages = find_packages(exclude="tests"),
+ packages = find_packages(exclude=["tests"]),
test_suite = "tests.cmdparse_suite",
) |
b8abb57f7a0e822ba32be2d379bb967f4abfbc21 | setup.py | setup.py | from distutils.core import setup
setup(
name='Zuice',
version='0.2-dev',
description='A dependency injection framework for Python',
author='Michael Williamson',
author_email='mike@zwobble.org',
url='http://gitorious.org/zuice',
packages=['zuice'],
)
| from distutils.core import setup
setup(
name='Zuice',
version='0.2-dev',
description='A dependency injection framework for Python',
author='Michael Williamson',
author_email='mike@zwobble.org',
url='https://github.com/mwilliamson/zuice',
packages=['zuice'],
)
| Update package URL to use GitHub | Update package URL to use GitHub
| Python | bsd-2-clause | mwilliamson/zuice | ---
+++
@@ -6,6 +6,6 @@
description='A dependency injection framework for Python',
author='Michael Williamson',
author_email='mike@zwobble.org',
- url='http://gitorious.org/zuice',
+ url='https://github.com/mwilliamson/zuice',
packages=['zuice'],
) |
f3ecf3000f6291bac711857e51e4d894d52ad24a | setup.py | setup.py | import os.path
import sys
from setuptools import setup, find_packages
from build_manpage import build_manpage
HOME=os.path.expanduser('~')
setup(
name='popup',
version='0.2.0',
author='Jay Edwards',
cmdclass={'build_manpage': build_manpage},
author_email='jay@meangrape.com',
packages=['PopupS... | import os.path
import sys
from setuptools import setup, find_packages
from build_manpage import build_manpage
HOME=os.path.expanduser('~')
setup(
name='popup',
version='0.1.0',
author='Jay Edwards',
cmdclass={'build_manpage': build_manpage},
author_email='jay@meangrape.com',
packages=['PopupS... | Revert "Bump version to 0.2.0" | Revert "Bump version to 0.2.0"
This reverts commit 189e4bc4bcd7a6764740d9974a633996f6ba1fc7.
| Python | bsd-2-clause | jayed/popup | ---
+++
@@ -8,7 +8,7 @@
setup(
name='popup',
- version='0.2.0',
+ version='0.1.0',
author='Jay Edwards',
cmdclass={'build_manpage': build_manpage},
author_email='jay@meangrape.com', |
31aa3fb5aa44d43327942767b89acf0f1375f6b2 | setup.py | setup.py | #!/usr/bin/env python
import os
from glob import glob
if os.environ.get('USE_SETUPTOOLS'):
from setuptools import setup
setup_kwargs = dict(zip_safe=0)
else:
from distutils.core import setup
setup_kwargs = dict()
storage_dirs = [ ('storage/whisper',[]), ('storage/lists',[]),
('storage/log'... | #!/usr/bin/env python
import os
from glob import glob
if os.environ.get('USE_SETUPTOOLS'):
from setuptools import setup
setup_kwargs = dict(zip_safe=0)
else:
from distutils.core import setup
setup_kwargs = dict()
storage_dirs = [ ('storage/whisper',[]), ('storage/lists',[]),
('storage/log'... | Make 0.9.10_pre4 to match webapp | Make 0.9.10_pre4 to match webapp
| Python | apache-2.0 | mleinart/carbon,kharandziuk/carbon,lyft/carbon,protochron/carbon,pu239ppy/carbon,JeanFred/carbon,johnseekins/carbon,xadjmerripen/carbon,pratX/carbon,criteo-forks/carbon,graphite-project/carbon,obfuscurity/carbon,benburry/carbon,piotr1212/carbon,xadjmerripen/carbon,graphite-server/carbon,kharandziuk/carbon,iain-buclaw-s... | ---
+++
@@ -19,7 +19,7 @@
setup(
name='carbon',
- version='0.9.10_pre3',
+ version='0.9.10_pre4',
url='https://launchpad.net/graphite',
author='Chris Davis',
author_email='chrismd@gmail.com', |
584b4f08cb1dacd57fde85b11824709e10d657ce | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='hadmin',
version='0.1',
packages=find_packages(),
author='Alec Ten Harmsel',
author_email='alec@alectenharmsel.com',
description='A Hadoop configuration manager',
url='http://github.com/trozamon/hadmin',
license='MIT',
test_su... | from setuptools import setup, find_packages
setup(
name='hadmin',
version='0.1',
packages=find_packages(),
author='Alec Ten Harmsel',
author_email='alec@alectenharmsel.com',
description='A Hadoop configuration manager',
url='http://github.com/trozamon/hadmin',
license='MIT',
test_su... | Make flake8 test only dependency | Make flake8 test only dependency
| Python | mit | trozamon/hadmin | ---
+++
@@ -10,7 +10,7 @@
url='http://github.com/trozamon/hadmin',
license='MIT',
test_suite='hadmin.test',
- setup_requires=['flake8'],
+ tests_require=['flake8'],
entry_points={
'console_scripts': [
'hadmin = hadmin.util:run' |
75a8d2ed6a3fa03ca132388182b1e7876fb6413e | setup.py | setup.py | #!/usr/bin/env python
from __future__ import unicode_literals
from setuptools import setup, find_packages
install_requires = [
"Jinja2",
"boto>=2.36.0",
"flask",
"httpretty==0.8.10",
"requests",
"xmltodict",
"six",
"werkzeug",
"sure",
"freezegun"
]
extras_require = {
# No b... | #!/usr/bin/env python
from __future__ import unicode_literals
from setuptools import setup, find_packages
install_requires = [
"Jinja2",
"boto>=2.36.0",
"flask",
"httpretty==0.8.10",
"requests",
"xmltodict",
"six",
"werkzeug",
"sure",
"freezegun"
]
extras_require = {
# No b... | Revert "Bumping the version reflecting the bugfix" | Revert "Bumping the version reflecting the bugfix"
This reverts commit 7f3daf4755aff19d04acf865df39f7d188655b15.
| Python | apache-2.0 | okomestudio/moto,spulec/moto,spulec/moto,heddle317/moto,Affirm/moto,okomestudio/moto,whummer/moto,2rs2ts/moto,Affirm/moto,ZuluPro/moto,rocky4570/moto,Brett55/moto,spulec/moto,gjtempleton/moto,2rs2ts/moto,okomestudio/moto,2rs2ts/moto,gjtempleton/moto,Brett55/moto,heddle317/moto,botify-labs/moto,spulec/moto,2rs2ts/moto,h... | ---
+++
@@ -22,7 +22,7 @@
setup(
name='moto',
- version='0.4.28',
+ version='0.4.27',
description='A library that allows your python tests to easily'
' mock out the boto library',
author='Steve Pulec', |
4c4a7a016abed4a0710ceffc35a985210cc52ab7 | setup.py | setup.py | from setuptools import setup
import os
version = 0.4
setup(
version=version,
description="A script allowing to setup Amazon EC2 instances through configuration files.",
long_description=open("README.txt").read() + "\n\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
name="mr... | from setuptools import setup
import os
version = 0.4
setup(
version=version,
description="A script allowing to setup Amazon EC2 instances through configuration files.",
long_description=open("README.txt").read() + "\n\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
name="mr... | Set minimum version for dependencies. | Set minimum version for dependencies.
| Python | bsd-3-clause | ployground/ploy,fschulze/ploy,ployground/ploy_fabric,ployground/ploy_ec2 | ---
+++
@@ -18,7 +18,7 @@
namespace_packages=['mr'],
install_requires=[
'setuptools',
- 'boto',
- 'Fabric',
+ 'boto >= 1.9b',
+ 'Fabric >= 0.9.0',
],
) |
18bd0bcc0d892aef4ea9babfc6ec2af6e40cea62 | manager/urls.py | manager/urls.py | from django.conf.urls import url
from manager import views
urlpatterns = [
url(r'^$', views.package_list, name='package_list'),
url(r'^packages/(?P<package_name>[a-zA-Z0-9_+-]+)/$', views.package_detail, name='package_detail'),
url(r'^packages/(?P<package_name>[a-zA-Z0-9_+-]+)/build/$', views.package_build... | from django.conf.urls import url
from manager import views
urlpatterns = [
url(r'^$', views.package_list, name='package_list'),
url(r'^packages/$', views.package_list, name='package_list'),
url(r'^packages/(?P<package_name>[a-zA-Z0-9_+-]+)/$', views.package_detail, name='package_detail'),
url(r'^packag... | Add alternative package list url | Add alternative package list url
| Python | mit | colajam93/aurpackager,colajam93/aurpackager,colajam93/aurpackager,colajam93/aurpackager | ---
+++
@@ -3,6 +3,7 @@
urlpatterns = [
url(r'^$', views.package_list, name='package_list'),
+ url(r'^packages/$', views.package_list, name='package_list'),
url(r'^packages/(?P<package_name>[a-zA-Z0-9_+-]+)/$', views.package_detail, name='package_detail'),
url(r'^packages/(?P<package_name>[a-zA-Z... |
646b0f8babf346f3ec21ae688453deee24fb410f | tests/core/tests/base_formats_tests.py | tests/core/tests/base_formats_tests.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.test import TestCase
from django.utils.text import force_text
from import_export.formats import base_formats
class XLSTest(TestCase):
def test_binary_format(self):
self.assertTrue(base_formats.XLS().is_binary())
cl... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.test import TestCase
try:
from django.utils.encoding import force_text
except ImportError:
from django.utils.encoding import force_unicode as force_text
from import_export.formats import base_formats
class XLSTest(TestCa... | Fix importing force_text tests for 1.4 compatibility | Fix importing force_text tests for 1.4 compatibility
use 1.4 compat code
| Python | bsd-2-clause | copperleaftech/django-import-export,PetrDlouhy/django-import-export,PetrDlouhy/django-import-export,rhunwicks/django-import-export,copperleaftech/django-import-export,Apkawa/django-import-export,jnns/django-import-export,PetrDlouhy/django-import-export,daniell/django-import-export,django-import-export/django-import-exp... | ---
+++
@@ -4,7 +4,11 @@
import os
from django.test import TestCase
-from django.utils.text import force_text
+
+try:
+ from django.utils.encoding import force_text
+except ImportError:
+ from django.utils.encoding import force_unicode as force_text
from import_export.formats import base_formats
|
913d7562a8be59561c2e7309eb51aa63bc013ad3 | build/setup.py | build/setup.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Add scipy as a dependency of jaxlib. | Add scipy as a dependency of jaxlib.
Jaxlib depends on LAPACK kernels provided by Scipy. | Python | apache-2.0 | google/jax,google/jax,tensorflow/probability,google/jax,tensorflow/probability,google/jax | ---
+++
@@ -25,7 +25,7 @@
author='JAX team',
author_email='jax-dev@google.com',
packages=['jaxlib'],
- install_requires=['numpy>=1.12', 'six', 'protobuf>=3.6.0', 'absl-py'],
+ install_requires=['scipy', 'numpy>=1.12', 'six', 'protobuf>=3.6.0', 'absl-py'],
url='https://github.com/google/jax',... |
a3d655bd311161679bafbcad66f678d412e158f0 | colour/examples/volume/examples_rgb.py | colour/examples/volume/examples_rgb.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Showcases RGB colourspace volume computations.
"""
from __future__ import division, unicode_literals
import colour
from colour.utilities.verbose import message_box
message_box('RGB Colourspace Volume Computations')
message_box('Computing "ProPhoto RGB" RGB coloursp... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Showcases RGB colourspace volume computations.
"""
from __future__ import division, unicode_literals
import colour
from colour.utilities.verbose import message_box
message_box('RGB Colourspace Volume Computations')
message_box('Computing "ProPhoto RGB" RGB coloursp... | Add "Pointer's Gamut" coverage computation example. | Add "Pointer's Gamut" coverage computation example.
| Python | bsd-3-clause | colour-science/colour | ---
+++
@@ -25,3 +25,11 @@
colour.PROPHOTO_RGB_COLOURSPACE,
samples=samples,
limits=limits * 1.1))
+
+print('\n')
+
+message_box(('Computing "ProPhoto RGB" RGB colourspace coverage of Pointer\'s '
+ 'Gamut using {0} samples.'.format(samples)))
+print(colour.RGB_colourspace_pointer_gamut_cov... |
160f29d42086a10bc38d255d8e03a30b1eb01deb | medical_prescription_sale/__openerp__.py | medical_prescription_sale/__openerp__.py | # -*- coding: utf-8 -*-
# © 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Medical Prescription Sales',
'summary': 'Create Sale Orders from Prescriptions',
'version': '9.0.0.1.0',
'author': "LasLabs, Odoo Community Association (OCA)",
'category': ... | # -*- coding: utf-8 -*-
# © 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Medical Prescription Sales',
'summary': 'Create Sale Orders from Prescriptions',
'version': '9.0.0.1.0',
'author': "LasLabs, Odoo Community Association (OCA)",
'category': ... | Add dependency * Add dependency on stock to manifest file. This is needed by some of the demo data in the module, which was not installing due to its absence. | [FIX] medical_prescription_sale: Add dependency
* Add dependency on stock to manifest file. This is needed by some of the demo
data in the module, which was not installing due to its absence.
| Python | agpl-3.0 | laslabs/vertical-medical,laslabs/vertical-medical | ---
+++
@@ -11,6 +11,7 @@
'category': 'Medical',
'depends': [
'sale',
+ 'stock',
'medical_prescription',
'medical_pharmacy',
'medical_prescription_thread', |
81b77db1a455a976a5c516decb5fdd141f10bc31 | Lib/test/test_fork1.py | Lib/test/test_fork1.py | """This test checks for correct fork() behavior.
"""
import os
import time
import unittest
from test.fork_wait import ForkWait
from test.test_support import run_unittest, reap_children
try:
os.fork
except AttributeError:
raise unittest.SkipTest, "os.fork not defined -- skipping test_fork1"
class ForkTest(For... | """This test checks for correct fork() behavior.
"""
import os
import time
from test.fork_wait import ForkWait
from test.test_support import run_unittest, reap_children, import_module
import_module('os.fork')
class ForkTest(ForkWait):
def wait_impl(self, cpid):
for i in range(10):
# waitpid(... | Convert import try/except to use test_support.import_module(). | Convert import try/except to use test_support.import_module().
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | ---
+++
@@ -3,14 +3,11 @@
import os
import time
-import unittest
from test.fork_wait import ForkWait
-from test.test_support import run_unittest, reap_children
+from test.test_support import run_unittest, reap_children, import_module
-try:
- os.fork
-except AttributeError:
- raise unittest.SkipTest, "os.... |
9ea9d111c8b6a20015f9ad6149f690c9e8c0774d | tools/tiny-test-fw/Utility/__init__.py | tools/tiny-test-fw/Utility/__init__.py | from __future__ import print_function
import sys
_COLOR_CODES = {
"white": '\033[0m',
"red": '\033[31m',
"green": '\033[32m',
"orange": '\033[33m',
"blue": '\033[34m',
"purple": '\033[35m',
"W": '\033[0m',
"R": '\033[31m',
"G": '\033[32m',
"O": '\033[33m',
"B": '\033[34m'... | from __future__ import print_function
import sys
_COLOR_CODES = {
"white": u'\033[0m',
"red": u'\033[31m',
"green": u'\033[32m',
"orange": u'\033[33m',
"blue": u'\033[34m',
"purple": u'\033[35m',
"W": u'\033[0m',
"R": u'\033[31m',
"G": u'\033[32m',
"O": u'\033[33m',
"B": u... | Make Utility.console_log accept Unicode and byte strings as well | tools: Make Utility.console_log accept Unicode and byte strings as well
| Python | apache-2.0 | mashaoze/esp-idf,espressif/esp-idf,armada-ai/esp-idf,www220/esp-idf,www220/esp-idf,mashaoze/esp-idf,www220/esp-idf,www220/esp-idf,mashaoze/esp-idf,espressif/esp-idf,www220/esp-idf,espressif/esp-idf,espressif/esp-idf,armada-ai/esp-idf,mashaoze/esp-idf,armada-ai/esp-idf,armada-ai/esp-idf,mashaoze/esp-idf | ---
+++
@@ -3,18 +3,18 @@
_COLOR_CODES = {
- "white": '\033[0m',
- "red": '\033[31m',
- "green": '\033[32m',
- "orange": '\033[33m',
- "blue": '\033[34m',
- "purple": '\033[35m',
- "W": '\033[0m',
- "R": '\033[31m',
- "G": '\033[32m',
- "O": '\033[33m',
- "B": '\033[34m',
- ... |
7baaac652f74ea44817cd48eb1a4b3aa36f94e23 | armstrong/hatband/sites.py | armstrong/hatband/sites.py | from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class AdminSite(DjangoAdminSite):
def get_urls(self):
from django.conf.urls.defaults import patterns, url
return patterns('',
# Custom hatband Views here
... | from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class HatbandAndDjangoRegistry(object):
def __init__(self, site, default_site=None):
if default_site is None:
default_site = django_site
super(HatbandAndDjango... | Revert "Simplify this code and make sure AdminSite doesn't act like a singleton" | Revert "Simplify this code and make sure AdminSite doesn't act like a singleton"
Unfortunately, it's not that simple. Without the runtime merging from
inside hatband.AdminSite, this doesn't seem to pick up everything else.
This reverts commit 122b4e6982fe7a74ee668c1b146c32a61c72ec7b.
| Python | apache-2.0 | texastribune/armstrong.hatband,armstrong/armstrong.hatband,armstrong/armstrong.hatband,armstrong/armstrong.hatband,texastribune/armstrong.hatband,texastribune/armstrong.hatband | ---
+++
@@ -2,7 +2,38 @@
from django.contrib.admin.sites import site as django_site
+class HatbandAndDjangoRegistry(object):
+ def __init__(self, site, default_site=None):
+ if default_site is None:
+ default_site = django_site
+ super(HatbandAndDjangoRegistry, self).__init__()
+ ... |
812d456599e1540e329a4ddc05a7541b5bfdc149 | labonneboite/conf/__init__.py | labonneboite/conf/__init__.py | import imp
import os
from labonneboite.conf.common import settings_common
# Settings
# --------
# Default settings of the application are defined in `labonneboite/conf/common/settings_common.py`.
# A specific environment (staging, production...) can define its custom settings by:
# - creating a specific `settings` f... | import imp
import os
from labonneboite.conf.common import settings_common
# Settings
# --------
# Default settings of the application are defined in `labonneboite/conf/common/settings_common.py`.
# A specific environment (staging, production...) can define its custom settings by:
# - creating a specific `settings` f... | Fix FileNotFoundError on missing local_settings.py | Fix FileNotFoundError on missing local_settings.py
This has been broken for a long time... When running LBB without a
local_settings.py and without an LBB_ENV environment variable, importing
local_settings.py was resulting in a FileNotFoundError.
| Python | agpl-3.0 | StartupsPoleEmploi/labonneboite,StartupsPoleEmploi/labonneboite,StartupsPoleEmploi/labonneboite,StartupsPoleEmploi/labonneboite | ---
+++
@@ -22,10 +22,13 @@
# Don't override settings in tests
settings_module = os.path.join(os.path.dirname(__file__), 'local_settings.py')
settings_module = os.environ.get('LBB_SETTINGS', settings_module)
- settings = imp.load_source('settings', settings_module)
-
- # Iterate over each setting... |
1f4ff058d14a32e7e7b9a28daee54a2e8ea1eb02 | media.py | media.py | # media.py
class Movie(object):
def __init__(self,
title,
storyline,
poster_image_url,
trailer_youtube_url,
lead_actors,
release_date,
mpaa_rating,
language,
run... | # media.py
class Movie(object):
""" Movie class for creating a movie """
def __init__(self,
title,
storyline,
poster_image_url,
trailer_youtube_url,
lead_actors,
release_date,
mpaa_rating,
... | Add docstring for class Movie | Add docstring for class Movie
| Python | mit | vishallama/udacity-fullstack-movie-trailer,vishallama/udacity-fullstack-movie-trailer | ---
+++
@@ -2,6 +2,7 @@
class Movie(object):
+ """ Movie class for creating a movie """
def __init__(self,
title,
storyline,
@@ -15,6 +16,20 @@
production_companies,
trivia
):
+ """
+ Args:
+ ... |
4dcb0e56627d3b801b5377d77fca721c43090ce2 | bom_data_parser/axf_parser.py | bom_data_parser/axf_parser.py | import csv
def read_axf(axf_string):
blocks = {}
state = 'new_block'
for line in axf_string.split('\n'):
if line == '[$]' or line == '':
pass
elif line.startswith('['):
block_key = line.replace('[',"").replace(']',"")
print block_key
else:
... | import csv
def read_axf(axf_string):
blocks = {}
state = 'new_block'
for line in axf_string.split('\n'):
if line == '[$]' or line == '':
pass
elif line.startswith('['):
block_key = line.replace('[',"").replace(']',"")
else:
if block_key not in ... | Fix some print statments for Python3 compatibility. | Fix some print statments for Python3 compatibility.
| Python | bsd-3-clause | amacd31/bom_data_parser,amacd31/bom_data_parser | ---
+++
@@ -10,7 +10,6 @@
elif line.startswith('['):
block_key = line.replace('[',"").replace(']',"")
- print block_key
else:
if block_key not in blocks:
@@ -43,4 +42,4 @@
return read_axf(f.read())
if __name__ == "__main__":
- print read_axf_fi... |
828d03d7a49d65e8584d4bc373ae4d429b291104 | tests/test_tensorflow_addons.py | tests/test_tensorflow_addons.py | import unittest
import tensorflow as tf
import tensorflow_addons as tfa
class TestTensorflowAddons(unittest.TestCase):
def test_tfa_image(self):
img_raw = tf.io.read_file('/input/tests/data/dot.png')
img = tf.io.decode_image(img_raw)
img = tf.image.convert_image_dtype(img, tf.float32)
... | import unittest
import numpy as np
import tensorflow as tf
import tensorflow_addons as tfa
class TestTensorflowAddons(unittest.TestCase):
def test_tfa_image(self):
img_raw = tf.io.read_file('/input/tests/data/dot.png')
img = tf.io.decode_image(img_raw)
img = tf.image.convert_image_dtype(i... | Add a test exercising TFA custom op. | Add a test exercising TFA custom op.
To prevent future regression.
BUG=145555176
| Python | apache-2.0 | Kaggle/docker-python,Kaggle/docker-python | ---
+++
@@ -1,5 +1,6 @@
import unittest
+import numpy as np
import tensorflow as tf
import tensorflow_addons as tfa
@@ -12,3 +13,11 @@
mean = tfa.image.mean_filter2d(img, filter_shape=1)
self.assertEqual(1, len(mean))
+
+ # This test exercises TFA Custom Op. See: b/145555176
+ def... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.