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 |
|---|---|---|---|---|---|---|---|---|---|---|
3ca4199db1a3bc4bd9a408ff2b86fc20ee477e41 | setup.py | setup.py | #!/usr/bin/python
import distutils
from setuptools import setup, Extension
long_desc = """This is a C extension module for Python which
implements extended attributes manipulation. It is a wrapper on top
of the attr C library - see attr(5)."""
version = "0.5.1"
author = "Iustin Pop"
author_email = "iusty@k1024.org"
m... | #!/usr/bin/python
import distutils
from setuptools import setup, Extension
long_desc = """This is a C extension module for Python which
implements extended attributes manipulation. It is a wrapper on top
of the attr C library - see attr(5)."""
version = "0.5.1"
author = "Iustin Pop"
author_email = "iusty@k1024.org"
m... | Add a download_url for pypi | Add a download_url for pypi
| Python | lgpl-2.1 | iustin/pyxattr,iustin/pyxattr | ---
+++
@@ -21,6 +21,7 @@
author = author,
author_email = author_email,
url = "http://pyxattr.k1024.org/",
+ download_url = "https://github.com/iustin/pyxattr/downloads",
license = "LGPL",
ext_modules = [Extension("xattr", ["xattr.c"],
libraries=... |
2ef360762cf807806417fbd505319165716e4591 | setup.py | setup.py | #!/usr/bin/env python
# Copyright (c) 2014, Michael Boyle
# See LICENSE file for details: <https://github.com/moble/quaternion/blob/master/LICENSE>
from auto_version import calculate_version, build_py_copy_version
def configuration(parent_package='', top_path=None):
import numpy
from distutils.errors import... | #!/usr/bin/env python
# Copyright (c) 2014, Michael Boyle
# See LICENSE file for details: <https://github.com/moble/quaternion/blob/master/LICENSE>
from auto_version import calculate_version, build_py_copy_version
def configuration(parent_package='', top_path=None):
import numpy
from distutils.errors import... | Add fast-math back to compiler options, now that anaconda can handle it | Add fast-math back to compiler options, now that anaconda can handle it
Closes #13
See https://github.com/ContinuumIO/anaconda-issues/issues/182
| Python | mit | moble/quaternion,moble/quaternion | ---
+++
@@ -18,7 +18,7 @@
# compile_args = ['-O3']
# else:
# compile_args = ['-ffast-math', '-O3']
- compile_args = ['-O3']
+ compile_args = ['-ffast-math', '-O3']
config = Configuration('quaternion', parent_package, top_path)
config.add_extension('numpy_quaternion',
... |
8b00632dd6659b9b3c3f792564a81c7b47e0da2c | setup.py | setup.py | import sys
import os.path as op
from setuptools import setup
from distutils.extension import Extension
exts = []
if sys.platform == 'darwin':
exts.append(Extension(
'_send2trash_osx',
[op.join('modules', 'send2trash_osx.c')],
extra_link_args=['-framework', 'CoreServices'],
))
if sys.p... | import sys
import os.path as op
from setuptools import setup
from distutils.extension import Extension
exts = []
if sys.platform == 'darwin':
exts.append(Extension(
'_send2trash_osx',
[op.join('modules', 'send2trash_osx.c')],
extra_link_args=['-framework', 'CoreServices'],
))
if sys.p... | Set zip_safe to False, as it causes problems when creating executables for Windows of apps using it. | Set zip_safe to False, as it causes problems when creating executables for Windows of apps using it.
| Python | bsd-3-clause | hsoft/send2trash | ---
+++
@@ -30,4 +30,5 @@
url='http://hg.hardcoded.net/send2trash/',
license='LICENSE',
description='Send file to trash natively under Mac OS X, Windows and Linux.',
+ zip_safe=False,
) |
045417a97251dbb3af2f75e6c0872586acf1f0c4 | setup.py | setup.py | from setuptools import setup, find_packages
version = '1.0'
setup(
name='tn.bulletino',
version=version,
description='',
classifiers=[
"Framework :: Plone",
"Programming Language :: Python",
],
keywords='',
author='TN Tecnologia e Negocios',
author_email='ed@tecnologiae... | from setuptools import setup, find_packages
version = '1.0'
setup(
name='tn.bulletino',
version=version,
description='',
classifiers=[
"Framework :: Plone",
"Programming Language :: Python",
],
keywords='',
author='TN Tecnologia e Negocios',
author_email='ed@tecnologiae... | Add plone.api as a dependency | Add plone.api as a dependency
| Python | bsd-3-clause | tecnologiaenegocios/tn.bulletino | ---
+++
@@ -25,6 +25,7 @@
'five.globalrequest',
'Plone',
'plone.app.z3cform',
+ 'plone.api',
'plone.directives.form',
'tn.plonebehavior.template',
'tn.plonehtmlimagecache', |
4f561976b28a81d233fc12903252a56a5de4f84e | setup.py | setup.py | from setuptools import (
setup,
find_packages,
)
#from os import path
#here = path.abspath(path.dirname(__file__))
#with open(path.join(here, "README.md")) as f:
# long_description = f.read()
long_description = "stuff will go here eventually"
setup(
name="py_types",
version="0.1.0a",
descript... | from setuptools import (
setup,
find_packages,
)
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.md")) as rdme:
with open(path.join(here, "CHANGELOG.md")) as chlog:
readme = rdme.read()
changes = chlog.read()
long_description = read... | Change long description to be README and CHANGELOG | Change long description to be README and CHANGELOG
| Python | mit | zekna/py-types | ---
+++
@@ -2,13 +2,15 @@
setup,
find_packages,
)
-#from os import path
+from os import path
-#here = path.abspath(path.dirname(__file__))
+here = path.abspath(path.dirname(__file__))
-#with open(path.join(here, "README.md")) as f:
-# long_description = f.read()
-long_description = "stuff will go he... |
1c678846cf612c83bf4c9a680dc4a6c3a524bd3e | setup.py | setup.py | #!/usr/bin/env python3
from os import curdir, pardir
from os.path import join
from distutils.core import setup
from Cython.Distutils import Extension, build_ext
setup(
name = "VapourSynth",
description = "A frameserver for the 21st century",
url = "http://www.vapoursynth.com/",
download_url = "http://... | #!/usr/bin/env python
from os import curdir, pardir
from os.path import join
from distutils.core import setup
from Cython.Distutils import Extension, build_ext
setup(
name = "VapourSynth",
description = "A frameserver for the 21st century",
url = "http://www.vapoursynth.com/",
download_url = "http://c... | Unify the python binaries being invoked in the various scripts. | Unify the python binaries being invoked in the various scripts.
| Python | lgpl-2.1 | vapoursynth/vapoursynth,vapoursynth/vapoursynth,vapoursynth/vapoursynth,Kamekameha/vapoursynth,Kamekameha/vapoursynth,Kamekameha/vapoursynth,vapoursynth/vapoursynth,Kamekameha/vapoursynth | ---
+++
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
from os import curdir, pardir
from os.path import join |
22e2d980d900f30901cf6f2ef5f167ddec62e9a7 | setup.py | setup.py | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name = "UCLDC Deep Harvester",
version = "0.0.1",
d... | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name = "UCLDC Deep Harvester",
version = "0.0.1",
d... | Remove this package as a dependency for itself! | Remove this package as a dependency for itself!
| Python | bsd-3-clause | barbarahui/nuxeo-calisphere,barbarahui/nuxeo-calisphere | ---
+++
@@ -16,13 +16,11 @@
author_email='barbara.hui@ucop.edu',
dependency_links=[
'https://github.com/ucldc/pynux/archive/master.zip#egg=pynux',
- 'https://github.com/barbarahui/nuxeo-calisphere/archive/master.zip#egg=UCLDC-Deep-Harvester'
],
install_requires=[
'boto',
... |
1d9349255fa29b8c29c7d916a5750a8cd0da8f78 | setup.py | setup.py | from setuptools import setup
description = """
Full featured redis cache backend for Django.
"""
setup(
name = "django-redis",
url = "https://github.com/niwibe/django-redis",
author = "Andrei Antoukh",
author_email = "niwi@niwi.be",
version='3.5.2',
packages = [
"redis_cache",
... | from setuptools import setup
description = """
Full featured redis cache backend for Django.
"""
setup(
name = "django-redis",
url = "https://github.com/niwibe/django-redis",
author = "Andrei Antoukh",
author_email = "niwi@niwi.be",
version='3.5.2',
packages = [
"redis_cache",
... | Set redis-py >= 2.9.0 requirement. | Set redis-py >= 2.9.0 requirement.
| Python | bsd-3-clause | smahs/django-redis,yanheng/django-redis,lucius-feng/django-redis,zl352773277/django-redis,GetAmbassador/django-redis | ---
+++
@@ -16,7 +16,7 @@
],
description = description.strip(),
install_requires=[
- 'redis>=2.7.0',
+ 'redis>=2.9.0',
],
zip_safe=False,
include_package_data = True, |
9ed88cba879168a7b9ba550668e7f7a617b4e789 | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import find_packages, setup
from valohai_cli import __version__
setup(
name='valohai-cli',
version=__version__,
entry_points={'console_scripts': ['vh=valohai_cli.cli:cli']},
author='Valohai',
author_email='hait@valohai.com',
license='MIT',
install_re... | # -*- coding: utf-8 -*-
from setuptools import find_packages, setup
from valohai_cli import __version__
setup(
name='valohai-cli',
version=__version__,
entry_points={'console_scripts': ['vh=valohai_cli.cli:cli']},
author='Valohai',
author_email='hait@valohai.com',
license='MIT',
install_re... | Correct click version requirement to >= 7.0 | Correct click version requirement to >= 7.0
We need the show_envvar kwarg since 1a0f77b33150c02648652e793974f0312a17e7d7
which was added in pallets/click#710 and released in Click 7.0.
| Python | mit | valohai/valohai-cli | ---
+++
@@ -11,7 +11,7 @@
author_email='hait@valohai.com',
license='MIT',
install_requires=[
- 'click>=6.0',
+ 'click>=7.0',
'six>=1.10.0',
'valohai-yaml>=0.8',
'requests[security]>=2.0.0', |
3a67b514968f0c002f049ce8e34710412ca39904 | setup.py | setup.py | from setuptools import setup, find_packages
import os
scriptnames = ['runElegant.sh',
'sddsprintdata.sh',
'renametolower.sh',
'file2lower.sh',
'lte2json',
'json2lte',
'latticeviewer',
'lv']
def readme():
with ... | from setuptools import setup, find_packages
import os
scriptnames = ['runElegant.sh',
'sddsprintdata.sh',
'renametolower.sh',
'file2lower.sh',
'lte2json',
'json2lte',
'latticeviewer',
'lv']
def readme():
with ... | Add wxPython and use install_requires | Add wxPython and use install_requires
* Add wxPython as a depenency
* Use `install_requires` so dependencies are installed if one installs this package
| Python | mit | Archman/beamline | ---
+++
@@ -14,7 +14,7 @@
with open('README.rst') as f:
return f.read()
-requiredpackages = ['pyrpn', 'h5py', 'numpy', 'matplotlib', 'pyepics']
+requiredpackages = ['pyrpn', 'h5py', 'numpy', 'matplotlib', 'pyepics', 'wxPython']
setup(
name = "beamline",
@@ -29,5 +29,6 @@
url =... |
7627b8759ab08df562048ec1fa94fe9d69d01374 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
from exoline import __version__ as version
with open('requirements.txt') as f:
required = f.read().splitlines()
try:
from collections import OrderedDict
except ImportError:
required.append('ordereddict==1.1')
setup(
name='exoline',
version=versi... | #!/usr/bin/env python
from setuptools import setup
from exoline import __version__ as version
with open('requirements.txt') as f:
required = f.read().splitlines()
try:
from collections import OrderedDict
except ImportError:
required.append('ordereddict>=1.1')
try:
import importlib
except ImportError... | Add importlib if not included | Add importlib if not included
| Python | bsd-3-clause | tadpol/exoline,azdle/exoline,asolz/exoline,danslimmon/exoline,tadpol/exoline,asolz/exoline,azdle/exoline,danslimmon/exoline | ---
+++
@@ -9,7 +9,12 @@
try:
from collections import OrderedDict
except ImportError:
- required.append('ordereddict==1.1')
+ required.append('ordereddict>=1.1')
+
+try:
+ import importlib
+except ImportError:
+ required.append('importlib>=1.0.2')
setup(
name='exoline', |
48f664721fc866871a17b459eb22e5641b311067 | setup.py | setup.py | #!/usr/bin/env python3
from setuptools import setup
setup(
name='sht',
version='1.0',
description='A fast spherical harmonic transform implementation',
author='Praveen Venkatesh',
url='https://github.com/praveenv253/sht',
packages=['sht', ],
install_requires=['numpy', 'scipy', ],
setup... | #!/usr/bin/env python3
from setuptools import setup
setup(
name='sht',
version='1.1',
description='A fast spherical harmonic transform implementation',
author='Praveen Venkatesh',
url='https://github.com/praveenv253/sht',
packages=['sht', ],
install_requires=['numpy', 'scipy', ],
setup... | Update version number to 1.1. | Update version number to 1.1.
| Python | mit | praveenv253/sht,praveenv253/sht | ---
+++
@@ -4,7 +4,7 @@
setup(
name='sht',
- version='1.0',
+ version='1.1',
description='A fast spherical harmonic transform implementation',
author='Praveen Venkatesh',
url='https://github.com/praveenv253/sht', |
160ad684262b654ce4f1e6ca2fc97a06f79ec6c6 | setup.py | setup.py | # coding: utf-8
import sys
from setuptools import setup
PY_VERSION = sys.version_info[0], sys.version_info[1]
requirements = [
'requests>=1.0',
'python-dateutil>=2.1',
'six>=1.2.0',
]
if PY_VERSION == (2, 6):
requirements.append('argparse')
setup(
name='pyuploadcare',
version='1.2.12',
... | # coding: utf-8
import sys
from setuptools import setup
PY_VERSION = sys.version_info[0], sys.version_info[1]
requirements = [
'requests>=1.0',
'python-dateutil>=2.1',
'six>=1.2.0',
]
if PY_VERSION == (2, 6):
requirements.append('argparse')
if PY_VERSION < (3, 0):
long_description = open('READ... | Fix encoding issue when installing with pip3 | Fix encoding issue when installing with pip3
| Python | mit | uploadcare/pyuploadcare | ---
+++
@@ -15,14 +15,16 @@
if PY_VERSION == (2, 6):
requirements.append('argparse')
+if PY_VERSION < (3, 0):
+ long_description = open('README.rst').read() + '\n\n' + open('HISTORY.rst').read()
+else:
+ long_description = open('README.rst', encoding='utf-8').read() + '\n\n' + open('HISTORY.rst', encodi... |
2901988d46a644c70ba12409c06e0bcb3bfc0eff | onadata/apps/restservice/services/kpi_hook.py | onadata/apps/restservice/services/kpi_hook.py | # coding: utf-8
import logging
import re
import requests
from django.conf import settings
from onadata.apps.restservice.RestServiceInterface import RestServiceInterface
from onadata.apps.logger.models import Instance
class ServiceDefinition(RestServiceInterface):
id = 'kpi_hook'
verbose_name = 'KPI Hook POST... | # coding: utf-8
import logging
import re
import requests
from django.conf import settings
from onadata.apps.restservice.RestServiceInterface import RestServiceInterface
from onadata.apps.logger.models import Instance
class ServiceDefinition(RestServiceInterface):
id = 'kpi_hook'
verbose_name = 'KPI Hook POST... | Use "submission_id" instead of "instance_id" parameter to send to KPI for RESTservice | Use "submission_id" instead of "instance_id" parameter to send to KPI for RESTservice
| Python | bsd-2-clause | kobotoolbox/kobocat,kobotoolbox/kobocat,kobotoolbox/kobocat,kobotoolbox/kobocat | ---
+++
@@ -16,7 +16,7 @@
# Will be used internally by KPI to fetch data with KoBoCatBackend
post_data = {
- 'instance_id': data.get('instance_id')
+ 'submission_id': data.get('instance_id')
}
headers = {'Content-Type': 'application/json'}
|
9f485a55227406c3cfbfb3154ec8d0f2cad8ae67 | publisher/build_paper.py | publisher/build_paper.py | #!/usr/bin/env python
import docutils.core as dc
from writer import writer
import os.path
import sys
import glob
preamble = r'''
% These preamble commands are from build_paper.py
% PDF Standard Fonts
\usepackage{mathptmx}
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
% Make verbatim environment smaller
\ma... | #!/usr/bin/env python
import docutils.core as dc
from writer import writer
import os.path
import sys
import glob
preamble = r'''
% These preamble commands are from build_paper.py
% PDF Standard Fonts
\usepackage{mathptmx}
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
% Make verbatim environment smaller
\ma... | Use IEEE computer society layout to improve looks. | Use IEEE computer society layout to improve looks.
| Python | bsd-2-clause | Stewori/euroscipy_proceedings,helgee/euroscipy_proceedings,juhasch/euroscipy_proceedings,mwcraig/scipy_proceedings,sbenthall/scipy_proceedings,helgee/euroscipy_proceedings,SepidehAlassi/euroscipy_proceedings,SepidehAlassi/euroscipy_proceedings,chendaniely/scipy_proceedings,dotsdl/scipy_proceedings,mikaem/euroscipy_proc... | ---
+++
@@ -27,7 +27,8 @@
settings = {'documentclass': 'IEEEtran',
'use_verbatim_when_possible': True,
'use_latex_citations': True,
- 'latex_preamble': preamble}
+ 'latex_preamble': preamble,
+ 'documentoptions': 'letterpaper,compsoc,twoside'}
if len(sys.... |
efe15dae9d57fe6e18d722057c1cf48bd855c28e | py2app/recipes/pyside.py | py2app/recipes/pyside.py | import pkg_resources
import glob
import os
def check(cmd, mf):
name = 'PySide'
m = mf.findNode(name)
if m is None or m.filename is None:
return None
from PySide import QtCore
plugin_dir = QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.PluginsPath)
resources = [pkg_resources.resource... | import pkg_resources
import glob
import os
def check(cmd, mf):
name = 'PySide'
m = mf.findNode(name)
if m is None or m.filename is None:
return None
from PySide import QtCore
plugin_dir = QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.PluginsPath)
resources = [pkg_resources.resource... | Fix incorrect indentation messing up PySide | Fix incorrect indentation messing up PySide
| Python | mit | metachris/py2app,metachris/py2app,metachris/py2app,metachris/py2app | ---
+++
@@ -19,8 +19,8 @@
if '*' in item:
for path in glob.glob(os.path.join(plugin_dir, item)):
resources.append((os.path.dirname('qt_plugins' + path[len(plugin_dir):]), [path]))
- else:
- resources.append((os.path.dirname(os.path.join('qt_plugins', it... |
cb2c937fa16590a7431f450c0fc79cc68dd9984c | readthedocs/cdn/purge.py | readthedocs/cdn/purge.py | import logging
from django.conf import settings
log = logging.getLogger(__name__)
CDN_SERVICE = getattr(settings, 'CDN_SERVICE')
CDN_USERNAME = getattr(settings, 'CDN_USERNAME')
CDN_KEY = getattr(settings, 'CDN_KEY')
CDN_SECET = getattr(settings, 'CDN_SECET')
CDN_ID = getattr(settings, 'CDN_ID')
def purge(files):
... | import logging
from django.conf import settings
log = logging.getLogger(__name__)
CDN_SERVICE = getattr(settings, 'CDN_SERVICE')
CDN_USERNAME = getattr(settings, 'CDN_USERNAME')
CDN_KEY = getattr(settings, 'CDN_KEY')
CDN_SECET = getattr(settings, 'CDN_SECET')
CDN_ID = getattr(settings, 'CDN_ID')
def purge(files):
... | Clean up bad logic to make it slightly less bad | Clean up bad logic to make it slightly less bad
| Python | mit | sid-kap/readthedocs.org,wanghaven/readthedocs.org,CedarLogic/readthedocs.org,mhils/readthedocs.org,sunnyzwh/readthedocs.org,titiushko/readthedocs.org,laplaceliu/readthedocs.org,hach-que/readthedocs.org,pombredanne/readthedocs.org,safwanrahman/readthedocs.org,wanghaven/readthedocs.org,michaelmcandrew/readthedocs.org,saf... | ---
+++
@@ -16,8 +16,8 @@
if CDN_USERNAME and CDN_KEY and CDN_SECET and CDN_ID:
if CDN_SERVICE == 'maxcdn':
- from maxcdn import MaxCDN as cdn_service
- api = cdn_service(CDN_USERNAME, CDN_KEY, CDN_SECET)
+ from maxcdn import MaxCDN
+ api = MaxCDN(CDN_USERNAME, CDN_KEY, CDN_SECET)
... |
552afcd33d890d2798b52919c0b4c0d146b7d914 | make_ids.py | make_ids.py | #!/usr/bin/env python
import csv
import json
import os
import sys
def format_entities_as_list(entities):
for i, entity in enumerate(entities, 1):
yield (unicode(i), json.dumps(entity["terms"]))
def generate_entities(fobj):
termsets_seen = set()
for line in fobj:
entity = json.loads(line... | #!/usr/bin/env python
import csv
import json
import os
import sys
def format_entities_as_list(entities):
"""Format entities read from an iterator as lists.
:param entities: An iterator yielding entities as dicts:
eg {"terms": ["Fred"]}
Yield a sequence of entites formatted as lists containin... | Add docstrings to all functions | Add docstrings to all functions
| Python | mit | alphagov/entity-manager | ---
+++
@@ -7,11 +7,33 @@
def format_entities_as_list(entities):
+ """Format entities read from an iterator as lists.
+
+ :param entities: An iterator yielding entities as dicts:
+ eg {"terms": ["Fred"]}
+
+ Yield a sequence of entites formatted as lists containing string values.
+ Also all... |
5fc7dccdb61eefed40361385166330e285eab85f | a11y_tests/test_course_enrollment_demographics_axs.py | a11y_tests/test_course_enrollment_demographics_axs.py | from bok_choy.web_app_test import WebAppTest
from bok_choy.promise import EmptyPromise
from a11y_tests.pages import CourseEnrollmentDemographicsAgePage
from a11y_tests.mixins import CoursePageTestsMixin
_multiprocess_can_split_ = True
class CourseEnrollmentDemographicsAgeTests(CoursePageTestsMixin, WebAppTest):
... | from bok_choy.web_app_test import WebAppTest
from bok_choy.promise import EmptyPromise
from a11y_tests.pages import CourseEnrollmentDemographicsAgePage
from a11y_tests.mixins import CoursePageTestsMixin
_multiprocess_can_split_ = True
class CourseEnrollmentDemographicsAgeTests(CoursePageTestsMixin, WebAppTest):
... | Fix bok-choy page query call | Fix bok-choy page query call
| Python | agpl-3.0 | edx/edx-analytics-dashboard,edx/edx-analytics-dashboard,Stanford-Online/edx-analytics-dashboard,edx/edx-analytics-dashboard,edx/edx-analytics-dashboard,Stanford-Online/edx-analytics-dashboard,Stanford-Online/edx-analytics-dashboard,Stanford-Online/edx-analytics-dashboard | ---
+++
@@ -31,7 +31,7 @@
# Wait for the datatable to finish loading
ready_promise = EmptyPromise(
- lambda: 'Loading' not in self.q(css='div.section-data-table').text,
+ lambda: 'Loading' not in self.page.q(css='div.section-data-table').text,
"Page finished load... |
25a2aeda1b041afbfbd1de09f784e0b7a3732215 | IPython/nbconvert/exporters/python.py | IPython/nbconvert/exporters/python.py | """
Python exporter which exports Notebook code into a PY file.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed... | """
Python exporter which exports Notebook code into a PY file.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed... | Rebase changes made by hand | Rebase changes made by hand
| Python | bsd-3-clause | SylvainCorlay/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,jupyter-widgets/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,cornhundred/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidg... | ---
+++
@@ -15,7 +15,7 @@
from IPython.utils.traitlets import Unicode
-from .exporter import TemplateExporter
+from .templateexporter import TemplateExporter
#-----------------------------------------------------------------------------
# Classes |
4663fdb44628238997ecc5adbb0f0193c99efc6c | script/lib/config.py | script/lib/config.py | #!/usr/bin/env python
import platform
import sys
BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '26dd65a62e35aa98b25c10cbfc00f1a621fd4c4b'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[0],
'win32': '32bit',
}... | #!/usr/bin/env python
import platform
import sys
BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'c01b10faf0d478e48f537210ec263fabd551578d'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[0],
'win32': '32bit',
}... | Update libchromiumcontent to disable zygote process | Update libchromiumcontent to disable zygote process
| Python | mit | Jonekee/electron,Faiz7412/electron,cos2004/electron,mubassirhayat/electron,smczk/electron,fomojola/electron,Jonekee/electron,IonicaBizauKitchen/electron,howmuchcomputer/electron,Floato/electron,bruce/electron,joaomoreno/atom-shell,tomashanacek/electron,ervinb/electron,gbn972/electron,Zagorakiss/electron,rhencke/electro... | ---
+++
@@ -4,7 +4,7 @@
import sys
BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
-LIBCHROMIUMCONTENT_COMMIT = '26dd65a62e35aa98b25c10cbfc00f1a621fd4c4b'
+LIBCHROMIUMCONTENT_COMMIT = 'c01b10faf0d478e48f537210ec263fabd551578d'
ARCH = {
'cygwin': '32bit', |
6869d5edd706d95c8cadbd1945b29fdd3bfecd6b | blaze/datashape/unification.py | blaze/datashape/unification.py | """
Unification is a generalization of Numpy broadcasting.
In Numpy we two arrays and broadcast them to yield similar
shaped arrays.
In Blaze we take two arrays with more complex datashapes and
unify the types prescribed by more complicated pattern matching
on the types.
"""
from numpy import promote_types
from cor... | """
Unification is a generalization of Numpy broadcasting.
In Numpy we two arrays and broadcast them to yield similar
shaped arrays.
In Blaze we take two arrays with more complex datashapes and
unify the types prescribed by more complicated pattern matching
on the types.
"""
from numpy import promote_types
from bla... | Remove very old type unifier, for robust one | Remove very old type unifier, for robust one
| Python | bsd-2-clause | seibert/blaze-core,seibert/blaze-core,seibert/blaze-core,seibert/blaze-core,seibert/blaze-core | ---
+++
@@ -11,77 +11,16 @@
"""
from numpy import promote_types
-from coretypes import Fixed, Range, TypeVar, Record, \
- CType, Enum, top, dynamic
+from blaze.datashape.coretypes import TypeVar
+from blaze.expr.typeinference import infer
-class Incommensurable(Exception):
- def __init__(self, space, dim)... |
e00dc2a5725faeb3b11c6aac0d9ed0be0a55d33f | OIPA/iati/parser/schema_validators.py | OIPA/iati/parser/schema_validators.py | import os
import os.path
from lxml import etree
from common.util import findnth_occurence_in_string
def validate(iati_parser, xml_etree):
base = os.path.dirname(os.path.abspath(__file__))
location = base + "/../schemas/" + iati_parser.VERSION \
+ "/iati-activities-schema.xsd"
xsd_data = open(loc... | import os
import os.path
from lxml import etree
from common.util import findnth_occurence_in_string
def validate(iati_parser, xml_etree):
base = os.path.dirname(os.path.abspath(__file__))
location = base + "/../schemas/" + iati_parser.VERSION \
+ "/iati-activities-schema.xsd"
xsd_data = open(loc... | Fix another bug related to logging dataset errors | Fix another bug related to logging dataset errors
OIPA-612 / #589
| Python | agpl-3.0 | openaid-IATI/OIPA,openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,zimmerman-zimmerman/OIPA | ---
+++
@@ -19,7 +19,9 @@
try:
xmlschema.assertValid(xml_etree)
- except etree.DocumentInvalid as xml_errors:
+ except etree.DocumentInvalid as e:
+ xml_errors = e
+
pass
if xml_errors: |
b5e5a18bfb6071189d96f64ba9d86f91fc48fd66 | template_utils/templatetags/generic_markup.py | template_utils/templatetags/generic_markup.py | """
Filters for converting plain text to HTML and enhancing the
typographic appeal of text on the Web.
"""
from django.conf import settings
from django.template import Library
from template_utils.markup import formatter
def apply_markup(value, arg=None):
"""
Applies text-to-HTML conversion.
Takes an... | """
Filters for converting plain text to HTML and enhancing the
typographic appeal of text on the Web.
"""
from django.conf import settings
from django.template import Library
from template_utils.markup import formatter
def apply_markup(value, arg=None):
"""
Applies text-to-HTML conversion.
Takes an... | Enable the SmartyPants filter; need to document it later | Enable the SmartyPants filter; need to document it later
| Python | bsd-3-clause | dongpoliu/django-template-utils | ---
+++
@@ -39,3 +39,4 @@
register = Library()
register.filter(apply_markup)
+register.filter(smartypants) |
8c9739572aa679cb6d55cb31737bff6d304db2d1 | openstack/tests/functional/network/v2/test_extension.py | openstack/tests/functional/network/v2/test_extension.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Add a functional test for find_extension | Add a functional test for find_extension
Change-Id: I351a1c1529beb3cae799650e1e57364b3521d00c
| Python | apache-2.0 | briancurtin/python-openstacksdk,dtroyer/python-openstacksdk,openstack/python-openstacksdk,dudymas/python-openstacksdk,stackforge/python-openstacksdk,briancurtin/python-openstacksdk,stackforge/python-openstacksdk,openstack/python-openstacksdk,dudymas/python-openstacksdk,dtroyer/python-openstacksdk | ---
+++
@@ -17,10 +17,14 @@
class TestExtension(base.BaseFunctionalTest):
- def test_list_and_find(self):
+ def test_list(self):
extensions = list(self.conn.network.extensions())
self.assertGreater(len(extensions), 0)
for ext in extensions:
self.assertIsInstance(ex... |
d44a338e704732b9e3e7cb935eb2c9b38d2cfa06 | api/drive.py | api/drive.py | # -*- encoding:utf8 -*-
import httplib2
from flask import Blueprint, redirect, request, Response, abort
from model.oauth import OAuth
from model.utils import Utils
drive = Blueprint('drive', __name__, url_prefix='/drive')
@drive.route("/auth", methods=['GET'])
def hookauth():
flow = OAuth().get_flow()
if ... | # -*- encoding:utf8 -*-
import httplib2
from flask import Blueprint, redirect, request, Response, abort
from model.cache import Cache
from model.oauth import OAuth
from model.utils import Utils
drive = Blueprint('drive', __name__, url_prefix='/drive')
@drive.route("/auth", methods=['GET'])
def hookauth():
flo... | Introduce cache clear logic through GoogleDrive webhook endpoint. | Introduce cache clear logic through GoogleDrive webhook endpoint.
| Python | mit | supistar/Botnyan | ---
+++
@@ -3,6 +3,7 @@
import httplib2
from flask import Blueprint, redirect, request, Response, abort
+from model.cache import Cache
from model.oauth import OAuth
from model.utils import Utils
@@ -31,3 +32,13 @@
credentials.authorize(http)
dic = {"response": "success"}
return Response(Utils()... |
e81b920ad19872306d6e18bc9f21c296bb2fd6ab | danceschool/backups/management/commands/backup_now.py | danceschool/backups/management/commands/backup_now.py | from django.core.management.base import BaseCommand
from django.core.management import call_command
from django.conf import settings
from django.utils import timezone
import logging
import os
from danceschool.core.constants import getConstant
# Define logger for this file
logger = logging.getLogger(__name... | from django.core.management.base import BaseCommand
from django.core.management import call_command
from django.conf import settings
from django.utils import timezone
import logging
import os
from danceschool.core.constants import getConstant
# Define logger for this file
logger = logging.getLogger(__name... | Change timestamp format (important for hourly backups). | Change timestamp format (important for hourly backups).
| Python | bsd-3-clause | django-danceschool/django-danceschool,django-danceschool/django-danceschool,django-danceschool/django-danceschool | ---
+++
@@ -23,7 +23,7 @@
'BACKUP_LOCATION must be updated in project settings.py.'
)
return None
- backup_loc = os.path.join(backup_folder,'%s%s.json' % (getConstant('backups__filePrefix'), timezone.now().strftime('%Y%m%d')))
+ backup_loc = os.path.join(backup... |
c1d6e066ea622cc3fa7cec33cb77aa12e43a6519 | avocado/exporters/_html.py | avocado/exporters/_html.py | from django.template import Context
from django.template.loader import get_template
from _base import BaseExporter
class HTMLExporter(BaseExporter):
preferred_formats = ('html', 'string')
def write(self, iterable, buff=None, template=None):
if not buff and not template:
raise Exception('E... | from django.template import Context
from django.template.loader import get_template
from _base import BaseExporter
class HTMLExporter(BaseExporter):
preferred_formats = ('html', 'string')
def write(self, iterable, buff=None, template=None):
if not buff and not template:
raise Exception('E... | Fix missing row iteration in HTMLExporter | Fix missing row iteration in HTMLExporter | Python | bsd-2-clause | murphyke/avocado,murphyke/avocado,murphyke/avocado,murphyke/avocado | ---
+++
@@ -14,7 +14,8 @@
if buff:
for row in generator:
- buff.write(row)
+ for item in row:
+ buff.write(item)
return buff
context = Context({'rows': generator}) |
323167f22c3176366cf2f90ce2ec314ee2c49c8f | moa/factory_registers.py | moa/factory_registers.py | from kivy.factory import Factory
r = Factory.register
r('StageTreeNode', module='moa.render.treerender')
r('StageSimpleDisplay', module='moa.render.stage_simple')
# --------------------- devices -----------------------------
r('Device', module='moa.device')
r('DigitalChannel', module='moa.device.digital')
r('Digita... | from kivy.factory import Factory
r = Factory.register
r('StageTreeNode', module='moa.render.treerender')
r('StageSimpleDisplay', module='moa.render.stage_simple')
# --------------------- devices -----------------------------
r('Device', module='moa.device.__init__')
r('DigitalChannel', module='moa.device.digital')
... | Use __init__ for factory imports. | Use __init__ for factory imports.
| Python | mit | matham/moa | ---
+++
@@ -7,7 +7,7 @@
# --------------------- devices -----------------------------
-r('Device', module='moa.device')
+r('Device', module='moa.device.__init__')
r('DigitalChannel', module='moa.device.digital')
r('DigitalPort', module='moa.device.digital')
r('ButtonChannel', module='moa.device.digital')
@@ -... |
a9be23f6e3b45b766b770b60e3a2a318e6fd7e71 | tests/script/test_no_silent_add_and_commit.py | tests/script/test_no_silent_add_and_commit.py | import pytest
pytestmark = pytest.mark.slow
version_file_content = """
major = 0
minor = 2
patch = 0
"""
config_file_content = """
__config_version__ = 1
GLOBALS = {
'serializer': '{{major}}.{{minor}}.{{patch}}',
}
FILES = ["VERSION"]
VERSION = ['major', 'minor', 'patch']
VCS = {
'name': 'git',
}
"""
d... | import pytest
pytestmark = pytest.mark.slow
version_file_content = """
major = 0
minor = 2
patch = 0
"""
config_file_content = """
__config_version__ = 1
GLOBALS = {
'serializer': '{{major}}.{{minor}}.{{patch}}',
}
FILES = ["VERSION"]
VERSION = ['major', 'minor', 'patch']
VCS = {
'name': 'git',
}
"""
d... | Test name changed to reflect behaviour | Test name changed to reflect behaviour
| Python | isc | lgiordani/punch | ---
+++
@@ -25,7 +25,7 @@
"""
-def test_update_major(test_environment):
+def test_check_no_silent_addition_happens(test_environment):
test_environment.ensure_file_is_present("VERSION", "0.2.0")
test_environment.ensure_file_is_present( |
c958615b7dd6548418117046e6ca06b657465ee5 | benchmarker/modules/problems/cnn2d_toy/pytorch.py | benchmarker/modules/problems/cnn2d_toy/pytorch.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from ..helpers_torch import Net4Both
class Net(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size=2)
self.conv2 = nn.Conv2d(in_channels=32, out_channels=32... | import torch
import torch.nn as nn
import torch.nn.functional as F
from ..helpers_torch import Net4Both
class Net(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size=2)
self.conv2 = nn.Conv2d(in_channels=32, out_channels=32... | Fix softmax dim (I hope!!!) | Fix softmax dim (I hope!!!)
| Python | mpl-2.0 | undertherain/benchmarker,undertherain/benchmarker,undertherain/benchmarker,undertherain/benchmarker | ---
+++
@@ -26,4 +26,4 @@
def get_kernel(params, unparsed_args=None):
net = Net()
- return Net4Both(params, net, lambda t1: F.softmax(t1, dim=1))
+ return Net4Both(params, net, lambda t1: F.softmax(t1, dim=-1)) |
d98b891d882ca916984586631b5ba09c52652a74 | app/__init__.py | app/__init__.py | from flask import Flask
from flask.ext.bower import Bower
from flask.ext.pymongo import PyMongo
from config import Config
app = Flask(__name__)
app.config.from_object(Config)
# Register bower
Bower(app)
# Create mongodb client
mongo = PyMongo(app)
from .report.views import index, report | from flask import Flask
from flask_bower import Bower
from flask_pymongo import PyMongo
from config import Config
app = Flask(__name__)
app.config.from_object(Config)
# Register bower
Bower(app)
# Create mongodb client
mongo = PyMongo(app)
from .report.views import index, report | Resolve the deprecated flask ext imports | Resolve the deprecated flask ext imports
| Python | mit | mingrammer/pyreportcard,mingrammer/pyreportcard | ---
+++
@@ -1,6 +1,6 @@
from flask import Flask
-from flask.ext.bower import Bower
-from flask.ext.pymongo import PyMongo
+from flask_bower import Bower
+from flask_pymongo import PyMongo
from config import Config
|
8ebec493b086525d23bbe4110c9d277c9b9b8301 | src/sentry/tsdb/dummy.py | src/sentry/tsdb/dummy.py | """
sentry.tsdb.dummy
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from sentry.tsdb.base import BaseTSDB
class DummyTSDB(BaseTSDB):
"""
A no-op time-series storage.
""... | """
sentry.tsdb.dummy
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from sentry.tsdb.base import BaseTSDB
class DummyTSDB(BaseTSDB):
"""
A no-op time-series storage.
""... | Add support for DummyTSDB backend. | Add support for DummyTSDB backend.
| Python | bsd-3-clause | daevaorn/sentry,gencer/sentry,mvaled/sentry,BuildingLink/sentry,daevaorn/sentry,beeftornado/sentry,jean/sentry,JackDanger/sentry,JamesMura/sentry,zenefits/sentry,jean/sentry,jean/sentry,ifduyue/sentry,mvaled/sentry,gencer/sentry,BayanGroup/sentry,imankulov/sentry,nicholasserra/sentry,JamesMura/sentry,beeftornado/sentry... | ---
+++
@@ -19,3 +19,12 @@
def get_range(self, model, keys, start, end, rollup=None):
return dict((k, []) for k in keys)
+
+ def record(self, model, key, values, timestamp=None):
+ pass
+
+ def get_distinct_counts_series(self, model, keys, start, end=None, rollup=None):
+ return {k... |
0498778db28fd2e2272b48fb84a99eece7b662ff | autocorrect.py | autocorrect.py | # Open list of correcly-spelled words.
wordFile = open("words.txt")
threshold = 8
listOfWords = input().split()
index = 0
def lev(a, b):
if min(len(a), len(b)) == 0:
return max(len(a), len(b))
else:
return min(lev(a[:-1], b) + 1, lev(a, b[:-1]) + 1,
lev(a[:-1], b[:-1]) + int(not a ... | # Open list of correcly-spelled words.
wordFile = open("words.txt")
threshold = 8
listOfWords = input().split()
index = 0
# Compute Levenshtein distance
def lev(a, b):
if min(len(a), len(b)) == 0:
return max(len(a), len(b))
elif len(a) == len(b):
# Use Hamming Distance (special case)
... | Use Hamming distance for efficiency | Use Hamming distance for efficiency
Hamming distance is faster when strings are of same length (Hamming is a
special case of Levenshtein).
| Python | mit | jmanuel1/spellingbee | ---
+++
@@ -4,29 +4,36 @@
listOfWords = input().split()
index = 0
+# Compute Levenshtein distance
+
+
def lev(a, b):
if min(len(a), len(b)) == 0:
return max(len(a), len(b))
+ elif len(a) == len(b):
+ # Use Hamming Distance (special case)
+ return sum(x != y for x, y in zip(a, b))
... |
76c44154ca1bc2eeb4e24cc820338c36960b1b5c | caniuse/test/test_caniuse.py | caniuse/test/test_caniuse.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import pytest
from caniuse.main import check
def test_package_name_has_been_used():
assert 'Sorry' in check('requests')
assert 'Sorry' in check('flask')
assert 'Sorry' in check('pip')
def test_package_name_has_not_be... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import pytest
from click.testing import CliRunner
from caniuse.main import check
from caniuse.cli import cli
class TestAPI():
def test_package_name_has_been_used(self):
assert 'Sorry' in check('requests')
asser... | Add tests for cli.py to improve code coverage | Add tests for cli.py to improve code coverage
| Python | mit | lord63/caniuse | ---
+++
@@ -4,17 +4,48 @@
from __future__ import absolute_import
import pytest
+from click.testing import CliRunner
from caniuse.main import check
+from caniuse.cli import cli
-def test_package_name_has_been_used():
- assert 'Sorry' in check('requests')
- assert 'Sorry' in check('flask')
- assert ... |
429bd22a98895252dfb993d770c9b3060fef0fe3 | tests/runalldoctests.py | tests/runalldoctests.py | import doctest
import glob
import pkg_resources
try:
pkg_resources.require('OWSLib')
except (ImportError, pkg_resources.DistributionNotFound):
pass
testfiles = glob.glob('*.txt')
for file in testfiles:
doctest.testfile(file)
| import doctest
import getopt
import glob
import sys
import pkg_resources
try:
pkg_resources.require('OWSLib')
except (ImportError, pkg_resources.DistributionNotFound):
pass
def run(pattern):
if pattern is None:
testfiles = glob.glob('*.txt')
else:
testfiles = glob.glob(pattern)
fo... | Add option to pick single test file from the runner | Add option to pick single test file from the runner
| Python | bsd-3-clause | datagovuk/OWSLib,kwilcox/OWSLib,QuLogic/OWSLib,KeyproOy/OWSLib,tomkralidis/OWSLib,menegon/OWSLib,datagovuk/OWSLib,datagovuk/OWSLib,dblodgett-usgs/OWSLib,ocefpaf/OWSLib,mbertrand/OWSLib,gfusca/OWSLib,jaygoldfinch/OWSLib,daf/OWSLib,JuergenWeichand/OWSLib,bird-house/OWSLib,geographika/OWSLib,kalxas/OWSLib,Jenselme/OWSLib,... | ---
+++
@@ -1,5 +1,8 @@
import doctest
+import getopt
import glob
+import sys
+
import pkg_resources
try:
@@ -7,8 +10,23 @@
except (ImportError, pkg_resources.DistributionNotFound):
pass
-testfiles = glob.glob('*.txt')
+def run(pattern):
+ if pattern is None:
+ testfiles = glob.glob('*.txt')
+... |
459546a9cedb8e9cf3bee67edb4a76d37874f03b | tests/test_athletics.py | tests/test_athletics.py | from nose.tools import ok_, eq_
from pennathletics.athletes import get_roster, get_player
class TestAthletics():
def test_roster(self):
ok_(get_roster("m-baskbl", 2015) != [])
def test_player_empty(self):
ok_(get_player("m-baskbl", 2014) != [])
def test_player_number(self):
eq_(g... | from nose.tools import ok_, eq_
from pennathletics.athletes import get_roster, get_player
class TestAthletics():
def test_roster(self):
ok_(get_roster("m-baskbl", 2015) != [])
def test_player_empty(self):
ok_(get_player("m-baskbl", 2014) != [])
def test_player_number(self):
eq_(g... | Add a few more tests for variety | Add a few more tests for variety
| Python | mit | pennlabs/pennathletics | ---
+++
@@ -11,3 +11,11 @@
def test_player_number(self):
eq_(get_player("m-baskbl", 2013, jersey=1)[0].height, "6'2\"")
+
+ def test_player_hometown(self):
+ player = get_player("m-baskbl", 2012, homeTown="Belfast, Ireland")[0]
+ eq_(player.weight, '210 lbs')
+
+ def test_player_so... |
921225181fc1d0242d61226c7b10663ddba1a1a2 | indra/tests/test_rlimsp.py | indra/tests/test_rlimsp.py | from indra.sources import rlimsp
def test_simple_usage():
stmts = rlimsp.process_pmc('PMC3717945')
| from indra.sources import rlimsp
def test_simple_usage():
rp = rlimsp.process_pmc('PMC3717945')
stmts = rp.statements
assert len(stmts) == 6, len(stmts)
def test_ungrounded_usage():
rp = rlimsp.process_pmc('PMC3717945', with_grounding=False)
assert len(rp.statements)
| Update test and add test for ungrounded endpoint. | Update test and add test for ungrounded endpoint.
| Python | bsd-2-clause | johnbachman/belpy,johnbachman/belpy,sorgerlab/indra,sorgerlab/belpy,sorgerlab/belpy,johnbachman/indra,pvtodorov/indra,johnbachman/indra,sorgerlab/belpy,johnbachman/indra,sorgerlab/indra,bgyori/indra,pvtodorov/indra,pvtodorov/indra,johnbachman/belpy,sorgerlab/indra,bgyori/indra,bgyori/indra,pvtodorov/indra | ---
+++
@@ -2,4 +2,11 @@
def test_simple_usage():
- stmts = rlimsp.process_pmc('PMC3717945')
+ rp = rlimsp.process_pmc('PMC3717945')
+ stmts = rp.statements
+ assert len(stmts) == 6, len(stmts)
+
+
+def test_ungrounded_usage():
+ rp = rlimsp.process_pmc('PMC3717945', with_grounding=False)
+ ass... |
c461c57a90804558a30f3980b2608497a43c06a7 | nipy/testing/__init__.py | nipy/testing/__init__.py | """The testing directory contains a small set of imaging files to be used
for doctests only. More thorough tests and example data will be stored in
a nipy-data-suite to be created later and downloaded separately.
Examples
--------
>>> from nipy.testing import funcfile
>>> from nipy.io.api import load_image
>>> img =... | """The testing directory contains a small set of imaging files to be
used for doctests only. More thorough tests and example data will be
stored in a nipy data packages that you can download separately - see
:mod:`nipy.utils.data`
.. note:
We use the ``nose`` testing framework for tests.
Nose is a dependenc... | Allow failed nose import without breaking nipy import | Allow failed nose import without breaking nipy import | Python | bsd-3-clause | bthirion/nipy,nipy/nipy-labs,alexis-roche/register,arokem/nipy,alexis-roche/niseg,alexis-roche/nireg,alexis-roche/niseg,alexis-roche/nipy,alexis-roche/register,nipy/nipy-labs,nipy/nireg,nipy/nireg,alexis-roche/register,alexis-roche/nipy,bthirion/nipy,arokem/nipy,alexis-roche/nireg,bthirion/nipy,arokem/nipy,bthirion/nip... | ---
+++
@@ -1,6 +1,15 @@
-"""The testing directory contains a small set of imaging files to be used
-for doctests only. More thorough tests and example data will be stored in
-a nipy-data-suite to be created later and downloaded separately.
+"""The testing directory contains a small set of imaging files to be
+used ... |
04fbd65f90a3ce821fed76377ce7858ae0dd56ee | masters/master.chromium.webrtc/master_builders_cfg.py | masters/master.chromium.webrtc/master_builders_cfg.py | # Copyright (c) 2015 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.
from buildbot.changes.filter import ChangeFilter
from buildbot.schedulers.basic import SingleBranchScheduler
from master.factory import annotator_factor... | # Copyright (c) 2015 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.
from buildbot.changes.filter import ChangeFilter
from buildbot.schedulers.basic import SingleBranchScheduler
from master.factory import annotator_factor... | Switch remaining chromium.webrtc builders to chromium recipe. | WebRTC: Switch remaining chromium.webrtc builders to chromium recipe.
Linux was switched in https://codereview.chromium.org/1508933002/
This switches the rest over to the chromium recipe.
BUG=538259
TBR=phajdan.jr@chromium.org
Review URL: https://codereview.chromium.org/1510853002 .
git-svn-id: 239fca9b83025a0b6f82... | Python | bsd-3-clause | eunchong/build,eunchong/build,eunchong/build,eunchong/build | ---
+++
@@ -29,15 +29,14 @@
{'name': 'Win10 Tester', 'category': 'win'},
{'name': 'Mac Builder', 'category': 'mac'},
{'name': 'Mac Tester', 'category': 'mac'},
- {'name': 'Linux Builder', 'recipe': 'chromium', 'category': 'linux'},
- {'name': 'Linux Tester', 'recipe': 'chromium', 'category': 'lin... |
45e86667311f4c9b79d90a3f86e71ffc072b1219 | oneflow/landing/admin.py | oneflow/landing/admin.py | # -*- coding: utf-8 -*-
from django.contrib import admin
from django.conf import settings
from .models import LandingContent
TRUNCATE_LENGTH = 50
content_fields_names = tuple(('content_' + code)
for code, lang
in settings.LANGUAGES)
content_fields_displays = ... | # -*- coding: utf-8 -*-
from django.contrib import admin
from django.conf import settings
from .models import LandingContent
from sparks.django.admin import truncate_field
content_fields_names = tuple(('content_' + code)
for code, lang
in settings.LANGUAGES)
c... | Move the `truncate_field` pseudo-decorator to sparks (which just released 1.17). | Move the `truncate_field` pseudo-decorator to sparks (which just released 1.17). | Python | agpl-3.0 | WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,1flow/1flow,1flow/1flow,WillianPaiva/1flow,1flow/1flow | ---
+++
@@ -3,8 +3,7 @@
from django.contrib import admin
from django.conf import settings
from .models import LandingContent
-
-TRUNCATE_LENGTH = 50
+from sparks.django.admin import truncate_field
content_fields_names = tuple(('content_' + code)
for code, lang
@@ -14,29 +13,20 @@
... |
b7e657134c21b62e78453b11f0745e0048e346bf | examples/simple_distribution.py | examples/simple_distribution.py | import sys
import time
from random import shuffle
from vania.fair_distributor import FairDistributor
def main():
# User input for the number of targets and objects.
users = ['user1', 'user2']
tasks = ['task1', 'task2']
preferences = [
[1, 2],
[2, 1],
]
# Run solver
start_t... | import sys
import time
from random import shuffle
from vania.fair_distributor import FairDistributor
def main():
# User input for the number of targets and objects.
users = ['user1', 'user2']
tasks = ['task1', 'task2']
preferences = [
[1, 2],
[2, 1],
]
# Run solver
distrib... | Remove time metrics from the simple example | Remove time metrics from the simple example
| Python | mit | Hackathonners/vania | ---
+++
@@ -14,10 +14,8 @@
]
# Run solver
- start_time = time.time()
distributor = FairDistributor(users, tasks, preferences)
output = distributor.distribute(output='problem.lp')
- elapsed_time = time.time() - start_time
# Output
print(output) |
a6e2c0fc837b17321e2979cb12ba2d0e69603eac | orderedmodel/__init__.py | orderedmodel/__init__.py | __all__ = ['OrderedModel', 'OrderedModelAdmin']
from models import OrderedModel
from admin import OrderedModelAdmin
| from .models import OrderedModel
from .admin import OrderedModelAdmin
__all__ = ['OrderedModel', 'OrderedModelAdmin']
try:
from django.conf import settings
except ImportError:
pass
else:
if 'mptt' in settings.INSTALLED_APPS:
from .mptt_models import OrderableMPTTModel
from .mptt_admin impo... | Make it easy importing of OrderableMPTTModel and OrderedMPTTModelAdmin in from orderedmodel module | Make it easy importing of OrderableMPTTModel and OrderedMPTTModelAdmin in from orderedmodel module
| Python | bsd-3-clause | MagicSolutions/django-orderedmodel,MagicSolutions/django-orderedmodel | ---
+++
@@ -1,4 +1,14 @@
+from .models import OrderedModel
+from .admin import OrderedModelAdmin
+
__all__ = ['OrderedModel', 'OrderedModelAdmin']
-from models import OrderedModel
-from admin import OrderedModelAdmin
+try:
+ from django.conf import settings
+except ImportError:
+ pass
+else:
+ if 'mptt' i... |
163cfea2a0c5e7d96dd870aa540c95a2ffa139f9 | appstats/filters.py | appstats/filters.py | # encoding: utf-8
import json
def json_filter(value):
return json.dumps(value)
def count_filter(value):
if value is None:
return ""
count = float(value)
base = 1000
prefixes = [
('K'),
('M'),
('G'),
('T'),
('P'),
('E'),
('Z'),
... | # encoding: utf-8
import json
def json_filter(value):
return json.dumps(value)
def count_filter(value):
if value is None:
return ""
count = float(value)
base = 1000
prefixes = [
('K'),
('M'),
('G'),
('T'),
('P'),
('E'),
('Z'),
... | Join two lines in one | Join two lines in one
| Python | mit | uvNikita/appstats,uvNikita/appstats,uvNikita/appstats | ---
+++
@@ -35,9 +35,8 @@
def time_filter(value):
if value is None:
return ""
- time = float(value)
# Transform secs into ms
- time = value * 1000
+ time = float(value) * 1000
if time < 1000:
return '%.1f ms' % time
else: |
fc94d60066692e6e8dc496bb854039bb66af3311 | scout.py | scout.py |
# Python does not require explicit interfaces,
# but I believe that code which does is more
# maintainable. Thus I include this explicit
# interface for Problems.
class Problem:
def getStartState(self):
return None
def getEndState(self):
return None
def isValidState(self, state):
... |
# Python does not require explicit interfaces,
# but I believe that code which does is more
# maintainable. Thus I include this explicit
# interface for Problems.
class Problem:
def getStartState(self):
return None
def getEndState(self):
return None
def isValidState(self, state):
... | Add a simple problem for testing | Add a simple problem for testing
| Python | mit | SpexGuy/Scout | ---
+++
@@ -20,11 +20,32 @@
return "BadProblem"
+class SquareProblem(Problem):
+ def __init__(self, size):
+ self.size = size
+
+ def getStartState(self):
+ return (0, 0)
+
+ def getEndState(self):
+ return (self.size, self.size)
+
+ def isValidState(self, state):
+ ... |
928290ac4659c5da387b6bd511818b31535eb09e | setup.py | setup.py | # coding=utf-8
from setuptools import setup, find_packages
long_description = open('README.md').read()
VERSION = "0.1.10"
setup(
name="PyTrustNFe",
version=VERSION,
author="Danimar Ribeiro",
author_email='danimaribeiro@gmail.com',
keywords=['nfe', 'mdf-e'],
classifiers=[
'Development ... | # coding=utf-8
from setuptools import setup, find_packages
VERSION = "0.1.11"
setup(
name="PyTrustNFe",
version=VERSION,
author="Danimar Ribeiro",
author_email='danimaribeiro@gmail.com',
keywords=['nfe', 'mdf-e'],
classifiers=[
'Development Status :: 3 - Alpha',
'Environment ::... | FIX - No such file or directory: 'README.md' | FIX - No such file or directory: 'README.md'
| Python | agpl-3.0 | danimaribeiro/PyTrustNFe | ---
+++
@@ -1,9 +1,7 @@
# coding=utf-8
from setuptools import setup, find_packages
-long_description = open('README.md').read()
-
-VERSION = "0.1.10"
+VERSION = "0.1.11"
setup(
name="PyTrustNFe",
@@ -27,7 +25,7 @@
url='https://github.com/danimaribeiro/PyTrustNFe',
license='LGPL-v2.1+',
desc... |
5801bf2644b26fc93ade4651ec9b2cc4c58d25ec | setup.py | setup.py | """Rachiopy setup script."""
from setuptools import find_packages, setup
version = "0.2.0"
GITHUB_USERNAME = "rfverbruggen"
GITHUB_REPOSITORY = "rachiopy"
GITHUB_PATH = f"{GITHUB_USERNAME}/{GITHUB_REPOSITORY}"
GITHUB_URL = f"https://github.com/{GITHUB_PATH}"
DOWNLOAD_URL = f"{GITHUB_URL}/archive/{VERSION}.tar.gz"
P... | """Rachiopy setup script."""
from setuptools import find_packages, setup
VERSION = "0.2.0"
GITHUB_USERNAME = "rfverbruggen"
GITHUB_REPOSITORY = "rachiopy"
GITHUB_PATH = f"{GITHUB_USERNAME}/{GITHUB_REPOSITORY}"
GITHUB_URL = f"https://github.com/{GITHUB_PATH}"
DOWNLOAD_URL = f"{GITHUB_URL}/archive/{VERSION}.tar.gz"
P... | Convert to using requests to resolve ssl errors | Convert to using requests to resolve ssl errors
| Python | mit | rfverbruggen/rachiopy | ---
+++
@@ -1,7 +1,7 @@
"""Rachiopy setup script."""
from setuptools import find_packages, setup
-version = "0.2.0"
+VERSION = "0.2.0"
GITHUB_USERNAME = "rfverbruggen"
GITHUB_REPOSITORY = "rachiopy" |
b07b4194528e08526be60b04413e40eb64d313d8 | setup.py | setup.py | import versioneer
from setuptools import setup
setup(
name='domain_events',
version=versioneer.get_version(),
cmdclass = versioneer.get_cmdclass(),
desription='Ableton Domain Events via Rabbitmq',
author='the Ableton web team',
author_email='webteam@ableton.com',
license='MIT',
package... | import versioneer
from setuptools import setup
setup(
name='domain_events',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='Send and receive domain events via RabbitMQ',
author='Ableton AG',
author_email='webteam@ableton.com',
url='https://github.com/Able... | Fix project description and add repository URL | Fix project description and add repository URL
| Python | mit | AbletonAG/domain-events | ---
+++
@@ -5,10 +5,11 @@
setup(
name='domain_events',
version=versioneer.get_version(),
- cmdclass = versioneer.get_cmdclass(),
- desription='Ableton Domain Events via Rabbitmq',
- author='the Ableton web team',
+ cmdclass=versioneer.get_cmdclass(),
+ description='Send and receive domain ev... |
4f722f2574740e79bda114fcd27d0f81ee6ce102 | setup.py | setup.py | import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
required = ['requests>=0.11.2',
'requests-oauth2>=0.2.1']
setup(
name='basecampx',
version='0.1.7',
... | import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
required = ['requests>=0.11.2',
'requests-oauth2>=0.2.0']
setup(
name='basecampx',
version='0.1.7',
... | Use the correct Requests OAuth lib version (previously we used a patched lib). | Use the correct Requests OAuth lib version (previously we used a patched lib).
| Python | mit | nous-consulting/basecamp-next | ---
+++
@@ -9,7 +9,7 @@
return open(os.path.join(os.path.dirname(__file__), fname)).read()
required = ['requests>=0.11.2',
- 'requests-oauth2>=0.2.1']
+ 'requests-oauth2>=0.2.0']
setup(
name='basecampx', |
7caf008f5442baff92cd820d3fd3a059293a3e5d | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name='icalendar',
version='0.10',
description='iCalendar support module',
package_dir = {'': 'src'},
packages=['icalendar'],
)
| #!/usr/bin/env python
from distutils.core import setup
f = open('version.txt', 'r')
version = f.read().strip()
f.close()
setup(name='icalendar',
version=version,
description='iCalendar support module',
package_dir = {'': 'src'},
packages=['icalendar'],
)
| Tweak so that version information is picked up from version.txt. | Tweak so that version information is picked up from version.txt.
git-svn-id: aa2e0347f72f9208cad9c7a63777f32311fef72e@11576 fd0d7bf2-dfb6-0310-8d31-b7ecfe96aada
| Python | lgpl-2.1 | greut/iCalendar,ryba-xek/iCalendar,offby1/icalendar | ---
+++
@@ -2,8 +2,12 @@
from distutils.core import setup
+f = open('version.txt', 'r')
+version = f.read().strip()
+f.close()
+
setup(name='icalendar',
- version='0.10',
+ version=version,
description='iCalendar support module',
package_dir = {'': 'src'},
packages=['icalendar'], |
17594ab5b3d591ae8c45c30834fefbe49644cb5f | setup.py | setup.py | import setuptools
setuptools.setup(
name='sprockets.handlers.status',
version='0.1.2',
description='A small handler for reporting application status',
long_description=open('test-requirements.txt', 'r').read(),
url='https://github.com/sprockets/sprockets.handlers.status',
author='AWeber Communi... | import codecs
import setuptools
setuptools.setup(
name='sprockets.handlers.status',
version='0.1.2',
description='A small handler for reporting application status',
long_description=codecs.open('README.rst', 'r', 'utf8').read(),
url='https://github.com/sprockets/sprockets.handlers.status',
auth... | Read the readme instead of the test requirements | Read the readme instead of the test requirements
| Python | bsd-3-clause | sprockets/sprockets.handlers.status | ---
+++
@@ -1,10 +1,11 @@
+import codecs
import setuptools
setuptools.setup(
name='sprockets.handlers.status',
version='0.1.2',
description='A small handler for reporting application status',
- long_description=open('test-requirements.txt', 'r').read(),
+ long_description=codecs.open('README.... |
24b112885d7611fca4186cd97bdee97ea2f934c3 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name = 'annotator',
version = '0.7.3',
packages = find_packages(),
install_requires = [
'Flask==0.8',
'pyes==0.16.0',
'PyJWT==0.1.4',
'nose==1.1.2',
'mock==0.8.0'
],
# metadata for upload to PyPI
au... | from setuptools import setup, find_packages
setup(
name = 'annotator',
version = '0.7.3',
packages = find_packages(),
install_requires = [
'Flask==0.8',
'pyes==0.16.0',
'PyJWT==0.1.4',
'iso8601==0.1.4',
'nose==1.1.2',
'mock==0.8.0'
],
# metadata... | Fix missing dep on iso8601 | Fix missing dep on iso8601
| Python | mit | nobita-isc/annotator-store,nobita-isc/annotator-store,ningyifan/annotator-store,nobita-isc/annotator-store,nobita-isc/annotator-store,happybelly/annotator-store,openannotation/annotator-store | ---
+++
@@ -9,6 +9,7 @@
'Flask==0.8',
'pyes==0.16.0',
'PyJWT==0.1.4',
+ 'iso8601==0.1.4',
'nose==1.1.2',
'mock==0.8.0'
], |
1963d144362a66ca39ffdb909163ef4301a8048d | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
README = readme_file.read()
install_requires = [
'click==6.6',
'botocore>=1.5.40,<2.0.0',
'typing==3.5.3.0',
'six>=1.10.0,<2.0.0',
'pip>=9,<10'
]
setup(
name='chalice',
version=... | #!/usr/bin/env python
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
README = readme_file.read()
install_requires = [
'click==6.6',
'botocore>=1.5.40,<2.0.0',
'typing==3.5.3.0',
'six>=1.10.0,<2.0.0',
'pip>=9,<10'
]
setup(
name='chalice',
version=... | Change status from Beta to Production/Stable | Change status from Beta to Production/Stable
| Python | apache-2.0 | awslabs/chalice | ---
+++
@@ -35,7 +35,7 @@
]
},
classifiers=[
- 'Development Status :: 4 - Beta',
+ 'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English', |
8646a5a111993dc58c322d3c6154b2d6197fdb06 | setup.py | setup.py | from setuptools import setup
setup(
name='flask_flaskwork',
description='A Flask plugin to talk with the Flaskwork Chrome extension.',
version='0.1.12',
license='BSD',
author='Tim Radke',
author_email='tim.is@self-proclaimed.ninja',
py_modules=['flask_flaskwork'],
zip_safe=False,
in... | from setuptools import setup
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='flask_flaskwork',
description='A Flask plugin to talk with the Flaskwork Chrome extensi... | Add description from README to pypi | Add description from README to pypi
| Python | mit | countach74/flask_flaskwork | ---
+++
@@ -1,4 +1,10 @@
from setuptools import setup
+from os import path
+
+
+this_directory = path.abspath(path.dirname(__file__))
+with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
+ long_description = f.read()
setup(
name='flask_flaskwork',
@@ -9,6 +15,8 @@
author_email='... |
cb4421529e9564f110b84f590f14057eda8746c8 | setup.py | setup.py | from setuptools import setup
from setuptools.command.install import install as _install
class install(_install):
def run(self):
_install.run(self)
setup(
cmdclass = { 'install' : install },
name = 'hydra',
version = '0.1',
author = 'tatsy',
author_email = 'tatsy.mail@gmail.com',
ur... | from setuptools import setup
from setuptools.command.install import install as _install
class install(_install):
def run(self):
_install.run(self)
setup(
cmdclass = { 'install' : install },
name = 'hydra',
version = '0.1',
author = 'tatsy',
author_email = 'tatsy.mail@gmail.com',
ur... | Add eo to installed packages. | Add eo to installed packages.
| Python | mit | tatsy/hydra | ---
+++
@@ -23,9 +23,10 @@
packages = [
'hydra',
'hydra.core',
+ 'hydra.eo',
+ 'hydra.filters',
'hydra.gen',
'hydra.io',
- 'hydra.filters',
'hydra.tonemap'
]
) |
3165cbdd418a38f72f2b638797b692589452528c | setup.py | setup.py | try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='debexpo',
version="",
#description='',
#author='',
#author_email='',
#url='',
install_requires=[... | try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='debexpo',
version="",
#description='',
#author='',
#author_email='',
#url='',
install_requires=[... | Make library dependencies python-debian a bit more sane | Make library dependencies python-debian a bit more sane
| Python | mit | jonnylamb/debexpo,jonnylamb/debexpo,jadonk/debexpo,jonnylamb/debexpo,jadonk/debexpo,swvist/Debexpo,swvist/Debexpo,swvist/Debexpo,jadonk/debexpo | ---
+++
@@ -18,7 +18,7 @@
"Webhelpers>=0.6.1",
"Babel>=0.9.6",
"ZSI",
- "python-debian==0.1.16",
+ "python-debian>=0.1.16",
"soaplib==0.8.1"],
packages=find_packages(exclude=['ez_setup']),
include_package_data=True, |
8421166d2d374113e0c9cff92075250269daee76 | setup.py | setup.py | import sys
sys.path.insert(0, 'src')
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='ibmiotf',
version="0.2.7",
author='David Parker',
author_email='parkerda@uk.ibm.com',
package_dir={'': 'src'},
packages=['ibmiotf', 'ibmiotf.codecs']... | import sys
sys.path.insert(0, 'src')
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='ibmiotf',
version="0.2.7",
author='David Parker',
author_email='parkerda@uk.ibm.com',
package_dir={'': 'src'},
packages=['ibmiotf', 'ibmiotf.codecs']... | Add xmltodict and dicttoxml to install_requires | Add xmltodict and dicttoxml to install_requires
| Python | epl-1.0 | ibm-watson-iot/iot-python,ibm-messaging/iot-python,Lokesh-K-Haralakatta/iot-python,ibm-watson-iot/iot-python | ---
+++
@@ -16,14 +16,16 @@
package_data={'ibmiotf': ['*.pem']},
url='https://github.com/ibm-watson-iot/iot-python',
license=open('LICENSE').read(),
- description='IBM Watson IoT Platform Client for Python',
+ description='Python Client for IBM Watson IoT Platform',
long_description=open('RE... |
9d180976b27213cf2c59e34a5aefec6335a1deca | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.7.2'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredis',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://w... | #!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.7.2'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredis',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://w... | Use bintrees to implement sorted sets. | Use bintrees to implement sorted sets.
| Python | apache-2.0 | matejkloska/mockredis,locationlabs/mockredis,optimizely/mockredis,yossigo/mockredis,path/mockredis | ---
+++
@@ -18,6 +18,7 @@
'nose==1.2.1'
],
install_requires=[
+ 'bintrees==1.0.1'
],
tests_require=[
'redis>=2.7.2' |
4b451e7c2e399baac311727de407db9138e97e56 | setup.py | setup.py | from skbuild import setup
setup(
name="avogadrolibs",
version="0.0.8",
description="",
author='Kitware',
license="BSD",
packages=['avogadro'],
cmake_args=[
'-DUSE_SPGLIB:BOOL=FALSE',
'-DUSE_OPENGL:BOOL=FALSE',
'-DUSE_QT:BOOL=FALSE',
'-DUSE_MMTF:BOOL=FALSE',
... | from skbuild import setup
setup(
name="avogadro",
version="0.0.8",
description="",
author='Kitware',
license="BSD",
packages=['avogadro'],
cmake_args=[
'-DUSE_SPGLIB:BOOL=FALSE',
'-DUSE_OPENGL:BOOL=FALSE',
'-DUSE_QT:BOOL=FALSE',
'-DUSE_MMTF:BOOL=FALSE',
... | Rename distribution avogadrolibs => avogadro | Rename distribution avogadrolibs => avogadro
Signed-off-by: Chris Harris <a361e89d1eba6c570561222d75facbbf7aaeeafe@kitware.com>
| Python | bsd-3-clause | ghutchis/avogadrolibs,OpenChemistry/avogadrolibs,OpenChemistry/avogadrolibs,OpenChemistry/avogadrolibs,ghutchis/avogadrolibs,ghutchis/avogadrolibs,ghutchis/avogadrolibs,OpenChemistry/avogadrolibs,OpenChemistry/avogadrolibs,ghutchis/avogadrolibs | ---
+++
@@ -1,7 +1,7 @@
from skbuild import setup
setup(
- name="avogadrolibs",
+ name="avogadro",
version="0.0.8",
description="",
author='Kitware', |
8597b77de45621292801a51f6a72a678a19dee57 | setup.py | setup.py | #!/usr/bin/env python
import subprocess
from setuptools import setup, find_packages
import os
def git_version():
def _minimal_ext_cmd(cmd):
# construct minimal environment
env = {}
for k in ['SYSTEMROOT', 'PATH']:
v = os.environ.get(k)
if v is not None:
... | #!/usr/bin/env python
import subprocess
from setuptools import setup, find_packages
import os
def git_version():
def _minimal_ext_cmd(cmd):
# construct minimal environment
env = {}
for k in ['SYSTEMROOT', 'PATH']:
v = os.environ.get(k)
if v is not None:
... | Update release number to 0.2.3 | Update release number to 0.2.3
| Python | mit | awhite40/pymks,davidbrough1/pymks,fredhohman/pymks,davidbrough1/pymks,XinyiGong/pymks | ---
+++
@@ -41,7 +41,7 @@
return version + '-dev.' + _git_version
setup(name='pymks',
- version=getVersion('0.2.1', release=True),
+ version=getVersion('0.2.3', release=True),
description='Materials Knowledge Systems in Python (PyMKS)',
author='David Brough, Daniel Wheeler',
... |
0574705dcbc473805aee35b482a41bdef060b0c9 | setup.py | setup.py | from distutils.core import setup
import py2pack
with open('README') as f:
README = f.read()
setup(
name = py2pack.__name__,
version = py2pack.__version__,
license = "GPLv2",
description = py2pack.__doc__,
long_description = README,
author = py2pack.__author__.rsplit(' ', 1)[0],
author_... | from distutils.core import setup
import py2pack
setup(
name = py2pack.__name__,
version = py2pack.__version__,
license = "GPLv2",
description = py2pack.__doc__,
long_description = open('README').read(),
author = py2pack.__author__.rsplit(' ', 1)[0],
author_email = py2pack.__author__.rsplit(... | Load README file traditionally, with-statement is not supported by older Python releases. | Load README file traditionally, with-statement is not supported by older
Python releases.
| Python | apache-2.0 | saschpe/py2pack,toabctl/py2pack | ---
+++
@@ -1,15 +1,12 @@
from distutils.core import setup
import py2pack
-
-with open('README') as f:
- README = f.read()
setup(
name = py2pack.__name__,
version = py2pack.__version__,
license = "GPLv2",
description = py2pack.__doc__,
- long_description = README,
+ long_description ... |
6d0307c7d145b02f7659efbed164833983cf1fcc | setup.py | setup.py | #!/usr/bin/env python
import sys
from setuptools import setup, find_packages
try:
import multiprocessing # NOQA
except ImportError:
pass
install_requires = ['mock']
lint_requires = ['pep8', 'pyflakes']
tests_require = ['nose']
if sys.version_info < (2, 7):
tests_require.append('unittest2')
setup_requi... | #!/usr/bin/env python
import sys
from setuptools import setup, find_packages
try:
import multiprocessing # NOQA
except ImportError:
pass
install_requires = ['mock']
lint_requires = ['pep8', 'pyflakes']
tests_require = ['nose']
if sys.version_info < (2, 7):
tests_require.append('unittest2')
setup_requi... | Document the supported versions of Python | Document the supported versions of Python | Python | mit | Fluxx/exam,Fluxx/exam,gterzian/exam,gterzian/exam | ---
+++
@@ -39,4 +39,13 @@
},
zip_safe=False,
test_suite='nose.collector',
+ classifiers=[
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 2",
+ "Programming Language :: Python :: 2.6",
+ "Programming Language :: Python :: 2.7",
+ "Programm... |
6bece40a1a0c8977c6211234e5aa4e64ad5b01a2 | linguine/ops/StanfordCoreNLP.py | linguine/ops/StanfordCoreNLP.py | #!/usr/bin/env python
import os
"""
Performs some core NLP operations as a proof of concept for the library.
"""
from stanford_corenlp_pywrapper import CoreNLP
class StanfordCoreNLP:
proc = None
"""
When the JSON segments return from the CoreNLP library, they
separate the data acquired from eac... | #!/usr/bin/env python
import os
"""
Performs some core NLP operations as a proof of concept for the library.
"""
from stanford_corenlp_pywrapper import CoreNLP
class StanfordCoreNLP:
proc = None
"""
When the JSON segments return from the CoreNLP library, they
separate the data acquired from eac... | Return entire corpus from corenlp analysis | Return entire corpus from corenlp analysis
| Python | mit | Pastafarians/linguine-python,rigatoni/linguine-python | ---
+++
@@ -22,9 +22,8 @@
def jsonCleanup(self, data, analysisTypes):
for corpus in data:
res = StanfordCoreNLP.proc.parse_doc(corpus.contents)
- print(str(res));
+ words = []
for sentence in res["sentences"]:
- words = []
for index, token ... |
468a66c0945ce9e78fb5da8a6a628ce581949759 | livinglots_usercontent/views.py | livinglots_usercontent/views.py | from django.views.generic import CreateView
from braces.views import FormValidMessageMixin
from livinglots_genericviews import AddGenericMixin
class AddContentView(FormValidMessageMixin, AddGenericMixin, CreateView):
def _get_content_name(self):
return self.form_class._meta.model._meta.object_name
... | from django.views.generic import CreateView
from braces.views import FormValidMessageMixin
from livinglots_genericviews import AddGenericMixin
class AddContentView(FormValidMessageMixin, AddGenericMixin, CreateView):
def _get_content_name(self):
return self.form_class._meta.model._meta.object_name
... | Set added_by_name if we can | Set added_by_name if we can
| Python | agpl-3.0 | 596acres/django-livinglots-usercontent,596acres/django-livinglots-usercontent | ---
+++
@@ -12,6 +12,17 @@
def get_form_valid_message(self):
return '%s added successfully.' % self._get_content_name()
+
+ def get_initial(self):
+ initial = super(AddContentView, self).get_initial()
+ user = self.request.user
+
+ # If user has name, set that for them
+ ... |
77c69f592fe35ac4e3087366da084b7a73f21ee6 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='panoptescli',
version='1.1.1',
url='https://github.com/zooniverse/panoptes-cli',
author='Adam McMaster',
author_email='adam@zooniverse.org',
description=(
'A command-line client for Panoptes, the API behind the Zooniverse'
),
... | from setuptools import setup, find_packages
setup(
name='panoptescli',
version='1.1.1',
url='https://github.com/zooniverse/panoptes-cli',
author='Adam McMaster',
author_email='adam@zooniverse.org',
description=(
'A command-line client for Panoptes, the API behind the Zooniverse'
),
... | Update pyyaml requirement from <5.2,>=5.1 to >=5.1,<5.3 | Update pyyaml requirement from <5.2,>=5.1 to >=5.1,<5.3
Updates the requirements on [pyyaml](https://github.com/yaml/pyyaml) to permit the latest version.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES)
- [Commits](https://github.com/yaml/pyy... | Python | apache-2.0 | zooniverse/panoptes-cli | ---
+++
@@ -13,7 +13,7 @@
include_package_data=True,
install_requires=[
'Click>=6.7,<7.1',
- 'PyYAML>=5.1,<5.2',
+ 'PyYAML>=5.1,<5.3',
'panoptes-client>=1.0,<2.0',
'humanize>=0.5.1,<0.6',
'pathvalidate>=0.29.0,<0.30', |
3b692018632fef7e632086ed2ef5a980ad6f6c2f | setup.py | setup.py | #-*- coding: utf-8 -*-
from setuptools import setup
version = "1.0.post1"
setup(
name = "django-easy-pjax",
version = version,
description = "Easy PJAX for Django.",
license = "BSD",
author = "Filip Wasilewski",
author_email = "en@ig.ma",
url = "https://github.com/nigma/django-easy-pjax... | #-*- coding: utf-8 -*-
from setuptools import setup
version = "1.0.post1"
setup(
name = "django-easy-pjax",
version = version,
description = "Easy PJAX for Django.",
license = "BSD",
author = "Filip Wasilewski",
author_email = "en@ig.ma",
url = "https://github.com/nigma/django-easy-pjax... | Update trove classifiers and django test version requirements | Update trove classifiers and django test version requirements
| Python | bsd-3-clause | Kondou-ger/django-easy-pjax,nigma/django-easy-pjax,nigma/django-easy-pjax,Kondou-ger/django-easy-pjax,Kondou-ger/django-easy-pjax,nigma/django-easy-pjax | ---
+++
@@ -26,13 +26,14 @@
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
- "Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",... |
c470da4fcf5bec84c255aa4514f6fd764781eb1a | setup.py | setup.py | from distutils.core import setup
ext_files = ["pyreBloom/bloom.c"]
kwargs = {}
try:
from Cython.Distutils import build_ext
from Cython.Distutils import Extension
print "Building from Cython"
ext_files.append("pyreBloom/pyreBloom.pyx")
kwargs['cmdclass'] = {'build_ext': build_ext}
except ImportErr... | from distutils.core import setup
ext_files = ["pyreBloom/bloom.c"]
kwargs = {}
try:
from Cython.Distutils import build_ext
from Cython.Distutils import Extension
print "Building from Cython"
ext_files.append("pyreBloom/pyreBloom.pyx")
kwargs['cmdclass'] = {'build_ext': build_ext}
except ImportErr... | Fix build with newer dependencies. | Fix build with newer dependencies.
| Python | mit | seomoz/pyreBloom,seomoz/pyreBloom,seomoz/pyreBloom | ---
+++
@@ -15,7 +15,9 @@
ext_files.append("pyreBloom/pyreBloom.c")
print "Building from C"
-ext_modules = [Extension("pyreBloom", ext_files, libraries=['hiredis'])]
+ext_modules = [Extension("pyreBloom", ext_files, libraries=['hiredis'],
+ library_dirs=['/usr/local/lib'],
+ ... |
34eadaca8901706fd51dc12df5c63cf4c966249e | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-bitfield',
version='1.9.0',
author='DISQUS',
author_email='opensource@disqus.com',
url='https://github.com/disqus/django-bitfield',
description='BitField in Django',
packages=find_packages(),
zip_safe... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-bitfield',
version='1.9.0',
author='DISQUS',
author_email='opensource@disqus.com',
url='https://github.com/disqus/django-bitfield',
description='BitField in Django',
packages=find_packages(),
zip_safe... | Set Django requirement to the last LTS | Set Django requirement to the last LTS
| Python | apache-2.0 | disqus/django-bitfield,Elec/django-bitfield,joshowen/django-bitfield | ---
+++
@@ -12,7 +12,7 @@
packages=find_packages(),
zip_safe=False,
install_requires=[
- 'Django>=1.10',
+ 'Django>=1.8',
'six',
],
extras_require={ |
fddc1198d54a8a868bd8b97ed7318feeb00f6725 | setup.py | setup.py | from setuptools import setup
VERSION = '0.2.8'
setup(
name='jinja2_standalone_compiler',
packages=['jinja2_standalone_compiler', ],
version=VERSION,
author='Filipe Waitman',
author_email='filwaitman@gmail.com',
install_requires=[x.strip() for x in open('requirements.txt').readlines()],
ur... | from setuptools import setup
VERSION = '0.2.9'
setup(
name='jinja2_standalone_compiler',
packages=['jinja2_standalone_compiler', ],
version=VERSION,
author='Filipe Waitman',
author_email='filwaitman@gmail.com',
install_requires=[x.strip() for x in open('requirements.txt').readlines()],
ur... | Add keywords and bump to 0.2.9 | Add keywords and bump to 0.2.9
| Python | mit | filwaitman/jinja2-standalone-compiler | ---
+++
@@ -1,6 +1,6 @@
from setuptools import setup
-VERSION = '0.2.8'
+VERSION = '0.2.9'
setup(
@@ -13,6 +13,7 @@
url='https://github.com/filwaitman/jinja2-standalone-compiler',
download_url='https://github.com/filwaitman/jinja2-standalone-compiler/tarball/{}'.format(VERSION),
test_suite='tes... |
7fe0a7d03a13834f390180907265b8f83a978385 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='django-facebook',
version='0.1',
description='Replace Django Authentication with Facebook',
long_description=open('README.md').read(),
author='Aidan Lister',
author_email='aidan@php.net',
url='http://github.com/pythonforfacebook/djang... | from setuptools import setup, find_packages
setup(
name='django-facebook',
version='0.1',
description='Replace Django Authentication with Facebook',
long_description=open('README.md').read(),
author='Aidan Lister',
author_email='aidan@php.net',
url='http://github.com/pythonforfacebook/djang... | Update 'install_requires' to right versions | Update 'install_requires' to right versions
| Python | mit | tino/django-facebook2,tino/django-facebook2 | ---
+++
@@ -12,8 +12,8 @@
include_package_data=True,
zip_safe=False,
install_requires=[
- 'django>=1.2.7',
- 'facebook-sdk>=0.2.0,==dev',
+ 'django>=1.5',
+ 'facebook-sdk==0.4.0',
],
dependency_links=[
'https://github.com/pythonforfacebook/facebook-sdk/tar... |
8b4d4ace387d2d366ae03ef14883942908167ad4 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='stix2-matcher',
version="0.1.0",
packages=find_packages(),
description='Match STIX content against STIX patterns',
install_requires=[
"antlr4-python2-runtime==4.7 ; python_version < '3'",
"antlr4-python3-runtime==4.7 ; python_... | from setuptools import setup, find_packages
setup(
name='stix2-matcher',
version="0.1.0",
packages=find_packages(),
description='Match STIX content against STIX patterns',
install_requires=[
"antlr4-python2-runtime==4.7 ; python_version < '3'",
"antlr4-python3-runtime==4.7 ; python_... | Bump required version of stix2-patterns. | Bump required version of stix2-patterns.
| Python | bsd-3-clause | chisholm/cti-pattern-matcher,oasis-open/cti-pattern-matcher | ---
+++
@@ -12,7 +12,7 @@
"enum34 ; python_version ~= '3.3.0'",
"python-dateutil",
"six",
- "stix2-patterns>=0.4.1",
+ "stix2-patterns>=0.5.0",
],
tests_require=[
"pytest>=2.9.2" |
25df3a8b74e9e7f03d6239fcb5f2afaa38d4b4ee | setup.py | setup.py | from setuptools import setup, find_packages
with open('README.rst') as f:
long_description = f.read()
setup(
name='jiradoc',
version='0.1',
description='A small Python module to parse JIRAdoc markup files and insert them into JIRA',
long_description=long_description,
url='https://github.com/lu... | from setuptools import setup, find_packages
with open('README.rst') as f:
long_description = f.read()
setup(
name='jiradoc',
version='0.1',
description='A small Python module to parse JIRAdoc markup files and insert them into JIRA',
long_description=long_description,
url='https://github.com/lu... | Add sample config to the package data | Add sample config to the package data
| Python | mit | lucianovdveekens/jiradoc | ---
+++
@@ -14,7 +14,7 @@
packages=find_packages(),
install_requires=['ply', 'jira', 'pyyaml', 'appdirs'],
package_data={
- 'jiradoc': ['data/test.jiradoc']
+ 'jiradoc': ['data/test.jiradoc', 'data/sample_config.yml']
},
entry_points={
'console_scripts': [ |
a15ace7fdabbfd9943fe388e4177627f09894f4b | slack.py | slack.py | import httplib
import urllib
import json
class Slack:
def __init__(self, webhook_path, url='hooks.slack.com', channel='#sigbridge',
username="sb-bot", icon=":satellite:"):
self.web_hook_url = url
self.webhook_path = webhook_path
self.channel = channel
self.user... | import httplib
import urllib
import json
class Slack:
def __init__(self, webhook_path, url='hooks.slack.com', channel='#test_bed',
username="sb-bot", icon=":satellite:"):
self.web_hook_url = url
self.webhook_path = webhook_path
self.channel = channel
self.userna... | Change default channel to test_bed | Change default channel to test_bed
| Python | mit | nafooesi/sigbridge | ---
+++
@@ -4,7 +4,7 @@
class Slack:
- def __init__(self, webhook_path, url='hooks.slack.com', channel='#sigbridge',
+ def __init__(self, webhook_path, url='hooks.slack.com', channel='#test_bed',
username="sb-bot", icon=":satellite:"):
self.web_hook_url = url
self.we... |
23f59f95ea3e7d6504e03949a1400be452166d17 | buildPy2app.py | buildPy2app.py | """
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
from glob import glob
import syncplay
APP = ['syncplayClient.py']
DATA_FILES = [
('resources', glob('resources/*.png') + glob('resources/*.rtf') + glob('resources/*.lua')),
]
OPTIONS = {
'icon... | """
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
from glob import glob
import syncplay
APP = ['syncplayClient.py']
DATA_FILES = [
('resources', glob('resources/*.png') + glob('resources/*.rtf') + glob('resources/*.lua')),
]
OPTIONS = {
'icon... | Update py2app script for Qt 5.11 | Update py2app script for Qt 5.11
| Python | apache-2.0 | NeverDecaf/syncplay,alby128/syncplay,alby128/syncplay,Syncplay/syncplay,Syncplay/syncplay,NeverDecaf/syncplay | ---
+++
@@ -17,7 +17,7 @@
'iconfile':'resources/icon.icns',
'includes': {'PySide2.QtCore', 'PySide2.QtUiTools', 'PySide2.QtGui','PySide2.QtWidgets', 'certifi'},
'excludes': {'PySide', 'PySide.QtCore', 'PySide.QtUiTools', 'PySide.QtGui'},
- 'qt_plugins': ['platforms/libqcocoa.dylib', 'platforms/libqminimal... |
1d5175beedeed2a2ae335a41380280a2ed39901b | lambda/control/commands.py | lambda/control/commands.py | from __future__ import print_function
import shlex
from traceback import format_exception
from obj import Obj
import click
from click.testing import CliRunner
runner = CliRunner()
@click.group(name='')
@click.argument('user', required=True)
@click.pass_context
def command(ctx, user, **kwargs):
ctx.obj = Obj(us... | from __future__ import print_function
import shlex
from traceback import format_exception
from obj import Obj
import click
from click.testing import CliRunner
runner = CliRunner()
@click.group(name='')
@click.argument('user', required=True)
@click.pass_context
def command(ctx, user, **kwargs):
ctx.obj = Obj(us... | Make the echo command actually echo all its parameters. | Make the echo command actually echo all its parameters.
| Python | mit | ilg/LambdaMLM | ---
+++
@@ -22,9 +22,14 @@
click.echo('This is the about command.')
@command.command()
+@click.argument('stuff', nargs=-1, required=False)
@click.pass_context
-def echo(ctx, **kwargs):
+def echo(ctx, stuff, **kwargs):
click.echo('This is the echo command. You are {}.'.format(ctx.obj.user))
+ if stuf... |
f80c11efb4bcbca6d20cdbbc1a552ebb04aa8302 | api/config/settings/production.py | api/config/settings/production.py | import os
import dj_database_url
from .base import *
# BASE_NAME and BASE_DOMAIN are intentionally unset
# They are only needed to seed data in staging and local
BASE_URL = "https://voterengagement.com"
###############################################################################
# Core
SECRET_KEY = os.environ['... | import os
import dj_database_url
from .base import *
# BASE_NAME and BASE_DOMAIN are intentionally unset
# They are only needed to seed data in staging and local
BASE_URL = "https://voterengagement.com"
###############################################################################
# Core
SECRET_KEY = os.environ['... | Allow citizenlabs.org as a host | Allow citizenlabs.org as a host
| Python | mit | citizenlabsgr/voter-engagement,citizenlabsgr/voter-engagement,citizenlabsgr/voter-engagement,citizenlabsgr/voter-engagement,citizenlabsgr/voter-engagement | ---
+++
@@ -16,9 +16,7 @@
ALLOWED_HOSTS = [
'127.0.0.1',
'localhost',
- # TODO: Prevent access from herokuapp.com when domain is registered
- # '.voterengagement.com',
- '.herokuapp.com',
+ '.citizenlabs.org',
]
############################################################################### |
a8218a1c20ea48a3392ef9e6d898a73eb9642d9c | ui/repository/browse.py | ui/repository/browse.py | from django.shortcuts import render_to_response
from django.template import RequestContext
from registry.models import ResourceCollection
from django.http import HttpResponse, HttpResponseBadRequest
import json
def browse(req):
# Find all the collections that do not have parents
top = ResourceCollection.object... | from django.shortcuts import render_to_response
from django.template import RequestContext
from registry.models import ResourceCollection
from django.http import HttpResponse, HttpResponseBadRequest
import json
def browse(req):
# Find all the collections that do not have parents
top = ResourceCollection.object... | Adjust parent filter on collections. Now top-level collections should specific 'top' as their parent instead of being null. This helps get rid of the problem of collections ending up being top-level when removed from their old parent | Adjust parent filter on collections. Now top-level collections should specific 'top' as their parent instead of being null. This helps get rid of the problem of collections ending up being top-level when removed from their old parent
| Python | bsd-3-clause | usgin/nrrc-repository,usgin/nrrc-repository,usgin/metadata-repository,usgin/metadata-repository | ---
+++
@@ -6,7 +6,7 @@
def browse(req):
# Find all the collections that do not have parents
- top = ResourceCollection.objects.filter(parents__isnull=True)
+ top = ResourceCollection.objects.filter(parents="Top")
# Find the closure (all children) for each top-level collection
result = [... |
142022516f310aeb58f3560031b2266f39a0f2e5 | erpnext_ebay/tasks.py | erpnext_ebay/tasks.py | # -*- coding: utf-8 -*-
"""Scheduled tasks to be run by erpnext_ebay"""
from frappe.utils.background_jobs import enqueue
def all():
pass
def hourly():
enqueue('erpnext_ebay.sync_orders.sync',
queue='long', job_name='Sync eBay Orders')
def daily():
enqueue('erpnext_ebay.ebay_active_listin... | # -*- coding: utf-8 -*-
"""Scheduled tasks to be run by erpnext_ebay"""
from frappe.utils.background_jobs import enqueue
def all():
pass
def hourly():
pass
def daily():
enqueue('erpnext_ebay.ebay_categories.category_sync',
queue='long', job_name='eBay Category Sync')
def weekly():
... | Remove sync_orders and update_ebay_listings from hooks scheduler | fix(hooks): Remove sync_orders and update_ebay_listings from hooks scheduler
| Python | mit | bglazier/erpnext_ebay,bglazier/erpnext_ebay | ---
+++
@@ -10,14 +10,10 @@
def hourly():
- enqueue('erpnext_ebay.sync_orders.sync',
- queue='long', job_name='Sync eBay Orders')
+ pass
def daily():
- enqueue('erpnext_ebay.ebay_active_listings.update_ebay_data',
- queue='long', job_name='Update eBay Data',
- multi... |
4eba105663ba8d0323559b095055b3f89521ea07 | demo/ubergui.py | demo/ubergui.py | #!/usr/bin/env python
import sys
import Pyro
import Tkinter, tkMessageBox
from VisionEgg.PyroApps.UberClientGUI import client_list, AppWindow
# You can add your own controllers and GUIs to client_list
try:
app_window = AppWindow(client_list=client_list)
except Pyro.errors.ProtocolError, x:
if str(x) == 'conn... | #!/usr/bin/env python
import sys
import Pyro
import Tkinter, tkMessageBox
from VisionEgg.PyroApps.UberClientGUI import client_list, AppWindow
# You can add your own controllers and GUIs to client_list
try:
app_window = AppWindow(client_list=client_list)
except Pyro.errors.PyroError, x:
uber_server_error = 0
... | Update errors for other versions of Pyro | Minor: Update errors for other versions of Pyro
git-svn-id: 033d166fe8e629f6cbcd3c0e2b9ad0cffc79b88b@775 3a63a0ee-37fe-0310-a504-e92b6e0a3ba7
| Python | lgpl-2.1 | visionegg/visionegg,visionegg/visionegg,visionegg/visionegg,visionegg/visionegg,visionegg/visionegg | ---
+++
@@ -9,24 +9,23 @@
try:
app_window = AppWindow(client_list=client_list)
-except Pyro.errors.ProtocolError, x:
- if str(x) == 'connection failed': # Can't find UberServer running on network
- try:
- tkMessageBox.showerror("Can't find UberServer","Can't find UberServer running on Pyr... |
a9e69025db7bf3c2f3cdf241f7c9b60a1e78ca58 | tests/base.py | tests/base.py | import unittest2
from sparts.vservice import VService
class BaseSpartsTestCase(unittest2.TestCase):
def assertNotNone(self, o, msg=''):
self.assertTrue(o is not None, msg)
class SingleTaskTestCase(BaseSpartsTestCase):
TASK = None
def setUp(self):
self.assertNotNone(self.TASK)
cl... | import unittest2
import logging
from sparts.vservice import VService
class BaseSpartsTestCase(unittest2.TestCase):
def assertNotNone(self, o, msg=''):
self.assertTrue(o is not None, msg)
def assertNotEmpty(self, o, msg=''):
self.assertTrue(len(o) > 0, msg)
@classmethod
def setUpClas... | Support unittests that require multiple tasks | Support unittests that require multiple tasks
| Python | bsd-3-clause | pshuff/sparts,facebook/sparts,bboozzoo/sparts,fmoo/sparts,facebook/sparts,djipko/sparts,fmoo/sparts,pshuff/sparts,djipko/sparts,bboozzoo/sparts | ---
+++
@@ -1,4 +1,5 @@
import unittest2
+import logging
from sparts.vservice import VService
@@ -7,20 +8,48 @@
def assertNotNone(self, o, msg=''):
self.assertTrue(o is not None, msg)
-class SingleTaskTestCase(BaseSpartsTestCase):
- TASK = None
+ def assertNotEmpty(self, o, msg=''):
+ ... |
83b060b573bee654708e5fbb41c9e3b2913e4d9c | generatechangedfilelist.py | generatechangedfilelist.py | import sys
import os
import commands
import fnmatch
import re
import subprocess, shlex
def cmdsplit(args):
if os.sep == '\\':
args = args.replace('\\', '\\\\')
return shlex.split(args)
def main():
md5dir = os.path.abspath(sys.argv[1])
list_file = os.path.abspath(sys.argv[2])
prelist = os.p... | import sys
import os
import commands
import fnmatch
import re
import subprocess, shlex
mcp_root = os.path.abspath(sys.argv[1])
sys.path.append(os.path.join(mcp_root,"runtime"))
from filehandling.srgshandler import parse_srg
def cmdsplit(args):
if os.sep == '\\':
args = args.replace('\\', '\\\\')
retur... | Tweak file list script to print obf names | Tweak file list script to print obf names
| Python | lgpl-2.1 | MinecraftForge/FML,aerospark/FML,aerospark/FML,aerospark/FML | ---
+++
@@ -5,21 +5,33 @@
import re
import subprocess, shlex
+mcp_root = os.path.abspath(sys.argv[1])
+sys.path.append(os.path.join(mcp_root,"runtime"))
+from filehandling.srgshandler import parse_srg
+
def cmdsplit(args):
if os.sep == '\\':
args = args.replace('\\', '\\\\')
return shlex.split... |
154ebba6f46acac1816e96993619b45ade314ba8 | dthm4kaiako/config/__init__.py | dthm4kaiako/config/__init__.py | """Configuration for Django system."""
__version__ = "0.8.0"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| """Configuration for Django system."""
__version__ = "0.8.1"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| Increment version number to 0.8.1 | Increment version number to 0.8.1
| Python | mit | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | ---
+++
@@ -1,6 +1,6 @@
"""Configuration for Django system."""
-__version__ = "0.8.0"
+__version__ = "0.8.1"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num |
139e6acc19040d89f304875c533513c9651f2906 | budget_proj/budget_app/filters.py | budget_proj/budget_app/filters.py | from django.db.models import CharField
from django_filters import rest_framework as filters
from . import models
class DefaultFilterMeta:
"""
Set our default Filter configurations to DRY up the FilterSet Meta classes.
"""
# Let us filter by all fields except id
exclude = ('id',)
# We prefer ca... | from django.db.models import CharField
from django_filters import rest_framework as filters
from . import models
class CustomFilterBase(filters.FilterSet):
"""
Extends Filterset to populate help_text from the associated model field.
Works with swagger but not the builtin docs.
"""
@classmethod
... | Upgrade Filters fields to use docs from model fields | Upgrade Filters fields to use docs from model fields
| Python | mit | jimtyhurst/team-budget,hackoregon/team-budget,hackoregon/team-budget,hackoregon/team-budget,jimtyhurst/team-budget,jimtyhurst/team-budget | ---
+++
@@ -2,10 +2,26 @@
from django_filters import rest_framework as filters
from . import models
+class CustomFilterBase(filters.FilterSet):
+ """
+ Extends Filterset to populate help_text from the associated model field.
+ Works with swagger but not the builtin docs.
+ """
+
+ @classmethod
+ ... |
891ca8ee117f462a1648e954b756f1d29a5f527c | tests/test_errors.py | tests/test_errors.py | """Tests for errors.py"""
import aiohttp
def test_bad_status_line1():
err = aiohttp.BadStatusLine(b'')
assert str(err) == "b''"
def test_bad_status_line2():
err = aiohttp.BadStatusLine('Test')
assert str(err) == 'Test'
| """Tests for errors.py"""
import aiohttp
def test_bad_status_line1():
err = aiohttp.BadStatusLine(b'')
assert str(err) == "b''"
def test_bad_status_line2():
err = aiohttp.BadStatusLine('Test')
assert str(err) == 'Test'
def test_fingerprint_mismatch():
err = aiohttp.FingerprintMismatch('exp', ... | Add a test for FingerprintMismatch repr | Add a test for FingerprintMismatch repr
| Python | apache-2.0 | jettify/aiohttp,esaezgil/aiohttp,z2v/aiohttp,arthurdarcet/aiohttp,pfreixes/aiohttp,z2v/aiohttp,mind1master/aiohttp,KeepSafe/aiohttp,mind1master/aiohttp,juliatem/aiohttp,hellysmile/aiohttp,esaezgil/aiohttp,esaezgil/aiohttp,arthurdarcet/aiohttp,panda73111/aiohttp,pfreixes/aiohttp,z2v/aiohttp,alex-eri/aiohttp-1,singulared... | ---
+++
@@ -11,3 +11,9 @@
def test_bad_status_line2():
err = aiohttp.BadStatusLine('Test')
assert str(err) == 'Test'
+
+
+def test_fingerprint_mismatch():
+ err = aiohttp.FingerprintMismatch('exp', 'got', 'host', 8888)
+ expected = '<FingerprintMismatch expected=exp got=got host=host port=8888>'
+ ... |
4bcc0aae53def04e16e87499b1321256ff35a7c1 | pyconll/__init__.py | pyconll/__init__.py | """
A library whose purpose is to provide a low level layer between the CoNLL format
and python code.
"""
__all__ = ['exception', 'load', 'tree', 'unit', 'util']
from .load import load_from_string, load_from_file, load_from_url, \
iter_from_string, iter_from_file, iter_from_url
| """
A library whose purpose is to provide a low level layer between the CoNLL format
and python code.
"""
__all__ = ['conllable', 'exception', 'load', 'tree', 'unit', 'util']
from .load import load_from_string, load_from_file, load_from_url, \
iter_from_string, iter_from_file, iter_from_url
| Add conllable to all list. | Add conllable to all list.
| Python | mit | pyconll/pyconll,pyconll/pyconll | ---
+++
@@ -3,7 +3,7 @@
and python code.
"""
-__all__ = ['exception', 'load', 'tree', 'unit', 'util']
+__all__ = ['conllable', 'exception', 'load', 'tree', 'unit', 'util']
from .load import load_from_string, load_from_file, load_from_url, \
iter_from_string, iter_from_file, iter_from_url |
48dcf46b048c94437b957616a363f9f64447b8da | pyinfra/__init__.py | pyinfra/__init__.py | '''
Welcome to pyinfra.
'''
import logging
# Global flag set True by `pyinfra_cli.__main__`
is_cli = False
# Global pyinfra logger
logger = logging.getLogger('pyinfra')
# Setup package level version
from .version import __version__ # noqa
# Trigger pseudo_* creation
from . import pseudo_modules # noqa
# Trigge... | '''
Welcome to pyinfra.
'''
import logging
# Global flag set True by `pyinfra_cli.__main__`
is_cli = False
# Global pyinfra logger
logger = logging.getLogger('pyinfra')
# Setup package level version
from .version import __version__ # noqa
# Trigger pseudo_* creation
from . import pseudo_modules # noqa
# Initia... | Add todo to remove import of all operations/facts when loading pyinfra. | Add todo to remove import of all operations/facts when loading pyinfra.
| Python | mit | Fizzadar/pyinfra,Fizzadar/pyinfra | ---
+++
@@ -17,12 +17,11 @@
# Trigger pseudo_* creation
from . import pseudo_modules # noqa
-# Trigger fact index creation
-from . import facts # noqa
-
-# Trigger module imports
-from . import operations # noqa # pragma: no cover
-
# Initialise base classes - this sets the pseudo modules to point at the unde... |
e056dc3581785fe34123189cccd9901e1e9afe71 | pylatex/__init__.py | pylatex/__init__.py | # flake8: noqa
"""
A library for creating Latex files.
.. :copyright: (c) 2014 by Jelte Fennema.
:license: MIT, see License for more details.
"""
from .document import Document
from .math import Math, VectorName, Matrix
from .package import Package
from .section import Section, Subsection, Subsubsection
from .t... | # flake8: noqa
"""
A library for creating Latex files.
.. :copyright: (c) 2014 by Jelte Fennema.
:license: MIT, see License for more details.
"""
from .document import Document
from .math import Math, VectorName, Matrix
from .package import Package
from .section import Section, Subsection, Subsubsection
from .t... | Add Tabu, LongTable and LongTabu global import | Add Tabu, LongTable and LongTabu global import
| Python | mit | sebastianhaas/PyLaTeX,sebastianhaas/PyLaTeX,votti/PyLaTeX,ovaskevich/PyLaTeX,JelteF/PyLaTeX,bjodah/PyLaTeX,votti/PyLaTeX,jendas1/PyLaTeX,bjodah/PyLaTeX,jendas1/PyLaTeX,JelteF/PyLaTeX,ovaskevich/PyLaTeX | ---
+++
@@ -11,7 +11,8 @@
from .math import Math, VectorName, Matrix
from .package import Package
from .section import Section, Subsection, Subsubsection
-from .table import Table, MultiColumn, MultiRow, Tabular
+from .table import Table, MultiColumn, MultiRow, Tabular, Tabu, LongTable, \
+ LongTabu
from .pgfp... |
117e4f59720de9d13ddb4eaa439915addb616f1d | tests/cli/test_pinout.py | tests/cli/test_pinout.py | from __future__ import (
unicode_literals,
absolute_import,
print_function,
division,
)
str = type('')
import pytest
import gpiozero.cli.pinout as pinout
def test_args_incorrect():
with pytest.raises(SystemExit) as ex:
pinout.parse_args(['--nonexistentarg'])
assert ex.value.code... | from __future__ import (
unicode_literals,
absolute_import,
print_function,
division,
)
str = type('')
import pytest
from gpiozero.cli import pinout
def test_args_incorrect():
with pytest.raises(SystemExit) as ex:
pinout.parse_args(['--nonexistentarg'])
assert ex.value.code == 2... | Use from to import rather than rename | Use from to import rather than rename
| Python | bsd-3-clause | waveform80/gpio-zero,MrHarcombe/python-gpiozero,RPi-Distro/python-gpiozero | ---
+++
@@ -9,7 +9,7 @@
import pytest
-import gpiozero.cli.pinout as pinout
+from gpiozero.cli import pinout
def test_args_incorrect(): |
d814c9c131f2c2957173302f7c4c1cbf2b719b45 | check_rfc_header.py | check_rfc_header.py | #!/usr/bin/env python
# -*- encoding: utf-8
import os
from travistooling import ROOT
def get_rfc_readmes(repo):
rfcs_dir = os.path.join(repo, 'docs', 'rfcs')
for root, _, filenames in os.walk(rfcs_dir):
for f in filenames:
if f == 'README.md':
yield os.path.join(root, f)
... | #!/usr/bin/env python
# -*- encoding: utf-8
import datetime as dt
import os
from travistooling import git, ROOT
def get_rfc_readmes(repo):
rfcs_dir = os.path.join(repo, 'docs', 'rfcs')
for root, _, filenames in os.walk(rfcs_dir):
for f in filenames:
if f == 'README.md':
y... | Check update dates in the RFC headers | Check update dates in the RFC headers
| Python | mit | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | ---
+++
@@ -1,9 +1,10 @@
#!/usr/bin/env python
# -*- encoding: utf-8
+import datetime as dt
import os
-from travistooling import ROOT
+from travistooling import git, ROOT
def get_rfc_readmes(repo):
@@ -14,18 +15,21 @@
yield os.path.join(root, f)
-print('*** Checking RFC headers')
+if ... |
d29410b39af1165ba520e7ecad7e6e9c36a7fd2f | test/test_basic.py | test/test_basic.py | #!/usr/bin/env python3
#coding=UTF-8
import os
import sys
#installed
import pytest
#local
sys.path.append(os.path.split(os.path.split(__file__)[0])[0])
import searchcolor
from api_keys import GoogleKeyLocker as Key
Key = Key()
def test_google_average():
result = searchcolor.google_average('Death', 10, Key.api(),... | #!/usr/bin/env python3
#coding=UTF-8
import os
import sys
#installed
import pytest
#local
sys.path.append(os.path.split(os.path.split(__file__)[0])[0])
import searchcolor
from api_keys import GoogleKeyLocker
from api_keys import BingKeyLocker
from api_keys import MSCSKeyLocker
GKL = GoogleKeyLocker()
BKL = BingKeyLoc... | Add tests for bing and mscs | Add tests for bing and mscs
| Python | mit | Tathorack/searchcolor,Tathorack/searchcolor | ---
+++
@@ -8,13 +8,31 @@
sys.path.append(os.path.split(os.path.split(__file__)[0])[0])
import searchcolor
-from api_keys import GoogleKeyLocker as Key
+from api_keys import GoogleKeyLocker
+from api_keys import BingKeyLocker
+from api_keys import MSCSKeyLocker
-Key = Key()
+GKL = GoogleKeyLocker()
+BKL = BingK... |
3751daef539d26b6909f142949293c20da3f8fe5 | test/test_sleep.py | test/test_sleep.py | """
Tests for POSIX-compatible `sleep`.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sleep.html
"""
import time
from helpers import check_version, run
def test_version():
"""Check that we're using Boreutil's implementation."""
assert check_version("sleep")
def test_missing_args():
"""No ... | """
Tests for POSIX-compatible `sleep`.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sleep.html
"""
import time
from helpers import check_version, run
def test_version():
"""Check that we're using Boreutil's implementation."""
assert check_version("sleep")
def test_missing_args():
"""No ... | Fix `sleep` test. How did this pass locally before?! | Fix `sleep` test. How did this pass locally before?!
| Python | isc | duckinator/boreutils,duckinator/boreutils | ---
+++
@@ -42,4 +42,4 @@
assert len(ret.stdout) == 0
assert len(ret.stderr) == 0
assert ret.returncode == 0
- assert (end - start) >= 2.0
+ assert (end - start) >= 1.0 |
01f3aaf8c0b2351ea41b854142263f2d52c03239 | comics/comics/perrybiblefellowship.py | comics/comics/perrybiblefellowship.py | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "The Perry Bible Fellowship"
language = "en"
url = "http://www.pbfcomics.com/"
start_date = "2001-01-01"
rights = "Nicholas Gurewitch"
class Cra... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "The Perry Bible Fellowship"
language = "en"
url = "http://www.pbfcomics.com/"
start_date = "2001-01-01"
rights = "Nicholas Gurewitch"
class Cra... | Use CSS selector instead of xpath for "The Perry Bible Fellowship" | Use CSS selector instead of xpath for "The Perry Bible Fellowship"
| Python | agpl-3.0 | jodal/comics,datagutten/comics,datagutten/comics,jodal/comics,datagutten/comics,jodal/comics,jodal/comics,datagutten/comics | ---
+++
@@ -18,8 +18,9 @@
feed = self.parse_feed("http://www.pbfcomics.com/feed/feed.xml")
for entry in feed.for_date(pub_date):
page = self.parse_page(entry.link)
- images = page.root.xpath("//div[@id='comic']/img")
+ images = page.src("div#comic img", allow_multi... |
cde63b076027345486e4e836a02811962ad5bcaa | tests/test_completion.py | tests/test_completion.py | import os
import subprocess
import sys
from pathlib import Path
import typer
from typer.testing import CliRunner
from first_steps import tutorial001 as mod
runner = CliRunner()
app = typer.Typer()
app.command()(mod.main)
def test_show_completion():
result = subprocess.run(
[
"bash",
... | import os
import subprocess
import sys
from pathlib import Path
import typer
from typer.testing import CliRunner
from first_steps import tutorial001 as mod
runner = CliRunner()
app = typer.Typer()
app.command()(mod.main)
def test_show_completion():
result = subprocess.run(
[
"bash",
... | Fix test completion, check for bash completion file before running | :bug: Fix test completion, check for bash completion file before running
| Python | mit | tiangolo/typer,tiangolo/typer | ---
+++
@@ -30,7 +30,9 @@
def test_install_completion():
bash_completion_path: Path = Path.home() / ".bash_completion"
- text = bash_completion_path.read_text()
+ text = ""
+ if bash_completion_path.is_file():
+ text = bash_completion_path.read_text()
result = subprocess.run(
[
... |
3ab0e72d5e4031bb07c6ce2e8e9e71db07b55f24 | tests/test_funcmakers.py | tests/test_funcmakers.py | from collections import defaultdict
import pytest
from funcy.funcmakers import *
def test_callable():
assert make_func(lambda x: x + 42)(0) == 42
def test_int():
assert make_func(0)('abc') == 'a'
assert make_func(2)([1,2,3]) == 3
assert make_func(1)({1: 'a'}) == 'a'
with pytest.raises(IndexErro... | from collections import defaultdict
import pytest
from funcy.funcmakers import *
def test_callable():
assert make_func(lambda x: x + 42)(0) == 42
def test_int():
assert make_func(0)('abc') == 'a'
assert make_func(2)([1,2,3]) == 3
assert make_func(1)({1: 'a'}) == 'a'
with pytest.raises(IndexErro... | Fix tests in Python 3.6 | Fix tests in Python 3.6
| Python | bsd-3-clause | Suor/funcy | ---
+++
@@ -21,10 +21,10 @@
def test_str():
- assert make_func('\d+')('ab42c') == '42'
- assert make_func('\d+')('abc') is None
- assert make_pred('\d+')('ab42c') is True
- assert make_pred('\d+')('abc') is False
+ assert make_func(r'\d+')('ab42c') == '42'
+ assert make_func(r'\d+')('abc') is N... |
c37500894b309a691009b87b1305935ee57648cb | tests/test_test.py | tests/test_test.py | import pytest
from web_test_base import *
"""
A class to test new features without running all of the tests.
Usage:
py.test tests/test_test.py -rsx
"""
class TestTest(WebTestBase):
urls_to_get = [
"http://aidtransparency.net/"
]
text_to_find = [
("information", '//*[@id="home-strapline... | import pytest
from web_test_base import *
"""
A class to test new features without running all of the tests.
Usage:
py.test tests/test_test.py -rsx
"""
class TestTest(WebTestBase):
urls_to_get = [
"http://iatistandard.org/"
, "http://iatistandard.org/202/namespaces-extensions/"
]
text_... | Add test text finding that fails | Add test text finding that fails
This indicates that a different method of specifying how and where
to find text within a document is required.
| Python | mit | IATI/IATI-Website-Tests | ---
+++
@@ -9,10 +9,11 @@
"""
class TestTest(WebTestBase):
urls_to_get = [
- "http://aidtransparency.net/"
+ "http://iatistandard.org/"
+ , "http://iatistandard.org/202/namespaces-extensions/"
]
text_to_find = [
- ("information", '//*[@id="home-strapline"]/h1')
+ ("... |
dd9dfa86fe0f7cb8d95b580ff9ae62753fb19026 | gefion/checks/base.py | gefion/checks/base.py | # -*- coding: utf-8 -*-
"""Base classes."""
import time
class Result(object):
"""Provides results of a Check.
Attributes:
availability (bool): Availability, usually reflects outcome of a check.
runtime (float): Time consumed running the check, in seconds.
message (string): Additional... | # -*- coding: utf-8 -*-
"""Base classes."""
import time
class Result(object):
"""Provides results of a Check.
Attributes:
availability (bool): Availability, usually reflects outcome of a check.
runtime (float): Time consumed running the check, in seconds.
message (string): Additional... | Fix typos in Result and Check docstrings | Fix typos in Result and Check docstrings
| Python | bsd-3-clause | dargasea/gefion | ---
+++
@@ -27,7 +27,7 @@
@property
def api_serialised(self):
- """Return serialisable data for API monitor assignments."""
+ """Return serialisable data for API result submissions."""
return {'availability': self.availability,
'runtime': self.runtime,
... |
0720397d5c47e2af33dbe9fdf8f25b95ce620106 | octavia/common/base_taskflow.py | octavia/common/base_taskflow.py | # Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
#
# 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 applicabl... | # Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
#
# 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 applicabl... | Work around strptime threading issue | Work around strptime threading issue
There is an open bug[1] in python strptime when used in multi-threaded
applications. We have seen this occur in the Octavia test jobs[2].
This patch works around the bug by loading strptime early.
[1] https://bugs.python.org/issue7980
[2] https://logs.opendev.org/37/673337/12/chec... | Python | apache-2.0 | openstack/octavia,openstack/octavia,openstack/octavia | ---
+++
@@ -14,6 +14,7 @@
#
import concurrent.futures
+import datetime
from oslo_config import cfg
from taskflow import engines as tf_engines
@@ -30,6 +31,8 @@
"""
def __init__(self):
+ # work around for https://bugs.python.org/issue7980
+ datetime.datetime.strptime('2014-06-19 22:47... |
2b9d702b6efd922069ceb44540b1ea7118e3f84b | gensysinfo.py | gensysinfo.py | #!/usr/bin/env python3
import psutil
import os
import time
import math
blocks = ['β', 'β', 'β', 'β', 'β
', 'β', 'β', 'β']
def create_bar(filled):
if filled > 1:
low = str(int(filled))
high = str(int(filled + 1))
filled = filled - int(filled)
filled = int(filled * 100)
if filled < 50... | #!/usr/bin/env python3
import psutil
import os
import time
import math
blocks = ['β', 'β', 'β', 'β', 'β
', 'β', 'β', 'β']
def create_bar(filled):
filled = int(filled * 100)
if filled < 50:
color = "green"
elif filled < 80:
color = "yellow"
else:
color = "red"
bar = '#[fg=' +... | Allow over 100 again for when load becomes available | Allow over 100 again for when load becomes available
| Python | mit | wilfriedvanasten/miscvar,wilfriedvanasten/miscvar,wilfriedvanasten/miscvar | ---
+++
@@ -7,10 +7,6 @@
blocks = ['β', 'β', 'β', 'β', 'β
', 'β', 'β', 'β']
def create_bar(filled):
- if filled > 1:
- low = str(int(filled))
- high = str(int(filled + 1))
- filled = filled - int(filled)
filled = int(filled * 100)
if filled < 50:
color = "green"
@@ -18,9 ... |
93380d1574438f4e70145e0bbcde4c3331ef5fd3 | massa/domain.py | massa/domain.py | # -*- coding: utf-8 -*-
from sqlalchemy import (
Column,
Date,
Integer,
MetaData,
Numeric,
String,
Table,
)
def define_tables(metadata):
Table('measurement', metadata,
Column('id', Integer, primary_key=True),
Column('weight', Numeric(4, 1), nullable=False),
Col... | # -*- coding: utf-8 -*-
from sqlalchemy import (
Column,
Date,
Integer,
MetaData,
Numeric,
String,
Table,
)
def define_tables(metadata):
Table('measurement', metadata,
Column('id', Integer, primary_key=True),
Column('weight', Numeric(4, 1), nullable=False),
Col... | Add a method to find all measurements. | Add a method to find all measurements. | Python | mit | jaapverloop/massa | ---
+++
@@ -41,6 +41,10 @@
def __init__(self, table):
self._table = table
+ def find_all(self):
+ s = self._table.select()
+ return s.execute()
+
def create(self, **kwargs):
i = self._table.insert()
i.execute(**kwargs) |
71f062a6db2a87fba57353f5a11ec2e63620a7dd | ctf-app.py | ctf-app.py | from flask import Flask, render_template, request
app = Flask(__name__)
@app.route('/', methods=['GET'])
def home():
return render_template('home.html')
if __name__ == '__main__':
app.run(debug=True)
| from flask import Flask, render_template, request
app = Flask(__name__)
@app.route('/')
def home():
return render_template('home.html')
@app.route('/login')
def join_team():
return render_template('join.html')
@app.route('/submit')
def submit_flag():
return render_template('submit.html')
@app.rout... | Add a bunch of placeholder routes | Add a bunch of placeholder routes
| Python | mit | WhiteHatCP/wrath-ctf-framework,DeltaHeavy/wrath-ctf-framework,DeltaHeavy/wrath-ctf-framework,WhiteHatCP/wrath-ctf-framework,DeltaHeavy/wrath-ctf-framework,WhiteHatCP/wrath-ctf-framework,WhiteHatCP/wrath-ctf-framework,DeltaHeavy/wrath-ctf-framework | ---
+++
@@ -1,11 +1,33 @@
from flask import Flask, render_template, request
+
app = Flask(__name__)
-@app.route('/', methods=['GET'])
+@app.route('/')
def home():
return render_template('home.html')
+
+@app.route('/login')
+def join_team():
+ return render_template('join.html')
+
+
+@app.route('/su... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.