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 |
|---|---|---|---|---|---|---|---|---|---|---|
54ab75918503ccaa991f9298c01d54a99b830c9b | games.py | games.py | """
This module is for generating fake game data for use with the API.
An example of some game data::
{
"id": 1,
"logURL": "http://derp.nope/",
"updates": [
{
"status": "complete",
"time": "today"
}
],
"players": [
... | """
This module is for generating fake game data for use with the API.
An example of some game data::
{
"id": 1,
"logURL": "http://derp.nope/",
"updates": [
{
"status": "complete",
"time": "today"
}
],
"players": [
... | Use 1-indexed counting for game IDs | Use 1-indexed counting for game IDs
| Python | bsd-3-clause | siggame/ng-games,siggame/ng-games,siggame/ng-games | ---
+++
@@ -30,7 +30,7 @@
def game_data(players, count):
now = datetime.datetime.now()
- for id in xrange(count):
+ for id in xrange(1, count+1):
yield {
"id": id,
"logURL": "about:blank", |
7681cfa394cdc91f77389a77ed8379cd5335f2c9 | setup.py | setup.py | from setuptools import setup, find_packages
GITHUB_ALERT = """**NOTE**: These are the docs for the version of envbuilder in git. For
documentation on the last release, see the `pypi_page <http://pypi.python.org/pypi/envbuilder/>`_."""
readme = open('README.rst', 'r')
unsplit_readme_text = readme.read()
split_text =... | from setuptools import setup, find_packages
GITHUB_ALERT = """**NOTE**: These are the docs for the version of envbuilder in git. For
documentation on the last release, see the `pypi_page <http://pypi.python.org/pypi/envbuilder/>`_."""
readme = open('README.rst', 'r')
unsplit_readme_text = readme.read()
split_text =... | Revert "Changing this to a release candidate." | Revert "Changing this to a release candidate."
This reverts commit a9f8afbc1c5a40d0a35e3a9757f8c96da494d35a.
| Python | bsd-3-clause | jasonbaker/envbuilder,jasonbaker/envbuilder | ---
+++
@@ -14,7 +14,7 @@
name='envbuilder',
author='Jason Baker',
author_email='amnorvend@gmail.com',
- version='0.2.0rc',
+ version='0.2.0b2',
packages=find_packages(),
setup_requires=['nose'],
install_requires=['ConfigObj>=4.7.0', 'argparse', 'pip', 'virtualenv'], |
55a87e2fa74af95cbfa86ccde427b16bf1512690 | setup.py | setup.py | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
import skypipe
setup(
name='skypipe',
version=skypipe.VERSION,
author='Jeff Lindsay',
author_email='progrium@gmail.com',
description='Magic pipe in the sky',
long_description=open(os.path.join(os.path.dirname(__file__)... | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
import skypipe
setup(
name='skypipe',
version=skypipe.VERSION,
author='Jeff Lindsay',
author_email='progrium@gmail.com',
description='Magic pipe in the sky',
long_description=open(os.path.join(os.path.dirname(__file__)... | Add dotcloud version requirement (I had 0.4.2 and that didn't work). | Add dotcloud version requirement (I had 0.4.2 and that didn't work).
| Python | mit | progrium/skypipe,progrium/skypipe | ---
+++
@@ -20,7 +20,7 @@
],
url="http://github.com/progrium/skypipe",
packages=find_packages(),
- install_requires=['pyzmq', 'dotcloud', 'argparse'],
+ install_requires=['pyzmq', 'dotcloud>=0.7', 'argparse'],
zip_safe=False,
package_data={
'skypipe': ['satellite/*']}, |
73b195cc952ade2b2e0a2c11d32616dfa3d8baa1 | yasibo/__init__.py | yasibo/__init__.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
def botcmd(*args, **kwargs):
"""
Decorator to declare a function as a... | Add fucntion to create bot commands | Add fucntion to create bot commands
| Python | mpl-2.0 | Yasibo/yasibo | ---
+++
@@ -0,0 +1,29 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+def botcmd(*args, **kwargs):
+ """
+ ... | |
e3765f9d109a6eacfce30a14ff01bd00a56c4c21 | setup.py | setup.py | from setuptools import setup
import jasinja, sys
requires = ['Jinja2']
if sys.version_info < (2, 6):
requires += ['simplejson']
setup(
name='jasinja',
version=jasinja.__version__,
url='http://bitbucket.org/djc/jasinja',
license='BSD',
author='Dirkjan Ochtman',
author_email='dirkjan@ochtman... | from setuptools import setup
import jasinja, sys
requires = ['Jinja2']
if sys.version_info < (2, 6):
requires += ['simplejson']
setup(
name='jasinja',
version=jasinja.__version__,
url='http://bitbucket.org/djc/jasinja',
license='BSD',
author='Dirkjan Ochtman',
author_email='dirkjan@ochtman... | Add test_requires dependency on python-spidermonkey. | Add test_requires dependency on python-spidermonkey.
| Python | bsd-3-clause | djc/jasinja,djc/jasinja | ---
+++
@@ -29,6 +29,7 @@
},
install_requires=requires,
test_suite='jasinja.tests.run.suite',
+ test_requires=['python-spidermonkey'],
entry_points={
'console_scripts': ['jasinja-compile = jasinja.compile:main'],
}, |
07c9b76d63714c431a983f0506ff71f19face3bd | astroquery/alma/tests/setup_package.py | astroquery/alma/tests/setup_package.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
def get_package_data():
paths = [os.path.join('data', '*.txt')]
return {'astroquery.alma.tests': paths}
| # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
def get_package_data():
paths = [os.path.join('data', '*.txt'), os.path.join('data', '*.xml')]
return {'astroquery.alma.tests': paths}
| Include xml datafile for alma tests | Include xml datafile for alma tests
| Python | bsd-3-clause | imbasimba/astroquery,imbasimba/astroquery,ceb8/astroquery,ceb8/astroquery | ---
+++
@@ -5,5 +5,5 @@
def get_package_data():
- paths = [os.path.join('data', '*.txt')]
+ paths = [os.path.join('data', '*.txt'), os.path.join('data', '*.xml')]
return {'astroquery.alma.tests': paths} |
c0ee0f27b21ed7c6eb97ad6b1fc1c7d72127c772 | audio_pipeline/tb_ui/util/Resources.py | audio_pipeline/tb_ui/util/Resources.py | import uuid
import os
from audio_pipeline.util.AudioFileFactory import AudioFileFactory
from audio_pipeline.util import Exceptions
mbid_directory = "Ready To Filewalk"
picard_directory = "Picard Me!"
cache_limit = 30
cancel = -1
checked = 1
unchecked = 0
def has_mbid(track):
"""
Check whether or not the gi... | import uuid
import os
from audio_pipeline.util.AudioFileFactory import AudioFileFactory
from audio_pipeline.util import Exceptions
mbid_directory = "Ready To Filewalk"
picard_directory = "Picard Me!"
cache_limit = 30
cancel = -1
checked = 1
unchecked = 0
def has_mbid(track):
"""
Check whether or not the gi... | Remove os.scandir usage (not in python 3.4) | Remove os.scandir usage (not in python 3.4)
| Python | mit | hidat/audio_pipeline | ---
+++
@@ -29,19 +29,19 @@
return good
+
def is_release(directory):
- d = os.path.split(directory)[1]
track = False
# we'll set this to a DBPOWERAMP config later
#if InputPatterns.release_pattern.match(d):
- for f in os.scandir(directory):
- if f.is_file:
- ... |
dd55baacdda9e0a88ec6924bbe29ad3f4bb30d21 | ghost.py | ghost.py | # creating file
| # ghost.py
# globals
g_words = dict()
_END = "_END"
def addWord(word):
# check if subset is already in the dictionary
cur = g_words
for char in word:
if char in cur:
cur = cur[char]
elif _END in cur:
return
else
break
# add word to d... | Set up framework, need to work on strategy | Set up framework, need to work on strategy
| Python | cc0-1.0 | tobiaselder/ghost | ---
+++
@@ -1 +1,43 @@
-# creating file
+# ghost.py
+
+# globals
+g_words = dict()
+_END = "_END"
+
+def addWord(word):
+ # check if subset is already in the dictionary
+ cur = g_words
+ for char in word:
+ if char in cur:
+ cur = cur[char]
+ elif _END in cur:
+ return
+ ... |
0e6ec8edc9502918b8b9ae01e14c7f485d6b261d | Init.py | Init.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2016 execuc *
# * ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2016 execuc *
# * ... | Fix missing parentheses initialization error | Fix missing parentheses initialization error | Python | lgpl-2.1 | execuc/LCInterlocking | ---
+++
@@ -23,4 +23,4 @@
# * *
# ***************************************************************************
-print "Interlocking laser cut workbench loaded"
+print("Interlocking laser cut workbench loaded") |
8ecd9c4605e92946941fe29a837b0b1855232135 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name = "idea-collection",
version = "0.1",
#url = "TBD",
license = "public domain",
description = "An idea collection tool for django",
author = "Jui Dai, Jennifer Ehlers, David Kennedy, Shashank Khandelwal, CM Lubinski",
packages = find_packages('s... | from setuptools import setup, find_packages
setup(
name = "idea-collection",
version = "0.1.0",
#url = "TBD",
license = "public domain",
description = "An idea collection tool for django",
author = "Jui Dai, Jennifer Ehlers, David Kennedy, Shashank Khandelwal, CM Lubinski",
packages = find_packages(... | Use 3-point version number as per semver.org | Use 3-point version number as per semver.org
| Python | cc0-1.0 | cfpb/idea-box,18F/idea-box,cfpb/idea-box,m3brown/idea-box,geomapdev/idea-box,geomapdev/idea-box,CapeSepias/idea-box,CapeSepias/idea-box,CapeSepias/idea-box,cmc333333/idea-box,cmc333333/idea-box,geomapdev/idea-box,m3brown/idea-box,18F/idea-box,cfpb/idea-box,18F/idea-box,cmc333333/idea-box | ---
+++
@@ -2,7 +2,7 @@
setup(
name = "idea-collection",
- version = "0.1",
+ version = "0.1.0",
#url = "TBD",
license = "public domain",
description = "An idea collection tool for django", |
9bd2a3951dca5e014799f31da30b4814af2b7a3b | setup.py | setup.py | from setuptools import find_packages, setup
setup(
name="clipspy",
version="0.0.1",
author="Matteo Cafasso",
author_email="noxdafox@gmail.com",
description=("CLIPS Python bindings."),
packages=find_packages(),
ext_package="clips",
setup_requires=["cffi>=1.0.0"],
install_requires=["c... | from setuptools import find_packages, setup
setup(
name="clipspy",
version="0.0.1",
author="Matteo Cafasso",
author_email="noxdafox@gmail.com",
description=("CLIPS Python bindings."),
packages=find_packages(),
ext_package="clips",
setup_requires=["cffi>=1.0.0"],
install_requires=["c... | Add Enum backport dependency for python 2 | Add Enum backport dependency for python 2
Signed-off-by: Matteo Cafasso <43c758619f0ced9dc5c51a50803f3466c86e4c3d@gmail.com>
| Python | bsd-3-clause | noxdafox/clipspy,noxdafox/clipspy | ---
+++
@@ -9,7 +9,7 @@
packages=find_packages(),
ext_package="clips",
setup_requires=["cffi>=1.0.0"],
- install_requires=["cffi>=1.0.0"],
+ install_requires=["cffi>=1.0.0", "enum34"],
cffi_modules=["clips_build.py:ffibuilder"],
classifiers=[
"Programming Language :: Python", |
86c3859838c93df1bbe90bce8abc9971f0affe1f | setup.py | setup.py | from setuptools import setup
setup(name='turtleart',
version='0.2',
description='Library to facilitate Turtle Art',
author='Ava and Teo Lisitza',
author_email='mlisitza+github@gmail.com',
packages=['turtleart', 'turtleart.scripts'],
entry_points={
'console_scripts': [
... | from setuptools import setup
setup(name='turtleart',
version='0.2',
description='Library to facilitate Turtle Art',
author='Ava and Teo Lisitza',
author_email='mlisitza+github@gmail.com',
packages=['turtleart', 'turtleart.scripts'],
entry_points={
'console_scripts': [
... | Make turtleart package require ipython | Make turtleart package require ipython
| Python | apache-2.0 | teolisitza/turtleart | ---
+++
@@ -11,4 +11,7 @@
'qturtle = turtleart.scripts.qturtle:main'
]
},
+ install_requires=[
+ 'ipython',
+ ]
) |
e751cb4f4805aed079fc025b9b1655f30cf5e69a | watson/html/entities.py | watson/html/entities.py | # -*- coding: utf-8 -*-
import re
from html import _escape_map_full
from html.entities import codepoint2name
html_entities = {_ord: '&{0};'.format(value)
for _ord, value in codepoint2name.items()}
html_entities.update(_escape_map_full)
entities_html = {value: _ord for _ord, value in html_entities.item... | # -*- coding: utf-8 -*-
import re
from html.entities import codepoint2name
try:
from html import _escape_map_full
except:
# taken from the 3.3 standard lib, as it's removed in 3.4
_escape_map_full = {ord('&'): '&', ord('<'): '<', ord('>'): '>',
ord('"'): '"', ord('\''... | Fix for Python 3.4 html module not containing _escape_map_full | Fix for Python 3.4 html module not containing _escape_map_full
| Python | bsd-3-clause | watsonpy/watson-html | ---
+++
@@ -1,7 +1,13 @@
# -*- coding: utf-8 -*-
import re
-from html import _escape_map_full
from html.entities import codepoint2name
+
+try:
+ from html import _escape_map_full
+except:
+ # taken from the 3.3 standard lib, as it's removed in 3.4
+ _escape_map_full = {ord('&'): '&', ord('<'): '<',... |
9a003165301e60ee4486b0a8bdde79e84eef65d8 | rparse.py | rparse.py | #!/usr/bin/env python
# Copyright 2015, Dmitry Veselov
from plyplus import Grammar, ParseError
try:
# Python 2.x and pypy
from itertools import imap as map
except ImportError:
# Python 3.x already have lazy map
pass
__all__ = [
"parse"
]
grammar = Grammar(r"""
start : package ;
package: name ... | #!/usr/bin/env python
# Copyright 2015, Dmitry Veselov
from plyplus import Grammar, STransformer, ParseError
try:
# Python 2.x and pypy
from itertools import imap as map
except ImportError:
# Python 3.x already have lazy map
pass
__all__ = [
"parse"
]
grammar = Grammar(r"""
@start : package ;
... | Transform AST to python objects | Transform AST to python objects
| Python | mit | dveselov/rparse | ---
+++
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# Copyright 2015, Dmitry Veselov
-from plyplus import Grammar, ParseError
+from plyplus import Grammar, STransformer, ParseError
try:
# Python 2.x and pypy
from itertools import imap as map
@@ -16,7 +16,7 @@
grammar = Grammar(r"""
-start : package ;
+@... |
0e472a135a22470f87a90f941ddfbb0a1cfd3a70 | setup.py | setup.py | import os
import re
from pathlib import Path
from setuptools import setup
project_path = Path(__file__).parent
README = (project_path / 'README.md').read_text()
version_text = (project_path / 'django_admin_json_editor' / '__init__.py').read_text()
VERSION = re.compile(r'.*__version__ = \'(.*?)\'', re.S).match(versi... | import os
import re
from setuptools import setup
project_path = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(project_path, 'README.md'), 'r') as fout:
README = fout.read()
with open(os.path.join(project_path, 'django_admin_json_editor', '__init__.py'), 'r') as fout:
version_text = fout.re... | Make installation python 2.7 compatible | Make installation python 2.7 compatible
| Python | mit | abogushov/django-admin-json-editor,abogushov/django-admin-json-editor | ---
+++
@@ -1,14 +1,14 @@
import os
import re
-from pathlib import Path
from setuptools import setup
-project_path = Path(__file__).parent
+project_path = os.path.abspath(os.path.dirname(__file__))
+with open(os.path.join(project_path, 'README.md'), 'r') as fout:
+ README = fout.read()
+with open(os.path.jo... |
2c4964026e07f572ccd2213b2093a39b99a8888a | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='panoptescli',
version='1.1.1',
url='https://github.com/zooniverse/panoptes-cli',
author='Adam McMaster',
author_email='adam@zooniverse.org',
description=(
'A command-line client for Panoptes, the API behind the Zooniverse'
),
... | from setuptools import setup, find_packages
setup(
name='panoptescli',
version='1.1.1',
url='https://github.com/zooniverse/panoptes-cli',
author='Adam McMaster',
author_email='adam@zooniverse.org',
description=(
'A command-line client for Panoptes, the API behind the Zooniverse'
),
... | Update pyyaml requirement from <5.3,>=5.1 to >=5.1,<5.4 | Update pyyaml requirement from <5.3,>=5.1 to >=5.1,<5.4
Updates the requirements on [pyyaml](https://github.com/yaml/pyyaml) to permit the latest version.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES)
- [Commits](https://github.com/yaml/pyy... | Python | apache-2.0 | zooniverse/panoptes-cli | ---
+++
@@ -13,7 +13,7 @@
include_package_data=True,
install_requires=[
'Click>=6.7,<7.1',
- 'PyYAML>=5.1,<5.3',
+ 'PyYAML>=5.1,<5.4',
'panoptes-client>=1.0,<2.0',
'humanize>=0.5.1,<0.6',
'pathvalidate>=0.29.0,<0.30', |
82316ec166b4ab64f1890f33e8b9b75bd6733e53 | fabfile/eg.py | fabfile/eg.py | from fabric.api import task, local, run, lcd, cd, env
from os.path import exists as file_exists
from fabtools.python import virtualenv
from os import path
PWD = path.join(path.dirname(__file__), '..')
VENV_DIR = path.join(PWD, '.env')
@task
def mnist():
with virtualenv(VENV_DIR):
with lcd(PWD):
... | from fabric.api import task, local, run, lcd, cd, env
from os.path import exists as file_exists
from fabtools.python import virtualenv
from os import path
PWD = path.join(path.dirname(__file__), '..')
VENV_DIR = path.join(PWD, '.env')
@task
def mnist():
with virtualenv(VENV_DIR):
with lcd(PWD):
... | Remove dataset installation from fabfile | Remove dataset installation from fabfile
| Python | mit | spacy-io/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc | ---
+++
@@ -21,6 +21,4 @@
with virtualenv(VENV_DIR):
with lcd(PWD):
local('pip install -e .')
- local('mkdir data')
- install_ancora()
local('python examples/basic_tagger.py') |
551335ba6cd219cd90bf7419bb73804bb5851c64 | typescript/commands/build.py | typescript/commands/build.py | import sublime_plugin
import sublime
import os
class TypescriptBuildCommand(sublime_plugin.WindowCommand):
def run(self):
file_name = self.window.active_view().file_name()
directory = os.path.dirname(file_name)
if "tsconfig.json" in os.listdir(directory):
self.window.run_comman... | import sublime_plugin
import sublime
import os
from ..libs.global_vars import IS_ST2
class TypescriptBuildCommand(sublime_plugin.WindowCommand):
def run(self):
file_name = self.window.active_view().file_name()
directory = os.path.dirname(file_name)
if "tsconfig.json" in os.listdir(director... | Add support for sublime 2 | Add support for sublime 2
| Python | apache-2.0 | RyanCavanaugh/TypeScript-Sublime-Plugin,kungfusheep/TypeScript-Sublime-Plugin,Microsoft/TypeScript-Sublime-Plugin,zhengbli/TypeScript-Sublime-Plugin,fongandrew/TypeScript-Sublime-JSX-Plugin,Microsoft/TypeScript-Sublime-Plugin,zhengbli/TypeScript-Sublime-Plugin,hoanhtien/TypeScript-Sublime-Plugin,zhengbli/TypeScript-Sub... | ---
+++
@@ -1,6 +1,7 @@
import sublime_plugin
import sublime
import os
+from ..libs.global_vars import IS_ST2
class TypescriptBuildCommand(sublime_plugin.WindowCommand):
@@ -9,8 +10,9 @@
directory = os.path.dirname(file_name)
if "tsconfig.json" in os.listdir(directory):
self.win... |
89a700b49d89a711f44a834d879c5edef959c195 | setup.py | setup.py | from setuptools import find_packages, setup
import sr.comp.scheduler.metadata as md
with open('README.rst') as f:
long_description = f.read()
setup(name='sr.comp.scheduler',
version=md.VERSION,
packages=find_packages(),
namespace_packages=['sr', 'sr.comp'],
description=md.DESCRIPTION,
... | from setuptools import find_packages, setup
import sr.comp.scheduler.metadata as md
with open('README.rst') as f:
long_description = f.read()
setup(name='sr.comp.scheduler',
version=md.VERSION,
packages=find_packages(),
namespace_packages=['sr', 'sr.comp'],
description=md.DESCRIPTION,
... | Drop the lower-bound on the Sphinx version | Drop the lower-bound on the Sphinx version
| Python | mit | prophile/sr-scheduler-2015 | ---
+++
@@ -18,7 +18,7 @@
author_email='srobo-devel@googlegroups.com',
install_requires=['PyYAML >=3.11, <4'],
setup_requires=[
- 'Sphinx >=1.3b, <2',
+ 'Sphinx >=1.2, <2',
'sphinx-argparse >=0.1.13, <0.2'
],
zip_safe=True, |
43ad157b058693fd38280a802ed4da92301ef4f1 | setup.py | setup.py | import re
from setuptools import setup
with open('mashdown/__init__.py') as f:
version = re.search(
r'(?<=__version__ = \')\d\.\d\.\d(?=\')',
f.read()
).group()
with open('README.rst') as f:
readme = f.read()
setup(
name=u'mashdown',
version=version,
description=u'Splits a y... | import re
from setuptools import setup
with open('mashdown/__init__.py') as f:
version = re.search(
r'(?<=__version__ = \')\d\.\d\.\d(?=\')',
f.read()
).group()
with open('README.rst') as f:
readme = f.read()
setup(
name=u'mashdown',
version=version,
description=u'Splits a y... | Add a proper License PyPI classifier | Add a proper License PyPI classifier
| Python | mit | brouberol/mashdown | ---
+++
@@ -29,7 +29,7 @@
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
- 'License :: TODO',
+ 'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :... |
d0472714a97af951250f68c7c22e57448f689291 | setup.py | setup.py | from setuptools import setup
import os
data = list()
for d in os.walk('markdo/'):
if len(d[2]) > 0:
path_list = map(
lambda x: str.join('/', os.path.join(d[0], x).split('/')[1:]),
d[2]
)
data.extend(path_list)
setup(
name="MarkDo",
version="0.2",
author=... | from setuptools import setup
import os
data = list()
for d in os.walk('markdo/'):
if len(d[2]) > 0:
path_list = map(
lambda x: str.join('/', os.path.join(d[0], x).split('/')[1:]),
d[2]
)
data.extend(path_list)
setup(
name="MarkDo",
version="0.2",
author=... | Add jinja2 as a required lib | Add jinja2 as a required lib
| Python | mit | nitipit/markdo,nitipit/markdo,nitipit/markdo | ---
+++
@@ -24,5 +24,5 @@
packages=['markdo'],
scripts=['markdo/markdo'],
package_data={'markdo': data},
- install_requires=['appkit==0.2'],
+ install_requires=['AppKit==0.2', 'Jinja2'],
) |
73c5ec2b477dc172dedf0b30dae16665babb14f6 | setup.py | setup.py | import sys
import os
from setuptools import setup
long_description = open('README.rst').read()
classifiers = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Pytho... | import sys
import os
from setuptools import setup
long_description = open('README.rst').read()
classifiers = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Pytho... | Update minimum version of cli package. | Update minimum version of cli package.
| Python | bsd-2-clause | getwarped/powershift-cluster,getwarped/powershift-cluster | ---
+++
@@ -31,7 +31,7 @@
packages=['powershift', 'powershift.cluster'],
package_dir={'powershift': 'src/powershift'},
install_requires=['passlib'],
- extras_require={'cli': ['powershift-cli>=1.1.1']},
+ extras_require={'cli': ['powershift-cli>=1.1.8']},
entry_points = {'powershift_cli_plugi... |
0ca332f81d8c5be094855f32971da40bed991540 | setup.py | setup.py | from setuptools import setup, find_packages
import populous
requirements = [
"click",
"cached-property",
"fake-factory",
]
setup(
name="populous",
version=populous.__version__,
url=populous.__url__,
description=populous.__doc__,
author=populous.__author__,
license=populous.__licen... | import sys
from setuptools import setup, find_packages
import populous
requirements = [
"click",
"cached-property",
"fake-factory",
]
if sys.version_info < (3, 2):
requirements.append('functools32')
setup(
name="populous",
version=populous.__version__,
url=populous.__url__,
descript... | Add functools32 to the requirements for Python < 3.2 | Add functools32 to the requirements for Python < 3.2
| Python | mit | novafloss/populous | ---
+++
@@ -1,3 +1,5 @@
+import sys
+
from setuptools import setup, find_packages
import populous
@@ -7,6 +9,9 @@
"cached-property",
"fake-factory",
]
+
+if sys.version_info < (3, 2):
+ requirements.append('functools32')
setup(
name="populous", |
b49314c656db718c17ad8beadedf95b365ca7fc5 | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.19',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.20',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | Update the PyPI version to 0.2.20. | Update the PyPI version to 0.2.20.
| Python | mit | Doist/todoist-python | ---
+++
@@ -10,7 +10,7 @@
setup(
name='todoist-python',
- version='0.2.19',
+ version='0.2.20',
packages=['todoist', 'todoist.managers'],
author='Doist Team',
author_email='info@todoist.com', |
20fd827bdfb80e435065ada50174c6085780889a | setup.py | setup.py | from setuptools import setup
with open('README.md') as f:
readme = f.read()
setup(
name='watson',
version='1.0.0',
packages=['watson'],
author='TailorDev',
author_email='contact@tailordev.com',
license='MIT',
long_description=readme,
install_requires=[
'Click',
'ar... | from setuptools import setup
with open('README.md') as f:
readme = f.read()
setup(
name='td-watson',
version='1.0.0',
packages=['watson'],
author='TailorDev',
author_email='contact@tailordev.com',
license='MIT',
long_description=readme,
install_requires=[
'Click',
... | Rename the PyPI package to td-watson | Rename the PyPI package to td-watson
| Python | mit | TailorDev/Watson,wehlutyk/Watson,yloiseau/Watson,TailorDev/Watson | ---
+++
@@ -5,7 +5,7 @@
setup(
- name='watson',
+ name='td-watson',
version='1.0.0',
packages=['watson'],
author='TailorDev', |
e2b77a2c98cbd51c5c0546e4146dd60af0a64c86 | comics/accounts/admin.py | comics/accounts/admin.py | from django.contrib import admin
from comics.accounts import models
class SubscriptionInline(admin.StackedInline):
model = models.Subscription
extra = 1
def email(obj):
return obj.user.email
class UserProfileAdmin(admin.ModelAdmin):
list_display = ('user', email, 'secret_key')
inlines = [Subs... | from django.contrib import admin
from comics.accounts import models
class SubscriptionInline(admin.StackedInline):
model = models.Subscription
extra = 1
def email(obj):
return obj.user.email
def subscription_count(obj):
return obj.comics.count()
class UserProfileAdmin(admin.ModelAdmin):
lis... | Add subscription count to comics profile list | Add subscription count to comics profile list
| Python | agpl-3.0 | datagutten/comics,datagutten/comics,datagutten/comics,jodal/comics,datagutten/comics,jodal/comics,jodal/comics,jodal/comics | ---
+++
@@ -12,8 +12,12 @@
return obj.user.email
+def subscription_count(obj):
+ return obj.comics.count()
+
+
class UserProfileAdmin(admin.ModelAdmin):
- list_display = ('user', email, 'secret_key')
+ list_display = ('user', email, 'secret_key', subscription_count)
inlines = [SubscriptionInli... |
1d5442aa70d2ed2569cc062d476129840d08a610 | oscar/apps/shipping/repository.py | oscar/apps/shipping/repository.py | from django.core.exceptions import ImproperlyConfigured
from oscar.apps.shipping.methods import Free, NoShippingRequired
class Repository(object):
"""
Repository class responsible for returning ShippingMethod
objects for a given user, basket etc
"""
def get_shipping_methods(self, user, basket... | from django.core.exceptions import ImproperlyConfigured
from oscar.apps.shipping.methods import Free, NoShippingRequired
class Repository(object):
"""
Repository class responsible for returning ShippingMethod
objects for a given user, basket etc
"""
def get_shipping_methods(self, user, basket, sh... | Make the cheapest shipping method the default one | Make the cheapest shipping method the default one
| Python | bsd-3-clause | mexeniz/django-oscar,kapari/django-oscar,makielab/django-oscar,eddiep1101/django-oscar,Jannes123/django-oscar,thechampanurag/django-oscar,rocopartners/django-oscar,john-parton/django-oscar,elliotthill/django-oscar,itbabu/django-oscar,mexeniz/django-oscar,jinnykoo/wuyisj.com,marcoantoniooliveira/labweb,sonofatailor/djan... | ---
+++
@@ -7,16 +7,16 @@
Repository class responsible for returning ShippingMethod
objects for a given user, basket etc
"""
-
+
def get_shipping_methods(self, user, basket, shipping_addr=None, **kwargs):
"""
Return a list of all applicable shipping method objects
fo... |
e337dc55aa5420506c1351d7000e903afdb4d4ef | account_analytic_invoice_line_menu/__openerp__.py | account_analytic_invoice_line_menu/__openerp__.py | # -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Account Analytic Invoice Line Menu",
"version": "8.0.1.0.0",
"license": "AGPL-3",
"author": "AvanzOSC",
"website": "http://www.avanzosc.es",
"contributor... | # -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Account Analytic Invoice Line Menu",
"version": "8.0.1.0.0",
"license": "AGPL-3",
"author": "AvanzOSC",
"website": "http://www.avanzosc.es",
"contributor... | Put dependency to "account_analytic_analysis" module. | [FIX] account_analytic_invoice_line_menu: Put dependency to "account_analytic_analysis" module.
| Python | agpl-3.0 | esthermm/odoo-addons,Daniel-CA/odoo-addons,mikelarre/hr-addons,Daniel-CA/odoo-addons,esthermm/odoo-addons,Daniel-CA/odoo-addons,esthermm/odoo-addons | ---
+++
@@ -13,6 +13,7 @@
],
"category": "Sales Management",
"depends": [
+ "account_analytic_analysis"
],
"data": [
"views/account_analytic_invoice_line_view.xml", |
477364a4d2895fc79af2a57ace35ededf0281911 | mistral/db/sqlalchemy/migration/alembic_migrations/versions/003_cron_trigger_constraints.py | mistral/db/sqlalchemy/migration/alembic_migrations/versions/003_cron_trigger_constraints.py | # Copyright 2015 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright 2015 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Fix database upgrade from a new database | Fix database upgrade from a new database
This fixes the problem where running "mistral-db-manage upgrade heads" on a
new database result in error with workflow_input_hash index does not exist.
Change-Id: I560b2b78d11cd3fd4ae9c8606e4336e87b22ef27
Closes-Bug: #1519929
| Python | apache-2.0 | openstack/mistral,StackStorm/mistral,openstack/mistral,StackStorm/mistral | ---
+++
@@ -34,8 +34,7 @@
'cron_triggers_v2',
sa.Column('first_execution_time', sa.DateTime(), nullable=True)
)
- op.drop_index('workflow_input_hash', table_name='cron_triggers_v2')
- op.drop_index('workflow_input_hash_2', table_name='cron_triggers_v2')
+
op.create_unique_constraint(... |
9f1d4788c5f3751b978da97434b5f6c2e22105b5 | django_inbound_email/__init__.py | django_inbound_email/__init__.py | """An inbound email handler for Django."""
__title__ = 'django-inbound-email'
__version__ = '0.3.3'
__author__ = 'YunoJuno Ltd'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014 YunoJuno'
__description__ = (
"A Django app to make it easy to receive inbound emails from "
"a hosted transactional email service ... | """An inbound email handler for Django."""
__title__ = 'django-inbound-email'
__version__ = '0.3.3'
__author__ = 'YunoJuno Ltd'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014 YunoJuno'
__description__ = 'A Django app for receiving inbound emails.'
| Update package description so it displays correctly on PyPI. | Update package description so it displays correctly on PyPI.
The description was wrapping, so it appeared with a single '(' character
on PyPI. I've updated it so that it's now all on a single line.
| Python | mit | yunojuno/django-inbound-email | ---
+++
@@ -5,8 +5,4 @@
__author__ = 'YunoJuno Ltd'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014 YunoJuno'
-__description__ = (
- "A Django app to make it easy to receive inbound emails from "
- "a hosted transactional email service (e.g. SendGrid, Postmark, "
- "Mandrill, etc.)."
-)
+__description... |
d0a87e354cd75429591fe860f070652b2438950e | bisnode/models.py | bisnode/models.py | from django.db import models
from .constants import COMPANY_RATING_REPORT
from .bisnode import get_bisnode_company_report
class BisnodeRatingReport(models.Model):
organization_number = models.CharField(max_length=10, null=True,
blank=True)
rating_code = models.Char... | Add Bisnode Rating Report model | Add Bisnode Rating Report model
| Python | mit | FundedByMe/django-bisnode | ---
+++
@@ -0,0 +1,21 @@
+from django.db import models
+
+from .constants import COMPANY_RATING_REPORT
+
+from .bisnode import get_bisnode_company_report
+
+
+class BisnodeRatingReport(models.Model):
+ organization_number = models.CharField(max_length=10, null=True,
+ blan... | |
f4014dea504293f3630205092d71ac272763c3b3 | blist/__init__.py | blist/__init__.py | from blist._blist import *
import collections
if hasattr(collections, 'MutableSet'): # Only supported in Python 2.6+
from blist._sortedlist import sortedlist, sortedset, weaksortedlist, weaksortedset
from blist._sorteddict import sorteddict
from blist._btuple import btuple
collections.MutableSequence.re... | from blist._blist import *
import collections
if hasattr(collections, 'MutableSet'): # Only supported in Python 2.6+
from blist._sortedlist import sortedlist, sortedset, weaksortedlist, weaksortedset
from blist._sorteddict import sorteddict
from blist._btuple import btuple
collections.MutableSequence.re... | Clean up the blist namespace. | Clean up the blist namespace.
| Python | bsd-3-clause | DanielStutzbach/blist,DanielStutzbach/blist,pfmoore/blist,pfmoore/blist | ---
+++
@@ -5,4 +5,5 @@
from blist._sorteddict import sorteddict
from blist._btuple import btuple
collections.MutableSequence.register(blist)
+ del _sortedlist, _sorteddict, _btuple
del collections |
8c3e3ec6076d8b9ee858fca00d92717d77c67ade | time_lapse.py | time_lapse.py | #!/usr/bin/env python
import sys
import time
import picamera
import settings
from settings import IMAGE, SNAP
import uploader
def main():
with picamera.PiCamera() as camera:
camera.resolution = (IMAGE.resolution_x, IMAGE.resolution_y)
time.sleep(2)
output_file = settings.IMAGES_DIRECTORY ... | #!/usr/bin/env python
import time
import picamera
from settings import Job, IMAGES_DIRECTORY
def main():
job = Job()
if job.exists():
resolution_x = job.image_settings.resolution_x
resolution_y = job.image_settings.resolution_y
image_quality = job.image_settings.quality
snap_i... | Check for job in main loop | Check for job in main loop
| Python | mit | projectweekend/Pi-Camera-Time-Lapse,projectweekend/Pi-Camera-Time-Lapse | ---
+++
@@ -1,23 +1,28 @@
#!/usr/bin/env python
-import sys
import time
import picamera
-import settings
-from settings import IMAGE, SNAP
-import uploader
+from settings import Job, IMAGES_DIRECTORY
def main():
- with picamera.PiCamera() as camera:
- camera.resolution = (IMAGE.resolution_x, IMAGE... |
7f1a58f9faacb0bb0e95c2527a348195742eb866 | tornado/test/autoreload_test.py | tornado/test/autoreload_test.py | from __future__ import absolute_import, division, print_function
import os
import subprocess
from subprocess import Popen
import sys
from tempfile import mkdtemp
from tornado.test.util import unittest
MAIN = """\
import os
import sys
from tornado import autoreload
# This import will fail if path is not set up corr... | from __future__ import absolute_import, division, print_function
import os
import subprocess
from subprocess import Popen
import sys
from tempfile import mkdtemp
from tornado.test.util import unittest
MAIN = """\
import os
import sys
from tornado import autoreload
# This import will fail if path is not set up corr... | Fix newline handling in autoreload test | Fix newline handling in autoreload test
| Python | apache-2.0 | SuminAndrew/tornado,mivade/tornado,legnaleurc/tornado,tornadoweb/tornado,ifduyue/tornado,bdarnell/tornado,NoyaInRain/tornado,bdarnell/tornado,ajdavis/tornado,NoyaInRain/tornado,bdarnell/tornado,eklitzke/tornado,wujuguang/tornado,allenl203/tornado,SuminAndrew/tornado,Lancher/tornado,Lancher/tornado,NoyaInRain/tornado,No... | ---
+++
@@ -40,7 +40,9 @@
if 'PYTHONPATH' in os.environ:
pythonpath += os.pathsep + os.environ['PYTHONPATH']
- p = Popen([sys.executable, '-m', 'testapp'], stdout=subprocess.PIPE,
- cwd=path, env=dict(os.environ, PYTHONPATH=pythonpath))
- out = p.communicate()[0]... |
fd78a7c2cdff3aca182b12f7e9fa5e0819c68720 | tests/factory/makers/test_selections.py | tests/factory/makers/test_selections.py | from mongoframes.factory import makers
from mongoframes.factory.makers import selections as selection_makers
from tests.fixtures import *
def test_cycle():
"""
`Cycle` makers should return values from a list of items (python types of or
makers) one after another.
"""
# Configured to cycle throug... | Add test for `Cycle` maker. | Add test for `Cycle` maker.
| Python | mit | GetmeUK/MongoFrames | ---
+++
@@ -0,0 +1,39 @@
+from mongoframes.factory import makers
+from mongoframes.factory.makers import selections as selection_makers
+
+from tests.fixtures import *
+
+
+def test_cycle():
+ """
+ `Cycle` makers should return values from a list of items (python types of or
+ makers) one after another.
+ ... | |
ace1997f5d1cab297ab68886501b45602b2d8e2d | cards/models.py | cards/models.py | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from time import time
def card_image_filename(instance, filename):
timestamp = int(time())
return 'cards/%s%d.jpg' % (instance, timest... | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from time import time
def card_image_filename(instance):
timestamp = int(time())
return 'cards/%s%d.jpg' % (instance, timestamp)
@py... | Remove unused filename parameter from card image filename function | Remove unused filename parameter from card image filename function
| Python | mit | neosergio/WisdomBox | ---
+++
@@ -6,7 +6,7 @@
from time import time
-def card_image_filename(instance, filename):
+def card_image_filename(instance):
timestamp = int(time())
return 'cards/%s%d.jpg' % (instance, timestamp)
|
1261777b6aaaea6947a32477e340ef1597045866 | nested_admin/urls.py | nested_admin/urls.py | try:
from django.conf.urls.defaults import patterns, url
except ImportError:
from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^server-data\.js$', 'nested_admin.views.server_data_js',
name="nesting_server_data"),
)
| from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^server-data\.js$', 'nested_admin.views.server_data_js',
name="nesting_server_data"),
)
| Fix DeprecationWarning in Django 1.5 | Fix DeprecationWarning in Django 1.5
| Python | bsd-2-clause | sbussetti/django-nested-admin,sbussetti/django-nested-admin,olivierdalang/django-nested-admin,sbussetti/django-nested-admin,olivierdalang/django-nested-admin,olivierdalang/django-nested-admin | ---
+++
@@ -1,7 +1,4 @@
-try:
- from django.conf.urls.defaults import patterns, url
-except ImportError:
- from django.conf.urls import patterns, url
+from django.conf.urls import patterns, url
urlpatterns = patterns('', |
2005e048f7342c011f4bc08899d5cb4d4a15357a | debugtools/middleware/xviewmiddleware.py | debugtools/middleware/xviewmiddleware.py | from debugtools.utils.xview import track_view_name, get_used_view_name, get_used_template
class XViewMiddleware(object):
"""
Adds an X-View header to requests.
If the request IP is internal or the user is a logged-in staff member,
add an ``X-View`` header to the response.
This is a variation of ... | import django
from debugtools.utils.xview import track_view_name, get_used_view_name, get_used_template
if django.VERSION >= (1, 10):
from django.utils.deprecation import MiddlewareMixin
else:
MiddlewareMixin = object
class XViewMiddleware(MiddlewareMixin):
"""
Adds an X-View header to requests.
... | Add MiddlewareMixin for Django 1.10 middleware compatibility | Add MiddlewareMixin for Django 1.10 middleware compatibility
| Python | apache-2.0 | edoburu/django-debugtools,edoburu/django-debugtools,edoburu/django-debugtools | ---
+++
@@ -1,7 +1,14 @@
+import django
from debugtools.utils.xview import track_view_name, get_used_view_name, get_used_template
-class XViewMiddleware(object):
+if django.VERSION >= (1, 10):
+ from django.utils.deprecation import MiddlewareMixin
+else:
+ MiddlewareMixin = object
+
+
+class XViewMiddlewar... |
1cb01d48246baf0ca84a23bd8718d46471b8105f | bin/mpy-tool-wrapper.py | bin/mpy-tool-wrapper.py | #!/usr/bin/env python
#
# Wrapper for mpy-cross.py.
#
from __future__ import print_function
import sys
import os
import subprocess
def main():
command = sys.argv[3:]
env = dict(os.environ, PYTHONPATH=sys.argv[2])
with open(sys.argv[1], 'w') as f:
f.write(subprocess.check_output(command, env=env)... | #!/usr/bin/env python
#
# Wrapper for mpy-cross.py.
#
from __future__ import print_function
import sys
import os
import subprocess
def main():
command = sys.argv[3:]
env = dict(os.environ, PYTHONPATH=sys.argv[2])
with open(sys.argv[1], 'w') as f:
f.write(subprocess.check_output(command, env=env)... | Add support for Python 3 | Add support for Python 3 | Python | mit | eerimoq/pumba,eerimoq/pumbaa,eerimoq/pumbaa,eerimoq/pumbaa,eerimoq/pumbaa,eerimoq/pumba,eerimoq/pumba | ---
+++
@@ -14,8 +14,8 @@
command = sys.argv[3:]
env = dict(os.environ, PYTHONPATH=sys.argv[2])
with open(sys.argv[1], 'w') as f:
- f.write(subprocess.check_output(command, env=env))
-
+ f.write(subprocess.check_output(command, env=env).decode("utf-8"))
+
if __name__ == '__main__':... |
108a05b050383bca218cd02be499f1fad58065dc | test/test_refmanage.py | test/test_refmanage.py | # -*- coding: utf-8 -*-
import unittest
import pathlib2 as pathlib
import refmanage
class NoSpecifiedFunctionality(unittest.TestCase):
"""
Tests when no functionality has been specified on cli
"""
def test_no_args(self):
"""
`ref` without arguments should print the help text
"""... | # -*- coding: utf-8 -*-
import unittest
import pathlib2 as pathlib
import refmanage
class NoSpecifiedFunctionality(unittest.TestCase):
"""
Tests when no functionality has been specified on cli
"""
def test_no_args(self):
"""
`ref` without arguments should print the help text
"""... | Replace "pass" with "self.fail()" in tests | Replace "pass" with "self.fail()" in tests
In this way, tests that haven't been written will run noisily instead of
silently, encouraging completion of writing tests.
| Python | mit | jrsmith3/refmanage | ---
+++
@@ -11,13 +11,13 @@
"""
`ref` without arguments should print the help text
"""
- pass
+ self.fail()
def test_version(self):
"""
`ref --version` should return version string
"""
- pass
+ self.fail()
class TestFunctional... |
5156af5576d5663555bc04f5960e7e4cdd861166 | objectrocket/util.py | objectrocket/util.py | """Utility code for the objectrocket package."""
import types
def register_extension_class(ext, base, *args, **kwargs):
"""Instantiate the given extension class and register as a public attribute of the given base.
README: The expected protocol here to instantiate the given extension and pass the base object... | """Utility code for the objectrocket package."""
import types
def register_extension_class(ext, base, *args, **kwargs):
"""Instantiate the given extension class and register as a public attribute of the given base.
README: The expected protocol here is to instantiate the given extension and pass the base
... | Clean up docs on extension protocols. | Clean up docs on extension protocols.
| Python | mit | objectrocket/python-client,objectrocket/python-client | ---
+++
@@ -5,15 +5,20 @@
def register_extension_class(ext, base, *args, **kwargs):
"""Instantiate the given extension class and register as a public attribute of the given base.
- README: The expected protocol here to instantiate the given extension and pass the base object
- as the first positional ar... |
1a8419c6b91276cf578f4c354e34d17551ac2403 | metakernel/__init__.py | metakernel/__init__.py | from ._metakernel import MetaKernel
from . import pexpect
from . import replwrap
from .process_metakernel import ProcessMetaKernel
from .magic import Magic, option
from .parser import Parser
__all__ = ['Magic', 'MetaKernel', 'option']
__version__ = '0.3'
del magic, _metakernel, parser, process_metakernel
| from ._metakernel import MetaKernel
from . import pexpect
from .replwrap import REPLWrapper, u
from .process_metakernel import ProcessMetaKernel
from .magic import Magic, option
from .parser import Parser
__all__ = ['Magic', 'MetaKernel', 'option']
__version__ = '0.3'
del magic, _metakernel, parser, process_metakern... | Move REPLWrapper and u() function to pkg level | Move REPLWrapper and u() function to pkg level
| Python | bsd-3-clause | Calysto/metakernel | ---
+++
@@ -1,6 +1,6 @@
from ._metakernel import MetaKernel
from . import pexpect
-from . import replwrap
+from .replwrap import REPLWrapper, u
from .process_metakernel import ProcessMetaKernel
from .magic import Magic, option
from .parser import Parser |
e30b8b60de491721f635300840b08b481250fea6 | microbower/__init__.py | microbower/__init__.py |
from subprocess import check_call
import urllib
import json
import os
import os.path
def install():
if not (os.path.isfile('.bowerrc') and os.path.isfile('bower.json')):
return
with open('.bowerrc') as f:
bowerrc = json.load(f)
with open('bower.json') as f:
bower_json = json.load(... |
from subprocess import check_call
import urllib
import json
import os
import os.path
def install():
if not (os.path.isfile('.bowerrc') and os.path.isfile('bower.json')):
return
with open('.bowerrc') as f:
bowerrc = json.load(f)
with open('bower.json') as f:
bower_json = json.load(... | Check if the git repo already exists before cloning it again | Check if the git repo already exists before cloning it again
| Python | isc | zenhack/microbower | ---
+++
@@ -24,7 +24,8 @@
req = urllib.urlopen('%s/packages/%s' % (registry, pkg))
info = json.load(req)
os.chdir(bowerrc['directory'])
- check_call(['git', 'clone', info['url']])
+ if not os.path.isdir(os.path.join(pkg, '.git')):
+ check_call(['git', 'clone', info[... |
4c0cc07edc566b2feebefbcc301a6e16033c613a | bin/register_jsonl.py | bin/register_jsonl.py | #!/usr/bin/env python
# create a single jsonl file from individual register entries
import sys
import os
from openregister import Item
from openregister.representations.jsonl import Writer
register = sys.argv[1] or "register"
dirname = "data/" + register + "/"
writer = Writer(sys.stdout)
for file in os.listdir(dir... | #!/usr/bin/env python
# create a single jsonl file from individual register entries
import sys
import os
from openregister import Item
from openregister.representations.jsonl import Writer
register = sys.argv[1] or "register"
dirname = os.path.join("data", register)
writer = Writer(sys.stdout)
for file in os.listd... | Use os.path.join to build prod | Use os.path.join to build prod
| Python | mit | openregister/registry-data | ---
+++
@@ -8,14 +8,14 @@
from openregister.representations.jsonl import Writer
register = sys.argv[1] or "register"
-dirname = "data/" + register + "/"
+dirname = os.path.join("data", register)
writer = Writer(sys.stdout)
for file in os.listdir(dirname):
if file.endswith(".yaml"):
item = Item... |
8f698f862e1ea4e2c17e8ddd14052c83bf87ea4c | adzone/views.py | adzone/views.py | # -*- coding: utf-8 -*-
# © Copyright 2009 Andre Engelbrecht. All Rights Reserved.
# This script is licensed under the BSD Open Source Licence
# Please see the text file LICENCE for more information
# If this script is distributed, it must be accompanied by the Licence
from datetime import datetime
from django.short... | # -*- coding: utf-8 -*-
# © Copyright 2009 Andre Engelbrecht. All Rights Reserved.
# This script is licensed under the BSD Open Source Licence
# Please see the text file LICENCE for more information
# If this script is distributed, it must be accompanied by the Licence
import re
from datetime import datetime
from d... | Improve http check to allow https as well | Improve http check to allow https as well
We switch from 'startswith' to a regex check which allows both as we
tested with https facebook urls and it failed to handle them properly.
| Python | bsd-3-clause | michaeljones/django-adzone,michaeljones/django-adzone | ---
+++
@@ -5,12 +5,17 @@
# Please see the text file LICENCE for more information
# If this script is distributed, it must be accompanied by the Licence
+import re
+
from datetime import datetime
from django.shortcuts import get_object_or_404
from django.http import HttpResponseRedirect
from adzone.models... |
f29477416729df9cc198f679a2478f6a077ce365 | app/util.py | app/util.py | # Various utility functions
import os
from typing import Any, Callable
SHOULD_CACHE = os.environ.get('ENV', 'development') == 'production'
def cached_function(func: Callable[..., Any]) -> Callable[..., Any]:
data = {}
def wrapper(*args: Any) -> Any:
if not SHOULD_CACHE:
return func(*arg... | # Various utility functions
import inspect
import os
from typing import Any, Callable
SHOULD_CACHE = os.environ.get('ENV', 'development') == 'production'
def cached_function(func: Callable[..., Any]) -> Callable[..., Any]:
data = {}
def wrapper(*args: Any) -> Any:
if not SHOULD_CACHE:
r... | Make cached_function not overwrite signature of wrapped function | Make cached_function not overwrite signature of wrapped function
| Python | mit | albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com | ---
+++
@@ -1,4 +1,5 @@
# Various utility functions
+import inspect
import os
from typing import Any, Callable
@@ -18,4 +19,5 @@
return data[cache_key]
wrapper.__qualname__ = func.__qualname__
+ wrapper.__signature__ = inspect.signature(func) # type: ignore
return wrapper |
8f66d41be2ffc8dd42392a30e6eefcbb6da9b667 | sheared/web/entwine.py | sheared/web/entwine.py | import warnings
from dtml import tal, metal, tales, context
from sheared.python import io
from sheared.python import benchmark
class Entwiner:
def __init__(self):
self.builtins = context.BuiltIns({})
#self.context = context.Context()
#self.context.setDefaults(self.builtins)
def handl... | import warnings
from dtml import tal, metal, tales, context
from sheared.python import io
class Entwiner:
def __init__(self):
self.builtins = context.BuiltIns({})
#self.context = context.Context()
#self.context.setDefaults(self.builtins)
def handle(self, request, reply, subpath):
... | Remove import of n/a benchmark module. | Remove import of n/a benchmark module.
git-svn-id: 8b0eea19d26e20ec80f5c0ea247ec202fbcc1090@75 5646265b-94b7-0310-9681-9501d24b2df7
| Python | mit | kirkeby/sheared | ---
+++
@@ -3,7 +3,6 @@
from dtml import tal, metal, tales, context
from sheared.python import io
-from sheared.python import benchmark
class Entwiner:
def __init__(self): |
27ff37e0b0f87d112ea98ff9c3674abed4a3e413 | fontcrunch/__init__.py | fontcrunch/__init__.py | from __future__ import print_function
from fontTools import ttLib
from multiprocessing import Pool
from .fontcrunch import optimize_glyph, plot_glyph
def _optimize(args):
font, name, pdf, penalty, quiet = args
if not quiet:
print('optimizing', name)
glyph = font['glyf'][name]
plot_glyph(font,... | from __future__ import print_function
from fontTools import ttLib
from multiprocessing import Pool
from .fontcrunch import optimize_glyph, plot_glyph
def _optimize(args):
font, name, pdf, penalty, quiet = args
if not quiet:
print('optimizing', name)
glyph = font['glyf'][name]
plot_glyph(font,... | Make this code actually do something! | Make this code actually do something!
| Python | apache-2.0 | googlefonts/fontcrunch,googlefonts/quadopt,googlefonts/quadopt,googlefonts/fontcrunch | ---
+++
@@ -15,6 +15,7 @@
plot_glyph(font, name, pdf, False)
if not quiet:
print('done optimizing', name)
+ return (name, glyph)
def _get_args(names, font, pdf, penalty, quiet):
for name in names:
@@ -29,12 +30,16 @@
from reportlab.pdfgen import canvas
pdf = canvas.Canv... |
fe4cca2101245621164b13e7a1c895501da4dbe6 | sketchbook/_version.py | sketchbook/_version.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2017 Kaede Hoshikawa
#
# 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
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2017 Kaede Hoshikawa
#
# 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
... | Move master version to 0.1.1. | Move master version to 0.1.1.
| Python | apache-2.0 | futursolo/sketchbook,futursolo/sketchbook | ---
+++
@@ -17,7 +17,7 @@
__all__ = ["__version__"]
-_tag_version = (0, 1, 0)
+_tag_version = (0, 1, 1)
_dev = 0
|
a28fe5793c6bcfc7482f840821eb6d7b779a78dd | slackelot/slackelot.py | slackelot/slackelot.py | import time
import requests
class SlackNotificationError(Exception):
pass
def send_slack_message(message, webhook_url, pretext=None, title=None):
""" Send slack message using webhooks
Args:
message (string)
webhook_url (string), 'https://hooks.slack.com/services/{team id}/{bot or channe... | import time
import requests
class SlackNotificationError(Exception):
pass
def send_slack_message(message, webhook_url, pretext=None, title=None):
""" Send slack message using webhooks
Args:
message (string)
webhook_url (string), 'https://hooks.slack.com/services/{team id}/{bot or channe... | Add initial check for arg webhook_url | Add initial check for arg webhook_url
| Python | mit | Chris-Graffagnino/slackelot | ---
+++
@@ -15,6 +15,10 @@
pretext (string)
title (string)
"""
+ if 'https://hooks.slack.com/services/' not in webhook_url:
+ raise SlackNotificationError(
+ 'webhook_url is not in the correct format. It should look like this:\n\
+ https://hooks.slack.com/service... |
9b3203bae4d72dab90e15dc1b60fb0518a4a0f40 | run_patch.py | run_patch.py | from patch_headers import patch_headers, add_object_info
import sys
for currentDir in sys.argv[1:]:
print "working on directory: %s" % currentDir
patch_headers(currentDir, new_file_ext='', overwrite=True)
add_object_info(currentDir, new_file_ext='', overwrite=True)
#add_overscan(currentDir, new_file_ex... | """
SYNOPSIS
python run_patch.py dir1 [dir2 dir3 ...]
DESCRIPTION
For each directory dir1, dir2, ... provided on the command line the
headers all of the FITS files in that directory are modified
to add information like LST, apparent object position, and more.
See the full documentation for a list... | Change to script and add significant documentation | Change to script and add significant documentation
| Python | bsd-3-clause | mwcraig/msumastro | ---
+++
@@ -1,8 +1,65 @@
+"""
+SYNOPSIS
+
+ python run_patch.py dir1 [dir2 dir3 ...]
+
+DESCRIPTION
+
+ For each directory dir1, dir2, ... provided on the command line the
+ headers all of the FITS files in that directory are modified
+ to add information like LST, apparent object position, and more.
+ ... |
f8604ddaa6e821960acb31b9aaea98a2dfd5b422 | cabot/celeryconfig.py | cabot/celeryconfig.py | import os
from datetime import timedelta
BROKER_URL = os.environ['CELERY_BROKER_URL']
CELERY_IMPORTS = ('cabot.cabotapp.tasks', )
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"
CELERY_TASK_SERIALIZER = "json"
CELERY_ACCEPT_CONTENT = ['json', 'msgpack', 'yaml']
CELERYD_TASK_SOFT_TIME_LIMIT = 120
CELERYD... | import os
from datetime import timedelta
BROKER_URL = os.environ['CELERY_BROKER_URL']
CELERY_IMPORTS = ('cabot.cabotapp.tasks', )
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"
CELERY_TASK_SERIALIZER = "json"
CELERY_ACCEPT_CONTENT = ['json', 'msgpack', 'yaml']
CELERYD_TASK_SOFT_TIME_LIMIT = 120
CELERYD... | Fix task path for cleanup | Fix task path for cleanup | Python | mit | Affirm/cabot,BillGuard/cabot,movermeyer/cabot,BillGuard/cabot,bonniejools/cabot,spladug/cabot,movermeyer/cabot,dever860/cabot,iurisilvio/cabot,spladug/cabot,BillGuard/cabot,mcansky/cabotapp,reddit/cabot,mcansky/cabotapp,xinity/cabot,dever860/cabot,Affirm/cabot,dever860/cabot,iurisilvio/cabot,arachnys/cabot,arachnys/cab... | ---
+++
@@ -19,7 +19,7 @@
'schedule': timedelta(seconds=1800),
},
'clean-db': {
- 'task': 'app.cabotapp.tasks.clean_db',
+ 'task': 'cabot.cabotapp.tasks.clean_db',
'schedule': timedelta(seconds=60*60*24),
},
} |
c1f4b466c9acbcb4569bab183f7e932125c833e9 | management/commands/startbot.py | management/commands/startbot.py | from django.core.management.base import BaseCommand
import importlib
import asyncio
class Command(BaseCommand):
def handle(self, *args, **options):
loop = asyncio.get_event_loop()
bot = None
while True:
bot_module = importlib.import_module('dwarf.bot')
bot = bot_m... | from django.core.management.base import BaseCommand
from django.conf import settings
import importlib
import asyncio
class Command(BaseCommand):
def handle(self, *args, **options):
loop = asyncio.get_event_loop()
if settings.DEBUG:
loop.set_debug(True)
bot = None
whil... | Enable asyncio debugging if settings.DEBUG is True | Enable asyncio debugging if settings.DEBUG is True
| Python | mit | Dwarf-Community/Dwarf | ---
+++
@@ -1,4 +1,5 @@
from django.core.management.base import BaseCommand
+from django.conf import settings
import importlib
import asyncio
@@ -8,6 +9,8 @@
def handle(self, *args, **options):
loop = asyncio.get_event_loop()
+ if settings.DEBUG:
+ loop.set_debug(True)
... |
c4009fdedc1625fe3692c689242d9f32a1c89f97 | tests/services/conftest.py | tests/services/conftest.py | import pytest
from responses import RequestsMock
from netvisor import Netvisor
@pytest.fixture
def netvisor():
kwargs = dict(
sender='Test client',
partner_id='xxx_yyy',
partner_key='E2CEBB1966C7016730C70CA92CBB93DD',
customer_id='xx_yyyy_zz',
customer_key='7767899D6F5FB33... | import pytest
from responses import RequestsMock
from netvisor import Netvisor
@pytest.fixture
def netvisor():
kwargs = dict(
sender='Test client',
partner_id='xxx_yyy',
partner_key='E2CEBB1966C7016730C70CA92CBB93DD',
customer_id='xx_yyyy_zz',
customer_key='7767899D6F5FB33... | Fix tests to work with responses 0.3.0 | Fix tests to work with responses 0.3.0
| Python | mit | fastmonkeys/netvisor.py | ---
+++
@@ -20,8 +20,6 @@
@pytest.yield_fixture(autouse=True)
def responses():
- requests_mock = RequestsMock()
- requests_mock._start()
- yield requests_mock
- requests_mock._stop()
- requests_mock.reset()
+ r = RequestsMock()
+ with r:
+ yield r |
e946f239695f74d83fcb1b4929ed2281846add4c | avalon/fusion/pipeline.py | avalon/fusion/pipeline.py |
def imprint_container(tool,
name,
namespace,
context,
loader=None):
"""Imprint a Loader with metadata
Containerisation enables a tracking of version, author and origin
for loaded assets.
Arguments:
tool (... |
def imprint_container(tool,
name,
namespace,
context,
loader=None):
"""Imprint a Loader with metadata
Containerisation enables a tracking of version, author and origin
for loaded assets.
Arguments:
tool (... | Store tool's name when parsing container | Store tool's name when parsing container
| Python | mit | MoonShineVFX/core,MoonShineVFX/core,getavalon/core,getavalon/core,mindbender-studio/core,mindbender-studio/core | ---
+++
@@ -38,9 +38,9 @@
def parse_container(tool):
"""Returns imprinted container data of a tool
-
+
This reads the imprinted data from `imprint_container`.
-
+
"""
container = {}
for key in ['schema', 'id', 'name', 'namespace',
@@ -48,4 +48,7 @@
value = tool.GetData('av... |
6b3dd31b1a795a92a00c7dba636a88636018655c | tests/blueprints/admin/conftest.py | tests/blueprints/admin/conftest.py | """
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
Fixtures specific to admin blueprints
"""
import pytest
from tests.base import create_admin_app
from tests.conftest import database_recreated
@pytest.fixture(scope='session')
def admin_app_without_db(db):
app = crea... | """
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
Fixtures specific to admin blueprints
"""
import pytest
from tests.conftest import database_recreated
@pytest.fixture(scope='module')
def app(admin_app, db):
app = admin_app
with app.app_context():
with ... | Use existing `admin_app` fixture for admin tests | Use existing `admin_app` fixture for admin tests
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | ---
+++
@@ -7,19 +7,12 @@
import pytest
-from tests.base import create_admin_app
from tests.conftest import database_recreated
-@pytest.fixture(scope='session')
-def admin_app_without_db(db):
- app = create_admin_app()
+@pytest.fixture(scope='module')
+def app(admin_app, db):
+ app = admin_app
wi... |
ed8add36f605def54e53c34627a1eedeefb145e5 | project/api/forms.py | project/api/forms.py | # Django
from django import forms
# Local
from .models import User
class UserCreationForm(forms.ModelForm):
class Meta:
model = User
fields = '__all__'
def save(self, commit=True):
user = super().save(commit=False)
user.email = self.cleaned_data['person'].email.lower()
... | # Django
from django import forms
# Local
from .models import User
class UserCreationForm(forms.ModelForm):
class Meta:
model = User
fields = '__all__'
def save(self, commit=True):
user = super().save(commit=False)
user.email = self.cleaned_data['person'].email.lower()
... | Create user name on Admin form create | Create user name on Admin form create
| Python | bsd-2-clause | dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore-django,dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api | ---
+++
@@ -14,6 +14,7 @@
def save(self, commit=True):
user = super().save(commit=False)
user.email = self.cleaned_data['person'].email.lower()
+ user.name = self.cleaned_data['name'].name
user.set_password(None)
if commit:
user.save() |
ed88d9b598b3bd360a6575d83ffd3d4044846a96 | traits/tests/test_array.py | traits/tests/test_array.py | #------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in /LICENSE.txt and may be redistributed only
# under the conditions described in the ... | #------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in /LICENSE.txt and may be redistributed only
# under the conditions described in the ... | Make definition of conditional on NumPy being installed; update skip message to match that used elsewhere | Make definition of conditional on NumPy being installed; update skip message to match that used elsewhere
| Python | bsd-3-clause | burnpanck/traits,burnpanck/traits | ---
+++
@@ -23,18 +23,21 @@
from ..api import Array, Bool, HasTraits
-class Foo(HasTraits):
- a = Array()
- event_fired = Bool(False)
+if numpy_available:
+ # Use of `Array` requires NumPy to be installed.
- def _a_changed(self):
- self.event_fired = True
+ class Foo(HasTraits):
+ ... |
ce39e4a5573e7b3a882ee4a327b3c9eb088d1d07 | senlin/profiles/container/docker.py | senlin/profiles/container/docker.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | Add 'host_node' and 'host_cluster' properties to container profile | Add 'host_node' and 'host_cluster' properties to container profile
Add 'host_node' and 'host_cluster' properties to container profile,
in a container profile, either 'host_node' or 'host_cluster' will
be assigned a value for a container node creation or a container
cluster creation.
blueprint container-profile-suppor... | Python | apache-2.0 | stackforge/senlin,openstack/senlin,stackforge/senlin,openstack/senlin,openstack/senlin | ---
+++
@@ -19,9 +19,9 @@
"""Profile for a docker container."""
KEYS = (
- CONTEXT, IMAGE, NAME, COMMAND,
+ CONTEXT, IMAGE, NAME, COMMAND, HOST_NODE, HOST_CLUSTER
) = (
- 'context', 'image', 'name', 'command',
+ 'context', 'image', 'name', 'command', 'host_node', 'host_clu... |
d357136075bce9d8582759a525536daf7489becb | unitypack/engine/object.py | unitypack/engine/object.py | def field(f, cast=None):
def _inner(self):
ret = self._obj[f]
if cast:
ret = cast(ret)
return ret
return property(_inner)
class Object:
def __init__(self, data=None):
if data is None:
data = {}
self._obj = data
def __repr__(self):
return "<%s %s>" % (self.__class__.__name__, self.name)
def __... | def field(f, cast=None, **kwargs):
def _inner(self):
if "default" in kwargs:
ret = self._obj.get(f, kwargs["default"])
else:
ret = self._obj[f]
if cast:
ret = cast(ret)
return ret
return property(_inner)
class Object:
def __init__(self, data=None):
if data is None:
data = {}
self._obj = dat... | Allow default values in field() | Allow default values in field()
| Python | mit | andburn/python-unitypack | ---
+++
@@ -1,6 +1,9 @@
-def field(f, cast=None):
+def field(f, cast=None, **kwargs):
def _inner(self):
- ret = self._obj[f]
+ if "default" in kwargs:
+ ret = self._obj.get(f, kwargs["default"])
+ else:
+ ret = self._obj[f]
if cast:
ret = cast(ret)
return ret
@@ -19,7 +22,7 @@
def __str__(self):
... |
be30b8220900eaf549fbe1bff7a1e7c3a9be8529 | settings_test.py | settings_test.py | # The test system uses this to override settings in settings.py and
# settings_local.py with settings appropriate for testing.
# Make sure Celery is EAGER.
CELERY_ALWAYS_EAGER = True
# Make sure the doctypes (the keys) match the doctypes in ES_INDEXES
# in settings.py and settings_local.py.
ES_INDEXES = {'default': '... | from django.conf import settings
# The test system uses this to override settings in settings.py and
# settings_local.py with settings appropriate for testing.
# Make sure Celery is EAGER.
CELERY_ALWAYS_EAGER = True
# Make sure the doctypes (the keys) match the doctypes in ES_INDEXES
# in settings.py and settings_loc... | Make settings test respect ES_INDEX_PREFIX. | Make settings test respect ES_INDEX_PREFIX.
| Python | bsd-3-clause | chirilo/kitsune,H1ghT0p/kitsune,feer56/Kitsune1,NewPresident1/kitsune,safwanrahman/kitsune,asdofindia/kitsune,brittanystoroz/kitsune,MikkCZ/kitsune,H1ghT0p/kitsune,philipp-sumo/kitsune,mozilla/kitsune,safwanrahman/kitsune,Osmose/kitsune,YOTOV-LIMITED/kitsune,philipp-sumo/kitsune,feer56/Kitsune1,dbbhattacharya/kitsune,a... | ---
+++
@@ -1,3 +1,4 @@
+from django.conf import settings
# The test system uses this to override settings in settings.py and
# settings_local.py with settings appropriate for testing.
@@ -6,7 +7,7 @@
# Make sure the doctypes (the keys) match the doctypes in ES_INDEXES
# in settings.py and settings_local.py.
... |
99774f3a525e59c65414606bca6a2f309f5ce140 | stageflip.py | stageflip.py | """
Helper functions for pushing content to a staging directory, moving the old directory aside, and moving the staging directory into place.
"""
from fabric.api import env
from fabric.operations import sudo
from . import debug
from os import path
import time
import re
def make_staging_directory(basename = "project", ... | """
Helper functions for pushing content to a staging directory, moving the old directory aside, and moving the staging directory into place.
"""
from fabric.api import env
from fabric.operations import sudo
from . import debug
from os import path
import time
import re
def make_staging_directory(basename = "project", ... | Return active dir for use by clients. | Return active dir for use by clients.
| Python | bsd-2-clause | Multifarious/fabulous | ---
+++
@@ -20,3 +20,4 @@
debug("Flipping directory name.")
sudo("mv %s %s.retired" % (active_dir,retired_dir), quiet=True)
sudo("mv %s %s" % (staging_dir,active_dir))
+ return active_dir |
9af78701228df0decee22854eae1fbb306d90068 | cactusbot/handlers/spam.py | cactusbot/handlers/spam.py | """Handle incoming spam messages."""
from ..handler import Handler
import logging
import json
class SpamHandler(Handler):
"""Spam handler."""
MAX_SCORE = 16
MAX_EMOTES = 6
ALLOW_LINKS = False
def __init__(self):
self.logger = logging.getLogger(__name__)
def on_message(self, packet)... | """Handle incoming spam messages."""
from ..handler import Handler
import logging
class SpamHandler(Handler):
"""Spam handler."""
MAX_SCORE = 16
MAX_EMOTES = 6
ALLOW_LINKS = False
def __init__(self):
self.logger = logging.getLogger(__name__)
def on_message(self, packet):
""... | Fix json loading, fix capital checker | Fix json loading, fix capital checker
| Python | mit | CactusDev/CactusBot | ---
+++
@@ -3,7 +3,6 @@
from ..handler import Handler
import logging
-import json
class SpamHandler(Handler):
"""Spam handler."""
@@ -17,12 +16,15 @@
def on_message(self, packet):
"""Handle message events."""
- packet = json.loads(packet)
- # exceeds_caps = self.check_caps(''... |
9127e56a26e836c7e2a66359a9f9b67e6c7f8474 | ovp_users/tests/test_filters.py | ovp_users/tests/test_filters.py | from django.test import TestCase
from ovp_users.recover_password import RecoveryTokenFilter
from ovp_users.recover_password import RecoverPasswordFilter
def test_filter(c):
obj = c()
obj.filter_queryset('a', 'b', 'c')
obj.get_fields('a')
def TestPasswordRecoveryFilters(TestCase):
def test_filters():
"""A... | from django.test import TestCase
from ovp_users.recover_password import RecoveryTokenFilter
from ovp_users.recover_password import RecoverPasswordFilter
def test_filter(c):
obj = c()
obj.filter_queryset('a', 'b', 'c')
obj.get_fields('a')
def PasswordRecoveryFiltersTestCase(TestCase):
def test_filters():
... | Fix PasswordRecovery test case name | Fix PasswordRecovery test case name
| Python | agpl-3.0 | OpenVolunteeringPlatform/django-ovp-users,OpenVolunteeringPlatform/django-ovp-users | ---
+++
@@ -8,7 +8,7 @@
obj.filter_queryset('a', 'b', 'c')
obj.get_fields('a')
-def TestPasswordRecoveryFilters(TestCase):
+def PasswordRecoveryFiltersTestCase(TestCase):
def test_filters():
"""Assert filters do not throw error when instantiated"""
# Nothing to assert here, we just instantiate th... |
1b502cdf399b5b9cd4593aea82750b77114fe858 | examples/flask_hello.py | examples/flask_hello.py | from pyinstrument import Profiler
try:
from flask import Flask, g, make_response, request
except ImportError:
print('This example requires Flask.')
print('Install using `pip install flask`.')
exit(1)
app = Flask(__name__)
@app.before_request
def before_request():
if "profile" in request.args:
... | import time
from pyinstrument import Profiler
try:
from flask import Flask, g, make_response, request
except ImportError:
print('This example requires Flask.')
print('Install using `pip install flask`.')
exit(1)
app = Flask(__name__)
@app.before_request
def before_request():
if "profile" in reque... | Add some more endpoints to the flask example | Add some more endpoints to the flask example
| Python | bsd-3-clause | joerick/pyinstrument,joerick/pyinstrument,joerick/pyinstrument,joerick/pyinstrument,joerick/pyinstrument,joerick/pyinstrument | ---
+++
@@ -1,3 +1,4 @@
+import time
from pyinstrument import Profiler
try:
@@ -27,3 +28,16 @@
@app.route('/')
def hello_world():
return 'Hello, World!'
+
+
+@app.route('/sleep')
+def sleep():
+ time.sleep(0.1)
+ return 'Good morning!'
+
+
+@app.route('/dosomething')
+def do_something():
+ imp... |
c8c186e46990797e1faa07c71fb57920a89a2dcc | webquills/core/commands.py | webquills/core/commands.py | """
Business logic in this app is implemented using a CQRS style. Commands should
be implemented as functions here. Queries should be implemented as methods on
Django model managers. Commands can then be called from a management command
(i.e. the CLI), a view, a signal, etc.
"""
from django.conf import settings
from dj... | """
Business logic in this app is implemented using a CQRS style. Commands should
be implemented as functions here. Queries should be implemented as methods on
Django model managers. Commands can then be called from a management command
(i.e. the CLI), a view, a signal, etc.
"""
from django.conf import settings
from dj... | Create SiteMeta for default site | Create SiteMeta for default site
| Python | apache-2.0 | veselosky/webquills,veselosky/webquills,veselosky/webquills | ---
+++
@@ -5,8 +5,9 @@
(i.e. the CLI), a view, a signal, etc.
"""
from django.conf import settings
-from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
+
+from webquills.core.models import SiteMeta
def initialize_site():
@@ -24,5 +25,6 @@
doma... |
e24ee559a607172f0072ac9f28c90f09765ddc62 | examples/print_gcode.py | examples/print_gcode.py | import os
import sys
lib_path = os.path.abspath('../')
sys.path.append(lib_path)
import s3g
import serial
import optparse
parser = optparse.OptionParser()
parser.add_option("-p", "--serialport", dest="serialportname",
help="serial port (ex: /dev/ttyUSB0)", default="/dev/ttyACM0")
parser.add_option("... | import os
import sys
lib_path = os.path.abspath('../')
sys.path.append(lib_path)
import s3g
import serial
import optparse
parser = optparse.OptionParser()
parser.add_option("-p", "--serialport", dest="serialportname",
help="serial port (ex: /dev/ttyUSB0)", default="/dev/ttyACM0")
parser.add_option("... | Update print_gcide example to work with latest api changes. | Update print_gcide example to work with latest api changes.
| Python | agpl-3.0 | Jnesselr/s3g,makerbot/s3g,makerbot/s3g,Jnesselr/s3g,makerbot/s3g,makerbot/s3g | ---
+++
@@ -19,12 +19,13 @@
file = serial.Serial(options.serialportname, options.serialbaud, timeout=0)
r = s3g.s3g()
-r.writer = s3g.StreamWriter(file)
+r.writer = s3g.Writer.StreamWriter(file)
-parser = s3g.GcodeParser()
+parser = s3g.Gcode.GcodeParser()
+parser.state.values["build_name"] = 'test'
parser.s3g... |
b22a9abc8b560ea3014b68b998830e8a5f5073f5 | tomviz/python/setup.py | tomviz/python/setup.py | from setuptools import setup, find_packages
setup(
name='tomviz-pipeline',
version='0.0.1',
description='Tomviz python external pipeline execution infrastructure.',
author='Kitware, Inc.',
author_email='kitware@kitware.com',
url='https://www.tomviz.org/',
license='BSD 3-Clause',
classif... | from setuptools import setup, find_packages
setup(
name='tomviz-pipeline',
version='0.0.1',
description='Tomviz python external pipeline execution infrastructure.',
author='Kitware, Inc.',
author_email='kitware@kitware.com',
url='https://www.tomviz.org/',
license='BSD 3-Clause',
classif... | Make itk and pyfftw extra requirements | Make itk and pyfftw extra requirements
Neither are needed by the core pipeline, some operators use them. Fixes
issue #2040.
Signed-off-by: Marcus D. Hanwell <cf7042e2e8eee958b5bcde1ae2cbefef82efc184@kitware.com>
| Python | bsd-3-clause | OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz | ---
+++
@@ -19,10 +19,11 @@
'Programming Language :: Python :: 3.5'
],
packages=find_packages(),
- install_requires=['tqdm', 'h5py', 'numpy==1.16.4', 'click', 'scipy',
- 'itk', 'pyfftw'],
+ install_requires=['tqdm', 'h5py', 'numpy==1.16.4', 'click', 'scipy'],
extras_... |
560ff8d533a2247e7b194755fb13941ffbc1f544 | IPython/nbconvert/exporters/python.py | IPython/nbconvert/exporters/python.py | """Python script Exporter class"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#----------... | """Python script Exporter class"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#----------... | Remove magic for loading templates from module names | Remove magic for loading templates from module names
| Python | bsd-3-clause | SylvainCorlay/ipywidgets,jupyter-widgets/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,SylvainCorlay/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,cornhundred/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidg... | ---
+++
@@ -24,9 +24,10 @@
"""
Exports a Python code file.
"""
-
- file_extension = Unicode(
- 'py', config=True,
- help="Extension of the file that should be written to disk")
+ def _file_extension_default(self):
+ return 'py'
+
+ def _template_file_default(self):
+ ... |
b6bb2185caa9f6242acc463fbaae1c7f841390da | tt_hospitals/models.py | tt_hospitals/models.py | from django.contrib.gis.db import models
class Hospital(models.Model):
file_nbr = models.CharField(max_length=20)
license_number = models.CharField(max_length=20)
name = models.CharField(max_length=250)
address = models.CharField(max_length=250)
zipcode = models.PositiveIntegerField()
latitude... | from django.contrib.gis.db import models
class Hospital(models.Model):
file_nbr = models.CharField(max_length=20)
license_number = models.CharField(max_length=20)
name = models.CharField(max_length=250)
address = models.CharField(max_length=250)
zipcode = models.PositiveIntegerField()
coordina... | Update the schema a bit and add the geo manager | Update the schema a bit and add the geo manager
| Python | apache-2.0 | texastribune/tt_hospitals,texastribune/tt_hospitals | ---
+++
@@ -7,8 +7,7 @@
name = models.CharField(max_length=250)
address = models.CharField(max_length=250)
zipcode = models.PositiveIntegerField()
- latitude = models.PointField()
- longitude = models.PointField()
+ coordinates = models.PointField()
phone = models.CharField(max_length=250... |
188e4e6d3419793ae8811eb66d94e31849af3461 | conf_site/core/forms.py | conf_site/core/forms.py | from django import forms
class CsvUploadForm(forms.Form):
"""Form for uploading a CSV file."""
csv_file = forms.FileField(label="Please upload a CSV file.")
| from django import forms
class CsvUploadForm(forms.Form):
"""Form for uploading a CSV file."""
csv_file = forms.FileField(label="Please upload a CSV file.")
def _is_csv_file(self, file_data):
"""
Test whether an uploaded file is a CSV file.
Returns a list of a boolean of the res... | Test whether uploaded CSV has correct mime type. | Test whether uploaded CSV has correct mime type.
Add cleaning method to CsvUploadForm to ensure that uploaded file has
either the mime type for a CSV file or no mime type. Return error if
user uploads a different mime type.
| Python | mit | pydata/conf_site,pydata/conf_site,pydata/conf_site | ---
+++
@@ -5,3 +5,23 @@
"""Form for uploading a CSV file."""
csv_file = forms.FileField(label="Please upload a CSV file.")
+
+ def _is_csv_file(self, file_data):
+ """
+ Test whether an uploaded file is a CSV file.
+
+ Returns a list of a boolean of the results and the uploaded co... |
72e1a3552a24ac9b08e5181fb1ad15f78ca6a592 | examples/uploadr/app.py | examples/uploadr/app.py | from flask import Flask, render_template
from flask_wtf import Form
from flask_wtf.file import FileField, FieldList
class FileUploadForm(Form):
uploads = FieldList(FileField())
DEBUG = True
SECRET_KEY = 'secret'
app = Flask(__name__)
app.config.from_object(__name__)
@app.route("/", methods=("GET", "POST",))
d... | from flask import Flask, render_template
from flask_wtf import Form
from flask_wtf.file import FileField
from wtforms import FieldList
class FileUploadForm(Form):
uploads = FieldList(FileField())
DEBUG = True
SECRET_KEY = 'secret'
app = Flask(__name__)
app.config.from_object(__name__)
@app.route("/", methods=(... | Fix example uploadr - wrong FieldList import | Fix example uploadr - wrong FieldList import
| Python | bsd-3-clause | Maxence1/flask-wtf,Maxence1/flask-wtf | ---
+++
@@ -1,7 +1,7 @@
from flask import Flask, render_template
from flask_wtf import Form
-from flask_wtf.file import FileField, FieldList
-
+from flask_wtf.file import FileField
+from wtforms import FieldList
class FileUploadForm(Form):
uploads = FieldList(FileField()) |
6995c7ca63f26a6c350fbdad5e5d194c4c1a60b0 | irco/graphs/country.py | irco/graphs/country.py | import sys
import itertools
import collections
import networkx as nx
from irco import logging
log = logging.get_logger()
def get_countries(publication):
publication_countries = set()
for affiliation in publication.affiliations:
country = affiliation.institution.country
if country is None:... | import sys
import itertools
import collections
import networkx as nx
from irco import logging
log = logging.get_logger()
def get_countries(publication):
publication_countries = set()
for affiliation in publication.affiliations:
country = affiliation.institution.country
if country is None:... | Sort countries before generating combinations. | Sort countries before generating combinations.
| Python | mit | GaretJax/irco,GaretJax/irco,GaretJax/irco,GaretJax/irco | ---
+++
@@ -35,7 +35,8 @@
g.add_nodes_from(publication_countries)
papers_count.update(publication_countries)
- collaborations = list(itertools.combinations(publication_countries, 2))
+ collaborations = list(itertools.combinations(
+ sorted(publication_countries), 2))
... |
1c1b8214a00adf7edc62a67575ae960fedf1d67c | irctest/irc_utils/ambiguities.py | irctest/irc_utils/ambiguities.py | """
Handles ambiguities of RFCs.
"""
def normalize_namreply_params(params):
# So… RFC 2812 says:
# "( "=" / "*" / "@" ) <channel>
# :[ "@" / "+" ] <nick> *( " " [ "@" / "+" ] <nick> )
# but spaces seem to be missing (eg. before the colon), so we
# don't know if there should be one befo... | """
Handles ambiguities of RFCs.
"""
def normalize_namreply_params(params):
# So… RFC 2812 says:
# "( "=" / "*" / "@" ) <channel>
# :[ "@" / "+" ] <nick> *( " " [ "@" / "+" ] <nick> )
# but spaces seem to be missing (eg. before the colon), so we
# don't know if there should be one befo... | Fix typo in function call | normalize_namreply_params: Fix typo in function call
| Python | mit | ProgVal/irctest | ---
+++
@@ -14,7 +14,7 @@
# end of the nick list.
if len(params) == 3:
assert params[1][0] in "=*@", params
- params.insert(1), params[1][0]
+ params.insert(1, params[1][0])
params[2] = params[2][1:]
params[3] = params[3].rstrip()
return params |
58c7726572ab6b6b762bbbfc3b3397729a9332cd | isaactest/tests/welcome_email.py | isaactest/tests/welcome_email.py | import time
from ..utils.log import log, INFO, ERROR, PASS
from ..utils.i_selenium import assert_tab, image_div
from ..tests import TestWithDependency
__all__ = ["welcome_email"]
#####
# Test : Welcome Email Recieved
#####
@TestWithDependency("WELCOME_EMAIL", ["SIGNUP"])
def welcome_email(driver, inbox, GUERRILLAMAI... | import time
from ..utils.log import log, INFO, ERROR, PASS
from ..utils.i_selenium import assert_tab, image_div
from ..tests import TestWithDependency
__all__ = ["welcome_email"]
#####
# Test : Welcome Email Recieved
#####
@TestWithDependency("WELCOME_EMAIL", ["SIGNUP"])
def welcome_email(driver, inbox, GUERRILLAMAI... | Fix test to reflect changes to welcome email | Fix test to reflect changes to welcome email
| Python | mit | jsharkey13/isaac-selenium-testing,jsharkey13/isaac-selenium-testing | ---
+++
@@ -22,7 +22,7 @@
log(INFO, "GuerrillaMail: Access welcome email in inbox.")
try:
- welcome_emails = inbox.get_by_subject("Welcome to Isaac Physics!")
+ welcome_emails = inbox.get_by_subject("Welcome to Isaac!")
assert len(welcome_emails) == 1, "Expected to recieve a welcome... |
c0d8b7f13a74fd4da7b36d30a61224b76367acbe | scraper.py | scraper.py | import urllib, datetime, os
def fetch():
url = 'http://loadmeter.egyptera.org/ClockToolTip.aspx'
output = datetime.datetime.now().strftime('egyptera.%Y-%m-%d-%H-%M-%S.html')
output = os.path.join(os.path.dirname(__file__), output)
content = urllib.urlretrieve(url, output)
if __name__ == '__main__':
... | import urllib, datetime, os
def fetch():
# Instead of doing all the parsing later, I get the status from Mosab's site & store it
url = 'http://power-grid-status.mos3abof.com/status'
output = datetime.datetime.now().strftime('egyptera.%Y-%m-%d-%H-%M-%S.json')
output = os.path.join(os.path.dirname(__file... | Use Mosab's site to get the status | Use Mosab's site to get the status
| Python | apache-2.0 | mtayseer/power-grid-scraper | ---
+++
@@ -1,8 +1,9 @@
import urllib, datetime, os
def fetch():
- url = 'http://loadmeter.egyptera.org/ClockToolTip.aspx'
- output = datetime.datetime.now().strftime('egyptera.%Y-%m-%d-%H-%M-%S.html')
+ # Instead of doing all the parsing later, I get the status from Mosab's site & store it
+ url = 'h... |
4a7b0fb482011400da0b3e760cde2d6f294d168f | sysrev/models.py | sysrev/models.py | from django.db import models
from django.contrib.auth.models import User
class Review(models.Model):
user = models.ForeignKey(User, default=None)
title = models.CharField(max_length=128)
description = models.TextField()
date_created = models.DateTimeField(auto_now_add=True)
last_modified = models.... | from django.db import models
from django.contrib.auth.models import User
class Review(models.Model):
user = models.ForeignKey(User, default=None)
title = models.CharField(max_length=128)
description = models.TextField()
date_created = models.DateTimeField(auto_now_add=True)
last_modified = models.... | Add completed field to review | Add completed field to review
| Python | mit | iliawnek/SystematicReview,iliawnek/SystematicReview,iliawnek/SystematicReview,iliawnek/SystematicReview | ---
+++
@@ -8,6 +8,7 @@
description = models.TextField()
date_created = models.DateTimeField(auto_now_add=True)
last_modified = models.DateTimeField(auto_now=True)
+ completed = models.BooleanField(default=False)
query = models.TextField()
abstract_pool_size = models.IntegerField() |
85f3d1396b5c3f615d83d355a1b836c29d23d295 | tests/__init__.py | tests/__init__.py | import sys
if sys.version_info < (2, 7):
from tests import TestCase # NOQA
else:
from unittest import TestCase # NOQA
| import sys
if sys.version_info < (2, 7):
from unittest2 import TestCase # NOQA
else:
from unittest import TestCase # NOQA
| Use right test case for py 2.6 | Use right test case for py 2.6
| Python | mit | gterzian/exam,gterzian/exam,Fluxx/exam,Fluxx/exam | ---
+++
@@ -2,6 +2,6 @@
if sys.version_info < (2, 7):
- from tests import TestCase # NOQA
+ from unittest2 import TestCase # NOQA
else:
from unittest import TestCase # NOQA |
0337f32a493690f5a0be3893c43b7af3644f964d | tests/runtests.py | tests/runtests.py | #!/usr/bin/env python
from __future__ import print_function, unicode_literals
import sys
import pytest
if __name__ == '__main__':
sys.exit(pytest.main(sys.argv[1:]))
| #!/usr/bin/env python
from __future__ import print_function, unicode_literals
import sys
import pytest
if __name__ == '__main__':
if len(sys.argv) >= 2 and sys.argv[1] != '--':
args = ['--db', sys.argv[1]] + sys.argv[2:]
else:
args = sys.argv[1:]
sys.exit(pytest.main(args))
| Fix running unit tests through the old test runner. | Fix running unit tests through the old test runner.
The old test runner (currently used in CI) had a regression when moving
to pytest. It failed to convert the first argument (the database name to
run everything against) to the new `pytest --db=` argument.
This change adds this back to the test runner. If an argument... | Python | bsd-3-clause | beanbaginc/django-evolution | ---
+++
@@ -7,4 +7,9 @@
if __name__ == '__main__':
- sys.exit(pytest.main(sys.argv[1:]))
+ if len(sys.argv) >= 2 and sys.argv[1] != '--':
+ args = ['--db', sys.argv[1]] + sys.argv[2:]
+ else:
+ args = sys.argv[1:]
+
+ sys.exit(pytest.main(args)) |
9d40acb468a5b31d104cc1837b4778bc993326e7 | tests/testwith.py | tests/testwith.py | import sys
if sys.version_info[:2] > (2, 5):
from tests._testwith import *
else:
from tests.support import unittest2
class TestWith(unittest2.TestCase):
@unittest2.skip('tests using with statement skipped on Python 2.4')
def testWith(self):
pass
if __name__ == '_... | import sys
if sys.version_info[:2] >= (2, 5):
from tests._testwith import *
else:
from tests.support import unittest2
class TestWith(unittest2.TestCase):
@unittest2.skip('tests using with statement skipped on Python 2.4')
def testWith(self):
pass
if __name__ == '... | Enable with statement tests for Python 2.5 | Enable with statement tests for Python 2.5
| Python | bsd-2-clause | 5monkeys/mock,Vanuan/mock | ---
+++
@@ -1,6 +1,6 @@
import sys
-if sys.version_info[:2] > (2, 5):
+if sys.version_info[:2] >= (2, 5):
from tests._testwith import *
else:
from tests.support import unittest2 |
9c1907d1b431281632da187617e857c4911c1ee1 | fmsgame_project/urls.py | fmsgame_project/urls.py | from django.conf.urls.defaults import patterns, url, include
from django.views.generic.simple import direct_to_template
import django.views.static
import settings
import views
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
... | from django.conf.urls.defaults import patterns, url, include
from django.views.generic.simple import direct_to_template
import django.views.static
import settings
import views
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
... | Add back in geolocate url name. | Add back in geolocate url name.
| Python | agpl-3.0 | mysociety/fmsgame,mysociety/fmsgame,mysociety/fmsgame | ---
+++
@@ -21,7 +21,7 @@
(r'^$', direct_to_template, { 'template': 'login.html', } ),
- (r'^geolocate$', direct_to_template, { 'template': 'geolocate.html', } ),
+ url(r'^geolocate$', direct_to_template, { 'template': 'geolocate.html', } name='geolocate'),
( r'^find_issues', ... |
8dd3457b20b5ce96cf7e0f5029e3541d57ca116d | wqflask/wqflask/decorators.py | wqflask/wqflask/decorators.py | """This module contains gn2 decorators"""
from flask import g
from typing import Dict
from functools import wraps
from utility.hmac import hmac_creation
from utility.tools import GN_PROXY_URL
import json
import requests
def edit_access_required(f):
"""Use this for endpoints where admins are required"""
@wrap... | """This module contains gn2 decorators"""
import hashlib
import hmac
from flask import current_app, g
from typing import Dict
from functools import wraps
import json
import requests
def create_hmac(data: str, secret: str) -> str:
return hmac.new(bytearray(secret, "latin-1"),
bytearray(data, "... | Remove "utility.hmac.hmac_creation" which causes circular imports | Remove "utility.hmac.hmac_creation" which causes circular imports
Hacky but re-implement `hmac_creation` as `create_hmac`
| Python | agpl-3.0 | pjotrp/genenetwork2,pjotrp/genenetwork2,genenetwork/genenetwork2,pjotrp/genenetwork2,pjotrp/genenetwork2,genenetwork/genenetwork2,genenetwork/genenetwork2,pjotrp/genenetwork2,genenetwork/genenetwork2 | ---
+++
@@ -1,26 +1,34 @@
"""This module contains gn2 decorators"""
-from flask import g
+import hashlib
+import hmac
+from flask import current_app, g
from typing import Dict
from functools import wraps
-from utility.hmac import hmac_creation
-from utility.tools import GN_PROXY_URL
import json
import requests... |
fb1cfd15c646cc076a152acbd823b736f2a46724 | studygroups/migrations/0028_auto_20150806_0039.py | studygroups/migrations/0028_auto_20150806_0039.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('studygroups', '0027_auto_20150513_2005'),
]
operations = [
migrations.CreateModel(
name='Location',
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('studygroups', '0027_auto_20150513_2005'),
]
operations = [
migrations.CreateModel(
name='Location',
... | Fix migration that fails on postgres | Fix migration that fails on postgres
| Python | mit | p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles | ---
+++
@@ -32,7 +32,11 @@
field=models.CharField(default='none', max_length=128),
preserve_default=False,
),
- migrations.AlterField(
+ migrations.RemoveField(
+ model_name='studygroup',
+ name='location',
+ ),
+ migrations.AddField... |
e78b8704a68b49593b43ac5b9690be36fca2e274 | default_config.py | default_config.py | class DefaultConfig():
secret_key = "LONG_AND_RANDOM"
tmdb_api_key = "THEMOVIEDB.ORG_API_KEY"
| class DefaultConfig():
secret_key = None # Django secret key used for sessions. Make this a long random string and keep it a secret
tmdb_api_key = None # API key for The Movie Database (themoviedb.org).
| Set default config values to none so user is forced to set them. | Set default config values to none so user is forced to set them.
Also document fields in the default config
| Python | mit | simon-andrews/movieman2,simon-andrews/movieman2 | ---
+++
@@ -1,3 +1,3 @@
class DefaultConfig():
- secret_key = "LONG_AND_RANDOM"
- tmdb_api_key = "THEMOVIEDB.ORG_API_KEY"
+ secret_key = None # Django secret key used for sessions. Make this a long random string and keep it a secret
+ tmdb_api_key = None # API key for The Movie Database (themoviedb.org... |
745148817bacacc26ff06a8470cf52c815f6565a | neutronclient/neutron/v2_0/availability_zone.py | neutronclient/neutron/v2_0/availability_zone.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Convert remaining use of neutronclient.i18n to _i18n | Convert remaining use of neutronclient.i18n to _i18n
Change-Id: I77f168af92ae51ce16bed4988bbcaf7c18557727
Related-Bug: 1519493
| Python | apache-2.0 | huntxu/python-neutronclient,eayunstack/python-neutronclient,rackerlabs/rackspace-python-neutronclient,eayunstack/python-neutronclient,Juniper/python-neutronclient,noironetworks/python-neutronclient,Juniper/python-neutronclient,noironetworks/python-neutronclient,huntxu/python-neutronclient,openstack/python-neutronclient... | ---
+++
@@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-from neutronclient.i18n import _
+from neutronclient._i18n import _
from neutronclient.neutron import v2_0 as neutronv20
|
bc5abf988956235b48aeb1234d9944fe70be619a | pytest_hidecaptured.py | pytest_hidecaptured.py | # -*- coding: utf-8 -*-
def pytest_runtest_logreport(report):
"""Overwrite report by removing any captured stderr."""
# print("PLUGIN SAYS -> report -> {0}".format(report))
# print("PLUGIN SAYS -> report.sections -> {0}".format(report.sections))
# print("PLUGIN SAYS -> dir(report) -> {0}".format(dir(rep... | # -*- coding: utf-8 -*-
import pytest
@pytest.mark.tryfirst
def pytest_runtest_logreport(report):
"""Overwrite report by removing any captured stderr."""
# print("PLUGIN SAYS -> report -> {0}".format(report))
# print("PLUGIN SAYS -> report.sections -> {0}".format(report.sections))
# print("PLUGIN SAYS ... | Fix interop issues with pytest-instafail | Fix interop issues with pytest-instafail
| Python | mit | hamzasheikh/pytest-hidecaptured | ---
+++
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
+import pytest
+
+@pytest.mark.tryfirst
def pytest_runtest_logreport(report):
"""Overwrite report by removing any captured stderr."""
# print("PLUGIN SAYS -> report -> {0}".format(report)) |
74db127246b7111a35c64079eec91d46f88ebd55 | src/test/stresstest.py | src/test/stresstest.py | #!/usr/bin/env python
# Copyright 2007 Albert Strasheim <fullung@gmail.com>
#
# 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 requ... | #!/usr/bin/env python
# Copyright 2007 Albert Strasheim <fullung@gmail.com>
#
# 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 requ... | Test everything with stress test. | Test everything with stress test.
| Python | apache-2.0 | tabish121/pyActiveMQ,tabish121/pyActiveMQ,tabish121/pyActiveMQ | ---
+++
@@ -16,6 +16,12 @@
import unittest
+from test_openwire_async import *
+from test_openwire_sync import *
+from test_stomp_async import *
+from test_stomp_sync import *
+from test_types import *
+
if __name__ == '__main__':
testLoader = unittest.defaultTestLoader
module = __import__('__main__') |
e422f77898853fc759d3828c4053b799cd2b1fa3 | plumeria/plugins/bot_control.py | plumeria/plugins/bot_control.py | from plumeria.command import commands, CommandError
from plumeria.message.lists import build_list
from plumeria.perms import owners_only
from plumeria.transport import transports
@commands.register('accept invite', category='Discord')
@owners_only
async def accept_invite(message):
"""
Accept an invite to join... | from plumeria.command import commands, CommandError
from plumeria.message.lists import build_list
from plumeria.perms import owners_only
from plumeria.transport import transports
@commands.register('join', category='Discord')
@owners_only
async def join(message):
"""
Accept an invite to join a server.
Ex... | Use /join instead of /accept invite. | Use /join instead of /accept invite.
| Python | mit | sk89q/Plumeria,sk89q/Plumeria,sk89q/Plumeria | ---
+++
@@ -4,15 +4,15 @@
from plumeria.transport import transports
-@commands.register('accept invite', category='Discord')
+@commands.register('join', category='Discord')
@owners_only
-async def accept_invite(message):
+async def join(message):
"""
Accept an invite to join a server.
Example::... |
d8da4526375946551fd3963b42f2bb13035abb2d | hijack_admin/tests/test_hijack_admin.py | hijack_admin/tests/test_hijack_admin.py | # -*- coding: utf-8 -*-
from hijack.tests.test_hijack import BaseHijackTests
from hijack.tests.utils import SettingsOverride
from hijack_admin import settings as hijack_admin_settings
from hijack_admin.tests.test_app.models import RelatedModel
class HijackAdminTests(BaseHijackTests):
def setUp(self):
s... | # -*- coding: utf-8 -*-
from hijack.tests.test_hijack import BaseHijackTests
from hijack_admin import settings as hijack_admin_settings
from hijack_admin.tests.test_app.models import RelatedModel
class HijackAdminTests(BaseHijackTests):
def setUp(self):
super(HijackAdminTests, self).setUp()
def tea... | Remove unused import in tests | Remove unused import in tests
| Python | mit | arteria/django-hijack-admin,arteria/django-hijack-admin,arteria/django-hijack-admin | ---
+++
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
-
from hijack.tests.test_hijack import BaseHijackTests
-from hijack.tests.utils import SettingsOverride
from hijack_admin import settings as hijack_admin_settings
from hijack_admin.tests.test_app.models import RelatedModel |
28385e10d00be3b68d312ed6ea19695c21c0beeb | version.py | version.py | major = 0
minor=0
patch=19
branch="master"
timestamp=1376526199.16 | major = 0
minor=0
patch=20
branch="master"
timestamp=1376526219.94 | Tag commit for v0.0.20-master generated by gitmake.py | Tag commit for v0.0.20-master generated by gitmake.py
| Python | mit | ryansturmer/gitmake | ---
+++
@@ -1,5 +1,5 @@
major = 0
minor=0
-patch=19
+patch=20
branch="master"
-timestamp=1376526199.16
+timestamp=1376526219.94 |
d69b41307b94db7e8658fd209fdae0e0240bc62a | Monstr/Core/Config.py | Monstr/Core/Config.py | import ConfigParser
Config = ConfigParser.ConfigParser()
import os
print os.getcwd()
try:
Config.read('/opt/monstr/current.cfg')
except Exception as e:
print 'WARNING! Configuration is missing. Using test_conf.cfg'
Config.read('test.cfg')
def get_section(section):
result = {}
if section in Con... | import ConfigParser
Config = ConfigParser.ConfigParser()
import os
print os.getcwd()
try:
Config.read('/opt/monstr/current.cfg')
except Exception as e:
print 'WARNING! Configuration is missing. Using test_conf.cfg'
Config.read('test.cfg')
def get_section(section):
result = {}
if section in Con... | Raise Exception instead of plain string | FIX: Raise Exception instead of plain string
| Python | apache-2.0 | tier-one-monitoring/monstr,tier-one-monitoring/monstr | ---
+++
@@ -17,4 +17,4 @@
result[option] = Config.get(section, option)
return result
else:
- raise 'Requested section is absent in configuration'
+ raise Exception('Requested section is absent in configuration') |
4c414e753cc086e0ae52425a3eae6de453b492ca | lot/landmapper/tests/test_pdf.py | lot/landmapper/tests/test_pdf.py | from django.test import TestCase
from django.conf import settings
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
# from selenium.webdriver.fir... | from django.test import TestCase
from django.conf import settings
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
# from selenium.webdriver.fir... | Use alt naming convention instead | Use alt naming convention instead
| Python | bsd-3-clause | Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner | ---
+++
@@ -32,7 +32,7 @@
def test_cover_map_img(self):
property_id = 'Demo%7C583966%7C862934'
# New URL
- self.selenium.get("http://localhost:8000/report/%s/%s/map_509x722" % (property_id, 'property'))
+ self.selenium.get("http://localhost:8000/report/%s/%s/map_alt" % (property_i... |
ded0d2ced823deeabf860abd9ec5120165ed7fde | djoser/utils.py | djoser/utils.py | from django.contrib.auth import user_logged_in, user_logged_out, login, logout
from django.utils.encoding import force_bytes, force_text
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
from djoser.conf import settings
def encode_uid(pk):
return urlsafe_base64_encode(force_bytes(pk)).de... | from django.contrib.auth import user_logged_in, user_logged_out, login, logout
from django.utils.encoding import force_bytes, force_text
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
from djoser.conf import settings
def encode_uid(pk):
return urlsafe_base64_encode(force_bytes(pk)).de... | Add **kwargs to ActionViewmixin.post() handler | Add **kwargs to ActionViewmixin.post() handler
Details: #359
| Python | mit | sunscrapers/djoser,sunscrapers/djoser,sunscrapers/djoser | ---
+++
@@ -32,7 +32,7 @@
class ActionViewMixin(object):
- def post(self, request):
+ def post(self, request, **kwargs):
serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True)
return self._action(serializer) |
b49c40dddb5b90881f9f86872cb6a3b6044e1637 | djpg/signals.py | djpg/signals.py | import logging
logger = logging.getLogger('djpg')
from django.dispatch import Signal
from .codes import codes
notification_received = Signal(providing_args=['notification'])
transaction_received = Signal(providing_args=['transaction'])
transaction_waiting = Signal()
transaction_analysis = Signal()
transaction_paid =... | import logging
logger = logging.getLogger('djpg')
from django.dispatch import Signal
from .codes import codes
notification_received = Signal(providing_args=['notification'])
transaction_received = Signal(providing_args=['transaction'])
transaction_waiting = Signal()
transaction_analysis = Signal()
transaction_paid =... | Fix bug when trying to convert transaction code to int | Fix bug when trying to convert transaction code to int
| Python | mit | mstrcnvs/djpg | ---
+++
@@ -19,7 +19,7 @@
def dispatch_transaction(sender, **kwargs):
transaction = kwargs.pop('transaction')
- code = int(transaction['code'])
+ code = transaction['code']
status = int(transaction['status'])
signals = { |
9349fc0f176a40de58fba551b205c771af3ea7b7 | djproxy/util.py | djproxy/util.py | # import_string was appropriated from django and then rewritten for broader
# python support. The version of this method can't be imported from Django
# directly because it didn't exist until 1.7.
def import_string(dotted_path):
"""
Import a dotted module path.
Returns the attribute/class designated by t... | # import_string was appropriated from django and then rewritten for broader
# python support. The version of this method can't be imported from Django
# directly because it didn't exist until 1.7.
def import_string(dotted_path):
"""
Import a dotted module path.
Returns the attribute/class designated by t... | Use valid fromlist parameter when calling __import__ | Use valid fromlist parameter when calling __import__
This was working before, but it wasn't what I had intended to write. It doesn't really matter what is passed in here as long as it isn't an empty list.
| Python | mit | thomasw/djproxy | ---
+++
@@ -17,7 +17,7 @@
except ValueError:
raise ImportError('%s doesn\'t look like a valid path' % dotted_path)
- module = __import__(module_path, fromlist=['class_name'])
+ module = __import__(module_path, fromlist=[class_name])
try:
return getattr(module, class_name) |
6a98ec7a72d91da09c40fe189fcfce51c7736782 | app/schedule/tasks.py | app/schedule/tasks.py | from django.conf import settings
from app.schedule.celery import celery_app
from app.schedule.libs.sms import DeviceNotFoundError
@celery_app.task(bind=True)
def send_message(self, to, message):
messenger = settings.APP_MESSENGER_CLASS
user = settings.SMS_GATEWAY_USER
password = settings.SMS_GATEWAY_PASS... | from django.conf import settings
from app.schedule.celery import celery_app
from app.schedule.libs.sms import DeviceNotFoundError
@celery_app.task(bind=True)
def send_message(self, to, message):
messenger = settings.APP_MESSENGER_CLASS
user = settings.SMS_GATEWAY_USER
password = settings.SMS_GATEWAY_PASS... | Return the message status to the message broker | fix: Return the message status to the message broker
| Python | agpl-3.0 | agendaodonto/server,agendaodonto/server | ---
+++
@@ -12,6 +12,6 @@
try:
messenger = messenger(user, password)
messenger.get_best_device()
- messenger.send_message(to, message)
+ return messenger.send_message(to, message)
except DeviceNotFoundError as e:
self.retry(exc=e, max_retries=settings.CELERY_TASK_MAX... |
9fefa30f51f1a3c0e4586bc21c36324c6dfbbc87 | test/tst_filepath.py | test/tst_filepath.py | import os
import unittest
import netCDF4
class test_filepath(unittest.TestCase):
def setUp(self):
self.netcdf_file = os.path.join(os.getcwd(), "netcdf_dummy_file.nc")
self.nc = netCDF4.Dataset(self.netcdf_file)
def test_filepath(self):
assert self.nc.filepath() == str(self.netcdf_file... | import os
import unittest
import tempfile
import netCDF4
class test_filepath(unittest.TestCase):
def setUp(self):
self.netcdf_file = os.path.join(os.getcwd(), "netcdf_dummy_file.nc")
self.nc = netCDF4.Dataset(self.netcdf_file)
def test_filepath(self):
assert self.nc.filepath() == str(... | Add test for filepath with non-ascii-chars | Add test for filepath with non-ascii-chars | Python | mit | Unidata/netcdf4-python,Unidata/netcdf4-python,Unidata/netcdf4-python | ---
+++
@@ -1,5 +1,6 @@
import os
import unittest
+import tempfile
import netCDF4
class test_filepath(unittest.TestCase):
@@ -11,5 +12,20 @@
def test_filepath(self):
assert self.nc.filepath() == str(self.netcdf_file)
+ def test_filepath_with_non_ascii_characters(self):
+ # create nc-fi... |
42abaca67b742ff343c4f6c5553b9eb9dad28d43 | skeleton/__init__.py | skeleton/__init__.py | """
Basic Template system for project skeleton.
skeleton is similar to the template part of PasteScript but
without any dependencies; it should also be compatible with Python 3.
However in this early phase of development, it only target python 2.5+,
and tests require Mock.
"""
from skeleton.core import Skeleton, Va... | """
Basic Template system for project skeleton.
skeleton is similar to the template part of PasteScript but
without any dependencies.
"""
from skeleton.core import Skeleton, Var
from skeleton.utils import insert_into_file
| Add insert_into_file to skeleton module | Add insert_into_file to skeleton module | Python | bsd-2-clause | dinoboff/skeleton | ---
+++
@@ -2,10 +2,8 @@
Basic Template system for project skeleton.
skeleton is similar to the template part of PasteScript but
-without any dependencies; it should also be compatible with Python 3.
-
-However in this early phase of development, it only target python 2.5+,
-and tests require Mock.
+without any ... |
15eae70c91cd08f9028944f8b6a3990d3170aa28 | snippet_parser/fr.py | snippet_parser/fr.py | #-*- encoding: utf-8 -*-
import base
def handle_date(template):
year = None
if len(template.params) >= 3:
try:
year = int(unicode(template.params[2]))
except ValueError:
pass
if isinstance(year, int):
# assume {{date|d|m|y|...}}
return ' '.join(map(u... | #-*- encoding: utf-8 -*-
import base
def handle_date(template):
year = None
if len(template.params) >= 3:
try:
year = int(unicode(template.params[2]))
except ValueError:
pass
if isinstance(year, int):
# assume {{date|d|m|y|...}}
return ' '.join(map(u... | Fix params handling in {{s}}. | Fix params handling in {{s}}.
| Python | mit | Stryn/citationhunt,Stryn/citationhunt,Stryn/citationhunt,jhsoby/citationhunt,Stryn/citationhunt,jhsoby/citationhunt,jhsoby/citationhunt,jhsoby/citationhunt | ---
+++
@@ -17,9 +17,9 @@
return unicode(template.params[0])
def handle_s(template):
- ret = template.params[0]
+ ret = unicode(template.params[0])
if len(template.params) == 2:
- ret += template.params[1]
+ ret += unicode(template.params[1])
if template.name.matches('-s'):
... |
665af108d44e5aa91483bc70c0c76dab9b297d41 | tests/test_api_info.py | tests/test_api_info.py | from tests.types import string
def test_get(test):
def handle_connect(handler):
info = handler.api.get_info()
assert isinstance(info['api_version'], string)
assert isinstance(info['server_timestamp'], string)
if info.get('rest_server_url'):
assert info['websocket_serve... | from tests.types import string
from tests.conftest import not_implemented_skip
def test_get(test):
def handle_connect(handler):
info = handler.api.get_info()
assert isinstance(info['api_version'], string)
assert isinstance(info['server_timestamp'], string)
if info.get('rest_server... | Add not implemeted get cluster | Add not implemeted get cluster
| Python | apache-2.0 | devicehive/devicehive-python | ---
+++
@@ -1,4 +1,5 @@
from tests.types import string
+from tests.conftest import not_implemented_skip
def test_get(test):
@@ -15,3 +16,8 @@
assert info['rest_server_url'] is None
test.run(handle_connect)
+
+
+@not_implemented_skip
+def test_get_cluster(test):
+ pass |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.