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 |
|---|---|---|---|---|---|---|---|---|---|---|
3b30dcc70cca6430594bdb3e35299252866b8577 | array/move_zeros_to_end.py | array/move_zeros_to_end.py | """
Write an algorithm that takes an array and moves all of the zeros to the end, preserving the order of the other elements.
move_zeros([false,1,0,1,2,0,1,3,"a"]) # returns[false,1,1,2,1,3,"a",0,0]
The time complexity of the below algorithm is O(n).
"""
def move_zeros(array):
if len(array) < 1:
return ar... | """
Write an algorithm that takes an array and moves all of the zeros to the end, preserving the order of the other elements.
move_zeros([false,1,0,1,2,0,1,3,"a"]) # returns[false,1,1,2,1,3,"a",0,0]
The time complexity of the below algorithm is O(n).
"""
def move_zeros(array):
result = []
zeros = 0
for i... | Change the variable name for clarity | Change the variable name for clarity | Python | mit | keon/algorithms,amaozhao/algorithms | ---
+++
@@ -6,19 +6,16 @@
"""
def move_zeros(array):
- if len(array) < 1:
- return array
- else:
- list = []
- zeros = 0
+ result = []
+ zeros = 0
- for i in array:
- if not i and type(i) is int or type(i) is float:
- zeros += 1
- else... |
68abb71275bbe5fcd9e75cd8a252fff49ca2eb86 | setup.py | setup.py | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import setup
from dlstats import version
import os
setup(name='dlstats',
version=version.version,
description='A python module that provides an interface between statistics providers and pandas.',
author='Widukind team',
author_email='dev@mic... | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import setup
from dlstats import version
import os
setup(name='dlstats',
version=version.version,
description='A python module that provides an interface between statistics providers and pandas.',
author='Widukind team',
author_email='dev@mic... | Add voluptuous as a dependency | Add voluptuous as a dependency
| Python | agpl-3.0 | MichelJuillard/dlstats,mmalter/dlstats,mmalter/dlstats,mmalter/dlstats,MichelJuillard/dlstats,Widukind/dlstats,MichelJuillard/dlstats,Widukind/dlstats | ---
+++
@@ -17,6 +17,7 @@
install_requires=[
'pandas>=0.12',
'docopt>=0.6.0'
+ 'voluptuous>=0.8'
]
)
|
424a7a08cce06e32b4159a90597fe569840f641f | udata/__init__.py | udata/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
uData
'''
from __future__ import unicode_literals
__version__ = '0.9.0.dev'
__description__ = 'Open data portal'
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
uData
'''
from __future__ import unicode_literals
__version__ = '1.0.0.dev'
__description__ = 'Open data portal'
| Increase dev version to 1.0.0 for Pypi | Increase dev version to 1.0.0 for Pypi
| Python | agpl-3.0 | etalab/udata,davidbgk/udata,opendatateam/udata,opendatateam/udata,jphnoel/udata,davidbgk/udata,opendatateam/udata,etalab/udata,jphnoel/udata,davidbgk/udata,jphnoel/udata,etalab/udata | ---
+++
@@ -5,5 +5,5 @@
'''
from __future__ import unicode_literals
-__version__ = '0.9.0.dev'
+__version__ = '1.0.0.dev'
__description__ = 'Open data portal' |
88840c70accccda1c3aad3891650942ca890bc34 | setup.py | setup.py | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
name = 'Mikko Korpela'
# I might be just a little bit too much afraid of those bots..
address = name.lower().replace(' ', '.')+chr(64)+'gmail.com'
setup(name='robotframework-pabot',
version='1.2.0',
description='Parallel test run... | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
name = 'Mikko Korpela'
# I might be just a little bit too much afraid of those bots..
address = name.lower().replace(' ', '.')+chr(64)+'gmail.com'
setup(name='robotframework-pabot',
version='1.2.0',
description='Parallel test run... | Revert "hide worker and coordinator" | Revert "hide worker and coordinator"
This reverts commit d2fc4b1fb37d8b687d7a5561be74a1e04fa0d57c.
| Python | apache-2.0 | mkorpela/pabot,mkorpela/pabot | ---
+++
@@ -28,7 +28,9 @@
'Framework :: Robot Framework'
],
entry_points = {'console_scripts': [
- 'pabot=pabot.pabot:main']},
+ 'pabot=pabot.pabot:main',
+ 'pabotcoordinator=pabot.coordinatorwrapper:main',
+ 'pabotworker=pabot.workerwrapper:main'... |
d1dda8983bdaa0d25ab10051381e34befe7ed4a8 | setup.py | setup.py | #!/usr/bin/env python
# coding: utf-8
from setuptools import setup, find_packages
setup(
name="bentoo",
description="Benchmarking tools",
version="0.20.0",
packages=find_packages(),
scripts=["scripts/bentoo-generator.py", "scripts/bentoo-runner.py",
"scripts/bentoo-collector.py", "scri... | #!/usr/bin/env python
# coding: utf-8
from setuptools import setup, find_packages
setup(
name="bentoo",
description="Benchmarking tools",
version="0.21.dev",
packages=find_packages(),
scripts=["scripts/bentoo-generator.py", "scripts/bentoo-runner.py",
"scripts/bentoo-collector.py", "sc... | Prepare for next dev cycle | Prepare for next dev cycle
| Python | mit | ProgramFan/bentoo | ---
+++
@@ -5,7 +5,7 @@
setup(
name="bentoo",
description="Benchmarking tools",
- version="0.20.0",
+ version="0.21.dev",
packages=find_packages(),
scripts=["scripts/bentoo-generator.py", "scripts/bentoo-runner.py",
"scripts/bentoo-collector.py", "scripts/bentoo-analyser.py", |
ad366d0f664d22c4124b2b0755815aeeccba4dd8 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='flask-appconfig',
version='0.9.1.dev1',
description=('Configures Flask applications in a canonical wa... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='flask-appconfig',
version='0.9.1.dev1',
description=('Configures Flask applications in a canonical wa... | Remove .py extension from py_module. | Remove .py extension from py_module.
| Python | mit | mbr/flask-appconfig,brettatoms/flask-appconfig | ---
+++
@@ -21,7 +21,7 @@
url='http://github.com/mbr/flask-appconfig',
license='MIT',
packages=find_packages(exclude=['tests']),
- py_modules=['flaskdev.py'],
+ py_modules=['flaskdev'],
install_requires=['flask', 'six'],
entry_points={
'console_scripts': [ |
01d73eb5b27f82707b9819277f4d1fe6e4f07a6b | setup.py | setup.py | from distutils.core import setup
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Win32 (MS Windows)',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Operating System :: Microsoft :: Windows',... | from distutils.core import setup
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Win32 (MS Windows)',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Operating System :: Microsoft :: Windows',... | Switch to a built-in long_description so pip succeeds | Switch to a built-in long_description so pip succeeds
| Python | mit | tjguk/winshell,tjguk/winshell,tjguk/winshell | ---
+++
@@ -12,6 +12,17 @@
"Programming Language :: Python :: 3",
]
+long_description = """winshell
+========
+
+The winshell module is a light wrapper around the Windows shell functionality.
+
+It includes convenience functions for accessing special folders, for using
+the shell's file copy, rename & delete fu... |
16ca763d966e4e0c3172ca6bd28a81c460c23811 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name="django-salmonella",
version="0.4.1",
author='Lincoln Loop: Seth Buntin, Yann Malet',
author_email='info@lincolnloop.com',
description=("raw_id_fields widget replacement that handles display of an object's "
"string value on c... | from setuptools import setup, find_packages
setup(
name="django-salmonella",
version="0.4.1",
author='Lincoln Loop: Seth Buntin, Yann Malet',
author_email='info@lincolnloop.com',
description=("raw_id_fields widget replacement that handles display of an object's "
"string value on c... | Remove the 1 in the Development status classifier | Remove the 1 in the Development status classifier
| Python | mit | lincolnloop/django-salmonella,lincolnloop/django-salmonella,lincolnloop/django-salmonella,lincolnloop/django-salmonella,Gustavosdo/django-salmonella,Gustavosdo/django-salmonella,Gustavosdo/django-salmonella | ---
+++
@@ -12,7 +12,7 @@
url="http://github.com/lincolnloop/django-salmonella/",
install_requires=['setuptools'],
classifiers=[
- 'Development Status :: 4 - Beta1',
+ 'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'In... |
fbb31793940619649d1d047d03788ca1967c7afd | setup.py | setup.py | import io
from setuptools import setup, find_packages
def read(*filenames, **kwargs):
"""
From http://www.jeffknupp.com/blog/2013/08/16/open-sourcing-a-python-project-the-right-way/
"""
encoding = kwargs.get('encoding', 'utf-8')
sep = kwargs.get('sep', '\n')
buf = []
for filename in filena... | import io
from setuptools import setup, find_packages
def read(*filenames, **kwargs):
"""
From http://www.jeffknupp.com/blog/2013/08/16/open-sourcing-a-python-project-the-right-way/
"""
encoding = kwargs.get('encoding', 'utf-8')
sep = kwargs.get('sep', '\n')
buf = []
for filename in filena... | Make South optional since we now support Django migrations. | Make South optional since we now support Django migrations.
| Python | mit | niconoe/djangocms-markdown,niconoe/djangocms-markdown,niconoe/djangocms-markdown | ---
+++
@@ -33,5 +33,7 @@
'South',
'django-cms>=3.0.0',
'django-markdown-deux',
- ],
+ ], extras_require = {
+ 'Django_less_than_17': ["South>=1.0"]
+ }
) |
395400dc5d727d1718485a71a90d03fce6e9bd47 | setup.py | setup.py | #!/usr/bin/python2.4
from distutils.core import setup
setup(name='mox',
version='0.5.1',
py_modules=['mox', 'stubout'],
url='http://code.google.com/p/pymox/',
maintainer='pymox maintainers',
maintainer_email='mox-discuss@googlegroups.com',
license='Apache License, Version 2.0',
... | #!/usr/bin/python2.4
from distutils.core import setup
setup(name='mox',
version='0.5.2',
py_modules=['mox', 'stubout'],
url='http://code.google.com/p/pymox/',
maintainer='pymox maintainers',
maintainer_email='mox-discuss@googlegroups.com',
license='Apache License, Version 2.0',
... | Increment version number to 0.5.2 for new release. | Increment version number to 0.5.2 for new release.
| Python | apache-2.0 | deets/mox-fork | ---
+++
@@ -2,7 +2,7 @@
from distutils.core import setup
setup(name='mox',
- version='0.5.1',
+ version='0.5.2',
py_modules=['mox', 'stubout'],
url='http://code.google.com/p/pymox/',
maintainer='pymox maintainers', |
1c1198b5c4e2542629cab438741a87d2a52a270c | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
from setuptools import setup
setup(
name = 'TracMasterTickets',
version = '2.1',
packages = ['mastertickets'],
package_data = { 'mastertickets': ['htdocs/*.js', 'htdocs/*.css' ] },
author = "Noah Kantrowitz",
author_email = "coderanger@yahoo.... | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
from setuptools import setup
setup(
name = 'TracMasterTickets',
version = '2.1.1',
packages = ['mastertickets'],
package_data = { 'mastertickets': ['htdocs/*.js', 'htdocs/*.css' ] },
author = "Noah Kantrowitz",
author_email = "coderanger@yaho... | Mark that we need Genshi from trunk. | Mark that we need Genshi from trunk.
| Python | bsd-3-clause | pombredanne/trac-mastertickets,thmo/trac-mastertickets,thmo/trac-mastertickets,pombredanne/trac-mastertickets | ---
+++
@@ -5,7 +5,7 @@
setup(
name = 'TracMasterTickets',
- version = '2.1',
+ version = '2.1.1',
packages = ['mastertickets'],
package_data = { 'mastertickets': ['htdocs/*.js', 'htdocs/*.css' ] },
@@ -19,7 +19,7 @@
'Framework :: Trac',
],
- install_requires = ['Trac'... |
425d7f34954ec76b51122a95ab32ab7cc320881a | setup.py | setup.py | from setuptools import setup
setup(
name='python-obelisk',
version="0.1.2",
install_requires=['ecdsa', 'pyzmq'],
maintainer='Dionysis Zindros',
maintainer_email='dionyziz@gmail.com',
zip_safe=False,
description="Python native client for the obelisk blockchain server.",
long_description=... | from setuptools import setup
setup(
name='python-obelisk',
version="0.1.3",
install_requires=['twisted', 'ecdsa', 'pyzmq'],
packages=['obelisk'],
maintainer='Dionysis Zindros',
maintainer_email='dionyziz@gmail.com',
zip_safe=False,
description="Python native client for the obelisk block... | Add twisted dependency, declare packages of project | Add twisted dependency, declare packages of project
| Python | agpl-3.0 | cpacia/python-libbitcoinclient,darkwallet/python-obelisk | ---
+++
@@ -2,8 +2,9 @@
setup(
name='python-obelisk',
- version="0.1.2",
- install_requires=['ecdsa', 'pyzmq'],
+ version="0.1.3",
+ install_requires=['twisted', 'ecdsa', 'pyzmq'],
+ packages=['obelisk'],
maintainer='Dionysis Zindros',
maintainer_email='dionyziz@gmail.com',
zip_s... |
d153bc1225a6971bc3dc509dd3934fa15ad69477 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(name='tap-awin',
version='0.0.1',
description='Singer.io tap for extracting data from the Affiliate Window API',
author='Onedox',
url='https://onedox.com',
classifiers=['Programming Language :: Python :: 3 :: Only'],
py_modul... | #!/usr/bin/env python
from setuptools import setup
setup(name='tap-awin',
version='0.0.1',
description='Singer.io tap for extracting data from the Affiliate Window API',
author='Onedox',
url='https://github.com/onedox/tap-awin',
download_url = 'https://github.com/onedox/tap-awin/archive/... | Prepare for 0.0.1 release to PyPI | Prepare for 0.0.1 release to PyPI
| Python | apache-2.0 | onedox/tap-awin | ---
+++
@@ -6,7 +6,8 @@
version='0.0.1',
description='Singer.io tap for extracting data from the Affiliate Window API',
author='Onedox',
- url='https://onedox.com',
+ url='https://github.com/onedox/tap-awin',
+ download_url = 'https://github.com/onedox/tap-awin/archive/0.0.1.tar.gz... |
5b92fdc1af9043649dd9efa1f4f5337809d5af27 | setup.py | setup.py | from setuptools import setup
setup(
name='hypothesis-pb',
packages=['hypothesis_protobuf'],
platforms='any',
version='1.2.0',
description='Hypothesis extension to allow generating protobuf messages matching a schema.',
author='H. Chase Stevens',
author_email='chase@chasestevens.com',
ur... | from setuptools import setup
setup(
name='hypothesis-pb',
packages=['hypothesis_protobuf'],
platforms='any',
version='1.2.0',
description='Hypothesis extension to allow generating protobuf messages matching a schema.',
author='H. Chase Stevens',
author_email='chase@chasestevens.com',
ur... | Add hypothesis as framework for discoverability | Add hypothesis as framework for discoverability | Python | mit | hchasestevens/hypothesis-protobuf | ---
+++
@@ -17,6 +17,7 @@
tests_require=['pytest>=3.1.2', 'future>=0.16.0'],
extras_require={'dev': ['pytest>=3.1.2', 'future>=0.16.0']},
classifiers=[
+ 'Framework :: Hypothesis',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming La... |
4f99fa0bba7410271e2b6f15fa8ea0d1df160740 | setup.py | setup.py | import setuptools
import sys
import os.path
import subprocess
# Build README.txt from README.md if not present, and if we are actually building for distribution to pypi
if not os.path.exists('README.txt') and 'sdist' in sys.argv:
subprocess.call(['pandoc', '--to=rst', '--smart', '--output=README.txt', 'README.md... | import setuptools
import sys
import os.path
import subprocess
# Build README.txt from README.md if not present, and if we are actually building for distribution to pypi
if not os.path.exists('README.txt') and 'sdist' in sys.argv:
subprocess.call(['pandoc', '--to=rst', '--smart', '--output=README.txt', 'README.md... | Add trove classifiers (bump version to 0.9 to publish them) | Add trove classifiers (bump version to 0.9 to publish them)
| Python | apache-2.0 | abloomston/python-jsonpath-rw,pkilambi/python-jsonpath-rw,kennknowles/python-jsonpath-rw,sileht/python-jsonpath-rw,wangjild/python-jsonpath-rw,brianthelion/python-jsonpath-rw | ---
+++
@@ -13,7 +13,7 @@
setuptools.setup(
name='jsonpath-rw',
- version='0.8',
+ version='0.9',
description='A robust and significantly extended implementation of JSONPath for Python, with a clear AST for metaprogramming.',
author='Kenneth Knowles',
author_email='kenn.knowles@gmail.com'... |
b18cd768b4663e9a09854b49524080300893037d | setup.py | setup.py | #!/usr/bin/env python2
import os
from setuptools import setup, find_packages
from plugins import __version__
repo_directory = os.path.dirname(__file__)
try:
long_description = open(os.path.join(repo_directory, 'README.rst')).read()
except:
long_description = None
setup(
name='gds-nagios-plugins',
ve... | #!/usr/bin/env python2
import os
from setuptools import setup, find_packages
from plugins import __version__
repo_directory = os.path.dirname(__file__)
try:
long_description = open(os.path.join(repo_directory, 'README.rst')).read()
except:
long_description = None
setup(
name='gds-nagios-plugins',
ve... | Upgrade nose to 1.3.1 for Travis | Upgrade nose to 1.3.1 for Travis
| Python | mit | alphagov/nagios-plugins | ---
+++
@@ -31,7 +31,7 @@
"nagioscheck==0.1.6"
],
tests_require=[
- "nose==1.3.0",
+ "nose==1.3.1",
"freezegun==0.1.11"
],
|
4bebc9b686b29f2a068dd90b2024960dcf5e19a2 | setup.py | setup.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from codecs import open
import os.path as osp
from setuptools import setup, find_packages
import strumenti
here = osp.abspath(osp.dirname(__file__))
with open(osp.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='stru... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from codecs import open
import os.path as osp
from setuptools import setup, find_packages
import strumenti
here = osp.abspath(osp.dirname(__file__))
with open(osp.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='stru... | Test wrapt.document for Read the Docs | Test wrapt.document for Read the Docs
| Python | bsd-3-clause | TimothyHelton/strumenti | ---
+++
@@ -38,6 +38,7 @@
'pytest',
'termcolor',
'wrapt',
+ 'wrapt.decorator',
],
package_dir={'strumenti': 'strumenti'},
include_package_data=True, |
5434b4731de5c0690ed98bf643fc27b79f0248f0 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name="python-ssmi",
version="0.0.4",
url='http://github.com/praekelt/python-ssmi',
license='proprietary',
description="Python module implementing SSMI for USSD and SMS.",
author='Morgan Collett',
author_email='morgan@praekelt.com',
pack... | from setuptools import setup, find_packages
setup(
name="python-ssmi",
version="0.0.4",
url='http://github.com/praekelt/python-ssmi',
license='BSD',
description="Python module implementing SSMI for USSD and SMS.",
author='Praekelt Foundation',
author_email='dev@praekeltfoundation.org',
... | Update license and trove classifiers. | Update license and trove classifiers.
| Python | bsd-3-clause | kostyll/python-ssmi,praekelt/python-ssmi | ---
+++
@@ -4,11 +4,20 @@
name="python-ssmi",
version="0.0.4",
url='http://github.com/praekelt/python-ssmi',
- license='proprietary',
+ license='BSD',
description="Python module implementing SSMI for USSD and SMS.",
- author='Morgan Collett',
- author_email='morgan@praekelt.com',
+ ... |
6cd5c0657579b0ad583c303d9076282f59f5d8b0 | setup.py | setup.py | #! /usr/bin/env python
"""TODO: Maybe add a docstring containing a long description
This would double as something we could put int the `long_description`
parameter for `setup` and it would squelch some complaints pylint has on
`setup.py`.
"""
from setuptools import setup
import os
setup(name='demandlib',
... | #! /usr/bin/env python
"""TODO: Maybe add a docstring containing a long description
This would double as something we could put int the `long_description`
parameter for `setup` and it would squelch some complaints pylint has on
`setup.py`.
"""
from setuptools import setup
import os
setup(name='demandlib',
... | Simplify package_data definition and add examples data | Simplify package_data definition and add examples data
| Python | mit | oemof/demandlib | ---
+++
@@ -20,11 +20,8 @@
description='Demandlib of the open energy modelling framework',
packages=['demandlib', 'examples'],
package_data = {
- 'demandlib': [
- os.path.join('bdew_data', 'selp_series.csv'),
- os.path.join('bdew_data', 'shlp_hour_factors.csv'),... |
36a6706bfd0866e7c03b2c7190e3550a2180fc4c | setup.py | setup.py | from setuptools import setup, find_packages
setup(name='adobe-umapi',
version='1.0.1',
description='Adobe User Management API (UMAPI) client - see http://bit.ly/2hwkVrs',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 2.7',
... | from setuptools import setup, find_packages
setup(name='adobe-umapi',
version='1.0.0rc1',
description='Adobe User Management API (UMAPI) client - see http://bit.ly/2hwkVrs',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 2.7',
... | Call the last release 1.0rc1 in preparation for renaming the published module. | Call the last release 1.0rc1 in preparation for renaming the published module.
| Python | mit | adobe-apiplatform/umapi-client.py | ---
+++
@@ -2,7 +2,7 @@
setup(name='adobe-umapi',
- version='1.0.1',
+ version='1.0.0rc1',
description='Adobe User Management API (UMAPI) client - see http://bit.ly/2hwkVrs',
classifiers=[
'Development Status :: 5 - Production/Stable', |
d5e1f7d690d9f663e12cd4ee85979d10e2df04ea | test/test_get_rest.py | test/test_get_rest.py | import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
test_dir = utils.set_search_paths(TOPDIR)
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
class Tests(unittest.TestCase):
def test_bad(self):
"""Test wrong... | import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
test_dir = utils.set_search_paths(TOPDIR)
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
class Tests(unittest.TestCase):
def test_bad(self):
"""Test wrong... | Make sure that output is text in Python 2 & 3. | Make sure that output is text in Python 2 & 3.
| Python | lgpl-2.1 | salilab/allosmod-lib,salilab/allosmod-lib,salilab/allosmod-lib,salilab/allosmod-lib,salilab/allosmod-lib | ---
+++
@@ -24,7 +24,8 @@
pass
out = check_output(['allosmod', 'get_rest',
os.path.join(test_dir, 'input',
- 'asite_pdb1.pdb')])
+ 'asite_pdb1.pdb')],
+ universal_n... |
4fcc2816cfcc545f29f4dabc466bd243c1d59ca6 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import publisher
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
version = publisher.__version__
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
print("You probably want... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup
import publisher
version = publisher.__version__
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
print("You probably want to also tag the version now:")
print(" git tag -a %s -m 'ver... | Remove distutils, removed django-model-utils requirement. | Remove distutils, removed django-model-utils requirement.
| Python | bsd-3-clause | jp74/django-model-publisher,jp74/django-model-publisher,wearehoods/django-model-publisher-ai,jp74/django-model-publisher,wearehoods/django-model-publisher-ai,wearehoods/django-model-publisher-ai | ---
+++
@@ -4,12 +4,9 @@
import os
import sys
+from setuptools import setup
+
import publisher
-
-try:
- from setuptools import setup
-except ImportError:
- from distutils.core import setup
version = publisher.__version__
@@ -34,10 +31,6 @@
'publisher',
],
include_package_data=True,... |
f6a713df2393d51cccbf99345f65165019608778 | setup.py | setup.py | from distutils.core import setup
setup(
name = "django-tweetar",
url = "http://github.com/adamfast/django-tweetar",
author = "Adam Fast",
author_email = "adamfast@gmail.com",
version = "0.1",
license = "BSD",
packages = ["djtweetar"],
install_requires = ['python-tweetar'],
descripti... | from distutils.core import setup
setup(
name = "django-tweetar",
url = "http://github.com/adamfast/django-tweetar",
author = "Adam Fast",
author_email = "adamfast@gmail.com",
version = "0.1",
license = "BSD",
packages = ["djtweetar", "djtweetar.runlogs"],
install_requires = ['python-twe... | Include the run logs app | Include the run logs app | Python | bsd-3-clause | adamfast/django-tweetar | ---
+++
@@ -7,7 +7,7 @@
author_email = "adamfast@gmail.com",
version = "0.1",
license = "BSD",
- packages = ["djtweetar"],
+ packages = ["djtweetar", "djtweetar.runlogs"],
install_requires = ['python-tweetar'],
description = "App for posting current conditions to twitter via python-twee... |
9ebb1ed46ac0c07603c0108e95a1e29194ed889b | setup.py | setup.py | from setuptools import setup, find_packages, Command
version = __import__('eemeter').get_version()
long_description = "Standard methods for calculating energy efficiency savings."
class PyTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass... | from setuptools import setup, find_packages, Command
version = __import__('eemeter').get_version()
long_description = "Standard methods for calculating energy efficiency savings."
class PyTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass... | Add term-missing to coverage call | Add term-missing to coverage call
| Python | apache-2.0 | openeemeter/eemeter,openeemeter/eemeter,impactlab/eemeter | ---
+++
@@ -15,7 +15,7 @@
def run(self):
import subprocess
import sys
- errno = subprocess.call([sys.executable, 'runtests.py', '--runslow', '--cov-report=', '--cov=eemeter', 'tests/'])
+ errno = subprocess.call([sys.executable, 'runtests.py', '--runslow', '--cov-report', 'term-mi... |
2b962c036b0d56ec27d186ea6dd9c837f260d953 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
settings = dict()
# Publish
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
settings.update(
name='whenpy'... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
settings = dict()
# Publish
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
settings.update(
name='whenpy'... | Fix Python versions for PKG-INFO | Fix Python versions for PKG-INFO
| Python | bsd-3-clause | dirn/When.py | ---
+++
@@ -34,8 +34,8 @@
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
- 'Programming Language :: Python :: Python 2.6',
- 'Programming Language :: Python :: Python 2.7',
+ 'Programming Language :: Python :: 2.6'... |
de3aa6eed0fca73f3949ee5c584bcc79e1b98109 | setup.py | setup.py | from setuptools import setup, find_packages
setup(name='mutube',
version='0.1',
description='Scrape YouTube links from 4chan threads.',
url='https://github.com/AP-e/mutube',
license='unlicense',
classifiers=['Development Status :: 2 - Pre-Alpha',
'Programming Language :... | from setuptools import setup, find_packages
setup(name='mutube',
version='0.1',
description='Scrape YouTube links from 4chan threads.',
url='https://github.com/AP-e/mutube',
license='unlicense',
classifiers=['Development Status :: 2 - Pre-Alpha',
'Programming Language :... | Remove Python 3 only classifier | Remove Python 3 only classifier
| Python | unlicense | AP-e/mutube | ---
+++
@@ -6,7 +6,7 @@
url='https://github.com/AP-e/mutube',
license='unlicense',
classifiers=['Development Status :: 2 - Pre-Alpha',
- 'Programming Language :: Python :: 3 :: Only'],
+ 'Programming Language :: Python'],
keywords='4chan youtube',
... |
e53a1c33dd3ce5258aff384257bd218f14c8870e | setup.py | setup.py | import os
import sys
import setuptools
from keystoneclient.openstack.common import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
requires = setup.parse_requirements()
depend_links = setup.parse_dependency_links()
tests_require = setup.parse_requirements(['tools/test-r... | import os
import sys
import setuptools
from keystoneclient.openstack.common import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
requires = setup.parse_requirements()
depend_links = setup.parse_dependency_links()
tests_require = setup.parse_requirements(['tools/test-r... | Add --version CLI opt and __version__ module attr | Add --version CLI opt and __version__ module attr
Change-Id: I8c39a797e79429dd21c5caf093b076a4b1757de0
| Python | apache-2.0 | citrix-openstack-build/keystoneauth,jamielennox/keystoneauth,sileht/keystoneauth | ---
+++
@@ -41,5 +41,6 @@
entry_points={
'console_scripts': ['keystone = keystoneclient.shell:main']
- }
+ },
+ data_files=[('keystoneclient', ['keystoneclient/versioninfo'])],
) |
95fa9acaaaffe3bf4cf8b32628f3425d83e383a1 | setup.py | setup.py | #!/usr/bin/python
from distutils.core import setup
from os.path import abspath, join, dirname
setup(
name='ccm',
version='0.9',
description='Cassandra Cluster Manager',
long_description=open(abspath(join(dirname(__file__), 'README'))).read(),
author='Sylvain Lebresne',
author_email='sylvain@da... | #!/usr/bin/python
from distutils.core import setup
from os.path import abspath, join, dirname
setup(
name='ccm',
version='1.0dev',
description='Cassandra Cluster Manager',
long_description=open(abspath(join(dirname(__file__), 'README'))).read(),
author='Sylvain Lebresne',
author_email='sylvain... | Update version after push to pypi | Update version after push to pypi
| Python | apache-2.0 | unusedPhD/ccm,tolbertam/ccm,mikefero/ccm,pombredanne/ccm,mikefero/ccm,thobbs/ccm,josh-mckenzie/ccm,jorgebay/ccm,oldsharp/ccm,pcmanus/ccm,aboudreault/ccm,kishkaru/ccm,tolbertam/ccm,slivne/ccm,bcantoni/ccm,spodkowinski/ccm,pcmanus/ccm,AtwooTM/ccm,mike-tr-adamson/ccm,pcmanus/ccm,mike-tr-adamson/ccm,jeffjirsa/ccm,umitunal/... | ---
+++
@@ -5,7 +5,7 @@
setup(
name='ccm',
- version='0.9',
+ version='1.0dev',
description='Cassandra Cluster Manager',
long_description=open(abspath(join(dirname(__file__), 'README'))).read(),
author='Sylvain Lebresne', |
ed88b56573eba2793b31478507f9f3def597dbc7 | setup.py | setup.py | #-*- coding: utf-8 -*-
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='zerows',
version='1.0.0',
description='W... | #-*- coding: utf-8 -*-
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='zerows',
version='1.0.0',
description='We... | Use README.md instead of README.rst | Use README.md instead of README.rst
| Python | mit | sebastianlach/zerows | ---
+++
@@ -5,7 +5,7 @@
here = path.abspath(path.dirname(__file__))
-with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
+with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup( |
c8229cc30d447561d4f757c07448080321973ca7 | setup.py | setup.py | from setuptools import setup
setup(
name='tangled.sqlalchemy',
version='0.1a3.dev0',
description='Tangled SQLAlchemy integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.sqlalchemy/tags',
author='W... | from setuptools import setup
setup(
name='tangled.sqlalchemy',
version='0.1a3.dev0',
description='Tangled SQLAlchemy integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.sqlalchemy/tags',
author='W... | Upgrade tangled from 0.1a5 to 0.1a7 | Upgrade tangled from 0.1a5 to 0.1a7
| Python | mit | TangledWeb/tangled.sqlalchemy | ---
+++
@@ -15,12 +15,12 @@
'tangled.sqlalchemy',
],
install_requires=[
- 'tangled>=0.1a5',
+ 'tangled>=0.1a7',
'SQLAlchemy',
],
extras_require={
'dev': [
- 'tangled[dev]>=0.1a5',
+ 'tangled[dev]>=0.1a7',
],
},
class... |
eeeb3cb68df913430ee8cf774e1b6a1b25407bbd | setup.py | setup.py | from setuptools import setup
import pycommand
setup(
name='pycommand',
version=pycommand.__version__,
description=pycommand.__doc__,
author=pycommand.__author__,
author_email='benjamin@babab.nl',
url='https://github.com/babab/pycommand',
download_url='http://pypi.python.org/pypi/pycommand/'... | from setuptools import setup
import pycommand
setup(
name='pycommand',
version=pycommand.__version__,
description=pycommand.__doc__,
author=pycommand.__author__,
author_email='benjamin@babab.nl',
url='https://github.com/babab/pycommand',
download_url='http://pypi.python.org/pypi/pycommand/'... | Install pycommand.3 manpage with pip | Install pycommand.3 manpage with pip
| Python | isc | babab/pycommand,babab/pycommand | ---
+++
@@ -18,7 +18,8 @@
data_files=[
('share/pycommand/examples', ['examples/basic-example',
'examples/full-example']),
- ('share/pycommand', ['LICENSE', 'README.rst'])
+ ('share/pycommand', ['LICENSE', 'README.rst']),
+ ('share/man/man3', ['... |
738f06c14a5a219a570720c93c74ac905de3fde1 | setup.py | setup.py | # -*- coding: utf-8 -*-
from distutils.core import setup
from setuptools import find_packages
import django_rq_dashboard
setup(
name='django-rq-dashboard',
version=django_rq_dashboard.__version__,
author='Bruno Renié',
author_email='bruno@renie.fr',
packages=find_packages(),
include_package_d... | # -*- coding: utf-8 -*-
from distutils.core import setup
from setuptools import find_packages
import django_rq_dashboard
setup(
name='django-rq-dashboard',
version=django_rq_dashboard.__version__,
author='Bruno Renié',
author_email='bruno@renie.fr',
packages=find_packages(),
include_package_d... | Add trove classifiers for Python 3 | Add trove classifiers for Python 3
| Python | bsd-3-clause | brutasse/django-rq-dashboard,brutasse/django-rq-dashboard,brutasse/django-rq-dashboard | ---
+++
@@ -31,6 +31,9 @@
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',... |
3a474e05a123240b92da03c668ac4720a6f4e8d4 | setup.py | setup.py | #!/usr/bin/env python3
from setuptools import setup
setup(
name='polygon-cli',
version='1.1.10',
packages=['polygon_cli', 'polygon_cli.actions'],
url='https://github.com/kunyavskiy/polygon-cli',
license='MIT',
author='Pavel Kunyavskiy',
author_email='kunyavskiy@g... | #!/usr/bin/env python3
from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='polygon-cli',
version='1.1.11',
packages=['polygon_cli', 'polygon_cli.actions'],
long_description=long_description,
long_description_content_type... | Add long_description for pypi, bump version to 1.1.11 | Add long_description for pypi, bump version to 1.1.11
| Python | mit | kunyavskiy/polygon-cli,kunyavskiy/polygon-cli | ---
+++
@@ -1,10 +1,15 @@
#!/usr/bin/env python3
from setuptools import setup
+with open("README.md", "r") as fh:
+ long_description = fh.read()
+
setup(
name='polygon-cli',
- version='1.1.10',
+ version='1.1.11',
packages=['polygon_cli', 'polygon_cli.actions'],
+ long_d... |
8c4af64413a34f9cd47053a4994f2e4773a4f6ac | setup.py | setup.py | from setuptools import setup
setup(
name='kubespawner',
version='0.1',
description='JupyterHub Spawner targetting Kubernetes',
url='http://github.com/yuvipanda/jupyterhub-kubernetes-spawner',
author='Yuvi Panda',
author_email='yuvipanda@riseup.net',
license='BSD',
packages=['kubespawner... | from setuptools import setup
setup(
name='kubespawner',
version='0.1',
install_requires=[
'requests-futures>=0.9.7',
'jupyterhub>=0.4.0',
],
description='JupyterHub Spawner targetting Kubernetes',
url='http://github.com/yuvipanda/jupyterhub-kubernetes-spawner',
author='Yuvi ... | Add explit dependencies to packaging | Add explit dependencies to packaging
| Python | bsd-3-clause | yuvipanda/jupyterhub-kubernetes-spawner,jbmarcille/kubespawner,ktong/kubespawner,jupyterhub/kubespawner | ---
+++
@@ -3,6 +3,10 @@
setup(
name='kubespawner',
version='0.1',
+ install_requires=[
+ 'requests-futures>=0.9.7',
+ 'jupyterhub>=0.4.0',
+ ],
description='JupyterHub Spawner targetting Kubernetes',
url='http://github.com/yuvipanda/jupyterhub-kubernetes-spawner',
author... |
df264c490f8600c5047db328c9388c1d07d4cbd5 | setup.py | setup.py | import distutils.core
# Uploading to PyPI
# =================
# $ python setup.py register -r pypi
# $ python setup.py sdist upload -r pypi
version = '0.0'
distutils.core.setup(
name='vecrec',
version=version,
author='Kale Kundert and Alex Mitchell',
packages=['vecrec'],
url='h... | import distutils.core
# Uploading to PyPI
# =================
# $ python setup.py register -r pypi
# $ python setup.py sdist upload -r pypi
version = '0.0'
distutils.core.setup(
name='vecrec',
version=version,
author='Kale Kundert and Alex Mitchell',
url='https://github.com/kxgames/vec... | Add finalexam and coverage as dependencies. | Add finalexam and coverage as dependencies.
| Python | mit | kxgames/vecrec,kxgames/vecrec | ---
+++
@@ -10,10 +10,12 @@
name='vecrec',
version=version,
author='Kale Kundert and Alex Mitchell',
- packages=['vecrec'],
url='https://github.com/kxgames/vecrec',
download_url='https://github.com/kxgames/vecrec/tarball/'+version,
license='LICENSE.txt',
... |
cb7226bbf5080e8a742f5262242a26e0a73ffd15 | setup.py | setup.py | from distutils.core import setup
setup(
name='hy-py',
version='0.0.1',
packages=['hy'],
license='MIT',
url='https://github.com/kalasjocke/hy',
long_description=open('README.md').read(),
)
| from distutils.core import setup
setup(
name='hy-py',
version='0.0.1',
packages=['hy'],
license='MIT',
author='Joakim Ekberg',
author_email='jocke.ekberg@gmail.com',
url='https://github.com/kalasjocke/hy',
long_description=open('README.md').read(),
)
| Add author to PyPI package | Add author to PyPI package
| Python | mit | kalasjocke/hyp | ---
+++
@@ -5,6 +5,8 @@
version='0.0.1',
packages=['hy'],
license='MIT',
+ author='Joakim Ekberg',
+ author_email='jocke.ekberg@gmail.com',
url='https://github.com/kalasjocke/hy',
long_description=open('README.md').read(),
) |
98fe5bbe14ef47006ca45b82b681abc5b54be5cd | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='django-flatblocks',
version='0.9',
description='django-flatblocks acts like django.contrib.flatpages but '
'for parts of a page; like an editable help box you want '
'show alongside the main content.',
long_descri... | from setuptools import setup, find_packages
setup(
name='django-flatblocks',
version='0.9',
description='django-flatblocks acts like django.contrib.flatpages but '
'for parts of a page; like an editable help box you want '
'show alongside the main content.',
long_descri... | Remove kws: does not exist | Remove kws: does not exist
| Python | bsd-3-clause | funkybob/django-flatblocks,funkybob/django-flatblocks | ---
+++
@@ -43,5 +43,4 @@
requires = [
'Django (>=1.4)',
],
- **kws
) |
7cf346794075bab025926549ee4ebe35bf188038 | Timetable.py | Timetable.py | import json
import urllib.request
import ast
# get the bus lines from the website and parse it to a list
def get_list():
url = 'http://widgets.vvo-online.de/abfahrtsmonitor/Abfahrten.do?ort=Dresden&hst=CasparDavidFriedrichStra%C3%9Fe'
response = urllib.request.urlopen(url)
data_raw = response.read()
da... | # -*- coding: utf-8 -*-
import json
from urllib2 import Request as request
import urllib2
import ast
# get the bus lines from the website and parse it to a list
def get_list(start):
# url = 'http://widgets.vvo-online.de/abfahrtsmonitor/Abfahrten.do?ort=Dresden&hst=CasparDavidFriedrichStra%C3%9Fe'
url = 'http://... | Change Python3 to Python and so use urllib2 | Change Python3 to Python and so use urllib2
| Python | apache-2.0 | NWuensche/TimetableBus | ---
+++
@@ -1,11 +1,15 @@
+# -*- coding: utf-8 -*-
import json
-import urllib.request
+from urllib2 import Request as request
+import urllib2
import ast
# get the bus lines from the website and parse it to a list
-def get_list():
- url = 'http://widgets.vvo-online.de/abfahrtsmonitor/Abfahrten.do?ort=Dresden&h... |
7ebfbbc8aaf7642d0f1c99862974452289762357 | __init__.py | __init__.py | from .backends import *
from .shapes import *
from .grids import *
from .colors import *
from .solarized import *
| from .backends import *
from .colors import *
from .grids import *
from .reference_image import *
from .shapes import *
from .solarized import *
| Include reference_image, and alphabetize imports | Include reference_image, and alphabetize imports
| Python | mit | zacbir/geometer | ---
+++
@@ -1,6 +1,7 @@
from .backends import *
+from .colors import *
+from .grids import *
+from .reference_image import *
from .shapes import *
-from .grids import *
-from .colors import *
from .solarized import *
|
f0cf9d295aabeaa5ee69e47831e50f52f94a1df5 | tests/api/conftest.py | tests/api/conftest.py | import pytest
from werkzeug.datastructures import Headers
from flask import Response, json
from flask.testing import FlaskClient
import config
from skylines import create_api_app
@pytest.fixture(scope="session")
def app():
"""Set up global front-end app for functional tests
Initialized once per test-run
... | import pytest
from werkzeug.datastructures import Headers
from flask import Response, json
from flask.testing import FlaskClient
import config
from skylines import create_api_app
@pytest.fixture(scope="session")
def app():
"""Set up global front-end app for functional tests
Initialized once per test-run
... | Add support for passing json keyword arguments to request methods | tests/api: Add support for passing json keyword arguments to request methods
| Python | agpl-3.0 | Harry-R/skylines,RBE-Avionik/skylines,Turbo87/skylines,Turbo87/skylines,skylines-project/skylines,shadowoneau/skylines,shadowoneau/skylines,Turbo87/skylines,Harry-R/skylines,Harry-R/skylines,Turbo87/skylines,RBE-Avionik/skylines,RBE-Avionik/skylines,Harry-R/skylines,shadowoneau/skylines,RBE-Avionik/skylines,skylines-pr... | ---
+++
@@ -26,6 +26,11 @@
headers.setdefault('User-Agent', 'py.test')
kwargs['headers'] = headers
+ json_data = kwargs.pop('json', None)
+ if json_data is not None:
+ kwargs['data'] = json.dumps(json_data)
+ kwargs['content_type'] = 'application/json'
+
... |
5a0e8efac25ded873a881465f8057fbfffff2555 | setup.py | setup.py | # coding=utf-8
# Copyright 2021 The Balloon Learning Environment Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | # coding=utf-8
# Copyright 2021 The Balloon Learning Environment Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | Set minimum version requirement for tensorflow-datasets | Set minimum version requirement for tensorflow-datasets
PiperOrigin-RevId: 414736430
| Python | apache-2.0 | google/balloon-learning-environment | ---
+++
@@ -18,7 +18,7 @@
setuptools.setup(
name='balloon_learning_environment',
- version='0.0.2',
+ version='0.0.3',
packages=setuptools.find_packages(),
install_requires=[
'absl-py',
@@ -31,7 +31,7 @@
's2sphere',
'scikit-learn',
'tensorflow',
- 'te... |
8442e89d005af039252b0f8ab757bb54fa4ed71c | tests.py | tests.py | import unittest
from pollster.pollster import Pollster, Chart
class TestBasic(unittest.TestCase):
def test_basic_setup(self):
p = Pollster()
self.assertIsNotNone(p)
def test_charts(self):
c = Pollster().charts()
self.assertIsNotNone(c)
self.assertIsInstance(c, list)
... | import unittest
from pollster.pollster import Pollster, Chart
class TestBasic(unittest.TestCase):
def test_basic_setup(self):
p = Pollster()
self.assertIsNotNone(p)
def test_charts(self):
c = Pollster().charts()
self.assertIsNotNone(c)
self.assertIsInstance(c, list)
... | Update Poll test to check members. | Update Poll test to check members.
| Python | bsd-2-clause | huffpostdata/python-pollster,ternus/python-pollster | ---
+++
@@ -34,3 +34,16 @@
def test_polls(self):
polls = Pollster().polls(topic='2016-president')
self.assertGreater(len(polls), 0)
+ poll = polls[0]
+ for attr in ['id',
+ 'pollster',
+ 'start_date',
+ 'e... |
162406757890e78ba50dc777be9f9501ce3c3414 | tests.py | tests.py | import unittest
from app import app
class TestScorepy(unittest.TestCase):
def setUp(self):
self.app = app.test_client()
self.app.testing = True
def tearDown(self):
pass
def test_index_response(self):
response = self.app.get('/')
self.assertEqual(response.status_cod... | import unittest
from app import create_app
class TestScorepy(unittest.TestCase):
def setUp(self):
app = create_app('config.TestingConfiguration')
self.app = app.test_client()
def tearDown(self):
pass
def test_index_response(self):
response = self.app.get('/')
self.... | Fix test file for factory pattern | Fix test file for factory pattern
| Python | mit | rtfoley/scorepy,rtfoley/scorepy,rtfoley/scorepy | ---
+++
@@ -1,10 +1,10 @@
import unittest
-from app import app
+from app import create_app
class TestScorepy(unittest.TestCase):
def setUp(self):
+ app = create_app('config.TestingConfiguration')
self.app = app.test_client()
- self.app.testing = True
def tearDown(self):
... |
548bdb45796e7e12a1c4294b49dc1ac1fb3fe647 | launch_pyslvs.py | launch_pyslvs.py | # -*- coding: utf-8 -*-
##Pyslvs - Dimensional Synthesis of Planar Four-bar Linkages in PyQt5 GUI.
##Copyright (C) 2016 Yuan Chang [daan0014119@gmail.com]
from os import _exit
if __name__=='__main__':
try:
from core.info.info import show_info, Pyslvs_Splash
args = show_info()
from PyQt5.QtWi... | # -*- coding: utf-8 -*-
##Pyslvs - Dimensional Synthesis of Planar Four-bar Linkages in PyQt5 GUI.
##Copyright (C) 2016 Yuan Chang [daan0014119@gmail.com]
from sys import exit
if __name__=='__main__':
try:
from core.info.info import show_info, Pyslvs_Splash
args = show_info()
from PyQt5.QtWi... | Change the way of exit application. | Change the way of exit application.
| Python | agpl-3.0 | 40323230/Pyslvs-PyQt5,KmolYuan/Pyslvs-PyQt5,KmolYuan/Pyslvs-PyQt5 | ---
+++
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
##Pyslvs - Dimensional Synthesis of Planar Four-bar Linkages in PyQt5 GUI.
##Copyright (C) 2016 Yuan Chang [daan0014119@gmail.com]
-from os import _exit
+from sys import exit
if __name__=='__main__':
try:
from core.info.info import show_info, Pyslvs_Sp... |
2f46d5468b7eaabfb23081669e6c1c2760a1bc16 | tests.py | tests.py | from __future__ import unicode_literals
from tqdm import format_interval
def test_format_interval():
assert format_interval(60) == '01:00'
assert format_interval(6160) == '1:42:40'
assert format_interval(238113) == '66:08:33'
| from __future__ import unicode_literals
from tqdm import format_interval, format_meter
def test_format_interval():
assert format_interval(60) == '01:00'
assert format_interval(6160) == '1:42:40'
assert format_interval(238113) == '66:08:33'
def test_format_meter():
assert format_meter(231, 1000, 392)... | Test of format_meter (failed on py32) | Test of format_meter (failed on py32)
| Python | mit | lrq3000/tqdm,kmike/tqdm | ---
+++
@@ -1,5 +1,5 @@
from __future__ import unicode_literals
-from tqdm import format_interval
+from tqdm import format_interval, format_meter
def test_format_interval():
@@ -7,3 +7,9 @@
assert format_interval(6160) == '1:42:40'
assert format_interval(238113) == '66:08:33'
+
+def test_format_mete... |
0f10d6f5ac06fcec3ef7df0688edcf3f6466301a | setup.py | setup.py | from distutils.core import setup
import sys
import os
import re
PACKAGENAME = 'OpSimSummary'
packageDir = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'opsimsummary')
versionFile = os.path.join(packageDir, 'version.py')
# Obtain the package version
with open(versionFile, 'r') as... | from distutils.core import setup
import sys
import os
import re
PACKAGENAME = 'OpSimSummary'
packageDir = os.path.join(os.path.dirname(os.path.abspath(__file__)),
PACKAGENAME)
versionFile = os.path.join(packageDir, 'version.py')
# Obtain the package version
with open(versionFile, 'r') as f:... | Revert "Revert "Changed back due to problems, will fix later"" | Revert "Revert "Changed back due to problems, will fix later""
This reverts commit 37fa1b22539dd31b8efc4c22b1ba9269822f77e1.
modified: setup.py
| Python | mit | rbiswas4/simlib | ---
+++
@@ -5,7 +5,7 @@
PACKAGENAME = 'OpSimSummary'
packageDir = os.path.join(os.path.dirname(os.path.abspath(__file__)),
- 'opsimsummary')
+ PACKAGENAME)
versionFile = os.path.join(packageDir, 'version.py')
# Obtain the package version |
201a469ac08d9b366e425d5068ebe6dce1fc148b | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
requirements = [
'pyzmq',
'docopt',
'virtualenv',
'requests',
'Pillow',
]
setup(
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
requirements = [
'pyzmq',
'docopt',
'virtualenv',
'requests',
'Pillow',
]
setup(
... | Change package name to tingbot-python for submission to PyPI | Change package name to tingbot-python for submission to PyPI
| Python | bsd-2-clause | furbrain/tingbot-python | ---
+++
@@ -18,7 +18,7 @@
]
setup(
- name='tingbot',
+ name='tingbot-python',
version='0.3.0',
description="Python APIs to write apps for Tingbot",
long_description=readme, |
f9393f8ae2a0552e2d23862d42ca3ddd2a6267fd | Afterscripts/H264.720p/h264-720p.py | Afterscripts/H264.720p/h264-720p.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import hyperspeed.afterscript
title = 'H264.720p'
cmd = '-vsync 0 -movflags faststart -crf 20 -minrate 0 -maxrate 4M -bufsize 15M -filter_complex "scale=1280:720,setsar=1" -pix_fmt yuv420p -vcodec libx264 -c:a aac -b:a 160k -strict -2 -ac 2 -ar 44100 ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import hyperspeed.afterscript
title = 'H264.720p'
cmd = '-vsync 0 -movflags faststart -crf 20 -minrate 0 -maxrate 4M -bufsize 15M -filter_complex "scale=1280:720:out_color_matrix=bt709,setsar=1" -pix_fmt yuv420p -vcodec libx264 -c:a aac -b:a 160k -stri... | Use 709 matrix when converting rgb to yuv | Use 709 matrix when converting rgb to yuv
| Python | apache-2.0 | bovesan/mistika-hyperspeed,bovesan/mistika-hyperspeed | ---
+++
@@ -4,7 +4,7 @@
import hyperspeed.afterscript
title = 'H264.720p'
-cmd = '-vsync 0 -movflags faststart -crf 20 -minrate 0 -maxrate 4M -bufsize 15M -filter_complex "scale=1280:720,setsar=1" -pix_fmt yuv420p -vcodec libx264 -c:a aac -b:a 160k -strict -2 -ac 2 -ar 44100 -acodec aac -af p... |
6bb517b467feb30b6af6d5b698209d356a2a4616 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='Lektor',
version='2.0.dev0',
url='http://github.com/lektor/lektor/',
description='A static content management system.',
license='BSD',
author='Armin Ronacher',
author_email='armin.ronacher@active-4.com',
packages=find_packages(),... | from setuptools import setup, find_packages
setup(
name='Lektor',
version='2.0.dev0',
url='http://github.com/lektor/lektor/',
description='A static content management system.',
license='BSD',
author='Armin Ronacher',
author_email='armin.ronacher@active-4.com',
packages=find_packages(),... | Remove beta label for 2.0 | Remove beta label for 2.0
| Python | bsd-3-clause | bameda/lektor,bameda/lektor,lektor/lektor,bameda/lektor,lektor/lektor,lektor/lektor,bameda/lektor,lektor/lektor | ---
+++
@@ -27,7 +27,6 @@
'requests[security]',
],
classifiers=[
- 'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License', |
9b154aaa839bab65244dbba83244473f2932cadb | tests/test_parsing.py | tests/test_parsing.py | #!/usr/bin/env python
#encoding:utf-8
#author:dbr/Ben
#project:tvnamer
#repository:http://github.com/dbr/tvnamer
#license:Creative Commons GNU GPL v2
# http://creativecommons.org/licenses/GPL/2.0/
"""Test tvnamer's filename parser
"""
import os
import sys
import unittest
sys.path.append(os.path.join(os.path.abspath(... | #!/usr/bin/env python
#encoding:utf-8
#author:dbr/Ben
#project:tvnamer
#repository:http://github.com/dbr/tvnamer
#license:Creative Commons GNU GPL v2
# http://creativecommons.org/licenses/GPL/2.0/
"""Test tvnamer's filename parser
"""
import os
import sys
from copy import copy
import unittest
sys.path.append(os.path... | Use nose's test generator function | Use nose's test generator function | Python | unlicense | m42e/tvnamer,dbr/tvnamer,lahwaacz/tvnamer | ---
+++
@@ -11,25 +11,32 @@
import os
import sys
+from copy import copy
import unittest
sys.path.append(os.path.join(os.path.abspath(sys.path[0]), ".."))
-from utils import FileParser, warn
-from tvnamer_exceptions import InvalidFilename
+from utils import FileParser
from test_files import files
-class t... |
a23fbfb83e72b4a7ccc69a55c262f02c5b0cd592 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='zeit.content.gallery',
version='2.4.2dev',
author='gocept',
author_email='mail@gocept.com',
url='https://svn.gocept.com/repos/gocept-int/zeit.cms',
description="ZEIT portraitbox",
packages=find_packages('src'),
package_dir = {'': ... | from setuptools import setup, find_packages
setup(
name='zeit.content.gallery',
version='2.4.2dev',
author='gocept',
author_email='mail@gocept.com',
url='https://svn.gocept.com/repos/gocept-int/zeit.cms',
description="ZEIT portraitbox",
packages=find_packages('src'),
package_dir = {'': ... | Use Pillow instead of PILwoTK | Use Pillow instead of PILwoTK
| Python | bsd-3-clause | ZeitOnline/zeit.content.gallery,ZeitOnline/zeit.content.gallery | ---
+++
@@ -14,7 +14,7 @@
license='gocept proprietary',
namespace_packages = ['zeit', 'zeit.content'],
install_requires=[
- 'PILwoTk',
+ 'Pillow',
'gocept.form',
'setuptools',
'zeit.cms>=1.46dev', |
616c0b0722d7b81cad1b4f8d2cfaec24dcfcbf71 | setup.py | setup.py | """setup.py"""
from codecs import open as codecs_open
from setuptools import setup
with codecs_open('README.md', 'r', 'utf-8') as f:
README = f.read()
with codecs_open('HISTORY.md', 'r', 'utf-8') as f:
HISTORY = f.read()
setup(
name='jsonrpcserver',
version='3.5.3',
description='Process JSON-RPC ... | """setup.py"""
from codecs import open as codecs_open
from setuptools import setup
with codecs_open('README.md', 'r', 'utf-8') as f:
README = f.read()
with codecs_open('HISTORY.md', 'r', 'utf-8') as f:
HISTORY = f.read()
setup(
author='Beau Barker',
author_email='beauinmelbourne@gmail.com',
classi... | Set readme content type to markdown | Set readme content type to markdown
| Python | mit | bcb/jsonrpcserver | ---
+++
@@ -4,23 +4,20 @@
with codecs_open('README.md', 'r', 'utf-8') as f:
README = f.read()
-
with codecs_open('HISTORY.md', 'r', 'utf-8') as f:
HISTORY = f.read()
setup(
- name='jsonrpcserver',
- version='3.5.3',
- description='Process JSON-RPC requests',
- long_description=README + '\... |
717a5c61cfe58a2c9bb32fdfbf7698c4236b9529 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='django-edtf',
version='2.0.0',
description='A Django app for the validation of dates in the Extended Date Time Format.',
long_description=('Please visit https://github.com/unt-libraries/django-edtf'
' for the latest document... | from setuptools import setup, find_packages
setup(
name='django-edtf',
version='2.0.0',
description='A Django app for the validation of dates in the Extended Date Time Format.',
long_description=('Please visit https://github.com/unt-libraries/django-edtf'
' for the latest document... | Use the master tag to install latest version of edtf | Use the master tag to install latest version of edtf
| Python | bsd-3-clause | unt-libraries/django-edtf,unt-libraries/django-edtf,unt-libraries/django-edtf | ---
+++
@@ -6,8 +6,7 @@
description='A Django app for the validation of dates in the Extended Date Time Format.',
long_description=('Please visit https://github.com/unt-libraries/django-edtf'
' for the latest documentation.'),
- install_requires=[
- 'edtf-validate >= 1.1.0']... |
3aeab31830469bea9d470fc13d1906b7a755d6d3 | tests/pytasa_tests.py | tests/pytasa_tests.py | from nose.tools import *
import pytasa
def test_basic():
print "nothing to test"
| from __future__ import print_function
from nose.tools import *
import pytasa
def test_basic():
print("nothing to test")
| Print needs to be python 3 and python 2 compatible | Print needs to be python 3 and python 2 compatible
| Python | mit | alanfbaird/PyTASA | ---
+++
@@ -1,5 +1,6 @@
+from __future__ import print_function
from nose.tools import *
import pytasa
def test_basic():
- print "nothing to test"
+ print("nothing to test") |
1772eb9da2169d88c7ecad9ca21c89d4d6472e94 | tests/test_cycling.py | tests/test_cycling.py | import os
from unittest import TestCase
from tcxparser import TCXParser
class TestParseCyclingTCX(TestCase):
def setUp(self):
tcx_file = "test2.tcx"
path = os.path.join(os.path.dirname(__file__), "files", tcx_file)
self.tcx = TCXParser(path)
def test_cadence_max_is_correct(self):
... | import os
from unittest import TestCase
from tcxparser import TCXParser
class TestParseCyclingTCX(TestCase):
def setUp(self):
"""
TCX file test2.tcx was taken from the following dataset:
S. Rauter, I. Jr. Fister, I. Fister. A collection of sport activity files
for data analysis an... | Add a source of test file | Add a source of test file
| Python | bsd-2-clause | vkurup/python-tcxparser,vkurup/python-tcxparser | ---
+++
@@ -6,6 +6,12 @@
class TestParseCyclingTCX(TestCase):
def setUp(self):
+ """
+ TCX file test2.tcx was taken from the following dataset:
+ S. Rauter, I. Jr. Fister, I. Fister. A collection of sport activity files
+ for data analysis and data mining.
+ Technical report... |
b1b0919f47f43d27bc409528617af8dbd4eea41c | tests/test_imports.py | tests/test_imports.py | import unittest
class TestImport(unittest.TestCase):
# Basic import tests for packages without any.
def test_basic(self):
import bq_helper
import cleverhans
from rl.agents.dqn import DQNAgent
| import unittest
class TestImport(unittest.TestCase):
# Basic import tests for packages without any.
def test_basic(self):
import bq_helper
import cleverhans
| Remove import test for keras-rl | Remove import test for keras-rl
This package was removed in #747 | Python | apache-2.0 | Kaggle/docker-python,Kaggle/docker-python | ---
+++
@@ -5,4 +5,3 @@
def test_basic(self):
import bq_helper
import cleverhans
- from rl.agents.dqn import DQNAgent |
9bb432844653bdab227806373d13d5a727b60b6c | simulator/simulator_cupid_shuffle.py | simulator/simulator_cupid_shuffle.py | def cupid():
steptime = .4
kick_angle = -10
for i in range(4):
forward(1, steptime)
wait(steptime)
for i in range(4):
backward(1, steptime)
wait(steptime)
for i in range(2):
turnBy(kick_angle)
wait(.2)
turnBy(-kick_angle)
wait(.2)
... | def cupid():
steptime = .4
kick_angle = -10
for i in range(4):
forward(1, steptime)
wait(steptime)
for i in range(4):
backward(1, steptime)
wait(steptime)
for i in range(2):
turnBy(kick_angle)
wait(.2)
turnBy(-kick_angle)
wait(.2)
... | Update link to raw shuffle2.wav file | Update link to raw shuffle2.wav file | Python | mit | CSavvy/python | ---
+++
@@ -21,7 +21,7 @@
init("sim")
penDown()
-# NOTE: be sure to download the wav file at https://github.com/CSavvy/python/blob/master/shuffle2.wav
+# NOTE: be sure to download the wav file at https://github.com/CSavvy/python/blob/master/shuffle2.wav?raw=true
s = makeSound("shuffle2.wav")
for j in range(2): ... |
dd4f4beb23c1a51c913cf2a2533c72df9fdca5fe | en-2017-06-25-consuming-and-publishing-celery-tasks-in-cpp-via-amqp/python/hello.py | en-2017-06-25-consuming-and-publishing-celery-tasks-in-cpp-via-amqp/python/hello.py | #
# Sends a request to call hello() from within a worker.
#
import sys
from tasks import hello
if __name__ == '__main__':
if len(sys.argv) != 3:
print('usage: {} NAME AGE'.format(sys.argv[0]))
sys.exit(1)
# By calling hello.delay(), we request hello() to be executed in a worker
# rather ... | #
# Sends a request to call hello() from within a worker.
#
import sys
from tasks import hello
if __name__ == '__main__':
if len(sys.argv) != 3:
print('usage: {} NAME AGE'.format(sys.argv[0]))
sys.exit(1)
# By calling hello.delay(), we request hello() to be executed in a worker
# rather ... | Fix the phrasing in a comment. | en-2017-06-25: Fix the phrasing in a comment.
| Python | bsd-3-clause | s3rvac/blog,s3rvac/blog,s3rvac/blog,s3rvac/blog | ---
+++
@@ -12,7 +12,7 @@
sys.exit(1)
# By calling hello.delay(), we request hello() to be executed in a worker
- # rather than executing it directly in the current process, which is what a
- # direct call to hello() would do.
+ # rather than executed directly in the current process, which is... |
e275ed385cfb9d8420fe500279271dc3c8e24540 | django_orm/__init__.py | django_orm/__init__.py | # -*- coding: utf-8 -*-
__version__ = (2, 0, 0, 'candidate', 8)
POOLTYPE_PERSISTENT = 1
POOLTYPE_QUEUE = 2
__all__ = ['POOLTYPE_PERSISTENT', 'POOLTYPE_QUEUE']
| # -*- coding: utf-8 -*-
__version__ = (2, 0, 0, 'candidate', 9)
POOLTYPE_PERSISTENT = 1
POOLTYPE_QUEUE = 2
__all__ = ['POOLTYPE_PERSISTENT', 'POOLTYPE_QUEUE']
| Increment version to candidate 9 | Increment version to candidate 9
| Python | bsd-3-clause | EnTeQuAk/django-orm,EnTeQuAk/django-orm | ---
+++
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-__version__ = (2, 0, 0, 'candidate', 8)
+__version__ = (2, 0, 0, 'candidate', 9)
POOLTYPE_PERSISTENT = 1
POOLTYPE_QUEUE = 2 |
7fbfcf75fed6713dd9a3541f74a7585db65f3dd6 | exercise-screens.py | exercise-screens.py | #!/usr/bin/env python
import multiprocessing
import sys
import requests
import webkit2png
def render_exercise(exercise_url):
print "Rendering %s" % exercise_url
return True
def main():
print "Fetching exercise data..."
request = requests.get("http://khanacademy.org/api/v1/exercises")
if reques... | #!/usr/bin/env python
import os
import sys
import subprocess
import tempfile
import threading
from multiprocessing.pool import ThreadPool
import requests
import webkit2png
DELAY = 5
STDOUT_LOCK = threading.Lock()
def process_exercise(exercise):
(name, url) = exercise
with STDOUT_LOCK:
print "Rende... | Implement a thread pool for shelling out to webkit2png in parallel | Implement a thread pool for shelling out to webkit2png in parallel
Test Plan: Run ./exercise_screens.py, see no failures
| Python | mit | Khan/exercise-screens | ---
+++
@@ -1,14 +1,45 @@
#!/usr/bin/env python
-import multiprocessing
+import os
import sys
+import subprocess
+import tempfile
+import threading
+from multiprocessing.pool import ThreadPool
import requests
import webkit2png
-def render_exercise(exercise_url):
- print "Rendering %s" % exercise_url
+D... |
67ab2070206fc1313e1f83948b6c29565c189861 | test/features/test_create_pages.py | test/features/test_create_pages.py | import time
import unittest
from hamcrest import *
from splinter import Browser
from support.stub_server import HttpStub
class test_create_pages(unittest.TestCase):
def setUp(self):
HttpStub.start()
time.sleep(2)
def tearDown(self):
HttpStub.stop()
def test_about_page(self):
... | import time
import unittest
from hamcrest import *
from splinter import Browser
from support.stub_server import HttpStub
class test_create_pages(unittest.TestCase):
def setUp(self):
HttpStub.start()
time.sleep(2)
def tearDown(self):
HttpStub.stop()
def test_about_page(self):
... | Use phantomjs instead of a real browser | Use phantomjs instead of a real browser
| Python | mit | alphagov/transactions-explorer,gds-attic/transactions-explorer,gds-attic/transactions-explorer,alphagov/transactions-explorer,gds-attic/transactions-explorer,gds-attic/transactions-explorer,alphagov/transactions-explorer,gds-attic/transactions-explorer,alphagov/transactions-explorer,alphagov/transactions-explorer | ---
+++
@@ -17,7 +17,7 @@
HttpStub.stop()
def test_about_page(self):
- with Browser() as browser:
+ with Browser('phantomjs', wait_time=3) as browser:
browser.visit("http://0.0.0.0:8000/high-volume-services/by-transactions-per-year/descending.html")
assert_that(... |
98ec9c2e1ea7510ac6b7b967d4c8865daf006bb3 | plugins/reversedns.py | plugins/reversedns.py | import logging, interfaces, os
from StringIO import StringIO
class Shorewall(interfaces.IOpenMesherPlugin):
def __init__(self):
self._files = {}
def process(self, mesh):
logging.debug('Generating DNS config...')
self._files = {}
rdns = StringIO()
for router... | import logging, interfaces, os, IPy
from StringIO import StringIO
class Shorewall(interfaces.IOpenMesherPlugin):
def __init__(self):
self._files = {}
def process(self, mesh):
logging.debug('Generating DNS config...')
self._files = {}
rdns = StringIO()
for r... | Return DNS data in the correct format | Return DNS data in the correct format
| Python | bsd-3-clause | heyaaron/openmesher,darkpixel/openmesher,heyaaron/openmesher,darkpixel/openmesher | ---
+++
@@ -1,4 +1,4 @@
-import logging, interfaces, os
+import logging, interfaces, os, IPy
from StringIO import StringIO
class Shorewall(interfaces.IOpenMesherPlugin):
@@ -20,7 +20,7 @@
#BUG: Need to put iface name in rev dns
rdns.write('%s\t\tPTR\t%s.\n' %(ip1.reverseN... |
ae89d5de1a9d248951bed0b992500121860c47d4 | tvsort_sl/messages.py | tvsort_sl/messages.py | import os
from sendgrid import sendgrid, Email
from sendgrid.helpers.mail import Content, Mail, MailSettings, SandBoxMode
def send_email(subject, content):
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
from_email = Email(name='TV sort', email='tvsortsl@gmail.com')
to_email = ... | import os
from sendgrid import sendgrid, Email
from sendgrid.helpers.mail import Content, Mail, MailSettings, SandBoxMode
def send_email(subject, content):
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
from_email = Email(name='TV sort', email='tvsortsl@gmail.com')
to_email = ... | Add debug prints to send_email | Add debug prints to send_email
| Python | mit | shlomiLan/tvsort_sl | ---
+++
@@ -11,6 +11,10 @@
content = Content("text/plain", content)
mail = Mail(from_email, subject, to_email, content)
sand_box = os.environ.get('SAND_BOX')
+
+ print(os.environ.get('SENDGRID_API_KEY'))
+ print(os.environ.get('SAND_BOX'))
+
if sand_box == 'true':
mail_settings = Ma... |
a0211fa99dfb0647bf78ce672ebb3a778f6fb6b7 | flaskext/lesscss.py | flaskext/lesscss.py | # -*- coding: utf-8 -*-
"""
flaskext.lesscss
~~~~~~~~~~~~~
A small Flask extension that makes it easy to use LessCSS with your Flask
application.
:copyright: (c) 2010 by Steve Losh.
:license: MIT, see LICENSE for more details.
"""
import os, subprocess
def lesscss(app):
@app.before_reque... | # -*- coding: utf-8 -*-
"""
flaskext.lesscss
~~~~~~~~~~~~~
A small Flask extension that makes it easy to use LessCSS with your Flask
application.
:copyright: (c) 2010 by Steve Losh.
:license: MIT, see LICENSE for more details.
"""
import os, subprocess
def lesscss(app):
@app.before_reque... | Fix errors when the css files do not exist. | Fix errors when the css files do not exist.
| Python | mit | bpollack/flask-lesscss,fitoria/flask-lesscss,b4oshany/flask-lesscss,fitoria/flask-lesscss,sjl/flask-lesscss | ---
+++
@@ -26,7 +26,11 @@
for less_path in less_paths:
css_path = os.path.splitext(less_path)[0] + '.css'
- css_mtime, less_mtime = os.path.getmtime(css_path), os.path.getmtime(less_path)
+ if not os.path.isfile(css_path):
+ css_mtime = -1
+ ... |
26e0a0ce2cb8b907ca7ea7ad098c644c2213fa1b | usb/tests/test_api.py | usb/tests/test_api.py | import json
from unittest import TestCase
from usb import create_application
from usb.models import db
class APITestCase(TestCase):
def setUp(self):
self.app = create_application('config/test.py')
self.client = self.app.test_client()
db.app = self.app
db.create_all()
def te... | import json
from unittest import TestCase
from usb import create_application
from usb.models import db
class APITestCase(TestCase):
def setUp(self):
self.app = create_application('config/test.py')
self.client = self.app.test_client()
db.app = self.app
db.create_all()
def te... | Test content type for JSON API | Test content type for JSON API
| Python | mit | dizpers/usb | ---
+++
@@ -36,5 +36,6 @@
def test_get_list_of_short_links_empty_db(self):
response = self.client.get('/links')
self.assertEqual(response.status_code, 200)
+ self.assertEqual(response.headers['Content-Type'], 'application/json')
data = json.loads(response.data)
self.ass... |
49724932966fc509b202a80b6dcb9b309f0135a7 | flexget/__init__.py | flexget/__init__.py | #!/usr/bin/python
from __future__ import unicode_literals, division, absolute_import
import logging
import os
from flexget import logger, plugin
from flexget.manager import Manager
from flexget.options import get_parser
__version__ = '{git}'
log = logging.getLogger('main')
def main(args=None):
"""Main entry ... | #!/usr/bin/python
from __future__ import unicode_literals, division, absolute_import
__version__ = '{git}'
import logging
import os
from flexget import logger, plugin
from flexget.manager import Manager
from flexget.options import get_parser
log = logging.getLogger('main')
def main(args=None):
"""Main entry p... | Move __version__ declaration before imports | Move __version__ declaration before imports
| Python | mit | lildadou/Flexget,oxc/Flexget,JorisDeRieck/Flexget,tsnoam/Flexget,malkavi/Flexget,oxc/Flexget,crawln45/Flexget,tsnoam/Flexget,grrr2/Flexget,sean797/Flexget,dsemi/Flexget,drwyrm/Flexget,jawilson/Flexget,malkavi/Flexget,malkavi/Flexget,v17al/Flexget,jawilson/Flexget,drwyrm/Flexget,patsissons/Flexget,antivirtel/Flexget,tar... | ---
+++
@@ -1,6 +1,7 @@
#!/usr/bin/python
+from __future__ import unicode_literals, division, absolute_import
-from __future__ import unicode_literals, division, absolute_import
+__version__ = '{git}'
import logging
import os
@@ -8,8 +9,6 @@
from flexget import logger, plugin
from flexget.manager import Mana... |
0aa97f39cdc91820385cdda4741802d09c30aa37 | src/lib/pipeline_tools.py | src/lib/pipeline_tools.py | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Fix a debug line in a test lib | Fix a debug line in a test lib
| Python | apache-2.0 | GoogleCloudPlatform/covid-19-open-data,GoogleCloudPlatform/covid-19-open-data | ---
+++
@@ -20,7 +20,7 @@
def get_pipeline_names() -> Iterator[str]:
""" Iterator with all the names of available data pipelines """
for item in (SRC / "pipelines").iterdir():
- if not item.name.startswith("_") and not item.is_file() and item.name == "epidemiology":
+ if not item.name.startsw... |
4364ffc7efd69a0d85dab6cb2c0efd1d2f4bf612 | get_sonos_ip.py | get_sonos_ip.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: Benjamin Preisig
import soco
import re
zone_list = list(soco.discover())
for zone in zone_list:
print u"Player: {0} at IP: {1}".format(zone.player_name, zone) | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: Benjamin Preisig
import soco
import re
import codecs
zone_list = list(soco.discover())
with codecs.open('discovered.csv', "w", "utf-8-sig") as the_file:
for zone in zone_list:
print u"Player: {0} at IP: {1}".format(zone.player_name, zone)
... | Write Zone Information to File | Write Zone Information to File
| Python | mit | prebm/SonosRemote,prebm/SonosRemote | ---
+++
@@ -5,8 +5,12 @@
import soco
import re
+import codecs
zone_list = list(soco.discover())
-for zone in zone_list:
- print u"Player: {0} at IP: {1}".format(zone.player_name, zone)
+
+with codecs.open('discovered.csv', "w", "utf-8-sig") as the_file:
+ for zone in zone_list:
+ print u"Player:... |
60838c6a1cd1a22b01ab9c4ed8530415c51ac572 | cvrminer/app/views.py | cvrminer/app/views.py | """Views for cvrminer app."""
from flask import Blueprint, current_app, render_template
from ..xbrler import search_for_regnskaber
from ..wikidata import cvr_to_q
main = Blueprint('app', __name__)
@main.route("/")
def index():
"""Return index page of for app."""
return render_template('base.html')
@main... | """Views for cvrminer app."""
from flask import Blueprint, current_app, render_template
from ..xbrler import search_for_regnskaber
from ..wikidata import cvr_to_q
main = Blueprint('app', __name__)
@main.route("/")
def index():
"""Return index page of for app."""
return render_template('index.html')
@mai... | Change to use index.html for index page | Change to use index.html for index page
| Python | apache-2.0 | fnielsen/cvrminer,fnielsen/cvrminer,fnielsen/cvrminer | ---
+++
@@ -12,7 +12,7 @@
@main.route("/")
def index():
"""Return index page of for app."""
- return render_template('base.html')
+ return render_template('index.html')
@main.route("/smiley/") |
85d3b1203d9861f986356e593a2b79d96c38c1b3 | utils/aiohttp_wrap.py | utils/aiohttp_wrap.py | #!/bin/env python
import aiohttp
async def aio_get_text(url, headers=None):
async with aiohttp.ClientSession() as session:
async with session.get(url, headers=headers) as r:
if r.status == 200:
return r.text()
else:
return None
async def aio_get_js... | #!/bin/env python
import aiohttp
async def aio_get(url: str):
async with aiohttp.ClientSession() as session:
<<<<<<< HEAD
async with session.get(url, headers=headers) as r:
if r.status == 200:
return r.text()
else:
return None
async def aio_get_jso... | Revert "progress on DDG cog & aiohttp wrapper" | Revert "progress on DDG cog & aiohttp wrapper"
This reverts commit 6b6d243e96bd13583e7f02dfe6669578d238a594.
| Python | mit | Naught0/qtbot | ---
+++
@@ -3,8 +3,9 @@
import aiohttp
-async def aio_get_text(url, headers=None):
+async def aio_get(url: str):
async with aiohttp.ClientSession() as session:
+<<<<<<< HEAD
async with session.get(url, headers=headers) as r:
if r.status == 200:
return r.text()
@@ -18,3... |
efdcc11678aed558fc464ea9e1b1f9351d6e1f8d | Python-practice/fy_print_seq_len_in_fasta.py | Python-practice/fy_print_seq_len_in_fasta.py | #!/usr/bin/env python
'''
Script: fy_print_seq_len_in_fasta.py
Function: Print sequence length to STDOUT in fasta file
Note: Python3 is not default installed for most computer,
and the extra-installed module like Biopython could
not be directly used by python3. So, it's not the
righ time to use Pyth... | #!/usr/bin/env python
'''
Script: fy_print_seq_len_in_fasta.py
Function: Print sequence length to STDOUT in fasta file
Note: Python3 is not default installed for most computer,
and the extra-installed module like Biopython could
not be directly used by python3. So, it's not the
righ time to use Pyth... | Use single quotes instead of double quotes | Use single quotes instead of double quotes
| Python | bsd-2-clause | lileiting/gfat | ---
+++
@@ -29,7 +29,7 @@
min_len = seqlen[0]
max_len = seqlen[-1]
-print("Number of sequences: " + str(num_of_seq))
-print("Total length: " + str(total_len))
-print("Max length: " + str(max_len))
-print("Min length: " + str(min_len))
+print('Number of sequences: ' + str(num_of_seq))
+print('Total length: ' + str... |
91b55e3377e641cd431d479887bdb12e9d0cbe35 | napps/kytos/of_core/v0x04/utils.py | napps/kytos/of_core/v0x04/utils.py | """Utilities module for of_core OpenFlow v0x04 operations"""
from kytos.core import log
from kytos.core.switch import Interface
def update_flow_list(controller, switch):
"""Method responsible for request stats of flow to switches.
Args:
controller(:class:`~kytos.core.controller.Controller`):
... | """Utilities module for of_core OpenFlow v0x04 operations"""
from kytos.core import log
from kytos.core.switch import Interface
def update_flow_list(controller, switch):
"""Method responsible for request stats of flow to switches.
Args:
controller(:class:`~kytos.core.controller.Controller`):
... | Change 'not implemented' log INFO to ERROR | Change 'not implemented' log INFO to ERROR
| Python | mit | kytos/kytos-napps,kytos/kyco-core-napps,cemsbr/kytos-napps | ---
+++
@@ -12,7 +12,7 @@
switch(:class:`~kytos.core.switch.Switch`):
target to send a stats request.
"""
- log.info("update_flow_list not implemented yet for OF v0x04")
+ log.error("update_flow_list not implemented yet for OF v0x04")
def handle_features_reply(controller, event): |
e11b4c299ffedd61d114c058e8ca5d525ffa461f | test/unit/staging/test_map_ctp.py | test/unit/staging/test_map_ctp.py | from nose.tools import *
import os, glob, shutil
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..'))
from qipipe.staging import CTPPatientIdMap
# The test parent directory.
ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
# The test fixture.
FIXTURE = o... | from nose.tools import *
import os, glob, shutil
import logging
logger = logging.getLogger(__name__)
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..'))
from qipipe.staging.map_ctp import CTPPatientIdMap
COLLECTION = 'Sarcoma'
"""The test collection."""
SUBJECTS = ["Sarcoma%02d"... | Update test for Map CTP API changes. | Update test for Map CTP API changes.
| Python | bsd-2-clause | ohsu-qin/qipipe | ---
+++
@@ -1,23 +1,33 @@
from nose.tools import *
import os, glob, shutil
+import logging
+logger = logging.getLogger(__name__)
+
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..'))
-from qipipe.staging import CTPPatientIdMap
+from qipipe.staging.map_ctp import CTPPatientId... |
e2934a342e3c825a3baf91724c6344b74d6dd724 | guides/voice/conference-calls-guide/moderated-conference/moderated-conference.6.x.py | guides/voice/conference-calls-guide/moderated-conference/moderated-conference.6.x.py | from flask import Flask, request
from twilio.twiml.voice_response import VoiceResponse, Dial
app = Flask(__name__)
# Update with your own phone number in E.164 format
MODERATOR = '+15558675309'
@app.route("/voice", methods=['GET', 'POST'])
def call():
"""Returns TwiML for a moderated conference call"""
# St... | """Demonstration of setting up a conference call in Flask with Twilio."""
from flask import Flask, request
from twilio.twiml.voice_response import VoiceResponse, Dial
app = Flask(__name__)
# Update with your own phone number in E.164 format
MODERATOR = '+18005551212'
@app.route("/voice", methods=['GET', 'POST'])
de... | Add with back to dial, docstring | Add with back to dial, docstring
| Python | mit | TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snip... | ---
+++
@@ -1,32 +1,34 @@
+"""Demonstration of setting up a conference call in Flask with Twilio."""
from flask import Flask, request
from twilio.twiml.voice_response import VoiceResponse, Dial
app = Flask(__name__)
# Update with your own phone number in E.164 format
-MODERATOR = '+15558675309'
+MODERATOR = '... |
e8ed1e7635aa82a6fb7fe00ca00fa3d1bf1cd015 | djcelery_email/tasks.py | djcelery_email/tasks.py | from django.conf import settings
from django.core.mail import get_connection, EmailMessage
from celery.task import task
CONFIG = getattr(settings, 'CELERY_EMAIL_TASK_CONFIG', {})
BACKEND = getattr(settings, 'CELERY_EMAIL_BACKEND',
'django.core.mail.backends.smtp.EmailBackend')
TASK_CONFIG = {
'... | from django.conf import settings
from django.core.mail import get_connection, EmailMessage
from celery.task import task
CONFIG = getattr(settings, 'CELERY_EMAIL_TASK_CONFIG', {})
BACKEND = getattr(settings, 'CELERY_EMAIL_BACKEND',
'django.core.mail.backends.smtp.EmailBackend')
TASK_CONFIG = {
'... | Deal with the fact that message is now a dict, not an object. | Logging: Deal with the fact that message is now a dict, not an object.
| Python | bsd-3-clause | pmclanahan/django-celery-email,pmclanahan/django-celery-email,andresriancho/django-celery-email | ---
+++
@@ -25,7 +25,7 @@
**kwargs.pop('_backend_init_kwargs', {}))
try:
result = conn.send_messages([from_dict(message)])
- logger.debug("Successfully sent email message to %r.", message.to)
+ logger.debug("Successfully sent email message to %r.", message['to'])... |
04f4c11ff52069475a3818de74b4cd89695cfa2c | scrapi/harvesters/tdar/__init__.py | scrapi/harvesters/tdar/__init__.py | """
Harvester for the The Digital Archaeological Record (tDAR) for the SHARE project
More information at https://github.com/CenterForOpenScience/SHARE/blob/master/providers/org.tdar.md
Example API call: http://core.tdar.org/oai-pmh/oai?verb=ListRecords&metadataPrefix=oai_dc&from=2014-10-05
"""
from __future__ impor... | """
Harvester for the The Digital Archaeological Record (tDAR) for the SHARE project
More information at https://github.com/CenterForOpenScience/SHARE/blob/master/providers/org.tdar.md
Example API call: http://core.tdar.org/oai-pmh/oai?verb=ListRecords&metadataPrefix=oai_dc&from=2014-10-05
"""
from __future__ impor... | Update tdar harvester with custom url gatheriing | Update tdar harvester with custom url gatheriing
| Python | apache-2.0 | icereval/scrapi,ostwald/scrapi,mehanig/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi,erinspace/scrapi,fabianvf/scrapi,CenterForOpenScience/scrapi,alexgarciac/scrapi,mehanig/scrapi,felliott/scrapi,fabianvf/scrapi,felliott/scrapi,jeffreyliu3230/scrapi | ---
+++
@@ -9,10 +9,33 @@
from __future__ import unicode_literals
+from scrapi import util
from scrapi.base import OAIHarvester
-tdar = OAIHarvester(
+class tdarHarvester(OAIHarvester):
+
+ def get_ids(self, result, doc):
+ """
+ Gather the DOI and url from identifiers, if possible.
+ ... |
0b0664536056c755befae4c5aaa83f100f76e8e8 | apps/actors/models.py | apps/actors/models.py | from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.db.models import DateTimeField, BooleanField, OneToOneField
from agenda.models import Calendar
class Actor(models.Model):
"""
An actor is an entity playing a role in your system. It can be anything that
belon... | from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.db.models import DateTimeField, BooleanField, OneToOneField
from agenda.models import Calendar
class Actor(models.Model):
"""
An actor is an entity playing a role in your system. It can be anything that
belon... | Make calendar not editbale for actors | Make calendar not editbale for actors
| Python | agpl-3.0 | SpreadBand/SpreadBand,SpreadBand/SpreadBand | ---
+++
@@ -14,25 +14,26 @@
abstract = True
registered_on = DateTimeField(auto_now_add=True,
- help_text=_('When it was was registered')
+ help_text=_('When it was was registered'),
+ editable=False
... |
0f3704a73ec54f015bff9a391d3a6dabc34368cd | palette/core/palette_selection.py | palette/core/palette_selection.py | # -*- coding: utf-8 -*-
## @package palette.core.palette_selection
#
# Implementation of automatic color palette selection.
# @author tody
# @date 2015/08/20
| # -*- coding: utf-8 -*-
## @package palette.core.palette_selection
#
# Implementation of automatic color palette selection.
# @author tody
# @date 2015/08/20
import os
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import matplotlib.animation as animation
impo... | Add initial plaette selection code. | Add initial plaette selection code.
| Python | mit | tody411/PaletteSelection | ---
+++
@@ -5,3 +5,60 @@
# @author tody
# @date 2015/08/20
+import os
+import numpy as np
+from mpl_toolkits.mplot3d import Axes3D
+import matplotlib.pyplot as plt
+import matplotlib.animation as animation
+import cv2
+
+from palette.datasets.google_image import dataFile
+from palette.cv.image impor... |
a4a7cdbb6c599d15fa26b0d84c73fdfba27ccf43 | Markov.py | Markov.py | from collections import deque, defaultdict
from random import choice
class SequenceGenerator:
def __init__(self, order):
self.order = order
self.table = defaultdict(list)
def addSample(self, sequence):
st = deque([None] * self.order, self.order)
len = 0
for v in sequence:
self.table[tup... | from collections import deque, defaultdict
from random import choice
class SequenceGenerator:
def __init__(self, order):
self.order = order
self.table = defaultdict(list)
def addSample(self, sequence):
st = deque([None] * self.order, self.order)
len = 0
for v in sequence:
self.table[tup... | Fix crash on empty DB. | Fix crash on empty DB.
| Python | mit | Fifty-Nine/github_ebooks | ---
+++
@@ -18,7 +18,7 @@
self.table[tuple(st)].append(None)
def next(self, state):
- return choice(self.table.get(tuple(state)))
+ return choice(self.table.get(tuple(state), [None]))
def generate(self):
state = deque([None] * self.order, self.order) |
b521317c773b6e5e08a135e2a3fc4a658a981ea8 | dddp/test/__init__.py | dddp/test/__init__.py | # This file mainly exists to allow `python setup.py test` to work.
import os
import sys
import dddp
import django
from django.test.utils import get_runner
from django.conf import settings
def run_tests():
os.environ['DJANGO_SETTINGS_MODULE'] = 'dddp.test.test_project.settings'
dddp.greenify()
django.setu... | Add test runner for use with `python setup.py test` | Add test runner for use with `python setup.py test`
| Python | mit | django-ddp/django-ddp,django-ddp/django-ddp,commoncode/django-ddp,commoncode/django-ddp,django-ddp/django-ddp,commoncode/django-ddp,commoncode/django-ddp,django-ddp/django-ddp | ---
+++
@@ -0,0 +1,17 @@
+# This file mainly exists to allow `python setup.py test` to work.
+import os
+import sys
+
+import dddp
+import django
+from django.test.utils import get_runner
+from django.conf import settings
+
+
+def run_tests():
+ os.environ['DJANGO_SETTINGS_MODULE'] = 'dddp.test.test_project.settin... | |
f7e80d42ce10e07eac45dad9ccced5818cee56fe | examples/terminal_mongo_example.py | examples/terminal_mongo_example.py | from chatterbot import ChatBot
from chatterbot.filters import LanguageFilter
import logging
# Uncomment the following line to enable verbose logging
# logging.basicConfig(level=logging.INFO)
# Create a new ChatBot instance
bot = ChatBot("Terminal",
storage_adapter="chatterbot.adapters.storage.MongoDatabaseAdapte... | from chatterbot import ChatBot
from chatterbot.filters import LanguageFilter, RepetitiveResponseFilter
import logging
# Uncomment the following line to enable verbose logging
# logging.basicConfig(level=logging.INFO)
# Create a new ChatBot instance
bot = ChatBot("Terminal",
storage_adapter="chatterbot.adapters.s... | Add filters to the Mongo DB example. | Add filters to the Mongo DB example.
| Python | bsd-3-clause | vkosuri/ChatterBot,maclogan/VirtualPenPal,Reinaesaya/OUIRL-ChatBot,davizucon/ChatterBot,gunthercox/ChatterBot,Gustavo6046/ChatterBot,Reinaesaya/OUIRL-ChatBot | ---
+++
@@ -1,5 +1,5 @@
from chatterbot import ChatBot
-from chatterbot.filters import LanguageFilter
+from chatterbot.filters import LanguageFilter, RepetitiveResponseFilter
import logging
@@ -14,6 +14,7 @@
],
filters=(
LanguageFilter,
+ RepetitiveResponseFilter
),
input_ada... |
e09894b92823392891fd0dddb63fd30bfd5bdc2a | pyclient/integtest.py | pyclient/integtest.py | #!/usr/bin/python
from lockd import LockdClient
lockd_client = LockdClient()
# Lock
assert lockd_client.lock("foo")
# Dup lock should fail
assert not lockd_client.lock("foo")
# Lock another entry should work
assert lockd_client.lock("bar")
# Unlock entries
assert lockd_client.unlock("foo")
assert lockd_client.unl... | #!/usr/bin/python
from lockd import LockdClient
lockd_client = LockdClient()
# Initial state
assert not lockd_client.is_locked("foo")
assert not lockd_client.is_locked("bar")
# Lock
assert lockd_client.lock("foo")
assert lockd_client.is_locked("foo")
# Dup lock should fail
assert not lockd_client.lock("foo")
asser... | Add is_locked calls to integration test | Add is_locked calls to integration test
| Python | mit | divtxt/lockd,divtxt/lockd | ---
+++
@@ -4,18 +4,28 @@
lockd_client = LockdClient()
+# Initial state
+assert not lockd_client.is_locked("foo")
+assert not lockd_client.is_locked("bar")
+
# Lock
assert lockd_client.lock("foo")
+assert lockd_client.is_locked("foo")
# Dup lock should fail
assert not lockd_client.lock("foo")
+assert lockd... |
5493848ddca54a57a6dceb781bd417a9232cf1c4 | tests/test_profile.py | tests/test_profile.py | """Test the profile listing and creation
Copyright (c) 2015 Francesco Montesano
MIT Licence
"""
import pytest
import dodocs
# fixtures
@pytest.fixture
def profile_list():
"""Execute the command profile list"""
command_line = 'profile list'
dodocs.main(command_line.split())
# profile listing
def test_l... | """Test the profile listing and creation
Copyright (c) 2015 Francesco Montesano
MIT Licence
"""
import pytest
import dodocs
# fixtures
@pytest.fixture
def profile_list():
"""Execute the command profile list"""
command_line = 'profile list'
dodocs.main(command_line.split())
@pytest.fixture
def profile_... | Add remove and edit on non existing dodocs directories | Add remove and edit on non existing dodocs directories
| Python | mit | montefra/dodocs | ---
+++
@@ -16,12 +16,44 @@
dodocs.main(command_line.split())
+@pytest.fixture
+def profile_rm():
+ """Execute the command profile remove"""
+ command_line = 'profile remove dodocs_pytest'
+ dodocs.main(command_line.split())
+
+
+@pytest.fixture
+def profile_edit():
+ """Execute the command profi... |
0d8283a066fd0bdfe278a5516a299971f7492cea | auth/src/db/crypto.py | auth/src/db/crypto.py | from passlib.context import CryptContext
from config import HASH_ROUNDS
crypt_context = CryptContext(
schemes=["pbkdf2_sha512"],
all__vary_rounds=0.1,
pbkdf2_sha512__default_rounds=HASH_ROUNDS
)
encrypt = crypt_context.encrypt
verify = crypt_context.verify
| from passlib.context import CryptContext
from config import HASH_ROUNDS, HASH_ALGORITHM
crypt_context = CryptContext(
schemes=[HASH_ALGORITHM],
all__vary_rounds=0.1,
pbkdf2_sha512__default_rounds=HASH_ROUNDS
)
encrypt = crypt_context.encrypt
verify = crypt_context.verify
| Make algorithm configurable, for real this time | Make algorithm configurable, for real this time
| Python | mit | jackfirth/docker-auth | ---
+++
@@ -1,8 +1,8 @@
from passlib.context import CryptContext
-from config import HASH_ROUNDS
+from config import HASH_ROUNDS, HASH_ALGORITHM
crypt_context = CryptContext(
- schemes=["pbkdf2_sha512"],
+ schemes=[HASH_ALGORITHM],
all__vary_rounds=0.1,
pbkdf2_sha512__default_rounds=HASH_ROUNDS
) |
fce10cb35be29ba265f2ed189198703c718ad479 | quantecon/__init__.py | quantecon/__init__.py | """
Import the main names to top level.
"""
from . import models as models
from .compute_fp import compute_fixed_point
from .discrete_rv import DiscreteRV
from .ecdf import ECDF
from .estspec import smooth, periodogram, ar_periodogram
from .graph_tools import DiGraph
from .gridtools import cartesian, mlinspace
from .g... | """
Import the main names to top level.
"""
from . import models as models
from .compute_fp import compute_fixed_point
from .discrete_rv import DiscreteRV
from .ecdf import ECDF
from .estspec import smooth, periodogram, ar_periodogram
from .graph_tools import DiGraph
from .gridtools import cartesian, mlinspace
from .g... | Fix for python 3 relative import statement | Fix for python 3 relative import statement
| Python | bsd-3-clause | andybrnr/QuantEcon.py,oyamad/QuantEcon.py,agutieda/QuantEcon.py,jviada/QuantEcon.py,QuantEcon/QuantEcon.py,QuantEcon/QuantEcon.py,gxxjjj/QuantEcon.py,agutieda/QuantEcon.py,gxxjjj/QuantEcon.py,oyamad/QuantEcon.py,jviada/QuantEcon.py,andybrnr/QuantEcon.py | ---
+++
@@ -27,7 +27,7 @@
from .util import searchsorted, random_probvec, random_sample_without_replacement
#-Module Imports-#
-import util.random as random
+from .util import random
#Add Version Attribute
from .version import version as __version__ |
e80169bf4ec40609f768f8c84519824b8a209e44 | fedoracommunity/mokshaapps/updates/controllers/root.py | fedoracommunity/mokshaapps/updates/controllers/root.py | from moksha.lib.base import Controller
from moksha.api.widgets import ContextAwareWidget, Grid
from tg import expose, tmpl_context
class UpdatesGrid(Grid, ContextAwareWidget):
template='mako:fedoracommunity.mokshaapps.updates.templates.table_widget'
updates_grid = UpdatesGrid('updates_table')
class RootControlle... | from tg import expose, tmpl_context, validate
from formencode import validators
from moksha.lib.base import Controller
from moksha.api.widgets import ContextAwareWidget, Grid
class UpdatesGrid(Grid, ContextAwareWidget):
template='mako:fedoracommunity.mokshaapps.updates.templates.table_widget'
updates_grid = Upda... | Use formencode validators in our updates app, instead of doing hacks | Use formencode validators in our updates app, instead of doing hacks
| Python | agpl-3.0 | fedora-infra/fedora-packages,Fale/fedora-packages,Fale/fedora-packages,Fale/fedora-packages,fedora-infra/fedora-packages,fedora-infra/fedora-packages,fedora-infra/fedora-packages | ---
+++
@@ -1,6 +1,8 @@
+from tg import expose, tmpl_context, validate
+from formencode import validators
+
from moksha.lib.base import Controller
from moksha.api.widgets import ContextAwareWidget, Grid
-from tg import expose, tmpl_context
class UpdatesGrid(Grid, ContextAwareWidget):
template='mako:fedoraco... |
3736b02d3b0004809bafb0a40625e26caffc1beb | opal/ddd.py | opal/ddd.py | """
DDD Integration for OPAL
"""
from django.conf import settings
import requests
CHANGE_ENDPOINT = settings.DDD_ENDPOINT + 'change/'
OUR_ENDPOINT = settings.DEFAULT_DOMAIN + '/ddd/'
def change(pre, post):
r = requests.post(
CHANGE_ENDPOINT,
params={'pre': pre, 'post': post, 'endpoint': OUR_ENDPOI... | """
DDD Integration for OPAL
"""
from django.conf import settings
from django.core.serializers.json import DjangoJSONEncoder
import json
import requests
CHANGE_ENDPOINT = settings.DDD_ENDPOINT + 'change/'
OUR_ENDPOINT = settings.DEFAULT_DOMAIN + '/ddd/'
def change(pre, post):
payload = {
'pre': json.d... | Use the real send POST params keyword. | Use the real send POST params keyword.
| Python | agpl-3.0 | khchine5/opal,khchine5/opal,khchine5/opal | ---
+++
@@ -2,16 +2,24 @@
DDD Integration for OPAL
"""
from django.conf import settings
+from django.core.serializers.json import DjangoJSONEncoder
+import json
import requests
CHANGE_ENDPOINT = settings.DDD_ENDPOINT + 'change/'
OUR_ENDPOINT = settings.DEFAULT_DOMAIN + '/ddd/'
def change(pre, post):
+ p... |
02d65664b44963a6d24ccf4fee59d6b5181a9164 | zephyr/lib/bulk_create.py | zephyr/lib/bulk_create.py | from django.conf import settings
# batch_bulk_create should become obsolete with Django 1.5, when the
# Django bulk_create method accepts a batch_size directly.
def batch_bulk_create(cls, cls_list, batch_size=150):
if "sqlite" not in settings.DATABASES["default"]["ENGINE"]:
# We don't need a low batch size ... | from django.conf import settings
# batch_bulk_create should become obsolete with Django 1.5, when the
# Django bulk_create method accepts a batch_size directly.
def batch_bulk_create(cls, cls_list, batch_size=150):
if "sqlite" not in settings.DATABASES["default"]["ENGINE"]:
# We don't need a low batch size ... | Increase MySQL batch size to 10,000. | Increase MySQL batch size to 10,000.
This saves 30 seconds in populate_db runtime on MySQL.
(imported from commit 7fe483bf5f32cfa3d09db8ad7a9be79bd0a2a271)
| Python | apache-2.0 | dnmfarrell/zulip,ryanbackman/zulip,hayderimran7/zulip,aakash-cr7/zulip,adnanh/zulip,praveenaki/zulip,johnny9/zulip,wangdeshui/zulip,moria/zulip,aps-sids/zulip,bitemyapp/zulip,brainwane/zulip,aliceriot/zulip,timabbott/zulip,littledogboy/zulip,wavelets/zulip,TigorC/zulip,hackerkid/zulip,natanovia/zulip,he15his/zulip,krtk... | ---
+++
@@ -5,7 +5,7 @@
if "sqlite" not in settings.DATABASES["default"]["ENGINE"]:
# We don't need a low batch size with mysql, but we do need
# one to avoid "MySQL Server has gone away" errors
- batch_size = 2000
+ batch_size = 10000
while len(cls_list) > 0:
curren... |
77704e80a32fbb2f4c9533778565a92dbb346ab6 | highlander/highlander.py | highlander/highlander.py | from functools import wraps
from logging import getLogger
from os import getcwd, unlink
from os.path import join, realpath, isfile
from psutil import Process
logger = getLogger(__name__)
def one(f):
@wraps(f)
def decorator():
pid_file = realpath(join(getcwd(), '.pid'))
if _is_running(pid_fi... | from functools import wraps
from logging import getLogger
from os import getcwd, unlink
from os.path import join, realpath, isfile
from psutil import Process
logger = getLogger(__name__)
def one(f):
@wraps(f)
def decorator():
pid_file = realpath(join(getcwd(), '.pid'))
if _is_running(pid_fi... | Make sure filename is a string. | Make sure filename is a string.
| Python | mit | chriscannon/highlander | ---
+++
@@ -29,6 +29,9 @@
def _read_pid_file(filename):
+ if not isfile(str(filename)):
+ return None
+
with open(filename, 'r') as f:
pid, create_time = f.read().split(',')
return Process(int(pid)) |
9178e4d6a8fb54c6124c192765a9ff8cc3a582c6 | docs/recipe_bridge.py | docs/recipe_bridge.py | #!/usr/bin/env python
import time
from picraft import World, Vector, Block
world = World(ignore_errors=True)
world.say('Auto-bridge active')
last_pos = None
while True:
this_pos = world.player.pos
if last_pos is not None:
# Has the player moved more than 0.2 units in a horizontal direction?
m... | #!/usr/bin/env python
from __future__ import unicode_literals
import time
from picraft import World, Vector, Block
from collections import deque
world = World(ignore_errors=True)
world.say('Auto-bridge active')
try:
bridge = deque()
last_pos = None
while True:
this_pos = world.player.pos
... | Update bridge recipe to limit length | Update bridge recipe to limit length
Also removes bridge at the end
| Python | bsd-3-clause | waveform80/picraft,radames/picraft | ---
+++
@@ -1,22 +1,35 @@
#!/usr/bin/env python
+
+from __future__ import unicode_literals
import time
from picraft import World, Vector, Block
+from collections import deque
world = World(ignore_errors=True)
world.say('Auto-bridge active')
+try:
+ bridge = deque()
+ last_pos = None
+ while True:
+ ... |
4b46ecb6304527b38d0c2f8951b996f8d28f0bff | config/freetype2/__init__.py | config/freetype2/__init__.py | import os
from SCons.Script import *
def configure(conf):
env = conf.env
conf.CBCheckHome('freetype2',
inc_suffix=['/include', '/include/freetype2'])
if not 'FREETYPE2_INCLUDE' in os.environ:
try:
env.ParseConfig('pkg-config freetype2 --cflags')
except OS... | import os
from SCons.Script import *
def configure(conf):
env = conf.env
conf.CBCheckHome('freetype2',
inc_suffix=['/include', '/include/freetype2'])
if not 'FREETYPE2_INCLUDE' in os.environ:
try:
env.ParseConfig('pkg-config freetype2 --cflags')
except OS... | Add fallback to freetype-config for compatibility. | Add fallback to freetype-config for compatibility.
| Python | lgpl-2.1 | CauldronDevelopmentLLC/cbang,CauldronDevelopmentLLC/cbang,CauldronDevelopmentLLC/cbang,CauldronDevelopmentLLC/cbang | ---
+++
@@ -12,7 +12,11 @@
try:
env.ParseConfig('pkg-config freetype2 --cflags')
except OSError:
- pass
+ try:
+ env.ParseConfig('freetype-config --cflags')
+ except OSError:
+ pass
+
if env['PLATFORM'] == 'darwin' or... |
eaf794231853ba74b49ceea7308f40d9bde008dc | flowworker/pdmlParse.py | flowworker/pdmlParse.py | #! /usr/bin/env python2
# vim: set fenc=utf8 ts=4 sw=4 et :
import sys
import json
import xml.sax
class PdmlHandler( xml.sax.ContentHandler ):
def __init__(self):
self.CurrentData = ""
self.type = ""
self.format = ""
self.year = ""
self.rating = ""
self.stars = ""
self.desc... | #! /usr/bin/env python2
# vim: set fenc=utf8 ts=4 sw=4 et :
import sys
import json
import xml.sax
class PdmlHandler( xml.sax.ContentHandler ):
def __init__(self):
self.CurrentData = ""
self.type = ""
self.format = ""
self.year = ""
self.rating = ""
self.stars = ""
self.desc... | Change value field in json output | Change value field in json output
| Python | apache-2.0 | Enteee/EtherFlows,Enteee/EtherFlows,Enteee/EtherFlows,Enteee/EtherFlows | ---
+++
@@ -20,9 +20,9 @@
if tag == "packet":
pkt.clear()
else:
- if attributes.has_key("name") and attributes.has_key("showname"):
+ if attributes.has_key("name") and attributes.has_key("show"):
name = attributes.getValue("name")
- showname = attr... |
ef2618e25cc6dfed119da8d0d4d3c26f2832a33b | ds/utils/logbuffer.py | ds/utils/logbuffer.py | from __future__ import absolute_import
from tempfile import NamedTemporaryFile
class LogBuffer(object):
def __init__(self, chunk_size=4096):
self.chunk_size = chunk_size
self.fp = NamedTemporaryFile()
def fileno(self):
return self.fp.fileno()
def write(self, chunk):
self... | from __future__ import absolute_import
from tempfile import NamedTemporaryFile
class LogBuffer(object):
def __init__(self, chunk_size=4096):
self.chunk_size = chunk_size
self.fp = NamedTemporaryFile()
def fileno(self):
return self.fp.fileno()
def write(self, chunk):
self... | Move flush logic into close | Move flush logic into close
| Python | apache-2.0 | jkimbo/freight,jkimbo/freight,getsentry/freight,klynton/freight,jkimbo/freight,getsentry/freight,klynton/freight,klynton/freight,rshk/freight,jkimbo/freight,getsentry/freight,klynton/freight,getsentry/freight,getsentry/freight,rshk/freight,rshk/freight,rshk/freight | ---
+++
@@ -16,6 +16,7 @@
self.fp.flush()
def close(self, force=False):
+ self.fp.flush()
if force:
self.fp.close()
@@ -23,8 +24,6 @@
self.fp.flush()
def iter_chunks(self):
- self.flush()
-
chunk_size = self.chunk_size
result = ''... |
adf1fc4646e18db1f4f2ad9c89e6d23799cd3b5f | dtoolcore/__init__.py | dtoolcore/__init__.py | """Tool for managing (scientific) data.
"""
__version__ = "2.0.0"
| """API for creating and interacting with dtool datasets.
"""
__version__ = "2.0.0"
| Update dtoolcore module summary line | Update dtoolcore module summary line
| Python | mit | JIC-CSB/dtoolcore | ---
+++
@@ -1,4 +1,4 @@
-"""Tool for managing (scientific) data.
+"""API for creating and interacting with dtool datasets.
"""
|
681379125ca83641e6906318c01b6932e0cb100b | whois_search.py | whois_search.py | from ipwhois import IPWhois
import whois
'''
############################################
# WHOIS #
############################################
'''
def whois_target(host):
# Technically this is still passive recon
# because you still aren't hitting target
w = whois.whoi... | from ipwhois import IPWhois
import whois
'''
############################################
# WHOIS #
############################################
'''
def whois_target(host):
# Technically this is still passive recon
# because you still aren't hitting target
w = whois.whoi... | Fix whois ip search (rename ranges/mult var) | Fix whois ip search (rename ranges/mult var)
| Python | unlicense | nethunteros/punter | ---
+++
@@ -18,7 +18,7 @@
def whois_ip(ip):
# Default to not found
- cidr, range = "Not found"
+ cidr, ranges = "CIDR not found", "Range not found"
# Get whois for IP. Returns a list with dictionary
ip_dict = IPWhois(ip).lookup_rws()
@@ -27,6 +27,6 @@
cidr = ip_dict['nets'][0].get('... |
514c5c684f314cc4322dfd6ba4ff16eca12796e4 | scripts/BemsPallet.py | scripts/BemsPallet.py | #!/usr/bin/env python
# * coding: utf8 *
'''
BemsPallet.py
A module that contains a pallet to update the querable layers behind our UTM basemaps
'''
from forklift.models import Pallet
from os.path import join
class BemsPallet(Pallet):
def __init__(self):
super(BemsPallet, self).__init__()
self... | #!/usr/bin/env python
# * coding: utf8 *
'''
BemsPallet.py
A module that contains a pallet to update the querable layers behind our UTM basemaps
'''
from forklift.models import Pallet
from os.path import join
class BemsPallet(Pallet):
def __init__(self):
super(BemsPallet, self).__init__()
self... | Move data into owner gdb | Move data into owner gdb
| Python | mit | agrc/BEMS,agrc/BEMS,agrc/BEMS | ---
+++
@@ -17,7 +17,7 @@
self.arcgis_services = [('BEMS/Boundaries', 'MapServer')]
- self.destination_workspace = 'C:\\Scheduled\\Staging\\SGID.gdb'
+ self.destination_workspace = 'C:\\Scheduled\\Staging\\Health.gdb'
self.copy_data = [self.destination_workspace]
def build(s... |
b48e39aafd9ef413216444a6bfb97e867aa40e1c | tests/auto/keras/test_constraints.py | tests/auto/keras/test_constraints.py | import unittest
import numpy as np
from theano import tensor as T
class TestConstraints(unittest.TestCase):
def setUp(self):
self.some_values = [0.1,0.5,3,8,1e-7]
self.example_array = np.random.random((100,100))*100. - 50.
self.example_array[0,0] = 0. # 0 could possibly cause trouble
d... | import unittest
import numpy as np
from theano import tensor as T
class TestConstraints(unittest.TestCase):
def setUp(self):
self.some_values = [0.1,0.5,3,8,1e-7]
self.example_array = np.random.random((100,100))*100. - 50.
self.example_array[0,0] = 0. # 0 could possibly cause trouble
d... | Add a test for the identity, non-negative, and unit-norm constraints | Add a test for the identity, non-negative, and unit-norm constraints
| Python | mit | saurav111/keras,kfoss/keras,Aureliu/keras,stephenbalaban/keras,chenych11/keras,jiumem/keras,cvfish/keras,xiaoda99/keras,rodrigob/keras,iamtrask/keras,wubr2000/keras,navyjeff/keras,keskarnitish/keras,eulerreich/keras,zxytim/keras,tencrance/keras,printedheart/keras,rudaoshi/keras,dribnet/keras,pthaike/keras,cheng6076/ker... | ---
+++
@@ -16,5 +16,25 @@
normed = norm_instance(self.example_array)
assert(np.all(normed.eval() < m))
+ def test_nonneg(self):
+ from keras.constraints import nonneg
+
+ normed = nonneg(self.example_array)
+ assert(np.all(np.min(normed.eval(),axis=1) == 0.))
+
+ ... |
8b7660193f5a18a2d0addd218f2fd2d77d8f98ac | app/grandchallenge/cases/serializers.py | app/grandchallenge/cases/serializers.py | from rest_framework import serializers
from grandchallenge.cases.models import Image, ImageFile
class ImageFileSerializer(serializers.ModelSerializer):
class Meta:
model = ImageFile
fields = ("pk", "image", "file")
class ImageSerializer(serializers.ModelSerializer):
files = ImageFileSeriali... | from rest_framework import serializers
from grandchallenge.cases.models import Image, ImageFile
class ImageFileSerializer(serializers.ModelSerializer):
class Meta:
model = ImageFile
fields = ("pk", "image", "file", "image_type")
class ImageSerializer(serializers.ModelSerializer):
files = Im... | Return image type of file in api | Return image type of file in api
| Python | apache-2.0 | comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django | ---
+++
@@ -6,7 +6,7 @@
class ImageFileSerializer(serializers.ModelSerializer):
class Meta:
model = ImageFile
- fields = ("pk", "image", "file")
+ fields = ("pk", "image", "file", "image_type")
class ImageSerializer(serializers.ModelSerializer): |
8297ca0006362d6a99fef6d8ad94c9fc094cc3ee | oscar/templatetags/form_tags.py | oscar/templatetags/form_tags.py | from django import template
register = template.Library()
@register.tag
def annotate_form_field(parser, token):
"""
Set an attribute on a form field with the widget type
This means templates can use the widget type to render things differently
if they want to. Django doesn't make this available by ... | from django import template
register = template.Library()
@register.tag
def annotate_form_field(parser, token):
"""
Set an attribute on a form field with the widget type
This means templates can use the widget type to render things differently
if they want to. Django doesn't make this available by ... | Adjust form templatetag to handle missing field var | Adjust form templatetag to handle missing field var
When a non-existant field gets passed, the templatetag was raising an
unseemly AttributeError. This change checks to see if the passed var is
actually a form field to avoid said error.
| Python | bsd-3-clause | WillisXChen/django-oscar,spartonia/django-oscar,solarissmoke/django-oscar,ka7eh/django-oscar,manevant/django-oscar,ademuk/django-oscar,dongguangming/django-oscar,thechampanurag/django-oscar,elliotthill/django-oscar,vovanbo/django-oscar,jlmadurga/django-oscar,lijoantony/django-oscar,spartonia/django-oscar,WadeYuChen/dja... | ---
+++
@@ -24,5 +24,6 @@
def render(self, context):
field = self.field.resolve(context)
- field.widget_type = field.field.widget.__class__.__name__
+ if hasattr(field, 'field'):
+ field.widget_type = field.field.widget.__class__.__name__
return '' |
a968cbcd4b5a2aec5e1253221598eb53f9f0c2e9 | osgtest/tests/test_10_condor.py | osgtest/tests/test_10_condor.py | import os
import osgtest.library.core as core
import unittest
class TestStartCondor(unittest.TestCase):
def test_01_start_condor(self):
core.config['condor.lockfile'] = '/var/lock/subsys/condor_master'
core.state['condor.started-service'] = False
core.state['condor.running-service'] = Fals... | import os
from osgtest.library import core, osgunittest
import unittest
class TestStartCondor(osgunittest.OSGTestCase):
def test_01_start_condor(self):
core.config['condor.lockfile'] = '/var/lock/subsys/condor_master'
core.state['condor.started-service'] = False
core.state['condor.running-... | Update 10_condor to use OkSkip functionality | Update 10_condor to use OkSkip functionality
git-svn-id: 884a03e47e2adb735d896e55bb5ad6bc3421ba19@16522 4e558342-562e-0410-864c-e07659590f8c
| Python | apache-2.0 | efajardo/osg-test,efajardo/osg-test | ---
+++
@@ -1,21 +1,19 @@
import os
-import osgtest.library.core as core
+from osgtest.library import core, osgunittest
import unittest
-class TestStartCondor(unittest.TestCase):
+class TestStartCondor(osgunittest.OSGTestCase):
def test_01_start_condor(self):
core.config['condor.lockfile'] = '/var... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.