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 |
|---|---|---|---|---|---|---|---|---|---|---|
979c56f882178ce49194850bd9e78c9dea4692dd | chardet/__init__.py | chardet/__init__.py | ######################## BEGIN LICENSE BLOCK ########################
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ve... | ######################## BEGIN LICENSE BLOCK ########################
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ve... | Remove unnecessary line from detect | Remove unnecessary line from detect
| Python | lgpl-2.1 | ddboline/chardet,chardet/chardet,chardet/chardet,ddboline/chardet | ---
+++
@@ -36,5 +36,4 @@
byte_str = bytearray(byte_str)
detector = UniversalDetector()
detector.feed(byte_str)
- detector.close()
- return detector.result
+ return detector.close() |
e0989ff4c2292d0f2d053065bfa71124a3705559 | jarn/mkrelease/colors.py | jarn/mkrelease/colors.py | import os
import functools
import blessed
def color(func):
functools.wraps(func)
def wrapper(string):
if os.environ.get('JARN_NO_COLOR') == '1':
return string
return func(string)
return wrapper
term = blessed.Terminal()
bold = color(term.bold)
blue = color(term.bold_blue)
gr... | import os
import functools
import blessed
def color(func):
assignments = functools.WRAPPER_ASSIGNMENTS
if not hasattr(func, '__name__'):
assignments = [x for x in assignments if x != '__name__']
@functools.wraps(func, assignments)
def wrapper(string):
if os.environ.get('JARN_NO_COLOR'... | Fix wrapping in color decorator. | Fix wrapping in color decorator.
| Python | bsd-2-clause | Jarn/jarn.mkrelease | ---
+++
@@ -4,7 +4,11 @@
def color(func):
- functools.wraps(func)
+ assignments = functools.WRAPPER_ASSIGNMENTS
+ if not hasattr(func, '__name__'):
+ assignments = [x for x in assignments if x != '__name__']
+
+ @functools.wraps(func, assignments)
def wrapper(string):
if os.envir... |
f036e74a6d887a5267885ef09cfe9c3a4de7eea5 | config.py | config.py | import os
config = {
'DEBUG': not os.getenv('SERVER_SOFTWARE', '').startswith('Google App Engine/'),
'SECRET_KEY': 'Some big sentence',
} | import os
config = {
'DEBUG': True if os.getenv('SERVER_SOFTWARE', '').startswith('Development/') else False,
'SECRET_KEY': 'Some big sentence',
}
| Set DEBUG to true only when using Development server | Set DEBUG to true only when using Development server
| Python | mit | i2nes/app-engine-blog,i2nes/app-engine-blog,i2nes/app-engine-blog | ---
+++
@@ -2,6 +2,6 @@
config = {
- 'DEBUG': not os.getenv('SERVER_SOFTWARE', '').startswith('Google App Engine/'),
+ 'DEBUG': True if os.getenv('SERVER_SOFTWARE', '').startswith('Development/') else False,
'SECRET_KEY': 'Some big sentence',
} |
70d2f182c09583802da2860994a99fd2bc9e39d5 | kimochiconsumer/views.py | kimochiconsumer/views.py | from pyramid.view import view_config
from pyramid.httpexceptions import (
HTTPNotFound,
)
@view_config(route_name='page', renderer='templates/page.mako')
@view_config(route_name='page_view', renderer='templates/page.mako')
def page_view(request):
if 'page_id' in request.matchdict:
data = request.kimoc... | from pyramid.view import view_config
from pyramid.httpexceptions import (
HTTPNotFound,
)
@view_config(route_name='page', renderer='templates/page.mako')
@view_config(route_name='page_view', renderer='templates/page.mako')
def page_view(request):
if 'page_id' in request.matchdict:
data = request.kimoc... | Use 'index' as the default page alias for lookups | Use 'index' as the default page alias for lookups
| Python | mit | matslindh/kimochi-consumer | ---
+++
@@ -10,7 +10,7 @@
if 'page_id' in request.matchdict:
data = request.kimochi.page(request.matchdict['page_id'])
else:
- data = request.kimochi.page('1')
+ data = request.kimochi.page('index')
return data
|
c537ec56660d6829c3297db9760fc75e2f6260b2 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
with open('README.md') as f:
long_description = f.read().strip()
setup(name='python-circuit',
version='0.1.6',
description='Simple implementation of the Circuit Breaker pattern',
long_description=long_description,
author='Edgeware',
... | #!/usr/bin/env python
from setuptools import setup
with open('README.md') as f:
long_description = f.read().strip()
setup(name='python-circuit',
version='0.1.6',
description='Simple implementation of the Circuit Breaker pattern',
long_description=long_description,
author='Edgeware',
... | Remove deprecated kwarg and undefined variable. | Remove deprecated kwarg and undefined variable.
| Python | apache-2.0 | edgeware/python-circuit | ---
+++
@@ -16,5 +16,4 @@
tests_require=[
'mockito==0.5.2',
'Twisted>=10.2'
- ],
- cmdclass=commands)
+ ]) |
db442d2300ee99f8b062432225291696f26448b7 | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
setup(
name='django-addendum',
version='0.0.1',
description='Simple template-based content swapping for CMS-less sites',
long_description=readme,
author='Ben Lopatin',
auth... | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
setup(
name='django-addendum',
version='0.0.2',
description='Simple template-based content swapping for CMS-less sites',
long_description=readme,
author='Ben Lopatin',
auth... | Fix version for migrations fix | Fix version for migrations fix
| Python | bsd-2-clause | adw0rd/django-addendum-inline,bennylope/django-addendum,bennylope/django-addendum,adw0rd/django-addendum-inline | ---
+++
@@ -8,7 +8,7 @@
setup(
name='django-addendum',
- version='0.0.1',
+ version='0.0.2',
description='Simple template-based content swapping for CMS-less sites',
long_description=readme,
author='Ben Lopatin', |
0dce3b4101b29ecb79d5743d2c86b40c22d0e7e9 | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst', 'r') as f:
long_desc = f.read().decode('utf-8')
setup(name='dmgbuild',
version='1.0.0',
description='Mac OS X command line utility to build disk images',
long_description=long_desc,
author='Alastair Houghton',
... | # -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst', 'r') as f:
long_desc = f.read().decode('utf-8')
setup(name='dmgbuild',
version='1.0.0',
description='Mac OS X command line utility to build disk images',
long_description=long_desc,
author='Alastair Houghton',
... | Add previously undeclared PyObjC Quartz dependency. | Add previously undeclared PyObjC Quartz dependency.
| Python | mit | al45tair/dmgbuild | ---
+++
@@ -25,6 +25,7 @@
scripts=['scripts/dmgbuild'],
install_requires=['ds_store >= 1.0.1',
'mac_alias >= 1.0.0',
- 'six >= 1.4.1'],
+ 'six >= 1.4.1',
+ 'pyobjc-framework-Quartz >= 3.0.4'],
provides=[... |
5ed223883a39c58af7db10d92829894407fba822 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
#from distutils.core import setup
setup(name='imagesize',
version='0.7.1',
description='Getting image size from png/jpeg/jpeg2000/gif file',
long_description='''
It parses image files' header and return image size.
* PNG
* JPEG
* JPEG2000
* GIF
Th... | #!/usr/bin/env python
from setuptools import setup
#from distutils.core import setup
setup(name='imagesize',
version='0.7.1',
description='Getting image size from png/jpeg/jpeg2000/gif file',
long_description='''
It parses image files' header and return image size.
* PNG
* JPEG
* JPEG2000
* GIF
Th... | Document project is stable and ready for use in production | Document project is stable and ready for use in production
| Python | mit | shibukawa/imagesize_py | ---
+++
@@ -23,7 +23,7 @@
py_modules=['imagesize'],
test_suite='test',
classifiers = [
- 'Development Status :: 4 - Beta',
+ 'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
... |
436fa5dd4ee955b35ef9d68a0f6b293f957e2ce0 | setup.py | setup.py | from distutils.core import setup
setup(
name = 'jsuite',
packages = ['jsuite'], # this must be the same as the name above
version = '0.3.0',
scripts=['bin/jsuite'],
install_requires = [
'lxml==3.6.4',
'clint==0.5.1'
],
description = 'Parsing and manipulation tools for JATS XML files.',
author... | from distutils.core import setup
setup(
name = 'jsuite',
packages = ['jsuite'], # this must be the same as the name above
version = '0.4.0',
scripts=['bin/jsuite'],
install_requires = [
'lxml==3.6.4',
'clint==0.5.1'
],
description = 'Parsing and manipulation tools for JATS XML files.',
author... | Add count function across entire document | v0.4.0: Add count function across entire document
| Python | mit | schatten/jsuite,TypesetIO/jsuite | ---
+++
@@ -3,7 +3,7 @@
setup(
name = 'jsuite',
packages = ['jsuite'], # this must be the same as the name above
- version = '0.3.0',
+ version = '0.4.0',
scripts=['bin/jsuite'],
install_requires = [ |
ad6c51fdbc0fbfa2993902b89a7dac04b62a244f | setup.py | setup.py | from setuptools import setup
import transip
setup(
name = transip.__name__,
version = transip.__version__,
author = transip.__author__,
author_email = transip.__email__,
license = transip.__license__,
description = transip.__doc__.splitlines()[0],
long_description = open('README.rst').read... | from setuptools import setup
import transip
setup(
name = transip.__name__,
version = transip.__version__,
author = transip.__author__,
author_email = transip.__email__,
license = transip.__license__,
description = transip.__doc__.splitlines()[0],
long_description = open('README.rst').read... | Add package transip.service or else this is not installed | Add package transip.service or else this is not installed
| Python | mit | benkonrath/transip-api,benkonrath/transip-api | ---
+++
@@ -12,7 +12,7 @@
long_description = open('README.rst').read(),
url = 'http://github.com/goabout/transip-backup',
download_url = 'http://github.com/goabout/transip-backup/archives/master',
- packages = ['transip'],
+ packages = ['transip', 'transip.service'],
include_package_data = T... |
9ddc63eb0e1e3612ac4a1ea5b95e405ca0915b52 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name="sysops-api",
version="1.0",
description="LinkedIn Redis / Cfengine API",
author = "Mike Svoboda",
author_email = "msvoboda@linkedin.com",
py_modules=['CacheExtractor', 'RedisFinder'],
data_files=[('/usr/local/bin', [... | #!/usr/bin/env python
from distutils.core import setup
setup(name="sysops-api",
version="1.0",
description="LinkedIn Redis / Cfengine API",
author="Mike Svoboda",
author_email="msvoboda@linkedin.com",
py_modules=['CacheExtractor', 'RedisFinder'],
scripts=['scripts/extract_sysops_cac... | Install scripts properly rather than as datafiles | Install scripts properly rather than as datafiles
- also fix whitespace
| Python | apache-2.0 | linkedin/sysops-api,linkedin/sysops-api,slietz/sysops-api,slietz/sysops-api | ---
+++
@@ -4,14 +4,14 @@
setup(name="sysops-api",
version="1.0",
description="LinkedIn Redis / Cfengine API",
- author = "Mike Svoboda",
- author_email = "msvoboda@linkedin.com",
+ author="Mike Svoboda",
+ author_email="msvoboda@linkedin.com",
py_modules=['CacheExtractor', '... |
a88452582e8d5ac01f9ccbdd3bf1736bf2209af2 | setup.py | setup.py | import sys
import os
from setuptools import setup
long_description = open('README.rst').read()
classifiers = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
]
setup_kwargs = dict(
name='... | import sys
import os
from setuptools import setup
long_description = open('README.rst').read()
classifiers = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Pytho... | Update to depend on separate powershift-cli package. | Update to depend on separate powershift-cli package.
| Python | bsd-2-clause | getwarped/powershift-cluster,getwarped/powershift-cluster | ---
+++
@@ -10,6 +10,7 @@
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
]
setup_kwargs = dict(
@@ -17,7 +18,7 @@
version='1.0.4',
description='PowerShift command plugi... |
381c2a53b9aa11acb140d7807fc218c003e14f5b | setup.py | setup.py | from __future__ import unicode_literals
import re
from setuptools import setup
def get_version(filename):
content = open(filename).read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content))
return metadata['version']
setup(
name='Mopidy-Scrobbler',
version=get_version('mopidy_scrob... | from __future__ import unicode_literals
import re
from setuptools import setup
def get_version(filename):
content = open(filename).read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content))
return metadata['version']
setup(
name='Mopidy-Scrobbler',
version=get_version('mopidy_scrob... | Add dependency on pylast, update project URL | Add dependency on pylast, update project URL
| Python | apache-2.0 | mopidy/mopidy-scrobbler,mthssdrbrg/mopidy-scrobbler | ---
+++
@@ -13,7 +13,7 @@
setup(
name='Mopidy-Scrobbler',
version=get_version('mopidy_scrobbler/__init__.py'),
- url='https://github.com/jodal/mopidy-scrobbler',
+ url='https://github.com/mopidy/mopidy-scrobbler',
license='Apache License, Version 2.0',
author='Stein Magnus Jodal',
auth... |
7ae590a0ba1b8fba8eb6643c9a44fe848fe9c5ee | setup.py | setup.py | from setuptools import setup, find_packages
install_requires = [
'prompt_toolkit',
'pathlib',
'python-keystoneclient'
]
test_requires = [
'mock'
]
setup(
name='contrail-api-cli',
version='0.1a2',
description="Simple CLI program to browse Contrail API server",
long_description=open('RE... | import sys
from setuptools import setup, find_packages
install_requires = [
'prompt_toolkit',
'python-keystoneclient'
]
test_requires = []
if sys.version_info[0] == 2:
install_requires.append('pathlib')
test_requires.append('mock')
setup(
name='contrail-api-cli',
version='0.1a2',
descri... | Install requirements depending on python version | Install requirements depending on python version
| Python | mit | eonpatapon/contrail-api-cli | ---
+++
@@ -1,14 +1,17 @@
+import sys
from setuptools import setup, find_packages
install_requires = [
'prompt_toolkit',
- 'pathlib',
'python-keystoneclient'
]
-test_requires = [
- 'mock'
-]
+test_requires = []
+
+if sys.version_info[0] == 2:
+ install_requires.append('pathlib')
+ test_re... |
6dc434de2b23f4a8e93e5969d52eb6f641b9665f | setup.py | setup.py | #!/usr/bin/env python
import sys
import os
if "publish" in sys.argv[-1]:
os.system("python setup.py sdist upload")
sys.exit()
try:
from setuptools import setup
setup
except ImportError:
from distutils.core import setup
setup
# Command-line tools
entry_points = {'console_scripts': [
'K2on... | #!/usr/bin/env python
import sys
import os
if "publish" in sys.argv[-1]:
os.system("python setup.py sdist upload")
sys.exit()
try:
from setuptools import setup
setup
except ImportError:
from distutils.core import setup
setup
# Command-line tools
entry_points = {'console_scripts': [
'K2on... | Bump version to v3.0.0 - ready for release | Bump version to v3.0.0 - ready for release
| Python | mit | mrtommyb/K2fov,KeplerGO/K2fov | ---
+++
@@ -23,7 +23,7 @@
]}
setup(name='K2fov',
- version='2.1.dev',
+ version='3.0.0',
description='Find which targets are in the field of view of K2',
author='Tom Barclay',
author_email='tom@tombarclay.com', |
1fe9117c57a947eb22a1f269220d21553a131f02 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-yadt',
url='https://chris-lamb.co.uk/projects/django-yadt',
version='2.0.5',
description="Yet Another Django Thumbnailer",
author="Chris Lamb",
author_email='chris@chris-lamb.co.uk',
license='BSD',
... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-yadt',
url='https://chris-lamb.co.uk/projects/django-yadt',
version='2.0.5',
description="Yet Another Django Thumbnailer",
author="Chris Lamb",
author_email='chris@chris-lamb.co.uk',
license='BSD',
... | Update Django requirement to latest LTS | Update Django requirement to latest LTS
| Python | bsd-3-clause | lamby/django-yadt | ---
+++
@@ -16,7 +16,7 @@
packages=find_packages(),
install_requires=(
- 'Django>=1.6.8',
+ 'Django>=1.8',
'Pillow',
),
) |
b2e378a747f4cd1172c9c8bffecda327c3dd25cc | setup.py | setup.py | import os
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.... | import os
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.... | Install url from the right place. | Install url from the right place.
| Python | bsd-3-clause | sunlightlabs/nanospider | ---
+++
@@ -29,9 +29,9 @@
"gevent",
"scrapelib",
"lxml",
- "url>=0.1.2dev",
+ "url>=0.1.3",
],
dependency_links=[
- "git+https://github.com/seomoz/url-py.git#egg=url-0.1.2dev",
+ "git+https://github.com/seomoz/url-py.git#egg=url-0.1.3",
],
) |
9cb406e18cedf8995c31a1760968a1ee86423c5f | setup.py | setup.py | #!/usr/bin/env python3
from setuptools import setup, find_packages
# We want to restrict newer versions while we deal with upstream breaking changes.
discordpy_version = '==0.10.0'
# TODO read README(.rst? .md looks bad on pypi) for long_description.
# Could use pandoc, but the end user shouldn't need to do thi... | #!/usr/bin/env python3
from setuptools import setup, find_packages
# We want to restrict newer versions while we deal with upstream breaking changes.
discordpy_version = '==0.10.0'
# TODO read README(.rst? .md looks bad on pypi) for long_description.
# Could use pandoc, but the end user shouldn't need to do thi... | Tweak the package name, add a note | Tweak the package name, add a note
| Python | mit | TAOTheCrab/CrabBot | ---
+++
@@ -11,7 +11,7 @@
setup(
# More permanent entries
- name='CrabBot',
+ name='crabbot',
author='TAOTheCrab',
url='https://github.com/TAOTheCrab/CrabBot',
license='MIT',
@@ -36,4 +36,6 @@
'youtube_dl'
]
}
+
+ # scripts=['__main__.py']
) |
5844d7203a2f17752bbeca57dd404b83cc8ad475 | setup.py | setup.py | from setuptools import setup
with open('README.md') as readme_file:
long_description = readme_file.read()
setup(
name="ipuz",
version="0.1.1",
license="MIT",
description="Python library for reading and writing ipuz puzzle files",
long_description=long_description,
author="Simeon Visser",... | from setuptools import setup
with open('README.md') as readme_file:
long_description = readme_file.read()
setup(
name="ipuz",
version="0.1.1",
license="MIT",
description="Python library for reading and writing ipuz puzzle files",
long_description=long_description,
author="Simeon Visser",... | Allow more flexibility in what six version is used | Allow more flexibility in what six version is used
| Python | mit | svisser/ipuz | ---
+++
@@ -15,7 +15,7 @@
author_email="simeonvisser@gmail.com",
url="https://github.com/svisser/ipuz",
install_requires=[
- 'six==1.6.1'
+ 'six'
],
packages=['ipuz', 'ipuz.puzzlekinds', 'ipuz.structures'],
classifiers=[ |
e693352b2c9787748cb1dcf2bfd6e134292bfa6a | setup.py | setup.py | import sys, os
from setuptools import setup, Extension, find_packages
import numpy
kws = {}
if not int(os.getenv( 'DISABLE_INSTALL_REQUIRES','0' )):
kws['install_requires'] = [
'numpy>=1.0.4',
]
setup(name="motmot.imops",
description="image format conversion (e.g. between MONO8, YUV422, and... | import sys, os
from setuptools import setup, Extension, find_packages
import numpy
# Note when building sdist package:
# Make sure to generate src/imops.c with "pyrexc src/imops.pyx".
kws = {}
if not int(os.getenv( 'DISABLE_INSTALL_REQUIRES','0' )):
kws['install_requires'] = [
'numpy>=1.0.4',
]
... | Add note about building sdist | Add note about building sdist
| Python | bsd-3-clause | motmot/imops,motmot/imops | ---
+++
@@ -2,6 +2,9 @@
from setuptools import setup, Extension, find_packages
import numpy
+
+# Note when building sdist package:
+# Make sure to generate src/imops.c with "pyrexc src/imops.pyx".
kws = {}
if not int(os.getenv( 'DISABLE_INSTALL_REQUIRES','0' )):
@@ -22,7 +25,7 @@
packages = find_packa... |
da58b6ec7b9b74867e7755667988d60218c9699a | setup.py | setup.py | from setuptools import setup
setup(name='mordecai',
version='2.0.0a1',
description='Full text geoparsing and event geocoding',
url='http://github.com/openeventdata/mordecai/',
author='Andy Halterman',
author_email='ahalterman0@gmail.com',
license='MIT',
packages=['mordecai'],
... | from setuptools import setup
setup(name='mordecai',
version='2.0.0a2',
description='Full text geoparsing and event geocoding',
url='http://github.com/openeventdata/mordecai/',
author='Andy Halterman',
author_email='ahalterman0@gmail.com',
license='MIT',
packages=['mordecai'],
... | Update README and fix typos | Update README and fix typos
| Python | mit | openeventdata/mordecai | ---
+++
@@ -1,7 +1,7 @@
from setuptools import setup
setup(name='mordecai',
- version='2.0.0a1',
+ version='2.0.0a2',
description='Full text geoparsing and event geocoding',
url='http://github.com/openeventdata/mordecai/',
author='Andy Halterman', |
f61b8cfcbf98da826a847981834763198db42867 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='ckanext-archiver',
version='0.1',
packages=find_packages(),
install_requires=[
'celery==2.4.5',
'kombu==1.5.1',
'kombu-sqlalchemy==1.1.0',
'SQLAlchemy>=0.6.6',
'requests==0.6.4',
'messytables>=0.1.4... | from setuptools import setup, find_packages
setup(
name='ckanext-archiver',
version='0.1',
packages=find_packages(),
install_requires=[
'celery==2.4.2',
'kombu==2.1.3',
'kombu-sqlalchemy==1.1.0',
'SQLAlchemy>=0.6.6',
'requests==0.6.4',
'messytables>=0.1.4... | Change celery and kombu requirements to match ckanext-datastorer | Change celery and kombu requirements to match ckanext-datastorer
| Python | mit | datagovuk/ckanext-archiver,DanePubliczneGovPl/ckanext-archiver,ckan/ckanext-archiver,DanePubliczneGovPl/ckanext-archiver,DanePubliczneGovPl/ckanext-archiver,datagovuk/ckanext-archiver,ckan/ckanext-archiver,datagovuk/ckanext-archiver,ckan/ckanext-archiver | ---
+++
@@ -5,8 +5,8 @@
version='0.1',
packages=find_packages(),
install_requires=[
- 'celery==2.4.5',
- 'kombu==1.5.1',
+ 'celery==2.4.2',
+ 'kombu==2.1.3',
'kombu-sqlalchemy==1.1.0',
'SQLAlchemy>=0.6.6',
'requests==0.6.4', |
232eba0b7521d4fa7c005339f64690dd0b807cd2 | setup.py | setup.py | from distutils.core import setup
from setuptools import find_packages
import versioneer
with open("requirements.txt") as f:
requirements = f.read().splitlines()
setup(
name="s3contents",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description="A S3-backed ContentsManage... | import os
from distutils.core import setup
from setuptools import find_packages
import versioneer
def read_file(filename):
filepath = os.path.join(
os.path.dirname(os.path.dirname(__file__)), filename)
if os.path.exists(filepath):
return open(filepath).read()
else:
return ''
REQU... | Handle markdown long description for Pypi | Handle markdown long description for Pypi
| Python | apache-2.0 | danielfrg/s3contents | ---
+++
@@ -1,22 +1,33 @@
+import os
from distutils.core import setup
from setuptools import find_packages
import versioneer
-with open("requirements.txt") as f:
- requirements = f.read().splitlines()
+def read_file(filename):
+ filepath = os.path.join(
+ os.path.dirname(os.path.dirname(__file__... |
f157ad4c971628c8fb0b1f94f6fd080c75413064 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name="xoxzo.logwatch",
version="0.4",
packages=find_packages(),
install_requires=[
'Baker==1.3',
'pytz==2016.3',
],
entry_points={
'console_scripts': [
'logwatch = xoxzo.logwatch.main:main',
],
},... | from setuptools import setup, find_packages
setup(
name="xoxzo.logwatch",
version="0.4",
packages=find_packages(),
install_requires=[
'Baker==1.3',
'pytz>=2016.3',
],
entry_points={
'console_scripts': [
'logwatch = xoxzo.logwatch.main:main',
],
},... | Set pytz version minimum 2016.3 | Set pytz version minimum 2016.3
| Python | mit | xoxzo/xoxzo.logwatch | ---
+++
@@ -6,7 +6,7 @@
packages=find_packages(),
install_requires=[
'Baker==1.3',
- 'pytz==2016.3',
+ 'pytz>=2016.3',
],
entry_points={
'console_scripts': [ |
79a6177fa8366879fbb0ed1cb0961cca6b5ab89a | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import materializecssform
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='django-materializecss-form',
version=materializecssform.__version__,
packages=find_packages(),
auth... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import materializecssform
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name='django-materializecss-form',
version=materializecssform.__version__,
packages=find_pac... | Fix possible decoding problem when locale is set to C/ASCII | Fix possible decoding problem when locale is set to C/ASCII
| Python | mit | florent1933/django-materializecss-form,florent1933/django-materializecss-form | ---
+++
@@ -5,7 +5,7 @@
import materializecssform
-with open("README.md", "r") as fh:
+with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup( |
2727fccdb3672e1c7b28e4ba94ec743b53298f26 | src/main.py | src/main.py | '''
Created on Aug 12, 2017
@author: Aditya
This is the main file and will import other modules/codes written for python tkinter demonstration
'''
import program1 as p1
import program2 as p2
import program3 as p3
import program4 as p4
import program5 as p5
import program6 as p6
import program7 as p7
i... | '''
Created on Aug 12, 2017
@author: Aditya
This is the main file and will import other modules/codes written for python tkinter demonstration
'''
import program1 as p1
import program2 as p2
import program3 as p3
import program4 as p4
import program5 as p5
import program6 as p6
import program7 as p7
i... | Include Text App in Main | Include Text App in Main | Python | mit | deshadi/python-gui-demos | ---
+++
@@ -18,6 +18,7 @@
import program10 as p10
import program11 as p11
import program12 as p12
+import program13 as p13
def main():
p1.sayhello()
@@ -32,6 +33,7 @@
p10.launchTopLevelApp()
p11.launchPanedWindowApp()
p12.launchNoteBookApp()
+ p13.launchApp()
if __name__ == '__main... |
ef1bd5c935d6fe814f2755dadff398929a5a23d6 | tasks.py | tasks.py | from datetime import timedelta
from celery import Celery
from celery.utils.log import get_task_logger
import settings
import client
celery = Celery('tasks', broker=settings.CELERY_BROKER, backend=settings.CELERY_RESULT_BACKEND)
@celery.task
def refresh_plows():
client.refresh_plows()
client.logger = get_task_lo... | from datetime import timedelta
from celery import Celery
from celery.utils.log import get_task_logger
import settings
import client
celery = Celery('tasks', broker=settings.CELERY_BROKER, backend=settings.CELERY_RESULT_BACKEND)
@celery.task
def refresh_plows():
client.refresh_plows()
client.logger = get_task_lo... | Update from upstream server every 10 secs | Update from upstream server every 10 secs
| Python | agpl-3.0 | City-of-Helsinki/aura,City-of-Helsinki/aura | ---
+++
@@ -16,6 +16,6 @@
celery.conf.CELERYBEAT_SCHEDULE = {
'update-plows': {
'task': '%s.refresh_plows' % __name__,
- 'schedule': timedelta(seconds=30)
+ 'schedule': timedelta(seconds=10)
},
} |
e3a2e65199c3d0db9576a25dc039f66e094171b6 | src/passgen.py | src/passgen.py | import string
import random
import argparse
def passgen(length=8):
"""Generate a strong password with *length* characters"""
pool = string.ascii_uppercase + string.ascii_lowercase + string.digits
return ''.join(random.SystemRandom().choice(pool) for _ in range(length))
def main():
parser = argparse.... | import string
import random
import argparse
def passgen(length=12):
"""Generate a strong password with *length* characters"""
pool = string.ascii_uppercase + string.ascii_lowercase + string.digits
return ''.join(random.SystemRandom().choice(pool) for _ in range(length))
def main():
parser = argparse... | Make length optional. Set up defaults. | Make length optional. Set up defaults.
| Python | mit | soslan/passgen | ---
+++
@@ -3,7 +3,7 @@
import argparse
-def passgen(length=8):
+def passgen(length=12):
"""Generate a strong password with *length* characters"""
pool = string.ascii_uppercase + string.ascii_lowercase + string.digits
return ''.join(random.SystemRandom().choice(pool) for _ in range(length))
@@ -11... |
1e327401d9c020bb7941b20ff51890ad1729973d | tests.py | tests.py | import pytest
from django.contrib.auth import get_user_model
from seleniumlogin import force_login
pytestmark = [pytest.mark.django_db(transaction=True)]
def test_non_authenticated_user_cannot_access_test_page(selenium, live_server):
selenium.get('{}/test/login_required/'.format(live_server.url))
assert 'fa... | import pytest
from django.contrib.auth import get_user_model
from seleniumlogin import force_login
pytestmark = [pytest.mark.django_db(transaction=True)]
def test_non_authenticated_user_cannot_access_test_page(selenium, live_server):
selenium.get('{}/test/login_required/'.format(live_server.url))
assert 'fa... | Rename test. The test tries to access a test page, not a blank page | Rename test. The test tries to access a test page, not a blank page
| Python | mit | feffe/django-selenium-login,feffe/django-selenium-login | ---
+++
@@ -11,7 +11,7 @@
assert 'fail' in selenium.page_source
-def test_authenticated_user_can_access_blank_login_page(selenium, live_server):
+def test_authenticated_user_can_access_test_page(selenium, live_server):
User = get_user_model()
user = User.objects.create_user(username='selenium', pas... |
dfc6e7d9b6c415dc230b5ea4948e59a486e7364c | mysite/deployment_settings.py | mysite/deployment_settings.py | from settings import *
OHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'
DEBUG=False
ADMINS=[
('All OH devs', 'devel@openhatch.org'),
]
INVITE_MODE=True # Enabled on production site
INVITATIONS_PER_USER=20
TEMPLTE_DEBUG=False
| from settings import *
OHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'
DEBUG=False
ADMINS=[
('All OH devs', 'devel@lists.openhatch.org'),
]
INVITE_MODE=True # Enabled on production site
INVITATIONS_PER_USER=20
TEMPLTE_DEBUG=False
| Use right email address for devel@ list | Use right email address for devel@ list
| Python | agpl-3.0 | ojengwa/oh-mainline,ojengwa/oh-mainline,campbe13/openhatch,mzdaniel/oh-mainline,willingc/oh-mainline,waseem18/oh-mainline,SnappleCap/oh-mainline,onceuponatimeforever/oh-mainline,mzdaniel/oh-mainline,sudheesh001/oh-mainline,eeshangarg/oh-mainline,vipul-sharma20/oh-mainline,jledbetter/openhatch,eeshangarg/oh-mainline,onc... | ---
+++
@@ -3,7 +3,7 @@
OHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'
DEBUG=False
ADMINS=[
- ('All OH devs', 'devel@openhatch.org'),
+ ('All OH devs', 'devel@lists.openhatch.org'),
]
INVITE_MODE=True # Enabled on production site |
741545dcf58fdfaf882d797d3ce4f7607ca0dad4 | kobo/client/commands/cmd_resubmit_tasks.py | kobo/client/commands/cmd_resubmit_tasks.py | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
from kobo.client.task_watcher import TaskWatcher
from kobo.client import ClientCommand
class Resubmit_Tasks(ClientCommand):
"""resubmit failed tasks"""
enabled = True
def options(self):
self.parser.usage = "%%prog %s tas... | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
from kobo.client.task_watcher import TaskWatcher
from kobo.client import ClientCommand
class Resubmit_Tasks(ClientCommand):
"""resubmit failed tasks"""
enabled = True
def options(self):
self.parser.usage = "%%prog %s tas... | Add --nowait option to resubmit-tasks cmd | Add --nowait option to resubmit-tasks cmd
In some use cases, waiting till the tasks finish is undesirable. Nowait
option should be provided.
| Python | lgpl-2.1 | release-engineering/kobo,release-engineering/kobo,release-engineering/kobo,release-engineering/kobo | ---
+++
@@ -16,6 +16,7 @@
def options(self):
self.parser.usage = "%%prog %s task_id [task_id...]" % self.normalized_name
self.parser.add_option("--force", action="store_true", help="Resubmit also tasks which are closed properly.")
+ self.parser.add_option("--nowait", default=False, actio... |
2e70450846fb0f40d6d0449093ddf121da7547a8 | tbmodels/__init__.py | tbmodels/__init__.py | # -*- coding: utf-8 -*-
# (c) 2015-2018, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <greschd@gmx.ch>
r"""
TBmodels is a tool for creating / loading and manipulating tight-binding models.
"""
__version__ = '1.3.2a1'
# import order is important due to circular imports
from . import helpers
... | # -*- coding: utf-8 -*-
# (c) 2015-2018, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <greschd@gmx.ch>
r"""
TBmodels is a tool for creating / loading and manipulating tight-binding models.
"""
__version__ = '1.3.2'
# import order is important due to circular imports
from . import helpers
fr... | Remove 'alpha' designation from version number. | Remove 'alpha' designation from version number.
| Python | apache-2.0 | Z2PackDev/TBmodels,Z2PackDev/TBmodels | ---
+++
@@ -6,7 +6,7 @@
TBmodels is a tool for creating / loading and manipulating tight-binding models.
"""
-__version__ = '1.3.2a1'
+__version__ = '1.3.2'
# import order is important due to circular imports
from . import helpers |
8e7a92bce03ca472bc78bb9df5e2c9cf063c29b7 | temba/campaigns/tasks.py | temba/campaigns/tasks.py | from __future__ import unicode_literals
from datetime import datetime
from django.utils import timezone
from djcelery_transactions import task
from redis_cache import get_redis_connection
from .models import Campaign, EventFire
from django.conf import settings
import redis
from temba.msgs.models import HANDLER_QUEUE, ... | from __future__ import unicode_literals
from datetime import datetime
from django.utils import timezone
from djcelery_transactions import task
from redis_cache import get_redis_connection
from .models import Campaign, EventFire
from django.conf import settings
import redis
from temba.msgs.models import HANDLER_QUEUE, ... | Use correct field to get org from | Use correct field to get org from
| Python | agpl-3.0 | harrissoerja/rapidpro,pulilab/rapidpro,pulilab/rapidpro,reyrodrigues/EU-SMS,tsotetsi/textily-web,harrissoerja/rapidpro,tsotetsi/textily-web,pulilab/rapidpro,tsotetsi/textily-web,Thapelo-Tsotetsi/rapidpro,Thapelo-Tsotetsi/rapidpro,ewheeler/rapidpro,praekelt/rapidpro,harrissoerja/rapidpro,praekelt/rapidpro,reyrodrigues/E... | ---
+++
@@ -26,9 +26,9 @@
if not r.get(key):
with r.lock(key, timeout=3600):
# for each that needs to be fired
- for fire in EventFire.objects.filter(fired=None, scheduled__lte=timezone.now()).select_related('event', 'event.org'):
+ for fire in EventFire.objects.filter... |
1e2086b868861034d89138349c4da909f380f19e | feedback/views.py | feedback/views.py | from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from rest_framework import serializers, status
from rest_framework.response import Response
from rest_framework.views import APIView
from .models import Feedback
class FeedbackSerializer(serializers.ModelSeriali... | from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from rest_framework import serializers, status
from rest_framework.response import Response
from rest_framework.views import APIView
from .models import Feedback
class FeedbackSerializer(serializers.ModelSeriali... | Make feedback compatible with DRF >3.3.0 | Make feedback compatible with DRF >3.3.0
| Python | mit | City-of-Helsinki/digihel,City-of-Helsinki/digihel,City-of-Helsinki/digihel,City-of-Helsinki/digihel | ---
+++
@@ -10,6 +10,7 @@
class FeedbackSerializer(serializers.ModelSerializer):
class Meta:
model = Feedback
+ fields = '__all__'
@method_decorator(csrf_exempt, name='dispatch') |
550ce00c5d2757287fee2d810543d3f17ad9ccff | Orange/tests/sql/test_naive_bayes_sql.py | Orange/tests/sql/test_naive_bayes_sql.py | import unittest
from numpy import array
import Orange.classification.naive_bayes as nb
from Orange import preprocess
from Orange.data.sql.table import SqlTable
from Orange.data import Domain
from Orange.data.variable import DiscreteVariable
from Orange.tests.sql.base import has_psycopg2
@unittest.skipIf(not has_psy... | import unittest
from numpy import array
import Orange.classification.naive_bayes as nb
from Orange import preprocess
from Orange.data.sql.table import SqlTable
from Orange.data import Domain
from Orange.data.variable import DiscreteVariable
from Orange.tests.sql.base import has_psycopg2
@unittest.skipIf(not has_psy... | Fix test of NaiveBayes on SQL table | Fix test of NaiveBayes on SQL table
| Python | bsd-2-clause | cheral/orange3,marinkaz/orange3,qusp/orange3,qPCR4vir/orange3,qusp/orange3,qusp/orange3,kwikadi/orange3,qPCR4vir/orange3,qPCR4vir/orange3,marinkaz/orange3,qPCR4vir/orange3,marinkaz/orange3,marinkaz/orange3,cheral/orange3,cheral/orange3,kwikadi/orange3,marinkaz/orange3,cheral/orange3,cheral/orange3,kwikadi/orange3,chera... | ---
+++
@@ -17,7 +17,7 @@
type_hints=Domain([], DiscreteVariable("iris",
values=['Iris-setosa', 'Iris-virginica',
'Iris-versicolor'])))
- table = preprocess.Discretize(table)
+ table = preprocess.Discreti... |
4fc1cd3e3b225b981521cf321f8c4441f45c3252 | test/pytorch/test_cnn.py | test/pytorch/test_cnn.py | import logging
import unittest
from ..helpers import run_module
logging.basicConfig(level=logging.DEBUG)
class PytorchCNNTest(unittest.TestCase):
def setUp(self):
self.name = "benchmarker"
self.imgnet_args = [
"--framework=pytorch",
"--problem_size=4",
"--batc... | import logging
import unittest
from ..helpers import run_module
logging.basicConfig(level=logging.DEBUG)
class PytorchCNNTest(unittest.TestCase):
def setUp(self):
self.name = "benchmarker"
self.args = [
"--problem=cnn2d_toy",
"--framework=pytorch",
"--problem_... | Add training and inference test | Add training and inference test
| Python | mpl-2.0 | undertherain/benchmarker,undertherain/benchmarker,undertherain/benchmarker,undertherain/benchmarker | ---
+++
@@ -9,11 +9,15 @@
class PytorchCNNTest(unittest.TestCase):
def setUp(self):
self.name = "benchmarker"
- self.imgnet_args = [
+ self.args = [
+ "--problem=cnn2d_toy",
"--framework=pytorch",
"--problem_size=4",
"--batch_size=2",
... |
90bdcad66a6f29c9e3d731b5b09b0a2ba477ae2f | tviit/urls.py | tviit/urls.py | from django.conf.urls import include, url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^', views.IndexView.as_view(), name='tviit_index'),
]
| from django.conf.urls import include, url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='tviit_index'),
url(r'create/$', views.create_tviit, name="create_tviit"),
]
| Create url-patterns for tviit creation | Create url-patterns for tviit creation
| Python | mit | DeWaster/Tviserrys,DeWaster/Tviserrys | ---
+++
@@ -4,5 +4,6 @@
from . import views
urlpatterns = [
- url(r'^', views.IndexView.as_view(), name='tviit_index'),
+ url(r'^$', views.IndexView.as_view(), name='tviit_index'),
+ url(r'create/$', views.create_tviit, name="create_tviit"),
] |
881222a49c6b3e8792adf5754c61992bd12c7b28 | tests/test_conduction.py | tests/test_conduction.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test Mongo Conduction."""
import logging
import pymongo
from mockupdb import go
from pymongo.errors import OperationFailure
from conduction.server import get_mockup, main_loop
from tests import unittest # unittest2 on Python 2.6.
class ConductionTest(unittest.Test... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test Mongo Conduction."""
import logging
import pymongo
from mockupdb import go
from pymongo.errors import OperationFailure
from conduction.server import get_mockup, main_loop
from tests import unittest # unittest2 on Python 2.6.
class ConductionTest(unittest.Test... | Test root URI and 404s. | Test root URI and 404s.
| Python | apache-2.0 | ajdavis/mongo-conduction | ---
+++
@@ -26,11 +26,26 @@
self.addCleanup(self.loop_future)
self.addCleanup(self.mockup.stop)
- self.conduction = pymongo.MongoClient(self.mockup.uri).test
+ # Any database name will do.
+ self.conduction = pymongo.MongoClient(self.mockup.uri).conduction
+
+ def test_root... |
86480f2a4948b58f458d686be5fba330abf9743f | rx/core/operators/delaysubscription.py | rx/core/operators/delaysubscription.py | from datetime import datetime
from typing import Union, Callable
from rx import empty, timer, operators as ops
from rx.core import Observable
def _delay_subscription(duetime: Union[datetime, int]) -> Callable[[Observable], Observable]:
"""Time shifts the observable sequence by delaying the subscription.
1 -... | from datetime import datetime
from typing import Union, Callable
from rx import empty, timer, operators as ops
from rx.core import Observable
def _delay_subscription(duetime: Union[datetime, int]) -> Callable[[Observable], Observable]:
"""Time shifts the observable sequence by delaying the subscription.
1 -... | Fix call to renamed function | Fix call to renamed function
| Python | mit | ReactiveX/RxPY,ReactiveX/RxPY | ---
+++
@@ -19,5 +19,5 @@
def mapper(_) -> Observable:
return empty()
- return source.pipe(ops.delay_with_selector(timer(duetime), mapper))
+ return source.pipe(ops.delay_with_mapper(timer(duetime), mapper))
return delay_subscription |
e3b1a323921b8331d7fd84c013e80a89a5b21bde | haproxy_status.py | haproxy_status.py | #!/usr/bin/env python
from BaseHTTPServer import BaseHTTPRequestHandler
from helpers.etcd import Etcd
from helpers.postgresql import Postgresql
import sys, yaml, socket
f = open(sys.argv[1], "r")
config = yaml.load(f.read())
f.close()
etcd = Etcd(config["etcd"])
postgresql = Postgresql(config["postgresql"])
class S... | #!/usr/bin/env python
from BaseHTTPServer import BaseHTTPRequestHandler
from helpers.etcd import Etcd
from helpers.postgresql import Postgresql
import sys, yaml, socket
f = open(sys.argv[1], "r")
config = yaml.load(f.read())
f.close()
etcd = Etcd(config["etcd"])
postgresql = Postgresql(config["postgresql"])
class S... | Add the ability to query for the replica status of a PG instance | Add the ability to query for the replica status of a PG instance
| Python | mit | Tapjoy/governor | ---
+++
@@ -18,7 +18,9 @@
def do_OPTIONS(self):
return self.do_ANY()
def do_ANY(self):
- if postgresql.name == etcd.current_leader()["hostname"]:
+ leader = etcd.current_leader()
+ is_leader = leader != None and postgresql.name == leader["hostname"]
+ if ((self.path == "... |
d0191c43c784b229ce104700989dfb91c67ec490 | helper/windows.py | helper/windows.py | """
Windows platform support for running the application as a detached process.
"""
import multiprocessing
import subprocess
import sys
DETACHED_PROCESS = 8
class Daemon(object):
def __init__(self, controller, user=None, group=None,
pid_file=None, prevent_core=None, exception_log=None):
... | """
Windows platform support for running the application as a detached process.
"""
import subprocess
import sys
DETACHED_PROCESS = 8
class Daemon(object):
"""Daemonize the helper application, putting it in a forked background
process.
"""
def __init__(self, controller):
raise NotImplemente... | Raise a NotImplementedError for Windows | Raise a NotImplementedError for Windows
| Python | bsd-3-clause | gmr/helper,dave-shawley/helper,gmr/helper | ---
+++
@@ -2,7 +2,6 @@
Windows platform support for running the application as a detached process.
"""
-import multiprocessing
import subprocess
import sys
@@ -10,23 +9,14 @@
class Daemon(object):
+ """Daemonize the helper application, putting it in a forked background
+ process.
- def __init... |
b8350e91d7bd1e3a775ed230820c96a180a2ad02 | tests/test_solver.py | tests/test_solver.py | from tinyik import Link, Joint, FKSolver
from .utils import x, y, z, theta, approx_eq
def test_forward_kinematics():
fk = FKSolver([
Joint('z'), Link([1., 0., 0.]), Joint('y'), Link([1., 0., 0.])
])
assert all(fk.solve([0., 0.]) == [2., 0., 0.])
assert approx_eq(fk.solve([theta, theta]), [x,... | from tinyik import Link, Joint, FKSolver, CCDFKSolver, CCDIKSolver
from .utils import x, y, z, theta, approx_eq
components = [Joint('z'), Link([1., 0., 0.]), Joint('y'), Link([1., 0., 0.])]
predicted = [2., 0., 0.]
def test_fk():
fk = FKSolver(components)
assert all(fk.solve([0., 0.]) == predicted)
as... | Add tests for CCD IK solver | Add tests for CCD IK solver
| Python | mit | lanius/tinyik | ---
+++
@@ -1,13 +1,30 @@
-from tinyik import Link, Joint, FKSolver
+from tinyik import Link, Joint, FKSolver, CCDFKSolver, CCDIKSolver
from .utils import x, y, z, theta, approx_eq
-def test_forward_kinematics():
- fk = FKSolver([
- Joint('z'), Link([1., 0., 0.]), Joint('y'), Link([1., 0., 0.])
- ... |
2f63f134d2c9aa67044eb176a3f81857279f107d | troposphere/utils.py | troposphere/utils.py | import time
def get_events(conn, stackname):
"""Get the events in batches and return in chronological order"""
next = None
event_list = []
while 1:
events = conn.describe_stack_events(stackname, next)
event_list.append(events)
if events.next_token is None:
break
... | import time
def _tail_print(e):
print("%s %s %s" % (e.resource_status, e.resource_type, e.event_id))
def get_events(conn, stackname):
"""Get the events in batches and return in chronological order"""
next = None
event_list = []
while 1:
events = conn.describe_stack_events(stackname, next... | Support a custom logging function and sleep time within tail | Support a custom logging function and sleep time within tail
| Python | bsd-2-clause | mhahn/troposphere | ---
+++
@@ -1,4 +1,8 @@
import time
+
+
+def _tail_print(e):
+ print("%s %s %s" % (e.resource_status, e.resource_type, e.event_id))
def get_events(conn, stackname):
@@ -15,17 +19,14 @@
return reversed(sum(event_list, []))
-def tail(conn, stack_name):
+def tail(conn, stack_name, log_func=_tail_print,... |
35594a4f8c549d507c7d7030141ae511aed57c09 | workflowmax/__init__.py | workflowmax/__init__.py | from .api import WorkflowMax # noqa
__version__ = "0.1.0"
| from .api import WorkflowMax # noqa
from .credentials import Credentials # noqa
__version__ = "0.1.0"
| Add Credentials to root namespace | Add Credentials to root namespace
| Python | bsd-3-clause | ABASystems/pyworkflowmax | ---
+++
@@ -1,3 +1,4 @@
from .api import WorkflowMax # noqa
+from .credentials import Credentials # noqa
__version__ = "0.1.0" |
ab5aac0c9b0e075901c4cd8dd5d134e79f0e0110 | brasileirao/spiders/results_spider.py | brasileirao/spiders/results_spider.py | import scrapy
import scrapy.selector
from brasileirao.items import BrasileiraoItem
import hashlib
class ResultsSpider(scrapy.Spider):
name = "results"
start_urls = [
'https://esporte.uol.com.br/futebol/campeonatos/brasileirao/jogos/',
]
def parse(self, response):
actual_round = 0
... | # -*- coding: utf-8 -*-
import scrapy
import scrapy.selector
from brasileirao.items import BrasileiraoItem
import hashlib
class ResultsSpider(scrapy.Spider):
name = "results"
start_urls = [
'https://esporte.uol.com.br/futebol/campeonatos/brasileirao/jogos/',
]
def parse(self, response):
... | Set utf-8 as default encoding. | Set utf-8 as default encoding.
| Python | mit | pghilardi/live-football-client | ---
+++
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
import scrapy
import scrapy.selector
@@ -23,8 +25,8 @@
item = BrasileiraoItem()
item['rodada'] = actual_round
- item['home_team'] = home_team.css("abbr::attr(title)").extract_first().encode('utf8')
- ... |
a3c1822dd2942de4b6bf5cac14039e6789babf85 | wafer/pages/admin.py | wafer/pages/admin.py | from django.contrib import admin
from wafer.pages.models import File, Page
class PageAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("name",)}
list_display = ('name', 'slug', 'get_people_display_names', 'get_in_schedule')
admin.site.register(Page, PageAdmin)
admin.site.register(File)
| from django.contrib import admin
from wafer.pages.models import File, Page
from reversion.admin import VersionAdmin
class PageAdmin(VersionAdmin, admin.ModelAdmin):
prepopulated_fields = {"slug": ("name",)}
list_display = ('name', 'slug', 'get_people_display_names', 'get_in_schedule')
admin.site.register(... | Add reversion support to Pages | Add reversion support to Pages
| Python | isc | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer | ---
+++
@@ -2,8 +2,10 @@
from wafer.pages.models import File, Page
+from reversion.admin import VersionAdmin
-class PageAdmin(admin.ModelAdmin):
+
+class PageAdmin(VersionAdmin, admin.ModelAdmin):
prepopulated_fields = {"slug": ("name",)}
list_display = ('name', 'slug', 'get_people_display_names', 'g... |
d30605d82d5f04e8478c785f1bb5086066e50878 | awx/wsgi.py | awx/wsgi.py | # Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
import logging
from django.core.wsgi import get_wsgi_application
from awx import prepare_env
from awx import __version__ as tower_version
"""
WSGI config for AWX project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more... | # Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
import logging
from awx import __version__ as tower_version
# Prepare the AWX environment.
from awx import prepare_env
prepare_env()
from django.core.wsgi import get_wsgi_application
"""
WSGI config for AWX project.
It exposes the WSGI callable as a module-... | Fix import error by calling prepare_env first | Fix import error by calling prepare_env first
| Python | apache-2.0 | wwitzel3/awx,snahelou/awx,snahelou/awx,snahelou/awx,wwitzel3/awx,wwitzel3/awx,snahelou/awx,wwitzel3/awx | ---
+++
@@ -2,9 +2,13 @@
# All Rights Reserved.
import logging
+from awx import __version__ as tower_version
+
+# Prepare the AWX environment.
+from awx import prepare_env
+prepare_env()
+
from django.core.wsgi import get_wsgi_application
-from awx import prepare_env
-from awx import __version__ as tower_version... |
4076fb322814848d802d1f925d163e90b3d629a9 | selenium_testcase/testcases/forms.py | selenium_testcase/testcases/forms.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from selenium.webdriver.common.by import By
from .utils import wait_for
class FormTestMixin:
# default search element
form_search_list = (
(By.ID, '{}',),
(By.NAME, '{}',),
(By.XPATH, '//form[@action="{}"]',),
(... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from selenium.webdriver.common.by import By
from .utils import wait_for
class FormTestMixin:
# default search element
form_search_list = (
(By.ID, '{}',),
(By.NAME, '{}',),
(By.XPATH, '//form[@action="{}"]',),
(... | Split get_input from set_input in FormTestMixin. | Split get_input from set_input in FormTestMixin.
In order to reduce side-effects, this commit moves the @wait_for to
a get_input method and set_input operates immediately.
| Python | bsd-3-clause | nimbis/django-selenium-testcase,nimbis/django-selenium-testcase | ---
+++
@@ -15,7 +15,7 @@
(By.NAME, '{}',),
(By.XPATH, '//form[@action="{}"]',),
(By.XPATH, '//form[@name="{}"]',),
- (By.XPATH, '//form/*',),
+ (By.XPATH, '//form',),
)
@wait_for
@@ -30,9 +30,14 @@
)
@wait_for
+ def get_input(self, field, **kwargs):... |
149a8091333766068cac445db770ea73055d8647 | simuvex/procedures/stubs/UserHook.py | simuvex/procedures/stubs/UserHook.py | import simuvex
class UserHook(simuvex.SimProcedure):
NO_RET = True
# pylint: disable=arguments-differ
def run(self, user_func=None, user_kwargs=None, default_return_addr=None):
result = user_func(self.state, **user_kwargs)
if result is None:
self.add_successor(self.state, defau... | import simuvex
class UserHook(simuvex.SimProcedure):
NO_RET = True
# pylint: disable=arguments-differ
def run(self, user_func=None, user_kwargs=None, default_return_addr=None, length=None):
result = user_func(self.state, **user_kwargs)
if result is None:
self.add_successor(self... | Make the userhook take the length arg b/c why not | Make the userhook take the length arg b/c why not
| Python | bsd-2-clause | axt/angr,schieb/angr,tyb0807/angr,chubbymaggie/angr,chubbymaggie/simuvex,chubbymaggie/angr,chubbymaggie/simuvex,f-prettyland/angr,axt/angr,angr/angr,f-prettyland/angr,tyb0807/angr,schieb/angr,axt/angr,chubbymaggie/angr,f-prettyland/angr,iamahuman/angr,tyb0807/angr,iamahuman/angr,angr/angr,iamahuman/angr,angr/angr,schie... | ---
+++
@@ -4,7 +4,7 @@
NO_RET = True
# pylint: disable=arguments-differ
- def run(self, user_func=None, user_kwargs=None, default_return_addr=None):
+ def run(self, user_func=None, user_kwargs=None, default_return_addr=None, length=None):
result = user_func(self.state, **user_kwargs)
... |
8528beef5d10355af07f641b4987df3cd64a7b0f | sprockets/mixins/metrics/__init__.py | sprockets/mixins/metrics/__init__.py | from .influxdb import InfluxDBMixin
from .statsd import StatsdMixin
version_info = (1, 0, 0)
__version__ = '.'.join(str(v) for v in version_info)
__all__ = ['InfluxDBMixin', 'StatsdMixin']
| try:
from .influxdb import InfluxDBMixin
from .statsd import StatsdMixin
except ImportError as error:
def InfluxDBMixin(*args, **kwargs):
raise error
def StatsdMixin(*args, **kwargs):
raise error
version_info = (1, 0, 0)
__version__ = '.'.join(str(v) for v in version_info)
__all__ = ['... | Make it safe to import __version__. | Make it safe to import __version__.
| Python | bsd-3-clause | sprockets/sprockets.mixins.metrics | ---
+++
@@ -1,5 +1,12 @@
-from .influxdb import InfluxDBMixin
-from .statsd import StatsdMixin
+try:
+ from .influxdb import InfluxDBMixin
+ from .statsd import StatsdMixin
+except ImportError as error:
+ def InfluxDBMixin(*args, **kwargs):
+ raise error
+
+ def StatsdMixin(*args, **kwargs):
+ ... |
afa6687c317191b77949ba246f3dcc0909c435f5 | organizer/urls/tag.py | organizer/urls/tag.py | from django.conf.urls import url
from ..models import Tag
from ..utils import DetailView
from ..views import (
TagCreate, TagDelete, TagList, TagPageList,
TagUpdate)
urlpatterns = [
url(r'^$',
TagList.as_view(),
name='organizer_tag_list'),
url(r'^create/$',
TagCreate.as_view(),... | from django.conf.urls import url
from ..views import (
TagCreate, TagDelete, TagDetail, TagList,
TagPageList, TagUpdate)
urlpatterns = [
url(r'^$',
TagList.as_view(),
name='organizer_tag_list'),
url(r'^create/$',
TagCreate.as_view(),
name='organizer_tag_create'),
ur... | Revert to Tag Detail URL pattern. | Ch17: Revert to Tag Detail URL pattern.
| Python | bsd-2-clause | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | ---
+++
@@ -1,10 +1,8 @@
from django.conf.urls import url
-from ..models import Tag
-from ..utils import DetailView
from ..views import (
- TagCreate, TagDelete, TagList, TagPageList,
- TagUpdate)
+ TagCreate, TagDelete, TagDetail, TagList,
+ TagPageList, TagUpdate)
urlpatterns = [
url(r'^$',
... |
7b1d520278b8fe33b68103d26f9aa7bb945f6791 | cryptography/hazmat/backends/__init__.py | cryptography/hazmat/backends/__init__.py | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | Make the default backend be a multi-backend | Make the default backend be a multi-backend
| Python | bsd-3-clause | bwhmather/cryptography,Ayrx/cryptography,bwhmather/cryptography,Lukasa/cryptography,Ayrx/cryptography,bwhmather/cryptography,kimvais/cryptography,skeuomorf/cryptography,dstufft/cryptography,kimvais/cryptography,Lukasa/cryptography,dstufft/cryptography,Ayrx/cryptography,skeuomorf/cryptography,Lukasa/cryptography,sholsap... | ---
+++
@@ -12,6 +12,7 @@
# limitations under the License.
from cryptography.hazmat.backends import openssl
+from cryptography.hazmat.backends.multibackend import MultiBackend
from cryptography.hazmat.bindings.commoncrypto.binding import (
Binding as CommonCryptoBinding
)
@@ -23,5 +24,7 @@
_ALL_BACKEN... |
0f3b413b269f8b95b6f8073ba39d11f156ae632c | zwebtest.py | zwebtest.py | """ Multicast DNS Service Discovery for Python, v0.14-wmcbrine
Copyright 2003 Paul Scott-Murphy, 2014 William McBrine
This module provides a unit test suite for the Multicast DNS
Service Discovery for Python module.
This library is free software; you can redistribute it and/or
modify it under the ... | from zeroconf import *
import socket
desc = {'path': '/~paulsm/'}
info = ServiceInfo("_http._tcp.local.",
"Paul's Test Web Site._http._tcp.local.",
socket.inet_aton("10.0.1.2"), 80, 0, 0,
desc, "ash-2.local.")
r = Zeroconf()
print "Registration of a service...... | Allow graceful exit from announcement test. | Allow graceful exit from announcement test.
| Python | lgpl-2.1 | basilfx/python-zeroconf,daid/python-zeroconf,jstasiak/python-zeroconf,gbiddison/python-zeroconf,giupo/python-zeroconf,AndreaCensi/python-zeroconf,nameoftherose/python-zeroconf,balloob/python-zeroconf,wmcbrine/pyzeroconf,decabyte/python-zeroconf,jantman/python-zeroconf | ---
+++
@@ -1,38 +1,17 @@
-""" Multicast DNS Service Discovery for Python, v0.14-wmcbrine
- Copyright 2003 Paul Scott-Murphy, 2014 William McBrine
-
- This module provides a unit test suite for the Multicast DNS
- Service Discovery for Python module.
-
- This library is free software; you can redistribute... |
5957999c52f939691cbe6b8dd5aa929980a24501 | tests/unit/test_start.py | tests/unit/test_start.py | import pytest
from iwant_bot import start
def test_add():
assert start.add_numbers(0, 0) == 0
assert start.add_numbers(1, 1) == 2
| from iwant_bot import start
def test_add():
assert start.add_numbers(0, 0) == 0
assert start.add_numbers(1, 1) == 2
| Remove the unused pytest import | Remove the unused pytest import
| Python | mit | kiwicom/iwant-bot | ---
+++
@@ -1,6 +1,3 @@
-import pytest
-
-
from iwant_bot import start
|
f5d4da9fa71dbb59a9459e376fde8840037bf39a | account_banking_sepa_credit_transfer/__init__.py | account_banking_sepa_credit_transfer/__init__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Credit Transfer module for OpenERP
# Copyright (C) 2010-2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you ... | # -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Credit Transfer module for OpenERP
# Copyright (C) 2010-2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you ... | Remove import models from init in sepa_credit_transfer | Remove import models from init in sepa_credit_transfer
| Python | agpl-3.0 | open-synergy/bank-payment,sergio-incaser/bank-payment,hbrunn/bank-payment,sergio-teruel/bank-payment,ndtran/bank-payment,David-Amaro/bank-payment,rlizana/bank-payment,sergiocorato/bank-payment,damdam-s/bank-payment,CompassionCH/bank-payment,CompassionCH/bank-payment,incaser/bank-payment,Antiun/bank-payment,sergio-terue... | ---
+++
@@ -21,4 +21,3 @@
##############################################################################
from . import wizard
-from . import models |
f1a1272bebcc4edf9063c75d3fe29fdcb9e277eb | rml/unitconversion.py | rml/unitconversion.py | import numpy as np
class UnitConversion():
def __init__(self, coef):
self.p = np.poly1d(coef)
def machine_to_physics(self, machine_value):
return self.p(machine_value)
def physics_to_machine(self, physics_value):
roots = (self.p - physics_value).roots
positive_roots = [ro... | import numpy as np
from scipy.interpolate import PchipInterpolator
class UnitConversion():
def __init__(self, coef):
self.p = np.poly1d(coef)
def machine_to_physics(self, machine_value):
return self.p(machine_value)
def physics_to_machine(self, physics_value):
roots = (self.p - p... | Add PPChipInterpolator unit conversion class | Add PPChipInterpolator unit conversion class
| Python | apache-2.0 | willrogers/pml,razvanvasile/RML,willrogers/pml | ---
+++
@@ -1,4 +1,5 @@
import numpy as np
+from scipy.interpolate import PchipInterpolator
class UnitConversion():
@@ -15,3 +16,16 @@
return positive_roots[0]
else:
raise ValueError("No corresponding positive machine value:", roots)
+
+
+class PPConversion():
+ def __init_... |
00e4663940ed1d22e768b3de3d1c645c8649aecc | src/WhiteLibrary/keywords/items/textbox.py | src/WhiteLibrary/keywords/items/textbox.py | from TestStack.White.UIItems import TextBox
from WhiteLibrary.keywords.librarycomponent import LibraryComponent
from WhiteLibrary.keywords.robotlibcore import keyword
class TextBoxKeywords(LibraryComponent):
@keyword
def input_text_to_textbox(self, locator, input):
"""
Writes text to a textbox... | from TestStack.White.UIItems import TextBox
from WhiteLibrary.keywords.librarycomponent import LibraryComponent
from WhiteLibrary.keywords.robotlibcore import keyword
class TextBoxKeywords(LibraryComponent):
@keyword
def input_text_to_textbox(self, locator, input_value):
"""
Writes text to a t... | Change to better argument name | Change to better argument name
| Python | apache-2.0 | Omenia/robotframework-whitelibrary,Omenia/robotframework-whitelibrary | ---
+++
@@ -5,16 +5,16 @@
class TextBoxKeywords(LibraryComponent):
@keyword
- def input_text_to_textbox(self, locator, input):
+ def input_text_to_textbox(self, locator, input_value):
"""
Writes text to a textbox.
``locator`` is the locator of the text box.
- ``inpu... |
23f32962e136dae32b3165f15f8ef7e2d5319530 | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# regex below borrowed from https://github.com/roadhump/SublimeLinter-eslint
# and is MIT-licensed from roadhump.
#
# Written by andrewdeandrade
# Copyright (c) 2014 andrewdeandrade
#
# License: MIT
#
"""This module exports the... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# regex below borrowed from https://github.com/roadhump/SublimeLinter-eslint
# and is MIT-licensed from roadhump.
#
# Written by andrewdeandrade
# Copyright (c) 2014 andrewdeandrade
#
# License: MIT
#
"""This module exports the... | Set minimum lint-trap version to 0.4.0 | Set minimum lint-trap version to 0.4.0
| Python | mit | Raynos/SublimeLinter-contrib-lint-trap | ---
+++
@@ -25,7 +25,7 @@
executable = None
version_args = '--version'
version_re = r'(?P<version>\d+\.\d+\.\d+)'
- version_requirement = '>= 0.3.0'
+ version_requirement = '>= 0.4.0'
regex = (
r'^.+?: line (?P<line>\d+), col (?P<col>\d+), '
r'(?:(?P<error>Error)|(?P<warnin... |
5cbae4953ea0bde97b0cf7cd914a3a5263fa74be | manage.py | manage.py | #!/usr/bin/env python
import os
import sys
import re
def read_env():
"""Pulled from Honcho code with minor updates, reads local default
environment variables from a .env file located in the project root
directory.
"""
try:
with open('.env') as f:
content = f.read()
except ... | #!/usr/bin/env python
import os
import sys
import re
def read_env():
"""Pulled from Honcho code with minor updates, reads local default
environment variables from a .env file located in the project root
directory.
"""
try:
with open('.env') as f:
content = f.read()
except ... | Make base module default DJANGO_SETTINGS_MODULE | Make base module default DJANGO_SETTINGS_MODULE | Python | mit | jpadilla/feedleap,jpadilla/feedleap | ---
+++
@@ -29,7 +29,7 @@
os.environ.setdefault(key, val)
if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "feedleap.settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "feedleap.settings.base")
from django.core.management import execute_from_command_l... |
39dbbac659e9ae9c1bbad8a979cc99ef6eafaeff | models.py | models.py | #!/usr/bin/env python
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL')
db = SQLAlchemy(app)
class FoodMenu(db.Model):
id = db.Column(db.Integer, primary_key=True)
result = db.Column(db.Text)
d... | #!/usr/bin/env python
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL')
db = SQLAlchemy(app)
class FoodMenu(db.Model):
id = db.Column(db.Integer, primary_key=True)
result = db.Column(db.Text)
d... | Include class name in model representations | Include class name in model representations
| Python | mit | alykhank/FoodMenu,alykhank/FoodMenu,alykhank/FoodMenu | ---
+++
@@ -15,7 +15,7 @@
self.result = result
def __repr__(self):
- return self.result
+ return "<FoodMenu('%s')>" % (self.result)
class FoodServices(db.Model):
id = db.Column(db.Integer, primary_key=True)
@@ -25,4 +25,4 @@
self.result = result
def __repr__(self):
- return self.result
+ return... |
e16c65ec8c774cc27f9f7aa43e88521c3854b6b7 | ella/imports/management/commands/fetchimports.py | ella/imports/management/commands/fetchimports.py | from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
help = 'Fetch all registered imports'
def handle(self, *test_labels, **options):
from ella.imports.models import fetch_all
fetch_all()
| from django.core.management.base import NoArgsCommand
from optparse import make_option
import sys
class Command(NoArgsCommand):
help = 'Fetch all registered imports'
def handle(self, *test_labels, **options):
from ella.imports.models import fetch_all
errors = fetch_all()
if errors:
... | Return exit code (count of errors) | Return exit code (count of errors)
git-svn-id: 6ce22b13eace8fe533dbb322c2bb0986ea4cd3e6@520 2d143e24-0a30-0410-89d7-a2e95868dc81
| Python | bsd-3-clause | MichalMaM/ella,MichalMaM/ella,WhiskeyMedia/ella,whalerock/ella,ella/ella,whalerock/ella,WhiskeyMedia/ella,petrlosa/ella,petrlosa/ella,whalerock/ella | ---
+++
@@ -1,8 +1,11 @@
-from django.core.management.base import BaseCommand
+from django.core.management.base import NoArgsCommand
from optparse import make_option
+import sys
-class Command(BaseCommand):
+class Command(NoArgsCommand):
help = 'Fetch all registered imports'
def handle(self, *test_labels... |
45c400e02fbeb5b455e27fef81e47e45f274eaec | core/forms.py | core/forms.py |
from django import forms
class GameForm(forms.Form):
amount = forms.IntegerField()
def __init__(self, *args, **kwargs):
super(GameForm, self).__init__(*args, **kwargs)
for name, field in self.fields.items():
if isinstance(field, forms.IntegerField):
self.fields[n... |
from django import forms
class GameForm(forms.Form):
amount = forms.IntegerField(initial=100)
def __init__(self, *args, **kwargs):
super(GameForm, self).__init__(*args, **kwargs)
for name, field in self.fields.items():
if isinstance(field, forms.IntegerField):
se... | Add a default bet amount. | Add a default bet amount.
| Python | bsd-2-clause | stephenmcd/gamblor,stephenmcd/gamblor | ---
+++
@@ -4,7 +4,7 @@
class GameForm(forms.Form):
- amount = forms.IntegerField()
+ amount = forms.IntegerField(initial=100)
def __init__(self, *args, **kwargs):
super(GameForm, self).__init__(*args, **kwargs) |
fcc571d2f4c35ac8f0e94e51e6ac94a0c051062d | src/rinoh/__init__.py | src/rinoh/__init__.py | # This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
"""rinohtype
"""
import os
import sys
from importlib ... | # This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
"""rinohtype
"""
import os
import sys
from importlib ... | Update the top-level rinoh package | Update the top-level rinoh package
Make all symbols and modules relevant to users available directly
from the rinoh package.
| Python | agpl-3.0 | brechtm/rinohtype,brechtm/rinohtype,brechtm/rinohtype | ---
+++
@@ -23,12 +23,14 @@
sys.exit(1)
-CORE_MODULES = ['annotation', 'color', 'dimension', 'document', 'draw', 'float',
- 'flowable', 'highlight', 'index', 'inline', 'layout', 'number',
- 'paper', 'paragraph', 'reference', 'structure', 'style',
- 'table', 'text'... |
f9293d838a21f495ea9b56cbe0f6f75533360aed | pyinfra/api/config.py | pyinfra/api/config.py | import six
from pyinfra import logger
class Config(object):
'''
The default/base configuration options for a pyinfra deploy.
'''
state = None
# % of hosts which have to fail for all operations to stop
FAIL_PERCENT = None
# Seconds to timeout SSH connections
CONNECT_TIMEOUT = 10
... | import six
class Config(object):
'''
The default/base configuration options for a pyinfra deploy.
'''
state = None
# % of hosts which have to fail for all operations to stop
FAIL_PERCENT = None
# Seconds to timeout SSH connections
CONNECT_TIMEOUT = 10
# Temporary directory (on ... | Remove support for deprecated `Config.TIMEOUT`. | Remove support for deprecated `Config.TIMEOUT`.
| Python | mit | Fizzadar/pyinfra,Fizzadar/pyinfra | ---
+++
@@ -1,6 +1,4 @@
import six
-
-from pyinfra import logger
class Config(object):
@@ -49,14 +47,6 @@
env = kwargs.pop('ENV', {})
self.ENV = env
- # Replace TIMEOUT -> CONNECT_TIMEOUT
- if 'TIMEOUT' in kwargs:
- logger.warning((
- 'Config.TIMEOUT i... |
94596f036270f8958afd84eb9788ce2b15f5cbd4 | registration/admin.py | registration/admin.py | from django.contrib import admin
from registration.models import RegistrationProfile
class RegistrationAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'activation_key_expired')
search_fields = ('user__username', 'user__first_name')
admin.site.register(RegistrationProfile, RegistrationAdmin)
| from django.contrib import admin
from registration.models import RegistrationProfile
class RegistrationAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'activation_key_expired')
raw_id_fields = ['user']
search_fields = ('user__username', 'user__first_name')
admin.site.register(RegistrationProfil... | Use raw_id_fields for the relation from RegistrationProfile to User, for sites which have huge numbers of users. | Use raw_id_fields for the relation from RegistrationProfile to User, for sites which have huge numbers of users.
| Python | bsd-3-clause | rafaduran/django-pluggable-registration,rbarrois/django-registration,maraujop/django-registration,thedod/django-registration-hg-mirror,CoatedMoose/django-registration,AndrewLvov/django-registration,AndrewLvov/django-registration,aptivate/django-registration,fedenko/django-registration,CoatedMoose/django-registration,ch... | ---
+++
@@ -5,6 +5,7 @@
class RegistrationAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'activation_key_expired')
+ raw_id_fields = ['user']
search_fields = ('user__username', 'user__first_name')
|
4765a88535262df6373e4f8d2111032fc290da85 | atest/testdata/parsing/custom-lang.py | atest/testdata/parsing/custom-lang.py | from robot.conf import Language
class Fi(Language):
setting_headers = {'H 1'}
variable_headers = {'H 2'}
test_case_headers = {'H 3'}
task_headers = {'H 4'}
keyword_headers = {'H 5'}
comment_headers = {'H 6'}
library = 'L'
resource = 'R'
variables = 'V'
documentation = 'S 1'
... | from robot.conf import Language
class Custom(Language):
setting_headers = {'H 1'}
variable_headers = {'H 2'}
test_case_headers = {'H 3'}
task_headers = {'H 4'}
keyword_headers = {'H 5'}
comment_headers = {'H 6'}
library = 'L'
resource = 'R'
variables = 'V'
documentation = 'S 1'... | Fix class name in test file | Fix class name in test file
| Python | apache-2.0 | robotframework/robotframework,HelioGuilherme66/robotframework,HelioGuilherme66/robotframework,HelioGuilherme66/robotframework,robotframework/robotframework,robotframework/robotframework | ---
+++
@@ -1,7 +1,7 @@
from robot.conf import Language
-class Fi(Language):
+class Custom(Language):
setting_headers = {'H 1'}
variable_headers = {'H 2'}
test_case_headers = {'H 3'} |
22f3d6d6fdc3e5f07ead782828b406c9a27d0199 | UDPSender.py | UDPSender.py | from can import Listener
import socket
class UDPSender(Listener):
dataConvert = {"0x600": {"String":"RPM:",
"Slot":0,
"Conversion":1},
"0x601": {"String":"OIL:",
"Slot":2,
"Convers... | from can import Listener
from socket import socket
class UDPSender(Listener):
dataConvert = {"0x600": {"String":"RPM:",
"Slot":0,
"Conversion":1},
"0x601": {"String":"OIL:",
"Slot":2,
... | Change of import of libraries. | Change of import of libraries.
Tried to fix issue displayed below.
[root@alarm BeagleDash]# python3.3 CANtoUDP.py
Traceback (most recent call last):
File "CANtoUDP.py", line 10, in <module>
listeners = [csv, UDPSender()]
TypeError: 'module' object is not callable
Exception AttributeError: "'super' object has no attri... | Python | mit | TAURacing/BeagleDash | ---
+++
@@ -1,5 +1,5 @@
from can import Listener
-import socket
+from socket import socket
class UDPSender(Listener):
dataConvert = {"0x600": {"String":"RPM:", |
da5db320bd96ff881be23c91f8f5d69505d67946 | src/project_name/urls.py | src/project_name/urls.py | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic.base import TemplateView
urlpatterns = [
url(r'^admin_tools/', includ... | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic.base import TemplateView
urlpatterns = [
url(r'^admin_tools/', includ... | Add missing configuration for DjDT | Add missing configuration for DjDT
| Python | mit | Clarity-89/clarityv2,Clarity-89/clarityv2,Clarity-89/clarityv2,Clarity-89/clarityv2 | ---
+++
@@ -17,3 +17,9 @@
# NOTE: The staticfiles_urlpatterns also discovers static files (ie. no need to run collectstatic). Both the static
# folder and the media folder are only served via Django if DEBUG = True.
urlpatterns += staticfiles_urlpatterns() + static(settings.MEDIA_URL, document_root=settings.MEDIA_... |
8be2d6c735ebdca542063c34d1048cb70ba7f882 | bob/macro.py | bob/macro.py | #
# Copyright (c) 2008 rPath, Inc.
#
# All rights reserved.
#
'''
Mechanism for expanding macros from a trove context.
'''
import logging
def expand(raw, parent, trove=None):
'''Transform a raw string with available configuration data.'''
macros = {}
# Basic info
macros.update(parent.cfg.macro)
... | #
# Copyright (c) 2008 rPath, Inc.
#
# All rights reserved.
#
'''
Mechanism for expanding macros from a trove context.
'''
import logging
def expand(raw, parent, trove=None):
'''Transform a raw string with available configuration data.'''
macros = {}
# Basic info
macros.update(parent.cfg.macro)
... | Delete missed reference to tag config option | Delete missed reference to tag config option
| Python | apache-2.0 | sassoftware/bob,sassoftware/bob | ---
+++
@@ -16,7 +16,7 @@
# Basic info
macros.update(parent.cfg.macro)
- for cfg_item in ('tag',):
+ for cfg_item in ('targetLabel',):
macros[cfg_item] = getattr(parent.cfg, cfg_item)
# Additional info available in trove contexts |
a3b108bdb03a74be5156a6b34219758f04b75fe8 | config.py | config.py | from os import getenv
class Config(object):
API_KEY = getenv('API_KEY')
DAEMON_SLEEP_INTERVAL = 6 # hours
MAIL_DEBUG = False
MAIL_DEFAULT_SENDER = getenv('SENDER_EMAIL', 'dynamite@example.com')
MAIL_PASSWORD = getenv('MAILGUN_SMTP_PASSWORD', None)
MAIL_PORT = getenv('MAILGUN_SMTP_PORT', 25)
... | from os import getenv
class Config(object):
API_KEY = getenv('API_KEY')
DAEMON_SLEEP_INTERVAL = 6 # hours
MAIL_DEBUG = False
MAIL_DEFAULT_SENDER = getenv('SENDER_EMAIL', 'dynamite@example.com')
MAIL_PASSWORD = getenv('MAILGUN_SMTP_PASSWORD', None)
MAIL_PORT = getenv('MAILGUN_SMTP_PORT', 25)
... | Simplify default database setting, but allow it to be overridden | Simplify default database setting, but allow it to be overridden
| Python | mit | taeram/dynamite,taeram/dynamite | ---
+++
@@ -11,7 +11,7 @@
MAIL_USERNAME = getenv('MAILGUN_SMTP_LOGIN', None)
MAIL_USE_SSL = False
NOTIFY_EMAIL = getenv('NOTIFY_EMAIL', 'dynamite@example.com')
- SQLALCHEMY_DATABASE_URI = getenv('DATABASE_URL').replace('mysql2:', 'mysql:')
+ SQLALCHEMY_DATABASE_URI = getenv('DATABASE_URL', 'sqlit... |
1da2c0e00d43c4fb9a7039e98401d333d387a057 | saleor/search/views.py | saleor/search/views.py | from __future__ import unicode_literals
from django.core.paginator import Paginator, InvalidPage
from django.conf import settings
from django.http import Http404
from django.shortcuts import render
from .forms import SearchForm
from ..product.utils import products_with_details
def paginate_results(results, get_data,... | from __future__ import unicode_literals
from django.core.paginator import Paginator, InvalidPage
from django.conf import settings
from django.http import Http404
from django.shortcuts import render
from .forms import SearchForm
from ..product.utils import products_with_details
def paginate_results(results, get_data,... | Fix empty search results logic | Fix empty search results logic
| Python | bsd-3-clause | mociepka/saleor,jreigel/saleor,itbabu/saleor,maferelo/saleor,KenMutemi/saleor,HyperManTT/ECommerceSaleor,HyperManTT/ECommerceSaleor,HyperManTT/ECommerceSaleor,KenMutemi/saleor,tfroehlich82/saleor,jreigel/saleor,KenMutemi/saleor,itbabu/saleor,car3oon/saleor,maferelo/saleor,car3oon/saleor,UITools/saleor,maferelo/saleor,i... | ---
+++
@@ -25,8 +25,8 @@
results = form.search(model_or_queryset=visible_products)
page = paginate_results(results, request.GET, settings.PAGINATE_BY)
else:
- page = form.no_query_found()
- query = form.cleaned_data['q']
+ page = []
+ query = form.cleaned_data.get('q', '')
... |
6c9b0b0c7e78524ea889f8a89c2eba8acb57f782 | gaphor/ui/iconname.py | gaphor/ui/iconname.py | """
With `get_icon_name` you can retrieve an icon name
for a UML model element.
"""
from gaphor import UML
import re
from functools import singledispatch
TO_KEBAB = re.compile(r"([a-z])([A-Z]+)")
def to_kebab_case(s):
return TO_KEBAB.sub("\\1-\\2", s).lower()
@singledispatch
def get_icon_name(element):
"... | """
With `get_icon_name` you can retrieve an icon name
for a UML model element.
"""
from gaphor import UML
import re
from functools import singledispatch
TO_KEBAB = re.compile(r"([a-z])([A-Z]+)")
def to_kebab_case(s):
return TO_KEBAB.sub("\\1-\\2", s).lower()
@singledispatch
def get_icon_name(element):
"... | Fix stereotype icon in namespace view | Fix stereotype icon in namespace view
| Python | lgpl-2.1 | amolenaar/gaphor,amolenaar/gaphor | ---
+++
@@ -25,7 +25,9 @@
@get_icon_name.register(UML.Class)
def get_name_for_class(element):
- if element.extension:
+ if isinstance(element, UML.Stereotype):
+ return "gaphor-stereotype"
+ elif element.extension:
return "gaphor-metaclass"
else:
return "gaphor-class" |
7c02e103a0af86016500625e20a4d7667e568265 | script/jsonify-book.py | script/jsonify-book.py | import sys
from glob import glob
from os.path import basename
import json
book_dir, out_dir = sys.argv[1:3]
files = [basename(x).rstrip(".xhtml") for x in glob(f"{book_dir}/*.xhtml")]
json_data = {}
for path in files:
with open(f"{book_dir}/{path}.json", "r") as meta_part:
json_data = json.load(meta_par... | import sys
from glob import glob
from os.path import basename
import json
book_dir, out_dir = sys.argv[1:3]
files = [basename(x).rstrip(".xhtml") for x in glob(f"{book_dir}/*.xhtml")]
json_data = {}
for path in files:
with open(f"{book_dir}/{path}-metadata.json", "r") as meta_part:
json_data = json.load... | Add metadata to jsonify json input filename | Add metadata to jsonify json input filename
| Python | lgpl-2.1 | Connexions/cte,Connexions/cnx-rulesets,Connexions/cnx-recipes,Connexions/cte,Connexions/cnx-rulesets,Connexions/cnx-recipes,Connexions/cnx-recipes,Connexions/cnx-recipes,Connexions/cnx-recipes,Connexions/cnx-rulesets,Connexions/cnx-rulesets | ---
+++
@@ -10,7 +10,7 @@
json_data = {}
for path in files:
- with open(f"{book_dir}/{path}.json", "r") as meta_part:
+ with open(f"{book_dir}/{path}-metadata.json", "r") as meta_part:
json_data = json.load(meta_part)
with open(f"{book_dir}/{path}.xhtml", "r") as book_part: |
9a33ac3f563ad657129d64cb591f08f9fd2a00a2 | tests/test_command.py | tests/test_command.py | """Unittest of command entry point."""
# Copyright 2015 Masayuki Yamamoto
#
# 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 r... | """Unittest of command entry point."""
# Copyright 2015 Masayuki Yamamoto
#
# 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 r... | Add command test for '--version' option | Add command test for '--version' option
Check output that is program name, "version" and version number.
| Python | apache-2.0 | ma8ma/yanico | ---
+++
@@ -14,7 +14,20 @@
# limitations under the License.
import unittest
+import unittest.mock as mock
+
+import yanico
+import yanico.command
class TestCreateMainParser(unittest.TestCase):
"""yanico.command.create_main_parser() test."""
+
+ def test_version(self):
+ """Parse '--version' o... |
9d23940c430a4f95ec11b33362141ec2ffc3f533 | src/tempel/models.py | src/tempel/models.py | from datetime import datetime, timedelta
from django.db import models
from django.conf import settings
from tempel import utils
def default_edit_expires():
return datetime.now() + timedelta(seconds=60*settings.TEMPEL_EDIT_AGE)
class Entry(models.Model):
content = models.TextField()
language = models.Cha... | from datetime import datetime, timedelta
from django.db import models
from django.conf import settings
from tempel import utils
def default_edit_expires():
return datetime.now() + timedelta(seconds=60*settings.TEMPEL_EDIT_AGE)
class Entry(models.Model):
content = models.TextField()
language = models.Cha... | Add is_editable and done_editable functions to Entry | Add is_editable and done_editable functions to Entry
| Python | agpl-3.0 | fajran/tempel | ---
+++
@@ -34,6 +34,15 @@
def get_extension(self):
return utils.get_extension(self.language)
+ def done_editable(self):
+ self.edit_token = None
+ self.save()
+
+ def is_editable(self, token):
+ time_ok = self.edit_expires is not None and self.edit_expires >= datetime.now()... |
02ca3946662fd996f77c30d9e61d8fc8d9243de7 | trac/upgrades/db20.py | trac/upgrades/db20.py | from trac.db import Table, Column, Index, DatabaseManager
from trac.core import TracError
from trac.versioncontrol.cache import CACHE_YOUNGEST_REV
def do_upgrade(env, ver, cursor):
"""Modify the repository cache scheme (if needed)
Now we use the 'youngest_rev' entry in the system table
to explicit... | from trac.db import Table, Column, Index, DatabaseManager
from trac.core import TracError
from trac.versioncontrol.cache import CACHE_YOUNGEST_REV
def do_upgrade(env, ver, cursor):
"""Modify the repository cache scheme (if needed)
Now we use the 'youngest_rev' entry in the system table
to explicitly store... | Make db upgrade step 20 more robust. | Make db upgrade step 20 more robust.
git-svn-id: f68c6b3b1dcd5d00a2560c384475aaef3bc99487@5815 af82e41b-90c4-0310-8c96-b1721e28e2e2
| Python | bsd-3-clause | exocad/exotrac,dokipen/trac,moreati/trac-gitsvn,exocad/exotrac,dokipen/trac,dafrito/trac-mirror,dafrito/trac-mirror,moreati/trac-gitsvn,dafrito/trac-mirror,dafrito/trac-mirror,exocad/exotrac,dokipen/trac,moreati/trac-gitsvn,exocad/exotrac,moreati/trac-gitsvn | ---
+++
@@ -12,11 +12,11 @@
try:
repos = env.get_repository()
youngest = repos.get_youngest_rev_in_cache(db) or ''
- # deleting first, for the 0.11dev and 0.10.4dev users
- cursor.execute("DELETE FROM system WHERE name=%s",
- (CACHE_YOUNGEST_REV,))
- c... |
ceb75d6f58ab16e3afdf3c7b00de539012d790d5 | djangopeoplenet/manage.py | djangopeoplenet/manage.py | #!/usr/bin/env python
import sys
paths = (
'/home/simon/sites/djangopeople.net',
'/home/simon/sites/djangopeople.net/djangopeoplenet',
'/home/simon/sites/djangopeople.net/djangopeoplenet/djangopeople/lib',
)
for path in paths:
if not path in sys.path:
sys.path.insert(0, path)
from django.core.m... | #!/usr/bin/env python
import sys, os
root = os.path.dirname(__file__)
paths = (
os.path.join(root),
os.path.join(root, "djangopeople", "lib"),
)
for path in paths:
if not path in sys.path:
sys.path.insert(0, path)
from django.core.management import execute_manager
try:
import settings # Assume... | Make the lib imports work on other computers than Simon's | Make the lib imports work on other computers than Simon's
Signed-off-by: Simon Willison <088e16a1019277b15d58faf0541e11910eb756f6@simonwillison.net> | Python | mit | brutasse/djangopeople,django/djangopeople,polinom/djangopeople,brutasse/djangopeople,polinom/djangopeople,brutasse/djangopeople,polinom/djangopeople,django/djangopeople,polinom/djangopeople,django/djangopeople,brutasse/djangopeople | ---
+++
@@ -1,9 +1,10 @@
#!/usr/bin/env python
-import sys
+
+import sys, os
+root = os.path.dirname(__file__)
paths = (
- '/home/simon/sites/djangopeople.net',
- '/home/simon/sites/djangopeople.net/djangopeoplenet',
- '/home/simon/sites/djangopeople.net/djangopeoplenet/djangopeople/lib',
+ os.path.join... |
bb34b21ebd2378f944498708ac4f13d16aa61aa1 | src/mist/io/tests/api/features/steps/backends.py | src/mist/io/tests/api/features/steps/backends.py | from behave import *
@given(u'"{text}" backend added')
def given_backend(context, text):
backends = context.client.list_backends()
for backend in backends:
if text in backend['title']:
return
@when(u'I list backends')
def list_backends(context):
context.backends = context.client.lis... | from behave import *
@given(u'"{text}" backend added through api')
def given_backend(context, text):
backends = context.client.list_backends()
for backend in backends:
if text in backend['title']:
return
@when(u'I list backends')
def list_backends(context):
context.backends = contex... | Rename Behave steps for api tests | Rename Behave steps for api tests
| Python | agpl-3.0 | johnnyWalnut/mist.io,DimensionDataCBUSydney/mist.io,zBMNForks/mist.io,afivos/mist.io,Lao-liu/mist.io,Lao-liu/mist.io,munkiat/mist.io,kelonye/mist.io,kelonye/mist.io,afivos/mist.io,Lao-liu/mist.io,Lao-liu/mist.io,DimensionDataCBUSydney/mist.io,johnnyWalnut/mist.io,zBMNForks/mist.io,DimensionDataCBUSydney/mist.io,Dimensi... | ---
+++
@@ -1,7 +1,7 @@
from behave import *
-@given(u'"{text}" backend added')
+@given(u'"{text}" backend added through api')
def given_backend(context, text):
backends = context.client.list_backends()
|
6f42f03f950e4c3967eb1efd7feb9364c9fbaf1f | google.py | google.py | import os
from werkzeug.contrib.fixers import ProxyFix
from flask import Flask, redirect, url_for
from flask_dance.contrib.google import make_google_blueprint, google
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app)
sentry = Sentry(app)
app.secret_key = os.environ.get(... | import os
from werkzeug.contrib.fixers import ProxyFix
from flask import Flask, redirect, url_for
from flask_dance.contrib.google import make_google_blueprint, google
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app)
sentry = Sentry(app)
app.secret_key = os.environ.get(... | Use userinfo URI for user profile info | Use userinfo URI for user profile info
| Python | mit | singingwolfboy/flask-dance-google | ---
+++
@@ -17,7 +17,7 @@
def index():
if not google.authorized:
return redirect(url_for("google.login"))
- resp = google.get("/plus/v1/people/me")
+ resp = google.get("/oauth2/v1/userinfo")
assert resp.ok, resp.text
return "You are {email} on Google".format(email=resp.json()["emails"][... |
2bb8ee6ae30e233f28ea0ae0fb01c0e4a1f8d9f1 | tests/functional/test_warning.py | tests/functional/test_warning.py | import pytest
import textwrap
@pytest.fixture
def warnings_demo(tmpdir):
demo = tmpdir.joinpath('warnings_demo.py')
demo.write_text(textwrap.dedent('''
from logging import basicConfig
from pip._internal.utils import deprecation
deprecation.install_warning_logger()
basicConfig(... | import textwrap
import pytest
@pytest.fixture
def warnings_demo(tmpdir):
demo = tmpdir.joinpath('warnings_demo.py')
demo.write_text(textwrap.dedent('''
from logging import basicConfig
from pip._internal.utils import deprecation
deprecation.install_warning_logger()
basicConfig... | Sort imports for the greater good | Sort imports for the greater good
| Python | mit | xavfernandez/pip,sbidoul/pip,pypa/pip,rouge8/pip,rouge8/pip,pfmoore/pip,xavfernandez/pip,sbidoul/pip,pypa/pip,pradyunsg/pip,xavfernandez/pip,pradyunsg/pip,pfmoore/pip,rouge8/pip | ---
+++
@@ -1,5 +1,6 @@
+import textwrap
+
import pytest
-import textwrap
@pytest.fixture |
ad73789f74106a2d6014a2f737578494d2d21fbf | virtool/api/processes.py | virtool/api/processes.py | import virtool.http.routes
import virtool.utils
from virtool.api.utils import json_response
routes = virtool.http.routes.Routes()
@routes.get("/api/processes")
async def find(req):
db = req.app["db"]
documents = [virtool.utils.base_processor(d) async for d in db.processes.find()]
return json_response(d... | import virtool.http.routes
import virtool.utils
from virtool.api.utils import json_response
routes = virtool.http.routes.Routes()
@routes.get("/api/processes")
async def find(req):
db = req.app["db"]
documents = [virtool.utils.base_processor(d) async for d in db.processes.find()]
return json_response(d... | Remove specific process API GET endpoints | Remove specific process API GET endpoints | Python | mit | virtool/virtool,igboyes/virtool,virtool/virtool,igboyes/virtool | ---
+++
@@ -23,21 +23,3 @@
document = await db.processes.find_one(process_id)
return json_response(virtool.utils.base_processor(document))
-
-
-@routes.get("/api/processes/software_update")
-async def get_software_update(req):
- db = req.app["db"]
-
- document = await db.processes.find_one({"type": ... |
c18b8b5e545032ae512bad505255c0f72390b633 | docs/conf.py | docs/conf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import hgtools.managers
# use hgtools to get the version
hg_mgr = hgtools.managers.RepoManager.get_first_valid_manager()
extensions = [
'sphinx.ext.autodoc',
]
# General information about the project.
project = 'pytest-runner'
copyright = '2015 Jason ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import setuptools_scm
extensions = [
'sphinx.ext.autodoc',
]
# General information about the project.
project = 'pytest-runner'
copyright = '2015 Jason R. Coombs'
# The short X.Y version.
version = setuptools_scm.get_version()
# The full version, inc... | Use setuptools_scm in docs generation. | Use setuptools_scm in docs generation.
| Python | mit | pytest-dev/pytest-runner | ---
+++
@@ -1,10 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
-import hgtools.managers
-
-# use hgtools to get the version
-hg_mgr = hgtools.managers.RepoManager.get_first_valid_manager()
+import setuptools_scm
extensions = [
'sphinx.ext.autodoc',
@@ -15,7 +12,7 @@
copyright = '2015 Jason R. Co... |
77ad68b04b66feb47116999cf79892f6630d9601 | thefuck/rules/ln_no_hard_link.py | thefuck/rules/ln_no_hard_link.py | """Suggest creating symbolic link if hard link is not allowed.
Example:
> ln barDir barLink
ln: ‘barDir’: hard link not allowed for directory
--> ln -s barDir barLink
"""
import re
from thefuck.specific.sudo import sudo_support
@sudo_support
def match(command):
return (command.stderr.endswith("hard link not al... | # -*- coding: utf-8 -*-
"""Suggest creating symbolic link if hard link is not allowed.
Example:
> ln barDir barLink
ln: ‘barDir’: hard link not allowed for directory
--> ln -s barDir barLink
"""
import re
from thefuck.specific.sudo import sudo_support
@sudo_support
def match(command):
return (command.stderr.en... | Fix encoding error in source file example | Fix encoding error in source file example
| Python | mit | lawrencebenson/thefuck,mlk/thefuck,nvbn/thefuck,PLNech/thefuck,scorphus/thefuck,nvbn/thefuck,SimenB/thefuck,Clpsplug/thefuck,SimenB/thefuck,mlk/thefuck,scorphus/thefuck,lawrencebenson/thefuck,Clpsplug/thefuck,PLNech/thefuck | ---
+++
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
"""Suggest creating symbolic link if hard link is not allowed.
Example: |
d7f3ea41bc3d252d786a339fc34337f01e1cc3eb | django_dbq/migrations/0001_initial.py | django_dbq/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
import uuid
try:
from django.db.models import UUIDField
except ImportError:
from django_dbq.fields import UUIDField
class Migration(migrations.Migration):
dependencies = [
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
import uuid
from django.db.models import UUIDField
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name=... | Remove reference to old UUIDfield in django migration | Remove reference to old UUIDfield in django migration
| Python | bsd-2-clause | dabapps/django-db-queue | ---
+++
@@ -5,10 +5,7 @@
import jsonfield.fields
import uuid
-try:
- from django.db.models import UUIDField
-except ImportError:
- from django_dbq.fields import UUIDField
+from django.db.models import UUIDField
class Migration(migrations.Migration): |
a5130e32bffa1dbc4d83f349fc3653b690154d71 | vumi/workers/vas2nets/workers.py | vumi/workers/vas2nets/workers.py | # -*- test-case-name: vumi.workers.vas2nets.test_vas2nets -*-
# -*- encoding: utf-8 -*-
from twisted.python import log
from twisted.internet.defer import inlineCallbacks, Deferred
from vumi.message import Message
from vumi.service import Worker
class EchoWorker(Worker):
@inlineCallbacks
def startWorker(sel... | # -*- test-case-name: vumi.workers.vas2nets.test_vas2nets -*-
# -*- encoding: utf-8 -*-
from twisted.python import log
from twisted.internet.defer import inlineCallbacks, Deferred
from vumi.message import Message
from vumi.service import Worker
class EchoWorker(Worker):
@inlineCallbacks
def startWorker(sel... | Add keyword to echo worker. | Add keyword to echo worker.
| Python | bsd-3-clause | TouK/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi | ---
+++
@@ -28,6 +28,7 @@
'message': data['message'],
'id': data['transport_message_id'],
'transport_network_id': data['transport_network_id'],
+ 'transport_keyword': data['transport_keyword'],
}
return self.publisher.publish_message(Message(**... |
bbf22dc68202d81a8c7e94fbb8e61d819d808115 | wisely_project/pledges/models.py | wisely_project/pledges/models.py | from django.utils import timezone
from django.db import models
from users.models import Course, BaseModel, User
class Pledge(BaseModel):
user = models.ForeignKey(User)
course = models.ForeignKey(Course)
money = models.DecimalField(max_digits=8, decimal_places=2)
pledge_date = models.DateTimeField('da... | from django.utils import timezone
from django.db import models
from users.models import Course, BaseModel, UserProfile
class Pledge(BaseModel):
user = models.ForeignKey(UserProfile)
course = models.ForeignKey(Course)
money = models.DecimalField(max_digits=8, decimal_places=2)
pledge_date = models.Dat... | Make pledge foreignkey to userprofile | Make pledge foreignkey to userprofile
| Python | mit | TejasM/wisely,TejasM/wisely,TejasM/wisely | ---
+++
@@ -1,11 +1,11 @@
from django.utils import timezone
from django.db import models
-from users.models import Course, BaseModel, User
+from users.models import Course, BaseModel, UserProfile
class Pledge(BaseModel):
- user = models.ForeignKey(User)
+ user = models.ForeignKey(UserProfile)
cour... |
8eca7b30865e4d02fd440f55ad3215dee6fab8a1 | gee_asset_manager/batch_remover.py | gee_asset_manager/batch_remover.py | import fnmatch
import logging
import sys
import ee
def delete(asset_path):
root = asset_path[:asset_path.rfind('/')]
all_assets_names = [e['id'] for e in ee.data.getList({'id': root})]
filtered_names = fnmatch.filter(all_assets_names, asset_path)
if not filtered_names:
logging.warning('Nothin... | import fnmatch
import logging
import sys
import ee
def delete(asset_path):
root_idx = asset_path.rfind('/')
if root_idx == -1:
logging.warning('Asset not found. Make sure you pass full asset name, e.g. users/pinkiepie/rainbow')
sys.exit(1)
root = asset_path[:root_idx]
all_assets_names... | Add warning when removing an asset without full path | Add warning when removing an asset without full path
| Python | apache-2.0 | tracek/gee_asset_manager | ---
+++
@@ -6,7 +6,11 @@
def delete(asset_path):
- root = asset_path[:asset_path.rfind('/')]
+ root_idx = asset_path.rfind('/')
+ if root_idx == -1:
+ logging.warning('Asset not found. Make sure you pass full asset name, e.g. users/pinkiepie/rainbow')
+ sys.exit(1)
+ root = asset_path[:... |
0255a9cc22999d3111076155feab85ebe3198492 | impeller/tools/build_metal_library.py | impeller/tools/build_metal_library.py | # Copyright 2013 The Flutter 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 sys
import argparse
import errno
import os
import subprocess
def MakeDirectories(path):
try:
os.makedirs(path)
except OSError as exc:... | # Copyright 2013 The Flutter 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 sys
import argparse
import errno
import os
import subprocess
def MakeDirectories(path):
try:
os.makedirs(path)
except OSError as exc:... | Add FIXME to address removing debug information from generated shaders. | Add FIXME to address removing debug information from generated shaders.
| Python | bsd-3-clause | chinmaygarde/flutter_engine,rmacnak-google/engine,devoncarew/engine,devoncarew/engine,chinmaygarde/flutter_engine,devoncarew/engine,rmacnak-google/engine,rmacnak-google/engine,rmacnak-google/engine,flutter/engine,chinmaygarde/flutter_engine,chinmaygarde/flutter_engine,flutter/engine,chinmaygarde/flutter_engine,rmacnak-... | ---
+++
@@ -37,6 +37,8 @@
command = [
"xcrun",
"metal",
+ # TODO: Embeds both sources and driver options in the output. This aids in
+ # debugging but should be removed from release builds.
"-MO",
"-gline-tables-only",
# Both user and system header will be tracked. |
18a874f312a57b4b9b7a5ce5cf9857585f0f0fef | truffe2/app/utils.py | truffe2/app/utils.py |
def add_current_unit(request):
"""Template context processor to add current unit"""
return {'CURRENT_UNIT': get_current_unit(request)}
def get_current_unit(request):
"""Return the current unit"""
from units.models import Unit
current_unit_pk = request.session.get('current_unit_pk', 1)
try... | from django.conf import settings
def add_current_unit(request):
"""Template context processor to add current unit"""
return {'CURRENT_UNIT': get_current_unit(request)}
def get_current_unit(request):
"""Return the current unit"""
from units.models import Unit
current_unit_pk = request.session.g... | Fix error if no units | Fix error if no units
| Python | bsd-2-clause | agepoly/truffe2,ArcaniteSolutions/truffe2,ArcaniteSolutions/truffe2,agepoly/truffe2,agepoly/truffe2,ArcaniteSolutions/truffe2,agepoly/truffe2,ArcaniteSolutions/truffe2 | ---
+++
@@ -1,3 +1,4 @@
+from django.conf import settings
def add_current_unit(request):
"""Template context processor to add current unit"""
@@ -15,7 +16,10 @@
try:
current_unit = Unit.objects.get(pk=current_unit_pk)
except Unit.DoesNotExist:
- current_unit = Unit.objects.get(pk=1)
... |
0a1358f27db3abb04032fac1b8a3da09d846d23e | oauth_provider/utils.py | oauth_provider/utils.py | import oauth.oauth as oauth
from django.conf import settings
from django.http import HttpResponse
from stores import DataStore
OAUTH_REALM_KEY_NAME = 'OAUTH_REALM_KEY_NAME'
def initialize_server_request(request):
"""Shortcut for initialization."""
oauth_request = oauth.OAuthRequest.from_request(request.meth... | import oauth.oauth as oauth
from django.conf import settings
from django.http import HttpResponse
from stores import DataStore
OAUTH_REALM_KEY_NAME = 'OAUTH_REALM_KEY_NAME'
def initialize_server_request(request):
"""Shortcut for initialization."""
# Django converts Authorization header in HTTP_AUTHORIZATION... | Fix a bug introduced in the latest revision, testing auth header in initialize_server_request now, thanks Chris McMichael for the report and patch | Fix a bug introduced in the latest revision, testing auth header in initialize_server_request now, thanks Chris McMichael for the report and patch
| Python | bsd-3-clause | e-loue/django-oauth-plus | ---
+++
@@ -9,9 +9,17 @@
def initialize_server_request(request):
"""Shortcut for initialization."""
+ # Django converts Authorization header in HTTP_AUTHORIZATION
+ # Warning: it doesn't happen in tests but it's useful, do not remove!
+ auth_header = {}
+ if 'Authorization' in request.META:
+ ... |
1fa0eb2c792b3cc89d27b322c80548f022b7fbb9 | api/base/exceptions.py | api/base/exceptions.py | from rest_framework.exceptions import APIException
from rest_framework import status
def jsonapi_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array with a 'detail' member
"""
from rest_framework.views import exception_handler
response = exception_ha... |
from rest_framework import status
from rest_framework.exceptions import APIException
def json_api_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array
"""
from rest_framework.views import exception_handler
response = exception_handler(exc, context)
... | Modify exception handler to cover multiple data types i.e. dict and list and handle when more than one error returned | Modify exception handler to cover multiple data types i.e. dict and list and handle when more than one error returned
| Python | apache-2.0 | monikagrabowska/osf.io,hmoco/osf.io,asanfilippo7/osf.io,njantrania/osf.io,sloria/osf.io,MerlinZhang/osf.io,acshi/osf.io,mluke93/osf.io,asanfilippo7/osf.io,Johnetordoff/osf.io,haoyuchen1992/osf.io,ckc6cz/osf.io,GageGaskins/osf.io,chrisseto/osf.io,ticklemepierce/osf.io,chennan47/osf.io,caseyrygt/osf.io,DanielSBrown/osf.i... | ---
+++
@@ -1,18 +1,34 @@
+
+from rest_framework import status
from rest_framework.exceptions import APIException
-from rest_framework import status
-def jsonapi_exception_handler(exc, context):
+
+def json_api_exception_handler(exc, context):
"""
- Custom exception handler that returns errors object as an... |
4c1bf1757baa5beec50377724961c528f5985864 | ptest/screencapturer.py | ptest/screencapturer.py | import threading
import traceback
import plogger
__author__ = 'karl.gong'
def take_screen_shot():
current_thread = threading.currentThread()
active_browser = current_thread.get_property("browser")
if active_browser is not None:
while True:
try:
active_browser.switch... | import threading
import traceback
import StringIO
import plogger
try:
from PIL import ImageGrab
except ImportError:
PIL_installed = False
else:
PIL_installed = True
try:
import wx
except ImportError:
wxpython_installed = False
else:
wxpython_installed = True
__author__ = 'karl.gong'
def t... | Support capture screenshot for no-selenium test | Support capture screenshot for no-selenium test
| Python | apache-2.0 | KarlGong/ptest,KarlGong/ptest | ---
+++
@@ -1,8 +1,23 @@
import threading
import traceback
+import StringIO
import plogger
+
+try:
+ from PIL import ImageGrab
+except ImportError:
+ PIL_installed = False
+else:
+ PIL_installed = True
+
+try:
+ import wx
+except ImportError:
+ wxpython_installed = False
+else:
+ wxpython_ins... |
c82f0f10ea8b96377ebed8a6859ff3cd8ed4cd3f | python/turbodbc/exceptions.py | python/turbodbc/exceptions.py | from __future__ import absolute_import
from functools import wraps
from exceptions import StandardError
from turbodbc_intern import Error as InternError
class Error(StandardError):
pass
class InterfaceError(Error):
pass
class DatabaseError(Error):
pass
def translate_exceptions(f):
@wraps(f)
... | from __future__ import absolute_import
from functools import wraps
from turbodbc_intern import Error as InternError
# Python 2/3 compatibility
try:
from exceptions import StandardError as _BaseError
except ImportError:
_BaseError = Exception
class Error(_BaseError):
pass
class InterfaceError(Error):... | Fix Python 2/3 exception base class compatibility | Fix Python 2/3 exception base class compatibility
| Python | mit | blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc | ---
+++
@@ -1,12 +1,18 @@
from __future__ import absolute_import
from functools import wraps
-from exceptions import StandardError
from turbodbc_intern import Error as InternError
-class Error(StandardError):
+# Python 2/3 compatibility
+try:
+ from exceptions import StandardError as _BaseError
+except ... |
80f1ee23f85aee9a54e0c6cae7a30dddbe96541b | scorecard/tests/test_views.py | scorecard/tests/test_views.py | import json
from infrastructure.models import FinancialYear
from django.test import (
TransactionTestCase,
Client,
override_settings,
)
from . import (
import_data,
)
from .resources import (
GeographyResource,
MunicipalityProfileResource,
MedianGroupResource,
RatingCountGroupResource,... | import json
from django.test import (
TransactionTestCase,
Client,
override_settings,
)
@override_settings(
SITE_ID=2,
STATICFILES_STORAGE="django.contrib.staticfiles.storage.StaticFilesStorage",
)
class GeographyDetailViewTestCase(TransactionTestCase):
serialized_rollback = True
fixtures... | Use new fixtures for geography views test | Use new fixtures for geography views test
| Python | mit | Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data | ---
+++
@@ -1,20 +1,9 @@
import json
-from infrastructure.models import FinancialYear
from django.test import (
TransactionTestCase,
Client,
override_settings,
-)
-
-from . import (
- import_data,
-)
-from .resources import (
- GeographyResource,
- MunicipalityProfileResource,
- MedianG... |
4666849791cad70ae1bb907a2dcc35ccfc0b7de4 | backend/populate_dimkarakostas.py | backend/populate_dimkarakostas.py | from string import ascii_lowercase
import django
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
django.setup()
from breach.models import Target, Victim
endpoint = 'https://dimkarakostas.com/rupture/test.php?ref=%s'
prefix = 'imper'
alphabet = ascii_lowercase
secretlength = 9
target_1 ... | from string import ascii_lowercase
import django
import os
import string
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
django.setup()
from breach.models import Target, Victim
endpoint = 'https://dimkarakostas.com/rupture/test.php?ref=%s'
prefix = 'imper'
alphabet = ascii_lowercase
secretlength ... | Update dimkarakostas population with alignmentalphabet | Update dimkarakostas population with alignmentalphabet
| Python | mit | esarafianou/rupture,dionyziz/rupture,esarafianou/rupture,dionyziz/rupture,dimriou/rupture,dionyziz/rupture,dimriou/rupture,esarafianou/rupture,dionyziz/rupture,dimkarakostas/rupture,esarafianou/rupture,dimkarakostas/rupture,dionyziz/rupture,dimriou/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dimkarakostas/ruptu... | ---
+++
@@ -1,6 +1,7 @@
from string import ascii_lowercase
import django
import os
+import string
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
django.setup()
@@ -16,7 +17,8 @@
endpoint=endpoint,
prefix=prefix,
alphabet=alphabet,
- secretlength=secretlength
+ secretle... |
1b74dc0288d1f3349e5045f6791c8495435c961d | controlers/errors.py | controlers/errors.py | '''Copyright(C): Leaf Johnson 2011
This file is part of makeclub.
makeclub is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later versi... | '''Copyright(C): Leaf Johnson 2011
This file is part of makeclub.
makeclub is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later versi... | Fix bug - error page could display message now | Fix bug - error page could display message now
| Python | agpl-3.0 | cardmaster/makeclub,cardmaster/makeclub,cardmaster/makeclub | ---
+++
@@ -23,7 +23,7 @@
tplt = os.path.join(os.path.dirname(__file__), '../templates/default/errors.html')
def renderErrorPage(msg, redirect=''):
- vars = dict(msg=msg, redirect=redirect)
+ vars = dict(message=msg, redirect=redirect)
return template.render(tplt, vars)
def errorPage(msg, redirect, response)... |
8abdce9c60c9d2ead839e0065d35128ec16a82a1 | chatterbot/__main__.py | chatterbot/__main__.py | import sys
if __name__ == '__main__':
import chatterbot
if '--version' in sys.argv:
print(chatterbot.__version__)
if 'list_nltk_data' in sys.argv:
import nltk.data
print('\n'.join(nltk.data.path))
| import sys
if __name__ == '__main__':
import chatterbot
if '--version' in sys.argv:
print(chatterbot.__version__)
if 'list_nltk_data' in sys.argv:
import os
import nltk.data
data_directories = []
# Find each data directory in the NLTK path that has content
... | Add commad line utility to find NLTK data | Add commad line utility to find NLTK data
| Python | bsd-3-clause | gunthercox/ChatterBot,vkosuri/ChatterBot | ---
+++
@@ -8,6 +8,15 @@
print(chatterbot.__version__)
if 'list_nltk_data' in sys.argv:
+ import os
import nltk.data
- print('\n'.join(nltk.data.path))
+ data_directories = []
+
+ # Find each data directory in the NLTK path that has content
+ for path in n... |
210c7b7fb421a7c083b9d292370b15c0ece17fa7 | source/bark/__init__.py | source/bark/__init__.py | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
from .handler.distribute import Distribute
#: Top level handler responsible for relaying all logs to other handlers.
handle = Distribute()
| # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
from .handler.distribute import Distribute
#: Top level handler responsible for relaying all logs to other handlers.
handler = Distribute()
handlers = handler.handlers
handle = handler.handle
| Correct handler reference variable name and add convenient accessors. | Correct handler reference variable name and add convenient accessors.
| Python | apache-2.0 | 4degrees/mill,4degrees/sawmill | ---
+++
@@ -5,5 +5,8 @@
from .handler.distribute import Distribute
#: Top level handler responsible for relaying all logs to other handlers.
-handle = Distribute()
+handler = Distribute()
+handlers = handler.handlers
+handle = handler.handle
+ |
c1f7544138990dc6dbb05090711d57e6fea36fb4 | pava/implementation/tests/__init__.py | pava/implementation/tests/__init__.py | import unittest
import arrays
ArrayTest = arrays.ArrayTest
class PavaTest(unittest.TestCase):
def test_general(self):
pass
if __name__ == "__main__":
unittest.main()
| Create all.py to run all tests | Create all.py to run all tests
| Python | mit | laffra/pava,laffra/pava | ---
+++
@@ -1,12 +1 @@
-import unittest
-import arrays
-
-ArrayTest = arrays.ArrayTest
-
-class PavaTest(unittest.TestCase):
- def test_general(self):
- pass
-
-if __name__ == "__main__":
- unittest.main() | |
696a79069ad1db1caee4d6da0c3c48dbd79f9157 | sqliteschema/_logger.py | sqliteschema/_logger.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import logbook
import pytablewriter
import simplesqlite
logger = logbook.Logger("sqliteschema")
logger.disable()
def set_logger(is_enable):
pytablew... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import logbook
import pytablewriter
import simplesqlite
logger = logbook.Logger("sqliteschema")
logger.disable()
def set_logger(is_enable):
if is_en... | Modify to avoid excessive logger initialization | Modify to avoid excessive logger initialization
| Python | mit | thombashi/sqliteschema | ---
+++
@@ -17,13 +17,16 @@
def set_logger(is_enable):
- pytablewriter.set_logger(is_enable=is_enable)
- simplesqlite.set_logger(is_enable=is_enable)
+ if is_enable != logger.disabled:
+ return
if is_enable:
logger.enable()
else:
logger.disable()
+
+ pytablewriter... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.