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 |
|---|---|---|---|---|---|---|---|---|---|---|
3f454b3d66cb2cb19936ca591b7d873683eb1da5 | autoapi/base.py | autoapi/base.py | from .settings import env
class AutoAPIBase(object):
language = 'base'
type = 'base'
def __init__(self, obj):
self.obj = obj
def render(self, ctx=None):
if not ctx:
ctx = {}
template = env.get_template(
'{language}/{type}.rst'.format(language=self.la... | from .settings import env
class AutoAPIBase(object):
language = 'base'
type = 'base'
def __init__(self, obj):
self.obj = obj
def render(self, ctx=None):
if not ctx:
ctx = {}
template = env.get_template(
'{language}/{type}.rst'.format(language=self.lan... | Make context output behavior overridable | Make context output behavior overridable
| Python | mit | rtfd/sphinx-autoapi,rtfd/sphinx-autoapi,rtfd/sphinx-autoapi,rtfd/sphinx-autoapi | ---
+++
@@ -9,14 +9,13 @@
def __init__(self, obj):
self.obj = obj
-
def render(self, ctx=None):
if not ctx:
ctx = {}
template = env.get_template(
'{language}/{type}.rst'.format(language=self.language, type=self.type)
)
- ctx.update(**sel... |
ccddc17f49d0e4a506cf2a967495f4da12358c41 | setup.py | setup.py | from distutils.core import setup
from setuptools import find_packages
__author__ = "Arthur Fortes"
setup(
name='CaseRecommender',
packages=find_packages(),
version='0.0.11',
license='GPL3 License',
description='A recommender systems framework for Python',
author='Arthur Fortes',
author_ema... | from distutils.core import setup
from setuptools import find_packages
__author__ = "Arthur Fortes"
setup(
name='CaseRecommender',
packages=find_packages(),
version='0.0.12',
license='GPL3 License',
description='A recommender systems framework for Python',
author='Arthur Fortes',
author_ema... | Fix bugs in item and user knn | Fix bugs in item and user knn
| Python | mit | ArthurFortes/CaseRecommender | ---
+++
@@ -6,13 +6,13 @@
setup(
name='CaseRecommender',
packages=find_packages(),
- version='0.0.11',
+ version='0.0.12',
license='GPL3 License',
description='A recommender systems framework for Python',
author='Arthur Fortes',
author_email='fortes.arthur@gmail.com',
url='ht... |
2d56080e18c44dcc6d49bba3b25fc2e4368cb1f4 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import find_packages, setup
install_requires = [
'Django>=1.8,<1.10',
'django-mptt>=0.7',
'django-mptt-admin>=0.3',
'sorl-thumbnail>=12.2',
'django-taggit>=0.21.3',
'python-dateutil>=2.6.0',
]
setup(
name='django-glitter',
version='0.2',
desc... | #!/usr/bin/env python
from setuptools import find_packages, setup
install_requires = [
'Django>=1.8,<1.10',
'django-mptt>=0.7',
'django-mptt-admin>=0.3',
'sorl-thumbnail>=12.2',
'django-taggit>=0.21.3',
'python-dateutil>=2.6.0',
]
setup(
name='django-glitter',
version='0.2',
desc... | Update GitHub repos from blancltd to developersociety | Update GitHub repos from blancltd to developersociety
| Python | bsd-3-clause | developersociety/django-glitter,blancltd/django-glitter,developersociety/django-glitter,blancltd/django-glitter,developersociety/django-glitter,blancltd/django-glitter | ---
+++
@@ -17,7 +17,7 @@
version='0.2',
description='Glitter for Django',
long_description=open('README.rst').read(),
- url='https://github.com/blancltd/django-glitter',
+ url='https://github.com/developersociety/django-glitter',
maintainer='Blanc Ltd',
maintainer_email='studio@blanc.l... |
af01ceeb16f8c1f7bdaaf73065b048852b7b6df0 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='projections',
version='0.1',
packages=find_packages(),
include_package_data=True,
install_requires=[
'Click',
'gdal',
'fiona',
'geopy',
'joblib',
'matplotlib',
'netCDF4',
'numba',
'numpy',... | from setuptools import setup, find_packages
setup(
name='projections',
version='0.1',
packages=find_packages(),
include_package_data=True,
install_requires=[
'Click',
'gdal',
'fiona',
'geopy',
'joblib',
'matplotlib',
'netCDF4',
'numba',
'numpy',... | Fix rasterio to version 0.36.0 now that 1.0 is out | Fix rasterio to version 0.36.0 now that 1.0 is out
There are some incompatibilities between the two. Until I can go to NHM
to upgrade their setup, I'll pin it to the old version.
| Python | apache-2.0 | ricardog/raster-project,ricardog/raster-project,ricardog/raster-project,ricardog/raster-project,ricardog/raster-project | ---
+++
@@ -18,7 +18,7 @@
'pandas',
'pylru',
'pyparsing',
- 'rasterio',
+ 'rasterio==0.36.0',
'rpy2',
'setuptools',
'shapely', |
bf7d547e5fb6ef1d46fdf773318f32a139929590 | bottery/message.py | bottery/message.py | import os
from datetime import datetime
from jinja2 import Environment, FileSystemLoader, select_autoescape
from bottery.conf import settings
class Message:
def __init__(self, id, platform, user, text, timestamp, raw):
self.id = id
self.platform = platform
self.user = user
self.t... | import os
from datetime import datetime
from jinja2 import Environment, FileSystemLoader, select_autoescape
from bottery.conf import settings
class Message:
def __init__(self, id, platform, user, text, timestamp, raw):
self.id = id
self.platform = platform
self.user = user
self.t... | Use utcfromtimestamp instead of fromtimestamp on Message | Use utcfromtimestamp instead of fromtimestamp on Message
| Python | mit | rougeth/bottery | ---
+++
@@ -17,7 +17,7 @@
@property
def datetime(self):
- return datetime.fromtimestamp(self.timestamp)
+ return datetime.utcfromtimestamp(self.timestamp)
def render(message, template_name, context={}): |
85ffe172eb00c25d35990bab313be7a0194dddb1 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name='Pipeless',
version='1.0',
description='Simple pipelines building framework.',
long_description= \
""" [=|Pipeless|=] provides a simple framework
for building a data pipeline.
It's an advanced version of this:
... | #!/usr/bin/env python
from distutils.core import setup
setup(name='Pipeless',
version='1.0.1',
description='Simple pipelines building framework.',
long_description= \
""" [=|Pipeless|=] provides a simple framework
for building a data pipeline.
It's an advanced version of this... | Add version number to reflect orderedict bug | Add version number to reflect orderedict bug
| Python | mit | andychase/pipeless | ---
+++
@@ -2,7 +2,7 @@
from distutils.core import setup
setup(name='Pipeless',
- version='1.0',
+ version='1.0.1',
description='Simple pipelines building framework.',
long_description= \
""" [=|Pipeless|=] provides a simple framework
@@ -31,7 +31,7 @@
""",
author='And... |
1b94c9d46a349597e2c04858dfe9f2916af9f15b | setup.py | setup.py | import codecs
import os
import re
from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
def read(*parts):
here = os.path.abspath(os.path.dirname(__file__))
return codecs.open(os.path.join(here, *parts), 'r').read()
def find_version(*file_paths):
version_file = ... | import codecs
import os
import re
from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
def read(*parts):
here = os.path.abspath(os.path.dirname(__file__))
return codecs.open(os.path.join(here, *parts), 'r').read()
def find_version(*file_paths):
version_file = ... | Update classifiers through Python 3.6 | Update classifiers through Python 3.6 | Python | apache-2.0 | Tinche/aiofiles | ---
+++
@@ -37,6 +37,8 @@
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
+ "Programming Language :: Python :: 3.5",
+ "Programming Language :: Python :: 3.6",
"Topic :: System :: ... |
db0c911379e90254461a8888ba42ff65e0914240 | setup.py | setup.py | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='django-envelope',
version=__import__('envelope').__version__,
description='A contact form app for Django',
long_description=read('README.rst'),
... | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='django-envelope',
version=__import__('envelope').__version__,
description='A contact form app for Django',
long_description=read('README.rst'),
... | Bump minimal Django version in install_requires. | Bump minimal Django version in install_requires.
| Python | mit | zsiciarz/django-envelope,zsiciarz/django-envelope | ---
+++
@@ -16,7 +16,7 @@
url='http://github.com/zsiciarz/django-envelope',
download_url='http://pypi.python.org/pypi/django-envelope',
license='MIT',
- install_requires=['Django>=1.5'],
+ install_requires=['Django>=1.8'],
packages=find_packages(exclude=['example_project', 'tests']),
in... |
c61ce07bbf5ace2186e107c58f4a095789ae215c | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(
name='eventlet',
version='0.2',
description='Coroutine-based networking library',
author='Linden Lab',
author_email='eventletdev@lists.secondlife.com',
url='http://wiki.secondlife.com/wiki/Eventlet',
packages=['eventlet'],
insta... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='eventlet',
version='0.2',
description='Coroutine-based networking library',
author='Linden Lab',
author_email='eventletdev@lists.secondlife.com',
url='http://wiki.secondlife.com/wiki/Eventlet',
packages=find_pac... | Patch from Chuck Thier to properly install subpackages (eventlet.hubs and eventlet.support) now that we have subpackages | Patch from Chuck Thier to properly install subpackages (eventlet.hubs and eventlet.support) now that we have subpackages
| Python | mit | tempbottle/eventlet,tempbottle/eventlet,lindenlab/eventlet,lindenlab/eventlet,lindenlab/eventlet,collinstocks/eventlet,collinstocks/eventlet | ---
+++
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-from setuptools import setup
+from setuptools import setup, find_packages
setup(
name='eventlet',
@@ -9,7 +9,7 @@
author='Linden Lab',
author_email='eventletdev@lists.secondlife.com',
url='http://wiki.secondlife.com/wiki/Eventlet',
- packages... |
44c14a9af100781645976aec1ae1bc700bd008b9 | setup.py | setup.py | from setuptools import setup
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst')) as readme_file:
long_description = readme_file.read()
setup(
name='pyfds',
description='Modular field simulation tool using finite differences.',
long_description=long... | from setuptools import setup
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst')) as readme_file:
long_description = readme_file.read()
setup(
name='pyfds',
description='Modular field simulation tool using finite differences.',
long_description=long... | Add matplotlib to runtime dependencies. | Add matplotlib to runtime dependencies.
| Python | bsd-3-clause | emtpb/pyfds | ---
+++
@@ -26,7 +26,8 @@
# Runtime dependencies
install_requires=[
'numpy',
- 'scipy'
+ 'scipy',
+ 'matplotlib'
],
# Setup/build dependencies; setuptools_scm required for git-based versioning |
727cda368514f15ec53ef195ffcd6161d0796521 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name='SpaceScout-Web',
version='1.0',
description='Web frontend for SpaceScout',
install_requires=[
'Django>=1.4,<1.5',
'oauth2',
'oauth_provider',
... | #!/usr/bin/env python
from distutils.core import setup
setup(name='SpaceScout-Web',
version='1.0',
description='Web frontend for SpaceScout',
install_requires=[
'Django>=1.4,<1.5',
'oauth2',
'oauth_provider',
... | Add PermissionsLogging for log files. | Add PermissionsLogging for log files.
| Python | apache-2.0 | uw-it-aca/spacescout_web,uw-it-aca/spacescout_web,uw-it-aca/spacescout_web | ---
+++
@@ -15,5 +15,6 @@
'simplejson',
'python-ldap',
'mock<=1.0.1',
+ 'PermissionsLogging',
],
) |
2bf87e4417257518e7d43bd421eaccd555fc4f4c | setup.py | setup.py | import os
from setuptools import setup, find_packages
setup(name='Coffin',
version=".".join(map(str, __import__("coffin").__version__)),
description='Jinja2 adapter for Django',
author='Christopher D. Leary',
author_email='cdleary@gmail.com',
maintainer='David Cramer',
maintainer_email='dcramer... | import os
from setuptools import setup, find_packages
setup(name='Coffin',
version=".".join(map(str, __import__("coffin").__version__)),
description='Jinja2 adapter for Django',
author='Christopher D. Leary',
author_email='cdleary@gmail.com',
maintainer='David Cramer',
maintainer_email='dcramer... | Fix URL to point to a valid repo | Fix URL to point to a valid repo
| Python | bsd-3-clause | rossowl/coffin,akx/coffin,rossowl/coffin | ---
+++
@@ -8,7 +8,7 @@
author_email='cdleary@gmail.com',
maintainer='David Cramer',
maintainer_email='dcramer@gmail.com',
- url='http://github.com/dcramer/coffin',
+ url='http://github.com/coffin/coffin',
packages=find_packages(),
#install_requires=['Jinja2', 'django>=1.2'],
class... |
11fc4fe8ad5caa072ed0827762a2f75319deec82 | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0.10',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0.11',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | Update the PyPI version to 7.0.11. | Update the PyPI version to 7.0.11.
| Python | mit | Doist/todoist-python | ---
+++
@@ -10,7 +10,7 @@
setup(
name='todoist-python',
- version='7.0.10',
+ version='7.0.11',
packages=['todoist', 'todoist.managers'],
author='Doist Team',
author_email='info@todoist.com', |
a3125b11e6f509b2d80cf989440bd99c713242a4 | setup.py | setup.py | #!/usr/bin/python
import os
from distutils.core import setup
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
except IOError:
README = CHANGES = ''
setup(
name="rpdb",
version="0... | #!/usr/bin/python3
import os
from distutils.core import setup
from io import open
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.rst'), encoding='utf8').read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
except IOError:
README = CHANGES = ''
... | Read the README file with UTF-8 encoding. | Read the README file with UTF-8 encoding.
This commit fixes an install issue in Python 3.5 where the read() function raises an encoding error. It uses
the open function from the io module so that the code will be compatible with both Python 2 and 3.
| Python | bsd-2-clause | tamentis/rpdb | ---
+++
@@ -1,15 +1,17 @@
-#!/usr/bin/python
+#!/usr/bin/python3
import os
from distutils.core import setup
+from io import open
here = os.path.abspath(os.path.dirname(__file__))
try:
- README = open(os.path.join(here, 'README.rst')).read()
+ README = open(os.path.join(here, 'README.rst'), encoding='u... |
264143c5208df1afa20eceff286849ca8362e5a7 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
root = os.path.abspath(os.path.dirname(__file__))
version = __import__('swf').__version__
with open(os.path.join(root, 'README.rst')) as f:
README = f.read()
setup(
name='simple-workflow',
version=version,
license... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
root = os.path.abspath(os.path.dirname(__file__))
version = __import__('swf').__version__
with open(os.path.join(root, 'README.rst')) as f:
README = f.read()
setup(
name='simple-workflow',
version=version,
license... | Make test dependencies more explicit | Make test dependencies more explicit
| Python | mit | botify-labs/python-simple-workflow,botify-labs/python-simple-workflow | ---
+++
@@ -27,8 +27,12 @@
zip_safe=True,
install_requires=[
'boto',
+ 'xworkflows==1.0.0',
+ ],
+
+ tests_require=[
'mock==1.0.1',
- 'xworkflows==1.0.0',
+ 'py.test>=2.8.5',
],
package_dir={'': '.'}, |
1e1ee9998a5e1461b1688d55218d793402fbb4d7 | setup.py | setup.py | import os
from setuptools import setup, find_packages
version = "1.4.0"
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "django-macaddress",
version = version,
url = 'http://github.com/tubaman/django-macaddress',
license = 'BSD',
description =... | import os
from setuptools import setup, find_packages
version = "1.4.0"
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "django-macaddress",
version = version,
url = 'http://github.com/tubaman/django-macaddress',
license = 'BSD',
description =... | Use the official notation of the Django package | Use the official notation of the Django package
Even if pypi is case insensitive, all other packages include django with an uppercase D.
This package using lowercase will lead to uninstalls/reinstalls when using pip-compile and other tools.
Please accept the change to make it compatible. | Python | bsd-3-clause | tubaman/django-macaddress | ---
+++
@@ -19,7 +19,7 @@
maintainer_email = 'the1.arun@gmail.com',
packages = ['macaddress', 'macaddress.tests'],
install_requires = ['netaddr'],
- tests_require = ['django'],
+ tests_require = ['Django'],
test_suite="runtests.runtests",
classifiers = [ |
df91e2840e84ecbcf74a46eb40c467dfe7d9a21e | setup.py | setup.py | """Setup for pymd5 module and command-line script."""
from setuptools import setup
def readme():
"""Use text contained in README.rst as long description."""
with open('README.rst') as desc:
return desc.read()
setup(name='pymd5',
version='0.1',
description=('Recursively calculate and displ... | """Setup for pymd5 module and command-line script."""
from setuptools import setup
def readme():
"""Use text contained in README.rst as long description."""
with open('README.rst') as desc:
return desc.read()
setup(name='pymd5',
version='0.1',
description=('Recursively calculate and displ... | Change url to point to tagged release | Change url to point to tagged release
| Python | mit | richmilne/pymd5 | ---
+++
@@ -12,7 +12,7 @@
description=('Recursively calculate and display MD5 file hashes '
'for all files rooted in a directory.'),
long_description=readme(),
- url='https://github.com/richmilne/pymd5',
+ url='https://github.com/richmilne/pymd5/releases/tag/v0.1',
a... |
cb41b0ab31e42165f8a525edf2332d15986f7168 | setup.py | setup.py | from setuptools import find_packages, setup
setup(
name='isic-discourse-sso',
version='1.0.0',
description='Girder plugin for a Discourse Single-Sign-On provider.',
url='https://github.com/ImageMarkup/isic_discourse_sso',
packages=find_packages(exclude=['test']),
python_requires='>=3.6',
in... | from setuptools import find_packages, setup
setup(
name='isic-discourse-sso',
version='1.0.0',
description='Girder plugin for a Discourse Single-Sign-On provider.',
url='https://github.com/ImageMarkup/isic-discourse-sso',
license='Apache 2.0',
packages=find_packages(exclude=['test']),
pytho... | Correct some Python package metadata | Correct some Python package metadata
| Python | apache-2.0 | ImageMarkup/discourse_sso,ImageMarkup/discourse_sso,ImageMarkup/discourse_sso | ---
+++
@@ -4,7 +4,8 @@
name='isic-discourse-sso',
version='1.0.0',
description='Girder plugin for a Discourse Single-Sign-On provider.',
- url='https://github.com/ImageMarkup/isic_discourse_sso',
+ url='https://github.com/ImageMarkup/isic-discourse-sso',
+ license='Apache 2.0',
packages=... |
f166d8aeb3bd6aa79813548068b5c6f687d8f26b | setup.py | setup.py | from setuptools import setup
from codecs import open
from os import path
# Open up settings
here = path.abspath(path.dirname(__file__))
about = {}
with open(path.join(here, "README.rst"), encoding="utf-8") as file:
long_description = file.read()
with open(path.join(here, "malaffinity", "__about__.py")) as file... | from setuptools import setup
from codecs import open
from os import path
# Open up settings
here = path.abspath(path.dirname(__file__))
about = {}
with open(path.join(here, "README.rst"), encoding="utf-8") as file:
long_description = file.read()
with open(path.join(here, "malaffinity", "__about__.py")) as file... | Remove scipy and numpy deps | Remove scipy and numpy deps
| Python | mit | erkghlerngm44/malaffinity | ---
+++
@@ -44,9 +44,7 @@
"install_requires": [
"bs4",
- "numpy",
- "requests",
- "scipy" # I tried getting rid of this, but numpy is shit so [](#yuishrug)
+ "requests"
]
}
|
b39d23cf2181d5d5af9c49a890c58fb19f2aad64 | setup.py | setup.py | #!/usr/bin/env python
# coding: utf-8
from setuptools import setup
setup(
name='requests-jwt',
version='0.4',
url='https://github.com/tgs/requests-jwt',
modules=['requests_jwt'],
install_requires=[ 'requests', 'PyJWT' ],
tests_require=['httpretty'],
test_suite='tests.suite',
provides=[... | #!/usr/bin/env python
# coding: utf-8
from setuptools import setup
setup(
name='requests-jwt',
version='0.5',
url='https://github.com/tgs/requests-jwt',
modules=['requests_jwt'],
install_requires=[ 'requests', 'PyJWT' ],
tests_require=['httpretty'],
test_suite='tests.suite',
provides=[... | Tag version 0.5 with bytes/text fix | Tag version 0.5 with bytes/text fix
| Python | isc | tgs/requests-jwt | ---
+++
@@ -5,7 +5,7 @@
setup(
name='requests-jwt',
- version='0.4',
+ version='0.5',
url='https://github.com/tgs/requests-jwt',
modules=['requests_jwt'],
install_requires=[ 'requests', 'PyJWT' ], |
21d19c32eb93e34dfba3f66cc44ab36685fd018c | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
__name__ == '__main__' and setup(name='aiohttp-json-rpc',
version='0.11.1',
author='Florian Scherf',
url='https://github.com/pengutronix/aiohttp-json-rpc/',
author_email='f.scherf@pengutronix.de',
l... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
__name__ == '__main__' and setup(name='aiohttp-json-rpc',
version='0.11.1',
author='Florian Scherf',
url='https://github.com/pengutronix/aiohttp-json-rpc/',
author_email='f.scherf@pengutronix.de',
l... | Update aiohttp version constraint to <3.5 | Update aiohttp version constraint to <3.5 | Python | apache-2.0 | pengutronix/aiohttp-json-rpc,pengutronix/aiohttp-json-rpc,pengutronix/aiohttp-json-rpc | ---
+++
@@ -9,7 +9,7 @@
url='https://github.com/pengutronix/aiohttp-json-rpc/',
author_email='f.scherf@pengutronix.de',
license='Apache 2.0',
- install_requires=['aiohttp>=3,<3.4'],
+ install_requires=['aiohttp>=3,<3.5'],
python_requires='>=3.5',
packages=find_packages(),
... |
1a09dca23b62e815cbce0860fe5786f51d5f207c | setup.py | setup.py | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
requirements = [
]
test_requirements = [
]
setup(
name='adb_android',
version='0.4.0',
description="Enables android adb in your python script",
long_description='This python package is... | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
requirements = [
]
test_requirements = [
]
setup(
name='adb_android',
version='0.5.0',
description="Enables android adb in your python script",
long_description='This python package is... | Change package version to 0.5.0 | Change package version to 0.5.0
| Python | bsd-3-clause | vmalyi/adb_android | ---
+++
@@ -12,7 +12,7 @@
setup(
name='adb_android',
- version='0.4.0',
+ version='0.5.0',
description="Enables android adb in your python script",
long_description='This python package is a wrapper for standard android adb\
implementation. It allows you to execute android adb commands in... |
46d89e06f9b6fbc06b72bb50b84b1dd28887fd09 | setup.py | setup.py | import sys
from chandra_aca import __version__
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
s... | import sys
from chandra_aca import __version__
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
s... | Fix another problem where package data was not included | Fix another problem where package data was not included
| Python | bsd-2-clause | sot/chandra_aca,sot/chandra_aca | ---
+++
@@ -27,6 +27,7 @@
version=__version__,
zip_safe=False,
packages=['chandra_aca', 'chandra_aca.tests'],
+ package_data={'chandra_aca.tests': ['data/*.txt']},
tests_require=['pytest'],
cmdclass={'test': PyTest},
) |
2b4c1f32e75c5884179d58b9fc27d19336677181 | setup.py | setup.py | from os.path import dirname, abspath, join, exists
from setuptools import setup
long_description = None
if exists("README.md"):
long_description = open("README.md").read()
install_reqs = [req for req in open(abspath(join(dirname(__file__), 'requirements.txt')))]
tests_reqs = [req for req in open(abspath(join(dirn... | from os.path import dirname, abspath, join, exists
from setuptools import setup
long_description = None
if exists("README.md"):
long_description = open("README.md").read()
install_reqs = [req for req in open(abspath(join(dirname(__file__), 'requirements.txt')))]
tests_reqs = [req for req in open(abspath(join(dirn... | Add python 3 compatibility in pip install | Add python 3 compatibility in pip install
| Python | mit | supercast-tv/python-mpd-parser,caststack/python-mpegdash,caststack/python-mpd-parser | ---
+++
@@ -15,7 +15,7 @@
long_description=long_description,
author="supercast",
author_email="gamzabaw@gmail.com",
- version="0.1.0",
+ version="0.1.5",
license="MIT",
zip_safe=False,
include_package_data=True,
@@ -23,4 +23,13 @@
url="https://github.com/caststack/python-mpegdash",
tests_req... |
54b3663206d80aa2dbe4f93c6f8ce9fc45424bf3 | src/rf/apps/home/urls.py | src/rf/apps/home/urls.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from django.conf.urls import patterns, url, include
from rest_framework.routers import SimpleRouter
from apps.home.views import (home_page,
UserLayerViewSe... | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from django.conf.urls import patterns, url, include
from rest_framework.routers import SimpleRouter
from apps.home.views import (home_page,
UserLayerViewSe... | Add URLs to redirect to home_page | Add URLs to redirect to home_page
Also refine some other URLs, so that, for example, layers/blah will result in a 404.
| Python | apache-2.0 | azavea/raster-foundry,aaronxsu/raster-foundry,kdeloach/raster-foundry,azavea/raster-foundry,aaronxsu/raster-foundry,azavea/raster-foundry,raster-foundry/raster-foundry,raster-foundry/raster-foundry,raster-foundry/raster-foundry,kdeloach/raster-foundry,kdeloach/raster-foundry,kdeloach/raster-foundry,azavea/raster-foundr... | ---
+++
@@ -26,11 +26,17 @@
urlpatterns = patterns(
'',
url(r'^', include(router.urls)),
- url(r'user/(?P<username>' + username_regex + r')/favorites/',
+ url(r'user/(?P<username>' + username_regex + r')/favorites/$',
FavoriteListView.as_view()),
url(r'user/(?P<username>' + username_reg... |
f9b3670732d6b211e69873b098dd6f0f3de2f0cb | call_subprocess.py | call_subprocess.py | """
Demo of calling subprocesses.
Links
-----
- https://docs.python.org/3/library/io.html
- https://docs.python.org/3/library/subprocess.html
"""
from subprocess import call
def call_and_check_errors():
call_args = ('wc', '-l', 'my_file')
call_args_str = ' '.join(call_args)
print(call_args_str)
result = ca... | """
Demo of calling subprocesses.
Links
-----
- https://docs.python.org/3/library/io.html
- https://docs.python.org/3/library/subprocess.html
"""
from subprocess import CalledProcessError, call, check_output
import sys
def call_and_check_errors():
call_args = ('touch', sys.argv[0])
call_args_str = ' '.join(ca... | Add call subprocess and print output | Add call subprocess and print output
| Python | mit | MattMS/Python_3_examples | ---
+++
@@ -10,11 +10,12 @@
- https://docs.python.org/3/library/subprocess.html
"""
-from subprocess import call
+from subprocess import CalledProcessError, call, check_output
+import sys
def call_and_check_errors():
- call_args = ('wc', '-l', 'my_file')
+ call_args = ('touch', sys.argv[0])
call_args_str... |
4c1237d2969d735cfcf9f3c10cf27cb801996e32 | tests/test_integration.py | tests/test_integration.py | """Unit test module for Selenium testing"""
from selenium import webdriver
from flask.ext.testing import LiveServerTestCase
from tests import TestCase
from pages import LoginPage
class TestUI(TestCase, LiveServerTestCase):
"""Test class for UI integration/workflow testing"""
def setUp(self):
"""Res... | """Unit test module for Selenium testing"""
import os
from selenium import webdriver
from flask.ext.testing import LiveServerTestCase
from tests import TestCase
from pages import LoginPage
class TestUI(TestCase, LiveServerTestCase):
"""Test class for UI integration/workflow testing"""
def setUp(self):
... | Use Sauce Labs for selenium testing when available | Use Sauce Labs for selenium testing when available
| Python | bsd-3-clause | uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal | ---
+++
@@ -1,4 +1,5 @@
"""Unit test module for Selenium testing"""
+import os
from selenium import webdriver
from flask.ext.testing import LiveServerTestCase
@@ -15,7 +16,26 @@
super(TestUI, self).setUp()
- self.driver = webdriver.Firefox()
+ if "SAUCE_USERNAME" in os.environ and "SAU... |
c7beb58c8f5d6f0efd0f7abeb608f9de27a3ac28 | src/waldur_mastermind/marketplace_rancher/processors.py | src/waldur_mastermind/marketplace_rancher/processors.py | from waldur_mastermind.marketplace import processors
from waldur_rancher import views as rancher_views
class RancherCreateProcessor(processors.BaseCreateResourceProcessor):
viewset = rancher_views.ClusterViewSet
fields = (
'name',
'description',
'nodes',
'tenant_settings',
... | from waldur_mastermind.marketplace import processors
from waldur_rancher import views as rancher_views
class RancherCreateProcessor(processors.BaseCreateResourceProcessor):
viewset = rancher_views.ClusterViewSet
fields = (
'name',
'description',
'nodes',
'tenant_settings',
... | Allow to pass security_groups from marketplace to Rancher plugin. | Allow to pass security_groups from marketplace to Rancher plugin.
| Python | mit | opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur | ---
+++
@@ -11,6 +11,7 @@
'tenant_settings',
'ssh_public_key',
'install_longhorn',
+ 'security_groups',
)
|
9148b45f05fbc7697864967d343b0b63d91fa33b | temba/msgs/migrations/0037_backfill_recipient_counts.py | temba/msgs/migrations/0037_backfill_recipient_counts.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('msgs', '0036_auto_20151103_1014'),
]
def backfill_recipient_counts(apps, schema):
Broadcast = apps.get_model('msgs', 'Broadc... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('msgs', '0036_auto_20151103_1014'),
]
def backfill_recipient_counts(apps, schema):
Broadcast = apps.get_model('msgs', 'Broadc... | Add migration to backfill recipient counts | Add migration to backfill recipient counts
| Python | agpl-3.0 | reyrodrigues/EU-SMS,tsotetsi/textily-web,pulilab/rapidpro,pulilab/rapidpro,ewheeler/rapidpro,ewheeler/rapidpro,tsotetsi/textily-web,pulilab/rapidpro,tsotetsi/textily-web,pulilab/rapidpro,reyrodrigues/EU-SMS,pulilab/rapidpro,tsotetsi/textily-web,reyrodrigues/EU-SMS,ewheeler/rapidpro,tsotetsi/textily-web,ewheeler/rapidpr... | ---
+++
@@ -18,7 +18,7 @@
for broadcast in Broadcast.objects.filter(recipient_count=0):
# set to # of msgs
broadcast.recipient_count = Msg.objects.filter(broadcast=broadcast).count()
- if recipient_count > 0:
+ if broadcast.recipient_count > 0:
... |
7c0db5fb36f082cfe95c4969df4cc15d1c88578d | icforum/forum/forms.py | icforum/forum/forms.py | from django import forms
from django.contrib.auth import authenticate
from .models import *
class SignInForm(forms.Form):
username = forms.CharField(max_length=100, label='Username')
password = forms.CharField(max_length=100, label='Password', widget=forms.PasswordInput)
def clean(self):
cleaned_data = super(Si... | from django import forms
from django.contrib.auth import authenticate
from .models import *
class SignInForm(forms.Form):
username = forms.CharField(max_length=100, label='Username')
password = forms.CharField(max_length=100, label='Password', widget=forms.PasswordInput)
def clean(self):
cleaned_data = super(Si... | Fix bug on sign in page when invalid credentials are given | Fix bug on sign in page when invalid credentials are given
| Python | apache-2.0 | rdujardin/icforum,rdujardin/icforum,rdujardin/icforum | ---
+++
@@ -11,7 +11,7 @@
cleaned_data = super(SignInForm, self).clean()
user = authenticate(username=cleaned_data.get('username'), password=cleaned_data.get('password'))
if user is None:
- raise ValidationError('Invalid username or password')
+ raise forms.ValidationError('Invalid username or password')... |
eee3ec1df295b51979f031e4fa7e6476cbb9a167 | ideasbox/blog/forms.py | ideasbox/blog/forms.py | from django import forms
from .models import Content
class ContentForm(forms.ModelForm):
class Meta:
model = Content
widgets = {
# We need a normalized date string for JS datepicker, so we take
# control over the format to bypass L10N.
"published_at": forms.Da... | from django import forms
from .models import Content
class ContentForm(forms.ModelForm):
class Meta:
model = Content
widgets = {
# We need a normalized date string for JS datepicker, so we take
# control over the format to bypass L10N.
"published_at": forms.Da... | Remove comma turning dict to tuple without my consent | Remove comma turning dict to tuple without my consent
| Python | agpl-3.0 | ideascube/ideascube,Lcaracol/ideasbox.lan,ideascube/ideascube,Lcaracol/ideasbox.lan,ideascube/ideascube,Lcaracol/ideasbox.lan,ideascube/ideascube | ---
+++
@@ -11,5 +11,5 @@
# We need a normalized date string for JS datepicker, so we take
# control over the format to bypass L10N.
"published_at": forms.DateInput(format='%Y-%m-%d')
- },
+ }
fields = "__all__" |
3a2daf3c5acc9489705de13ffac8efce5c81c736 | pyrpl/test/test_redpitaya.py | pyrpl/test/test_redpitaya.py | # unitary test for the pyrpl module
import unittest
import os
from pyrpl import RedPitaya
class RedPitayaTestCases(unittest.TestCase):
def setUp(self):
self.hostname = os.environ.get('REDPITAYA')
def tearDown(self):
pass
def test_hostname(self):
self.assertIsNotNone(
... | # unitary test for the pyrpl module
import unittest
import os
from pyrpl import RedPitaya
class RedPitayaTestCases(unittest.TestCase):
def setUp(self):
self.hostname = os.environ.get('REDPITAYA')
self.password = os.environ.get('RP_PASSWORD') or 'root'
def tearDown(self):
pass
... | Update test_connect to read password from env. variable | Update test_connect to read password from env. variable
| Python | mit | lneuhaus/pyrpl,lneuhaus/pyrpl,lneuhaus/pyrpl,lneuhaus/pyrpl | ---
+++
@@ -10,6 +10,7 @@
def setUp(self):
self.hostname = os.environ.get('REDPITAYA')
+ self.password = os.environ.get('RP_PASSWORD') or 'root'
def tearDown(self):
pass
@@ -18,9 +19,14 @@
self.assertIsNotNone(
self.hostname,
msg="Set REDPITAYA... |
55af5785d1aedff028f85229af691d5f59ba434a | python_cowbull_server/__init__.py | python_cowbull_server/__init__.py | # Initialization code. Placed in a separate Python package from the main
# app, this code allows the app created to be imported into any other
# package, module, or method.
import argparse
import logging # Import standard logging - for levels only
from python_cowbull_server.Configurator import Configurator
f... | # Initialization code. Placed in a separate Python package from the main
# app, this code allows the app created to be imported into any other
# package, module, or method.
import logging # Import standard logging - for levels only
from python_cowbull_server.Configurator import Configurator
from flask import... | Remove parameter support (due to unittest module) and modify to print parameters on each run. | Remove parameter support (due to unittest module) and modify to print parameters on each run.
| Python | apache-2.0 | dsandersAzure/python_cowbull_server,dsandersAzure/python_cowbull_server | ---
+++
@@ -2,41 +2,28 @@
# app, this code allows the app created to be imported into any other
# package, module, or method.
-import argparse
import logging # Import standard logging - for levels only
from python_cowbull_server.Configurator import Configurator
from flask import Flask
-#
-# Step 1... |
47337d203d4b67dce71f33ab5a14c0a7342c94ae | server.py | server.py | import StringIO
import base64
import signal
import flask
from quiver.plotter import FieldPlotter
app = flask.Flask(__name__)
@app.route('/')
def quiver():
'''Route for homepage'''
return flask.render_template('quiver.html')
@app.route('/plot/', methods=['GET',])
def plot():
equation_string = flask.requ... | import StringIO
import base64
import signal
import flask
from quiver.plotter import FieldPlotter
app = flask.Flask(__name__)
@app.route('/')
def quiver():
'''Route for homepage'''
return flask.render_template('quiver.html')
@app.route('/plot', methods=['GET',])
def plot():
equation_string = flask.reque... | Remove trailing slashes from routes. | Remove trailing slashes from routes.
| Python | mit | davidsoncasey/quiver,davidsoncasey/quiver,davidsoncasey/quiver,davidsoncasey/quiver,davidsoncasey/quiver | ---
+++
@@ -13,7 +13,7 @@
'''Route for homepage'''
return flask.render_template('quiver.html')
-@app.route('/plot/', methods=['GET',])
+@app.route('/plot', methods=['GET',])
def plot():
equation_string = flask.request.args.get('equation')
diff_equation = FieldPlotter()
@@ -31,7 +31,7 @@
el... |
82178af68dde7754cade01e9d5f092c9889ab957 | tomorrow_corrector/bot.py | tomorrow_corrector/bot.py | import praw, time
# replace with your username/password
username, password = USERNAME, PASSWORD
r = praw.Reddit(user_agent='A "tomorrow"-misspelling corrector by /u/tomorrow_corrector')
r.login(username, password, disable_warning=True)
def run_bot():
'''Check /r/all for mispellings in comments and reply to them... | import praw, time
# replace with your username/password
username, password = USERNAME, PASSWORD
r = praw.Reddit(user_agent='A "tomorrow"-misspelling corrector by /u/tomorrow_corrector')
r.login(username, password, disable_warning=True)
misspellings = ['tommorow', 'tommorrow', 'tomorow']
comment_cache = []
def run_b... | Check if comment body contains misspelling, reply if so | Check if comment body contains misspelling, reply if so
| Python | mit | kshvmdn/reddit-bots | ---
+++
@@ -6,12 +6,17 @@
r = praw.Reddit(user_agent='A "tomorrow"-misspelling corrector by /u/tomorrow_corrector')
r.login(username, password, disable_warning=True)
+misspellings = ['tommorow', 'tommorrow', 'tomorow']
+comment_cache = []
def run_bot():
'''Check /r/all for mispellings in comments and repl... |
f2a1dba207d870ebd287ebdf71f721b348c2ea36 | tests/test_redis_storage.py | tests/test_redis_storage.py | import unittest
import datetime
import hiro
import redis
from sifr.span import Minute, Day
from sifr.storage import MemoryStorage, RedisStorage
class RedisStorageTests(unittest.TestCase):
def setUp(self):
self.redis = redis.Redis()
self.redis.flushall()
def test_incr_simple_minute(self):
... | import unittest
import datetime
import hiro
import redis
from sifr.span import Minute, Day
from sifr.storage import MemoryStorage, RedisStorage
class RedisStorageTests(unittest.TestCase):
def setUp(self):
self.redis = redis.Redis()
self.redis.flushall()
def test_incr_simple_minute(self):
... | Remove hiro timeline context in redis test | Remove hiro timeline context in redis test
| Python | mit | alisaifee/sifr,alisaifee/sifr | ---
+++
@@ -28,11 +28,10 @@
self.assertEqual(storage.get_unique(span), 2)
def test_tracker_minute(self):
- with hiro.Timeline().freeze() as timeline:
- span = Minute(datetime.datetime.now(), ["minute_span"])
- storage = RedisStorage(self.redis)
- storage.track(s... |
b6663ab3ee1791d9b1fd3aee24bf0509a4cebe84 | tests/test_youtube_cache.py | tests/test_youtube_cache.py | import os
import pytest
from ricecooker.utils.youtube_cache import YouTubeVideoCache
""" *********** YouTube Cache FIXTURES *********** """
@pytest.fixture
def youtube_video_cache():
cache_dir = os.path.join('tests', 'testcontent', 'youtubecache')
assert os.path.isdir(cache_dir), 'Incorrect directory path... | import os
import pytest
from ricecooker.utils.youtube_cache import YouTubeVideoCache, YouTubePlaylistCache
""" *********** YouTube Cache FIXTURES *********** """
@pytest.fixture
def youtube_video_cache():
cache_dir = os.path.join('tests', 'testcontent', 'youtubecache')
assert os.path.isdir(cache_dir), 'Inco... | Add test for YouTube playlist | Add test for YouTube playlist
| Python | mit | learningequality/ricecooker,learningequality/ricecooker,learningequality/ricecooker,learningequality/ricecooker | ---
+++
@@ -1,8 +1,7 @@
import os
import pytest
-from ricecooker.utils.youtube_cache import YouTubeVideoCache
-
+from ricecooker.utils.youtube_cache import YouTubeVideoCache, YouTubePlaylistCache
""" *********** YouTube Cache FIXTURES *********** """
@@ -13,6 +12,11 @@
assert os.path.isdir(cache_dir), ... |
1f74b7ea4fdbcae6166477e56d1a6ccc81f6a5c8 | valohai_cli/exceptions.py | valohai_cli/exceptions.py | import click
from click import ClickException
class APIError(ClickException):
def __init__(self, response):
super(APIError, self).__init__(response.text)
self.response = response
self.request = response.request
def show(self, file=None):
click.secho('Error: %s' % self.format_m... | import click
from click import ClickException
class APIError(ClickException):
def __init__(self, response):
super(APIError, self).__init__(response.text)
self.response = response
self.request = response.request
def show(self, file=None):
click.secho('Error: %s' % self.format_m... | Make ConfigurationError also a ClickException | Make ConfigurationError also a ClickException
| Python | mit | valohai/valohai-cli | ---
+++
@@ -12,7 +12,7 @@
click.secho('Error: %s' % self.format_message(), file=file, err=True, fg='red')
-class ConfigurationError(RuntimeError):
+class ConfigurationError(ClickException, RuntimeError):
pass
|
273c7b89f02469ef1a6c53b6287412cd48881428 | matador/commands/deployment/deployment.py | matador/commands/deployment/deployment.py | import logging
import subprocess
import re
def substitute_keywords(text, repo_folder, commit):
substitutions = {
'version': commit,
'date': subprocess.check_output(
['git', '-C', repo_folder, 'show', '-s', '--format=%ci', commit],
stderr=subprocess.STDOUT),
}
new_te... | import logging
import subprocess
import re
def substitute_keywords(text, repo_folder, commit):
substitutions = {
'version': commit,
'date': subprocess.check_output(
['git', '-C', repo_folder, 'show', '-s', '--format=%ci', commit],
stderr=subprocess.STDOUT),
}
new_te... | Add splitlines method to substitute_keywords | Add splitlines method to substitute_keywords
| Python | mit | Empiria/matador | ---
+++
@@ -10,8 +10,8 @@
['git', '-C', repo_folder, 'show', '-s', '--format=%ci', commit],
stderr=subprocess.STDOUT),
}
- new_text = None
- for line in text:
+ new_text = ''
+ for line in text.splitlines(keepends=True):
for key, value in substitutions.items():
... |
5a27b1ff443db49a9c70cb6980653f615cca1b33 | meetup_facebook_bot/messenger/message_validators.py | meetup_facebook_bot/messenger/message_validators.py | def is_quick_button(messaging_event):
if 'message' not in messaging_event:
return False
if 'quick_reply' not in messaging_event['message']:
return False
return True
def is_talk_ask_command(messaging_event):
if 'postback' not in messaging_event:
return False
return 'ask talk... | def is_quick_button(messaging_event):
if 'message' not in messaging_event:
return False
if 'quick_reply' not in messaging_event['message']:
return False
return True
def is_talk_ask_command(messaging_event):
if 'postback' not in messaging_event:
return False
return 'ask talk... | Fix bug in like validator | Fix bug in like validator
| Python | mit | Stark-Mountain/meetup-facebook-bot,Stark-Mountain/meetup-facebook-bot | ---
+++
@@ -25,9 +25,9 @@
def is_talk_like_command(messaging_event):
- if 'postback' not in messaging_event:
+ if not is_quick_button(messaging_event):
return False
- return 'like talk' in messaging_event['postback']['payload']
+ return 'like talk' in messaging_event['message']['quick_reply'... |
fdfeb16f0ae6cdad7eaf223cf6b6dbd7586e63ec | tc_purger/handlers/purger.py | tc_purger/handlers/purger.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015, thumbor-community, Wikimedia Foundation
# Use of this source code is governed by the MIT license that can be
# found in the LICENSE file.
import urllib
from tornado import gen
from thumbor.handlers.imaging import ImagingHandler
class UrlPurgerHandler(ImagingHandler):
... | # -*- coding: utf-8 -*-
# Copyright (c) 2015, thumbor-community, Wikimedia Foundation
# Use of this source code is governed by the MIT license that can be
# found in the LICENSE file.
import urllib
from tornado import gen
from thumbor.handlers.imaging import ImagingHandler
class UrlPurgerHandler(ImagingHandler):
... | Purge should always be attempted | Purge should always be attempted
Since the original is very volatile (in memcache), its absence shouldn't
prevent the thumbnails from being purged.
Furthermore, knowing whether the item was there beforehand isn't
very useful.
Change-Id: I014df0bce00983031b9dec9d48126c25b1688a77
| Python | mit | wikimedia/thumbor-purger | ---
+++
@@ -24,16 +24,9 @@
def get(self, **kw):
imageurl = urllib.quote(kw['image'].encode('utf8'))
- exists = yield gen.maybe_future(
- self.context.modules.storage.exists(imageurl)
- )
-
- if exists:
- self.context.modules.storage.remove(imageurl)
- ... |
d0e625ff77ed905b1b120568c87ca32fa92c0020 | teknologr/members/lookups.py | teknologr/members/lookups.py | from ajax_select import register, LookupChannel
from members.models import *
from django.utils.html import escape
@register('member')
class MemberLookup(LookupChannel):
model = Member
def get_query(self, q, request):
from django.db.models import Q
args = []
for word in q.split()... | from ajax_select import register, LookupChannel
from members.models import *
from django.utils.html import escape
@register('member')
class MemberLookup(LookupChannel):
model = Member
def get_query(self, q, request):
from django.db.models import Q
args = []
for word in q.split()... | Refactor AJAX search to use member model methods | Refactor AJAX search to use member model methods
| Python | mit | Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io,Teknologforeningen/teknologr.io | ---
+++
@@ -19,19 +19,19 @@
return [] # No words in query (only spaces?)
- return Member.objects.filter(*args)
+ return Member.objects.filter(*args).order_by('surname', 'given_names')[:10]
def get_result(self, obj):
""" result is the simple text that is the completion of... |
b78a79da5753f2c379501daa921fc47d26350dc5 | datapackage_pipelines_fiscal/processors/update_model_in_registry.py | datapackage_pipelines_fiscal/processors/update_model_in_registry.py | import os
import copy
from datapackage_pipelines.wrapper import process
from os_package_registry import PackageRegistry
ES_ADDRESS = os.environ.get('ELASTICSEARCH_ADDRESS')
def modify_datapackage(dp, parameters, *_):
dataset_id = parameters['dataset-id']
loaded = parameters.get('loaded')
datapackage_url... | import os
import copy
from datapackage_pipelines.wrapper import process
from os_package_registry import PackageRegistry
ES_ADDRESS = os.environ.get('ELASTICSEARCH_ADDRESS')
def modify_datapackage(dp, parameters, *_):
dataset_id = parameters['dataset-id']
loaded = parameters.get('loaded')
datapackage_url... | Change where we're saving the datapackage | Change where we're saving the datapackage
| Python | mit | openspending/datapackage-pipelines-fiscal | ---
+++
@@ -13,17 +13,15 @@
datapackage_url = parameters.get('datapackage-url')
if ES_ADDRESS:
registry = PackageRegistry(ES_ADDRESS)
+ datapackage = copy.deepcopy(dp)
params = {}
- if 'babbageModel' in dp:
- model = dp['babbageModel']
- datapackage = co... |
b4e92b84c275568041a4a9771a03ee0b9bb3fc48 | visram/tests/test_visram.py | visram/tests/test_visram.py | """For testing"""
import visram.chart
import unittest
class TestVisram(unittest.TestCase):
def _test_chart_type(self, chart_type):
fig, axes, chart_type = visram.chart.create_chart(
chart_type, 'spectral')
# output chart type should be the same as the input
self.assertEqual(c... | """For testing"""
import visram.chart
import unittest
class TestVisram(unittest.TestCase):
def _test_chart_type(self, chart_type):
fig, axes, result_chart_type = visram.chart.create_chart(
chart_type, 'spectral')
# output chart type should be the same as the input
self.assert... | Fix test to properly compare chart types | Fix test to properly compare chart types
A variable was being compared to itself
| Python | mit | Spferical/visram | ---
+++
@@ -6,11 +6,11 @@
class TestVisram(unittest.TestCase):
def _test_chart_type(self, chart_type):
- fig, axes, chart_type = visram.chart.create_chart(
+ fig, axes, result_chart_type = visram.chart.create_chart(
chart_type, 'spectral')
# output chart type should be th... |
4903afcec3d22d046c39a5b565366dc13472c6fd | zosimus/chartchemy/utils.py | zosimus/chartchemy/utils.py | import simplejson
from django.utils.html import escape
def render_highcharts_options(render_to, categories, series, title, x_axis_title, y_axis_title, series_name):
"""Accepts the parameters to render a chart and returns a JSON serialized Highcharts options object."""
# Escape all the character strings to ma... | import simplejson
from django.utils.html import escape
def render_highcharts_options(render_to, categories, series, title, x_axis_title, y_axis_title, series_name):
"""Accepts the parameters to render a chart and returns a JSON serialized Highcharts options object."""
# Escape all the character strings to ma... | Fix unicode error in series | Fix unicode error in series | Python | bsd-2-clause | pgollakota/zosimus,pgollakota/zosimus | ---
+++
@@ -6,12 +6,12 @@
"""Accepts the parameters to render a chart and returns a JSON serialized Highcharts options object."""
# Escape all the character strings to make them HTML safe.
- render_to = escape(render_to) if render_to else render_to
- title = escape(title) if title else title
- x_... |
f1bdcde329b5b03e453f193720066914c908d46d | api/schemas.py | api/schemas.py | import marshmallow
class StorySchema(marshmallow.Schema):
id = marshmallow.fields.Int(dump_only=True)
title = marshmallow.fields.Str(required=True)
created = marshmallow.fields.DateTime(dump_only=True)
event_time = marshmallow.fields.DateTime(allow_none=True)
location = marshmallow.fields.Str()
... | import marshmallow
class StorySchema(marshmallow.Schema):
id = marshmallow.fields.Int(dump_only=True)
title = marshmallow.fields.Str(required=True)
created = marshmallow.fields.DateTime(dump_only=True)
event_time = marshmallow.fields.DateTime(allow_none=True)
location = marshmallow.fields.Str(allo... | Allow story location and section to be null | Allow story location and section to be null
| Python | mit | thepoly/Pipeline,thepoly/Pipeline,thepoly/Pipeline,thepoly/Pipeline,thepoly/Pipeline | ---
+++
@@ -6,8 +6,8 @@
title = marshmallow.fields.Str(required=True)
created = marshmallow.fields.DateTime(dump_only=True)
event_time = marshmallow.fields.DateTime(allow_none=True)
- location = marshmallow.fields.Str()
- section = marshmallow.fields.Str()
+ location = marshmallow.fields.Str(a... |
9aa4957392249ed43fd061f9efb88b5821e19a67 | swh/web/ui/service.py | swh/web/ui/service.py | # Copyright (C) 2015 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
from swh.web.ui import main
from swh.web.ui import query
def lookup_ha... | # Copyright (C) 2015 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
from swh.web.ui import main
from swh.web.ui import query
def lookup_ha... | Refactor following storage's api backend change | Refactor following storage's api backend change
| Python | agpl-3.0 | SoftwareHeritage/swh-web-ui,SoftwareHeritage/swh-web-ui,SoftwareHeritage/swh-web-ui | ---
+++
@@ -22,7 +22,7 @@
"""
hash = query.categorize_hash(q)
if hash != {}:
- present = main.storage().content_find(hash)
+ present = main.storage().content_exist(hash)
return 'Found!' if present else 'Not Found'
return """This is not a hash.
Hint: hexadecimal string with ... |
962bbd745569600a9cfff5d5ee70f03a05a24e26 | laundry/status/models.py | laundry/status/models.py | from django.db import models
class Query(models.Model):
query_text = models.CharField(max_length=200)
def __unicode__(self):
return u'%s' % (self.query_text)
class Response(models.Model):
query = models.ForeignKey(Query)
machine_type = models.CharField(max_length=200)
machine_in_use = mode... | from django.db import models
class Query(models.Model):
query_text = models.CharField(max_length=200)
def __unicode__(self):
return u'%s' % (self.query_text)
class Response(models.Model):
query = models.ForeignKey(Query)
machine_type = models.CharField(max_length=200)
machine_in_use = mode... | Fix __unicode__() method in Response | Fix __unicode__() method in Response
| Python | agpl-3.0 | justathoughtor2/psu-hn-laundry,justathoughtor2/psu-hn-laundry,justathoughtor2/psu-hn-laundry | ---
+++
@@ -10,4 +10,4 @@
machine_type = models.CharField(max_length=200)
machine_in_use = models.IntegerField(default=-1)
def __unicode__(self):
- return u'%s' % (self.response_text)
+ return u'%s' % (self.machine_type) |
4e4262f3d9cde4394d08681c517fcec4e2e9a336 | shellpython/tests/test_helpers.py | shellpython/tests/test_helpers.py | import unittest
import tempfile
import os
from shellpython.helpers import Dir
class TestDirectory(unittest.TestCase):
def test_relative_dirs(self):
cur_dir = os.path.split(__file__)[0]
with Dir(os.path.join(cur_dir, 'data')):
self.assertEqual(os.path.join(cur_dir, 'data'), os.getcwd(... | import unittest
import tempfile
import os
from os import path
from shellpython.helpers import Dir
class TestDirectory(unittest.TestCase):
def test_relative_dirs(self):
cur_dir = path.dirname(path.abspath(__file__))
with Dir(path.join(cur_dir, 'data')):
self.assertEqual(path.join(cur_... | Fix directory tests, __file__ may return relative path and now it is taken into consideration | Fix directory tests, __file__ may return relative path and now it is
taken into consideration
| Python | bsd-3-clause | lamerman/shellpy | ---
+++
@@ -1,18 +1,19 @@
import unittest
import tempfile
import os
+from os import path
from shellpython.helpers import Dir
class TestDirectory(unittest.TestCase):
def test_relative_dirs(self):
- cur_dir = os.path.split(__file__)[0]
+ cur_dir = path.dirname(path.abspath(__file__))
- ... |
f1266219af530d1cc65019e7b7d40367c3daa024 | observatory/emaillist/methods.py | observatory/emaillist/methods.py | from django.core.mail import EmailMessage
from emaillist.models import EmailExclusion
def send_mail(subject, body, from_email, recipient_list, fail_silently=False):
to = [addr for addr in recipient_list if not EmailExclusion.excluded(addr)]
for addr in to:
#For now use default email body with an unsu... | from django.core.mail import EmailMessage
from emaillist.models import EmailExclusion
from django.core.urlresolvers import reverse
def send_mail(subject, body, from_email, recipient_list, fail_silently=False):
to = [addr for addr in recipient_list if not EmailExclusion.excluded(addr)]
#Doing a separate email ... | Update format to produce a valid link | Update format to produce a valid link
| Python | isc | rcos/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory,rcos/Observatory | ---
+++
@@ -1,13 +1,15 @@
from django.core.mail import EmailMessage
from emaillist.models import EmailExclusion
+from django.core.urlresolvers import reverse
def send_mail(subject, body, from_email, recipient_list, fail_silently=False):
to = [addr for addr in recipient_list if not EmailExclusion.excluded(ad... |
049ec8a07aeb2344b7617ab5eb039c61f52fec45 | Pig-Latin/pig_latin.py | Pig-Latin/pig_latin.py | class Pig_latin(object):
vowels = ["a", "e" , "i", "o", "u", "A", "E", "I", "O", "U"]
def __init__(self, sentence):
self.sentence = sentence
print self.convert_sentence()
def convert_sentence(self):
new_sentence = self.sentence.split(" ")
converted_sentence = []
for word in new_sentence:
... | class Pig_latin(object):
vowels = ["a", "e" , "i", "o", "u", "A", "E", "I", "O", "U"]
def __init__(self):
self.sentence = raw_input("Enter a sentence to be converted into pig latin: ")
print self.convert_sentence()
while True:
play_again = raw_input("Do you want to play again? Type yes or no ").... | Add user functionality to Pig Latin class | Add user functionality to Pig Latin class
| Python | mit | Bigless27/Python-Projects | ---
+++
@@ -1,9 +1,21 @@
class Pig_latin(object):
vowels = ["a", "e" , "i", "o", "u", "A", "E", "I", "O", "U"]
- def __init__(self, sentence):
- self.sentence = sentence
+ def __init__(self):
+ self.sentence = raw_input("Enter a sentence to be converted into pig latin: ")
print self.convert_sentenc... |
297253b3cbeb91f29f8a51f7108f22d0b9c8cfb9 | app.py | app.py | """ app.py """
from flask import Flask, render_template
import requests
app = Flask(__name__)
def get_time():
response = requests.get('http://localhouse:3001/time')
return response.json().get('datetime')
def get_user():
response = requests.get('http://localhost:3002/user')
return response.json().... | """ app.py """
from flask import Flask, render_template
import requests
app = Flask(__name__)
def get_time():
try:
response = requests.get('http://localhouse:3001/time')
except requests.exceptions.ConnectionError:
return 'Unavailable'
return response.json().get('datetime')
def get_use... | Update get_time to handle connection errors. | Update get_time to handle connection errors.
| Python | mit | danriti/short-circuit,danriti/short-circuit | ---
+++
@@ -8,7 +8,10 @@
def get_time():
- response = requests.get('http://localhouse:3001/time')
+ try:
+ response = requests.get('http://localhouse:3001/time')
+ except requests.exceptions.ConnectionError:
+ return 'Unavailable'
return response.json().get('datetime')
|
50de60d8c1fe196ea18369d95ab328f9ef709159 | tools/pdtools/pdtools/devices/camera.py | tools/pdtools/pdtools/devices/camera.py | import base64
import cStringIO
import requests
class Camera(object):
def __init__(self, host):
self.host = host
def get_image(self):
"""
Get an image from the camera.
Returns image data as a StringIO object.
"""
url = "http://{}/image.jpg".format(self.host)
... | import base64
import requests
import six
class Camera(object):
def __init__(self, host):
self.host = host
def get_image(self):
"""
Get an image from the camera.
Returns image data as a BytesIO/StringIO object.
"""
url = "http://{}/image.jpg".format(self.host)... | Use six.BytesIO for Python3 compatibility | Use six.BytesIO for Python3 compatibility
| Python | apache-2.0 | ParadropLabs/Paradrop,ParadropLabs/Paradrop,ParadropLabs/Paradrop | ---
+++
@@ -1,7 +1,7 @@
import base64
-import cStringIO
import requests
+import six
class Camera(object):
@@ -12,7 +12,7 @@
"""
Get an image from the camera.
- Returns image data as a StringIO object.
+ Returns image data as a BytesIO/StringIO object.
"""
u... |
047351704c4cd4a3a0714f4e839f96bbc6c125bf | scripts/slave/chromium/test_mini_installer_wrapper.py | scripts/slave/chromium/test_mini_installer_wrapper.py | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Wrapper script for src/chrome/test/mini_installer/test_installer.py.
"""
import optparse
import os
import sys
from slave import bu... | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Wrapper script for src/chrome/test/mini_installer/test_installer.py.
"""
import optparse
import os
import sys
from slave import bu... | Update mini_installer test wrapper script. | Update mini_installer test wrapper script.
This tracks changes made to the script in r286837.
BUG=264859,399511
R=robertshield@chromium.org
Review URL: https://codereview.chromium.org/437593008
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@286999 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | eunchong/build,eunchong/build,eunchong/build,eunchong/build | ---
+++
@@ -26,7 +26,8 @@
return chromium_utils.RunCommand([
sys.executable,
os.path.join(mini_installer_dir, 'test_installer.py'),
- mini_installer_tests_config,
+ '-v',
+ '--config', mini_installer_tests_config,
'--build-dir', build_directory.GetBuildOutputDirectory(),
... |
c2792efbb7c3b74c18ffede21b53adc42d887423 | social_website_django_angular/social_website_django_angular/urls.py | social_website_django_angular/social_website_django_angular/urls.py | """social_website_django_angular URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home,... | """social_website_django_angular URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home,... | Add login endpoint to URLs | Add login endpoint to URLs
| Python | mit | tomaszzacharczuk/social-website-django-angular,tomaszzacharczuk/social-website-django-angular,tomaszzacharczuk/social-website-django-angular | ---
+++
@@ -19,7 +19,7 @@
from rest_framework_nested import routers
from social_website_django_angular.views import IndexView
-from authentication.views import AccountViewSet
+from authentication.views import AccountViewSet, LoginView
router = routers.SimpleRouter()
router.register(r'accounts', AccountViewSet... |
9616ba8659aab6b60d95ea7e07699e258fb436e6 | openprovider/modules/__init__.py | openprovider/modules/__init__.py | # coding=utf-8
import lxml
E = lxml.objectify.ElementMaker(annotate=False)
from openprovider.modules import customer
from openprovider.modules import domain
from openprovider.modules import extension
from openprovider.modules import financial
from openprovider.modules import nameserver
from openprovider.modules impo... | # coding=utf-8
import lxml
E = lxml.objectify.ElementMaker(annotate=False)
def OE(element, value, transform=lambda x: x):
"""
Create an Optional Element.
Returns an Element as ElementMaker would, unless value is None. Optionally the value can be
transformed through a function.
>>> OE('elem', N... | Implement an Optional Element function | Implement an Optional Element function
| Python | mit | AntagonistHQ/openprovider.py | ---
+++
@@ -3,6 +3,26 @@
import lxml
E = lxml.objectify.ElementMaker(annotate=False)
+
+
+def OE(element, value, transform=lambda x: x):
+ """
+ Create an Optional Element.
+
+ Returns an Element as ElementMaker would, unless value is None. Optionally the value can be
+ transformed through a function.... |
3b5094b86414a70460a54600d1cf7959fffea240 | nisl/io/tests/test_nifti_masker.py | nisl/io/tests/test_nifti_masker.py | """
Test the nifti_masker module
"""
# Author: Gael Varoquaux
# License: simplified BSD
import numpy as np
from nibabel import Nifti1Image
from ..nifti_masker import NiftiMasker
def test_auto_mask():
data = np.ones((9, 9, 9))
data[3:-3, 3:-3, 3:-3] = 10
img = Nifti1Image(data, np.eye(4))
masker = N... | """
Test the nifti_masker module
"""
# Author: Gael Varoquaux
# License: simplified BSD
from nose.tools import assert_true, assert_false
import numpy as np
from nibabel import Nifti1Image
from ..nifti_masker import NiftiMasker
def test_auto_mask():
data = np.ones((9, 9, 9))
data[3:-3, 3:-3, 3:-3] = 10
i... | Add test for NaN input values | Add test for NaN input values
| Python | bsd-3-clause | abenicho/isvr | ---
+++
@@ -4,7 +4,7 @@
# Author: Gael Varoquaux
# License: simplified BSD
-
+from nose.tools import assert_true, assert_false
import numpy as np
from nibabel import Nifti1Image
@@ -18,3 +18,23 @@
masker = NiftiMasker()
masker.fit(img)
+def test_nan():
+ data = np.ones((9, 9, 9))
+ data[0] =... |
a9796c68c24c3e8a059c54aad6eee2d0b61a9041 | test/psyco.py | test/psyco.py | import _psyco
import sys
ticks = 0
depth = 10
funcs = {}
def f(frame, event, arg):
if event != 'call': return
c = frame.f_code.co_code
fn = frame.f_code.co_name
g = frame.f_globals
if not funcs.has_key(c):
funcs[c] = 1
if funcs[c] != None:
funcs[c] = funcs[c] + 1
if fu... | import _psyco
_psyco.selective(1) # Argument is number of invocations before rebinding
# import sys
# ticks = 0
# depth = 10
# funcs = {}
# def f(frame, event, arg):
# if event != 'call': return
# print type(frame.f_globals)
# c = frame.f_code.co_code
# fn = frame.f_code.co_name
# g = ... | Use c-version of the selective compilation | Use c-version of the selective compilation
| Python | mit | tonysimpson/Ni,tonysimpson/Ni,tonysimpson/Ni,tonysimpson/Ni,tonysimpson/Ni | ---
+++
@@ -1,22 +1,26 @@
import _psyco
-import sys
+_psyco.selective(1) # Argument is number of invocations before rebinding
-ticks = 0
-depth = 10
-funcs = {}
+# import sys
-def f(frame, event, arg):
- if event != 'call': return
- c = frame.f_code.co_code
- fn = frame.f_code.co_name
- g = frame.f... |
a9f9fc75411aededcb768adf32cc26efd64fe976 | sevenbridges/models/compound/tasks/__init__.py | sevenbridges/models/compound/tasks/__init__.py | from sevenbridges.models.file import File
def map_input_output(item, api):
"""
Maps item to appropriate sevebridges object.
:param item: Input/Output value.
:param api: Api instance.
:return: Mapped object.
"""
if isinstance(item, list):
return [map_input_output(it, api) for it in ... | from sevenbridges.models.enums import FileApiFormats
from sevenbridges.models.file import File
def map_input_output(item, api):
"""
Maps item to appropriate sevebridges object.
:param item: Input/Output value.
:param api: Api instance.
:return: Mapped object.
"""
if isinstance(item, list):... | Add support for cwl1 task outputs so the name is preloaded. Add preloaded file type for task outputs. | Add support for cwl1 task outputs so the name is preloaded.
Add preloaded file type for task outputs.
| Python | apache-2.0 | sbg/sevenbridges-python | ---
+++
@@ -1,3 +1,4 @@
+from sevenbridges.models.enums import FileApiFormats
from sevenbridges.models.file import File
@@ -12,14 +13,30 @@
return [map_input_output(it, api) for it in item]
elif isinstance(item, dict) and 'class' in item:
- if item['class'].lower() in ('file', 'directory')... |
72382916560d275a0bb456ab4d5bd0e63e95cff4 | css_updater/git/webhook/handler.py | css_updater/git/webhook/handler.py | """handles webhook"""
from typing import Any, List, Dict
class Handler(object):
"""wraps webhook data"""
def __init__(self: Handler, data: Dict[str, Any]) -> None:
self.data: Dict[str, Any] = data
@property
def head_commit(self: Handler) -> Dict[str, Any]:
"""returns head_commit for ... | """handles webhook"""
from typing import Any, List, Dict
class Handler(object):
"""wraps webhook data"""
def __init__(self: Handler, data: Dict[str, Any]) -> None:
self.data: Dict[str, Any] = data
@property
def head_commit(self: Handler) -> Dict[str, Any]:
"""returns head_commit for ... | Add function to return URL | Add function to return URL
| Python | mit | neoliberal/css-updater | ---
+++
@@ -42,3 +42,8 @@
def branch(self: Handler) -> str:
"""returns the branch the commit was pushed to"""
return self.data["ref"].split('/')[-1]
+
+ @property
+ def url(self: Handler) -> str:
+ """returns url to github repository"""
+ return self.data["repository"]["html... |
e3c413e9642a026dba20c91ae8865c4e193ada5b | tests/create_service_test.py | tests/create_service_test.py | from mock import Mock
import testify as T
import create_service
class SrvReaderWriterTestCase(T.TestCase):
@T.setup
def init_service(self):
paths = create_service.paths.SrvPathBuilder("fake_srvpathbuilder")
self.srw = create_service.SrvReaderWriter(paths)
def test_append_raises_when_file... | from mock import Mock
import testify as T
import create_service
class SrvReaderWriterTestCase(T.TestCase):
"""I bailed out of this test, but I'll leave this here for now as an
example of how to interact with the Srv* classes."""
@T.setup
def init_service(self):
paths = create_service.paths.Sr... | Remove an aborted test and add a docstring explaining why this test-less testcase is still here. | Remove an aborted test and add a docstring explaining why this test-less testcase is still here.
| Python | apache-2.0 | Yelp/paasta,Yelp/paasta,somic/paasta,gstarnberger/paasta,somic/paasta,gstarnberger/paasta | ---
+++
@@ -5,13 +5,12 @@
class SrvReaderWriterTestCase(T.TestCase):
+ """I bailed out of this test, but I'll leave this here for now as an
+ example of how to interact with the Srv* classes."""
@T.setup
def init_service(self):
paths = create_service.paths.SrvPathBuilder("fake_srvpathbui... |
fa7856c152c0f9866f4a3befd507bb7693c350df | runserver.py | runserver.py | #!/usr/bin/python
from optparse import OptionParser
from sys import stderr
import pytz
from werkzeug import script
from werkzeug.script import make_runserver
from firmant.wsgi import Application
from firmant.utils import mod_to_dict
from firmant.utils import get_module
parser = OptionParser()
parser.add_option('-s', ... | #!/usr/bin/python
from optparse import OptionParser
from sys import stderr
import pytz
from werkzeug import script
from werkzeug.script import make_runserver
from firmant.wsgi import Application
from firmant.utils import mod_to_dict
from firmant.utils import get_module
parser = OptionParser()
parser.add_option('-s', ... | Disable reloader. It messes with plugins. | Disable reloader. It messes with plugins.
| Python | bsd-3-clause | rescrv/firmant | ---
+++
@@ -30,7 +30,7 @@
def make_app():
return Application(settings)
-action_runserver = script.make_runserver(make_app, use_reloader=True)
+action_runserver = script.make_runserver(make_app, use_reloader=False)
if __name__ == '__main__':
print 'Starting local WSGI Server' |
a0eaad7d4d4426c9d497409a6699929c71afeea7 | opps/views/generic/detail.py | opps/views/generic/detail.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.core.exceptions import ImproperlyConfigured
from django.views.generic.detail import DetailView as DjangoDetailView
from django.contrib.sites.models import get_current_site
from django.utils import timezone
from opps.views.generic.base import View
class Detail... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.views.generic.detail import DetailView as DjangoDetailView
from django.contrib.sites.models import get_current_site
from django.utils import timezone
from opps.views.generic.base import View
class DetailView(View, DjangoDetailView):
def get_template_name... | Fix opps template engine (name list) on DetailView | Fix opps template engine (name list) on DetailView
| Python | mit | jeanmask/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,opps/opps,opps/opps,YACOWS/opps,opps/opps,opps/opps,williamroot/opps,williamroot/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,YACOWS/opps,williamroot/opps | ---
+++
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-from django.core.exceptions import ImproperlyConfigured
from django.views.generic.detail import DetailView as DjangoDetailView
from django.contrib.sites.models import get_current_site
from django.utils import timezone
@@ -11,19 +10,19 @@
cla... |
9f69c886a1b5d75444e2efcfa29ce636d000b0a0 | microbower/__init__.py | microbower/__init__.py |
from subprocess import check_call
import urllib
import json
import os
import os.path
def install():
with open('.bowerrc') as f:
bowerrc = json.load(f)
with open('bower.json') as f:
bower_json = json.load(f)
registry = 'https://bower.herokuapp.com'
topdir = os.path.abspath(os.curdir)
... |
from subprocess import check_call
import urllib
import json
import os
import os.path
def install():
with open('.bowerrc') as f:
bowerrc = json.load(f)
with open('bower.json') as f:
bower_json = json.load(f)
registry = 'https://bower.herokuapp.com'
topdir = os.path.abspath(os.curdir)
... | Make the destination directory if it does not exist | Make the destination directory if it does not exist
| Python | isc | zenhack/microbower | ---
+++
@@ -17,6 +17,8 @@
for pkg in bower_json['dependencies'].keys():
req = urllib.urlopen('%s/packages/%s' % (registry, pkg))
info = json.load(req)
+ if not os.path.isdir(bowerrc['directory']):
+ os.makedirs(bowerrc['directory'])
os.chdir(bowerrc['directory'])
... |
28afd50b0243cedf0796b57600bfbb5845623843 | warehouse/database/mixins.py | warehouse/database/mixins.py | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from sqlalchemy.dialects import postgresql as pg
from sqlalchemy.schema import FetchedValue
from sqlalchemy.sql import func
from sqlalchemy.sql.expression import text
from warehouse import db
from warehouse.... | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from sqlalchemy.dialects import postgresql as pg
from sqlalchemy.schema import FetchedValue
from sqlalchemy.sql import func
from sqlalchemy.sql.expression import text
from warehouse import db
from warehouse.... | Make the FetchedValue marked as for_update | Make the FetchedValue marked as for_update
SQLAlchemy is currently unable to determine between a FetchedValue
inside of a server_default and one inside of a server_onupdate
causing the one in server_onupdate to override the func.now()
in server_default.
See: http://www.sqlalchemy.org/trac/ticket/2631
| Python | bsd-2-clause | davidfischer/warehouse | ---
+++
@@ -40,4 +40,4 @@
created = db.Column(db.DateTime, nullable=False, server_default=func.now())
modified = db.Column(db.DateTime, nullable=False,
server_default=func.now(),
- server_onupdate=FetchedValue())
+ server_onupdate=Fet... |
059125f04430dd525205fe9b4331ac87c5556d8c | thumbor_cloud_storage/loaders/cloud_storage_loader.py | thumbor_cloud_storage/loaders/cloud_storage_loader.py | from tornado.concurrent import return_future
from gcloud import storage
from collections import defaultdict
buckets = defaultdict(dict)
@return_future
def load(context, path, callback):
bucket_id = context.config.get("CLOUD_STORAGE_BUCKET_ID")
project_id = context.config.get("CLOUD_STORAGE_PROJECT_ID")
b... | from tornado.concurrent import return_future
from gcloud import storage
from collections import defaultdict
buckets = defaultdict(dict)
@return_future
def load(context, path, callback):
bucket_id = context.config.get("CLOUD_STORAGE_BUCKET_ID")
project_id = context.config.get("CLOUD_STORAGE_PROJECT_ID")
b... | Return None on missing object | Return None on missing object
| Python | mit | Superbalist/thumbor-cloud-storage | ---
+++
@@ -15,4 +15,7 @@
buckets[project_id][bucket_id] = bucket
blob = bucket.get_blob(path)
- callback(blob.download_as_string())
+ if blob:
+ callback(blob.download_as_string())
+ else:
+ callback(blob) |
5497d37337ae16b31b3cc9eba39d143c7a6adeca | hr_employee_service_contract/migrations/12.0.1.0.0/pre-migration.py | hr_employee_service_contract/migrations/12.0.1.0.0/pre-migration.py | # Copyright 2019 Eficent <http://www.eficent.com>
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
cr = env.cr
if openupgrade.column_exists(cr, 'hr_employee'... | # Copyright 2019 Eficent <http://www.eficent.com>
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
cr = env.cr
if openupgrade.column_exists(cr, 'hr_employee'... | Fix bad syntax in query | Fix bad syntax in query
the query is not correct because of semicolon
| Python | agpl-3.0 | OCA/hr,OCA/hr,OCA/hr | ---
+++
@@ -11,7 +11,7 @@
openupgrade.logged_query(
cr, """
UPDATE hr_employee
- SET service_hire_date = initial_employment_date;
+ SET service_hire_date = initial_employment_date
WHERE initial_employment_date IS NOT NULL;
"""
... |
0d261edf436fac06d8a8bd35fba34e1773aee460 | alexandria/__init__.py | alexandria/__init__.py | import logging
log = logging.getLogger(__name__)
from pyramid.config import Configurator
from sqlalchemy import engine_from_config
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
engine = engine_from_config(settings, 'sqlalchemy.')
DBSession.configure(b... | import logging
log = logging.getLogger(__name__)
from pyramid.config import Configurator
from sqlalchemy import engine_from_config
required_settings = [
'pyramid.secret.session',
'pyramid.secret.auth',
]
def main(global_config, **settings):
""" This function returns a Pyramid WSGI applic... | Check for some required settings | Check for some required settings
| Python | isc | cdunklau/alexandria,bertjwregeer/alexandria,cdunklau/alexandria,cdunklau/alexandria,bertjwregeer/alexandria | ---
+++
@@ -5,6 +5,10 @@
from sqlalchemy import engine_from_config
+required_settings = [
+ 'pyramid.secret.session',
+ 'pyramid.secret.auth',
+ ]
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
@@ -13,8 +17,15 @@
DBSession.configure(bi... |
1265221d0300ff214cef12dc244f745c7f2ec316 | tests/core/ast_transforms/test_basic_sanity.py | tests/core/ast_transforms/test_basic_sanity.py |
from fastats.core.decorator import fs
from tests import cube
def child(x):
return x * x
@fs
def parent(a):
b = 2 * a
result = child(b)
return result
def quad(x):
return cube(x) * x
def test_child_transform_square_to_cube_execution():
original = parent(2)
assert original == 16
r... |
from fastats.core.decorator import fs
from tests import cube
def child(x):
return x * x
@fs
def parent(a):
b = 2 * a
result = child(b)
return result
def quad(x):
return cube(x) * x
def zero(x):
return 0
def child_faker(x):
return 42
child_faker.__name__ = 'child'
def test_chil... | Add a failing, coverage-increasing test | Add a failing, coverage-increasing test
| Python | mit | dwillmer/fastats,fastats/fastats | ---
+++
@@ -16,6 +16,17 @@
def quad(x):
return cube(x) * x
+
+
+def zero(x):
+ return 0
+
+
+def child_faker(x):
+ return 42
+
+
+child_faker.__name__ = 'child'
def test_child_transform_square_to_cube_execution():
@@ -43,6 +54,35 @@
assert final == 36
+def test_child_transform_square_to_ze... |
fbe3644bf58f29150ada009951691425571429d4 | moocng/eco_api/urls.py | moocng/eco_api/urls.py | # -*- coding: utf-8 -*-
# Copyright 2012-2013 UNED
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # -*- coding: utf-8 -*-
# Copyright 2012-2013 UNED
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Fix courses by user url | Fix courses by user url
| Python | apache-2.0 | GeographicaGS/moocng,GeographicaGS/moocng,GeographicaGS/moocng,GeographicaGS/moocng | ---
+++
@@ -24,7 +24,7 @@
url(r'^heartbeat', 'heartbeat', name='heartbeat'),
- url(r'^users/(?P<id>[-\w]+)/courses', 'courses_by_users', name='heartbeat'),
+ url(r'^users/(?P<id>[-\w.]+)/courses', 'courses_by_users', name='heartbeat'),
url(r'^teachers/(?P<id>[-\w]+)/', 'teacher', name='heartbeat')... |
2a46eecd0fbd13dd03610b7bbace6cf84466f455 | mysite/search/tests.py | mysite/search/tests.py | import django.test
from search.models import Project
class NonJavascriptSearch(django.test.TestCase):
fixtures = ['bugs-for-two-projects.json']
def testSearch(self):
response = self.client.get('/search/')
for n in range(1, 11):
self.assertContains(response, 'Title #%d' % n)
... | import django.test
from search.models import Project
class NonJavascriptSearch(django.test.TestCase):
fixtures = ['bugs-for-two-projects.json']
def testSearch(self):
response = self.client.get('/search/')
for n in range(1, 11):
self.assertContains(response, 'Title #%d' % n)
... | Use the response.context to check the provided start and end | Use the response.context to check the provided start and end
| Python | agpl-3.0 | Changaco/oh-mainline,openhatch/oh-mainline,sudheesh001/oh-mainline,willingc/oh-mainline,onceuponatimeforever/oh-mainline,mzdaniel/oh-mainline,ojengwa/oh-mainline,ehashman/oh-mainline,openhatch/oh-mainline,willingc/oh-mainline,onceuponatimeforever/oh-mainline,sudheesh001/oh-mainline,SnappleCap/oh-mainline,heeraj123/oh-m... | ---
+++
@@ -11,9 +11,8 @@
self.assertContains(response, 'Description #%d' % n)
def testMatchingBugsFromMtoN(self):
- # FIXME: This should test for 1 to 10, not 0 to 10
response = self.client.get('/search/')
- self.assertContains(response, '0 to 10')
+ self.failUnlessE... |
b22b292ec2b839d611738928f41c79723146ea15 | readthedocs/core/migrations/0005_migrate-old-passwords.py | readthedocs/core/migrations/0005_migrate-old-passwords.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-11 17:28
from __future__ import unicode_literals
from django.db import migrations
def forwards_func(apps, schema_editor):
User = apps.get_model('auth', 'User')
old_password_patterns = (
'sha1$',
# RTD's production database does... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-11 17:28
from __future__ import unicode_literals
from django.db import migrations
from django.contrib.auth.hashers import make_password
def forwards_func(apps, schema_editor):
User = apps.get_model('auth', 'User')
old_password_patterns = (
... | Migrate old passwords without "set_unusable_password" | Migrate old passwords without "set_unusable_password"
| Python | mit | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | ---
+++
@@ -3,6 +3,7 @@
from __future__ import unicode_literals
from django.db import migrations
+from django.contrib.auth.hashers import make_password
def forwards_func(apps, schema_editor):
@@ -18,7 +19,7 @@
for pattern in old_password_patterns:
users = User.objects.filter(password__startswit... |
d70360601669f9e58072cd121de79896690471fd | buildlet/datastore/tests/test_inmemory.py | buildlet/datastore/tests/test_inmemory.py | import unittest
from ..inmemory import (
DataValueInMemory, DataStreamInMemory, DataStoreNestableInMemory)
from .mixintestcase import (
MixInValueTestCase, MixInStreamTestCase, MixInNestableAutoValueTestCase)
class TestDataValueInMemory(MixInValueTestCase, unittest.TestCase):
dstype = DataValueInMemory
... | import unittest
from ..inmemory import (
DataValueInMemory, DataStreamInMemory,
DataStoreNestableInMemory, DataStoreNestableInMemoryAutoValue)
from .mixintestcase import (
MixInValueTestCase, MixInStreamTestCase,
MixInNestableTestCase, MixInNestableAutoValueTestCase)
class TestDataValueInMemory(MixIn... | Fix and add tests for datastore.inmemory | Fix and add tests for datastore.inmemory
| Python | bsd-3-clause | tkf/buildlet | ---
+++
@@ -1,9 +1,11 @@
import unittest
from ..inmemory import (
- DataValueInMemory, DataStreamInMemory, DataStoreNestableInMemory)
+ DataValueInMemory, DataStreamInMemory,
+ DataStoreNestableInMemory, DataStoreNestableInMemoryAutoValue)
from .mixintestcase import (
- MixInValueTestCase, MixInStrea... |
eba8a0796242d18807e1cace97bd476386ade0aa | functions.py | functions.py | import requests
def tweets(url):
api = "http://urls.api.twitter.com/1/urls/count.json?url="
respobj = requests.get(api + url)
adict = respobj.json()
return adict["count"]
def plusses(url):
import requests
api = "https://clients6.google.com/rpc"
jobj = '''{
"method":"pos.plusones.get",
"id":"p",
... | import requests
def tweets(url):
api = "http://urls.api.twitter.com/1/urls/count.json?url="
respobj = requests.get(api + url)
adict = respobj.json()
return adict["count"]
def plusses(url):
api = "https://clients6.google.com/rpc"
jobj = '''{
"method":"pos.plusones.get",
"id":"p",
"params":{
... | Put in a try for shares function | Put in a try for shares function
| Python | mit | miklevin/pipulate,miklevin/pipulate,whofman/my-pipulate,whofman/my-pipulate,miklevin/pipulate,whofman/my-pipulate | ---
+++
@@ -7,7 +7,6 @@
return adict["count"]
def plusses(url):
- import requests
api = "https://clients6.google.com/rpc"
jobj = '''{
"method":"pos.plusones.get",
@@ -31,6 +30,9 @@
api = "http://graph.facebook.com/?id="
respobj = requests.get(api + url)
adict = respobj.json()
- return adic... |
c048b42e7eac68f0e7ab300efab5f414227c0a21 | readthedocs/tastyapi/slum.py | readthedocs/tastyapi/slum.py | import slumber
import json
import logging
from django.conf import settings
log = logging.getLogger(__name__)
USER = getattr(settings, 'SLUMBER_USERNAME', None)
PASS = getattr(settings, 'SLUMBER_PASSWORD', None)
API_HOST = getattr(settings, 'SLUMBER_API_HOST', 'http://readthedocs.org')
if USER and PASS:
log.debu... | import slumber
import json
import logging
from django.conf import settings
log = logging.getLogger(__name__)
USER = getattr(settings, 'SLUMBER_USERNAME', None)
PASS = getattr(settings, 'SLUMBER_PASSWORD', None)
API_HOST = getattr(settings, 'SLUMBER_API_HOST', 'https://readthedocs.org')
if USER and PASS:
log.deb... | Fix http->https for the API | Fix http->https for the API
| Python | mit | KamranMackey/readthedocs.org,SteveViss/readthedocs.org,dirn/readthedocs.org,agjohnson/readthedocs.org,raven47git/readthedocs.org,attakei/readthedocs-oauth,sils1297/readthedocs.org,safwanrahman/readthedocs.org,d0ugal/readthedocs.org,agjohnson/readthedocs.org,espdev/readthedocs.org,raven47git/readthedocs.org,singingwolfb... | ---
+++
@@ -8,7 +8,7 @@
USER = getattr(settings, 'SLUMBER_USERNAME', None)
PASS = getattr(settings, 'SLUMBER_PASSWORD', None)
-API_HOST = getattr(settings, 'SLUMBER_API_HOST', 'http://readthedocs.org')
+API_HOST = getattr(settings, 'SLUMBER_API_HOST', 'https://readthedocs.org')
if USER and PASS:
log.debug... |
a54be407e4b18250f24a256fe6d615f25d42a7ee | pubrunner/snakemake.py | pubrunner/snakemake.py |
import pubrunner
import os
import shlex
import subprocess
def launchSnakemake(snakeFilePath,useCluster=True,parameters={}):
globalSettings = pubrunner.getGlobalSettings()
clusterFlags = ""
if useCluster and "cluster" in globalSettings:
clusterSettings = globalSettings["cluster"]
jobs = 1
if "jobs" in globa... |
import pubrunner
import os
import shlex
import subprocess
def launchSnakemake(snakeFilePath,useCluster=True,parameters={}):
globalSettings = pubrunner.getGlobalSettings()
clusterFlags = ""
if useCluster and "cluster" in globalSettings:
clusterSettings = globalSettings["cluster"]
jobs = 1
if "jobs" in globa... | Fix for non-DRMAA cluster run | Fix for non-DRMAA cluster run
| Python | mit | jakelever/pubrunner,jakelever/pubrunner | ---
+++
@@ -18,7 +18,7 @@
if "drmaa" in clusterSettings and clusterSettings["drmaa"] == True:
clusterFlags += ' --drmaa'
elif "options" in clusterSettings:
- clusterFlags = "--cluster '%s'" % clusterSettings["options"]
+ clusterFlags += " --cluster '%s'" % clusterSettings["options"]
else:
raise R... |
2cfe6e6c9284dfffba2943a8562e38844b6ba089 | temba/campaigns/migrations/0015_campaignevent_message_new.py | temba/campaigns/migrations/0015_campaignevent_message_new.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-04-19 14:53
from __future__ import unicode_literals
import json
import temba.utils.models
from django.contrib.postgres.operations import HStoreExtension
from django.db import migrations
def populate_message_new(apps, schema_editor):
CampaignEvent = ap... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-04-19 14:53
from __future__ import unicode_literals
import json
import temba.utils.models
from django.contrib.postgres.operations import HStoreExtension
from django.db import migrations
def populate_message_new(apps, schema_editor):
CampaignEvent = ap... | Fix migration to work with flows with no base_language | Fix migration to work with flows with no base_language
| Python | agpl-3.0 | pulilab/rapidpro,pulilab/rapidpro,pulilab/rapidpro,pulilab/rapidpro,pulilab/rapidpro | ---
+++
@@ -17,7 +17,8 @@
try:
event.message_new = json.loads(event.message)
except Exception:
- event.message_new = {event.flow.base_language: event.message}
+ base_lang = event.flow.base_language or 'base'
+ event.message_new = {base_lang: event.messag... |
b2addc724a35c3859e8982ddecff180b6e2ec9df | exercises/control_movement.py | exercises/control_movement.py | """Simple exercise file where the kid must write code.
Control the LED light in the finch robot with this small exercise. The code
doesn't run as it is because a kid is supposed to complete the exercise first.
NAO will open this file in an editor.
"""
from exercises.finch.finch import Finch
from time import sleep
fi... | """Simple exercise file where the kid must write code.
Control the LED light in the finch robot with this small exercise. The code
doesn't run as it is because a kid is supposed to complete the exercise first.
NAO will open this file in an editor.
"""
from exercises.finch.finch import Finch
from time import sleep
fi... | Correct style of wheels exercise | Correct style of wheels exercise
| Python | mit | AliGhahraei/nao-classroom | ---
+++
@@ -17,15 +17,15 @@
# duration of their movement
# CODE: rueda_izquierda = 0.5, rueda_derecha = 0, tiempo = 5
-rueda_izquierda =
-rueda_derecha =
-tiempo =
+rueda_izquierda =
+rueda_derecha =
+tiempo =
###############################################################################
# Ahora pide al... |
53de65c29fe4bc3961258bb160210c32ddfaeae4 | django/website/contacts/tests/test_validators.py | django/website/contacts/tests/test_validators.py | from datetime import date
from django.test import TestCase
from django.core.exceptions import ValidationError
from contacts.validators import year_to_now
today = date.today()
this_year = today.year
class ValidatorTests(TestCase):
def test_year_to_now(self):
self.assertRaises(ValidationError, year_to_now... | from datetime import date
from django.test import TestCase
from django.core.exceptions import ValidationError
from contacts.validators import year_to_now
today = date.today()
this_year = today.year
class ValidatorTests(TestCase):
def test_year_to_now(self):
self.assertRaises(ValidationError, year_to_now... | Add test for year_to_now with non-integer values | Add test for year_to_now with non-integer values | Python | agpl-3.0 | aptivate/kashana,aptivate/alfie,aptivate/alfie,aptivate/kashana,daniell/kashana,daniell/kashana,daniell/kashana,aptivate/kashana,daniell/kashana,aptivate/alfie,aptivate/alfie,aptivate/kashana | ---
+++
@@ -18,3 +18,7 @@
self.assertIsNone(year_to_now(1900))
self.assertIsNone(year_to_now(this_year - 1))
+
+ def test_calling_year_to_now_with_non_integer_throws_value_error(self):
+ self.assertRaises(ValidationError, year_to_now, 'a')
+ self.assertRaises(ValidationError, year... |
43ca79dbd2067ba9733bf43f81b43aa048bbd900 | seaweb_project/jobs/serializers.py | seaweb_project/jobs/serializers.py | from rest_framework import serializers
from django.contrib.auth.models import User
from .models import Job, Result
class ResultSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Result
class JobSerializer(serializers.HyperlinkedModelSerializer):
owner = serializers.Field(source=... | from rest_framework import serializers
from django.contrib.auth.models import User
from .models import Job, Result
class ResultSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Result
class JobSerializer(serializers.HyperlinkedModelSerializer):
owner = serializers.Field(source=... | Implement validation for structure and topology files. | Implement validation for structure and topology
files. | Python | mit | grollins/sea-web-django | ---
+++
@@ -18,6 +18,26 @@
'iterations', 'result')
read_only_fields = ('status',)
+ def validate_structure(self, attrs, source):
+ """
+ Check that structure file is a gro file.
+ """
+ uploaded_file = attrs[source]
+ if uploaded_file.name.endswith('... |
cf7e1c52a0242814cf9e621a62414252110765a2 | feincms/content/rss/models.py | feincms/content/rss/models.py | from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
import feedparser
class RSSContent(models.Model):
link = models.URLField(_('link'))
rendered_content = models.TextField(_('Pre... | from datetime import datetime
from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
import feedparser
class RSSContent(models.Model):
link = models.URLField(_('link'))
rendered_co... | Add last_updated field to RSSContent | Add last_updated field to RSSContent
| Python | bsd-3-clause | joshuajonah/feincms,matthiask/django-content-editor,matthiask/feincms2-content,matthiask/django-content-editor,feincms/feincms,nickburlett/feincms,nickburlett/feincms,michaelkuty/feincms,feincms/feincms,pjdelport/feincms,hgrimelid/feincms,mjl/feincms,joshuajonah/feincms,mjl/feincms,hgrimelid/feincms,michaelkuty/feincms... | ---
+++
@@ -1,3 +1,5 @@
+from datetime import datetime
+
from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
@@ -9,6 +11,7 @@
class RSSContent(models.Model):
link = models.URLField(_('link'))
rendered_content = models.TextFie... |
e13c6ab9e5e14b457439cefd1ebc9de7facd6ddb | sacredboard/tests/app/test_sacredboard.py | sacredboard/tests/app/test_sacredboard.py | from unittest import TestCase
from sacredboard.app.sacredboard import Sacredboard
class TestSacredboard(TestCase):
def test_get_version(self):
assert Sacredboard.get_version() == "0.3.3"
| from unittest import TestCase
from sacredboard.app.sacredboard import Sacredboard
class TestSacredboard(TestCase):
def test_get_version(self):
assert Sacredboard.get_version() == "0.4.0"
| Increase version number to 0.4.0 - fix | Increase version number to 0.4.0 - fix
| Python | mit | chovanecm/sacredboard,chovanecm/sacredboard,chovanecm/sacredboard | ---
+++
@@ -5,4 +5,4 @@
class TestSacredboard(TestCase):
def test_get_version(self):
- assert Sacredboard.get_version() == "0.3.3"
+ assert Sacredboard.get_version() == "0.4.0" |
ac0f3c39c471efc9981382acbdb0bb8f9d1cf52e | categories/__init__.py | categories/__init__.py | __version_info__ = {
'major': 1,
'minor': 7,
'micro': 0,
'releaselevel': 'final',
'serial': 1
}
def get_version(short=False):
assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final')
vers = ["%(major)i.%(minor)i" % __version_info__, ]
if __version_info__['micro'] and not s... | __version_info__ = {
'major': 1,
'minor': 7,
'micro': 1,
'releaselevel': 'final',
'serial': 1
}
def get_version(short=False):
assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final')
vers = ["%(major)i.%(minor)i" % __version_info__, ]
if __version_info__['micro'] and not s... | Update the version to 1.7.1 | Update the version to 1.7.1
| Python | apache-2.0 | callowayproject/django-categories,callowayproject/django-categories,callowayproject/django-categories | ---
+++
@@ -1,7 +1,7 @@
__version_info__ = {
'major': 1,
'minor': 7,
- 'micro': 0,
+ 'micro': 1,
'releaselevel': 'final',
'serial': 1
} |
df9dd41cfd7140a266f41296024c4e6ba59f25ec | server/plugins/cryptstatus/cryptstatus.py | server/plugins/cryptstatus/cryptstatus.py | import requests
from collections import defaultdict
from requests.exceptions import RequestException
from django.conf import settings
from django.utils.dateparse import parse_datetime
import sal.plugin
import server.utils as utils
class CryptStatus(sal.plugin.DetailPlugin):
class Meta:
description = 'F... | import requests
from collections import defaultdict
from requests.exceptions import RequestException
from django.conf import settings
from django.utils.dateparse import parse_datetime
import sal.plugin
import server.utils as utils
class CryptStatus(sal.plugin.DetailPlugin):
description = 'FileVault Escrow Stat... | Fix missed plugin code update. | Fix missed plugin code update.
This `Meta` business is from an earlier draft.
| Python | apache-2.0 | salopensource/sal,sheagcraig/sal,sheagcraig/sal,salopensource/sal,sheagcraig/sal,salopensource/sal,sheagcraig/sal,salopensource/sal | ---
+++
@@ -11,12 +11,11 @@
class CryptStatus(sal.plugin.DetailPlugin):
- class Meta:
- description = 'FileVault Escrow Status'
+ description = 'FileVault Escrow Status'
def get_context(self, machine, **kwargs):
context = defaultdict(str)
- context['title'] = self.Meta.descrip... |
dd4c35272db9ec7161fd83fc8fb346877f9b74a7 | spyder_unittest/backend/tests/__init__.py | spyder_unittest/backend/tests/__init__.py | # -*- coding: utf-8 -*-
#
# Copyright © 2017 Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# noqa: D104
| Add copyright notice, skip docstring checks | Add copyright notice, skip docstring checks | Python | mit | jitseniesen/spyder-unittest | ---
+++
@@ -0,0 +1,7 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright © 2017 Spyder Project Contributors
+# Licensed under the terms of the MIT License
+# (see LICENSE.txt for details)
+
+# noqa: D104 | |
7a5161739b9348e577f484143e56a37f327104c6 | src/gramcore/transformations/geometric.py | src/gramcore/transformations/geometric.py | """
"""
def resize(parameters):
pass
def rotate(parameters):
pass
| """Geometric transformations on arrays. They are more useful in the context
that these arrays are in fact images.
"""
from skimage import transform
def resize(parameters):
"""Resizes input to match a certain size.
Check http://scikit-image.org/docs/dev/api/skimage.transform.html#resize
:param parameters... | Add initial resize and rotate, no tests yet | Add initial resize and rotate, no tests yet
| Python | mit | cpsaltis/pythogram-core | ---
+++
@@ -1,12 +1,37 @@
+"""Geometric transformations on arrays. They are more useful in the context
+that these arrays are in fact images.
"""
-"""
+from skimage import transform
def resize(parameters):
- pass
+ """Resizes input to match a certain size.
+
+ Check http://scikit-image.org/docs/dev/api... |
8433fe04ad1230329de2c209a8625cd4b36b63f8 | src/sentry/api/serializers/models/grouptagvalue.py | src/sentry/api/serializers/models/grouptagvalue.py | from __future__ import absolute_import
from sentry.api.serializers import Serializer, register
from sentry.models import GroupTagValue
@register(GroupTagValue)
class GroupTagValueSerializer(Serializer):
def serialize(self, obj, attrs, user):
d = {
'key': obj.key,
'value': obj.valu... | from __future__ import absolute_import
from sentry.api.serializers import Serializer, register
from sentry.models import GroupTagValue, TagValue
@register(GroupTagValue)
class GroupTagValueSerializer(Serializer):
def get_attrs(self, item_list, user):
assert len(set(i.key for i in item_list)) < 2
... | Implement labels on group tag values | Implement labels on group tag values
| Python | bsd-3-clause | gencer/sentry,drcapulet/sentry,vperron/sentry,pauloschilling/sentry,kevinlondon/sentry,ifduyue/sentry,zenefits/sentry,JamesMura/sentry,jean/sentry,fotinakis/sentry,gencer/sentry,ngonzalvez/sentry,gg7/sentry,mvaled/sentry,JTCunning/sentry,alexm92/sentry,hongliang5623/sentry,Kryz/sentry,JackDanger/sentry,gg7/sentry,TedaL... | ---
+++
@@ -1,13 +1,33 @@
from __future__ import absolute_import
from sentry.api.serializers import Serializer, register
-from sentry.models import GroupTagValue
+from sentry.models import GroupTagValue, TagValue
@register(GroupTagValue)
class GroupTagValueSerializer(Serializer):
+ def get_attrs(self, it... |
a222d268ec1c12466db48bbfcd58d8ecf2907805 | echo_server.py | echo_server.py | import socket
class EchoServer(object):
"""a simple EchoServer"""
def __init__(self, ip=u'127.0.0.1', port=50000, backlog=5):
self.ip = ip
self.port = port
self.backlog = backlog
self.socket = socket.socket(
socket.AF_INET,
socket.SOCK_STREAM,
... | import socket
class EchoServer(object):
"""a simple EchoServer"""
def __init__(self, ip=u'127.0.0.1', port=50000, backlog=5):
self.ip = ip
self.port = port
self.backlog = backlog
self.socket = socket.socket(
socket.AF_INET,
socket.SOCK_STREAM,
... | Update EchoServer to keep connection open until client shutsdown connection in order to collect all requests | Update EchoServer to keep connection open until client shutsdown connection in order to collect all requests
| Python | mit | jefrailey/network_tools | ---
+++
@@ -16,13 +16,18 @@
def start_listening(self):
while True:
+ request = []
self.connection, self.addr = self.socket.accept()
- words = self.connection.recv(32)
- if words:
- self.connection.sendall(unicode(words))
+
+ while... |
67c291b6acf0943a55626be8d40e7134012f9271 | entity/hero.py | entity/hero.py | #-*- coding: utf-8 -*-
from lib.base_entity import BaseEntity
from lib.base_animation import BaseAnimation
from pygame.locals import K_UP as UP
class HeroAnimation(BaseAnimation):
"""Custom class Animation : HeroAnimation
"""
WIDTH_SPRITE = 31
HEIGHT_SPRITE = 31
def get_sprite(self, move_d... | #-*- coding: utf-8 -*-
from lib.base_entity import BaseEntity
from lib.base_animation import BaseAnimation
from pygame.locals import K_UP as UP
class HeroAnimation(BaseAnimation):
"""Custom class Animation : HeroAnimation
"""
WIDTH_SPRITE = 31
HEIGHT_SPRITE = 31
def get_sprite(self, move_d... | Modify Hero :: Life + 2 | Modify Hero :: Life + 2
| Python | unlicense | Bobbyshow/Avoid | ---
+++
@@ -31,7 +31,7 @@
def __init__(self, name, rect_data, speed, max_frame, max_frame_delay, img):
super(Hero, self).__init__(name, rect_data, speed, max_frame, max_frame_delay, img)
- self.life = 1
+ self.life = 3
def init_animation(self, max_frame, max_frame_delay, i... |
d1bae39247a1184f7d61fa015897103af2069703 | pinax/notifications/urls.py | pinax/notifications/urls.py | from django.conf.urls import patterns, url
from .views import NoticeSettingsView
urlpatterns = patterns(
"",
url(r"^settings/$", NoticeSettingsView.as_view(), name="notification_notice_settings"),
)
| from django.conf.urls import url
from .views import NoticeSettingsView
urlpatterns = [
url(r"^settings/$", NoticeSettingsView.as_view(), name="notification_notice_settings"),
]
| Make compatible with Django 1.9 | Make compatible with Django 1.9
| Python | mit | pinax/pinax-notifications,pinax/pinax-notifications | ---
+++
@@ -1,9 +1,8 @@
-from django.conf.urls import patterns, url
+from django.conf.urls import url
from .views import NoticeSettingsView
-urlpatterns = patterns(
- "",
+urlpatterns = [
url(r"^settings/$", NoticeSettingsView.as_view(), name="notification_notice_settings"),
-)
+] |
bf343f88ee1eb16bb1268bc70ecb03f25ab338cf | Sketches/RJL/Util/DataSource.py | Sketches/RJL/Util/DataSource.py | from Axon.Component import component
from Axon.Ipc import producerFinished, shutdownMicroprocess, shutdown
class DataSource(component):
def __init__(self, messages):
super(DataSource, self).__init__()
self.messages = messages
def main(self):
while len(self.messages) > 0:
... | from Axon.Component import component
from Axon.Ipc import producerFinished, shutdownMicroprocess, shutdown
class DataSource(component):
def __init__(self, messages):
super(DataSource, self).__init__()
self.messages = messages
def main(self):
while len(self.messages) > 0:
... | Work around a minor bug in ConsoleEchoer - yield before sending a complete message. | Work around a minor bug in ConsoleEchoer - yield before sending a
complete message.
| Python | apache-2.0 | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | ---
+++
@@ -10,4 +10,15 @@
while len(self.messages) > 0:
yield 1
self.send(self.messages.pop(0), "outbox")
+ yield 1
self.send(producerFinished(), "signal")
+ return
+
+if __name__ == "__main__":
+ from Kamaelia.Util.PipelineComponent import pipeline
+ f... |
dc140f6c7bc6fe03ec60a5b1029d7bc7463d2a0e | pydarkstar/scrubbing/scrubber.py | pydarkstar/scrubbing/scrubber.py | from ..darkobject import DarkObject
from bs4 import BeautifulSoup
import logging
import time
from urllib.request import urlopen
class Scrubber(DarkObject):
def __init__(self):
super(Scrubber, self).__init__()
def scrub(self):
"""
Get item metadata.
"""
return {}
... | from ..darkobject import DarkObject
from bs4 import BeautifulSoup
import requests
import logging
import time
class Scrubber(DarkObject):
def __init__(self):
super(Scrubber, self).__init__()
def scrub(self):
"""
Get item metadata.
"""
return {}
# noinspection PyBro... | Add support for absolute URL in request | Add support for absolute URL in request
| Python | mit | AdamGagorik/pydarkstar | ---
+++
@@ -1,10 +1,8 @@
from ..darkobject import DarkObject
from bs4 import BeautifulSoup
+import requests
import logging
import time
-
-
-from urllib.request import urlopen
class Scrubber(DarkObject):
@@ -19,22 +17,26 @@
# noinspection PyBroadException
@staticmethod
- def soup(url):
+ def... |
fbd49474eb9d0d80874048964ca08295e8c040cb | webwatcher/fetcher/simple.py | webwatcher/fetcher/simple.py | import json
import requests
def simple(conf):
url = conf['url']
output_format = conf.get('format', 'html')
response = requests.get(url)
if output_format == 'json':
return json.dumps(response.json(), indent=True)
else:
return response.text
| import json
import requests
def simple(conf):
url = conf['url']
output_format = conf.get('format', 'html')
response = requests.get(url)
if output_format == 'json':
return json.dumps(response.json(), indent=True, sort_keys=True)
else:
return response.text
| Sort keys in JSON fetcher for consistent results | Sort keys in JSON fetcher for consistent results | Python | mit | kibitzr/kibitzr,kibitzr/kibitzr | ---
+++
@@ -8,6 +8,6 @@
output_format = conf.get('format', 'html')
response = requests.get(url)
if output_format == 'json':
- return json.dumps(response.json(), indent=True)
+ return json.dumps(response.json(), indent=True, sort_keys=True)
else:
return response.text |
3b8269857b1370e550664b47a20af30427992204 | kolibri/core/test/test_key_urls.py | kolibri/core/test/test_key_urls.py | from __future__ import absolute_import, print_function, unicode_literals
from django.core.urlresolvers import reverse
from rest_framework.test import APITestCase
from kolibri.auth.test.test_api import FacilityFactory
from kolibri.auth.test.helpers import create_superuser, provision_device
DUMMY_PASSWORD = "password... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from rest_framework.test import APITestCase
from kolibri.auth.test.helpers import create_superuser
from kolibri.auth.test.helpers import provision_device
fr... | Update KolibriTagNavigationTestCase to handle new redirect method | Update KolibriTagNavigationTestCase to handle new redirect method
| Python | mit | learningequality/kolibri,lyw07/kolibri,indirectlylit/kolibri,benjaoming/kolibri,mrpau/kolibri,indirectlylit/kolibri,learningequality/kolibri,DXCanas/kolibri,benjaoming/kolibri,learningequality/kolibri,lyw07/kolibri,learningequality/kolibri,mrpau/kolibri,mrpau/kolibri,indirectlylit/kolibri,DXCanas/kolibri,benjaoming/kol... | ---
+++
@@ -1,11 +1,13 @@
-from __future__ import absolute_import, print_function, unicode_literals
+from __future__ import absolute_import
+from __future__ import print_function
+from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from rest_framework.test import APITestCase
+fr... |
1a4f8b2565b0e6ccdef8eba8982633825ddd978c | telemetry/telemetry/core/profile_types.py | telemetry/telemetry/core/profile_types.py | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
PROFILE_TYPE_MAPPING = {
'typical_user': 'chrome/test/data/extensions/profiles/content_scripts1',
'power_user': 'chrome/test/data/extensio... | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
PROFILE_TYPE_MAPPING = {
'typical_user': 'chrome/test/data/extensions/profiles/content_scripts1',
'power_user': 'chrome/test/data/extensio... | Use correct profile for power_user. | [Telemetry] Use correct profile for power_user.
TEST=None
BUG=None
NOTRY=True
Review URL: https://chromiumcodereview.appspot.com/12775015
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@188294 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | sahiljain/catapult,catapult-project/catapult-csm,benschmaus/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,sahiljain/catapult,benschmaus/catapult,catapult-project/catapult-csm,benschmaus/catapult,SummerLW/Perf-Insight-Report,catapult-project/catapult-csm,benschmaus/catapult,Summe... | ---
+++
@@ -6,7 +6,7 @@
PROFILE_TYPE_MAPPING = {
'typical_user': 'chrome/test/data/extensions/profiles/content_scripts1',
- 'power_user': 'chrome/test/data/extensions/profiles/content_scripts10',
+ 'power_user': 'chrome/test/data/extensions/profiles/extension_webrequest',
}
PROFILE_TYPES = PROFILE_TYPE_MAPP... |
c07e2bbbeb513429fc6ef4a5efba5cae71cac214 | autostew_back/tests/test_assets/settings_no_plugins.py | autostew_back/tests/test_assets/settings_no_plugins.py | import logging
from autostew_back.tests.test_assets import prl_s4_r2_zolder_casual
logging.getLogger().setLevel(logging.INFO)
logging.getLogger('django.db.backends').setLevel(logging.INFO)
logging.getLogger('requests.packages.urllib3.connectionpool').setLevel(logging.INFO)
class SettingsWithoutPlugins:
host_nam... | import logging
from autostew_back.tests.test_assets import prl_s4_r2_zolder_casual
logging.getLogger().setLevel(logging.INFO)
logging.getLogger('django.db.backends').setLevel(logging.INFO)
logging.getLogger('requests.packages.urllib3.connectionpool').setLevel(logging.INFO)
class SettingsWithoutPlugins:
host_nam... | Set sleep times to zero for tests | Set sleep times to zero for tests
| Python | agpl-3.0 | Autostew/autostew,Autostew/autostew,Autostew/autostew | ---
+++
@@ -12,8 +12,8 @@
server_name = "TestServer"
config_file = "server.cfg"
url = "http://localhost:9000"
- event_poll_period = 1
- full_update_period = 5
+ event_poll_period = 0
+ full_update_period = 0
setup_rotation = [
prl_s4_r2_zolder_casual |
de7043594786780a29d5451f5ec21132634ec878 | wsgiproxy/requests_client.py | wsgiproxy/requests_client.py | # -*- coding: utf-8 -*-
import requests
class HttpClient(object):
"""A HTTP client using requests"""
default_options = dict(verify=False, allow_redirects=False)
def __init__(self, chunk_size=1024 * 24, **requests_options):
options = self.default_options.copy()
options.update(requests_opt... | # -*- coding: utf-8 -*-
import requests
class HttpClient(object):
"""A HTTP client using requests"""
default_options = dict(verify=False, allow_redirects=False)
def __init__(self, chunk_size=1024 * 24, session=None, **requests_options):
options = self.default_options.copy()
options.updat... | Allow custom session object for the requests backend. | Allow custom session object for the requests backend.
| Python | mit | gawel/WSGIProxy2 | ---
+++
@@ -7,11 +7,14 @@
default_options = dict(verify=False, allow_redirects=False)
- def __init__(self, chunk_size=1024 * 24, **requests_options):
+ def __init__(self, chunk_size=1024 * 24, session=None, **requests_options):
options = self.default_options.copy()
options.update(requ... |
d8a4cfcf50462050d186d086733ee9cbb2a2ec3b | imhotep_jsl/plugin.py | imhotep_jsl/plugin.py | from imhotep.tools import Tool
from collections import defaultdict
import re
class JSL(Tool):
regex = re.compile(
r'^(?P<type>[WE]) '
r'(?P<filename>.*?) L(?P<line_number>\d+): (?P<message>.*)$')
def invoke(self, dirname, filenames=set()):
retval = defaultdict(lambda: defaultdict(list... | from imhotep.tools import Tool
from collections import defaultdict
import re
class JSL(Tool):
regex = re.compile(
r'^(?P<type>[WE]) '
r'(?P<filename>.*?) L(?P<line_number>\d+): (?P<message>.*)$')
def invoke(self, dirname, filenames=set(), linter_configs=set()):
retval = defaultdict(la... | Update for api change with linter_configs. | Update for api change with linter_configs.
| Python | mit | hayes/imhotep_jsl | ---
+++
@@ -8,7 +8,7 @@
r'^(?P<type>[WE]) '
r'(?P<filename>.*?) L(?P<line_number>\d+): (?P<message>.*)$')
- def invoke(self, dirname, filenames=set()):
+ def invoke(self, dirname, filenames=set(), linter_configs=set()):
retval = defaultdict(lambda: defaultdict(list))
if len... |
e89602fec93ca86c3952b4bf33ee7151bfe2e6b0 | emission/analysis/classification/cleaning/speed_outlier_detection.py | emission/analysis/classification/cleaning/speed_outlier_detection.py | # Techniques for outlier detection of speeds. Each of these returns a speed threshold that
# can be used with outlier detection techniques.
# Standard imports
import logging
logging.basicConfig(level=logging.DEBUG)
class BoxplotOutlier(object):
MINOR = 1.5
MAJOR = 3
def __init__(self, multiplier = MAJOR... | # Techniques for outlier detection of speeds. Each of these returns a speed threshold that
# can be used with outlier detection techniques.
# Standard imports
import logging
logging.basicConfig(level=logging.DEBUG)
class BoxplotOutlier(object):
MINOR = 1.5
MAJOR = 3
def __init__(self, multiplier = MAJOR... | Support an option to ignore zeros while calculating thresholds | Support an option to ignore zeros while calculating thresholds
Based on the results, the default should be to ignore
| Python | bsd-3-clause | shankari/e-mission-server,e-mission/e-mission-server,joshzarrabi/e-mission-server,yw374cornell/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,yw374cornell/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,yw374cornell/e-missi... | ---
+++
@@ -9,20 +9,30 @@
class BoxplotOutlier(object):
MINOR = 1.5
MAJOR = 3
- def __init__(self, multiplier = MAJOR):
+ def __init__(self, multiplier = MAJOR, ignore_zeros = False):
self.multiplier = multiplier
+ self.ignore_zeros = ignore_zeros
def get_threshold(self, with_s... |
35fb8c91bac3d68d255223b20dbbfd84ab34b3b1 | quant/ichimoku/ichimoku_test.py | quant/ichimoku/ichimoku_test.py | import pandas as pd
import numpy as np
import os
#from ta import ichimoku
from util import get_data, plot_data
from pandas import DataFrame, Series
from technical_analysis import ichimoku
from datetime import datetime, timedelta,date
import os
import time
import sys
import getopt,argparse
def test_run(stock='000725'... | import pandas as pd
import numpy as np
import os
#from ta import ichimoku
from util import get_data, plot_data
from pandas import DataFrame, Series
from technical_analysis import ichimoku
from datetime import datetime, timedelta,date
import os
import time
import sys
import getopt,argparse
MAX_ROLLING = 100
def test_r... | Add the missing data for ichimoku with additional data fed | Add the missing data for ichimoku with additional data fed
| Python | apache-2.0 | yunfeiz/py_learnt | ---
+++
@@ -12,20 +12,19 @@
import sys
import getopt,argparse
-
+MAX_ROLLING = 100
def test_run(stock='000725'):
duration = 360
#now=datetime.now()
today=date.today()
- ndays_ago=today-timedelta(duration)
- #print(str(n)+" days ago:\n"+str(ndays_ago))
+ ndays_ago=today-timedelta(duration+MAX_ROLLING)
s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.