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 |
|---|---|---|---|---|---|---|---|---|---|---|
0ff0ca626c7f1e313fafdb034db77933424fe7ca | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# TODO: put package requirements here
]
test_requi... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# None
]
test_requirements = [
'tox',
]
setup... | Update description and add 'tox' as a testing dependency. | Update description and add 'tox' as a testing dependency.
| Python | bsd-3-clause | petrilli/generalwords | ---
+++
@@ -12,17 +12,17 @@
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
- # TODO: put package requirements here
+ # None
]
test_requirements = [
- # TODO: put package test requirements here
+ 'tox',
]
setup(
name='generalwords',
version='0.1.0'... |
7aaaeef4cbcd1c3010bb633599770fab39031822 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='zeit.content.infobox',
version='1.23.6dev',
author='gocept',
author_email='mail@gocept.com',
url='https://svn.gocept.com/repos/gocept-int/zeit.cms',
description="ZEIT infobox",
packages=find_packages('src'),
package_dir = {'': 'sr... | from setuptools import setup, find_packages
setup(
name='zeit.content.infobox',
version='1.23.6dev',
author='gocept',
author_email='mail@gocept.com',
url='https://svn.gocept.com/repos/gocept-int/zeit.cms',
description="ZEIT infobox",
packages=find_packages('src'),
package_dir = {'': 'sr... | Declare required version of zeit.cms | Declare required version of zeit.cms
| Python | bsd-3-clause | ZeitOnline/zeit.content.infobox | ---
+++
@@ -17,7 +17,7 @@
'gocept.form',
'mock',
'setuptools',
- 'zeit.cms>1.40.3',
+ 'zeit.cms>=1.53.0.dev',
'zeit.wysiwyg',
'zope.app.appsetup',
'zope.app.testing', |
f22cb6c576d167bd20658e35f6b28066871a80a2 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyj... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyj... | Add contrib package to deployment | Add contrib package to deployment
| Python | isc | sharoonthomas/fulfil-python-api,fulfilio/fulfil-python-api | ---
+++
@@ -34,9 +34,11 @@
url='https://github.com/fulfilio/fulfil-python-api',
packages=[
'fulfil_client',
+ 'fulfil_client.contrib',
],
package_dir={
- 'fulfil_client': 'fulfil_client'
+ 'fulfil_client': 'fulfil_client',
+ 'fulfil_client.contrib': 'fulfil_cli... |
a10caabf5a8ece0ba05fac2d9166a6a85ac39b38 | setup.py | setup.py | #!/usr/bin/env python
"""Package setup script; requires setuptools (or Python >=3.4 which
bundles it)."""
from setuptools import setup
setup(name='Treepace',
version='0.2',
description='Tree Transformation Language',
author='Matúš Sulír',
url='https://github.com/sulir/treepace',
package... | #!/usr/bin/env python
"""Package setup script; requires setuptools (or Python >=3.4 which
bundles it)."""
from setuptools import setup
setup(name='Treepace',
version='0.3',
description='Tree Transformation Language',
author='Matúš Sulír',
url='https://github.com/sulir/treepace',
package... | Change version because of an important bugfix | Change version because of an important bugfix
| Python | mit | sulir/treepace | ---
+++
@@ -6,15 +6,15 @@
from setuptools import setup
setup(name='Treepace',
- version='0.2',
+ version='0.3',
description='Tree Transformation Language',
author='Matúš Sulír',
url='https://github.com/sulir/treepace',
packages=['treepace', 'treepace.examples'],
test_s... |
aafd9f66610dc801a197e634cc98c7e855670d35 | setup.py | setup.py | #!/usr/bin/env python
import setuptools
import sys
if not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)
or sys.version_info.major > 3):
exit("Sorry, Python's version must be later than 3.5.")
import shakyo
setuptools.setup(
name=shakyo.__name__,
version=shakyo.__version__,
descri... | #!/usr/bin/env python
import setuptools
import sys
if not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)
or sys.version_info.major > 3):
exit("Sorry, Python's version must be later than 3.5.")
import shakyo
setuptools.setup(
name=shakyo.__name__,
version=shakyo.__version__,
descri... | Add another PyPI package classifier of Python 3.5 programming language | Add another PyPI package classifier of Python 3.5 programming language
| Python | unlicense | raviqqe/shakyo | ---
+++
@@ -28,6 +28,7 @@
"Intended Audience :: End Users/Desktop",
"License :: Public Domain",
"Operating System :: POSIX",
+ "Programming Language :: Python :: 3.5",
"Topic :: Education :: Computer Aided Instruction (CAI)",
"Topic :: Games/Entertainment",
], |
b91e458c0250b090de8a7327f5dee1cd4f105f56 | setup.py | setup.py | #!/usr/bin/env python3
"""Setup module."""
from setuptools import setup, find_packages
import os
def read(fname):
"""Read and return the contents of a file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='macmond',
version='0.0.1',
description='MACMond - MAC ad... | #!/usr/bin/env python3
"""Setup module."""
from setuptools import setup, find_packages
import os
def read(fname):
"""Read and return the contents of a file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='macmond',
version='0.0.1',
description='MACMond - MAC ad... | Fix a typo in the project URL | Fix a typo in the project URL
Signed-off-by: Kalman Olah <aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d@kalmanolah.net>
| Python | mit | kalmanolah/macmond | ---
+++
@@ -16,7 +16,7 @@
long_description=read('README'),
author='Kalman Olah',
author_email='hello@kalmanolah.net',
- url='https://github.io/kalmanolah/macmond',
+ url='https://github.com/kalmanolah/macmond',
license='MIT',
classifiers=[
'Development Status :: 2 - Pre-Alpha', |
40c4ffd480f291e35ffa69c3145d240146dbcd6c | setup.py | setup.py | # -*- coding: utf-8 -*-
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='cotede',
version='0.1.2',
author='Guilherme Castelão',
author_email='guilherme@castelao.net',
packages=['cotede'],
url='http://cotede.castelao.net',
license='See... | # -*- coding: utf-8 -*-
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='cotede',
version='0.2.0',
author='Guilherme Castelão',
author_email='guilherme@castelao.net',
packages=['cotede'],
url='http://cotede.castelao.net',
license='See... | Update to 0.2, pre-alpha. Fundamental tests are working. | Update to 0.2, pre-alpha. Fundamental tests are working.
| Python | bsd-3-clause | castelao/CoTeDe | ---
+++
@@ -8,7 +8,7 @@
setup(
name='cotede',
- version='0.1.2',
+ version='0.2.0',
author='Guilherme Castelão',
author_email='guilherme@castelao.net',
packages=['cotede'],
@@ -17,7 +17,7 @@
description='Quality Control of CTD profiles',
long_description=open('README.rst').read(... |
75c1e7ffbc938a4543094360df4ddc1e0262ce5f | setup.py | setup.py | version = '0.1.0'
with open('requirements.txt', 'r') as f:
install_requires = [x.strip() for x in f.readlines()]
from setuptools import setup, find_packages
setup(
name='bodylabs-rigger',
version=version,
author='Body Labs',
author_email='david.smith@bodylabs.com',
description="Utilities for ... | version = '0.1.0'
with open('requirements.txt', 'r') as f:
install_requires = [x.strip() for x in f.readlines()]
from setuptools import setup, find_packages
setup(
name='bodylabs-rigger',
version=version,
author='Body Labs',
author_email='david.smith@bodylabs.com',
description="Utilities for ... | Add rig_assets.json as package data. | Add rig_assets.json as package data.
| Python | bsd-2-clause | bodylabs/rigger,kaiserk/rigger | ---
+++
@@ -14,6 +14,9 @@
url='https://github.com/bodylabs/rigger',
license='BSD',
packages=find_packages(),
+ package_data={
+ 'bodylabs_rigger.static': ['rig_assets.json']
+ },
install_requires=install_requires,
classifiers=[
'Development Status :: 2 - Pre-Alpha', |
4dc51fbc78800db0c3ba750ee92bac1ed49a944d | setup.py | setup.py | """
setup.py
"""
from setuptools import setup, find_packages
setup(
name='SATOSA',
version='3.4.8',
description='Protocol proxy (SAML/OIDC).',
author='DIRG',
author_email='satosa-dev@lists.sunet.se',
license='Apache 2.0',
url='https://github.com/SUNET/SATOSA',
packages=find_packages('s... | """
setup.py
"""
from setuptools import setup, find_packages
setup(
name='SATOSA',
version='3.4.8',
description='Protocol proxy (SAML/OIDC).',
author='DIRG',
author_email='satosa-dev@lists.sunet.se',
license='Apache 2.0',
url='https://github.com/SUNET/SATOSA',
packages=find_packages('s... | Support optional NameID element in SAML response | Support optional NameID element in SAML response
Prior to pysaml2 v4.6.1 an exception is thrown when parsing a SAML
response with no NameID element.
satosa.exception.SATOSAAuthenticationError: Failed to parse authn request
pysaml2 v4.6.1 onwards supports SAML responses with no NameID element.
Signed-off-by: Ivan ... | Python | apache-2.0 | SUNET/SATOSA,its-dirg/SATOSA,irtnog/SATOSA,SUNET/SATOSA,irtnog/SATOSA | ---
+++
@@ -16,7 +16,7 @@
package_dir={'': 'src'},
install_requires=[
"pyop",
- "pysaml2==4.5.0",
+ "pysaml2>=4.6.1",
"pycryptodomex",
"requests",
"PyYAML", |
09f5d2997408ba338edf83101834fd15151e135e | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='weaveserver',
version='0.8',
author='Srivatsan Iyer',
author_email='supersaiyanmode.rox@gmail.com',
packages=find_packages(),
license='MIT',
description='Library to interact with Weave Server',
long_description=open('README.md').r... | from setuptools import setup, find_packages
setup(
name='weaveserver',
version='0.8',
author='Srivatsan Iyer',
author_email='supersaiyanmode.rox@gmail.com',
packages=find_packages(),
license='MIT',
description='Library to interact with Weave Server',
long_description=open('README.md').r... | Use bottle to serve HTTP. | Use bottle to serve HTTP.
| Python | mit | supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer | ---
+++
@@ -12,6 +12,7 @@
install_requires=[
'weavelib',
'eventlet!=0.22',
+ 'bottle',
'GitPython',
'redis',
], |
0b8c12fba3f6819616edf9b02d5207c129635688 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme_file = path.join(path.dirname(path.abspath(__file__)), 'README.rst')
with open(readme_file) as readme_file:
readme = readme_file.read()
setup(
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme_file = path.join(path.dirname(path.abspath(__file__)), 'README.rst')
with open(readme_file) as readme_file:
readme = readme_file.read()
setup(
... | Add python3 :: Only classifier | Add python3 :: Only classifier
| Python | mit | miyakogi/syncer | ---
+++
@@ -31,6 +31,7 @@
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.5',
],
test_suite='test_syncer', |
35870f0243e58c1b4c141499e39af54aea468d2c | setup.py | setup.py | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Collect xUnit xml files and upload them to bob-bench.org',
'author': 'Holger Hans Peter Freyther',
'url': 'http://www.bob-bench.org',
'download_url': 'http://www.bob-bench.org',
... | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Collect xUnit xml files and upload them to bob-bench.org',
'author': 'Holger Hans Peter Freyther',
'url': 'http://www.bob-bench.org',
'download_url': 'http://www.bob-bench.org',
... | Make a new release with circleci detection | Make a new release with circleci detection
| Python | agpl-3.0 | bob-bench/benchupload,bob-bench/benchupload | ---
+++
@@ -9,7 +9,7 @@
'url': 'http://www.bob-bench.org',
'download_url': 'http://www.bob-bench.org',
'author_email': 'help@bob-bench.org',
- 'version': '5',
+ 'version': '6',
'install_requires': [
'requests',
], |
3a4ff183940f3af7e3ec7cfe491f7d60409f5fea | setup.py | setup.py | from setuptools import setup, find_packages
import wsgiservice
setup(
name='WsgiService',
version=wsgiservice.__version__,
description="A lean WSGI framework for easy creation of REST services",
author=", ".join(wsgiservice.__author__),
url='http://github.com/pneff/wsgiservice/tree/master',
down... | from setuptools import setup, find_packages
import wsgiservice
setup(
name='WsgiService',
version=wsgiservice.__version__,
description="A lean WSGI framework for easy creation of REST services",
long_description=open('README').read(),
author=", ".join(wsgiservice.__author__),
url='http://github.... | Add the README as the long description to the package. | Add the README as the long description to the package.
| Python | bsd-2-clause | pneff/wsgiservice,beekpr/wsgiservice | ---
+++
@@ -4,6 +4,7 @@
name='WsgiService',
version=wsgiservice.__version__,
description="A lean WSGI framework for easy creation of REST services",
+ long_description=open('README').read(),
author=", ".join(wsgiservice.__author__),
url='http://github.com/pneff/wsgiservice/tree/master',
... |
270d58388effc5777dea7a186d9578116bd0afb4 | setup.py | setup.py | from setuptools import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.3.4',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email =... | from setuptools import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.3.4',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email =... | Remove sqlite3 (part of the standard library) from the list of requirements. | Remove sqlite3 (part of the standard library) from the list of requirements.
| Python | mit | pwcazenave/PyFVCOM | ---
+++
@@ -12,7 +12,7 @@
keywords = ['fvcom', 'unstructured grid', 'mesh'],
license = 'MIT',
platforms = 'any',
- install_requires = ['pyshp', 'jdcal', 'scipy', 'numpy', 'matplotlib', 'netCDF4', 'lxml', 'sqlite3', 'matplotlib'],
+ install_requires = ['pyshp', 'jdcal', 'scipy', 'numpy', 'matplotl... |
d1537c9111a3834de07a330953ab0c1a31240ec4 | setup.py | setup.py | #! /usr/bin/env python3
from distutils.core import setup
setup(
description = 'File downloader for danbooru',
author = 'Todd Gaunt',
url = 'https://www.github.com/toddgaunt/danboorsync',
download_url = 'https://www.github.com/toddgaunt/danboorsync',
author_email = 'toddgaunt@protonmail.ch',
ver... | #! /usr/bin/env python3
from distutils.core import setup
setup(
description = 'File downloader for danbooru',
author = 'Todd Gaunt',
url = 'https://www.github.com/toddgaunt/danboorsync',
download_url = 'https://www.github.com/toddgaunt/danboorsync',
author_email = 'toddgaunt@protonmail.ch',
ver... | Remove / from script path to make it search bin rather than /bin | Remove / from script path to make it search bin rather than /bin
| Python | isc | toddgaunt/imgfetch | ---
+++
@@ -17,6 +17,6 @@
data_files = [('/usr/share/man/man1', ['doc/danboorsync.1']),
('/usr/share/licenses/danboorsync/LICENSE', ['doc/LICENSE'])],
- scripts = ['/bin/danboorsync'],
+ scripts = ['bin/danboorsync'],
name = 'danboorsync'
) |
aea05ee76193ac0abe2f6673910917bf13a3b339 | setup.py | setup.py | from distutils.core import setup
setup(
name='simplecrypto',
version=open('CHANGES.txt').read().split()[0],
author='Lucas Boppre Niehues',
author_email='lucasboppre@gmail.com',
packages=['simplecrypto'],
url='http://pypi.python.org/pypi/simplecrypto/',
license='LICENSE.txt',
description... | from distutils.core import setup
setup(
name='simplecrypto',
version=open('CHANGES.txt').read().split()[0],
author='Lucas Boppre Niehues',
author_email='lucasboppre@gmail.com',
packages=['simplecrypto'],
url='https://github.com/boppreh/simplecrypto',
license='LICENSE.txt',
description='... | Change homepage to github URL | Change homepage to github URL
| Python | mit | boppreh/simplecrypto | ---
+++
@@ -6,7 +6,7 @@
author='Lucas Boppre Niehues',
author_email='lucasboppre@gmail.com',
packages=['simplecrypto'],
- url='http://pypi.python.org/pypi/simplecrypto/',
+ url='https://github.com/boppreh/simplecrypto',
license='LICENSE.txt',
description='simplecrypto',
long_descri... |
ebe9d80277b2b03a50b0fe69836bf28a13edbbd9 | setup.py | setup.py | #!/usr/bin/env python
# coding=utf8
import os
import sys
from setuptools import setup
if sys.version_info < (2, 7):
tests_require = ['unittest2', 'mock']
test_suite = 'unittest2.collector'
else:
tests_require = ['mock']
test_suite = 'unittest.collector'
def read(fname):
return open(os.path.join... | #!/usr/bin/env python
# coding=utf8
import os
import sys
from setuptools import setup, find_packages
if sys.version_info < (2, 7):
tests_require = ['unittest2', 'mock']
test_suite = 'unittest2.collector'
else:
tests_require = ['mock']
test_suite = 'unittest.collector'
def read(fname):
return op... | Use find_packages to discover packages. | Use find_packages to discover packages.
| Python | mit | karteek/simplekv,fmarczin/simplekv,mbr/simplekv,karteek/simplekv,mbr/simplekv,fmarczin/simplekv | ---
+++
@@ -4,7 +4,7 @@
import os
import sys
-from setuptools import setup
+from setuptools import setup, find_packages
if sys.version_info < (2, 7):
tests_require = ['unittest2', 'mock']
@@ -27,7 +27,7 @@
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/simplekv',
lice... |
69c14597c676236b64398dc3cbe83d42ec4e3a9b | setup.py | setup.py | import os
import sys
from setuptools import setup
INSTALL_REQUIRES = ['requests >=1.0.3', 'boto >=2.1.1', 'six >=1.2.0', 'urllib3 >= 1.0.2']
if sys.version_info < (2, 7, 0):
INSTALL_REQUIRES.append('argparse>=1.1')
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
... | import os
import sys
from setuptools import setup
INSTALL_REQUIRES = ['requests >=1.0.3', 'boto >=2.1.1', 'six >=1.2.0', 'urllib3 >= 1.0.2']
if sys.version_info < (2, 7, 0):
INSTALL_REQUIRES.append('argparse>=1.1')
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
... | Update trove classifiers with Apache License. | Update trove classifiers with Apache License.
| Python | apache-2.0 | tanishgupta1/qds-sdk-py-1,prakharjain09/qds-sdk-py,adeshr/qds-sdk-py,msumit/qds-sdk-py,rohitpruthi95/qds-sdk-py,vrajat/qds-sdk-py,qubole/qds-sdk-py,jainavi/qds-sdk-py,yogesh2021/qds-sdk-py | ---
+++
@@ -25,6 +25,7 @@
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
+ "License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python... |
612b9244560afd0d5eb4d7b1bf27464c4b2946d4 | setup.py | setup.py | from setuptools import setup, find_packages
from os.path import join, dirname
version = 0.1
short_description = "Git cherry pick tracking."
long_description = open(join(dirname(__file__), "README.txt"), "r").read()
setup(name = "git_origin",
version = version,
description = short_description,
long_d... | from setuptools import setup, find_packages
from os.path import join, dirname
version = 0.1
short_description = "Git cherry pick tracking."
long_description = open(join(dirname(__file__), "README.txt"), "r").read()
setup(name = "git_origin",
version = version,
description = short_description,
long_d... | Add missing console_scripts entry point. | Add missing console_scripts entry point.
Signed-off-by: Chris Larson <8cf06b7089d5169434d5def8b2d1c9c9c95f6e71@mvista.com>
| Python | mit | kergoth/git-origin | ---
+++
@@ -24,4 +24,9 @@
"setuptools",
"GitPython",
],
+ entry_points = {
+ "console_scripts": [
+ "git-origin = git_origin.cmd:origin",
+ ],
+ },
) |
888cdf6797690fe202b03ac0fc2ba46d5df3c6d5 | setup.py | setup.py | from setuptools import setup
setup(
name='property-caching',
version='1.0.1',
description='Property caching',
author='Yola',
author_email='engineers@yola.com',
license='MIT (Expat)',
url='https://github.com/yola/property-caching',
packages=['property_caching'],
test_suite='tests'
)
| from setuptools import setup
setup(
name='property-caching',
version='1.0.1',
description='Property caching',
author='Yola',
author_email='engineers@yola.com',
license='MIT (Expat)',
url='https://github.com/yola/property-caching',
packages=['property_caching'],
test_suite='tests',
... | Add classifiers for python 2 and 3 support | Add classifiers for python 2 and 3 support
| Python | mit | yola/property-caching | ---
+++
@@ -9,5 +9,11 @@
license='MIT (Expat)',
url='https://github.com/yola/property-caching',
packages=['property_caching'],
- test_suite='tests'
+ test_suite='tests',
+ classifiers=[
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 3',
+ 'De... |
5bb90727efb62525995caad3b52fd588d8b08298 | pregnancy/urls.py | pregnancy/urls.py | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import contractions.views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'pregnancy.views.home', name='home'),
# url(r'^pregnancy/', include('... | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import contractions.views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'pregnancy.views.home', name='home'),
# url(r'^pregnancy/', include('... | Update url to point / to the contractions app | Update url to point / to the contractions app
| Python | bsd-2-clause | dreinhold/pregnancy,dreinhold/pregnancy,dreinhold/pregnancy | ---
+++
@@ -10,6 +10,7 @@
# Examples:
# url(r'^$', 'pregnancy.views.home', name='home'),
# url(r'^pregnancy/', include('pregnancy.foo.urls')),
+ url(r'^$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^contractions/$', contractions.views.ContractionList.as_view()... |
9fa76b8e9d7fb9309a49d46b9bbd43e9b65418ad | pytest_cookies.py | pytest_cookies.py | # -*- coding: utf-8 -*-
import pytest
def pytest_addoption(parser):
group = parser.getgroup('cookies')
group.addoption(
'--foo',
action='store',
dest='dest_foo',
default=2015,
help='Set the value for the fixture "bar".'
)
parser.addini('HELLO', 'Dummy pytest.i... | # -*- coding: utf-8 -*-
import pytest
from cookiecutter.main import cookiecutter
class Cookies(object):
"""Class to provide convenient access to the cookiecutter API."""
error = None
project = None
def __init__(self, template, output_dir):
self._template = template
self._output_dir ... | Implement cookies fixture along with Helper class | Implement cookies fixture along with Helper class
| Python | mit | hackebrot/pytest-cookies | ---
+++
@@ -1,21 +1,51 @@
# -*- coding: utf-8 -*-
import pytest
+
+from cookiecutter.main import cookiecutter
+
+
+class Cookies(object):
+ """Class to provide convenient access to the cookiecutter API."""
+ error = None
+ project = None
+
+ def __init__(self, template, output_dir):
+ self._tem... |
eec004dd34ffc977e29481c94345e20cae867238 | views.py | views.py | from django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
def warmup(request):
"""
Provides default procedure for handling warmup requests on App Engine.
Just add this view to your main urls.py.
"""
for app in settings.INSTALLED_APPS:
... | from django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
def warmup(request):
"""
Provides default procedure for handling warmup requests on App Engine.
Just add this view to your main urls.py.
"""
for app in settings.INSTALLED_APPS:
... | Expand pre loading on warmup | Expand pre loading on warmup
| Python | bsd-3-clause | adieu/djangoappengine | ---
+++
@@ -8,7 +8,7 @@
Just add this view to your main urls.py.
"""
for app in settings.INSTALLED_APPS:
- for name in ('urls', 'views'):
+ for name in ('urls', 'views', 'models'):
try:
import_module('%s.%s' % (app, name))
except ImportError: |
ba1bfc262e023a01d6e201d48d234640a443ed96 | raven/__init__.py | raven/__init__.py | """
raven
~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
__all__ = ('VERSION', 'Client', 'load')
try:
VERSION = __import__('pkg_resources') \
.get_distribution('raven').version
except Exception, e:
VERSION = 'unknown'
fro... | """
raven
~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
__all__ = ('VERSION', 'Client', 'load')
try:
VERSION = __import__('pkg_resources') \
.get_distribution('raven').version
except Exception, e:
VERSION = 'unknown'
fro... | Use absolute imports, not relative ones. | Use absolute imports, not relative ones. | Python | bsd-3-clause | hzy/raven-python,akheron/raven-python,akalipetis/raven-python,nikolas/raven-python,arthurlogilab/raven-python,inspirehep/raven-python,recht/raven-python,akheron/raven-python,arthurlogilab/raven-python,arthurlogilab/raven-python,lepture/raven-python,percipient/raven-python,collective/mr.poe,Goldmund-Wyldebeast-Wunderlie... | ---
+++
@@ -14,5 +14,5 @@
except Exception, e:
VERSION = 'unknown'
-from base import *
-from conf import *
+from raven.base import *
+from raven.conf import * |
a3b22d074ace7d44ee9c863c56f0c24354bc6a99 | snake/launcher.py | snake/launcher.py |
from .game_manager import GameManager
from .robot_controller import RobotController
from .snake_board import SnakeBoard
from .snake_robot import SnakeRobot
from .snake_beacon import SnakeBeacon
def launch_robot(robot_module, myrobot, board_size=(8,16)):
'''
Creates a robot controller, a board, and sets th... |
from .game_manager import GameManager
from .robot_controller import RobotController
from .snake_board import SnakeBoard
from .snake_robot import SnakeRobot
from .snake_beacon import SnakeBeacon
def launch_robot(robot_module, myrobot, board_size=(8,16)):
'''
Creates a robot controller, a board, and sets th... | Remove the beacon for now | Remove the beacon for now
| Python | mit | virtuald/RobotSnake,virtuald/RobotSnake | ---
+++
@@ -21,7 +21,7 @@
# create the robot
snake_robot = SnakeRobot(controller)
- snake_beacon = SnakeBeacon(controller, snake_robot)
+ #snake_beacon = SnakeBeacon(controller, snake_robot)
# start the robot controller (does not block)
controller.run()
@@ -29,7 +29,7 @@
# ... |
ee0c852d494a0952d51b7f5ddde77ec2b46deca3 | lambdas/update_ecs_service_size.py | lambdas/update_ecs_service_size.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Change the size of an ECS service.
This is used to schedule our service applications: by setting the desired
size to 0/greater-than-0, Amazon will do the work of spinning up or scaling
down the tasks.
The script is triggered by notifications to an SNS topic, in whic... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Change the size of an ECS service.
This is used to schedule our service applications: by setting the desired
size to 0/greater-than-0, Amazon will do the work of spinning up or scaling
down the tasks.
The script is triggered by notifications to an SNS topic, in whic... | Fix the Update ECS Service size Lambda | Fix the Update ECS Service size Lambda
| Python | mit | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | ---
+++
@@ -34,7 +34,7 @@
def main(event, _):
print('Received event: %r' % event)
- message = event['Message']
+ message = event['Records'][0]['Sns']['Message']
message_data = json.loads(message)
change_desired_count( |
dfe84075109620481cac493c1d0dba69d9ca19df | vesper/tests/test_case_mixin.py | vesper/tests/test_case_mixin.py | """
Unit test test case mixin class.
This mixin class is intended for use with a subclass of either
`unittest.TestCase` or `django.test.TestCase`. It includes several
convenience `_assert...` methods.
"""
import vesper.util.numpy_utils as numpy_utils
class TestCaseMixin:
def assert_raises(self, excep... | """
Unit test test case mixin class.
This mixin class is intended for use with a subclass of either
`unittest.TestCase` or `django.test.TestCase`. It includes several
convenience `_assert...` methods.
"""
import vesper.util.numpy_utils as numpy_utils
SHOW_EXCEPTION_MESSAGES = False
class TestCaseMixin:
... | Add method for testing async function errors. | Add method for testing async function errors.
| Python | mit | HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper | ---
+++
@@ -10,21 +10,42 @@
import vesper.util.numpy_utils as numpy_utils
+SHOW_EXCEPTION_MESSAGES = False
+
class TestCaseMixin:
def assert_raises(self, exception_class, function, *args, **kwargs):
- self.assertRaises(exception_class, function, *args, **kwargs)
-
... |
2082a4ba334a14bf95e9ad9deecc2c703e0f1aa5 | rotostitch/__init__.py | rotostitch/__init__.py | import os
import sys
__version__ = "1.0.0"
packageDir = os.path.dirname(__file__)
RESOURCE_DIR = os.path.join(os.path.abspath(packageDir), "resources")
if not os.path.isdir(RESOURCE_DIR):
RESOURCE_DIR = os.path.join(os.path.dirname(sys.argv[0]), "resources")
| import os
import sys
__version__ = "1.1.0"
packageDir = os.path.dirname(__file__)
RESOURCE_DIR = os.path.join(os.path.abspath(packageDir), "resources")
if not os.path.isdir(RESOURCE_DIR):
RESOURCE_DIR = os.path.join(os.path.dirname(sys.argv[0]), "resources")
| Increment version number to 1.1.0 | Increment version number to 1.1.0
| Python | mit | AWFeldick/Rotostitch | ---
+++
@@ -1,7 +1,7 @@
import os
import sys
-__version__ = "1.0.0"
+__version__ = "1.1.0"
packageDir = os.path.dirname(__file__)
RESOURCE_DIR = os.path.join(os.path.abspath(packageDir), "resources") |
33ba6400768b759180d7602c14e6f947d1c8e771 | djangosaml2/templatetags/idplist.py | djangosaml2/templatetags/idplist.py | # Copyright (C) 2011 Yaco Sistemas (http://www.yaco.es)
#
# 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 applic... | # Copyright (C) 2011 Yaco Sistemas (http://www.yaco.es)
#
# 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 applic... | Load the config as late as possible to avoid crashing when the configuration is not ready yet. Also this code is more reentrant | Load the config as late as possible to avoid crashing when the configuration is not ready yet. Also this code is more reentrant
| Python | apache-2.0 | WiserTogether/djangosaml2,sdelements/djangosaml2,kradalby/djangosaml2,kradalby/djangosaml2,WiserTogether/djangosaml2 | ---
+++
@@ -23,10 +23,10 @@
def __init__(self, variable_name):
self.variable_name = variable_name
- self.conf = config_settings_loader()
def render(self, context):
- context[self.variable_name] = self.conf.get_available_idps()
+ conf = config_settings_loader()
+ cont... |
d83ed858dab0991e4829a7f249260ae1f1140b41 | rave/main.py | rave/main.py | import rave.events
import rave.modularity
import rave.backends
import rave.resources
import rave.rendering
def init_game(game):
rave.events.emit('game.init', game)
with game.env:
rave.modularity.load_all()
rave.backends.select_all()
def run_game(game):
running = True
# Stop the eve... | import rave.events
import rave.modularity
import rave.backends
import rave.resources
import rave.rendering
def init_game(game):
rave.modularity.load_all()
rave.events.emit('game.init', game)
with game.env:
rave.backends.select_all()
def run_game(game):
running = True
# Stop the event l... | Load modules in engine context. | core: Load modules in engine context.
| Python | bsd-2-clause | rave-engine/rave | ---
+++
@@ -6,10 +6,10 @@
def init_game(game):
+ rave.modularity.load_all()
rave.events.emit('game.init', game)
with game.env:
- rave.modularity.load_all()
rave.backends.select_all()
|
a37ef5af5a28207d21b11f08990e233a34afa768 | acme/utils/loggers/__init__.py | acme/utils/loggers/__init__.py | # python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | # python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | Add LoggingData annotation to Logger base import so users can type-annotate Logger subclasses properly. | Add LoggingData annotation to Logger base import so users can type-annotate Logger subclasses properly.
PiperOrigin-RevId: 315308368
Change-Id: I608c9f6f5f4b9edbbf504ec321fc4c8e90ed8193
| Python | apache-2.0 | deepmind/acme,deepmind/acme | ---
+++
@@ -18,6 +18,7 @@
from acme.utils.loggers.aggregators import Dispatcher
from acme.utils.loggers.asynchronous import AsyncLogger
from acme.utils.loggers.base import Logger
+from acme.utils.loggers.base import LoggingData
from acme.utils.loggers.base import to_numpy
from acme.utils.loggers.csv import CSVLo... |
7014bfb976524e95b6e13eb44cf62401568bff1a | examples/web_demo/exifutil.py | examples/web_demo/exifutil.py | """
This script handles the skimage exif problem.
"""
from PIL import Image
import numpy as np
ORIENTATIONS = { # used in apply_orientation
2: (Image.FLIP_LEFT_RIGHT,),
3: (Image.ROTATE_180,),
4: (Image.FLIP_TOP_BOTTOM,),
5: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_90),
6: (Image.ROTATE_270,),
7... | """
This script handles the skimage exif problem.
"""
from PIL import Image
import numpy as np
ORIENTATIONS = { # used in apply_orientation
2: (Image.FLIP_LEFT_RIGHT,),
3: (Image.ROTATE_180,),
4: (Image.FLIP_TOP_BOTTOM,),
5: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_90),
6: (Image.ROTATE_270,),
7... | FIX web_demo upload was not processing grayscale correctly | FIX web_demo upload was not processing grayscale correctly
| Python | agpl-3.0 | tackgeun/caffe,CZCV/s-dilation-caffe,longjon/caffe,gnina/gnina,CZCV/s-dilation-caffe,tackgeun/caffe,gnina/gnina,gnina/gnina,gogartom/caffe-textmaps,CZCV/s-dilation-caffe,gogartom/caffe-textmaps,wangg12/caffe,tackgeun/caffe,wangg12/caffe,gnina/gnina,gnina/gnina,gogartom/caffe-textmaps,CZCV/s-dilation-caffe,longjon/caffe... | ---
+++
@@ -23,7 +23,13 @@
if exif is not None and 274 in exif:
orientation = exif[274]
im = apply_orientation(im, orientation)
- return np.asarray(im).astype(np.float32) / 255.
+ img = np.asarray(im).astype(np.float32) / 255.
+ if img.ndim == 2:
+ img = img[:, :, np... |
527c414da01dd40425086253dec2007c54e30675 | send_reminders.py | send_reminders.py | from twilio.rest import TwilioRestClient
import project.utils.reminders
ACCOUNT_SID = "AC6a9746370384b26236aae71013aa35b2"
AUTH_TOKEN = "38b0bcc37788e553978c840929d54aa2"
def send_reminder(text, phone):
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(to=phone, from_="+15713646776", b... | from twilio.rest import TwilioRestClient
import project.utils.reminders
ACCOUNT_SID = "ayylmao"
AUTH_TOKEN = "ayylmao"
def send_reminder(text, phone):
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(to=phone, from_="+15172194225", body=text)
def send_all_reminders():
x = project... | Update API keys and phone number | Update API keys and phone number
| Python | apache-2.0 | tjcsl/mhacksiv | ---
+++
@@ -1,12 +1,12 @@
from twilio.rest import TwilioRestClient
import project.utils.reminders
-ACCOUNT_SID = "AC6a9746370384b26236aae71013aa35b2"
-AUTH_TOKEN = "38b0bcc37788e553978c840929d54aa2"
+ACCOUNT_SID = "ayylmao"
+AUTH_TOKEN = "ayylmao"
def send_reminder(text, phone):
client = TwilioRestClient(... |
e7865a22eb2e7433f3c36cd571aae3ac65436423 | signage/models.py | signage/models.py | from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeFramedModel
from taggit.managers import TaggableManager
@python_2_unicode_compatible
class Slide(TimeFram... | from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeFramedModel
from taggit.managers import TaggableManager
@python_2_unicode_compatible
class Slide(TimeFram... | Order displayed slides by weight | Order displayed slides by weight
| Python | bsd-3-clause | jbittel/django-signage,jbittel/django-signage,jbittel/django-signage | ---
+++
@@ -60,4 +60,4 @@
return reverse('signage:display_update', args=[self.pk])
def get_slides(self):
- return Slide.objects.filter(tags__name__in=self.tags.names()).distinct()
+ return Slide.objects.filter(tags__name__in=self.tags.names()).order_by('weight').distinct() |
cf52a7c83e1479a99e95ab2125958a67febfccf5 | dataviews/__init__.py | dataviews/__init__.py | import sys, os
# Add param submodule to sys.path
cwd = os.path.abspath(os.path.split(__file__)[0])
sys.path.insert(0, os.path.join(cwd, '..', 'param'))
from .views import * # pyflakes:ignore (API import)
from .dataviews import * # pyflakes:ignore (API import)
from .sheetviews import * # pyflakes:ignore (API import)
f... | import sys, os
# Add param submodule to sys.path
cwd = os.path.abspath(os.path.split(__file__)[0])
sys.path.insert(0, os.path.join(cwd, '..', 'param'))
import param
__version__ = param.Version(release=(0,7), fpath=__file__)
from .views import * # pyflakes:ignore (API import)
from .dataviews import * # pyflakes:igno... | Set __version__ using param.Version (commit tagged as 'v0.7') | Set __version__ using param.Version (commit tagged as 'v0.7')
| Python | bsd-3-clause | mjabri/holoviews,basnijholt/holoviews,ioam/holoviews,mjabri/holoviews,ioam/holoviews,vascotenner/holoviews,vascotenner/holoviews,ioam/holoviews,basnijholt/holoviews,basnijholt/holoviews,vascotenner/holoviews,mjabri/holoviews | ---
+++
@@ -3,6 +3,10 @@
# Add param submodule to sys.path
cwd = os.path.abspath(os.path.split(__file__)[0])
sys.path.insert(0, os.path.join(cwd, '..', 'param'))
+
+import param
+
+__version__ = param.Version(release=(0,7), fpath=__file__)
from .views import * # pyflakes:ignore (API import)
from .dataviews imp... |
0236ad9090f7b218fc7515fdc8d919b2fc048a72 | simple_counter.py | simple_counter.py | # Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2008 Google Inc.
#
# 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, ... | Indent only (PEP8) commit of simple counter. | Indent only (PEP8) commit of simple counter.
| Python | apache-2.0 | GoogleCloudPlatform/appengine-sharded-counters-python | ---
+++
@@ -25,24 +25,24 @@
class SimpleCounterShard(ndb.Model):
- """Shards for the counter"""
- count = ndb.IntegerProperty(required=True, default=0)
+ """Shards for the counter"""
+ count = ndb.IntegerProperty(required=True, default=0)
def get_count():
- """Retrieve the value for a given sharded... |
da93d78d141e0e07581b2a00cd6a4fb4058dcf56 | scikits/learn/setup.py | scikits/learn/setup.py | def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('learn',parent_package,top_path)
config.add_subpackage('datasets')
config.add_subpackage('common')
config.add_subpackage('machine')
config.add_subpackage('utils')
r... | def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('learn',parent_package,top_path)
config.add_subpackage('datasets')
config.add_subpackage('machine')
config.add_subpackage('utils')
return config
if __name__ == '__main... | Remove references to deleted submodule common/ | Remove references to deleted submodule common/
From: Fabian Pedregosa <fabian.pedregosa@inria.fr>
git-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@384 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8
| Python | bsd-3-clause | jayflo/scikit-learn,toastedcornflakes/scikit-learn,Aasmi/scikit-learn,kjung/scikit-learn,macks22/scikit-learn,trungnt13/scikit-learn,sgenoud/scikit-learn,ldirer/scikit-learn,aetilley/scikit-learn,elkingtonmcb/scikit-learn,IshankGulati/scikit-learn,zhenv5/scikit-learn,fzalkow/scikit-learn,petosegan/scikit-learn,mojoboss... | ---
+++
@@ -3,7 +3,6 @@
config = Configuration('learn',parent_package,top_path)
config.add_subpackage('datasets')
- config.add_subpackage('common')
config.add_subpackage('machine')
config.add_subpackage('utils')
return config |
6d09970db6a10a156977687612c0d8b65456c559 | mysite/deployment_settings.py | mysite/deployment_settings.py | from settings import *
OHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'
DEBUG=False
ADMINS=[
('Everybody at OpenHatch', 'all@openhatch.org'),
]
INVITE_MODE=False # Suckas, invite codes are disabled everywarez
INVITATIONS_PER_USER=20
TEMPLATE_DEBUG=False
EMAIL_SUBJECT_PREFIX='[Kaboom@OH] '
SEND_BROKEN_LINK_EMAILS=True
MAN... | from settings import *
OHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'
DEBUG=False
ADMINS=[
('Everybody at OpenHatch', 'all@openhatch.org'),
]
INVITE_MODE=False # Suckas, invite codes are disabled everywarez
INVITATIONS_PER_USER=20
TEMPLATE_DEBUG=False
EMAIL_SUBJECT_PREFIX='[Kaboom@OH] '
SEND_BROKEN_LINK_EMAILS=True
MAN... | Remove trailing slash that was causing problems. | Remove trailing slash that was causing problems.
| Python | agpl-3.0 | eeshangarg/oh-mainline,sudheesh001/oh-mainline,willingc/oh-mainline,SnappleCap/oh-mainline,moijes12/oh-mainline,mzdaniel/oh-mainline,SnappleCap/oh-mainline,ehashman/oh-mainline,openhatch/oh-mainline,moijes12/oh-mainline,Changaco/oh-mainline,ojengwa/oh-mainline,vipul-sharma20/oh-mainline,vipul-sharma20/oh-mainline,onceu... | ---
+++
@@ -28,7 +28,7 @@
## Django search via Haystack
HAYSTACK_SITECONF='mysite.haystack_configuration'
HAYSTACK_SEARCH_ENGINE='solr'
-HAYSTACK_SOLR_URL='http://173.230.128.217:8983/solr/'
+HAYSTACK_SOLR_URL='http://173.230.128.217:8983/solr'
try:
from deployment_settings_secret_keys import GOOGLE_ANALYT... |
c3520c1c1802f903af829da5470fa14d1a1d5354 | src/c2w2c.py | src/c2w2c.py |
from models import C2W, LanguageModel, W2C
from util import load_training_data
from keras.models import Model
from keras.layers import TimeDistributed, Input, Activation
N_batch = 50
N_ctx = 10
d_C = 150
d_W = 50
d_Wi = 150
training_data = load_training_data('data/training.txt')
V_C ... | Build the actual C2W2C model | Build the actual C2W2C model | Python | mit | milankinen/c2w2c,milankinen/c2w2c | ---
+++
@@ -1 +1,41 @@
+from models import C2W, LanguageModel, W2C
+from util import load_training_data
+from keras.models import Model
+from keras.layers import TimeDistributed, Input, Activation
+
+
+N_batch = 50
+N_ctx = 10
+d_C = 150
+d_W = 50
+d_Wi = 150
+
+
+training_data = load_trainin... | |
1ef1d7a973ce44943fc59315d1f962ed59f06e33 | seacucumber/backend.py | seacucumber/backend.py | """
This module contains the SESBackend class, which is what you'll want to set in
your settings.py::
EMAIL_BACKEND = 'seacucumber.backend.SESBackend'
"""
from django.core.mail.backends.base import BaseEmailBackend
from seacucumber.tasks import SendEmailTask
class SESBackend(BaseEmailBackend):
"""
A Djang... | """
This module contains the SESBackend class, which is what you'll want to set in
your settings.py::
EMAIL_BACKEND = 'seacucumber.backend.SESBackend'
"""
from django.core.mail.backends.base import BaseEmailBackend
from seacucumber.tasks import SendEmailTask
class SESBackend(BaseEmailBackend):
"""
A Djan... | Patch to send mails with UTF8 encoding | Patch to send mails with UTF8 encoding
Just a temp fix
| Python | mit | makielab/sea-cucumber,duointeractive/sea-cucumber | ---
+++
@@ -7,6 +7,7 @@
from django.core.mail.backends.base import BaseEmailBackend
from seacucumber.tasks import SendEmailTask
+
class SESBackend(BaseEmailBackend):
"""
A Django Email backend that uses Amazon's Simple Email Service.
@@ -15,7 +16,7 @@
"""
Sends one or more EmailMessag... |
a9b56fe98a0df71881c41a2524bdb5abc4b0de50 | services/imu-logger.py | services/imu-logger.py | #!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
import time
DELAY = 1 # in seconds
sense = SenseHat()
client = MongoClient("mongodb://10.0.1.25:27017")
db = client.g2x
while True:
orientation = sense.get_orientation_degrees()
print(orientation)
acceleration = sen... | #!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
from datetime import datetime
sense = SenseHat()
client = MongoClient("mongodb://10.0.1.25:27017")
db = client.g2x
last_time = datetime.utcnow()
sample_count = 0
while True:
current_time = datetime.utcnow()
elapsed_time =... | Read samples faster but log only once a second | Read samples faster but log only once a second
| Python | bsd-3-clause | gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2 | ---
+++
@@ -2,37 +2,59 @@
from sense_hat import SenseHat
from pymongo import MongoClient
-import time
+from datetime import datetime
-
-DELAY = 1 # in seconds
sense = SenseHat()
client = MongoClient("mongodb://10.0.1.25:27017")
db = client.g2x
+last_time = datetime.utcnow()
+sample_count = 0
+
while T... |
b7b1ae11378b37350a3fcd9d989be58f655ec986 | calexicon/helpers.py | calexicon/helpers.py | from datetime import date as vanilla_date
def ordinal(n):
suffix = "th"
if n % 10 == 1:
suffix = "st"
if n % 10 == 2:
suffix = "nd"
if n % 10 == 3:
suffix = "rd"
if 10 < n % 100 < 20:
suffix = "th"
return "%d%s" % (n, suffix)
def month_string(n):
d = vanil... | from datetime import date as vanilla_date
def ordinal(n):
suffix = "th"
if n % 10 in [1, 2, 3]:
suffix = [None, 'st', 'nd', 'rd'][n % 10]
if 10 < n % 100 < 20:
suffix = "th"
return "%d%s" % (n, suffix)
def month_string(n):
d = vanilla_date(1995, n, 1)
return d.strftime("%B")
| Make this part of the function simpler. | Make this part of the function simpler.
| Python | apache-2.0 | jwg4/qual,jwg4/calexicon | ---
+++
@@ -3,12 +3,8 @@
def ordinal(n):
suffix = "th"
- if n % 10 == 1:
- suffix = "st"
- if n % 10 == 2:
- suffix = "nd"
- if n % 10 == 3:
- suffix = "rd"
+ if n % 10 in [1, 2, 3]:
+ suffix = [None, 'st', 'nd', 'rd'][n % 10]
if 10 < n % 100 < 20:
suffix ... |
8be4829832bab01b0508c59114f924c5945878b1 | executor/opensubmitexec/compiler.py | executor/opensubmitexec/compiler.py | '''
Functions dealing with the compilation of code.
'''
from .exceptions import ValidatorBrokenException
import logging
logger = logging.getLogger('opensubmitexec')
GCC = ['gcc', '-o', '{output}', '{inputs}']
GPP = ['g++', '-o', '{output}', '{inputs}']
def compiler_cmdline(compiler=GCC, output=None, inputs=None):
... | '''
Functions dealing with the compilation of code.
'''
from .exceptions import ValidatorBrokenException
import logging
logger = logging.getLogger('opensubmitexec')
GCC = ['gcc', '-o', '{output}', '{inputs}']
GPP = ['g++', '-pthread', '-o', '{output}', '{inputs}']
def compiler_cmdline(compiler=GCC, output=None, in... | Fix CPP problem on Linux | Fix CPP problem on Linux
| Python | agpl-3.0 | troeger/opensubmit,troeger/opensubmit,troeger/opensubmit,troeger/opensubmit,troeger/opensubmit | ---
+++
@@ -8,7 +8,7 @@
logger = logging.getLogger('opensubmitexec')
GCC = ['gcc', '-o', '{output}', '{inputs}']
-GPP = ['g++', '-o', '{output}', '{inputs}']
+GPP = ['g++', '-pthread', '-o', '{output}', '{inputs}']
def compiler_cmdline(compiler=GCC, output=None, inputs=None): |
4c987cd45080cb6a1a449fa708a567c40ba8c94f | examples/pax_mininet_node.py | examples/pax_mininet_node.py | # coding: latin-1
"""
pax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node.
"""
from mininet.node import Node
from mininet.log import info, warn
class PaxNode( Node ):
"PaxNode: A node which allows Pax to behave as the sole packet hander on that node."
def __in... | # coding: latin-1
"""
pax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node.
"""
from mininet.node import Node
from mininet.log import info, warn
class PaxNode( Node ):
"PaxNode: A node which allows Pax to behave as the sole packet hander on that node."
def __in... | Add comment explaining why we disable ip_forward | Add comment explaining why we disable ip_forward
| Python | apache-2.0 | niksu/pax,TMVector/pax,niksu/pax,niksu/pax,TMVector/pax | ---
+++
@@ -22,7 +22,9 @@
for intf in self.intfList():
self.cmd("iptables -A INPUT -p tcp -i %s -j DROP" % intf.name)
- # Disable ip_forward because otherwise this still happens, even with the above iptables rules
+ # Disable ip_forward because otherwise, even with the above ipta... |
3252a1e0f5b2991179d3fabe66f34a19f7cd85c9 | src/DecodeTest.py | src/DecodeTest.py | import unittest
from Decode import Decoder
import Frames
class TestDecoder(unittest.TestCase):
"""
"""
def setUp(self):
self.decoder = Decoder()
def test_decoder_get_frame_class(self):
command = 'SEND'
self.assertEquals(self.decoder.get_frame_class(command), Frames.SEND)
d... | import unittest
from Decode import Decoder
import Frames
class TestDecoder(unittest.TestCase):
"""
"""
def setUp(self):
self.decoder = Decoder()
def test_decoder_get_frame_class(self):
command = 'SEND'
self.assertEquals(self.decoder.get_frame_class(command), Frames.SEND)
d... | Send and Connect frame tests | Send and Connect frame tests
| Python | mit | phan91/STOMP_agilis | ---
+++
@@ -21,11 +21,18 @@
msg = "CONNECT\naccept-version:1.2\nhost:localhost\n\n\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
+ def test_decoder_decode_connect_missing_req_header(self):
+ msg = "CONNECT\nhost:localhost\n\n\x00"
+ self.assertRaise... |
fb0b129216bd98a90cdee623157df5c7e4a742fb | blinkenlights/blinkenlights.py | blinkenlights/blinkenlights.py | #!/usr/bin/python3
import asyncio, signal, os
from blink import blink
import ipc.coordinator
loop = asyncio.get_event_loop()
def my_interrupt_handler():
print('Stopping')
for task in asyncio.Task.all_tasks():
task.cancel()
loop.stop()
loop.add_signal_handler(signal.SIGINT, my_interrupt_handle... | #!/usr/bin/python3
import asyncio, signal, os
from blink import blink
import ipc.coordinator
loop = asyncio.get_event_loop()
def my_interrupt_handler():
print('Stopping')
for task in asyncio.Task.all_tasks():
task.cancel()
loop.stop()
loop.add_signal_handler(signal.SIGINT, my_interrupt_handle... | Clean up socket file on exiting | Clean up socket file on exiting
Change-Id: I34391c64408b5a35386913bd7be01d81feed61b6
| Python | mit | fayoh/KSP-Control | ---
+++
@@ -25,4 +25,5 @@
print('Tasks has been canceled')
finally:
ipc.coordinator.stop()
+ os.remove('/tmp/coord.socket')
loop.close() |
3ccaf18243232d756ed139d9f84a6b3903af15f7 | exploratory_analysis/author_scan.py | exploratory_analysis/author_scan.py | import os
from utils import Reader
import code
import sys
author_dict = dict()
def extract_authors(tweets):
# code.interact(local=dict(globals(), **locals()))
for t in tweets:
if t.is_post():
actor = t.actor()
create_key(actor['id'])
increment_author(actor, t.is_p... | import os
from utils import Reader
import code
import sys
def extract_authors(tweets):
for t in tweets:
if t.is_post():
actor = t.actor()
print '"{}","{}","{}","{}",{},{}'.format(actor['id'],
actor['link'],
... | Print everything out in csv and use tableau to do calculation | Print everything out in csv and use tableau to do calculation
| Python | apache-2.0 | chuajiesheng/twitter-sentiment-analysis | ---
+++
@@ -3,51 +3,27 @@
import code
import sys
-author_dict = dict()
-
def extract_authors(tweets):
- # code.interact(local=dict(globals(), **locals()))
-
for t in tweets:
if t.is_post():
actor = t.actor()
- create_key(actor['id'])
- increment_author(actor,... |
9d651a1cdb92d7d8ba039fce97a11de085b54990 | polymorphic/formsets/utils.py | polymorphic/formsets/utils.py | """
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
dest += media
else:
dest.add_css(media._css)
dest.add... | """
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
combined = dest + media
dest._css = combined._css
dest._j... | Fix the add_media() hack for Django 2.0 | Fix the add_media() hack for Django 2.0
| Python | bsd-3-clause | chrisglass/django_polymorphic,chrisglass/django_polymorphic | ---
+++
@@ -11,7 +11,9 @@
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
- dest += media
+ combined = dest + media
+ dest._css = combined._css
+ dest._js = combined._js
else:
dest.add_css(media._css)
dest.add_js(media._js) |
94e3572a4049b0eb0ff0d762a3bce5248a5bd507 | src/sas/sasgui/perspectives/file_converter/file_converter.py | src/sas/sasgui/perspectives/file_converter/file_converter.py | """
File Converter Plugin
"""
import logging
from sas.sasgui.guiframe.plugin_base import PluginBase
from sas.sasgui.perspectives.file_converter.converter_panel import ConverterWindow
logger = logging.getLogger(__name__)
class Plugin(PluginBase):
"""
This class defines the interface for a Plugin class
for... | """
File Converter Plugin
"""
import logging
from sas.sasgui.guiframe.plugin_base import PluginBase
from sas.sasgui.perspectives.file_converter.converter_panel import ConverterWindow
logger = logging.getLogger(__name__)
class Plugin(PluginBase):
"""
This class defines the interface for a Plugin class
for... | Update file converter tooltip in tools menu | Update file converter tooltip in tools menu
| Python | bsd-3-clause | SasView/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,SasView/sasview,SasView/sasview,lewisodriscoll/sasview,lewisodriscoll/sasview,SasView/sasview,lewisodriscoll/sasview,lewisodriscoll/sasview | ---
+++
@@ -24,7 +24,7 @@
"""
Returns a set of menu entries
"""
- help_txt = "Convert single column ASCII data to CanSAS format"
+ help_txt = "Convert ASCII or BSL/OTOKO data to CanSAS or NXcanSAS formats"
return [("File Converter", help_txt, self.on_file_converter)]
... |
4712e870bec7c678f88af3d7b54fcf7c8b040795 | salt/modules/http.py | salt/modules/http.py | # -*- coding: utf-8 -*-
'''
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.
'''
from __future__ import absolute_import
# Import salt libs
import salt.utils.http
def query(url, **kwargs):
'''
Query a resource, and decode the return dat... | # -*- coding: utf-8 -*-
'''
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.
'''
from __future__ import absolute_import
# Import salt libs
import salt.utils.http
def query(url, **kwargs):
'''
Query a resource, and decode the return dat... | Allow execution module to update_ca_bundle | Allow execution module to update_ca_bundle
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | ---
+++
@@ -24,3 +24,45 @@
data='<xml>somecontent</xml>'
'''
return salt.utils.http.query(url=url, opts=__opts__, **kwargs)
+
+
+def update_ca_bundle(target=None, source=None, merge_files=None):
+ '''
+ Update the local CA bundle file from a URL
+
+ CLI Example:
+
+ .. code-block:: ... |
edd534103ca404bdeadf3225ea381acc8c555ced | polyaxon/polyaxon/config_settings/rest.py | polyaxon/polyaxon/config_settings/rest.py | REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
# 'djangorestframework_camel_case.render.CamelCaseJSONRenderer', # Any other renders,
'rest_framework.renderers.JSONRenderer',
# 'rest_framework.renderers.BrowsableAPIRenderer',
),
# 'DEFAULT_PARSER_CLASSES': (
# 'djangorestf... | REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
# 'djangorestframework_camel_case.render.CamelCaseJSONRenderer', # Any other renders,
'rest_framework.renderers.JSONRenderer',
# 'rest_framework.renderers.BrowsableAPIRenderer',
),
# 'DEFAULT_PARSER_CLASSES': (
# 'djangorestf... | Use 20 as default page size | Use 20 as default page size
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | ---
+++
@@ -30,5 +30,5 @@
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
- 'PAGE_SIZE': 30
+ 'PAGE_SIZE': 20
} |
dadbcf91eab36b67ba9f0db77076651c04d1e85d | packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py | packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py | # coding=utf8
"""
Test that C++ supports char8_t correctly.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class CxxChar8_tTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)... | # coding=utf8
"""
Test that C++ supports char8_t correctly.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class CxxChar8_tTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)... | Update test so it matches the Windows output | [test] Update test so it matches the Windows output
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@369595 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | apache-2.0 | llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb | ---
+++
@@ -31,10 +31,10 @@
self.runCmd("run", RUN_SUCCEEDED)
self.expect(
- "frame variable a", substrs=["(char8_t) ::a = 0x61 u8'a'"])
+ "frame variable a", substrs=["(char8_t)", "0x61 u8'a'"])
self.expect(
- "frame variable ab", substrs=['(const char8... |
25e5b38b09a21cd6e6fbf4ba141bc35bb34cb77e | Core/views.py | Core/views.py | from django.shortcuts import render
# Create your views here.
| from django.http import HttpResponse, HttpResponseNotFound, Http404
from django.shortcuts import render, redirect
from django.middleware.csrf import get_token
from models import *
class view():
request = ''
template = ''
isSecuredArea = True
isUserAuthenticated = False
#Normal Overridable methods
@abstractme... | Add core view hangler class | Add core view hangler class
| Python | mit | Tomcuzz/OctaHomeAutomation,Tomcuzz/OctaHomeAutomation,Tomcuzz/OctaHomeAutomation,Tomcuzz/OctaHomeAutomation | ---
+++
@@ -1,3 +1,87 @@
-from django.shortcuts import render
+from django.http import HttpResponse, HttpResponseNotFound, Http404
+from django.shortcuts import render, redirect
+from django.middleware.csrf import get_token
+from models import *
-# Create your views here.
+class view():
+ request = ''
+ template = ... |
9f9357bc46f813cd8a26a5f14bba5364aa4a4c10 | rx/core/operators/contains.py | rx/core/operators/contains.py | from typing import Callable, Optional, TypeVar
from rx import operators as ops
from rx.core import Observable, pipe, typing
from rx.internal.basic import default_comparer
_T = TypeVar("_T")
def contains_(
value: _T, comparer: Optional[typing.Comparer[_T]] = None
) -> Callable[[Observable[_T]], Observable[bool]]... | from typing import Callable, Optional, TypeVar
from rx import operators as ops
from rx.core import Observable, pipe, typing
from rx.internal.basic import default_comparer
_T = TypeVar("_T")
def contains_(
value: _T, comparer: Optional[typing.Comparer[_T]] = None
) -> Callable[[Observable[_T]], Observable[bool]]... | Use typed function instead of lambda | Use typed function instead of lambda
| Python | mit | ReactiveX/RxPY,ReactiveX/RxPY | ---
+++
@@ -12,7 +12,10 @@
) -> Callable[[Observable[_T]], Observable[bool]]:
comparer_ = comparer or default_comparer
- filtering = ops.filter(lambda v: comparer_(v, value))
+ def predicate(v: _T) -> bool:
+ return comparer_(v, value)
+
+ filtering = ops.filter(predicate)
something = ops... |
2883d803609554e38f96f920f1ef41b54b6ec4c2 | fabfile.py | fabfile.py | import os
from fabric.api import local, settings, abort, run, cd, env, put, sudo
from fabric.contrib.console import confirm
import time
DEPLOY_WAIT_TIME = 15
timestamp="release-%s" % int(time.time() * 1000)
env.user = 'deploy' # Special group with limited sudo
env.hosts = ['104.236.224.252']
code_dir = '/home/liz... | import os
from fabric.api import local, settings, abort, run, cd, env, put, sudo
from fabric.contrib.console import confirm
import time
DEPLOY_WAIT_TIME = 15
timestamp="release-%s" % int(time.time() * 1000)
env.user = 'deploy' # Special group with limited sudo
env.hosts = ['104.236.224.252']
code_dir = '/home/liz... | Remove the noise default broken image | Remove the noise default broken image
| Python | mit | UCDavisLibrary/scribeAPI,UCDavisLibrary/scribeAPI,UCDavisLibrary/scribeAPI,UCDavisLibrary/scribeAPI,UCDavisLibrary/scribeAPI | ---
+++
@@ -25,7 +25,7 @@
stop_host()
time.sleep(DEPLOY_WAIT_TIME) # Wait for the process to die
- start_shot()
+ start_host()
print "Done deploying"
|
86c106fc95946e4558fabfae57bbd039b248a70c | mindbender/maya/plugins/validate_single_shape.py | mindbender/maya/plugins/validate_single_shape.py | import pyblish.api
class ValidateMindbenderSingleShape(pyblish.api.InstancePlugin):
"""One mesh per transform"""
label = "Validate Single Shape"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
active = False
optional = True
families = [
"mindbender.model",
"mindbender.... | import pyblish.api
class ValidateMindbenderSingleShape(pyblish.api.InstancePlugin):
"""Transforms with a mesh must ever only contain a single mesh
This ensures models only contain a single shape node.
"""
label = "Validate Single Shape"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
... | Repair validate single shape validator | Repair validate single shape validator
| Python | mit | mindbender-studio/core,MoonShineVFX/core,getavalon/core,MoonShineVFX/core,mindbender-studio/core,getavalon/core | ---
+++
@@ -2,41 +2,47 @@
class ValidateMindbenderSingleShape(pyblish.api.InstancePlugin):
- """One mesh per transform"""
+ """Transforms with a mesh must ever only contain a single mesh
+
+ This ensures models only contain a single shape node.
+
+ """
label = "Validate Single Shape"
orde... |
d57e4993ece29da34c370a96732c820798c5048b | fake-service/features/environment.py | fake-service/features/environment.py | #
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pixelated is distrib... | #
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pixelated is distrib... | Revert "increasing webdriver timeout on fake-service" | Revert "increasing webdriver timeout on fake-service"
This reverts commit a39a4b40a947db655c84af6eb62d5870cfd8b32c.
| Python | agpl-3.0 | alabeduarte/pixelated-user-agent,phazel/pixelated-user-agent,pixelated-project/pixelated-user-agent,sw00/pixelated-user-agent,SamuelToh/pixelated-user-agent,SamuelToh/pixelated-user-agent,PuZZleDucK/pixelated-user-agent,sw00/pixelated-user-agent,SamuelToh/pixelated-user-agent,phazel/pixelated-user-agent,pixelated/pixel... | ---
+++
@@ -20,8 +20,8 @@
#context.browser = webdriver.Firefox()
context.browser = webdriver.PhantomJS()
context.browser.set_window_size(1280, 1024)
- context.browser.implicitly_wait(10)
- context.browser.set_page_load_timeout(120) # wait for data
+ context.browser.implicitly_wait(5)
+ cont... |
e994aa4c4389177aedca8192a41d27bdbb81458e | tests/conftest.py | tests/conftest.py | from distutils import dir_util
import pytest
import os
@pytest.fixture(scope="class")
def datadir(tmpdir_factory, request):
"""
Fixture responsible for searching a folder with the same name of test
module and, if available, moving all contents to a temporary directory so
tests can use them freely.
... | from distutils import dir_util
import pytest
import os
@pytest.fixture(scope="function")
def datadir(tmpdir_factory, request):
"""
Fixture responsible for searching a folder with the same name of test
module and, if available, moving all contents to a temporary directory so
tests can use them freely.
... | Change scope of datadir fixture to function-level | Change scope of datadir fixture to function-level
| Python | mit | ZedThree/fort_depend.py,ZedThree/fort_depend.py | ---
+++
@@ -3,7 +3,7 @@
import os
-@pytest.fixture(scope="class")
+@pytest.fixture(scope="function")
def datadir(tmpdir_factory, request):
"""
Fixture responsible for searching a folder with the same name of test |
2e0585a59e7c3c60b8bf7e0a8d5e377b7f2f9cd5 | grammar/entities/adjectives/deff.py | grammar/entities/adjectives/deff.py | from pyparsing import *
from ...constants.math.deff import NUM, FULLNUM
from ...constants.zones.deff import TOP, BOTTOM
from ...constants.verbs.deff import *
from ...mana.deff import color
from ...types.deff import nontype, supertype
from ...functions.deff import delimitedListAnd, delimitedListOr
from decl import *
... | from pyparsing import *
from ...constants.math.deff import NUM, FULLNUM
from ...constants.zones.deff import TOP, BOTTOM
from ...constants.verbs.deff import *
from ...mana.deff import color
from ...types.deff import nontype, supertype
from ...functions.deff import delimitedListAnd, delimitedListOr
from decl import *
... | Add commentary explaining and/or lists | Add commentary explaining and/or lists
| Python | mit | jrgdiz/cardwalker,jrgdiz/cardwalker | ---
+++
@@ -37,7 +37,21 @@
| haunted
)
+# 'and' captures both 'legendary creature' (juxtaposed) and 'black and red' (joined)
+
+# 'or' will capture explicit disjunctions 'black or red'
+# but since it will come after the ^, not juxtapositions (taken by 'and')
+
+# so the 'one or more' allows 'legendary black or ... |
400027592a131872da5754306ee5e0ec2eba61cf | tests/test_err.py | tests/test_err.py | # Testing use of cpl_errs
import pytest
import rasterio
from rasterio.errors import RasterioIOError
def test_io_error(tmpdir):
with pytest.raises(RasterioIOError) as exc_info:
rasterio.open(str(tmpdir.join('foo.tif')))
msg, = exc_info.value.args
assert msg.startswith("'{0}'".format(tmpdir.join('... | # Testing use of cpl_errs
import pytest
import rasterio
from rasterio.errors import RasterioIOError
def test_io_error(tmpdir):
"""RasterioIOError is raised when a disk file can't be opened.
Newlines are removed from GDAL error messages."""
with pytest.raises(RasterioIOError) as exc_info:
rasteri... | Check msg in a way that passes for all GDAL versions | Check msg in a way that passes for all GDAL versions
| Python | bsd-3-clause | kapadia/rasterio,brendan-ward/rasterio,kapadia/rasterio,kapadia/rasterio,brendan-ward/rasterio,brendan-ward/rasterio | ---
+++
@@ -7,12 +7,12 @@
def test_io_error(tmpdir):
+ """RasterioIOError is raised when a disk file can't be opened.
+ Newlines are removed from GDAL error messages."""
with pytest.raises(RasterioIOError) as exc_info:
rasterio.open(str(tmpdir.join('foo.tif')))
msg, = exc_info.value.args... |
1bd57b89cb0deed5081540e5b29f7531215fa121 | polyaxon_client/transport/socket_transport.py | polyaxon_client/transport/socket_transport.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
webs = websock... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import six
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
web... | Check if string before decoding | Check if string before decoding
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | ---
+++
@@ -3,6 +3,7 @@
import json
+import six
import websocket
from polyaxon_client.logger import logger
@@ -26,7 +27,9 @@
def _on_message(self, message_handler, message):
if message_handler and message:
- message_handler(json.loads(message.decode('utf-8')))
+ if not i... |
2717a35a78f5982f96d57e258dfedd308cb6ffa8 | hoomd/typeparam.py | hoomd/typeparam.py | from hoomd.parameterdicts import AttachedTypeParameterDict
class TypeParameter:
def __init__(self, name, type_kind, param_dict):
self.name = name
self.type_kind = type_kind
self.param_dict = param_dict
def __getitem__(self, key):
return self.param_dict[key]
def __setitem_... | from hoomd.parameterdicts import AttachedTypeParameterDict
class TypeParameter:
def __init__(self, name, type_kind, param_dict):
self.name = name
self.type_kind = type_kind
self.param_dict = param_dict
def __getitem__(self, key):
return self.param_dict[key]
def __setitem_... | Add keys iterator for ``TypeParameter`` | Add keys iterator for ``TypeParameter``
| Python | bsd-3-clause | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | ---
+++
@@ -35,3 +35,6 @@
def to_dict(self):
return self.param_dict.to_dict()
+
+ def keys(self):
+ yield from self.param_dict.keys() |
fcb80afe4703c7a031778ef573a3b839484d8c24 | mpld3/test_plots/test_ticklabels.py | mpld3/test_plots/test_ticklabels.py | """Plot to test date axis"""
import matplotlib.pyplot as plt
import matplotlib
import mpld3
def create_plot():
fig, ax = plt.subplots()
ax.plot([2000, 2050], [1, 2])
ax.set_title('Tick label test', size=14)
return fig
def test_date():
fig = create_plot()
_ = mpld3.fig_to_html(fig)
plt.cl... | """
Plot to test date axis
TODO (@vladh): This test is misleading and needs to be updated. It should test
dates, but it only plots numbers in [2000, 2050], which will of course get
thousands separators automatically added.
"""
import matplotlib.pyplot as plt
import matplotlib
import mpld3
def create_plot():
fig,... | Add note for misleading test | Add note for misleading test
| Python | bsd-3-clause | jakevdp/mpld3,mpld3/mpld3,mpld3/mpld3,jakevdp/mpld3 | ---
+++
@@ -1,4 +1,10 @@
-"""Plot to test date axis"""
+"""
+Plot to test date axis
+
+TODO (@vladh): This test is misleading and needs to be updated. It should test
+dates, but it only plots numbers in [2000, 2050], which will of course get
+thousands separators automatically added.
+"""
import matplotlib.pyplot as... |
398937e4ca759de8e1f88db7245280c72eddb88d | devicehive/transports/base_transport.py | devicehive/transports/base_transport.py | class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self._name = name
self._data_format = data_format_class(**data_format_options)
self._data_type = self._data_format.... | class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self.name = name
self._data_format = data_format_class(**data_format_options)
self._data_type = self._data_format.d... | Set transport name as public | Set transport name as public
| Python | apache-2.0 | devicehive/devicehive-python | ---
+++
@@ -3,7 +3,7 @@
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
- self._name = name
+ self.name = name
self._data_format = data_format_class(**data_format_options)
self._data_type = self._data_format.dat... |
d2250ac74b0797d1662c054d2357573578caa251 | core/tasks.py | core/tasks.py | import os
import gzip
import urllib.request
from celery import shared_task
from django.core.mail import EmailMessage
from celery.task import periodic_task
from celery.schedules import crontab
@shared_task(name='deliver_email')
def deliver_email(subject=None, body=None, recipients=None):
#print("Entering core.task... | import os
import gzip
import urllib.request
from celery import shared_task
from django.core.mail import EmailMessage
from celery.task import periodic_task
from celery.schedules import crontab
@shared_task(name='deliver_email')
def deliver_email(subject=None, body=None, recipients=None):
if recipients:
f... | Clean up code and remove print statements | Clean up code and remove print statements
| Python | mit | LindaTNguyen/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,gdit-cnd/RAPID,gdit-cnd/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,LindaTNguyen/RAPID | ---
+++
@@ -9,18 +9,18 @@
@shared_task(name='deliver_email')
def deliver_email(subject=None, body=None, recipients=None):
- #print("Entering core.tasks.deliver_email for ...", recipients)
if recipients:
for recipient in recipients:
- #print("sending email to recipient: ", recipient... |
116432001ca2b8eb1716add4455dfb1e2562f29a | nodeconductor/quotas/admin.py | nodeconductor/quotas/admin.py | from django.contrib import admin
from django.contrib.contenttypes import models as ct_models, generic
from nodeconductor.quotas import models, utils
class QuotaScopeClassListFilter(admin.SimpleListFilter):
# Human-readable title
title = 'Scope class'
# Parameter for the filter that will be used in the U... | from django.contrib import admin
from django.contrib.contenttypes import models as ct_models, generic
from nodeconductor.quotas import models, utils
class QuotaScopeClassListFilter(admin.SimpleListFilter):
# Human-readable title
title = 'Scope class'
# Parameter for the filter that will be used in the U... | Change quota inline display style (nc-417) | Change quota inline display style (nc-417)
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | ---
+++
@@ -27,7 +27,7 @@
list_filter = ['name', QuotaScopeClassListFilter]
-class QuotaInline(generic.GenericStackedInline):
+class QuotaInline(generic.GenericTabularInline):
model = models.Quota
fields = ('name', 'limit', 'usage')
readonly_fields = ('name',) |
96aa6271a4dab8c4e222c4161ab9ad06472b4f19 | orges/test/integration/test_main.py | orges/test/integration/test_main.py | from __future__ import division, print_function, with_statement
from nose.tools import eq_
from orges.main import optimize
from orges.optimizer.gridsearch import GridSearchOptimizer
from orges.test.util.one_param_sleep_and_negate_f import f
def test_optimize_running_too_long_aborts():
optimizer = GridSearchOpti... | from __future__ import division, print_function, with_statement
from nose.tools import eq_
from orges.main import optimize
from orges.optimizer.gridsearch import GridSearchOptimizer
from orges.test.util.one_param_sleep_and_negate_f import f
def test_optimize_running_too_long_aborts():
optimizer = GridSearchOpti... | Fix test for optimize method | Fix test for optimize method
| Python | bsd-3-clause | cigroup-ol/metaopt,cigroup-ol/metaopt,cigroup-ol/metaopt | ---
+++
@@ -9,11 +9,12 @@
def test_optimize_running_too_long_aborts():
optimizer = GridSearchOptimizer()
- val = optimize(f, timeout=1, optimizer=optimizer)
+ result = optimize(f, timeout=1, optimizer=optimizer)
# f(a=0) is 0, f(a=1) is -1. Because of the timeout we never see a=1, hence
# we... |
7f83888c957b892e6cc9d2e92f49a2737a9eabfe | logstash_handler/__init__.py | logstash_handler/__init__.py | from logging.handlers import SocketHandler
import ssl
class LogstashHandler(SocketHandler):
"""
Sends output to an optionally encrypted streaming logstash TCP listener.
"""
def __init__(self, host, port, keyfile=None, certfile=None, ssl=True):
SocketHandler.__init__(self, host, port)
self.keyfile = ke... | from logging.handlers import SocketHandler
import ssl
class LogstashHandler(SocketHandler):
"""
Sends output to an optionally encrypted streaming logstash TCP listener.
"""
def __init__(self, host, port, keyfile=None, certfile=None, ca_certs=None, ssl=True):
SocketHandler.__init__(self, host, port)
se... | Add support for CA certificates | Add support for CA certificates
better SSL support | Python | mit | klynch/python-logstash-handler | ---
+++
@@ -6,17 +6,18 @@
Sends output to an optionally encrypted streaming logstash TCP listener.
"""
- def __init__(self, host, port, keyfile=None, certfile=None, ssl=True):
+ def __init__(self, host, port, keyfile=None, certfile=None, ca_certs=None, ssl=True):
SocketHandler.__init__(self, host, port... |
09fa1e01c6de9dffc99c7726607d64c843b564ba | osgtest/tests/test_53_gums.py | osgtest/tests/test_53_gums.py | import os
import pwd
import unittest
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest
class TestGUMS(osgunittest.OSGTestCase):
def test_01_map_user(self):
core.skip_ok_unless_installed('gums... | import os
import pwd
import unittest
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest
class TestGUMS(osgunittest.OSGTestCase):
def test_01_map_user(self):
core.skip_ok_unless_installed('gums... | Revert accidental gums test change from previous commit. | Revert accidental gums test change from previous commit.
git-svn-id: 884a03e47e2adb735d896e55bb5ad6bc3421ba19@17355 4e558342-562e-0410-864c-e07659590f8c
| Python | apache-2.0 | efajardo/osg-test,efajardo/osg-test | ---
+++
@@ -16,5 +16,5 @@
pwd_entry = pwd.getpwnam(core.options.username)
cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
user_dn, _ = core.certificate_info(cert_path)
- command = ('gums-host', 'mapUser', user_dn)
+ command = ('gums', 'mapUser', '--serv',... |
256a86b9cfbf2f78fc913b87997dd89673d177c5 | custom/icds_reports/migrations/0070_ccsrecordmonthly_closed.py | custom/icds_reports/migrations/0070_ccsrecordmonthly_closed.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-11 14:35
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
from corehq.sql_db.operations import RawSQLMigration
from custom.icds_reports.utils.migrations import get_view_migrations
mi... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-11 14:35
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
from corehq.sql_db.operations import RawSQLMigration
from custom.icds_reports.utils.migrations import get_view_migrations
mi... | Remove adding field to View model | Remove adding field to View model
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | ---
+++
@@ -17,10 +17,5 @@
]
operations = [
- migrations.AddField(
- model_name='CcsRecordMonthlyView',
- name='open_in_month',
- field=models.SmallIntegerField(blank=True, null=True),
- ),
]
operations.extend(get_view_migrations()) |
49c00236569d48f651bd8f2226907d5c784cbe77 | json262/json262.py | json262/json262.py | # -*- coding: utf-8 -*- | # -*- coding: utf-8 -*-
"""
Serialize data to/from JSON
Inspired by https://github.com/django/django/blob/master/django/core/serializers/json.py
"""
# Avoid shadowing the standard library json module
from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
import decimal
import ... | Bring in encoder from webhooks. | Bring in encoder from webhooks.
| Python | bsd-3-clause | audreyr/standardjson,audreyr/standardjson | ---
+++
@@ -1 +1,42 @@
# -*- coding: utf-8 -*-
+
+"""
+Serialize data to/from JSON
+Inspired by https://github.com/django/django/blob/master/django/core/serializers/json.py
+"""
+
+# Avoid shadowing the standard library json module
+from __future__ import absolute_import
+from __future__ import unicode_literals
+
+i... |
94b716142a575e73d906f332fda84d68b549d5cd | trove/tests/unittests/util/util.py | trove/tests/unittests/util/util.py | # Copyright 2012 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 l... | # Copyright 2012 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 l... | Fix concurrency issue with Python 3.4 test | Fix concurrency issue with Python 3.4 test
We have been seeing failures in parallel Py34
tests caused by the test database being set up more
than once.
The existing mechanism is not thread-safe.
Add a lock around the database setup to ensure
the it is ever executed by only one thread.
Partially implements: blueprint ... | Python | apache-2.0 | zhangg/trove,zhangg/trove,hplustree/trove,openstack/trove,openstack/trove,hplustree/trove | ---
+++
@@ -12,18 +12,22 @@
# License for the specific language governing permissions and limitations
# under the License.
+import threading
+
+from trove.common import cfg
+from trove.db import get_db_api
+from trove.db.sqlalchemy import session
+
+CONF = cfg.CONF
DB_SETUP = None
+LOCK = threading.Lock()
... |
a44c71cf25672606bd866014982b18836acc46ef | string/reverse.py | string/reverse.py | # Reverse each word in a sentence
def reverse_sentence(string, separator):
# string_list = string.split()
# flipped_list = string_list[::-1]
flipped_list = (string.split())[::-1] # split string into list and then reverse order of elements in list
output = separator.join(flipped_list)
print output
| # Reverse each word in a sentence
def reverse_sentence(string):
string_list = string.split() # split string by word into list
output = ' '.join([word[::-1] for word in string_list]) # reverse each element/word in list and consolidate into single string
print output
# test cases
test = "Hey dude!"
reverse_sentence... | Debug method and add test cases | Debug method and add test cases
| Python | mit | derekmpham/interview-prep,derekmpham/interview-prep | ---
+++
@@ -1,9 +1,13 @@
# Reverse each word in a sentence
-def reverse_sentence(string, separator):
- # string_list = string.split()
- # flipped_list = string_list[::-1]
- flipped_list = (string.split())[::-1] # split string into list and then reverse order of elements in list
- output = separator.join(flipped_li... |
641b1e0c78da6459a43516fc23c5dc388fe2d273 | swift/__init__.py | swift/__init__.py | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | Revert "version bump to 1.4.10" | Revert "version bump to 1.4.10"
This reverts commit e4ab8f004c0c4a8b631d0de77b72d85d5fdba221.
Change-Id: Id8262405acec0f13314f27fbac02bd3cded60789
| Python | apache-2.0 | eatbyte/Swift,prashanthpai/swift,notmyname/swift,matthewoliver/swift,Seagate/swift,bkolli/swift,prashanthpai/swift,smerritt/swift,Akanoa/swift,matthewoliver/swift,notmyname/swift,citrix-openstack-build/swift,dpgoetz/swift,larsbutler/swift,clayg/swift,iostackproject/IO-Bandwidth-Differentiation,mjzmjz/swift,daasbank/swi... | ---
+++
@@ -14,7 +14,7 @@
return '%s-dev' % (self.canonical_version,)
-_version = Version('1.4.10', False)
+_version = Version('1.4.9', False)
__version__ = _version.pretty_version
__canonical_version__ = _version.canonical_version
|
d029c67f59ce65f9ad651b2e261e7f29ef8c2ca2 | sync_scheduler.py | sync_scheduler.py | from tapiriik.database import db
from tapiriik.messagequeue import mq
import kombu
from datetime import datetime
import time
channel = mq.channel()
exchange = kombu.Exchange("tapiriik-users", type="direct")(channel)
exchange.declare()
producer = kombu.Producer(channel, exchange)
while True:
queueing_at = datetime.ut... | from tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
import kombu
from datetime import datetime
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while True:
queueing_at = datetime.utcnow()
users = db.users.find(
... | Declare relevant queues in sync scheduler | Declare relevant queues in sync scheduler
| Python | apache-2.0 | campbellr/tapiriik,niosus/tapiriik,dlenski/tapiriik,niosus/tapiriik,cmgrote/tapiriik,gavioto/tapiriik,cpfair/tapiriik,cpfair/tapiriik,abhijit86k/tapiriik,cheatos101/tapiriik,abhijit86k/tapiriik,niosus/tapiriik,cmgrote/tapiriik,dmschreiber/tapiriik,brunoflores/tapiriik,marxin/tapiriik,campbellr/tapiriik,cgourlay/tapirii... | ---
+++
@@ -1,13 +1,13 @@
from tapiriik.database import db
from tapiriik.messagequeue import mq
+from tapiriik.sync import Sync
import kombu
from datetime import datetime
import time
-channel = mq.channel()
-exchange = kombu.Exchange("tapiriik-users", type="direct")(channel)
-exchange.declare()
-producer = kom... |
8322c776fe989d65f83beaefff5089716d0286e7 | test/test_pydh.py | test/test_pydh.py | import pyDH
def test_pydh_keygen():
d1 = pyDH.DiffieHellman()
d2 = pyDH.DiffieHellman()
d1_pubkey = d1.gen_public_key()
d2_pubkey = d2.gen_public_key()
d1_sharedkey = d1.gen_shared_key(d2_pubkey)
d2_sharedkey = d2.gen_shared_key(d1_pubkey)
assert d1_sharedkey == d2_sharedkey | import sys
sys.path.append('.')
import pyDH
def test_pydh_keygen():
d1 = pyDH.DiffieHellman()
d2 = pyDH.DiffieHellman()
d1_pubkey = d1.gen_public_key()
d2_pubkey = d2.gen_public_key()
d1_sharedkey = d1.gen_shared_key(d2_pubkey)
d2_sharedkey = d2.gen_shared_key(d1_pubkey)
assert d1_sharedkey... | Add current dir to Python path | Add current dir to Python path
| Python | apache-2.0 | amiralis/pyDH | ---
+++
@@ -1,3 +1,5 @@
+import sys
+sys.path.append('.')
import pyDH
def test_pydh_keygen(): |
3b127af586ccfeb785a16ef432af8ce52c08a7e4 | web3/apps/request/urls.py | web3/apps/request/urls.py | from django.conf.urls import url
from . import views
urlpatterns = [
url("^$", views.request_view, name="request_site"),
url("^approve$", views.approve_view, name="approve_site"),
url("^admin$", views.approve_admin_view, name="admin_site")
]
| from django.conf.urls import url
from . import views
urlpatterns = [
url(r"^$", views.request_view, name="request_site"),
url(r"^approve$", views.approve_view, name="approve_site"),
url(r"^admin$", views.approve_admin_view, name="admin_site")
]
| Use r-strings for URL regexes | Use r-strings for URL regexes
| Python | mit | tjcsl/director,tjcsl/director,tjcsl/director,tjcsl/director | ---
+++
@@ -3,7 +3,7 @@
from . import views
urlpatterns = [
- url("^$", views.request_view, name="request_site"),
- url("^approve$", views.approve_view, name="approve_site"),
- url("^admin$", views.approve_admin_view, name="admin_site")
+ url(r"^$", views.request_view, name="request_site"),
+ url(r... |
4e309e7f70760e400dc7150b34e7f86c4c5643b4 | golddust/packages.py | golddust/packages.py | # Copyright 2015-2017 John "LuaMilkshake" Marion
#
# 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 ag... | # Copyright 2015-2017 John "LuaMilkshake" Marion
#
# 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 ag... | Add munge_jar stub for InstallScript | Add munge_jar stub for InstallScript
| Python | apache-2.0 | Packeteers/GoldDust | ---
+++
@@ -36,9 +36,21 @@
class InstallScript:
"""Package pre/post install action script.
+
+ These functions are used to perform extra work beyond extracting
+ files.
+
+ Note that JAR modification should only be done using the `munge_jar`
+ function. This lets GoldDust know that you're modifyin... |
4fb3ff629f88935a6dcd905f9268eb953b6ad7fb | src/syft/grid/client/request_api/group_api.py | src/syft/grid/client/request_api/group_api.py | # stdlib
from typing import Any
from typing import Dict
# third party
from pandas import DataFrame
# syft relative
from ...messages.group_messages import CreateGroupMessage
from ...messages.group_messages import DeleteGroupMessage
from ...messages.group_messages import GetGroupMessage
from ...messages.group_messages ... | # stdlib
from typing import Any
from typing import Callable
# syft relative
from ...messages.group_messages import CreateGroupMessage
from ...messages.group_messages import DeleteGroupMessage
from ...messages.group_messages import GetGroupMessage
from ...messages.group_messages import GetGroupsMessage
from ...messages... | Update Group API - ADD type hints - Remove unused imports | Update Group API
- ADD type hints
- Remove unused imports
| Python | apache-2.0 | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | ---
+++
@@ -1,9 +1,6 @@
# stdlib
from typing import Any
-from typing import Dict
-
-# third party
-from pandas import DataFrame
+from typing import Callable
# syft relative
from ...messages.group_messages import CreateGroupMessage
@@ -17,7 +14,7 @@
class GroupRequestAPI(GridRequestAPI):
response_key = "gr... |
599760942e556c5d23deb0904beafcdf11235595 | stoneridge_reporter.py | stoneridge_reporter.py | #!/usr/bin/env python
# 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/.
import glob
import os
import requests
import stoneridge
class StoneRidgeReporter(object):
de... | #!/usr/bin/env python
# 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/.
import argparse
import glob
import os
import requests
import stoneridge
class StoneRidgeReporter... | Make reporter succeed in talking to the graph server | Make reporter succeed in talking to the graph server
| Python | mpl-2.0 | mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge | ---
+++
@@ -3,6 +3,7 @@
# 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/.
+import argparse
import glob
import os
import requests
@@ -18,13 +19,14 @@
def run(self):
files = glob.glob(self.pattern)
for fpath in files:
- ... |
101e50f1e668169836a5f253c938420f3675fb16 | jesusmtnez/python/kata/game.py | jesusmtnez/python/kata/game.py | class Game():
def __init__(self):
self._score = 0
def roll(self, pins):
self._score += pins
def score(self):
return self._score
| class Game():
def __init__(self):
self._rolls = [0] * 21
self._current_roll = 0
def roll(self, pins):
self._rolls[self._current_roll] += pins
self._current_roll += 1
def score(self):
score = 0
for frame in range(0, 20, 2):
if self._is_spare(frame... | Add 'spare' support in when calculating scores | [Python] Add 'spare' support in when calculating scores
| Python | mit | JesusMtnez/devexperto-challenge,JesusMtnez/devexperto-challenge | ---
+++
@@ -1,9 +1,23 @@
class Game():
def __init__(self):
- self._score = 0
+ self._rolls = [0] * 21
+ self._current_roll = 0
def roll(self, pins):
- self._score += pins
+ self._rolls[self._current_roll] += pins
+ self._current_roll += 1
def score(self):
... |
2060cf215d851f86ae8c2766b4a2985c9a37cfae | temba/flows/migrations/0056_indexes_update.py | temba/flows/migrations/0056_indexes_update.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
INDEX_SQL = """
CREATE INDEX flows_flowrun_org_modified_id
ON flows_flowrun (org_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on;
CREATE INDEX flows_flowrun_org_responded_modified_... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
INDEX_SQL = """
CREATE INDEX flows_flowrun_org_modified_id
ON flows_flowrun (org_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on;
CREATE INDEX flows_flowrun_org_modified_id_where_r... | Revert "index on flow run responded field as well" | Revert "index on flow run responded field as well"
This reverts commit cbbac0f0f23f6e0ad3ce15a784aad30a82a2fe5a.
| Python | agpl-3.0 | ewheeler/rapidpro,tsotetsi/textily-web,tsotetsi/textily-web,pulilab/rapidpro,tsotetsi/textily-web,tsotetsi/textily-web,tsotetsi/textily-web,pulilab/rapidpro,ewheeler/rapidpro,pulilab/rapidpro,pulilab/rapidpro,ewheeler/rapidpro,pulilab/rapidpro,ewheeler/rapidpro | ---
+++
@@ -10,8 +10,9 @@
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on;
-CREATE INDEX flows_flowrun_org_responded_modified_id
-ON flows_flowrun (org_id, responded, modified_on DESC, id DESC);
+CREATE INDEX flows_flowrun_org_modified_id_where_responded
+ON flows_flowrun (org_id, modified_on DESC, id DESC... |
1f5d52f18df2fba70b53acd681ebb381f532adff | tests/conftest.py | tests/conftest.py | """ Fixtures in this file are available to all files automatically, no
importing required. Only put general purpose fixtures here!
"""
import pytest
import os
from shutil import rmtree
TEST_CONFIG = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'config.cfg')
@pytest.fixture(scope='se... | """ Fixtures in this file are available to all files automatically, no
importing required. Only put general purpose fixtures here!
"""
import pytest
import os
from shutil import rmtree
TEST_CONFIG = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'config.cfg')
@pytest.fixture(scope='se... | Document expected behaviour instead of leaving XXX comment | Document expected behaviour instead of leaving XXX comment
| Python | agpl-3.0 | wakermahmud/sync-engine,ErinCall/sync-engine,nylas/sync-engine,Eagles2F/sync-engine,EthanBlackburn/sync-engine,closeio/nylas,nylas/sync-engine,PriviPK/privipk-sync-engine,ErinCall/sync-engine,ErinCall/sync-engine,Eagles2F/sync-engine,gale320/sync-engine,EthanBlackburn/sync-engine,ErinCall/sync-engine,EthanBlackburn/syn... | ---
+++
@@ -16,12 +16,12 @@
load_config(filename=TEST_CONFIG)
return config
-# XXX is this the right scope for this? This will remove log/ at the end of
-# the test session.
@pytest.fixture(scope='session')
def log(request, config):
""" Returns root server logger. For others loggers, use this fixtu... |
f17611b39c9cc3ec6815093db2eb85cb6b30b5ba | lwr/lwr_client/transport/standard.py | lwr/lwr_client/transport/standard.py | """
LWR HTTP Client layer based on Python Standard Library (urllib2)
"""
from __future__ import with_statement
from os.path import getsize
import mmap
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
try:
from urllib2 import Request
except ImportError:
from urllib.... | """
LWR HTTP Client layer based on Python Standard Library (urllib2)
"""
from __future__ import with_statement
from os.path import getsize
import mmap
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
try:
from urllib2 import Request
except ImportError:
from urllib.... | Fix small bug introduced in 0b8e5d428e60. | Fix small bug introduced in 0b8e5d428e60.
Opening file twice.
| Python | apache-2.0 | jmchilton/pulsar,natefoo/pulsar,ssorgatem/pulsar,jmchilton/lwr,galaxyproject/pulsar,jmchilton/pulsar,ssorgatem/pulsar,galaxyproject/pulsar,natefoo/pulsar,jmchilton/lwr | ---
+++
@@ -24,7 +24,6 @@
input = None
try:
if input_path:
- input = open(input_path, 'rb')
if getsize(input_path):
input = open(input_path, 'rb')
data = mmap.mmap(input.fileno(), 0, access=mmap.ACCESS_READ) |
0858cd463d4e6179e3bf4abbfa94cc54fb0600db | test/integration/test_node_propagation.py | test/integration/test_node_propagation.py | class TestPropagation(object):
def test_node_propagation(self):
"""
Tests that check node propagation
1) Spin up four servers.
2) Make the first one send a sync request to all three others.
3) Count the numbers of requests made.
4) Check databases to see that they al... | from kitten.server import KittenServer
from gevent.pool import Group
from mock import MagicMock
class TestPropagation(object):
def setup_method(self, method):
self.servers = Group()
for port in range(4):
ns = MagicMock()
ns.port = 9812 + port
server = Kitten... | Add setup to first integration test | Add setup to first integration test
| Python | mit | thiderman/network-kitten | ---
+++
@@ -1,4 +1,21 @@
+from kitten.server import KittenServer
+
+from gevent.pool import Group
+
+from mock import MagicMock
+
+
class TestPropagation(object):
+ def setup_method(self, method):
+ self.servers = Group()
+
+ for port in range(4):
+ ns = MagicMock()
+ ns.port =... |
4c655c31bf9625fe426c8b481afba41fe328494d | metaci/api/renderers/csv_renderer.py | metaci/api/renderers/csv_renderer.py | # I started here: https://www.django-rest-framework.org/api-guide/renderers/#example
from rest_framework import renderers
import unicodecsv as csv
import io
import logging
logger = logging.getLogger(__name__)
class SimpleCSVRenderer(renderers.BaseRenderer):
"""Renders simple 1-level-deep data as csv"""
med... | # I started here: https://www.django-rest-framework.org/api-guide/renderers/#example
import csv
import io
import logging
from rest_framework import renderers
logger = logging.getLogger(__name__)
class SimpleCSVRenderer(renderers.BaseRenderer):
"""Renders simple 1-level-deep data as csv"""
media_type = "te... | Remove dependency on unicodecsv module | Remove dependency on unicodecsv module
| Python | bsd-3-clause | SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci | ---
+++
@@ -1,9 +1,10 @@
# I started here: https://www.django-rest-framework.org/api-guide/renderers/#example
-from rest_framework import renderers
-import unicodecsv as csv
+import csv
import io
import logging
+
+from rest_framework import renderers
logger = logging.getLogger(__name__)
@@ -23,12 +24,12 @@
... |
b87da7d5666fc5dc3654d9f58779b8f58a3e6e9f | sft/sim/SimplePathWorldGenerator.py | sft/sim/SimplePathWorldGenerator.py | from sim.PathWorldGenerator import PathWorldGenerator
class SimplePathWorldGenerator(PathWorldGenerator):
def __init__(self, logger, view_size, world_size, sampler, path_in_init_view=False,
target_not_in_init_view=False):
# enforce simple paths consisting of one step, i.e. straight lines
super(SimplePathWo... | from sft.sim.PathWorldGenerator import PathWorldGenerator
class SimplePathWorldGenerator(PathWorldGenerator):
def __init__(self, logger, view_size, world_size, sampler, path_in_init_view=False,
target_not_in_init_view=False):
# enforce simple paths consisting of one step, i.e. straight lines
super(SimplePa... | Improve trainer logging and print every logged message to console | Improve trainer logging and print every logged message to console
| Python | mit | kevinkepp/search-for-this | ---
+++
@@ -1,4 +1,4 @@
-from sim.PathWorldGenerator import PathWorldGenerator
+from sft.sim.PathWorldGenerator import PathWorldGenerator
class SimplePathWorldGenerator(PathWorldGenerator): |
5694209065b707e2529b7c8b97b1c82a3990c938 | lithium/ximport.py | lithium/ximport.py | import os
import sys
def importRelativeOrAbsolute(f):
# maybe there's a way to do this more sanely with the |imp| module...
if f.endswith(".py"):
f = f[:-3]
if f.endswith(".pyc"):
f = f[:-4]
p, f = os.path.split(f)
if p:
# Add the path part of the given filename to the impor... | import os
import sys
def importRelativeOrAbsolute(f):
# maybe there's a way to do this more sanely with the |imp| module...
if f.endswith(".py"):
f = f[:-3]
if f.endswith(".pyc"):
f = f[:-4]
p, f = os.path.split(f)
if p:
# Add the path part of the given filename to the impor... | Make it work in Python < 2.6 | Make it work in Python < 2.6
| Python | mpl-2.0 | nth10sd/lithium,MozillaSecurity/lithium,MozillaSecurity/lithium,nth10sd/lithium | ---
+++
@@ -16,7 +16,7 @@
sys.path.append(".")
try:
module = __import__(f)
- except ImportError as e:
+ except ImportError, e:
print "Failed to import: " + f
print "From: " + __file__
print str(e) |
f1f18b6b996d2bcf108bf7b594d0fdf4dab23057 | timpani/themes.py | timpani/themes.py | import os
import os.path
from . import database
THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes"))
def getCurrentTheme():
databaseConnection = database.ConnectionManager.getConnection("main")
query = (databaseConnection.session
.query(database.tables.Setting)
.filter(database.tab... | import os
import os.path
from . import database
THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes"))
def getCurrentTheme():
databaseConnection = database.ConnectionManager.getConnection("main")
query = (databaseConnection.session
.query(database.tables.Setting)
.filter(database.tab... | Add cases for either CSS or template not existing | Add cases for either CSS or template not existing
| Python | mit | ollien/Timpani,ollien/Timpani,ollien/Timpani | ---
+++
@@ -18,14 +18,19 @@
except StopIteration:
return None
- themeFile = open(
- os.path.join(THEME_PATH, folderName, "theme.css"), "r")
- theme = themeFile.read()
- themeFile.close()
- templateFile = open(
- os.path.join(THEME_PATH, folderName, "template.html"), "r")
- template = templatefile.re... |
f5aa51a57e3d161c12d8b8390e6e6aab7609b459 | readthedocs/projects/feeds.py | readthedocs/projects/feeds.py | from django.contrib.syndication.views import Feed
from django.db.models import Max
from projects.models import Project
class LatestProjectsFeed(Feed):
title = "Recently updated documentation"
link = "http://readthedocs.org"
description = "Recently updated documentation on Read the Docs"
def items(sel... | from django.contrib.syndication.views import Feed
from django.db.models import Max
from projects.models import Project
class LatestProjectsFeed(Feed):
title = "Recently updated documentation"
link = "http://readthedocs.org"
description = "Recently updated documentation on Read the Docs"
def items(sel... | Make the RSS feed not slow. | Make the RSS feed not slow.
| Python | mit | VishvajitP/readthedocs.org,soulshake/readthedocs.org,agjohnson/readthedocs.org,attakei/readthedocs-oauth,nikolas/readthedocs.org,pombredanne/readthedocs.org,michaelmcandrew/readthedocs.org,laplaceliu/readthedocs.org,takluyver/readthedocs.org,atsuyim/readthedocs.org,mrshoki/readthedocs.org,d0ugal/readthedocs.org,asampat... | ---
+++
@@ -9,7 +9,7 @@
description = "Recently updated documentation on Read the Docs"
def items(self):
- return Project.objects.filter(builds__isnull=False).annotate(max_date=Max('builds__date')).order_by('-max_date')[:10]
+ return Project.objects.order_by('-modified_date')[:10]
def... |
29316060fb422a881833e411350e0149575bf1c4 | update-database/stackdoc/namespaces/python.py | update-database/stackdoc/namespaces/python.py | import re
import urllib
############### Functions called by stackdoc
def get_version():
return 1
def get_ids(title, body, tags):
ids = []
if "http://docs.python.org/" in body:
urls = re.findall(r'<a href="([^"]+)"', body)
for url in urls:
m = re.match("http://docs.python.org/... | import re
import urllib
############### Functions called by stackdoc
def get_version():
return 2
def get_ids(title, body, tags):
ids = []
if "http://docs.python.org/" in body or "http://www.python.org/doc/" in body:
urls = re.findall(r'<a href="([^"]+)"', body)
for url in urls:
... | Support old style Python doc links. | Support old style Python doc links.
| Python | bsd-3-clause | alnorth/stackdoc,alnorth/stackdoc,alnorth/stackdoc | ---
+++
@@ -5,16 +5,20 @@
############### Functions called by stackdoc
def get_version():
- return 1
+ return 2
def get_ids(title, body, tags):
ids = []
- if "http://docs.python.org/" in body:
+ if "http://docs.python.org/" in body or "http://www.python.org/doc/" in body:
urls = re.fi... |
f19d4eaec9681192eb761758b1506638b78a5e15 | tests/__init__.py | tests/__init__.py | import inspect
import os
# Get testdata absolute path.
abs_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
path = abs_path + "/testdata"
| import inspect
import os
# Get testdata absolute path.
abs_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
#path = abs_path + "/testdata"
path = "./testdata"
| Change the testdata path to relative path. | Change the testdata path to relative path.
| Python | mit | PytLab/VASPy,PytLab/VASPy | ---
+++
@@ -3,5 +3,6 @@
# Get testdata absolute path.
abs_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
-path = abs_path + "/testdata"
+#path = abs_path + "/testdata"
+path = "./testdata"
|
4ce674ea3a672c2819112b5237319000e33f22c5 | marten/__init__.py | marten/__init__.py | """Stupid simple Python configuration environments"""
from __future__ import absolute_import
import os as _os
__version__ = '0.6.0'
_os.environ.setdefault('MARTEN_ENV', 'default')
try:
from .util import get_config_from_env as _get_config
except ImportError:
config = None
else:
config = _get_config()
| """Stupid simple Python configuration environments"""
from __future__ import absolute_import
from marten import loaded_configs
import os as _os
__version__ = '0.6.1'
_os.environ.setdefault('MARTEN_ENV', 'default')
try:
from .util import get_config_from_env as _get_config
except ImportError:
config = None
else... | Add explicit import for loaded_configs namespace to fix RuntimeWarning | Add explicit import for loaded_configs namespace to fix RuntimeWarning
| Python | mit | nick-allen/marten | ---
+++
@@ -2,9 +2,11 @@
from __future__ import absolute_import
+from marten import loaded_configs
+
import os as _os
-__version__ = '0.6.0'
+__version__ = '0.6.1'
|
0dac29f30853498f6e9d82c8b791ced5ec21667c | models/00_settings.py | models/00_settings.py | import os
import logging
import json
from logging.config import dictConfig
from gluon.storage import Storage
from gluon.contrib.appconfig import AppConfig
# app_config use to cache values in production
app_config = AppConfig(reload=True)
# settings is used to avoid cached values in production
settings = Storage()
#... | import os
import logging
import json
from logging.config import dictConfig
from gluon.storage import Storage
from gluon.contrib.appconfig import AppConfig
# app_config use to cache values in production
app_config = AppConfig(reload=True)
# settings is used to avoid cached values in production
settings = Storage()
#... | Check configuration file rather than env variable | Check configuration file rather than env variable
| Python | apache-2.0 | wefner/w2pfooty,wefner/w2pfooty,wefner/w2pfooty | ---
+++
@@ -33,7 +33,7 @@
# DATABASE CONFIGURATION
# Check whether POSTGRES_ENABLED env var is set to True or not.
# If so, generate connection string.
-if os.environ['POSTGRES_ENABLED'] == 'True':
+if app_config.has_key('postgres'):
settings.db_uri = 'postgres://{u}:{p}@{h}:{po}/{db}'.format(
u=app_... |
6c0c05c523043abd4fb35ee53daf1a216346a94d | tests/runtests.py | tests/runtests.py | #!/usr/bin/env python
'''
Discover all instances of unittest.TestCase in this directory.
'''
# Import python libs
import os
# Import salt libs
import saltunittest
from integration import TestDaemon
TEST_DIR = os.path.dirname(os.path.normpath(os.path.abspath(__file__)))
def run_integration_tests():
with TestDaemon... | #!/usr/bin/env python
'''
Discover all instances of unittest.TestCase in this directory.
'''
# Import python libs
import os
# Import salt libs
import saltunittest
from integration import TestDaemon
TEST_DIR = os.path.dirname(os.path.normpath(os.path.abspath(__file__)))
def run_integration_tests():
with TestDaemon... | Add support for a dir of client tests | Add support for a dir of client tests
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | ---
+++
@@ -12,9 +12,12 @@
def run_integration_tests():
with TestDaemon():
- loader = saltunittest.TestLoader()
- tests = loader.discover(os.path.join(TEST_DIR, 'integration', 'modules'), '*.py')
- saltunittest.TextTestRunner(verbosity=1).run(tests)
+ moduleloader = saltunittest.Te... |
6c2d73b0d387eb49e38b0432318733b56d2deb96 | tests/settings.py | tests/settings.py | SECRET_KEY = 'not-anymore'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = [
'tests',
]
| SECRET_KEY = 'not-anymore'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = [
'tests',
]
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
| Add support for Django 4.0. | Add support for Django 4.0.
| Python | mit | gintas/django-picklefield | ---
+++
@@ -9,3 +9,5 @@
INSTALLED_APPS = [
'tests',
]
+
+DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' |
8d7862a7045fbb52ce3a2499766ffa1ffef284af | tests/settings.py | tests/settings.py | """
Settings for tests.
"""
from moztrap.settings.default import *
DEFAULT_FILE_STORAGE = "tests.storage.MemoryStorage"
ALLOW_ANONYMOUS_ACCESS = False
SITE_URL = "http://localhost:80"
USE_BROWSERID = True
| """
Settings for tests.
"""
from moztrap.settings.default import *
DEFAULT_FILE_STORAGE = "tests.storage.MemoryStorage"
ALLOW_ANONYMOUS_ACCESS = False
SITE_URL = "http://localhost:80"
USE_BROWSERID = True
PASSWORD_HASHERS = ['django.contrib.auth.hashers.UnsaltedMD5PasswordHasher']
| Use faster password hashing in tests. | Use faster password hashing in tests.
| Python | bsd-2-clause | mccarrmb/moztrap,bobsilverberg/moztrap,mozilla/moztrap,mccarrmb/moztrap,shinglyu/moztrap,mccarrmb/moztrap,shinglyu/moztrap,mccarrmb/moztrap,shinglyu/moztrap,mccarrmb/moztrap,bobsilverberg/moztrap,mozilla/moztrap,bobsilverberg/moztrap,shinglyu/moztrap,mozilla/moztrap,shinglyu/moztrap,bobsilverberg/moztrap,mozilla/moztra... | ---
+++
@@ -8,3 +8,5 @@
ALLOW_ANONYMOUS_ACCESS = False
SITE_URL = "http://localhost:80"
USE_BROWSERID = True
+
+PASSWORD_HASHERS = ['django.contrib.auth.hashers.UnsaltedMD5PasswordHasher'] |
cd599444433fd32f989fa4f61a3b19f773b12f0e | readthedocs/profiles/urls/public.py | readthedocs/profiles/urls/public.py | from django.conf.urls import *
from profiles import views
urlpatterns = patterns('',
url(r'^(?P<username>[\w.-]+)/$',
views.profile_detail,
{'template_name': 'profiles/public/profile_detail.html'},
name='profiles_... | from django.conf.urls import *
from profiles import views
urlpatterns = patterns('',
url(r'^(?P<username>[\w@.-]+)/$',
views.profile_detail,
{'template_name': 'profiles/public/profile_detail.html'},
name='profiles... | Allow email in profile urls | Allow email in profile urls
| Python | mit | techtonik/readthedocs.org,sid-kap/readthedocs.org,agjohnson/readthedocs.org,asampat3090/readthedocs.org,CedarLogic/readthedocs.org,soulshake/readthedocs.org,LukasBoersma/readthedocs.org,VishvajitP/readthedocs.org,KamranMackey/readthedocs.org,nikolas/readthedocs.org,VishvajitP/readthedocs.org,wanghaven/readthedocs.org,s... | ---
+++
@@ -4,7 +4,7 @@
urlpatterns = patterns('',
- url(r'^(?P<username>[\w.-]+)/$',
+ url(r'^(?P<username>[\w@.-]+)/$',
views.profile_detail,
{'template_name': 'profiles/public/profile_detail.html'},
... |
81215120afffe54b17be3f38bbc2ac292452c0c4 | addons/mail/models/ir_attachment.py | addons/mail/models/ir_attachment.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class IrAttachment(models.Model):
_inherit = 'ir.attachment'
@api.multi
def _post_add_create(self):
""" Overrides behaviour when the attachment is created throu... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class IrAttachment(models.Model):
_inherit = 'ir.attachment'
@api.multi
def _post_add_create(self):
""" Overrides behaviour when the attachment is created throu... | Revert "[FIX] mail: remove attachment as main at unlink" | Revert "[FIX] mail: remove attachment as main at unlink"
This reverts commit abc45b1
Since by default the ondelete attribute of a many2one is `set null`,
this was completely unnecessary to begin with.
Bug caused by this commit:
Unlink a record that has some attachments.
The unlink first removes the record, then its r... | Python | agpl-3.0 | ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo | ---
+++
@@ -15,19 +15,6 @@
for record in self:
record.register_as_main_attachment(force=False)
- @api.multi
- def unlink(self):
- self.remove_as_main_attachment()
- super(IrAttachment, self).unlink()
-
- @api.multi
- def remove_as_main_attachment(self):
- for a... |
da3e6b3c59e2c0d94f165e526daefd33fc9d8d79 | napper_kittydar.py | napper_kittydar.py | import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from ... | import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from ... | Add missing trailing slash required by kittydar. | Add missing trailing slash required by kittydar.
| Python | mit | ms705/napper | ---
+++
@@ -16,7 +16,7 @@
hdfs_fetch_file("/input/kittys/CAT_0%d" % (worker_id), os.environ['FLAGS_task_data_dir'])
# execute program
-command = "nodejs %s --dir %s/CAT_0%d" % (kittydar_path, os.environ['FLAGS_task_data_dir'], worker_id)
+command = "nodejs %s --dir %s/CAT_0%d/" % (kittydar_path, os.environ['FLAGS... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.