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 |
|---|---|---|---|---|---|---|---|---|---|---|
e86431ab5fbac2c99c0551b8ba261ba09077fc23 | setup.py | setup.py |
#!/usr/bin/env python
# encoding: utf-8
"""
tempodb/setup.py
Copyright (c) 2012 TempoDB Inc. All rights reserved.
"""
import os
from setuptools import setup
import tempodb
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="python-tempodb",
version=tempodb... | #!/usr/bin/env python
# encoding: utf-8
"""
tempodb/setup.py
Copyright (c) 2012 TempoDB Inc. All rights reserved.
"""
import os
from setuptools import setup
import tempodb
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="tempodb",
version=tempodb.__versi... | Change package name to tempodb | Change package name to tempodb
| Python | mit | tempodb/tempodb-python,tempodb/tempodb-python,mrgaaron/tempoiq-python,TempoIQ/tempoiq-python | ---
+++
@@ -1,4 +1,3 @@
-
#!/usr/bin/env python
# encoding: utf-8
"""
@@ -17,7 +16,7 @@
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
- name="python-tempodb",
+ name="tempodb",
version=tempodb.__version__,
author="TempoDB Inc",
author_email="dev@tempo-db.com... |
1d58d74e9a19d700d1654c8e9e2858f16535d7cb | setup.py | setup.py | """
Flask-Babel
-----------
Adds i18n/l10n support to Flask applications with the help of the
`Babel`_ library.
Links
`````
* `documentation <http://packages.python.org/Flask-Babel>`_
* `development version
<http://github.com/mitsuhiko/flask-babel/zipball/master#egg=Flask-Babel-dev>`_
.. _Babel: http://babel.edge... | """
Flask-Babel
-----------
Adds i18n/l10n support to Flask applications with the help of the
`Babel`_ library.
Links
`````
* `documentation <http://packages.python.org/Flask-Babel>`_
* `development version
<http://github.com/mitsuhiko/flask-babel/zipball/master#egg=Flask-Babel-dev>`_
.. _Babel: http://babel.edge... | Update minimum babel version to >=2.3. | Update minimum babel version to >=2.3.
Babel 1.0 is now 3 years obsolete. Numerous critical bug fixes are
included in the 1.0 - 2.3 range.
| Python | bsd-3-clause | mitsuhiko/flask-babel,TkTech/flask-babel,mitsuhiko/flask-babel | ---
+++
@@ -32,7 +32,7 @@
platforms='any',
install_requires=[
'Flask',
- 'Babel>=1.0',
+ 'Babel>=2.3',
'speaklater>=1.2',
'Jinja2>=2.5'
], |
efe24b5b9d25bc499de0aff57f7d28f0f3c73991 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
requirements = [
'furl==0.5.6',
'six==1.10.0'
]
test_requirements = [
# TODO: put package test requirements here
]
setup(
name='surveymonkey',
versi... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
requirements = [
'furl==0.5.6',
'six==1.10.0',
'pytest==3.0.3'
]
test_requirements = [
# TODO: put package test requirements here
]
setup(
name='sur... | Add pytest to surveymonkey dependencies | Add pytest to surveymonkey dependencies
| Python | mit | Administrate/surveymonkey | ---
+++
@@ -8,7 +8,8 @@
requirements = [
'furl==0.5.6',
- 'six==1.10.0'
+ 'six==1.10.0',
+ 'pytest==3.0.3'
]
test_requirements = [ |
8a76fdf13bd00cd11d8a2bc37111c83c175e6517 | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup
VERSION = '0.5'
setup(
name='conllu',
packages=["conllu"],
version=VERSION,
description='CoNLL-U Parser parses a CoNLL-U formatted string into a nested python dictionary',
author=u'Emil Stenström',
author_email='em@kth.se',
url='https://... | # -*- coding: utf-8 -*-
from setuptools import setup
VERSION = '0.6'
setup(
name='conllu',
packages=["conllu"],
version=VERSION,
description='CoNLL-U Parser parses a CoNLL-U formatted string into a nested python dictionary',
author=u'Emil Stenström',
author_email='em@kth.se',
url='https://... | Declare Python 3 support, bump version. | Declare Python 3 support, bump version.
| Python | mit | EmilStenstrom/conllu | ---
+++
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from setuptools import setup
-VERSION = '0.5'
+VERSION = '0.6'
setup(
name='conllu',
@@ -19,6 +19,7 @@
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
+ "Programming Language :: Python ::... |
a63ded95f6de31d0b433966e9369cb04190cb23f | setup.py | setup.py | import os
from distutils.core import setup
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.rst')).read()
LICENSE = open(os.path.join(here, 'LICENSE')).read()
setup(
name='saferedisqueue',
version='1.1.0',
d... | import os
from distutils.core import setup
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.rst')).read()
LICENSE = open(os.path.join(here, 'LICENSE')).read()
setup(
name='saferedisqueue',
version='1.1.0',
d... | Mark this version as compatible with redis.py up to 2.6.x | Mark this version as compatible with redis.py up to 2.6.x
| Python | bsd-3-clause | hellp/saferedisqueue | ---
+++
@@ -27,7 +27,7 @@
url='https://github.com/hellp/saferedisqueue',
py_modules=['saferedisqueue'],
install_requires=[
- 'redis >= 2.4.10, < 2.5',
+ 'redis >= 2.4.10, < 2.7',
],
zip_safe=False,
) |
f17db5655cc436aa85c81a6d35555787528075ea | setup.py | setup.py | import os
from setuptools import setup
def get_version():
"""Get the version info from the mpld3 package without importing it"""
import ast
with open(os.path.join("geneimpacts", "__init__.py"), "r") as init_file:
module = ast.parse(init_file.read())
version = (ast.literal_eval(node.value) fo... | import os
from setuptools import setup
def get_version():
"""Get the version info from the mpld3 package without importing it"""
import ast
with open(os.path.join("geneimpacts", "__init__.py"), "r") as init_file:
module = ast.parse(init_file.read())
version = (ast.literal_eval(node.value) fo... | Switch from nosetest -> pytest | Switch from nosetest -> pytest
| Python | mit | brentp/geneimpacts | ---
+++
@@ -26,9 +26,9 @@
author="Brent Pedersen",
author_email="bpederse@gmail.com",
zip_safe=False,
- test_suite='nose.collector',
+ test_suite='pytest',
include_package_data=True,
- tests_require=['nose'],
+ tests_require=['pytest'],
classifiers=[
'Develo... |
0f5224c825c5fbd1aa4d4c89eeb9d35f55e845ee | setup.py | setup.py | #-*- coding: utf-8 -*-
#
# setup.py
# anytop
#
# Created by Lars Yencken on 2011-10-09.
# Copyright 2011 Lars Yencken. All rights reserved.
#
from distutils.core import setup
setup(
name='anytop',
version='0.1.2',
description='Streaming frequency distribution viewer.',
long_description=open('READM... | #-*- coding: utf-8 -*-
#
# setup.py
# anytop
#
# Created by Lars Yencken on 2011-10-09.
# Copyright 2011 Lars Yencken. All rights reserved.
#
from distutils.core import setup
setup(
name='anytop',
version='0.1.2',
description='Streaming frequency distribution viewer.',
long_description=open('READM... | Add anyhist as an installed script. | Add anyhist as an installed script.
| Python | isc | larsyencken/anytop | ---
+++
@@ -17,7 +17,7 @@
author='Lars Yencken',
author_email='lars@yencken.org',
url='http://bitbucket.org/larsyencken/anytop',
- scripts=['anytop'],
+ scripts=['anytop', 'anyhist'],
packages=['anyutil'],
license='ISC',
) |
cfcb0ab86e8d8d6cf8fb17f91f5ac49214af6bd9 | setup.py | setup.py | import io
from setuptools import find_packages, setup
def read(fname):
with io.open(fname, encoding='utf-8') as f:
return f.read()
setup(
name='wagtail-pg-search-backend',
version='1.0.0.dev0',
packages=find_packages(exclude=['tests']),
include_package_data=True,
zip_safe=False,
... | import io
from setuptools import find_packages, setup
def read(fname):
with io.open(fname, encoding='utf-8') as f:
return f.read()
setup(
name='wagtail-pg-search-backend',
version='1.0.0.dev0',
author='Bertrand Bordage',
author_email='bordage.bertrand@gmail.com',
packages=find_packa... | Set package author to Bertrand Bordage | Set package author to Bertrand Bordage
| Python | mit | wagtail/wagtail-pg-search-backend | ---
+++
@@ -11,6 +11,8 @@
setup(
name='wagtail-pg-search-backend',
version='1.0.0.dev0',
+ author='Bertrand Bordage',
+ author_email='bordage.bertrand@gmail.com',
packages=find_packages(exclude=['tests']),
include_package_data=True,
zip_safe=False, |
71ca6c8516e5b887a22d2e16f3fdea72f7d041d9 | STAF/__init__.py | STAF/__init__.py | # Copyright 2012 Kevin Goodsell
#
# This software is licensed under the Eclipse Public License (EPL) V1.0.
'''
Interface to the STAF API.
'''
# Using __all__ makes pydoc work properly. Otherwise it looks at the modules the
# items actually come from and assumes they don't belong in the docs for
# __init__.
__all__ = ... | # Copyright 2012 Kevin Goodsell
#
# This software is licensed under the Eclipse Public License (EPL) V1.0.
'''
Interface to the STAF API.
'''
# Using __all__ makes pydoc work properly. Otherwise it looks at the modules the
# items actually come from and assumes they don't belong in the docs for
# __init__.
__all__ = ... | Add missing function in __all__. | Add missing function in __all__.
| Python | epl-1.0 | KevinGoodsell/caduceus | ---
+++
@@ -13,9 +13,9 @@
'Handle', 'wrap_data', 'add_privacy_delimiters',
'remove_privacy_delimiters', 'mask_private_data',
'escape_privacy_delimiters', 'errors', 'strerror', 'STAFError',
- 'STAFResultError', 'unmarshal', 'STAFUnmarshalError', 'MapClassDefinition',
- 'MapClass', 'unmarshal_recur... |
bdacb16673b2435249ee7cff42a6cc4cacd07e41 | setup.py | setup.py | """Setuptools configuration for rpmvenv."""
from setuptools import setup
from setuptools import find_packages
with open('README.rst', 'r') as readmefile:
README = readmefile.read()
setup(
name='rpmvenv',
version='0.23.0',
url='https://github.com/kevinconway/rpmvenv',
description='RPM packager f... | """Setuptools configuration for rpmvenv."""
from setuptools import setup
from setuptools import find_packages
with open('README.rst', 'r') as readmefile:
README = readmefile.read()
setup(
name='rpmvenv',
version='0.23.0',
url='https://github.com/kevinconway/rpmvenv',
description='RPM packager f... | Add semver version limit due to compat changes | Add semver version limit due to compat changes
The semver library stopped working for legacy Python versions after the
2.9.1 release. This adds a less than 2.10 restriction to the abstract
dependency requirements so that folks don't need to all add a pin to
their requirements.txt.
| Python | mit | kevinconway/rpmvenv | ---
+++
@@ -24,7 +24,7 @@
'argparse',
'confpy',
'ordereddict',
- 'semver',
+ 'semver<2.10', # semver dropped support for legacy Python at 2.10.
],
entry_points={
'console_scripts': [ |
37427ee9052d83cb4bef850487a0e8b7783a64a7 | setup.py | setup.py | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='yarntf',
version='0.0.1.dev15',
description='TensorFlow on YARN... | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='yarntf',
version='0.0.1.dev16',
description='TensorFlow on YARN... | Change require from grpc to grpcio | Change require from grpc to grpcio
| Python | apache-2.0 | tobiajo/tfyarn | ---
+++
@@ -9,7 +9,7 @@
setup(
name='yarntf',
- version='0.0.1.dev15',
+ version='0.0.1.dev16',
description='TensorFlow on YARN',
long_description=long_description,
url='https://github.com/tobiajo/yarntf',
@@ -25,5 +25,5 @@
],
keywords='yarn tf hadoop tensorflow',
packages=... |
f8d1ac65452339f628345a9663794772348d6193 | setup.py | setup.py | #!/usr/bin/env python
# coding: utf-8
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def publish():
"""
Publish this package to PyPI (aka "the Cheeseshop").
"""
os.system('python setup.py sdist upload')
if sys.argv[-1] == 'publ... | #!/usr/bin/env python
# coding: utf-8
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def publish():
"""
Publish this package to PyPI (aka "the Cheeseshop").
"""
os.system('python setup.py sdist upload')
def make_long_descriptio... | Put the code to create the package's long_description into a function. | Put the code to create the package's long_description into a function.
| Python | mit | harsh00008/pystache,rismalrv/pystache,arlenesr28/pystache,nitish116/pystache,rismalrv/pystache,harsh00008/pystache,nitish116/pystache,charbeljc/pystache,rismalrv/pystache,nitish116/pystache,arlenesr28/pystache,beni55/pystache,jrnold/pystache,charbeljc/pystache,arlenesr28/pystache,beni55/pystache,jrnold/pystache,harsh00... | ---
+++
@@ -19,14 +19,26 @@
os.system('python setup.py sdist upload')
+def make_long_description():
+ """
+ Return the long description for the package.
+
+ """
+ long_description = open('README.rst').read() + '\n\n' + open('HISTORY.rst').read()
+
+ return long_description
+
+
if sys.argv[-1]... |
bbc1d23f61086c63bc57215f3202050440f7e2a0 | setup.py | setup.py | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Add dependency on github version of fonttools | Add dependency on github version of fonttools
| Python | apache-2.0 | googlefonts/fontreport,googlei18n/fontreport | ---
+++
@@ -28,5 +28,8 @@
},
install_requires=[
'fonttools>=3.0',
+ ],
+ dependency_links=[
+ 'https://github.com/behdad/fonttools/tarball/master#egg=fonttools-3.0'
]
) |
a50e899e568080e99926acb7c9e9dce8e825b9e5 | setup.py | setup.py | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import unicode_literals
from setuptools import setup, find_packages
from milestones import __version__ as VERSION
setup(
name='edx-milestones',
version=VERSION,
description='Significant events module for Open edX',
long_descr... | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import unicode_literals
from setuptools import setup, find_packages
from milestones import __version__ as VERSION
setup(
name='edx-milestones',
version=VERSION,
description='Significant events module for Open edX',
long_descr... | Add six as a requirement. | Add six as a requirement.
| Python | agpl-3.0 | edx/edx-milestones | ---
+++
@@ -27,6 +27,7 @@
"django>=1.8,<2.0",
"django-model-utils",
"edx-opaque-keys>=0.2.1,<1.0.0",
+ "six",
],
tests_require=[
"coverage==4.5.3", |
5b1a353e77f20c8516b20f4ca85d3fe201fb3544 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='formal',
version='0.8.2',
description='HTML forms framework for Nevow',
author='Matt Goodall',
author_email='matt@pollenation.net',
packages=find_packages(),
package_data={
'formal': ['formal.css', 'html/*', 'js/*'],
}... | from setuptools import setup, find_packages
setup(
name='formal',
version='0.8.2',
description='HTML forms framework for Nevow',
author='Matt Goodall',
author_email='matt@pollenation.net',
packages=find_packages(),
package_data={
'': ['*.css', '*.html', '*.js'],
},
zip_s... | Make the package_data globs less specific to pick up examples.css too and (hopefully) not miss resource files added in future. | Make the package_data globs less specific to pick up examples.css too and
(hopefully) not miss resource files added in future.
| Python | mit | emgee/formal,emgee/formal,emgee/formal | ---
+++
@@ -8,7 +8,7 @@
author_email='matt@pollenation.net',
packages=find_packages(),
package_data={
- 'formal': ['formal.css', 'html/*', 'js/*'],
+ '': ['*.css', '*.html', '*.js'],
},
zip_safe = True,
) |
e3c9adf810ac97f8780dbed03fb190d388e11926 | setup.py | setup.py | import os
from setuptools import find_packages
from setuptools import setup
import sys
sys.path.insert(0, os.path.abspath('lib'))
exec(open('lib/ansiblereview/version.py').read())
setup(
name='ansible-review',
version=__version__,
description=('reviews ansible playbooks, roles and inventory and suggests... | import os
from setuptools import find_packages
from setuptools import setup
import sys
sys.path.insert(0, os.path.abspath('lib'))
exec(open('lib/ansiblereview/version.py').read())
setup(
name='ansible-review',
version=__version__,
description=('reviews ansible playbooks, roles and inventory and suggests... | Add flake8 to installation dependencies | Add flake8 to installation dependencies
| Python | mit | willthames/ansible-review | ---
+++
@@ -19,7 +19,7 @@
package_dir={'': 'lib'},
packages=find_packages('lib'),
zip_safe=False,
- install_requires=['ansible-lint>=3.0.0', 'pyyaml', 'appdirs', 'unidiff'],
+ install_requires=['ansible-lint>=3.0.0', 'pyyaml', 'appdirs', 'unidiff', 'flake8'],
scripts=['bin/ansible-review'],
... |
b53e53e6098af55254977b9b98af277de8304fbe | setup.py | setup.py | from setuptools import setup
setup(
name='EasyEuler',
version='0.1',
py_modules=['EasyEuler'],
install_requires=[
'Click',
'Jinja2'
],
entry_points='''
[console_scripts]
easyeuler=EasyEuler.cli:cli
'''
)
| import sys
from setuptools import setup
requirements = ['Click', 'Jinja2']
if 'win32' in sys.platform.lower():
# Windows needs colorama for the terminal colors to work.
requirements.append('colorama')
setup(
name='EasyEuler',
version='0.1',
py_modules=['EasyEuler'],
install_requires=require... | Add colorama to requirements for Windows | Add colorama to requirements for Windows
| Python | mit | Encrylize/EasyEuler | ---
+++
@@ -1,13 +1,19 @@
+import sys
+
from setuptools import setup
+
+
+requirements = ['Click', 'Jinja2']
+
+if 'win32' in sys.platform.lower():
+ # Windows needs colorama for the terminal colors to work.
+ requirements.append('colorama')
setup(
name='EasyEuler',
version='0.1',
py_modules=... |
7fb5df76dc3b0e044c2ae6fe5f860a9edad76f83 | backend/breach/tests/test_sniffer.py | backend/breach/tests/test_sniffer.py | from mock import patch
from django.test import TestCase
from breach.sniffer import Sniffer
class SnifferTest(TestCase):
def setUp(self):
self.endpoint = 'http://localhost'
self.sniffer = Sniffer(self.endpoint)
self.source_ip = '147.102.239.229'
self.destination_host = 'dionyziz.c... | from mock import patch
from django.test import TestCase
from breach.sniffer import Sniffer
class SnifferTest(TestCase):
def setUp(self):
self.endpoint = 'http://localhost'
self.sniffer = Sniffer(self.endpoint)
self.source_ip = '147.102.239.229'
self.destination_host = 'dionyziz.c... | Fix sniffer test, rename stop to delete | Fix sniffer test, rename stop to delete
| Python | mit | dimkarakostas/rupture,dimkarakostas/rupture,dimriou/rupture,dionyziz/rupture,dionyziz/rupture,dionyziz/rupture,dimkarakostas/rupture,dimriou/rupture,dimkarakostas/rupture,esarafianou/rupture,dimriou/rupture,dionyziz/rupture,dimriou/rupture,dimriou/rupture,esarafianou/rupture,dimkarakostas/rupture,esarafianou/rupture,es... | ---
+++
@@ -23,6 +23,6 @@
self.assertTrue(requests.get.called)
@patch('breach.sniffer.requests')
- def test_sniffer_stop(self, requests):
- self.sniffer.stop(self.source_ip, self.destination_host)
+ def test_sniffer_delete(self, requests):
+ self.sniffer.delete(self.source_ip, self... |
6ccc4a267f939d60ab8948874d9b066ff2b2e5ee | grader/grader/test/test_build.py | grader/grader/test/test_build.py | import os
import pytest
from subprocess import Popen, PIPE
def has_installed(program):
"""Checks to see if a program is installed using ``which``.
:param str program: the name of the program we're looking for
:rtype bool:
:return: True if it's installed, otherwise False.
"""
proc = Popen(... | import os
import pytest
import shutil
hasdocker = pytest.mark.skipif(shutil.which("docker") is None,
reason="Docker must be installed.")
"""A decorator to skip a test if docker is not installed."""
@hasdocker
def test_build(parse_and_run):
"""Test vanilla assignment build
"""
... | Use shutil for 'which docker' | Use shutil for 'which docker'
| Python | mit | redkyn/grader,redkyn/grader,grade-it/grader | ---
+++
@@ -1,25 +1,9 @@
import os
import pytest
-
-from subprocess import Popen, PIPE
+import shutil
-def has_installed(program):
- """Checks to see if a program is installed using ``which``.
-
- :param str program: the name of the program we're looking for
-
- :rtype bool:
-
- :return: True if it'... |
de43482266fa71adb8393823680675145ffe93e0 | hr_switzerland/models/hr_expense.py | hr_switzerland/models/hr_expense.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2017 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2017 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | Add notification to manager at expense creation | Add notification to manager at expense creation
| Python | agpl-3.0 | CompassionCH/compassion-switzerland,CompassionCH/compassion-switzerland,ecino/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,CompassionCH/compassion-switzerland,ecino/compassion-switzerland,eicher31/compassion-switzerland,ecino/compassion-switzerland | ---
+++
@@ -30,3 +30,24 @@
"""
if self.state == 'draft':
super(HrExpense, self)._onchange_product_id()
+
+
+class HrExpenseSheet(models.Model):
+ _inherit = 'hr.expense.sheet'
+
+ # Adding a user_id field for the assign notification to work
+ user_id = fields.Many2one(related='... |
9830a8d3cf140af5af53918db51ede4b82392dd5 | dbcollection/datasets/mscoco/load_data_test.py | dbcollection/datasets/mscoco/load_data_test.py | import os
from dbcollection.utils.file_load import load_json
def load_data_test(set_name, image_dir, annotation_path, verbose=True):
"""
Load test data annotations.
"""
data = {}
# load annotation file
if verbose:
print('> Loading annotation file: ' + annotation_path)
annotations ... | import os
from dbcollection.utils.file_load import load_json
def load_data_test(set_name, image_dir, annotation_path, verbose=True):
"""
Load test data annotations.
"""
data = {}
# load annotation file
if verbose:
print('> Loading annotation file: ' + annotation_path)
annotations ... | Add annotations var to returned data | db: Add annotations var to returned data
| Python | mit | dbcollection/dbcollection,farrajota/dbcollection | ---
+++
@@ -18,10 +18,12 @@
if verbose:
print('> Processing image annotations... ')
for i, annot in enumerate(annotations['images']):
- data[annot['id']] = {
+ data[annot['file_name']] = {
+ "file_name" : os.path.join(image_dir, annot['file_name']),
"width" : a... |
867c71f0f2d3c2898815334a5d76063cd7671fae | processors/fix_changeline_budget_titles.py | processors/fix_changeline_budget_titles.py | import json
if __name__ == "__main__":
input = sys.argv[1]
output = sys.argv[2]
processor = fix_changeline_budget_titles().process(input,output,[])
class fix_changeline_budget_titles(object):
def process(self,inputs,output):
out = []
budgets = {}
changes_jsons, budget_jsons... | import json
import logging
if __name__ == "__main__":
input = sys.argv[1]
output = sys.argv[2]
processor = fix_changeline_budget_titles().process(input,output,[])
class fix_changeline_budget_titles(object):
def process(self,inputs,output):
out = []
budgets = {}
changes_json... | Fix bug in changeling title fix - it used to remove some lines on the way... | Fix bug in changeling title fix - it used to remove some lines on the way...
| Python | mit | OpenBudget/open-budget-data,OpenBudget/open-budget-data,omerbartal/open-budget-data,omerbartal/open-budget-data | ---
+++
@@ -1,4 +1,5 @@
import json
+import logging
if __name__ == "__main__":
input = sys.argv[1]
@@ -23,9 +24,12 @@
changed_num = 0
for line in file(changes_jsons):
line = json.loads(line.strip())
- title = budgets.get("%(year)s/%(budget_code)s" % line)
+ ... |
c988925927ec9d50ded81c92b85c3abce6c2638f | fireplace/carddata/minions/neutral/legendary.py | fireplace/carddata/minions/neutral/legendary.py | import random
from ...card import *
# Ragnaros the Firelord
class EX1_298(Card):
cantAttack = True
def onTurnEnd(self, player):
self.hit(random.choice(self.controller.getTargets(TARGET_ENEMY_CHARACTERS)), 8)
# Harrison Jones
class EX1_558(Card):
def action(self):
weapon = self.controller.opponent.hero.weapon... | import random
from ...card import *
# Cairne Bloodhoof
class EX1_110(Card):
deathrattle = summonMinion("EX1_110t")
# Baron Geddon
class EX1_249(Card):
def action(self):
for target in self.controller.getTargets(TARGET_ALL_MINIONS):
if target is not self:
self.hit(target, 2)
# Ragnaros the Firelord
class... | Implement Baron Geddon, Cairne Bloodhoof and Malygos | Implement Baron Geddon, Cairne Bloodhoof and Malygos
| Python | agpl-3.0 | amw2104/fireplace,beheh/fireplace,smallnamespace/fireplace,liujimj/fireplace,butozerca/fireplace,oftc-ftw/fireplace,Ragowit/fireplace,Ragowit/fireplace,smallnamespace/fireplace,NightKev/fireplace,Meerkov/fireplace,jleclanche/fireplace,butozerca/fireplace,Meerkov/fireplace,amw2104/fireplace,oftc-ftw/fireplace,liujimj/fi... | ---
+++
@@ -1,5 +1,18 @@
import random
from ...card import *
+
+
+# Cairne Bloodhoof
+class EX1_110(Card):
+ deathrattle = summonMinion("EX1_110t")
+
+
+# Baron Geddon
+class EX1_249(Card):
+ def action(self):
+ for target in self.controller.getTargets(TARGET_ALL_MINIONS):
+ if target is not self:
+ self.hit(... |
679c2daceb7f4e9d193e345ee42b0334dd576c64 | changes/web/index.py | changes/web/index.py | import changes
import urlparse
from flask import render_template, current_app, redirect, url_for, session
from flask.views import MethodView
class IndexView(MethodView):
def get(self, path=''):
# require auth
if not session.get('email'):
return redirect(url_for('login'))
if c... | import changes
import urlparse
from flask import render_template, current_app, redirect, url_for, session
from flask.views import MethodView
class IndexView(MethodView):
def get(self, path=''):
# require auth
if not session.get('email'):
return redirect(url_for('login'))
if c... | Disable Sentry due to sync behavior | Disable Sentry due to sync behavior
| Python | apache-2.0 | bowlofstew/changes,wfxiang08/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,dropbox/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes | ---
+++
@@ -11,7 +11,7 @@
if not session.get('email'):
return redirect(url_for('login'))
- if current_app.config['SENTRY_DSN']:
+ if current_app.config['SENTRY_DSN'] and False:
parsed = urlparse.urlparse(current_app.config['SENTRY_DSN'])
dsn = '%s://%s@%... |
1a0c9fd8e8d6ce59c2d6ea42c59dfa6497400753 | buildscripts/condarecipe/run_test.py | buildscripts/condarecipe/run_test.py | import sys
import platform
import llvm
from llvm.core import Module
from llvm.ee import EngineBuilder
from llvm.utils import check_intrinsics
m = Module.new('fjoidajfa')
eb = EngineBuilder.new(m)
target = eb.select_target()
print('target.triple=%r' % target.triple)
if sys.platform == 'darwin':
s = {'64bit': 'x86... | import sys
import platform
import llvm
from llvm.ee import TargetMachine
target = TargetMachine.new()
print('target.triple=%r' % target.triple)
if sys.platform == 'darwin':
s = {'64bit': 'x86_64', '32bit': 'x86'}[platform.architecture()[0]]
assert target.triple.startswith(s + '-apple-darwin')
assert llvm.test... | Fix buildscript for Python2 on OSX | Fix buildscript for Python2 on OSX
| Python | bsd-3-clause | llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy | ---
+++
@@ -1,14 +1,8 @@
import sys
import platform
import llvm
-
-from llvm.core import Module
-from llvm.ee import EngineBuilder
-from llvm.utils import check_intrinsics
-
-m = Module.new('fjoidajfa')
-eb = EngineBuilder.new(m)
-target = eb.select_target()
+from llvm.ee import TargetMachine
+target = TargetMachi... |
9021b035cc7bc63603fce3f626ca6c92c0ba3f9b | pygraphc/clustering/ConnectedComponents.py | pygraphc/clustering/ConnectedComponents.py | import networkx as nx
from ClusterUtility import ClusterUtility
class ConnectedComponents:
"""This is a class for connected component detection method to cluster event logs [1]_.
References
----------
.. [1] H. Studiawan, B. A. Pratomo, and R. Anggoro, Connected component detection for authentication... | import networkx as nx
from ClusterUtility import ClusterUtility
class ConnectedComponents:
"""This is a class for connected component detection method to cluster event logs [Studiawan2016a]_.
References
----------
.. [Studiawan2016a] H. Studiawan, B. A. Pratomo, and R. Anggoro, Connected component de... | Fix bug in docstring references Studiawan2016a | Fix bug in docstring references Studiawan2016a
| Python | mit | studiawan/pygraphc | ---
+++
@@ -3,12 +3,12 @@
class ConnectedComponents:
- """This is a class for connected component detection method to cluster event logs [1]_.
+ """This is a class for connected component detection method to cluster event logs [Studiawan2016a]_.
References
----------
- .. [1] H. Studiawan, B... |
c858c4dcf255949cb6ccbf01ac4e5cbf5b2c4bfb | pygraphc/clustering/ConnectedComponents.py | pygraphc/clustering/ConnectedComponents.py | import networkx as nx
class ConnectedComponents:
"""This is a class for connected component detection method to cluster event logs [1]_.
.. [1] H. Studiawan, B. A. Pratomo, and R. Anggoro, Connected component detection for authentication log
clustering, in Proceedings of the International Seminar on S... | import networkx as nx
class ConnectedComponents:
"""This is a class for connected component detection method to cluster event logs [1]_.
.. [1] H. Studiawan, B. A. Pratomo, and R. Anggoro, Connected component detection for authentication log
clustering, in Proceedings of the International Seminar on S... | Add new line in the end of the file | Add new line in the end of the file
| Python | mit | studiawan/pygraphc | |
895af0411bc8f45f48265872ccbba9c2a040f7d1 | ds_graph.py | ds_graph.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
class Vertex(object):
"""Vertex class.
It uses a dict to keep track of the vertices which it's connected.
"""
class Graph(object):
"""Graph class.
It contains a dict to map vertex name to ver... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
class Vertex(object):
"""Vertex class.
It uses a dict to keep track of the vertices which it's connected.
"""
def __init__(self, key):
self.id = key
self.connected_to_dict = {}
def add_neighnor(s... | Implement Vertex class’s __init__ and helper functions | Implement Vertex class’s __init__ and helper functions
| Python | bsd-2-clause | bowen0701/algorithms_data_structures | ---
+++
@@ -8,6 +8,24 @@
It uses a dict to keep track of the vertices which it's connected.
"""
+ def __init__(self, key):
+ self.id = key
+ self.connected_to_dict = {}
+
+ def add_neighnor(self, new_nb, weight=0):
+ pass
+
+ def __str__(self):
+ pass
+
+ def get_connections(self):
+ pass
+
+ def get_id... |
9769f66101a2927ec4fc2f978a8c6401219624ad | account_move_fiscal_year/models/account_move_line.py | account_move_fiscal_year/models/account_move_line.py | # Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
date_range_fy_id = fields.Many2one(
related='move_id.date_range_fy_id',
store=True, copy=False)
| # Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
date_range_fy_id = fields.Many2one(
related='move_id.date_range_fy_id',
)
| Remove unneeded and inefficient "store=True" | [FIX] Remove unneeded and inefficient "store=True"
| Python | agpl-3.0 | OCA/account-financial-tools,OCA/account-financial-tools | ---
+++
@@ -10,4 +10,4 @@
date_range_fy_id = fields.Many2one(
related='move_id.date_range_fy_id',
- store=True, copy=False)
+ ) |
7dd723874ac5bae83039b313abd00393636f1d80 | modernrpc/tests/test_entry_points.py | modernrpc/tests/test_entry_points.py | # coding: utf-8
import requests
def test_forbidden_get(live_server):
r = requests.get(live_server.url + '/all-rpc/')
assert r.status_code == 405
r2 = requests.post(live_server.url + '/all-rpc/')
assert r2.status_code == 200
def test_allowed_get(live_server):
r = requests.get(live_server.url +... | # coding: utf-8
import requests
from django.core.exceptions import ImproperlyConfigured
from pytest import raises
from modernrpc.views import RPCEntryPoint
def test_forbidden_get(live_server):
r = requests.get(live_server.url + '/all-rpc/')
assert r.status_code == 405
r2 = requests.post(live_server.url... | Test for bad setting value | Test for bad setting value
| Python | mit | alorence/django-modern-rpc,alorence/django-modern-rpc | ---
+++
@@ -1,5 +1,9 @@
# coding: utf-8
import requests
+from django.core.exceptions import ImproperlyConfigured
+from pytest import raises
+
+from modernrpc.views import RPCEntryPoint
def test_forbidden_get(live_server):
@@ -18,3 +22,13 @@
r2 = requests.post(live_server.url + '/all-rpc-doc/')
asse... |
9cc7b71d69a10f9e166d7264366669ac8ec4e212 | cochlear/__init__.py | cochlear/__init__.py | import logging.config
def configure_logging(filename):
time_format = '[%(asctime)s] :: %(name)s - %(levelname)s - %(message)s'
simple_format = '%(name)s - %(message)s'
logging_config = {
'version': 1,
'formatters': {
'time': {'format': time_format},
'simple': {'for... | import logging.config
def configure_logging(filename=None):
time_format = '[%(asctime)s] :: %(name)s - %(levelname)s - %(message)s'
simple_format = '%(name)s - %(message)s'
logging_config = {
'version': 1,
'formatters': {
'time': {'format': time_format},
'simple': ... | Allow logging to be config w/o filename | ENH: Allow logging to be config w/o filename
| Python | bsd-3-clause | bburan/cochlear | ---
+++
@@ -1,7 +1,7 @@
import logging.config
-def configure_logging(filename):
+def configure_logging(filename=None):
time_format = '[%(asctime)s] :: %(name)s - %(levelname)s - %(message)s'
simple_format = '%(name)s - %(message)s'
@@ -18,13 +18,6 @@
'formatter': 'simple',
... |
bf312434a9b52264dc63667c986ff353d0379e5b | cogs/utils/dataIO.py | cogs/utils/dataIO.py | import redis_collections
import threading
import time
import __main__
class RedisDict(redis_collections.Dict):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.die = False
self.thread = threading.Thread(target=self.update_loop)
self.thread.start()
self.prev = N... | import redis_collections
import threading
import time
import __main__
class RedisDict(redis_collections.Dict):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.die = False
self.thread = threading.Thread(target=self.update_loop, daemon=True)
self.thread.start()
... | Make threads run in daemon mode | Make threads run in daemon mode
| Python | mit | Thessia/Liara | ---
+++
@@ -8,7 +8,7 @@
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.die = False
- self.thread = threading.Thread(target=self.update_loop)
+ self.thread = threading.Thread(target=self.update_loop, daemon=True)
self.thread.start()
self.prev = None... |
950b18ed6a4eaabd99ec6ce769247fc84676eb3b | tests.py | tests.py | #! usr/bin/env python3
import unittest
from sqlviz import Schema
# Tests will go here...eventually
class InventorySchemaSpec (unittest.TestCase):
def setUp (self):
self.schema = Schema(
"""DROP TABLE Inventory;
CREATE TABLE Inventory
(
id INT PRIMARY... | #! usr/bin/env python3
import unittest
from sqlviz import Schema
# Tests will go here...eventually
class InventorySchemaSpec (unittest.TestCase):
def setUp (self):
self.schema = Schema(
"""DROP TABLE Inventory;
CREATE TABLE Inventory
(
id INT PRIMARY... | Fix misplaced colon in test suite | Fix misplaced colon in test suite | Python | mit | hawkw/sqlviz | ---
+++
@@ -25,7 +25,7 @@
"The Inventory schema should contain 1 table.")
def test_n_keys(self):
- self.assertEqual(self.schema.n_keys(), {"PRIMARY KEY": 1, "FOREIGN KEY:" 0},
+ self.assertEqual(self.schema.n_keys(), {"PRIMARY KEY": 1, "FOREIGN K... |
ad6b7fe871be502220de5bcb6c2a65f4e7999294 | etcd3/client.py | etcd3/client.py | import grpc
from etcd3.etcdrpc import rpc_pb2 as etcdrpc
import etcd3.exceptions as exceptions
class Etcd3Client(object):
def __init__(self, host='localhost', port=2379):
self.channel = grpc.insecure_channel('{host}:{port}'.format(
host=host, port=port)
)
self.kvstub = etcdrpc... | import grpc
from etcd3.etcdrpc import rpc_pb2 as etcdrpc
import etcd3.exceptions as exceptions
class Etcd3Client(object):
def __init__(self, host='localhost', port=2379):
self.channel = grpc.insecure_channel('{host}:{port}'.format(
host=host, port=port)
)
self.kvstub = etcdrpc... | Add compact and delete stubs | Add compact and delete stubs
| Python | apache-2.0 | kragniz/python-etcd3 | ---
+++
@@ -35,6 +35,12 @@
put_request.value = value.encode('utf-8')
self.kvstub.Put(put_request)
+ def delete(self, key):
+ pass
+
+ def compact(self):
+ pass
+
def client():
'''Return an instance of an Etcd3Client''' |
a4a58384733abd23e5e9074d6c181c112c909f2d | tosp_auth/tests.py | tosp_auth/tests.py | from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
class ControlerLogoutTest(TestCase):
"""Unit test suite for testing the controler of
Logout in the app: tosp_auth.
Test that if the functionality of logout is correct.
""... | from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
class ControlerLogoutTest(TestCase):
"""Unit test suite for testing the controler of
Logout in the app: tosp_auth.
Test that if the functionality of logout is correct.
"""... | Delete whitespace at line 7 | Delete whitespace at line 7
Delete a white space for travis
| Python | mit | erikiado/jp2_online,erikiado/jp2_online,erikiado/jp2_online | ---
+++
@@ -4,7 +4,7 @@
class ControlerLogoutTest(TestCase):
- """Unit test suite for testing the controler of
+ """Unit test suite for testing the controler of
Logout in the app: tosp_auth.
Test that if the functionality of logout is correct. |
5e61515eb6d07004ae2d3eb8f8d7ffe59b351a8c | migrations/versions/0003_create_tokens.py | migrations/versions/0003_create_tokens.py | """empty message
Revision ID: 0003_create_tokens
Revises: 0001_initialise_data
Create Date: 2016-01-13 17:07:49.061776
"""
# revision identifiers, used by Alembic.
revision = '0003_create_tokens'
down_revision = '0001_initialise_data'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands ... | """empty message
Revision ID: 0003_create_tokens
Revises: 0001_initialise_data
Create Date: 2016-01-13 17:07:49.061776
"""
# revision identifiers, used by Alembic.
revision = '0003_create_tokens'
down_revision = '0002_add_templates'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands au... | Fix the migration script so that the down revision is pointing to the migration scripts in the merge | Fix the migration script so that the down revision is pointing to the migration scripts in the merge
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | ---
+++
@@ -8,7 +8,7 @@
# revision identifiers, used by Alembic.
revision = '0003_create_tokens'
-down_revision = '0001_initialise_data'
+down_revision = '0002_add_templates'
from alembic import op
import sqlalchemy as sa |
6ae61fe99c6ab98b866a8ecf28a5503febc697d6 | pypuppetdbquery/__init__.py | pypuppetdbquery/__init__.py | # -*- coding: utf-8 -*-
#
# This file is part of pypuppetdbquery.
# Copyright © 2016 Chris Boot <bootc@bootc.net>
#
# 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.or... | # -*- coding: utf-8 -*-
#
# This file is part of pypuppetdbquery.
# Copyright © 2016 Chris Boot <bootc@bootc.net>
#
# 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.or... | Return JSON from pypuppetdbquery.parse() by default | Return JSON from pypuppetdbquery.parse() by default
This will be the most useful mode of operation when combined with
pypuppetdb, so make life easy for people.
| Python | apache-2.0 | bootc/pypuppetdbquery | ---
+++
@@ -15,13 +15,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from json import dumps as json_dumps
from .evaluator import Evaluator
from .parser import Parser
-def parse(s, parser_opts=None, evaluator_opts=None):
+def parse(s, json=True, ... |
4c240f17571b5e63805a2632e5e8a6c1d3695d54 | examples/00-load/create-tri-surface.py | examples/00-load/create-tri-surface.py | """
Create Triangulated Surface
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a surface from a set of points through a Delaunay triangulation.
"""
# sphinx_gallery_thumbnail_number = 2
import vtki
import numpy as np
################################################################################
# First, create some points fo... | """
Create Triangulated Surface
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a surface from a set of points through a Delaunay triangulation.
"""
# sphinx_gallery_thumbnail_number = 2
import vtki
import numpy as np
################################################################################
# First, create some points fo... | Increase point size in example | Increase point size in example
| Python | mit | akaszynski/vtkInterface | ---
+++
@@ -27,7 +27,8 @@
# simply pass the numpy points to the PolyData constructor
cloud = vtki.PolyData(points)
-cloud.plot()
+vtki.set_plot_theme('doc')
+cloud.plot(point_size=15, use_panel=False)
################################################################################
# Now that we have a ``vtki`... |
5437d5135213fec4390d208174cda1e5c1a57674 | manager/context_processor.py | manager/context_processor.py | # This file is part of Workout Manager.
#
# Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Workout Manage... | # This file is part of Workout Manager.
#
# Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Workout Manage... | Set a default if the browser doesn't send the DNT header | Set a default if the browser doesn't send the DNT header
| Python | agpl-3.0 | wger-project/wger,wger-project/wger,DeveloperMal/wger,kjagoo/wger_stark,wger-project/wger,rolandgeider/wger,DeveloperMal/wger,petervanderdoes/wger,DeveloperMal/wger,DeveloperMal/wger,kjagoo/wger_stark,rolandgeider/wger,rolandgeider/wger,wger-project/wger,petervanderdoes/wger,rolandgeider/wger,petervanderdoes/wger,peter... | ---
+++
@@ -22,5 +22,5 @@
'version' : get_version(),
# Do not track header
- 'DNT': request.META['HTTP_DNT']
+ 'DNT': request.META.get('HTTP_DNT', False)
} |
e41867e8d36803f22f8a64db65bd1bf5c04315c8 | mediachain/translation/lookup.py | mediachain/translation/lookup.py | from mediachain.datastore.ipfs import get_ipfs_datastore
import sys
import os
from os.path import expanduser, join
class ChDir(object):
"""
Step into a directory temporarily
"""
def __init__(self, path):
self.old_dir = os.getcwd()
self.new_dir = path
def __enter__(self):
o... | from mediachain.datastore.ipfs import get_ipfs_datastore
import sys
import os
from os.path import expanduser, join
class ChDir(object):
"""
Step into a directory temporarily
"""
def __init__(self, path):
self.old_dir = os.getcwd()
self.new_dir = path
def __enter__(self):
os... | Revert "only fetch translator from ipfs if it doesn't exist locally from prev run" | Revert "only fetch translator from ipfs if it doesn't exist locally from prev run"
- IPFS cache has these on the fs already
This reverts commit a77349df4b80e4b3cd037c518fc9c69f784072a0.
| Python | mit | mediachain/mediachain-client,mediachain/mediachain-client | ---
+++
@@ -2,7 +2,6 @@
import sys
import os
from os.path import expanduser, join
-
class ChDir(object):
"""
@@ -18,36 +17,28 @@
def __exit__(self, *args):
os.chdir(self.old_dir)
+def get_translator(translator_id):
+ try:
+ name, version = translator_id.split('@')
+ except ValueError:
+ r... |
d8d3f01bf9fdbae8b5eed05d44b5e811c1af3de4 | billjobs/urls.py | billjobs/urls.py | from django.conf.urls import url, include
from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
urlpatterns = [
url(r'^generate_pdf/(?P<bill_id>\d+)$', views.generate_pdf,
name='generate-pdf'),
url(r'^', include(router.urls... | from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^generate_pdf/(?P<bill_id>\d+)$', views.generate_pdf,
name='generate-pdf'),
url(r'^users/$', views.UserAdmin.as_view(), name='users'),
url(r'^users/(?P<pk>[0-9]+)/$', views.UserAdminDetail.as_view(), name='user-deta... | Remove rest_framework routers, add urlpattern for users api | Remove rest_framework routers, add urlpattern for users api
| Python | mit | ioO/billjobs | ---
+++
@@ -1,13 +1,10 @@
from django.conf.urls import url, include
-from rest_framework import routers
from . import views
-
-router = routers.DefaultRouter()
-router.register(r'users', views.UserViewSet)
urlpatterns = [
url(r'^generate_pdf/(?P<bill_id>\d+)$', views.generate_pdf,
name='generate-pd... |
88fa9a0841f7f7774b57b9d8731fb7334d799259 | formidable/json_migrations/__init__.py | formidable/json_migrations/__init__.py | import os
import sys
from glob import glob
from importlib import import_module
__all__ = ['migrate', 'get_migrations']
HERE = os.path.dirname(__file__)
package = sys.modules[__name__].__name__
def get_migrations():
for module in sorted(glob(os.path.join(HERE, '[0-9]*.py'))):
module_name, _ = os.path.ba... | import os
import sys
from glob import glob
from importlib import import_module
__all__ = ['migrate', 'get_migrations']
HERE = os.path.dirname(__file__)
package = sys.modules[__name__].__name__
def get_migrations():
"""
Return a generator with all JSON migrations sorted.
Each item is a tuple with:
... | Add docstrings to JSON migrations functions | Add docstrings to JSON migrations functions
| Python | mit | novafloss/django-formidable | ---
+++
@@ -11,6 +11,15 @@
def get_migrations():
+ """
+ Return a generator with all JSON migrations sorted.
+
+ Each item is a tuple with:
+ - the version number (int)
+ - the label of the migration
+ - the reference to the migrate() function
+
+ """
for module in sorted(glob(os.... |
04b64f521763ed9cc55103455a93ed51656868a0 | core/loaders/news.py | core/loaders/news.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import json
import os
import sys
import re
import hashlib
from datetime import datetime, timedelta
import common
def load( terms = ['.json'], data_dir = '', folder = 'media/' ):
import dateparser
path = data_dir + f... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import json
import os
import sys
import re
import hashlib
from datetime import datetime, timedelta
import common
def load( terms = ['.json'], data_dir = '', folder = 'news/' ):
import dateparser
path = data_dir + fo... | Change default value for folder parameter. | Change default value for folder parameter.
| Python | mit | HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core | ---
+++
@@ -13,7 +13,7 @@
import common
-def load( terms = ['.json'], data_dir = '', folder = 'media/' ):
+def load( terms = ['.json'], data_dir = '', folder = 'news/' ):
import dateparser
|
43ad2ecd572e85b5c9f92025b0826e88770fc33c | moscowdjango/settings_staging.py | moscowdjango/settings_staging.py | # Django settings for moscowdjango project.
from .settings import *
DEBUG = True
EMBEDLY_KEY = os.environ.get('EMBEDLY_KEY')
SECRET_KEY = os.environ.get('SECRET_KEY')
# Amazon credentials
AWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY')
AWS_STORA... | # Django settings for moscowdjango project.
from .settings import *
DEBUG = os.environ.get('DEBUG', False)
EMBEDLY_KEY = os.environ.get('EMBEDLY_KEY')
SECRET_KEY = os.environ.get('SECRET_KEY')
# Amazon credentials
AWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SEC... | Make DEBUG configurable on staging | Make DEBUG configurable on staging
| Python | bsd-3-clause | moscowpython/moscowpython,VladimirFilonov/moscowdjango,moscowdjango/moscowdjango,VladimirFilonov/moscowdjango,moscowpython/moscowpython,moscowdjango/moscowdjango,moscowdjango/moscowdjango,VladimirFilonov/moscowdjango,moscowpython/moscowpython | ---
+++
@@ -1,7 +1,7 @@
# Django settings for moscowdjango project.
from .settings import *
-DEBUG = True
+DEBUG = os.environ.get('DEBUG', False)
EMBEDLY_KEY = os.environ.get('EMBEDLY_KEY')
SECRET_KEY = os.environ.get('SECRET_KEY')
@@ -16,10 +16,10 @@
# Media & static
DEFAULT_FILE_STORAGE = 'moscowdjango.... |
35b5215cd16493fea00c7ebb2106c633ce4c6a9b | qutebrowser/config.py | qutebrowser/config.py | config.load_autoconfig()
c.tabs.background = True
c.new_instance_open_target = 'window'
c.downloads.position = 'bottom'
c.spellcheck.languages = ['en-US']
config.bind(',ce', 'config-edit')
config.bind(',p', 'config-cycle -p content.plugins ;; reload')
config.bind(',rta', 'open {url}top/?sort=top&t=all')
config.bind(... | config.load_autoconfig()
c.tabs.background = True
c.new_instance_open_target = 'window'
c.downloads.position = 'bottom'
c.spellcheck.languages = ['en-US']
config.bind(',ce', 'config-edit')
config.bind(',p', 'config-cycle -p content.plugins ;; reload')
config.bind(',rta', 'open {url}top/?sort=top&t=all')
config.bind(... | Use Arial as Fantasy font | qutebrowser: Use Arial as Fantasy font
| Python | mit | The-Compiler/dotfiles,The-Compiler/dotfiles,The-Compiler/dotfiles | ---
+++
@@ -20,6 +20,7 @@
c.fonts.tabs = '8pt monospace'
c.fonts.statusbar = '8pt monospace'
+c.fonts.web.family.fantasy = 'Arial'
c.search.incremental = False
c.editor.command = ['emacs', '{}'] |
467c1fc9e56ac6d6adc9e82cb546951d1ce5fdcd | grammpy/Rule.py | grammpy/Rule.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .Constants import EPSILON
class Rule:
right = [EPSILON]
left = [EPSILON]
rule = ([EPSILON], [EPSILON])
rules = [([EPSILON], [EPSILON])]
@staticmethod
def is_regular():
... | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .Constants import EPSILON
class Rule:
#TODO rules -> rule -> left/right -> rules
right = [EPSILON]
left = [EPSILON]
rule = ([EPSILON], [EPSILON])
rules = [([EPSILON], [EPSILON])]
... | Add __active property to rule | Add __active property to rule
| Python | mit | PatrikValkovic/grammpy | ---
+++
@@ -11,10 +11,13 @@
class Rule:
+ #TODO rules -> rule -> left/right -> rules
right = [EPSILON]
left = [EPSILON]
rule = ([EPSILON], [EPSILON])
rules = [([EPSILON], [EPSILON])]
+
+ __active = True
@staticmethod
def is_regular(): |
ebe1fed581c7a2eeab6dc7c4f6304e7aa634e942 | regenesis/database.py | regenesis/database.py | import logging
import sqlaload as sl
from regenesis.core import app, engine
log = logging.getLogger(__name__)
def load_cube(cube):
cube_table = sl.get_table(engine, 'cube')
sl.upsert(engine, cube_table, cube.to_row(), ['name'])
statistic_table = sl.get_table(engine, 'statistic')
sl.upsert(engine... | import logging
import sqlaload as sl
from regenesis.core import app, engine
log = logging.getLogger(__name__)
def load_cube(cube):
cube_table = sl.get_table(engine, 'cube')
if sl.find_one(engine, cube_table, name=cube.name):
return
sl.upsert(engine, cube_table, cube.to_row(), ['name'])
... | Speed up loading, don't update for now. | Speed up loading, don't update for now. | Python | mit | pudo/regenesis,pudo/regenesis | ---
+++
@@ -11,6 +11,9 @@
def load_cube(cube):
cube_table = sl.get_table(engine, 'cube')
+ if sl.find_one(engine, cube_table, name=cube.name):
+ return
+
sl.upsert(engine, cube_table, cube.to_row(), ['name'])
statistic_table = sl.get_table(engine, 'statistic')
@@ -31,7 +34,9 @@
... |
9c848315eba6580249d1f9fc5b598a08ec818fed | tests/test_functions.py | tests/test_functions.py | """This module tests the TimeFunction class"""
import pytest
import pandas as pd
from tssim.functions import TimeFunction
@pytest.fixture
def ts():
"""Setup test data.
"""
periods = 10
index = pd.date_range("2017-04-12", periods=periods)
return pd.Series(range(periods), index)
def test_... | """This module tests the TimeFunction class"""
import pandas as pd
import pytest
import tssim
@pytest.fixture
def ts():
"""Setup test data.
"""
periods = 10
index = pd.date_range("2017-04-12", periods=periods)
return pd.Series(range(periods), index)
def test_vectorized_no_condition(ts):
... | Update reference in TimeFunction test. | Update reference in TimeFunction test.
| Python | mit | mansenfranzen/tssim | ---
+++
@@ -1,10 +1,9 @@
"""This module tests the TimeFunction class"""
+import pandas as pd
import pytest
-import pandas as pd
-from tssim.functions import TimeFunction
-
+import tssim
@pytest.fixture
def ts():
@@ -21,4 +20,4 @@
def test_vectorized_no_condition(ts):
func = lambda x: x * 2
- asse... |
1f5d4fed6d8ad9493c50cbacb2bf8e116de46ff8 | thinc/extra/load_nlp.py | thinc/extra/load_nlp.py | import numpy
SPACY_MODELS = {}
VECTORS = {}
def get_spacy(lang, **kwargs):
global SPACY_MODELS
import spacy
if lang not in SPACY_MODELS:
SPACY_MODELS[lang] = spacy.load(lang, **kwargs)
return SPACY_MODELS[lang]
def get_vectors(ops, lang):
global VECTORS
key = (ops.device, lang)
... | import numpy
SPACY_MODELS = {}
VECTORS = {}
def get_spacy(lang, **kwargs):
global SPACY_MODELS
import spacy
if lang not in SPACY_MODELS:
SPACY_MODELS[lang] = spacy.load(lang, **kwargs)
return SPACY_MODELS[lang]
def get_vectors(ops, lang):
global VECTORS
key = (ops.device, lang)
... | Fix divide by zero error in vectors loading | Fix divide by zero error in vectors loading
| Python | mit | explosion/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc | ---
+++
@@ -22,6 +22,6 @@
vectors = numpy.zeros((nV, nM), dtype='float32')
for lex in nlp.vocab:
if lex.has_vector:
- vectors[lex.rank] = lex.vector / lex.vector_norm
+ vectors[lex.rank] = lex.vector / (lex.vector_norm+1e-8)
VECTORS[key] = ops.asar... |
5b2f835f377481c6c217dd886f28c1bb400db553 | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by ckaznocha
# Copyright (c) 2014 ckaznocha
#
# License: MIT
#
"""This module exports the CFLint plugin class."""
from SublimeLinter.lint import Linter, util
class CFLint(Linter):
"""Provides an i... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by ckaznocha
# Copyright (c) 2014 ckaznocha
#
# License: MIT
#
"""This module exports the CFLint plugin class."""
from SublimeLinter.lint import Linter, util
class CFLint(Linter):
"""Provides an i... | Update cmd to allow args | Update cmd to allow args
Change the cmd string so that the "args" argument can be used in linter settings. The way it was any args would be inserted between the '-file' and the filename which broke the '-file' argument.
For this config,
"cflint": {
"@disable": false,
"args": ['-configfile c:\cflintrc.xml... | Python | mit | ckaznocha/SublimeLinter-contrib-CFLint | ---
+++
@@ -17,7 +17,7 @@
"""Provides an interface to CFLint."""
syntax = ('coldfusioncfc', 'html+cfml')
- cmd = 'cflint -q -text -file'
+ cmd = 'cflint -file @ -q -text'
version_args = '-version'
version_re = r'\b(?P<version>\d+\.\d+\.\d+)'
version_requirement = '>= 0.1.8' |
e3780b2751aac7a1a0c261b4b058aaff855b8e8b | docido_sdk/toolbox/contextlib_ext.py | docido_sdk/toolbox/contextlib_ext.py |
from contextlib import contextmanager
import copy
@contextmanager
def restore(obj, copy_func=copy.deepcopy):
"""Backup an object in a with context and restore it when leaving
the scope.
:param obj: object to backup
:param copy_func: callbable object used to create an object copy.
default is `cop... |
from contextlib import contextmanager
import copy
@contextmanager
def restore_dict_kv(a_dict, key, copy_func=copy.deepcopy):
"""Backup an object in a with context and restore it when leaving
the scope.
:param a_dict:
associative table
:param: key
key whose value has to be backed up
:... | Apply `restore' utility to dictionary only | Apply `restore' utility to dictionary only
| Python | apache-2.0 | cogniteev/docido-python-sdk,LilliJane/docido-python-sdk | ---
+++
@@ -4,16 +4,19 @@
@contextmanager
-def restore(obj, copy_func=copy.deepcopy):
+def restore_dict_kv(a_dict, key, copy_func=copy.deepcopy):
"""Backup an object in a with context and restore it when leaving
the scope.
- :param obj: object to backup
+ :param a_dict:
+ associative table... |
0f5b08e8aa0a0ad1106e217064f8e11da98ebc0d | linter.py | linter.py | from SublimeLinter.lint import Linter, util
class Govet(Linter):
cmd = ('go', 'tool', 'vet')
regex = r'.+?:(?P<line>\d+):((?P<col>\d+):)?\s+(?P<message>.+)'
tempfile_suffix = 'go'
error_stream = util.STREAM_STDERR
defaults = {
'selector': 'source.go'
}
| from SublimeLinter.lint import Linter, util
class Govet(Linter):
cmd = ('go', 'vet', '${file_path}')
regex = r'(?P<filename>^.+?):(?P<line>\d+):((?P<col>\d+):)?\s+(?P<message>(.|\n\t)+)'
tempfile_suffix = '-'
multiline = True
error_stream = util.STREAM_STDERR
defaults = {
'selector':... | Handle multiline go vet messages. | Handle multiline go vet messages.
| Python | mit | sirreal/SublimeLinter-contrib-govet | ---
+++
@@ -2,10 +2,19 @@
class Govet(Linter):
- cmd = ('go', 'tool', 'vet')
- regex = r'.+?:(?P<line>\d+):((?P<col>\d+):)?\s+(?P<message>.+)'
- tempfile_suffix = 'go'
+ cmd = ('go', 'vet', '${file_path}')
+
+ regex = r'(?P<filename>^.+?):(?P<line>\d+):((?P<col>\d+):)?\s+(?P<message>(.|\n\t)+)'
+
... |
8dbd39a1e1d1f17da40d6a032f1b5d5b125fd025 | IPython/parallel/tests/test_mongodb.py | IPython/parallel/tests/test_mongodb.py | """Tests for mongodb backend
Authors:
* Min RK
"""
#-------------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this softwar... | """Tests for mongodb backend
Authors:
* Min RK
"""
#-------------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this softwar... | Use username and password for MongoDB on ShiningPanda. | Use username and password for MongoDB on ShiningPanda.
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | ---
+++
@@ -30,6 +30,10 @@
conn_kwargs = {}
if 'DB_IP' in os.environ:
conn_kwargs['host'] = os.environ['DB_IP']
+if 'DBA_MONGODB_ADMIN_URI' in os.environ:
+ # On ShiningPanda, we need a username and password to connect. They are
+ # passed in a mongodb:// URI.
+ conn_kwargs['host'] = os.environ['DBA_M... |
cec76801dc870ae3e1f8682e84126ee69a2a25a2 | spacy/__main__.py | spacy/__main__.py | # coding: utf8
from __future__ import print_function
# NB! This breaks in plac on Python 2!!
#from __future__ import unicode_literals
if __name__ == '__main__':
import plac
import sys
from spacy.cli import download, link, info, package, train, convert, model
from spacy.util import prints
commands ... | # coding: utf8
from __future__ import print_function
# NB! This breaks in plac on Python 2!!
#from __future__ import unicode_literals
if __name__ == '__main__':
import plac
import sys
from spacy.cli import download, link, info, package, train, convert, model
from spacy.cli import profile
from spacy... | Add profile command to CLI | Add profile command to CLI
| Python | mit | spacy-io/spaCy,explosion/spaCy,aikramer2/spaCy,honnibal/spaCy,explosion/spaCy,recognai/spaCy,honnibal/spaCy,aikramer2/spaCy,spacy-io/spaCy,recognai/spaCy,spacy-io/spaCy,recognai/spaCy,recognai/spaCy,explosion/spaCy,recognai/spaCy,aikramer2/spaCy,explosion/spaCy,spacy-io/spaCy,aikramer2/spaCy,aikramer2/spaCy,honnibal/sp... | ---
+++
@@ -7,6 +7,7 @@
import plac
import sys
from spacy.cli import download, link, info, package, train, convert, model
+ from spacy.cli import profile
from spacy.util import prints
commands = {
@@ -16,7 +17,8 @@
'train': train,
'convert': convert,
'package':... |
76b52c988f6b3a23bf52e8c1c2a8993e6f9112c8 | nightreads/user_manager/forms.py | nightreads/user_manager/forms.py | from django.contrib.auth.models import User
from django.core.signing import BadSignature, SignatureExpired
from django import forms
from . import user_service
class SubscribeForm(forms.Form):
email = forms.EmailField()
tags = forms.CharField()
def clean_tags(self):
tags = self.cleaned_data['tags... | from django.contrib.auth.models import User
from django.core.signing import BadSignature, SignatureExpired
from django import forms
from nightreads.posts.models import Tag
from . import user_service
class SubscribeForm(forms.Form):
email = forms.EmailField()
tags = forms.MultipleChoiceField(choices=[(
... | Use `MultipleChoiceField` for `tags` field | Use `MultipleChoiceField` for `tags` field
| Python | mit | avinassh/nightreads,avinassh/nightreads | ---
+++
@@ -2,16 +2,14 @@
from django.core.signing import BadSignature, SignatureExpired
from django import forms
+from nightreads.posts.models import Tag
from . import user_service
class SubscribeForm(forms.Form):
email = forms.EmailField()
- tags = forms.CharField()
-
- def clean_tags(self):
- ... |
061c83bce03b1ae0261ae345f72f82625f12ff0a | ovp_organizations/serializers.py | ovp_organizations/serializers.py | from django.core.exceptions import ValidationError
from ovp_core import validators as core_validators
from ovp_core.serializers import GoogleAddressSerializer
from ovp_organizations import models
from rest_framework import serializers
from rest_framework import permissions
class OrganizationCreateSerializer(seriali... | from django.core.exceptions import ValidationError
from ovp_core import validators as core_validators
from ovp_core.serializers import GoogleAddressSerializer, GoogleAddressCityStateSerializer
from ovp_organizations import models
from rest_framework import serializers
from rest_framework import permissions
class Or... | Return GoogleAddressCityStateSerializer on address field instead of pk in OrganizationSearchSerializer | Return GoogleAddressCityStateSerializer on address field instead of pk in OrganizationSearchSerializer
| Python | agpl-3.0 | OpenVolunteeringPlatform/django-ovp-organizations,OpenVolunteeringPlatform/django-ovp-organizations | ---
+++
@@ -1,7 +1,7 @@
from django.core.exceptions import ValidationError
from ovp_core import validators as core_validators
-from ovp_core.serializers import GoogleAddressSerializer
+from ovp_core.serializers import GoogleAddressSerializer, GoogleAddressCityStateSerializer
from ovp_organizations import model... |
9d058688986838459edf9f6ec40fac04867e0c2c | knights/compat/django.py | knights/compat/django.py | import ast
from django.core.urlresolvers import reverse
from django.utils.encoding import iri_to_uri
import datetime
from knights.library import Library
register = Library()
@register.tag
def static(parser, token):
src = parser.parse_expression(token)
return ast.Yield(value=ast.BinOp(
left=ast.Str... | import ast
from django.core.urlresolvers import reverse
from django.utils.encoding import iri_to_uri
import datetime
from knights.library import Library
register = Library()
@register.helper
def now(fmt):
return datetime.datetime.now().strftime(fmt)
@register.helper
def url(name, *args, **kwargs):
try:
... | Remove bodgy static tag Remove duplicate capfirst helper | Remove bodgy static tag
Remove duplicate capfirst helper
| Python | mit | funkybob/knights-templater,funkybob/knights-templater | ---
+++
@@ -10,28 +10,10 @@
register = Library()
-@register.tag
-def static(parser, token):
- src = parser.parse_expression(token)
- return ast.Yield(value=ast.BinOp(
- left=ast.Str(s='/static/%s'),
- op=ast.Mod(),
- right=src,
- ))
-
-
-@register.helper
-def capfirst(value):
- r... |
f96d26e8686cb2d1a15860414b90e48418e41f38 | tests/integration/conftest.py | tests/integration/conftest.py | import pytest
import io
import contextlib
import tempfile
import shutil
import os
from xd.docker.client import *
DOCKER_HOST = os.environ.get('DOCKER_HOST', None)
@pytest.fixture(scope="module")
def docker(request):
return DockerClient(host=DOCKER_HOST)
class StreamRedirector(object):
def __init__(self)... | import pytest
import io
import contextlib
import tempfile
import shutil
import os
from xd.docker.client import *
DOCKER_HOST = os.environ.get('DOCKER_HOST', None)
@pytest.fixture(scope="function")
def docker(request):
os.system("for c in `docker ps -a -q`;do docker rm $c;done")
os.system("for i in `docker ... | Purge images and containers before each test | tests: Purge images and containers before each test
Signed-off-by: Esben Haabendal <da90c138e4a9573086862393cde34fa33d74f6e5@haabendal.dk>
| Python | mit | XD-embedded/xd-docker,XD-embedded/xd-docker,esben/xd-docker,esben/xd-docker | ---
+++
@@ -11,8 +11,10 @@
DOCKER_HOST = os.environ.get('DOCKER_HOST', None)
-@pytest.fixture(scope="module")
+@pytest.fixture(scope="function")
def docker(request):
+ os.system("for c in `docker ps -a -q`;do docker rm $c;done")
+ os.system("for i in `docker images -q`;do docker rmi $i;done")
return ... |
e4e4e8d5c3acf5851d33700f8b55aa2e1f9c33f2 | server/app/migrations/0003_region.py | server/app/migrations/0003_region.py | import os
import json
from django.db import migrations
from django.conf import settings
def dfs(apps, root, deep, superset=None, leaf=True):
Region = apps.get_model('app', 'Region')
if isinstance(root, dict):
for k, v in root.items():
s = dfs(apps, k, deep, superset, not v)
df... | import os
import json
from collections import OrderedDict
from django.db import migrations
from django.conf import settings
def dfs(apps, root, deep, superset=None, leaf=True):
Region = apps.get_model('app', 'Region')
if isinstance(root, dict):
for k, v in root.items():
s = dfs(apps, k, d... | Make ID of regions be definite. | SERVER-242: Make ID of regions be definite.
| Python | mit | malaonline/Server,malaonline/iOS,malaonline/Android,malaonline/Android,malaonline/iOS,malaonline/Android,malaonline/Server,malaonline/Server,malaonline/iOS,malaonline/Server | ---
+++
@@ -1,5 +1,6 @@
import os
import json
+from collections import OrderedDict
from django.db import migrations
from django.conf import settings
@@ -16,9 +17,9 @@
for k in root:
dfs(apps, k, deep, superset, True)
else:
- region = Region(name=root, superset=superset, admin_l... |
e2ecc6968eb4108a3c15d16898e60e0962eba9f8 | invocations/checks.py | invocations/checks.py | """
Shortcuts for common development check tasks
"""
from __future__ import unicode_literals
from invoke import task
@task(name='blacken', iterable=['folder'])
def blacken(c, line_length=79, folder=None):
"""Run black on the current source"""
default_folders = ["."]
configured_folders = c.config.get("bl... | """
Shortcuts for common development check tasks
"""
from __future__ import unicode_literals
from invoke import task
@task(name="blacken", iterable=["folder"])
def blacken(c, line_length=79, folder=None, check=False):
"""Run black on the current source"""
default_folders = ["."]
configured_folders = c.... | Add --check support to the invocations.blacken task | Add --check support to the invocations.blacken task
| Python | bsd-2-clause | pyinvoke/invocations | ---
+++
@@ -6,15 +6,21 @@
from invoke import task
-@task(name='blacken', iterable=['folder'])
-def blacken(c, line_length=79, folder=None):
+
+@task(name="blacken", iterable=["folder"])
+def blacken(c, line_length=79, folder=None, check=False):
"""Run black on the current source"""
default_folders = ... |
dba6f3a456b3d75e1202ccb688581876a93e48f2 | pwndbg/strings.py | pwndbg/strings.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Functionality for resolving ASCII printable strings within
the debuggee's address space.
"""
from __future__ import print_function
import string
import gdb
import pwndbg.events
import pwndbg.typeinfo
length = 15
@pwndbg.events.stop
def update_length():
r"""
U... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Functionality for resolving ASCII printable strings within
the debuggee's address space.
"""
from __future__ import print_function
import string
import gdb
import pwndbg.events
import pwndbg.typeinfo
length = 15
@pwndbg.events.stop
def update_length():
r"""
U... | Fix string extraction. The "ignore" setting was getting us lots of non-string stuff. | Fix string extraction. The "ignore" setting was getting us lots of non-string stuff.
| Python | mit | anthraxx/pwndbg,cebrusfs/217gdb,pwndbg/pwndbg,chubbymaggie/pwndbg,disconnect3d/pwndbg,zachriggle/pwndbg,cebrusfs/217gdb,anthraxx/pwndbg,pwndbg/pwndbg,disconnect3d/pwndbg,cebrusfs/217gdb,disconnect3d/pwndbg,anthraxx/pwndbg,0xddaa/pwndbg,pwndbg/pwndbg,chubbymaggie/pwndbg,cebrusfs/217gdb,anthraxx/pwndbg,zachriggle/pwndbg,... | ---
+++
@@ -34,13 +34,16 @@
try:
sz = gdb.Value(address)
sz = sz.cast(pwndbg.typeinfo.pchar)
- sz = sz.string('ascii', 'ignore')
+ sz = sz.string('ascii', 'replace', maxlen)
+ sz = pwndbg.memory.read(address, len(sz))
+
+ if not all(s in string.printable for s in sz.... |
cd827059f9c500603d5c6b1d1bdf1621dc87a6a2 | pyaem/handlers.py | pyaem/handlers.py | from BeautifulSoup import *
import exception
def auth_fail(response, **kwargs):
code = response['http_code']
message = 'Authentication failed - incorrect username and/or password'
raise exception.PyAemException(code, message)
def method_not_allowed(response, **kwargs):
code = response['http_code']
soup... | from BeautifulSoup import *
import exception
def auth_fail(response, **kwargs):
code = response['http_code']
message = 'Authentication failed - incorrect username and/or password'
raise exception.PyAemException(code, message)
def method_not_allowed(response, **kwargs):
code = response['http_code']
soup... | Update unexpected handler message, with http code and body. | Update unexpected handler message, with http code and body.
| Python | mit | wildone/pyaem,Sensis/pyaem | ---
+++
@@ -21,6 +21,6 @@
def unexpected(response, **kwargs):
code = response['http_code']
- message = 'Unexpected error'
+ message = 'Unexpected response http code {0} and body\n{1}'.format(response['http_code'], response['body'])
raise exception.PyAemException(code, message) |
eabe9c25d73a2644b8697f0e9304e61dee5be198 | src/smdba/roller.py | src/smdba/roller.py | # coding: utf-8
"""
Visual console "toys".
"""
import time
import sys
import threading
class Roller(threading.Thread):
"""
Roller of some fun sequences while waiting.
"""
def __init__(self):
threading.Thread.__init__(self)
self.__sequence = ['-', '\\', '|', '/',]
self.__freq ... | # coding: utf-8
"""
Visual console "toys".
"""
import time
import sys
import threading
import typing
class Roller(threading.Thread):
"""
Roller of some fun sequences while waiting.
"""
def __init__(self) -> None:
threading.Thread.__init__(self)
self.__sequence = ['-', '\\', '|', '/',... | Add annotations to the methods | Add annotations to the methods
| Python | mit | SUSE/smdba,SUSE/smdba | ---
+++
@@ -6,6 +6,7 @@
import time
import sys
import threading
+import typing
class Roller(threading.Thread):
@@ -13,15 +14,15 @@
Roller of some fun sequences while waiting.
"""
- def __init__(self):
+ def __init__(self) -> None:
threading.Thread.__init__(self)
self.__sequ... |
b6bf01a5c95da0de1e6831a3cf41243e69297854 | setup.py | setup.py | # Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
# h... | # Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
# h... | Remove workaround for issue with older python versions. | Remove workaround for issue with older python versions.
| Python | apache-2.0 | osrg/ryu,osrg/ryu,osrg/ryu,osrg/ryu,osrg/ryu | ---
+++
@@ -14,12 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# a bug workaround. http://bugs.python.org/issue15881
-try:
- import multiprocessing
-except ImportError:
- pass
-
import setuptools
import ryu.hooks
|
f87e5d37609b075abd2c7adb0a8b97294b205cb2 | src/info_retrieval/info_retrieval.py | src/info_retrieval/info_retrieval.py | # LING 573 Question Answering System
# Code last updated 4/17/14 by Clara Gordon
# This code implements an InfoRetriever for the question answering system.
from pymur import *
from general_classes import *
class InfoRetriever:
# builds a QueryEnvironment associated with the indexed document collection
def... | # LING 573 Question Answering System
# Code last updated 4/17/14 by Clara Gordon
# This code implements an InfoRetriever for the question answering system.
from pymur import *
from general_classes import *
class InfoRetriever:
# builds a QueryEnvironment associated with the indexed document collection
def... | Join word tokens into space-delimited string in InfoRetriever | Join word tokens into space-delimited string in InfoRetriever
| Python | mit | amkahn/question-answering,amkahn/question-answering | ---
+++
@@ -25,6 +25,7 @@
def retrieve_passages(self, queries):
passages = []
for query in queries:
+ query = " ".join(query)
# second argument is the number of documents desired
docs = self.query_env.runQuery("#combine[passage50:25](" + query + ")", 20)
... |
36c7fab4939bbf15c3023883aafdf5f302600018 | usingnamespace/management/traversal/__init__.py | usingnamespace/management/traversal/__init__.py | class Root(object):
"""ManagementRoot
The main root object for any management traversal
"""
__name__ = None
__parent__ = None
def __init__(self, request):
"""Create the default root object
:request: The Pyramid request object
"""
self._request = request
... | class Root(object):
"""ManagementRoot
The main root object for any management traversal
"""
__name__ = None
__parent__ = None
def __init__(self, request):
"""Create the default root object
:request: The Pyramid request object
"""
self._request = request
... | Add API traversal to the management app | Add API traversal to the management app
| Python | isc | usingnamespace/usingnamespace | ---
+++
@@ -17,4 +17,31 @@
def __getitem__(self, key):
"""Check to see if we can traverse this ..."""
+
+ next_ctx = None
+
+ if key == 'api':
+ next_ctx = API()
+
+ if next_ctx is None:
+ raise KeyError
+
+ next_ctx.__parent__ = self
+
+ return... |
b21fa7c5b4aeb7421149730df3e1a5e3bec97ed3 | dodo_commands/dodo_upgrade.py | dodo_commands/dodo_upgrade.py | import os
import sys
from plumbum import local
def main(): # noqa
pip = local[os.path.join(os.path.dirname(sys.executable), "pip")]
pip["install", "--upgrade", "dodo_commands"]
| import os
import sys
from plumbum import local
def main(): # noqa
pip = local[os.path.join(os.path.dirname(sys.executable), "pip")]
pip("install", "--upgrade", "dodo_commands")
| Fix dodo-upgrade (nothing was executed) | Fix dodo-upgrade (nothing was executed)
| Python | mit | mnieber/dodo_commands | ---
+++
@@ -5,4 +5,4 @@
def main(): # noqa
pip = local[os.path.join(os.path.dirname(sys.executable), "pip")]
- pip["install", "--upgrade", "dodo_commands"]
+ pip("install", "--upgrade", "dodo_commands") |
3ffb34257acdd58ec8929bf7ec7d5bd2567be334 | nvchecker_source/git.py | nvchecker_source/git.py | # MIT licensed
# Copyright (c) 2020 Felix Yan <felixonmars@archlinux.org>, et al.
from .cmd import run_cmd # type: ignore
async def get_version(
name, conf, *, cache, keymanager=None
):
git = conf['git']
cmd = f"git ls-remote -t --refs {git}"
data = await cache.get(cmd, run_cmd)
versions = list(map(lambda l... | # MIT licensed
# Copyright (c) 2020 Felix Yan <felixonmars@archlinux.org>, et al.
from .cmd import run_cmd # type: ignore
async def get_version(
name, conf, *, cache, keymanager=None
):
git = conf['git']
cmd = f"git ls-remote -t --refs {git}"
data = await cache.get(cmd, run_cmd)
versions = [line.split("refs... | Use list comprehension instead of map lambda | Use list comprehension instead of map lambda
| Python | mit | lilydjwg/nvchecker | ---
+++
@@ -9,5 +9,5 @@
git = conf['git']
cmd = f"git ls-remote -t --refs {git}"
data = await cache.get(cmd, run_cmd)
- versions = list(map(lambda line: line.split("refs/tags/")[1], data.split("\n")))
+ versions = [line.split("refs/tags/")[1] for line in data.splitlines()]
return versions |
d2456f280fd1d1bff44475b870bf067d2694fc9d | chainerrl/functions/arctanh.py | chainerrl/functions/arctanh.py | from chainer.backends import cuda
from chainer import function_node
from chainer import utils
from chainer.utils import type_check
class Arctanh(function_node.FunctionNode):
"""Elementwise inverse hyperbolic tangent function."""
def check_type_forward(self, in_types):
type_check._argname(in_types, (... | from chainer.backends import cuda
from chainer import function_node
from chainer import utils
from chainer.utils import type_check
class Arctanh(function_node.FunctionNode):
"""Elementwise inverse hyperbolic tangent function."""
def check_type_forward(self, in_types):
if hasattr(type_check, '_argnam... | Fix chainer v4 error about type_check._argname | Fix chainer v4 error about type_check._argname
| Python | mit | toslunar/chainerrl,toslunar/chainerrl | ---
+++
@@ -9,7 +9,9 @@
"""Elementwise inverse hyperbolic tangent function."""
def check_type_forward(self, in_types):
- type_check._argname(in_types, ('x',))
+ if hasattr(type_check, '_argname'):
+ # typecheck._argname is introduced by Chainer v6
+ type_check._argname(... |
3c264c4ddf3e21c3b0e495d663e78dc3c80ce949 | python/saliweb/test/MySQLdb/cursors.py | python/saliweb/test/MySQLdb/cursors.py | import datetime
class DictCursor(object):
def __init__(self, conn):
self.conn = conn
def execute(self, sql, args=()):
self.sql, self.args = sql, args
def fetchone(self):
if self.sql == 'SELECT * FROM jobs WHERE name=%s AND passwd=%s':
# Check completed jobs
... | import datetime
class DictCursor(object):
def __init__(self, conn):
self.conn = conn
def execute(self, sql, args=()):
self.sql, self.args = sql, args
def fetchone(self):
if self.sql == 'SELECT * FROM jobs WHERE name=%s AND passwd=%s':
# Check completed jobs
... | Add support for completed-job email to mocks | Add support for completed-job email to mocks
| Python | lgpl-2.1 | salilab/saliweb,salilab/saliweb,salilab/saliweb,salilab/saliweb,salilab/saliweb | ---
+++
@@ -17,7 +17,8 @@
'passwd': j.passwd,
'archive_time': datetime.datetime(year=2099,
month=1, day=1),
- 'directory': j.directory}
+ 'dire... |
0c56e276aa1963ec35d744f61cecbb9368f115be | admin_tools/theming/templatetags/theming_tags.py | admin_tools/theming/templatetags/theming_tags.py | """
Theming template tags.
To load the theming tags just do: ``{% load theming_tags %}``.
"""
from django import template
from django.conf import settings
from admin_tools.utils import get_media_url
register = template.Library()
def render_theming_css():
"""
Template tag that renders the needed css files fo... | """
Theming template tags.
To load the theming tags just do: ``{% load theming_tags %}``.
"""
from django import template
from django.conf import settings
from admin_tools.utils import get_media_url
register = template.Library()
def render_theming_css():
"""
Template tag that renders the needed css files fo... | Enable not loading theming CSS by explicitely setting ADMIN_TOOLS_THEMING_CSS to None | Enable not loading theming CSS by explicitely setting ADMIN_TOOLS_THEMING_CSS to None
| Python | mit | liberation/django-admin-tools,liberation/django-admin-tools,liberation/django-admin-tools,liberation/django-admin-tools | ---
+++
@@ -13,11 +13,20 @@
def render_theming_css():
"""
Template tag that renders the needed css files for the theming app.
+
+ If ADMIN_TOOLS_THEMING_CSS is explicitely defined to None, don't render
+ anything.
"""
- css = getattr(settings, 'ADMIN_TOOLS_THEMING_CSS', False)
- if css:
- ... |
21e961d7b52b5e34607f899748ef7be9aa3cd1be | evalset/multiopt_test_funcs.py | evalset/multiopt_test_funcs.py | from evalset.test_funcs import TestFunction, lzip
import numpy
class MultioptTestFunction(TestFunction):
def __init__(self, dim):
super(MultioptTestFunction, self).__init__(dim)
self.local_minima_loc = [] # Sorted in increasing order of function value at the local minima
class LowDMixtureOfGaussians(Multio... | from evalset.test_funcs import TestFunction, lzip
import numpy
class MultioptTestFunction(TestFunction):
def __init__(self, dim):
super(MultioptTestFunction, self).__init__(dim)
self.local_minima_loc = [] # Sorted in increasing order of function value at the local minima
class LowDMixtureOfGaussians01(Mult... | Add 01 to function name | Add 01 to function name
| Python | mit | sigopt/evalset | ---
+++
@@ -7,11 +7,11 @@
super(MultioptTestFunction, self).__init__(dim)
self.local_minima_loc = [] # Sorted in increasing order of function value at the local minima
-class LowDMixtureOfGaussians(MultioptTestFunction):
+class LowDMixtureOfGaussians01(MultioptTestFunction):
def __init__(self, dim=2)... |
5785323d0a83c1f8b3b4e1cd17a22ff5222114fe | mistraldashboard/test/tests/error_handle.py | mistraldashboard/test/tests/error_handle.py | # Copyright 2015 ASD Technologies Co.
#
# 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 ... | # Copyright 2015 ASD Technologies Co.
#
# 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 ... | Remove the test cases for handle_errors to fix the py27 gate issue | Remove the test cases for handle_errors to fix the py27 gate issue
As we just change the exceptions handle method in horizon, now the
test cases have some issues, so disable them first to fix all py27
gate fails.
Change-Id: Ic369434a40ff209b06de9481884637d46ee588f7
| Python | apache-2.0 | openstack/mistral-dashboard,openstack/mistral-dashboard,openstack/mistral-dashboard | ---
+++
@@ -12,7 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-from mistraldashboard.handle_errors import handle_errors
from mistraldashboard.test import helpers as test
@@ -20,20 +19,3 @@
class CommonException(Exception):
pass
... |
1454ae817862fc446ad5948cbefe2825ceb46fc8 | queue.py | queue.py | #!/usr/bin/env python
'''Implementation of a simple queue data structure.
The queue has `enqueue`, `dequeue`, and `peek` methods.
Items in the queue have `value` and `behind` attributes.
The queue has a `front` attribute.
'''
class Item(object):
def __init__(self, value, behind=None):
self.value = value
... | #!/usr/bin/env python
'''Implementation of a simple queue data structure.
The queue has `enqueue`, `dequeue`, and `peek` methods.
Items in the queue have `value` and `behind` attributes.
The queue has a `front` attribute.
'''
class Item(object):
def __init__(self, value, behind=None):
self.value = value
... | Add peek function to Queue class | Add peek function to Queue class
| Python | mit | jwarren116/data-structures-deux | ---
+++
@@ -27,4 +27,7 @@
pass
def peek(self):
- pass
+ try:
+ return self.front.value
+ except AttributeError:
+ raise ValueError('No items in queue') |
dc4a16a663e718e07815d810313d36fcc6039878 | sequere/backends/redis/query.py | sequere/backends/redis/query.py | from collections import OrderedDict
from sequere.query import QuerySetTransformer
from sequere import utils
class RedisQuerySetTransformer(QuerySetTransformer):
def __init__(self, client, count, key, prefix, manager):
super(RedisQuerySetTransformer, self).__init__(client, count)
self.keys = [key... | try:
from collections import OrderedDict
except ImportError:
from django.utils.datastructures import SortedDict as OrderedDict
from sequere.query import QuerySetTransformer
from sequere import utils
class RedisQuerySetTransformer(QuerySetTransformer):
def __init__(self, client, count, key, prefix, manage... | Fix compat for python 2.6 | Fix compat for python 2.6
| Python | mit | thoas/django-sequere | ---
+++
@@ -1,4 +1,7 @@
-from collections import OrderedDict
+try:
+ from collections import OrderedDict
+except ImportError:
+ from django.utils.datastructures import SortedDict as OrderedDict
from sequere.query import QuerySetTransformer
from sequere import utils
@@ -37,4 +40,5 @@
objects = sel... |
c324a640893a4a6b36bb8edfe0515fad55d1df2d | efm2riot/patches.py | efm2riot/patches.py | EXTERN_START = "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n"
EXTERN_STOP = "#ifdef __cplusplus\n}\n#endif\n\n"
EXTERN_FIND1 = "extern \"C\" {\n"
EXTERN_FIND2 = " *****************************************************************************/\n" # noqa
def add_extern_c(source_file, source):
"""
Add 'Exte... | EXTERN_START = "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n"
EXTERN_STOP = "#ifdef __cplusplus\n}\n#endif\n\n"
EXTERN_FIND1 = "extern \"C\" {\n"
EXTERN_FIND2 = " *****************************************************************************/\n" # noqa
def add_extern_c(source_file, source):
"""
Add 'Exte... | Make sure that Linux line endings are used. | Make sure that Linux line endings are used.
| Python | mit | basilfx/EFM2Riot,basilfx/EFM2Riot,basilfx/EFM2Riot,basilfx/EFM2Riot,basilfx/EFM2Riot | ---
+++
@@ -9,6 +9,12 @@
"""
Add 'Extern C' to a given source_file.
"""
+
+ # Patches only work with newline versions of the file.
+ if "\r\n" in source:
+ raise Exception(
+ "You need to convert all Gecko SDK sources to Linux file endings "
+ "first (use something li... |
e07c1659f5c8dcad473b43f492a3418083e8fdad | setup.py | setup.py | # pylint: disable=missing-docstring
from setuptools import setup
from setuptools import find_packages
setup(name='mltils',
version='0.1',
description='A package with utility functions for Machine Learning',
author='Rafael Ladeira',
author_email='rwladeira@gmail.com',
license='MIT',
... | # pylint: disable=missing-docstring
from setuptools import setup
from setuptools import find_packages
setup(name='mltils',
version='0.1',
description='A package with utility functions for Machine Learning',
author='Rafael Ladeira',
author_email='rwladeira@gmail.com',
license='MIT',
... | Add statsmodels as a dependency | Add statsmodels as a dependency
| Python | mit | rladeira/mltils | ---
+++
@@ -10,6 +10,6 @@
license='MIT',
install_requires=[
'tqdm', 'numpy', 'scipy', 'scikit-learn', 'pandas',
- 'xgboost'
+ 'xgboost', 'statsmodels'
],
packages=find_packages()) |
e727b390732687565a0a21127e78c6d36e8a8b84 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='blanc-basic-news',
version='0.3',
description='Blanc Basic News for Django',
long_description=open('README.rst').read(),
url='https://github.com/blancltd/blanc-basic-news',
maintainer='Blanc Ltd',
maintainer_emai... | #!/usr/bin/env python
from setuptools import find_packages, setup
setup(
name='blanc-basic-news',
version='0.3',
description='Blanc Basic News for Django',
long_description=open('README.rst').read(),
url='https://github.com/blancltd/blanc-basic-news',
maintainer='Blanc Ltd',
maintainer_ema... | Add Python 3.4 to supported list | Add Python 3.4 to supported list
| Python | bsd-3-clause | blancltd/blanc-basic-news | ---
+++
@@ -1,5 +1,6 @@
#!/usr/bin/env python
-from setuptools import setup, find_packages
+from setuptools import find_packages, setup
+
setup(
name='blanc-basic-news',
@@ -25,6 +26,7 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming L... |
1abed516121f879e7497b665d59866d7a59ccc4a | setup.py | setup.py | import distutils.core
import sys
from rabbitpy import __version__
tests_require = ['nose', 'mock']
if sys.version_info < (2, 7, 0):
tests_require.append('unittest2')
desc = 'A minimalistic & pythonic AMQP library focused on supporting RabbitMQ'
distutils.core.setup(name='rabbitpy',
version=... | import distutils.core
import sys
from rabbitpy import __version__
tests_require = ['nose', 'mock']
if sys.version_info < (2, 7, 0):
tests_require.append('unittest2')
desc = 'A minimalistic & pythonic AMQP library focused on supporting RabbitMQ'
distutils.core.setup(name='rabbitpy',
version=... | Change the development status to Beta | Change the development status to Beta
| Python | bsd-3-clause | gmr/rabbitpy,gmr/rabbitpy,jonahbull/rabbitpy | ---
+++
@@ -23,7 +23,7 @@
tests_require=tests_require,
test_suite='nose.collector',
license=open('LICENSE').read(),
- classifiers=['Development Status :: 3 - Alpha',
+ classifiers=['Development Status :: 4 - Beta... |
0805fd05006d3efba6b6fa52b5921ed01120988b | wagtail_pgsearchbackend/migrations/0002_add_gin_index.py | wagtail_pgsearchbackend/migrations/0002_add_gin_index.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-03-22 14:53
from __future__ import unicode_literals
from django.db import migrations
from ..models import IndexEntry
table = IndexEntry._meta.db_table
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtail_pgs... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-03-22 14:53
from __future__ import unicode_literals
from django.db import migrations
from ..models import IndexEntry
table = IndexEntry._meta.db_table
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtail_pgs... | Fix migration for Postgres < 9.5 | Fix migration for Postgres < 9.5
| Python | mit | wagtail/wagtail-pg-search-backend | ---
+++
@@ -20,7 +20,7 @@
operations = [
migrations.RunSQL(
- 'CREATE INDEX IF NOT EXISTS {0}_body_search ON {0} '
+ 'CREATE INDEX {0}_body_search ON {0} '
'USING GIN(body_search);'.format(table),
'DROP INDEX IF EXISTS {}_body_search;'.format(table),
... |
991e0f6692a5a07eda8bd1901af6110b5a7dee0b | setup.py | setup.py | import setuptools
import sys
import os.path
import subprocess
# Build README.txt from README.md if not present, and if we are actually building for distribution to pypi
if not os.path.exists('README.txt') and 'sdist' in sys.argv:
subprocess.call(['pandoc', '--to=rst', '--smart', '--output=README.txt', 'README.md... | import setuptools
import sys
import os.path
import subprocess
# Build README.txt from README.md if not present, and if we are actually building for distribution to pypi
if not os.path.exists('README.txt') and 'sdist' in sys.argv:
subprocess.call(['pandoc', '--to=rst', '--smart', '--output=README.txt', 'README.md... | Add more specific Python version classifiers | Add more specific Python version classifiers
| Python | apache-2.0 | abloomston/python-jsonpath-rw,kennknowles/python-jsonpath-rw,brianthelion/python-jsonpath-rw,pkilambi/python-jsonpath-rw,wangjild/python-jsonpath-rw,sileht/python-jsonpath-rw | ---
+++
@@ -28,6 +28,10 @@
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
'Programming Language :: Py... |
264e522539f7df0743c1724ad69a83495055d78b | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
import os
from azure_storage import __version__
PACKAGE_DIR = os.path.abspath(os.path.dirname(__file__))
os.chdir(PACKAGE_DIR)
setup(
name='django-azure-storage',
version=__version__,
url="https://github.com/Rediker-Software/django-azure-... | #!/usr/bin/env python
from setuptools import setup, find_packages
import os
from azure_storage import __version__
PACKAGE_DIR = os.path.abspath(os.path.dirname(__file__))
os.chdir(PACKAGE_DIR)
setup(
name='django-azure-storage',
version=__version__,
url="https://github.com/Rediker-Software/django-azure-... | Switch to only requiring azure-storage | Switch to only requiring azure-storage
This switches the requirement to match azure@1.0.3. We no longer
require all of the Azure packages in order to use the storage
adapter. This should not be a breaking change, it only reduces the
scope of the requirements to be as minimal as possible for this
package. There are no ... | Python | mit | Rediker-Software/django-azure-storage | ---
+++
@@ -20,7 +20,7 @@
include_package_data=True,
install_requires=[
'Django>=1.3',
- 'azure>=1.0.0,<1.1.0',
+ 'azure-storage>=0.20.0,<0.30.0',
],
# See http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[ |
ce53b83dba2bdbbd04497d4edda402ccc79bed76 | setup.py | setup.py | from setuptools import setup
setup(
name = "simplecpreprocessor",
version = "0.0.4",
author = "Seppo Yli-Olli",
author_email = "seppo.yli-olli@iki.fi",
description = "Simple C preprocessor for usage eg before CFFI",
keywords = "python c preprocessor",
license = "BSD",
url = "https://git... | from setuptools import setup
setup(
name = "simplecpreprocessor",
version = "0.0.5",
author = "Seppo Yli-Olli",
author_email = "seppo.yli-olli@iki.fi",
description = "Simple C preprocessor for usage eg before CFFI",
keywords = "python c preprocessor",
license = "BSD",
url = "https://git... | Bump version to fix URL | Bump version to fix URL
| Python | mit | nanonyme/simplecpreprocessor | ---
+++
@@ -2,7 +2,7 @@
setup(
name = "simplecpreprocessor",
- version = "0.0.4",
+ version = "0.0.5",
author = "Seppo Yli-Olli",
author_email = "seppo.yli-olli@iki.fi",
description = "Simple C preprocessor for usage eg before CFFI", |
63b484e164a24b2f14475ed9a4efbcb025707e03 | setup.py | setup.py | from django_rocket import __version__, __author__, __email__, __license__
from setuptools import setup, find_packages
README = open('README.rst').read()
# Second paragraph has the short description
description = README.split('\n')[1]
setup(
name='django-rocket',
version=__version__,
description=descripti... | from django_rocket import __version__, __author__, __email__, __license__
from setuptools import setup, find_packages
README = open('README.rst').read()
# Second paragraph has the short description
description = README.split('\n')[1]
setup(
name='django-rocket',
version=__version__,
description=descripti... | Exclude common unwanted package patterns | Exclude common unwanted package patterns
| Python | mit | mariocesar/django-rocket,mariocesar/django-rocket | ---
+++
@@ -16,7 +16,7 @@
license=__license__,
url='https://github.com/mariocesar/django-rocket',
download_url='https://pypi.python.org/pypi/django-rocket',
- packages=find_packages(exclude=['tests', 'tests.*']),
+ packages=find_packages(exclude=['tests', 'tests.*', 'example', 'docs', 'env']),
... |
96a43f4ef5dae1cfdd8fd356bc3d22e98971dd00 | setup.py | setup.py | import sys
from setuptools import setup, find_packages
import populous
requirements = [
"click",
"cached-property",
"fake-factory",
"dateutils",
"PyYAML",
"peloton_bloomfilters"
]
if sys.version_info < (3, 2):
requirements.append('functools32')
setup(
name="populous",
version=po... | import sys
from setuptools import setup, find_packages
import populous
requirements = [
"click",
"cached-property",
"Faker",
"dateutils",
"PyYAML",
"peloton_bloomfilters"
]
if sys.version_info < (3, 2):
requirements.append('functools32')
setup(
name="populous",
version=populous.... | Use new 'Faker' package for fake-factory | Use new 'Faker' package for fake-factory
| Python | mit | novafloss/populous | ---
+++
@@ -7,7 +7,7 @@
requirements = [
"click",
"cached-property",
- "fake-factory",
+ "Faker",
"dateutils",
"PyYAML",
"peloton_bloomfilters" |
974160117e2f36b12b52df13d4a35726a4ff0907 | boxsdk/object/api_json_object.py | boxsdk/object/api_json_object.py | # coding: utf-8
from __future__ import unicode_literals, absolute_import
from collections import Mapping
from abc import ABCMeta
from .base_api_json_object import BaseAPIJSONObject, BaseAPIJSONObjectMeta
from ..util.compat import with_metaclass
class APIJSONObjectMeta(BaseAPIJSONObjectMeta, ABCMeta):
"""
A... | # coding: utf-8
from __future__ import unicode_literals, absolute_import
from collections import Mapping
from abc import ABCMeta
from .base_api_json_object import BaseAPIJSONObject, BaseAPIJSONObjectMeta
from ..util.compat import with_metaclass
class APIJSONObjectMeta(BaseAPIJSONObjectMeta, ABCMeta):
"""
A... | Remove redundant __iter__ from APIJsonObject base class | Remove redundant __iter__ from APIJsonObject base class
| Python | apache-2.0 | box/box-python-sdk | ---
+++
@@ -22,6 +22,3 @@
def __len__(self):
return len(self._response_object)
-
- def __iter__(self):
- return iter(self._response_object) |
1ec0f5267119874244474072dfb32f952ae4a8f1 | setup.py | setup.py | from distutils.core import setup
setup(
name='cardscript',
version='0.6',
description="A scriptable card game processing engine.",
author="Charles Nelson",
author_email="cnelsonsic@gmail.com",
url="https://github.com/cnelsonsic/cardscript",
packages=['cardscript', 'cardscript.cards'],
l... | from distutils.core import setup
from sh import pandoc
setup(
name='cardscript',
version='0.6',
description="A scriptable card game processing engine.",
author="Charles Nelson",
author_email="cnelsonsic@gmail.com",
url="https://github.com/cnelsonsic/cardscript",
packages=['cardscript', 'car... | Use pandoc to convert the markdown readme to rst. | Use pandoc to convert the markdown readme to rst.
| Python | agpl-3.0 | cnelsonsic/cardscript | ---
+++
@@ -1,4 +1,5 @@
from distutils.core import setup
+from sh import pandoc
setup(
name='cardscript',
@@ -9,7 +10,7 @@
url="https://github.com/cnelsonsic/cardscript",
packages=['cardscript', 'cardscript.cards'],
license='AGPLv3+',
- long_description=open('README.md').read(),
+ long_d... |
9bf70db96d8ae5204b20e1e214cb92e195ab5928 | changes/api/build_flaky_tests.py | changes/api/build_flaky_tests.py | from __future__ import absolute_import
from changes.api.base import APIView
from changes.config import db
from changes.constants import Result
from changes.models import Build, Job, TestCase
class BuildFlakyTestsAPIView(APIView):
def get(self, build_id):
build = Build.query.get(build_id)
if build... | from __future__ import absolute_import
from changes.api.base import APIView
from changes.config import db
from changes.constants import Result
from changes.models import Build, Job, TestCase
class BuildFlakyTestsAPIView(APIView):
def get(self, build_id):
build = Build.query.get(build_id)
if build... | Add projectSlug to build flaky tests API response | Add projectSlug to build flaky tests API response
Summary: We will use it in the test quarantine service to whitelist projects which support quarantine.
Test Plan:
Tested locally.
{
"projectSlug": "changesjenkins",
"repositoryUrl": "https://github.com/dropbox/changes.git",
"flakyTests": {
"count": 1,
"... | Python | apache-2.0 | dropbox/changes,wfxiang08/changes,wfxiang08/changes,dropbox/changes,dropbox/changes,wfxiang08/changes,bowlofstew/changes,dropbox/changes,wfxiang08/changes,bowlofstew/changes,bowlofstew/changes,bowlofstew/changes | ---
+++
@@ -27,6 +27,7 @@
flaky_tests = map(lambda test: {'name': test.name}, flaky_tests_query)
context = {
+ 'projectSlug': build.project.slug,
'repositoryUrl': build.project.repository.url,
'flakyTests': {
'count': len(flaky_tests), |
51466e1d18180e538cbbb92cc8d3c1a2417be5ff | geojsonlint/urls.py | geojsonlint/urls.py | from django.conf.urls import patterns, include, url
from django.conf import settings
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'geojsonlint.views.home', name='home'),
url(r'^validate$', 'g... | from django.conf.urls import patterns, include, url
from django.conf import settings
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'geojsonlint.views.home', name='home'),
url(r'^validate$', 'g... | Fix URL that was killing serving static files. | Fix URL that was killing serving static files.
| Python | bsd-2-clause | JasonSanford/geojsonlint.com,Drooids/geojsonlint.com,JasonSanford/geojsonlint.com,Drooids/geojsonlint.com,JasonSanford/geojsonlint.com,Drooids/geojsonlint.com | ---
+++
@@ -20,7 +20,5 @@
if settings.DEBUG:
urlpatterns += patterns('',
- url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {
- 'document_root': settings.STATIC_ROOT,
- }),
- )
+ (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STAT... |
6d5f5975f913e91554c02b008d3196fa5c6f90cb | setup.py | setup.py | #!/usr/bin/env python
import os
import sys
import io
try:
import setuptools
except ImportError:
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup, Extension
from setuptools import find_packages
mod_cv_algorithms = Extension('cv_algorithms._cv_algorithms',
... | #!/usr/bin/env python
import os
import sys
import io
try:
import setuptools
except ImportError:
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup, Extension
from setuptools import find_packages
extra_compile_args = [] if os.name == 'nt' else ["-g", "-O2", "-march=nat... | Fix passing GCC compiler options on Windows | Fix passing GCC compiler options on Windows | Python | apache-2.0 | ulikoehler/cv_algorithms,ulikoehler/cv_algorithms | ---
+++
@@ -10,14 +10,17 @@
from setuptools import setup, Extension
from setuptools import find_packages
+extra_compile_args = [] if os.name == 'nt' else ["-g", "-O2", "-march=native"]
+extra_link_args = [] if os.name == 'nt' else ["-g"]
+
mod_cv_algorithms = Extension('cv_algorithms._cv_algorithms',
... |
ba0805d69e4c5e897383403a9aef1a99861d5a86 | setup.py | setup.py | from setuptools import setup, find_packages
setup(name='pixiedust',
version='1.1.18',
description='Productivity library for Jupyter Notebook',
url='https://github.com/pixiedust/pixiedust',
install_requires=['mpld3', 'lxml', 'geojson', 'astunparse', 'markdown', 'colour', 'requests', 'matplotlib',... | from setuptools import setup, find_packages
setup(name='pixiedust',
version='1.1.18',
description='Productivity library for Jupyter Notebook',
url='https://github.com/pixiedust/pixiedust',
install_requires=['mpld3', 'lxml', 'geojson', 'astunparse', 'markdown', 'colour', 'requests', 'matplotlib',... | Resolve syntax errror during install | Resolve syntax errror during install
| Python | apache-2.0 | ibm-cds-labs/pixiedust,ibm-cds-labs/pixiedust,ibm-cds-labs/pixiedust,ibm-cds-labs/pixiedust | ---
+++
@@ -3,7 +3,7 @@
version='1.1.18',
description='Productivity library for Jupyter Notebook',
url='https://github.com/pixiedust/pixiedust',
- install_requires=['mpld3', 'lxml', 'geojson', 'astunparse', 'markdown', 'colour', 'requests', 'matplotlib', 'pandas],
+ install_requires=['m... |
ca470bc87dc8aceda0295f79864a47b208bf1a19 | setup.py | setup.py | #!/usr/bin/env python
# -----------------------------------------------------------------------------
# FreeType high-level python API - copyright 2011 Nicolas P. Rougier
# Distributed under the terms of the new BSD license.
# -----------------------------------------------------------------------------
from distutil... | #!/usr/bin/env python
# -----------------------------------------------------------------------------
# FreeType high-level python API - copyright 2011 Nicolas P. Rougier
# Distributed under the terms of the new BSD license.
# -----------------------------------------------------------------------------
from distutil... | Set classifiers to indicate this project supoorts both Python 2 and 3 | Set classifiers to indicate this project supoorts both Python 2 and 3
| Python | bsd-3-clause | daltonmaag/freetype-py,bitforks/freetype-py | ---
+++
@@ -22,7 +22,8 @@
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: Unix',
- 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 3',
'T... |
f42d42135ab234bd49337b826dbddce08cbff804 | setup.py | setup.py | """Setuptools configuration for rpmvenv."""
from setuptools import setup
from setuptools import find_packages
with open('README.rst', 'r') as readmefile:
README = readmefile.read()
setup(
name='rpmvenv',
version='0.19.0',
url='https://github.com/kevinconway/rpmvenv',
description='RPM packager f... | """Setuptools configuration for rpmvenv."""
from setuptools import setup
from setuptools import find_packages
with open('README.rst', 'r') as readmefile:
README = readmefile.read()
setup(
name='rpmvenv',
version='0.20.0',
url='https://github.com/kevinconway/rpmvenv',
description='RPM packager f... | Bump version for relative path fix | Bump version for relative path fix
| Python | mit | kevinconway/rpmvenv | ---
+++
@@ -10,7 +10,7 @@
setup(
name='rpmvenv',
- version='0.19.0',
+ version='0.20.0',
url='https://github.com/kevinconway/rpmvenv',
description='RPM packager for Python virtualenv.',
author="Kevin Conway", |
9faf2f746eb47ad0d3961ee1d934314c608c3614 | setup.py | setup.py | import os
import relman
import setuptools
BASEPATH = os.path.abspath(os.path.dirname(__file__))
def load_requirements(filename):
"""load requirements from a pip requirements file."""
lineiter = (line.strip()
for line in open(os.path.join(BASEPATH, filename)))
return [line for line in li... | import os
import relman
import setuptools
BASEPATH = os.path.abspath(os.path.dirname(__file__))
def load_requirements(filename):
"""load requirements from a pip requirements file."""
lineiter = (line.strip()
for line in open(os.path.join(BASEPATH, filename)))
return [line for line in li... | Fix dev status trove classifier. | Fix dev status trove classifier.
| Python | apache-2.0 | delapsley/relman | ---
+++
@@ -21,7 +21,7 @@
long_description='Release manager - Automation Toolkit',
classifiers=[
"Topic :: Software Development :: Build Tools",
- "Topic :: Software Development :: Documentation"
+ "Topic :: Software Development :: Documentation",
"Development Status :: 4 - B... |
a0dd5f40852af01d83451fd213f57a61a4fe0cc5 | openstack_dashboard/dashboards/project/images/snapshots/urls.py | openstack_dashboard/dashboards/project/images/snapshots/urls.py | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | Fix too loose url regex for snapshot creation | Fix too loose url regex for snapshot creation
Current regex '^(?P<instance_id>[^/]+)/create' for url
projects/images/<instance-id>/create will match all urls start with 'create' by
mistake. The '$' added will make sure the regex only match 'create' as expect.
Change-Id: I9f180d8d904d15e9458513f39b1e4719ac6800a3
Close... | Python | apache-2.0 | gerrive/horizon,wolverineav/horizon,noironetworks/horizon,openstack/horizon,wolverineav/horizon,redhat-openstack/horizon,davidcusatis/horizon,noironetworks/horizon,Mirantis/mos-horizon,django-leonardo/horizon,redhat-cip/horizon,bigswitch/horizon,dan1/horizon-x509,redhat-cip/horizon,davidcusatis/horizon,django-leonardo/... | ---
+++
@@ -24,7 +24,7 @@
urlpatterns = patterns(
'',
- url(r'^(?P<instance_id>[^/]+)/create',
+ url(r'^(?P<instance_id>[^/]+)/create/$',
views.CreateView.as_view(),
name='create')
) |
dd3ddd6bb7fcfdf9aa230ba53dde85f4cab4cc6d | setup.py | setup.py | from setuptools import setup
setup(
name="demosys-py",
version="0.3.10",
description="Modern OpenGL 4.1+ Framework inspired by Django",
long_description=open('README.rst').read(),
url="https://github.com/Contraz/demosys-py",
author="Einar Forselv",
author_email="eforselv@gmail.com",
mai... | from setuptools import setup
setup(
name="demosys-py",
version="0.3.10",
description="Modern OpenGL 3.3+ Framework inspired by Django",
long_description=open('README.rst').read(),
url="https://github.com/Contraz/demosys-py",
author="Einar Forselv",
author_email="eforselv@gmail.com",
mai... | Update package description to specify OpenGL 3.3+ | Update package description to specify OpenGL 3.3+
| Python | isc | Contraz/demosys-py | ---
+++
@@ -3,7 +3,7 @@
setup(
name="demosys-py",
version="0.3.10",
- description="Modern OpenGL 4.1+ Framework inspired by Django",
+ description="Modern OpenGL 3.3+ Framework inspired by Django",
long_description=open('README.rst').read(),
url="https://github.com/Contraz/demosys-py",
... |
6f7354ac31e0ac19a1d2850093a5f1e9901b4fb5 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='pytest-relaxed',
version='0.0.1',
description='Relaxed test discovery/organization for pytest',
license='BSD',
author='Jeff Forcier',
author_email='jeff@bitprophet.org',
packages=find_packages(),
entry_poi... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='pytest-relaxed',
version='0.0.1',
description='Relaxed test discovery/organization for pytest',
license='BSD',
url="https://github.com/bitprophet/pytest-relaxed",
author='Jeff Forcier',
author_email='jeff@bitpr... | Add URL and long-desc to metadata | Add URL and long-desc to metadata
| Python | bsd-2-clause | bitprophet/pytest-relaxed | ---
+++
@@ -8,8 +8,10 @@
description='Relaxed test discovery/organization for pytest',
license='BSD',
+ url="https://github.com/bitprophet/pytest-relaxed",
author='Jeff Forcier',
author_email='jeff@bitprophet.org',
+ long_description="\n" + open('README.rst').read(),
packages=find_p... |
0d3481a2ee4eb5a079a580785124d610d5bcc9e0 | setup.py | setup.py | from distutils.core import setup
from setuptools import find_packages
VERSION = __import__("import_export").__version__
CLASSIFIERS = [
'Framework :: Django',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Intended Au... | from distutils.core import setup
from setuptools import find_packages
VERSION = __import__("import_export").__version__
CLASSIFIERS = [
'Framework :: Django',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Intended Au... | Add trove classifiers for all supported Python versions | Add trove classifiers for all supported Python versions
| Python | bsd-2-clause | bmihelac/django-import-export,django-import-export/django-import-export,daniell/django-import-export,copperleaftech/django-import-export,django-import-export/django-import-export,jnns/django-import-export,daniell/django-import-export,copperleaftech/django-import-export,bmihelac/django-import-export,copperleaftech/djang... | ---
+++
@@ -13,10 +13,15 @@
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
- 'Topic :: Software Development',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
+ 'Programming Language :: Python ::... |
2c696d7182bf6f857842e2ae95efa5eaa4fb2594 | setup.py | setup.py | from distutils.core import Extension, setup
from Cython.Build import cythonize
extensions = [
Extension('*', ['mathix/*.pyx']),
]
setup(
name='mathix',
author='Peith Vergil',
version='0.1',
ext_modules=cythonize(extensions)
)
| from distutils.core import Extension, setup
from Cython.Build import cythonize
try:
from Cython.Distutils import build_ext
except ImportError:
use_cython = False
else:
use_cython = True
if use_cython:
extensions = [
Extension('mathix.vector', ['mathix/vector.pyx']),
]
cmdclass = {
... | Add more classifiers. Check if Cython compilation is available or not. | Add more classifiers. Check if Cython compilation is available or not.
| Python | mit | PeithVergil/cython-example | ---
+++
@@ -2,10 +2,28 @@
from Cython.Build import cythonize
+try:
+ from Cython.Distutils import build_ext
+except ImportError:
+ use_cython = False
+else:
+ use_cython = True
-extensions = [
- Extension('*', ['mathix/*.pyx']),
-]
+
+if use_cython:
+ extensions = [
+ Extension('mathix.ve... |
2337deea980b12ea83bd0c05feac2f1b503c5869 | setup.py | setup.py | #!/usr/bin/env python
# coding=utf-8
from setuptools import setup, find_packages
import os
def find_scripts(scriptdir):
"""scrape all available scripts from 'bin' folder"""
return [os.path.join(scriptdir, s) for s in os.listdir(scriptdir) if not s.endswith(".pyc")]
setup(
name = "veros",
version = "... | #!/usr/bin/env python
# coding=utf-8
from setuptools import setup, find_packages
import os
def find_scripts(scriptdir):
"""scrape all available scripts from 'bin' folder"""
return [os.path.join(scriptdir, s) for s in os.listdir(scriptdir) if not s.endswith(".pyc")]
setup(
name = "veros",
version = "... | Remove version requirement for numpy | Remove version requirement for numpy | Python | mit | dionhaefner/veros,dionhaefner/veros | ---
+++
@@ -14,7 +14,7 @@
version = "0.0.1b0",
packages = find_packages(),
install_requires = [
- "numpy<1.12",
+ "numpy",
"scipy",
"netCDF4",
"h5py", |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.