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 |
|---|---|---|---|---|---|---|---|---|---|---|
36d98f499316d4695c20544701dd1d4300aca600 | corehq/ex-submodules/dimagi/utils/couch/cache/cache_core/lib.py | corehq/ex-submodules/dimagi/utils/couch/cache/cache_core/lib.py | from __future__ import absolute_import
from __future__ import unicode_literals
import simplejson
from django_redis.cache import RedisCache
from . import CACHE_DOCS, key_doc_id, rcache
from corehq.util.soft_assert import soft_assert
def invalidate_doc_generation(doc):
from .gen import GenerationCache
doc_type ... | from __future__ import absolute_import
from __future__ import unicode_literals
import simplejson
from . import CACHE_DOCS, key_doc_id, rcache
def invalidate_doc_generation(doc):
from .gen import GenerationCache
doc_type = doc.get('doc_type', None)
generation_mgr = GenerationCache.doc_type_generation_map()... | Revert "track multi key ops in Redis" | Revert "track multi key ops in Redis"
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | ---
+++
@@ -1,9 +1,7 @@
from __future__ import absolute_import
from __future__ import unicode_literals
import simplejson
-from django_redis.cache import RedisCache
from . import CACHE_DOCS, key_doc_id, rcache
-from corehq.util.soft_assert import soft_assert
def invalidate_doc_generation(doc):
@@ -23,22 +21,3... |
786de8ec482ed67b78696357c66dfa9292eea62f | tk/templatetags.py | tk/templatetags.py | from django.core.urlresolvers import reverse, resolve
from django.template import Library
from django.utils import translation
from django.templatetags.i18n import register
@register.simple_tag(takes_context=True)
def translate_url(context, language):
view = resolve(context['request'].path)
args = [a for a in... | from django.core.urlresolvers import reverse, resolve
from django.template import Library
from django.utils import translation
from django.templatetags.i18n import register
@register.simple_tag(takes_context=True)
def translate_url(context, language):
if hasattr(context.get('object', None), 'get_absolute_url'):
... | Fix getting the translated urls for material detail views | Fix getting the translated urls for material detail views
| Python | agpl-3.0 | GISAElkartea/tresna-kutxa,GISAElkartea/tresna-kutxa,GISAElkartea/tresna-kutxa,GISAElkartea/tresna-kutxa | ---
+++
@@ -6,9 +6,12 @@
@register.simple_tag(takes_context=True)
def translate_url(context, language):
+ if hasattr(context.get('object', None), 'get_absolute_url'):
+ with translation.override(language):
+ return context['object'].get_absolute_url()
+
view = resolve(context['request'].... |
a66ba9970675cbc0a79ec683d8db6046865d022e | OnionLauncher/main.py | OnionLauncher/main.py | import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.uic import loadUi
class MainWindow(QMainWindow):
def __init__(self, *args):
super(MainWindow, self).__init__(*args)
loadUi("ui_files/main.ui", self)
self.tbAdd.clicked.connect(self.addRow)
self.tbRemove.clicked.connect(self.removeRo... | import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.uic import loadUi
class MainWindow(QMainWindow):
def __init__(self, *args):
super(MainWindow, self).__init__(*args)
loadUi("ui_files/main.ui", self)
self.tbAdd.clicked.connect(self.addRow)
self.tbRemove.clicked.connect(self.removeRo... | Remove useless conversion in remove row code | Remove useless conversion in remove row code
| Python | bsd-2-clause | neelchauhan/OnionLauncher | ---
+++
@@ -20,7 +20,7 @@
rows.reverse()
for row in rows:
- self.twSettings.removeRow(int(row))
+ self.twSettings.removeRow(row)
if __name__ == "__main__":
app = QApplication(sys.argv) |
affc6d644a5a259b1237df419b32b7001431ea6f | setup.py | setup.py | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as file_readme:
readme = file_readme.read()
setup(name='json-sempai',
version='0.3.0',
description='Use JSON files as if they\'re python modules',
long_de... | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as file_readme:
readme = file_readme.read()
setup(name='json-sempai',
version='0.3.0',
description='Use JSON files as if they\'re python modules',
long_de... | Add jsonsempai.tests to list of packages to install | Add jsonsempai.tests to list of packages to install
Closes: #10
| Python | mit | kragniz/json-sempai | ---
+++
@@ -27,6 +27,6 @@
'Programming Language :: Python :: 3.4',
],
keywords='please don\'t use this library for anything',
- packages=['jsonsempai'],
+ packages=['jsonsempai', 'jsonsempai.tests'],
test_suite='jsonsempai.tests'
) |
91165642fb40165987ab0ff734959f88712e514c | humblemedia/resources/migrations/0001_initial.py | humblemedia/resources/migrations/0001_initial.py | # encoding: utf8
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | # encoding: utf8
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('auth', '__first__'),
('contenttypes', '_... | Add dependencies to contenttypes to the migration | Add dependencies to contenttypes to the migration
| Python | mit | vladimiroff/humble-media,vladimiroff/humble-media | ---
+++
@@ -9,6 +9,8 @@
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ('auth', '__first__'),
+ ('contenttypes', '__first__'),
]
operations = [ |
430fd5393668249f01a2b941eef62569d758c6cf | tools/skp/page_sets/skia_intelwiki_desktop.py | tools/skp/page_sets/skia_intelwiki_desktop.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry import story
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
clas... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry import story
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
clas... | Add scrolling to go to the more interesting parts of desk_intelwiki.skp | Add scrolling to go to the more interesting parts of desk_intelwiki.skp
Bug: skia:11804
Change-Id: I96ce34311b5e5420ee343a0dbc68ef20f399be4f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/390336
Commit-Queue: Ravi Mistry <9fa2e7438b8cb730f96b74865492597170561628@google.com>
Reviewed-by: Robert Phillips <95... | Python | bsd-3-clause | google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/pl... | ---
+++
@@ -21,7 +21,11 @@
def RunNavigateSteps(self, action_runner):
action_runner.Navigate(self.url)
- action_runner.Wait(120)
+ action_runner.Wait(20)
+
+ def RunPageInteractions(self, action_runner):
+ with action_runner.CreateGestureInteraction('ScrollAction'):
+ action_runner.ScrollPage... |
902e4500b57d54a80a586b0843ff3a68706a5c58 | setup.py | setup.py | """
Distutils script for building cython .c and .so files. Call it with:
python setup.py build_ext --inplace
"""
from distutils.core import setup
from Cython.Build import cythonize
#from Cython.Compiler.Options import directive_defaults
#directive_defaults['profile'] = True
setup(
name = "Pentacular",
... | """
Distutils script for building cython .c and .so files. Call it with:
python setup.py build_ext --inplace
"""
from distutils.core import setup
from Cython.Build import cythonize
#from Cython.Compiler.Options import directive_defaults
#directive_defaults['profile'] = True
cy_modules = [
'board_strip.py... | Remove py modules causing GUI lag | Remove py modules causing GUI lag
| Python | mit | cropleyb/pentai,cropleyb/pentai,cropleyb/pentai | ---
+++
@@ -9,6 +9,23 @@
#from Cython.Compiler.Options import directive_defaults
#directive_defaults['profile'] = True
+cy_modules = [
+ 'board_strip.pyx',
+ 'length_lookup_table.pyx',
+ ]
+if False:
+ cy_modules.extend([
+ 'priority_filter.py',
+ 'budget_searcher... |
24773383448698c71c5e83810b767e3a7c0900fb | setup.py | setup.py | # -*- coding: utf-8 -*-
"""Setup file for basecrm library."""
import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name="bas... | # -*- coding: utf-8 -*-
"""Setup file for basecrm library."""
import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name="bas... | Update package name to basecrm | Update package name to basecrm
Was basecrm-python, but it's a Python package, uploaded to PyPI, so
the suffix is redundant. It's maintained in the root folder name as
this makes it relevant in Github (and distinct from other languages).
| Python | mit | yunojuno/django-basecrm | ---
+++
@@ -9,7 +9,7 @@
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
- name="basecrm-python",
+ name="basecrm",
version="0.1",
packages=[
'basecrm', |
b4ff3790fcefe070d13efed01247e94cbe87bd43 | setup.py | setup.py | import sys
import setuptools
def read_long_description():
with open('README.rst') as f:
data = f.read()
with open('CHANGES.rst') as f:
data += '\n\n' + f.read()
return data
importlib_req = ['importlib'] if sys.version_info < (2,7) else []
argparse_req = ['argparse'] if sys.ver... | import sys
import setuptools
def read_long_description():
with open('README.rst') as f:
data = f.read()
with open('CHANGES.rst') as f:
data += '\n\n' + f.read()
return data
importlib_req = ['importlib'] if sys.version_info < (2,7) else []
argparse_req = ['argparse'] if sys.ver... | Use hgtools 5 or later for use_vcs_version | Use hgtools 5 or later for use_vcs_version
| Python | mit | jaraco/irc | ---
+++
@@ -16,7 +16,7 @@
name="irc",
description="IRC (Internet Relay Chat) protocol client library for Python",
long_description=read_long_description(),
- use_hg_version=True,
+ use_vcs_version=True,
packages=setuptools.find_packages(),
author="Joel Rosdahl",
author_email="joel@... |
76dc4637d41b7c32f00a0cc1ab0a8af9b463524d | setup.py | setup.py | from setuptools import setup
import sys
try:
from PyQt4.QtCore import QT_VERSION_STR
except ImportError:
sys.exit("PyQt4 is required to install this package (see README.md for installation instructions)")
setup(
name = "wethepeopletoolkit",
version = "1.3",
author = "Alex Peattie",
author_email = "me@alex... | from setuptools import setup
import sys
try:
from PyQt4.QtCore import QT_VERSION_STR
except ImportError:
sys.exit("PyQt4 is required to install this package (see README.md for installation instructions)")
setup(
name = "wethepeopletoolkit",
version = "1.4",
author = "Alex Peattie",
author_email = "me@alex... | Change how console_scripts is invoked | Change how console_scripts is invoked
| Python | mit | alexpeattie/wethepeopletoolkit | ---
+++
@@ -8,14 +8,14 @@
setup(
name = "wethepeopletoolkit",
- version = "1.3",
+ version = "1.4",
author = "Alex Peattie",
author_email = "me@alexpeattie.com",
description = ("A project for analyzing and visualizing data from the Obama-era 'We the People' petitions site."),
license = "MIT",
k... |
618138eaac7463b9e2afd6e8d28c2e27cf294f87 | setup.py | setup.py | #! /usr/bin/env python3
from setuptools import setup
from hsluv import __version__
setup(
name='hsluv',
version=__version__,
description='Human-friendly HSL',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
license="MIT",
author_email="alexei@boron... | #! /usr/bin/env python3
from setuptools import setup
from hsluv import __version__
setup(
name='hsluv',
version=__version__,
description='Human-friendly HSL',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
license="MIT",
author_email="alexei@boron... | Add official support for Python 3.10 | Add official support for Python 3.10
| Python | mit | hsluv/hsluv-python,husl-colors/husl.py | ---
+++
@@ -23,6 +23,7 @@
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3 :: Only",
],
python_requires='>=3.7... |
bfeccfd7c6d926e760f938f6073827fc0c2d3dfa | setup.py | setup.py | try:
from setuptools import setup
except:
from distutils.core import setup
import os
def parse_requirements(requirements_filename='requirements.txt'):
requirements = []
if os.path.exists(requirements_filename):
with open(requirements_filename) as requirements_file:
for requirement... | try:
from setuptools import setup
except:
from distutils.core import setup
import os
def parse_requirements(requirements_filename='requirements.txt'):
requirements = []
if os.path.exists(requirements_filename):
with open(requirements_filename) as requirements_file:
for requirement... | Update github link to cloudenvy org | Update github link to cloudenvy org
| Python | apache-2.0 | cloudenvy/cloudenvy | ---
+++
@@ -17,7 +17,7 @@
config = dict(
name='cloudenvy',
version='0.1.0',
- url='https://github.com/bcwaldon/cloudenvy',
+ url='https://github.com/cloudenvy/cloudenvy',
description='Fast provisioning on openstack clouds.',
author='Brian Waldon',
author_email='bcwaldon@gmail.com', |
101de91508d918b90c6254dc0b1cc5e0744bbd71 | setup.py | setup.py | from setuptools import setup
import sys
setup(
# Basic package information.
name = 'zdesk',
author = 'Brent Woodruff',
version = '2.4.0',
author_email = 'brent@fprimex.com',
packages = ['zdesk'],
include_package_data = True,
install_requires = ['requests'],
license='LICENSE.txt',
... | from setuptools import setup
import sys
setup(
# Basic package information.
name = 'zdesk',
author = 'Brent Woodruff',
version = '2.3.0',
author_email = 'brent@fprimex.com',
packages = ['zdesk'],
include_package_data = True,
install_requires = ['requests'],
license='LICENSE.txt',
... | Revert "bump version for impending release" | Revert "bump version for impending release"
This reverts commit c9c46f1bd4593cd1b13df404b2dba89c75c4f1ec.
| Python | mit | fprimex/zdesk,blade2005/zdesk,fprimex/zdgen | ---
+++
@@ -5,7 +5,7 @@
# Basic package information.
name = 'zdesk',
author = 'Brent Woodruff',
- version = '2.4.0',
+ version = '2.3.0',
author_email = 'brent@fprimex.com',
packages = ['zdesk'],
include_package_data = True, |
d78bcc4391f74c86eee927d9c30b58bb211d1cfe | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from os import path
import sys
install_requires = [
'itsdangerous',
'msgpack-python',
'pysha3',
'six',
]
extras_require = {
'test': [
'coverage',
'nose',
],
}
if sys.version_info < (3, 4... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from os import path
import sys
install_requires = [
'itsdangerous',
'msgpack-python',
'pysha3',
'six',
]
extras_require = {
'test': [
'coverage',
'nose',
],
}
if sys.version_info < (3, 4... | Fix extras_require for test deps | Fix extras_require for test deps
| Python | mit | thusoy/nuts-auth,thusoy/nuts-auth | ---
+++
@@ -33,8 +33,7 @@
url='https://github.com/thusoy/nuts-auth',
description='An authenticated datagram protocol. That might fly in space.',
install_requires=install_requires,
- extras_require={
- },
+ extras_require=extras_require,
packages=find_packages(),
zip_safe=False,
) |
6459acb1b96f28e43346677b6e14173e7f30b91e | setup.py | setup.py | from setuptools import setup
import backlog
PACKAGE = 'TracBacklog'
setup(name=PACKAGE,
version=backlog.get_version(),
packages=['backlog'],
package_data={
'backlog': [
'htdocs/css/*.css',
'htdocs/img/*.png',
'htdocs/js/*.js',
'htdocs/js/dojo/*... | from setuptools import setup
import backlog
PACKAGE = 'TracBacklog'
setup(name=PACKAGE,
version=backlog.get_version(),
packages=['backlog'],
package_data={
'backlog': [
'htdocs/css/*.css',
'htdocs/img/*.png',
'htdocs/js/*.js',
'htdocs/js/dojo/*... | Add simplejson as a requirement for the plugin. | Add simplejson as a requirement for the plugin. | Python | bsd-3-clause | jszakmeister/trac-backlog,jszakmeister/trac-backlog | ---
+++
@@ -20,6 +20,9 @@
]},
entry_points={
'trac.plugins': ['backlog = backlog.web_ui']
- }
+ },
+ install_requires=[
+ 'simplejson>=2.0',
+ ]
)
|
0dd97c8154cb73d709656fbee99b8539d73a3ea6 | setup.py | setup.py | from distutils.core import setup
setup(
name='Logentries',
version='0.7',
author='Mark Lacomber',
author_email='marklacomber@gmail.com',
packages=['logentries'],
scripts=[],
url='http://pypi.python.org/pypi/Logentries/',
license='LICENSE.txt',
description='Python Logger plugin to se... | from distutils.core import setup
setup(
name='Logentries',
version='0.7',
author='Mark Lacomber',
author_email='marklacomber@gmail.com',
packages=['logentries'],
scripts=[],
url='http://pypi.python.org/pypi/Logentries/',
license='LICENSE.txt',
description='Python Logger plugin to se... | Use md instead of rst | Use md instead of rst
| Python | mit | logentries/le_python,jcftang/le_python,drgarcia1986/le_python | ---
+++
@@ -10,7 +10,7 @@
url='http://pypi.python.org/pypi/Logentries/',
license='LICENSE.txt',
description='Python Logger plugin to send logs to Logentries',
- long_description=open('README.rst').read(),
+ long_description=open('README.md').read(),
install_requires=[
"certifi",
... |
8682d4fe70571e6ad06357cd7d1f30559ed177ce | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='ptwit',
version='0.0.9',
description='A simple twitter command line client',
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='ptwit',
version='0.0.9',
description='A simple twitter command line client',
... | Remove 3rd package required version | Remove 3rd package required version
| Python | mit | ptpt/ptwit | ---
+++
@@ -19,7 +19,9 @@
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
+ 'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
'Programmi... |
e093b77da3f914d15ace4d916cbe0ae9543c1327 | setup.py | setup.py | import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
setup(
name = "mobile-city-history",
version = 0.1,
author = "Jan-Christopher Pien",
author_email = "jan_christopher.pien@fokus.fraunhofer.de",
url = "http://www.foo.bar",
license = "MIT",
description = "... | import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
setup(
name = "mobile-city-history",
version = 0.1,
author = "Jan-Christopher Pien",
author_email = "jan_christopher.pien@fokus.fraunhofer.de",
url = "http://www.foo.bar",
license = "MIT",
description = "... | Add mssql to staging branch | Add mssql to staging branch
| Python | mit | fraunhoferfokus/mobile-city-memory,jessepeng/coburg-city-memory,fraunhoferfokus/mobile-city-memory,jessepeng/coburg-city-memory | ---
+++
@@ -20,6 +20,8 @@
"django >= 1.6",
"jsonpickle >= 0.7.0",
"django-apptemplates",
+ "django-mssql >= 1.5",
+ "pywin32 >= 219",
"djangorestframework",
"schedule",
], |
5b7b410d49f82d90b5846edaa523cd8b0a703b07 | setup.py | setup.py | # (c) 2017 Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
from setuptools import setup
import sys
from conda_verify import __version__
if sys.version_info.major == 2:
requirements = ['backports.functools_lru_cache >= 1.4', 'click >= 6.7']
else:
requirements = ['click >= 6.7']
setup(
... | # (c) 2017 Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
from setuptools import setup
import sys
from conda_verify import __version__
if sys.version_info.major == 2:
requirements = ['backports.functools_lru_cache >= 1.4', 'click >= 6.7',
'jinja2 >= 2.9.6']
else:
re... | Add jinja2 as install requirement | Add jinja2 as install requirement
| Python | bsd-3-clause | mandeep/conda-verify | ---
+++
@@ -7,9 +7,10 @@
if sys.version_info.major == 2:
- requirements = ['backports.functools_lru_cache >= 1.4', 'click >= 6.7']
+ requirements = ['backports.functools_lru_cache >= 1.4', 'click >= 6.7',
+ 'jinja2 >= 2.9.6']
else:
- requirements = ['click >= 6.7']
+ requirements ... |
7143e2706dbf78a064b49369a4b17636ef0bf6dd | setup.py | setup.py | from setuptools import find_packages, setup
from setuptools.command.install import install
import os
BASEPATH='.eDisGo'
class InstallSetup(install):
def run(self):
self.create_edisgo_path()
install.run(self)
@staticmethod
def create_edisgo_path():
edisgo_path = os.path.join(os.pa... | from setuptools import find_packages, setup
from setuptools.command.install import install
import os
BASEPATH='.eDisGo'
class InstallSetup(install):
def run(self):
self.create_edisgo_path()
install.run(self)
@staticmethod
def create_edisgo_path():
edisgo_path = os.path.join(os.pa... | Install with dingo version 0.1.2 | Install with dingo version 0.1.2
| Python | agpl-3.0 | openego/eDisGo,openego/eDisGo | ---
+++
@@ -31,14 +31,11 @@
author_email='',
description='A python package for distribution grid analysis and optimization',
install_requires = [
- 'dingo==0.1.0-pre+git.477bf495',
+ 'ding0==0.1.2',
'networkx >=1.11',
'shapely >= 1.5.12, <= 1.5.12',
'pandas >=0.... |
75c10d885c89cd763a065e4eb599ea5032b31fdd | setup.py | setup.py | from setuptools import find_packages, setup
setup(
name="redshift-etl",
version="0.27.0",
author="Harry's Data Engineering and Contributors",
description="ETL code to ferry data from PostgreSQL databases (or S3 files) to Redshift cluster",
license="MIT",
keywords="redshift postgresql etl extra... | from setuptools import find_packages, setup
setup(
name="redshift-etl",
version="0.27.1",
author="Harry's Data Engineering and Contributors",
description="ETL code to ferry data from PostgreSQL databases (or S3 files) to Redshift cluster",
license="MIT",
keywords="redshift postgresql etl extra... | Drop max-concurrency for update in refresh pipeline (invalid arg) | Drop max-concurrency for update in refresh pipeline (invalid arg)
| Python | mit | harrystech/arthur-redshift-etl,harrystech/arthur-redshift-etl,harrystech/arthur-redshift-etl,harrystech/arthur-redshift-etl,harrystech/arthur-redshift-etl | ---
+++
@@ -3,7 +3,7 @@
setup(
name="redshift-etl",
- version="0.27.0",
+ version="0.27.1",
author="Harry's Data Engineering and Contributors",
description="ETL code to ferry data from PostgreSQL databases (or S3 files) to Redshift cluster",
license="MIT", |
67cb72b37ce0e68ceee7943295934f1d1fda179e | setup.py | setup.py | import os
from setuptools import find_packages, setup
from great import __url__
with open(os.path.join(os.path.dirname(__file__), "README.rst")) as readme:
long_description = readme.read()
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: MIT License",
"Operating System... | import os
from setuptools import find_packages, setup
from great import __url__
with open(os.path.join(os.path.dirname(__file__), "README.rst")) as readme:
long_description = readme.read()
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: MIT License",
"Operating System... | Make sure to install the tap. | Make sure to install the tap.
| Python | mit | Julian/Great,Julian/Great,Julian/Great | ---
+++
@@ -21,7 +21,7 @@
setup(
name="great",
- packages=find_packages(),
+ packages=find_packages() + ["twisted.plugins"],
setup_requires=["setuptools_scm"],
use_scm_version=True, |
5d5d55c80b6067e6e785a5b4578124a6759a1cfd | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='django-timepiece',
version=__import__('timepiece').__version__,
author='Caktus Consulting Group',
author_email='solutions@caktusgroup.com',
packages=find_packages(exclude=['example_project']),
include_package_data=True,
url='https://g... | from setuptools import setup, find_packages
setup(
name='django-timepiece',
version=__import__('timepiece').__version__,
author='Caktus Consulting Group',
author_email='solutions@caktusgroup.com',
packages=find_packages(exclude=['example_project']),
include_package_data=True,
url='https://g... | Remove textile requirement from install_requires | Remove textile requirement from install_requires | Python | mit | dannybrowne86/django-timepiece,BocuStudio/django-timepiece,gaga3966/django-timepiece,caktus/django-timepiece,dannybrowne86/django-timepiece,BocuStudio/django-timepiece,arbitrahj/django-timepiece,josesanch/django-timepiece,dannybrowne86/django-timepiece,caktus/django-timepiece,caktus/django-timepiece,gaga3966/django-tim... | ---
+++
@@ -26,7 +26,6 @@
"python-dateutil==1.5",
"django-ajax-selects==1.1.4",
"django-pagination==1.0.7",
- "textile==2.1.4",
"django-selectable==0.2.0",
],
) |
c8360831ab2fa4d5af2929a85beca4a1f33ef9d1 | travis_settings.py | travis_settings.py | # Settings used for running tests in Travis
#
# Load default settings
# noinspection PyUnresolvedReferences
from settings import *
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'alexia_test', ... | # Settings used for running tests in Travis
#
# Load default settings
# noinspection PyUnresolvedReferences
from settings import *
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'alexia_test', ... | Use MySQL database backend in Travis CI. | Use MySQL database backend in Travis CI.
| Python | bsd-3-clause | Inter-Actief/alexia,Inter-Actief/alexia,Inter-Actief/alexia,Inter-Actief/alexia | ---
+++
@@ -8,10 +8,10 @@
# Database
DATABASES = {
'default': {
- 'ENGINE': 'django.db.backends.sqlite3', # 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
+ 'ENGINE': 'django.db.backends.mysql', # 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'alexia_test', ... |
b69f69b0e89a49b427292ec179e12bdee6fb4743 | samples/web/content/testrtc/testrtc.py | samples/web/content/testrtc/testrtc.py | #!/usr/bin/python2.4
#
# Copyright 2014 Google Inc. All Rights Reserved.
"""WebRTC Test
This module serves the WebRTC Test Page.
"""
import cgi
import logging
import os
import jinja2
import webapp2
jinja_environment = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)))
class MainPage... | #!/usr/bin/python2.4
#
# Copyright 2014 Google Inc. All Rights Reserved.
"""WebRTC Test
This module serves the WebRTC Test Page.
"""
import cgi
import logging
import random
import os
import jinja2
import webapp2
jinja_environment = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)))
... | Add ability to download a random file with a given size from any domain. | Add ability to download a random file with a given size from any domain.
| Python | bsd-3-clause | xdumaine/adapter,mulyoved/samples,ralic/testrtc,82488059/apprtc,mauricionr/samples,smayoorans/samples,shelsonjava/testrtc,4lejandrito/adapter,TribeMedia/testrtc,YouthAndra/apprtc,JiYou/apprtc,fetterov/samples,82488059/apprtc,webrtc/samples,TribeMedia/samples,dengshaodong/docker-apprtc,4lejandrito/adapter,diddie06/webrt... | ---
+++
@@ -9,6 +9,7 @@
import cgi
import logging
+import random
import os
import jinja2
import webapp2
@@ -16,13 +17,23 @@
jinja_environment = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)))
+# Generate 10 kilobytes of random data and create a 10MB buffer from it.
+rando... |
95ebac75381580fe3767d7c9e287226a75bc43bf | elections/kenya/lib.py | elections/kenya/lib.py | from __future__ import unicode_literals
import re
def shorten_post_label(post_label):
return re.sub(r'^Member of Parliament for ', '', post_label)
| from __future__ import unicode_literals
import re
def shorten_post_label(post_label):
return re.sub(r'^(County Assembly Member for|Member of the National Assembly for|County Governor for|Women Representative for|Senator for|President of)\s+', '', post_label)
| Implement post label abbreviation for current posts | KE: Implement post label abbreviation for current posts
| Python | agpl-3.0 | mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextrepresentative,mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextmp-popit,mysociety/yournextmp-popit,mysociety/yournextrepresentative | ---
+++
@@ -3,4 +3,4 @@
import re
def shorten_post_label(post_label):
- return re.sub(r'^Member of Parliament for ', '', post_label)
+ return re.sub(r'^(County Assembly Member for|Member of the National Assembly for|County Governor for|Women Representative for|Senator for|President of)\s+', '', post_label) |
17cee8fe32a38f976e8548993fa57857f84943ef | pastas/version.py | pastas/version.py | # This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
__version__ = '0.20.0b'
| # This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
__version__ = '0.20.0'
| Prepare update of Master to v0.20.0 | Prepare update of Master to v0.20.0
| Python | mit | pastas/pastas | ---
+++
@@ -1,3 +1,3 @@
# This is the only location where the version will be written and changed.
# Based on https://packaging.python.org/single_source_version/
-__version__ = '0.20.0b'
+__version__ = '0.20.0' |
3830ef5200f3d1763be5d162f5123cd59ca1da0b | virtualenv/__init__.py | virtualenv/__init__.py | from __future__ import absolute_import, division, print_function
from virtualenv.__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
)
from virtualenv.core import create
def create_environment(
home_dir,
site_packages=False, clear=False,
... | from __future__ import absolute_import, division, print_function
from virtualenv.__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
)
# some support for old api in legacy virtualenv
from virtualenv.core import create
from virtualenv.__main__ impo... | Add a main function (more support for the api in the legacy virtualenv). | Add a main function (more support for the api in the legacy virtualenv).
| Python | mit | ionelmc/virtualenv,ionelmc/virtualenv,ionelmc/virtualenv | ---
+++
@@ -4,8 +4,17 @@
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
)
+
+# some support for old api in legacy virtualenv
from virtualenv.core import create
+from virtualenv.__main__ import main # flake8: noqa
+
+__all__ = [
+ "__title__", "__summa... |
33f1cd2950bf1544f4bb481aa0c31326a5c061ab | examples/rpc_pubsub.py | examples/rpc_pubsub.py | import asyncio
import aiozmq.rpc
class Handler(aiozmq.rpc.AttrHandler):
@aiozmq.rpc.method
def remote_func(self, a: int, b: int):
pass
@asyncio.coroutine
def go():
subscriber = yield from aiozmq.rpc.serve_pubsub(
Handler(), subscribe='topic', bind='tcp://*:*')
subscriber_addr = next... | import asyncio
import aiozmq.rpc
from itertools import count
class Handler(aiozmq.rpc.AttrHandler):
def __init__(self):
self.connected = False
@aiozmq.rpc.method
def remote_func(self, step, a: int, b: int):
self.connected = True
print("HANDLER", step, a, b)
@asyncio.coroutine
d... | Make rpc pubsub example stable | Make rpc pubsub example stable
| Python | bsd-2-clause | aio-libs/aiozmq,asteven/aiozmq,claws/aiozmq,MetaMemoryT/aiozmq | ---
+++
@@ -1,27 +1,42 @@
import asyncio
import aiozmq.rpc
+from itertools import count
class Handler(aiozmq.rpc.AttrHandler):
+ def __init__(self):
+ self.connected = False
+
@aiozmq.rpc.method
- def remote_func(self, a: int, b: int):
- pass
+ def remote_func(self, step, a: int, ... |
fd5507db05429635200d56d4763fe623dfa6a811 | pinax/messages/apps.py | pinax/messages/apps.py | from django.apps import AppConfig as BaseAppConfig
from django.utils.translation import ugettext_lazy as _
class AppConfig(BaseAppConfig):
name = "pinax.messages"
label = "pinax_messages"
verbose_name = _("Pinax Messages")
| from django.apps import AppConfig as BaseAppConfig
from django.utils.translation import gettext_lazy as _
class AppConfig(BaseAppConfig):
name = "pinax.messages"
label = "pinax_messages"
verbose_name = _("Pinax Messages")
| Drop miscellaneous features deprecated in Django 3 | Drop miscellaneous features deprecated in Django 3
https://docs.djangoproject.com/en/dev/releases/3.0/#id3
| Python | mit | pinax/pinax-messages,pinax/pinax-messages | ---
+++
@@ -1,5 +1,5 @@
from django.apps import AppConfig as BaseAppConfig
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
class AppConfig(BaseAppConfig): |
891ce02157c0862f707cab7a140389e0b059acd4 | registration/__init__.py | registration/__init__.py | VERSION = (0, 9, 0, 'beta', 1)
def get_version():
from django.utils.version import get_version as django_get_version
return django_get_version(VERSION) # pragma: no cover
| VERSION = (1, 0, 0, 'final', 0)
def get_version():
"Returns a PEP 386-compliant version number from VERSION."
assert len(VERSION) == 5
assert VERSION[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number:
# main = X.Y[.Z]
# sub = .devN - for pre-alpha releases... | Fix version number reporting so we can be installed before Django. | Fix version number reporting so we can be installed before Django.
| Python | bsd-3-clause | christang/django-registration-1.5,fedenko/django-registration,fedenko/django-registration,christang/django-registration-1.5 | ---
+++
@@ -1,6 +1,22 @@
-VERSION = (0, 9, 0, 'beta', 1)
+VERSION = (1, 0, 0, 'final', 0)
def get_version():
- from django.utils.version import get_version as django_get_version
- return django_get_version(VERSION) # pragma: no cover
+ "Returns a PEP 386-compliant version number from VERSION."
+ asse... |
7b2db239b0862db256722f57241c74d4cc9b42ff | diss/__init__.py | diss/__init__.py |
import os
import hashlib
import magic
from base64 import b64encode, b64decode
from datetime import datetime
from .settings import inventory
from .encryption import random_key, copy_and_encrypt, decrypt_blob
hashing = hashlib.sha256
def add_file(filepath, *, key=None):
"Import a file into Dis."
if not os.p... |
import os
import hashlib
import magic
from base64 import b64encode, b64decode
from datetime import datetime
from .settings import inventory
from .encryption import random_key, copy_and_encrypt, decrypt_blob
hashing = hashlib.sha256
def add_file(filepath, *, key=None):
"Import a file into Dis."
# Resolve s... | Fix mimetype detection on symlink | Fix mimetype detection on symlink
| Python | agpl-3.0 | hoh/Billabong,hoh/Billabong | ---
+++
@@ -14,6 +14,9 @@
def add_file(filepath, *, key=None):
"Import a file into Dis."
+ # Resolve symlinks
+ realpath = os.path.realpath(filepath)
+
if not os.path.isfile(filepath):
raise FileNotFoundError
@@ -28,13 +31,13 @@
meta = {
'key': b64encode(key),
'has... |
421e811242b737a7b1bf27814d70f719f345131b | watchlist/utils.py | watchlist/utils.py | from .models import ShiftSlot, weekday_loc
from website.settings import WORKSHOP_OPEN_DAYS
def get_shift_weekview_rows():
'''Returns a dictionary of shifts for each timeslot, for each weekday'''
slots = ShiftSlot.objects.all()
if not slots:
return None
# Could be troublesome wrt. sorting of di... | from .models import ShiftSlot, weekday_loc
from website.settings import WORKSHOP_OPEN_DAYS
def get_shift_weekview_rows():
'''Returns a dictionary of shifts for each timeslot, for each weekday'''
slots = ShiftSlot.objects.all()
if not slots:
return None
# Could be troublesome wrt. sorting of di... | Order weekday columns in watchlist | Order weekday columns in watchlist
| Python | mit | hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website | ---
+++
@@ -23,7 +23,7 @@
def get_shift_weekview_columns():
'''Returns a list of weekday name column headers to populate a weekview table with'''
- slots = ShiftSlot.objects.all()
+ slots = ShiftSlot.objects.all().order_by('weekday')
if not slots:
return None
|
8db252d2980451a3c2107df64c4438de44781eea | frigg/projects/urls.py | frigg/projects/urls.py | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^projects/approve/$', views.approve_projects, name='approve_projects_overview'),
url(r'^projects/approve/(?P<project_id>\d+)/$', views.approve_projects, name='approve_project'),
url(r'^(?P<owner>[^/]+)/(?P<name>[^/]+).svg$', views.... | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^projects/approve/$', views.approve_projects, name='approve_projects_overview'),
url(r'^projects/approve/(?P<project_id>\d+)/$', views.approve_projects, name='approve_project'),
url(r'^(?P<owner>[^/]+)/(?P<name>[^/]+).svg$', views.... | Add support for specifying branch name to svg badges | Add support for specifying branch name to svg badges
| Python | mit | frigg/frigg-hq,frigg/frigg-hq,frigg/frigg-hq | ---
+++
@@ -6,6 +6,10 @@
url(r'^projects/approve/$', views.approve_projects, name='approve_projects_overview'),
url(r'^projects/approve/(?P<project_id>\d+)/$', views.approve_projects, name='approve_project'),
url(r'^(?P<owner>[^/]+)/(?P<name>[^/]+).svg$', views.build_badge, name='build_badge'),
+ ur... |
9261db252969c69ede633d4a4c02bb87c7bc1434 | quilt/__init__.py | quilt/__init__.py | # vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# python-quilt - A Python implementation of the quilt patch system
#
# Copyright (C) 2012 Björn Ricks <bjoern.ricks@googlemail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as ... | # vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# python-quilt - A Python implementation of the quilt patch system
#
# Copyright (C) 2012 Björn Ricks <bjoern.ricks@googlemail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as ... | Add docstring for main module | Add docstring for main module
| Python | mit | bjoernricks/python-quilt,vadmium/python-quilt | ---
+++
@@ -19,5 +19,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
+""" A python implementation of quilt """
+
__version_info__ = ("0", "1", "dev1")
__version__ = '.'.join(__version_info__)
+ |
17b3ea3fb2af48aa7680b339bb83cba15f842a83 | classes/wechatMessageType.py | classes/wechatMessageType.py | from enum import Enum
class WechatMessageType(Enum):
TEXT = 1
SYSTEM_MESSAGE = 10000
VOICE = 34
EMOTION = 47
VIDEO = 62
CALL = 50
PICTURE = 3
POSITION = 48
CARD = 42
LINK = 49
UNHANDLED = -999 | from enum import Enum
class WechatMessageType(Enum):
TEXT = 1
SYSTEM_MESSAGE = 10000
VOICE = 34
VIDEO1 = 43
EMOTION = 47
VIDEO2 = 62
CALL = 50
PICTURE = 3
POSITION = 48
CARD = 42
LINK = 49
UNHANDLED = -999 | Support wechat message type 43 | Support wechat message type 43
| Python | apache-2.0 | jambus/wechat-analysis | ---
+++
@@ -4,8 +4,9 @@
TEXT = 1
SYSTEM_MESSAGE = 10000
VOICE = 34
+ VIDEO1 = 43
EMOTION = 47
- VIDEO = 62
+ VIDEO2 = 62
CALL = 50
PICTURE = 3
POSITION = 48 |
a7c1ec51aca74785ac309618f9519d4592953d3f | pydispatch/__init__.py | pydispatch/__init__.py | import pkg_resources
try:
__version__ = pkg_resources.require('python-dispatch')[0].version
except: # pragma: no cover
__version__ = 'unknown'
from pydispatch.dispatch import Dispatcher
from pydispatch.properties import *
| import pkg_resources
try:
__version__ = pkg_resources.require('python-dispatch')[0].version
except: # pragma: no cover
__version__ = 'unknown'
from pydispatch.dispatch import Dispatcher, Event
from pydispatch.properties import *
| Make Event object available at root level import | Make Event object available at root level import
| Python | mit | nocarryr/python-dispatch | ---
+++
@@ -5,5 +5,5 @@
except: # pragma: no cover
__version__ = 'unknown'
-from pydispatch.dispatch import Dispatcher
+from pydispatch.dispatch import Dispatcher, Event
from pydispatch.properties import * |
3c4a9c08858378624600a3f64616f03e29d21f31 | actually-do-refunds.py | actually-do-refunds.py | #!/usr/bin/env python -u
from __future__ import absolute_import, division, print_function, unicode_literals
import csv, os, requests
url = 'https://api.balancedpayments.com/debits/{}/refunds'
balanced_api_secret = os.environ['BALANCED_API_SECRET']
inp = csv.reader(open('refunds.csv'))
out = csv.writer(open('refunds.... | #!/usr/bin/env python -u
from __future__ import absolute_import, division, print_function, unicode_literals
from gratipay.billing.payday import threaded_map
import csv, os, requests
import threading
url = 'https://api.balancedpayments.com/debits/{}/refunds'
balanced_api_secret = os.environ['BALANCED_API_SECRET']
inp... | Use threaded_map to speed up refunds | Use threaded_map to speed up refunds
| Python | mit | gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com | ---
+++
@@ -1,17 +1,29 @@
#!/usr/bin/env python -u
from __future__ import absolute_import, division, print_function, unicode_literals
+from gratipay.billing.payday import threaded_map
import csv, os, requests
+import threading
url = 'https://api.balancedpayments.com/debits/{}/refunds'
balanced_api_secret = o... |
0cb87e52f91c85ec99b58f2795c7762354531e7c | python/assemble_BFs.py | python/assemble_BFs.py | import doseresponse as dr
import numpy as np
import itertools as it
import os
import argparse
import sys
parser = argparse.ArgumentParser()
requiredNamed = parser.add_argument_group('required arguments')
requiredNamed.add_argument("--data-file", type=str, help="csv file from which to read in data, in same format as p... | import doseresponse as dr
import numpy as np
import itertools as it
import os
import argparse
import sys
parser = argparse.ArgumentParser()
requiredNamed = parser.add_argument_group('required arguments')
requiredNamed.add_argument("--data-file", type=str, help="csv file from which to read in data, in same format as p... | Unravel index for argmin of array | Unravel index for argmin of array
| Python | bsd-3-clause | mirams/PyHillFit,mirams/PyHillFit,mirams/PyHillFit | ---
+++
@@ -32,8 +32,8 @@
BFs[i, j] = np.loadtxt(bf_file)
-max_idx = np.argmax(BFs)
-min_idx = np.argmin(BFs)
+max_idx = np.unravel_index(np.argmax(BFs), (30,7))
+min_idx = np.unravel_index(np.argmin(BFs), (30,7))
print "max:", BFs[max_idx]
print "min:", BFs[min_idx] |
dbf0fb82263005d90a84ff9011da9849d0a3d0f3 | cards/bjcard.py | cards/bjcard.py | """
Created on Dec 24, 2016
@author: john papa
Copyright 2016 John Papa. All rights reserved.
This work is licensed under the MIT License.
"""
import logging
from .card import Card
class BjCard(Card):
def __init__(self, suit, rank):
super().__init__(suit, rank)
self._logger = logging.getLogger... | """
Created on Dec 24, 2016
@author: john papa
Copyright 2016 John Papa. All rights reserved.
This work is licensed under the MIT License.
"""
import logging
from .card import Card
class BjCard(Card):
def __init__(self, suit, rank):
super().__init__(suit, rank)
self._logger = logging.getLogger... | Change log message to debug | Change log message to debug
| Python | mit | johnpapa2/twenty-one,johnpapa2/twenty-one | ---
+++
@@ -27,5 +27,5 @@
self._value = 10
else:
self._value = 11
- self._logger.info(f"My {self} is worth {self._value} points")
+ self._logger.debug(f"My {self} is worth {self._value} points")
return self._value |
70808dfd53c5a5760a13252a72caf229793e8225 | crawl.py | crawl.py | import urllib2;
from bs4 import BeautifulSoup;
| import urllib.parse;
import urllib.request;
from bs4 import BeautifulSoup;
def searchLink(search):
BASE_URL = "http://www.990.ro/"
key = urllib.parse.urlencode({'kw': search}).encode('ascii');
re = urllib.request.Request(BASE_URL + 'functions/search3/live_search_using_jquery_ajax/search.php', key);
re_link = ur... | Add search method to find the movies/series home url | Add search method to find the movies/series home url
| Python | mit | raztechs/py-video-crawler | ---
+++
@@ -1,2 +1,35 @@
-import urllib2;
+import urllib.parse;
+import urllib.request;
from bs4 import BeautifulSoup;
+
+
+def searchLink(search):
+
+ BASE_URL = "http://www.990.ro/"
+ key = urllib.parse.urlencode({'kw': search}).encode('ascii');
+
+ re = urllib.request.Request(BASE_URL + 'functions/search3/live_se... |
e03bc2013adb21154a1fc2b4737d92f649325154 | utils.py | utils.py | import re
import textwrap
import html2text
text_maker = html2text.HTML2Text()
text_maker.body_width = 0
def strip_html_tags(text):
text = re.sub(r'<a.*?</a>', '', text)
return re.sub('<[^<]+?>', '', text)
def html_to_md(string, strip_html=True, markdown=False):
if not string:
return 'No Descri... | import re
import textwrap
import html2text
text_maker = html2text.HTML2Text()
text_maker.body_width = 0
def strip_html_tags(text):
text = re.sub(r'<a.*?</a>', '', text)
return re.sub('<[^<]+?>', '', text)
def html_to_md(string, strip_html=True, markdown=False):
if not string:
return 'No Descri... | Create a new string, instead of modifying the `template` | Create a new string, instead of modifying the `template`
| Python | mit | avinassh/Laozi,avinassh/Laozi | ---
+++
@@ -38,6 +38,6 @@
url = book_data['url']
tip = 'Use author name also for better search results'
- template = template.format(title, authors, average_rating, ratings_count,
+ response = template.format(title, authors, average_rating, ratings_count,
description,... |
eea8b5622ced613cde54e6d09cd98f6483543dfd | tests/test_parser2.py | tests/test_parser2.py | import support
from html5lib import html5parser
from html5lib.treebuilders import dom
import unittest
# tests that aren't autogenerated from text files
class MoreParserTests(unittest.TestCase):
def test_assertDoctypeCloneable(self):
parser = html5parser.HTMLParser(tree=dom.TreeBuilder)
doc = parser.parse('... | import support
from html5lib import html5parser
from html5lib.treebuilders import dom
import unittest
# tests that aren't autogenerated from text files
class MoreParserTests(unittest.TestCase):
def test_assertDoctypeCloneable(self):
parser = html5parser.HTMLParser(tree=dom.TreeBuilder)
doc = parser.parse('... | Add a test case to ensure that this continues to work | Add a test case to ensure that this continues to work
--HG--
extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40952
| Python | mit | alex/html5lib-python,html5lib/html5lib-python,mgilson/html5lib-python,mindw/html5lib-python,ordbogen/html5lib-python,mgilson/html5lib-python,mindw/html5lib-python,html5lib/html5lib-python,dstufft/html5lib-python,alex/html5lib-python,ordbogen/html5lib-python,mindw/html5lib-python,dstufft/html5lib-python,html5lib/html5li... | ---
+++
@@ -12,6 +12,11 @@
doc = parser.parse('<!DOCTYPE HTML>')
self.assert_(doc.cloneNode(True))
+ def test_line_counter(self):
+ # http://groups.google.com/group/html5lib-discuss/browse_frm/thread/f4f00e4a2f26d5c0
+ parser = html5parser.HTMLParser(tree=dom.TreeBuilder)
+ parser.parse("<pre>\n... |
7d362cfc37398a22440173fa7209224a2542778e | eng100l/ambulances/urls.py | eng100l/ambulances/urls.py | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^update/(?P<pk>[0-9]+)$',
views.AmbulanceUpdateView.as_view(),
name="ambulance_update"),
url(r'^info/(?P<pk>[0-9]+)$',
views.AmbulanceInfoView.as_view(),
name="ambulance_info"),
url(r'... | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^update/(?P<pk>[0-9]+)$',
views.AmbulanceUpdateView.as_view(),
name="ambulance_update"),
url(r'^info/(?P<pk>[0-9]+)$',
views.AmbulanceInfoView.as_view(),
name="ambulance_info"),
url(r'... | Simplify URL for ambulance creation | Simplify URL for ambulance creation
| Python | bsd-3-clause | EMSTrack/WebServerAndClient,EMSTrack/WebServerAndClient,EMSTrack/WebServerAndClient | ---
+++
@@ -11,7 +11,7 @@
views.AmbulanceInfoView.as_view(),
name="ambulance_info"),
- url(r'^ambulance_create$',
+ url(r'^create$',
views.AmbulanceCreateView.as_view(),
name="ambulance_create"),
] |
9fba993ea52df48de8d812c1ad0128d48c8ab4cf | classes/room.py | classes/room.py | class Room(object):
def __init__(self, room_name, room_type, max_persons):
self.room_name = room_name
self.room_type = room_type
self.max_persons = max_persons
self.persons = []
def add_occupant(self, person):
if len(self.persons) < self.max_persons:
self.pe... | class Room(object):
def __init__(self, room_name, room_type, max_persons):
self.room_name = room_name
self.room_type = room_type
self.max_persons = max_persons
self.persons = []
def add_occupant(self, person):
if len(self.persons) < self.max_persons:
self.per... | Add Error statement to add_occupant method for when max capacity is reached | Add Error statement to add_occupant method for when max capacity is reached
| Python | mit | peterpaints/room-allocator | ---
+++
@@ -5,9 +5,9 @@
self.max_persons = max_persons
self.persons = []
-
def add_occupant(self, person):
if len(self.persons) < self.max_persons:
self.persons.append(person)
+ print (person.person_type.title() + " " + person.person_name.title() + " " + perso... |
d9fc2cfdcfaf13f2e8491ace60680f3c94ad5c83 | tests/test_async.py | tests/test_async.py | try:
import asyncio
loop = asyncio.get_event_loop()
except ImportError:
asyncio = None
import pexpect
import unittest
@unittest.skipIf(asyncio is None, "Requires asyncio")
class AsyncTests(unittest.TestCase):
def test_simple_expect(self):
p = pexpect.spawn('cat')
p.sendline('Hello asyn... | try:
import asyncio
except ImportError:
asyncio = None
import pexpect
import unittest
def run(coro):
return asyncio.get_event_loop().run_until_complete(coro)
@unittest.skipIf(asyncio is None, "Requires asyncio")
class AsyncTests(unittest.TestCase):
def test_simple_expect(self):
p = pexpect.sp... | Expand tests for async expect | Expand tests for async expect
| Python | isc | dongguangming/pexpect,quatanium/pexpect,crdoconnor/pexpect,Depado/pexpect,crdoconnor/pexpect,dongguangming/pexpect,crdoconnor/pexpect,Wakeupbuddy/pexpect,nodish/pexpect,Wakeupbuddy/pexpect,blink1073/pexpect,nodish/pexpect,quatanium/pexpect,bangi123/pexpect,dongguangming/pexpect,bangi123/pexpect,quatanium/pexpect,Depado... | ---
+++
@@ -1,23 +1,42 @@
try:
import asyncio
- loop = asyncio.get_event_loop()
except ImportError:
asyncio = None
import pexpect
import unittest
+def run(coro):
+ return asyncio.get_event_loop().run_until_complete(coro)
+
@unittest.skipIf(asyncio is None, "Requires asyncio")
class AsyncTest... |
aaac1ae0667dabe6fd038c9f5a42c157b9457ef1 | tests/test_parse.py | tests/test_parse.py | from hypothesis_auto import auto_pytest_magic
from isort import parse
from isort.settings import default
TEST_CONTENTS = """
import xyz
import abc
def function():
pass
"""
def test_file_contents():
(
in_lines,
out_lines,
import_index,
place_imports,
import_placement... | from hypothesis_auto import auto_pytest_magic
from isort import parse
from isort.settings import Config
TEST_CONTENTS = """
import xyz
import abc
def function():
pass
"""
def test_file_contents():
(
in_lines,
out_lines,
import_index,
place_imports,
import_placements... | Fix use of default config to match new refactor | Fix use of default config to match new refactor
| Python | mit | PyCQA/isort,PyCQA/isort | ---
+++
@@ -1,7 +1,7 @@
from hypothesis_auto import auto_pytest_magic
from isort import parse
-from isort.settings import default
+from isort.settings import Config
TEST_CONTENTS = """
import xyz
@@ -30,7 +30,7 @@
line_separator,
sections,
section_comments,
- ) = parse.file_conte... |
39309bb0b8fe088b6576cfbf4d744f58ca6b1b0b | tests/test_quiz1.py | tests/test_quiz1.py | from playwright.sync_api import sync_playwright
def run(playwright):
browser = playwright.chromium.launch(headless=False, slow_mo=100)
context = browser.new_context()
# Open new page
page = context.new_page()
page.goto("http://pyar.github.io/PyZombis/master/quiz/Quiz1.html")
page.... | def test_quiz1_2(page):
page.goto("/quiz/Quiz1.html")
page.click("text=def metros_a_milimetros(n):")
page.press("text=def metros_a_milimetros(n):", "ArrowDown")
page.press("text=def metros_a_milimetros(n):", "Tab")
page.type("text=def metros_a_milimetros(n):", "return n * 1000")
pa... | Convert sample test to pytest | Convert sample test to pytest
| Python | agpl-3.0 | PyAr/PyZombis,PyAr/PyZombis,PyAr/PyZombis | ---
+++
@@ -1,13 +1,5 @@
-from playwright.sync_api import sync_playwright
-
-def run(playwright):
- browser = playwright.chromium.launch(headless=False, slow_mo=100)
- context = browser.new_context()
-
- # Open new page
- page = context.new_page()
-
- page.goto("http://pyar.github.io/PyZombis/master/qu... |
254ecc95cdd0c2809328634e50882ea42fb32105 | tests/test_utils.py | tests/test_utils.py | import pytest
from bonsai.utils import escape_filter_exp
from bonsai.utils import escape_attribute_value
def test_escape_attribute_value():
""" Test escaping special characters in attribute values. """
assert (
escape_attribute_value(" dummy=test,something+somethingelse")
== r"\ dummy\=test\,... | import pytest
from bonsai.utils import escape_filter_exp
from bonsai.utils import escape_attribute_value
from bonsai.utils import set_connect_async
def test_escape_attribute_value():
""" Test escaping special characters in attribute values. """
assert (
escape_attribute_value(" dummy=test,something+s... | Add simple call test for set_connect_async | Add simple call test for set_connect_async
| Python | mit | Noirello/PyLDAP,Noirello/bonsai,Noirello/PyLDAP,Noirello/PyLDAP,Noirello/bonsai,Noirello/bonsai | ---
+++
@@ -2,6 +2,7 @@
from bonsai.utils import escape_filter_exp
from bonsai.utils import escape_attribute_value
+from bonsai.utils import set_connect_async
def test_escape_attribute_value():
@@ -20,3 +21,12 @@
assert escape_filter_exp("cn=*") == "cn=\\2A"
assert escape_filter_exp("\\backslash") ... |
bff2488c184e142bfbf31e945b593e18db707dcc | conda_env/cli/main_export.py | conda_env/cli/main_export.py | from argparse import RawDescriptionHelpFormatter
from copy import copy
import yaml
from conda.cli import common
from conda.cli import main_list
from conda import install
description = """
Export a given environment
"""
example = """
examples:
conda env export
conda env export --file SOME_FILE
"""
def conf... | from argparse import RawDescriptionHelpFormatter
from copy import copy
import yaml
from conda.cli import common
from conda.cli import main_list
from conda import install
description = """
Export a given environment
"""
example = """
examples:
conda env export
conda env export --file SOME_FILE
"""
def conf... | Fix to use pip style == | Fix to use pip style ==
| Python | bsd-3-clause | isaac-kit/conda-env,conda/conda-env,nicoddemus/conda-env,isaac-kit/conda-env,phobson/conda-env,phobson/conda-env,mikecroucher/conda-env,asmeurer/conda-env,dan-blanchard/conda-env,conda/conda-env,ESSS/conda-env,dan-blanchard/conda-env,nicoddemus/conda-env,ESSS/conda-env,mikecroucher/conda-env,asmeurer/conda-env | ---
+++
@@ -43,6 +43,6 @@
pip_pkgs = sorted(installed - conda_pkgs)
dependencies = ['='.join(a.rsplit('-', 2)) for a in sorted(conda_pkgs)]
- dependencies.append({'pip': ['='.join(a.rsplit('-', 2)[:2]) for a in pip_pkgs]})
+ dependencies.append({'pip': ['=='.join(a.rsplit('-', 2)[:2]) for a in pip_p... |
5503a615db51a6ae0461cc0417c61ba508a43eae | ufyr/storage/utils.py | ufyr/storage/utils.py | from os import chmod, unlink, stat, makedirs
from os.path import isfile, split, exists
from shutil import copyfile
def move_verify_delete(in_file, out_file):
'''
Moves in_file to out_file, verifies that the filesizes are the same and
then does a chmod 666
'''
if not exists(split(out_file)[0]):
... | from os import chmod, unlink, stat, makedirs
from os.path import isfile, split, exists
from shutil import copyfile
def move_verify_delete(in_file, out_file, overwrite=False):
'''
Moves in_file to out_file, verifies that the filesizes are the same and
then does a chmod 666
'''
if not exists(split(ou... | Add in overwrite output file | Add in overwrite output file
| Python | unlicense | timeartist/ufyr | ---
+++
@@ -2,7 +2,7 @@
from os.path import isfile, split, exists
from shutil import copyfile
-def move_verify_delete(in_file, out_file):
+def move_verify_delete(in_file, out_file, overwrite=False):
'''
Moves in_file to out_file, verifies that the filesizes are the same and
then does a chmod 666
@@... |
4d55b1bde81c9f426da97f474d759ba8b0a94650 | cpt/test/unit/config_test.py | cpt/test/unit/config_test.py | import unittest
from conans.errors import ConanException
from cpt.config import ConfigManager
from cpt.printer import Printer
from cpt.test.integration.base import BaseTest
from cpt.test.unit.packager_test import MockConanAPI
class RemotesTest(unittest.TestCase):
def setUp(self):
self.conan_api = MockC... | import unittest
from conans.errors import ConanException
from cpt.config import ConfigManager
from cpt.printer import Printer
from cpt.test.integration.base import BaseTest
from cpt.test.unit.packager_test import MockConanAPI
class RemotesTest(unittest.TestCase):
def setUp(self):
self.conan_api = MockC... | Update Bincrafters config url for tests | Update Bincrafters config url for tests
Signed-off-by: Uilian Ries <d4bad57018205bdda203549c36d3feb0bfe416a7@gmail.com>
| Python | mit | conan-io/conan-package-tools | ---
+++
@@ -15,11 +15,11 @@
def test_valid_config(self):
manager = ConfigManager(self.conan_api, Printer())
- manager.install('https://github.com/bincrafters/conan-config.git')
+ manager.install('https://github.com/bincrafters/bincrafters-config.git')
def test_valid_config_with_ar... |
f55f965c4102e2d7230ace39a0eecdaf585538ea | blaze/expr/scalar/boolean.py | blaze/expr/scalar/boolean.py | import operator
from datashape import dshape
from .core import Scalar, BinOp, UnaryOp
class BooleanInterface(Scalar):
def __not__(self):
return Not(self)
def __and__(self, other):
return And(self, other)
def __or__(self, other):
return Or(self, other)
class Boolean(BooleanInter... | import operator
from datashape import dshape
from .core import Scalar, BinOp, UnaryOp
class BooleanInterface(Scalar):
def __invert__(self):
return Invert(self)
def __and__(self, other):
return And(self, other)
def __or__(self, other):
return Or(self, other)
class Boolean(Boolea... | Use __invert__ instead of __not__ | Use __invert__ instead of __not__
| Python | bsd-3-clause | LiaoPan/blaze,caseyclements/blaze,cpcloud/blaze,cowlicks/blaze,caseyclements/blaze,jdmcbr/blaze,dwillmer/blaze,nkhuyu/blaze,scls19fr/blaze,mrocklin/blaze,cowlicks/blaze,dwillmer/blaze,cpcloud/blaze,xlhtc007/blaze,jcrist/blaze,maxalbert/blaze,jdmcbr/blaze,ChinaQuants/blaze,ContinuumIO/blaze,maxalbert/blaze,mrocklin/blaz... | ---
+++
@@ -4,8 +4,8 @@
class BooleanInterface(Scalar):
- def __not__(self):
- return Not(self)
+ def __invert__(self):
+ return Invert(self)
def __and__(self, other):
return And(self, other)
@@ -65,6 +65,7 @@
class Not(UnaryOp, Boolean):
+ symbol = '~'
op = opera... |
367d5d6196c3c21e2d1353b258801e6d5e14e602 | xos/core/models/node.py | xos/core/models/node.py | import os
from django.db import models
from core.models import PlCoreBase
from core.models.plcorebase import StrippedCharField
from core.models import Site, SiteDeployment, SitePrivilege
from core.models import Tag
from django.contrib.contenttypes import generic
# Create your models here.
class Node(PlCoreBase):
... | import os
from django.db import models
from core.models import PlCoreBase
from core.models.plcorebase import StrippedCharField
from core.models import Site, SiteDeployment, SitePrivilege
from core.models import Tag
from django.contrib.contenttypes import generic
# Create your models here.
class Node(PlCoreBase):
... | Make Node syncs a noop | Make Node syncs a noop
| Python | apache-2.0 | jermowery/xos,cboling/xos,cboling/xos,cboling/xos,jermowery/xos,cboling/xos,xmaruto/mcord,jermowery/xos,xmaruto/mcord,xmaruto/mcord,cboling/xos,jermowery/xos,xmaruto/mcord | ---
+++
@@ -16,6 +16,10 @@
def __unicode__(self): return u'%s' % (self.name)
+ def __init__(self, *args, **kwargs):
+ super(Node, self).__init__(*args, **kwargs)
+ self.no_sync=True
+
def save(self, *args, **kwds):
if self.site is None and self.site_deployment is not None:
... |
7a5d11229ff68735c16993c61c3a44e6b5ece7a8 | simple_model/__version__.py | simple_model/__version__.py | __author__ = 'Luiz Menezes'
__title__ = 'simple-model'
__version__ = '2.0.2'
| __author__ = 'Luiz Menezes'
__title__ = 'simple-model'
__version__ = '2.0.3'
| Fix version preparation to 2.0.3 | Fix version preparation to 2.0.3
| Python | mit | lamenezes/simple-model | ---
+++
@@ -1,3 +1,3 @@
__author__ = 'Luiz Menezes'
__title__ = 'simple-model'
-__version__ = '2.0.2'
+__version__ = '2.0.3' |
b706c31fe24e4e940108882f420c0509cce94970 | django_databrowse/plugins/objects.py | django_databrowse/plugins/objects.py | from django import http
from django.core.exceptions import ObjectDoesNotExist
from django_databrowse.datastructures import EasyModel
from django_databrowse.sites import DatabrowsePlugin
from django.shortcuts import render_to_response
import urlparse
class ObjectDetailPlugin(DatabrowsePlugin):
def model_view(self, ... | from django import http
from django.core.exceptions import ObjectDoesNotExist
from django_databrowse.datastructures import EasyModel
from django_databrowse.sites import DatabrowsePlugin
from django.shortcuts import render_to_response
from django.template import RequestContext
import urlparse
class ObjectDetailPlugin(D... | Add RequestContext for object detail | Add RequestContext for object detail
| Python | bsd-3-clause | Alir3z4/django-databrowse,Alir3z4/django-databrowse | ---
+++
@@ -3,6 +3,7 @@
from django_databrowse.datastructures import EasyModel
from django_databrowse.sites import DatabrowsePlugin
from django.shortcuts import render_to_response
+from django.template import RequestContext
import urlparse
class ObjectDetailPlugin(DatabrowsePlugin):
@@ -28,5 +29,5 @@
... |
f8ff675f8c9a4ef2b370e5254d33b97261a9d8ca | byceps/util/sentry.py | byceps/util/sentry.py | """
byceps.util.sentry
~~~~~~~~~~~~~~~~~~
Sentry_ integration
.. _Sentry: https://sentry.io/
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import Flask
def configure_sentry_for_webapp(dsn: str, environment: str, app: Flask) -> None:
"""Initialize an... | """
byceps.util.sentry
~~~~~~~~~~~~~~~~~~
Sentry_ integration
.. _Sentry: https://sentry.io/
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import Flask
def configure_sentry_for_webapp(dsn: str, environment: str, app: Flask) -> None:
"""Initialize an... | Set Sentry `site_id` tag only in site app mode | Set Sentry `site_id` tag only in site app mode
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | ---
+++
@@ -24,8 +24,11 @@
dsn=dsn, environment=environment, integrations=[FlaskIntegration()],
)
- sentry_sdk.set_tag('app_mode', app.config.get('APP_MODE'))
- sentry_sdk.set_tag('site_id', app.config.get('SITE_ID'))
+ app_mode = app.config.get('APP_MODE')
+ sentry_sdk.set_tag('app_mode',... |
04b0f21bee9cfef54f4c1138296f86c9694dba95 | geotrek/common/__init__.py | geotrek/common/__init__.py | """
Geotrek startup script.
This is executed only once at startup.
"""
from south.signals import post_migrate
from django.conf import settings
from mapentity.helpers import api_bbox
from geotrek.common.utils.postgresql import load_sql_files
"""
http://djangosnippets.org/snippets/2311/
Ensure Sout... | """
Geotrek startup script.
This is executed only once at startup.
"""
from south.signals import post_migrate
from django.conf import settings
from mapentity.helpers import api_bbox
from geotrek.common.utils.postgresql import load_sql_files
"""
http://djangosnippets.org/snippets/2311/
Ensure Sout... | Increase viewport margin (10% was not enough for small screens) | Increase viewport margin (10% was not enough for small screens)
| Python | bsd-2-clause | makinacorpus/Geotrek,makinacorpus/Geotrek,mabhub/Geotrek,GeotrekCE/Geotrek-admin,Anaethelion/Geotrek,makinacorpus/Geotrek,johan--/Geotrek,mabhub/Geotrek,camillemonchicourt/Geotrek,mabhub/Geotrek,GeotrekCE/Geotrek-admin,mabhub/Geotrek,Anaethelion/Geotrek,johan--/Geotrek,camillemonchicourt/Geotrek,johan--/Geotrek,makinac... | ---
+++
@@ -30,4 +30,4 @@
Computed client-side setting.
"""
-settings.LEAFLET_CONFIG['SPATIAL_EXTENT'] = api_bbox(settings.SPATIAL_EXTENT, buffer=0.1)
+settings.LEAFLET_CONFIG['SPATIAL_EXTENT'] = api_bbox(settings.SPATIAL_EXTENT, buffer=0.5) |
1b7d84526ac7650f18851610ebef47bdfef828ea | scripts/galaxy/gedlab.py | scripts/galaxy/gedlab.py | """
k-mer count and presence
"""
from galaxy.datatypes.binary import Binary
import os
import logging
log = logging.getLogger(__name__)
class Count(Binary):
def __init__(self, **kwd):
Binary.__init__(self, **kwd)
class Presence(Binary):
def __init__(self, **kwd):
Binary.__init__(self, **... | """
k-mer count and presence
"""
from galaxy.datatypes.binary import Binary
import logging
log = logging.getLogger(__name__)
class Count(Binary):
def __init__(self, **kwd):
Binary.__init__(self, **kwd)
class Presence(Binary):
def __init__(self, **kwd):
Binary.__init__(self, **kwd)
Bina... | Fix pylint warning: Unused import os | Fix pylint warning: Unused import os
| Python | bsd-3-clause | Winterflower/khmer,kdmurray91/khmer,souravsingh/khmer,jas14/khmer,kdmurray91/khmer,Winterflower/khmer,F1000Research/khmer,jas14/khmer,ged-lab/khmer,kdmurray91/khmer,ged-lab/khmer,F1000Research/khmer,ged-lab/khmer,F1000Research/khmer,jas14/khmer,Winterflower/khmer,souravsingh/khmer,souravsingh/khmer | ---
+++
@@ -4,7 +4,6 @@
from galaxy.datatypes.binary import Binary
-import os
import logging
log = logging.getLogger(__name__) |
cbd9c312b857565bfebc2d9f8452453ca333ba92 | giles.py | giles.py | #!/usr/bin/env python2
# Giles: giles.py, the main loop.
# Copyright 2012 Phil Bordelon
#
# This program 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 op... | #!/usr/bin/env python2
# Giles: giles.py, the main loop.
# Copyright 2012 Phil Bordelon
#
# This program 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 op... | Support choosing a port on the command line. | Support choosing a port on the command line.
Just put a number as the only CLI for now. Useful for me testing
changes now that I'm actually keeping the server running.
| Python | agpl-3.0 | sunfall/giles | ---
+++
@@ -16,7 +16,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import giles.server
+import sys
server = giles.server.Server()
-server.instantiate()
+
+if len(sys.argv) == 2:
+ port = int(sys.argv[1])
+else:
+ port = 9435
+server.instantiate(port)
server.loop() |
5d2f585779bef5e8bd82e7f4e7b46818153af711 | build.py | build.py | from conan.packager import ConanMultiPackager
if __name__ == "__main__":
builder = ConanMultiPackager()
builder.add_common_builds(pure_c=False)
builder.run()
| from conan.packager import ConanMultiPackager
if __name__ == "__main__":
builder = ConanMultiPackager()
builder.add_common_builds(pure_c=False)
builds = []
for settings, options, env_vars, build_requires, reference in builder.items:
settings["cppstd"] = 14
builds.append([settings, optio... | Use std 14 in CI | CI: Use std 14 in CI
| Python | mit | zhuhaow/libnekit,zhuhaow/libnekit,zhuhaow/libnekit,zhuhaow/libnekit | ---
+++
@@ -3,4 +3,9 @@
if __name__ == "__main__":
builder = ConanMultiPackager()
builder.add_common_builds(pure_c=False)
+ builds = []
+ for settings, options, env_vars, build_requires, reference in builder.items:
+ settings["cppstd"] = 14
+ builds.append([settings, options, env_vars, ... |
6b4f4f07c442705f76294b9ec9a37d3d02ca1551 | run_tests.py | run_tests.py | #!/usr/bin/env python
import os, sys, re, shutil
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
import django
from django.core.management import call_command
names = next((a for a in sys.argv[1:] if not a.startswith('-')), None)
if names and re.search(r'^\d+$', names):
names = 'tests.tests.IssueTests.tes... | #!/usr/bin/env python
import os, sys, re, shutil
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
import django
from django.core.management import call_command
names = next((a for a in sys.argv[1:] if not a.startswith('-')), None)
if not names:
names = 'tests'
elif re.search(r'^\d+$', names):
names = '... | Allow running separate test files | Allow running separate test files
With e.g.:
./runtests.py tests.tests_transactions
| Python | bsd-3-clause | rutube/django-cacheops,Suor/django-cacheops,LPgenerator/django-cacheops,ErwinJunge/django-cacheops,bourivouh/django-cacheops | ---
+++
@@ -6,12 +6,12 @@
from django.core.management import call_command
names = next((a for a in sys.argv[1:] if not a.startswith('-')), None)
-if names and re.search(r'^\d+$', names):
+if not names:
+ names = 'tests'
+elif re.search(r'^\d+$', names):
names = 'tests.tests.IssueTests.test_' + names
-elif... |
a5ce33cf60deb5a1045a0bf693b58eb20dbad8d2 | sshkeys_update.py | sshkeys_update.py | #!/usr/bin/python
import config, store, os
standalone_py = os.path.join(os.path.dirname(__file__), 'standalone.py')
c = config.Config("config.ini")
s = store.Store(c)
cursor = s.get_cursor()
cursor.execute("lock table sshkeys in exclusive mode") # to prevent simultaneous updates
cursor.execute("select u.name,s.key from... | #!/usr/bin/python
import config, store, os
standalone_py = os.path.join(os.path.dirname(__file__), 'standalone.py')
c = config.Config("config.ini")
s = store.Store(c)
cursor = s.get_cursor()
cursor.execute("lock table sshkeys in exclusive mode") # to prevent simultaneous updates
cursor.execute("select u.name,s.key from... | Make sure to write in ~submit's authorized_keys. | Make sure to write in ~submit's authorized_keys.
| Python | bsd-3-clause | pydotorg/pypi,pydotorg/pypi,pydotorg/pypi,pydotorg/pypi | ---
+++
@@ -10,7 +10,7 @@
for name, key in cursor.fetchall():
lines.append('command="%s -r %s",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s\n' %
(standalone_py, name, key))
-f = open('.ssh/authorized_keys', 'wb')
+f = open(os.path.expanduser('~submit/.ssh/authorized_keys'... |
90284fabbbbb1f6e7bda1cf33bdc39a1d76a25d4 | jarviscli/plugins/voice.py | jarviscli/plugins/voice.py | from plugin import plugin
@plugin('enable sound')
def enable_sound(jarvis, s):
"""Let Jarvis use his voice."""
jarvis.enable_voice()
@plugin('disable sound')
def disable_sound(jarvis, s):
"""Deny Jarvis his voice."""
jarvis.disable_voice()
@plugin('say')
def say(jarvis, s):
"""Reads what is ty... | from plugin import plugin
@plugin('enable sound')
def enable_sound(jarvis, s):
"""Let Jarvis use his voice."""
jarvis.enable_voice()
@plugin('disable sound')
def disable_sound(jarvis, s):
"""Deny Jarvis his voice."""
jarvis.disable_voice()
@plugin('say')
def say(jarvis, s):
"""Reads what is ty... | Add plugins for talking faster and slower | Add plugins for talking faster and slower
| Python | mit | sukeesh/Jarvis,sukeesh/Jarvis,sukeesh/Jarvis,sukeesh/Jarvis | ---
+++
@@ -24,3 +24,12 @@
jarvis.say(s)
if not voice_state:
jarvis.disable_voice()
+
+# TODO: Add a message if voice is disabled
+@plugin('talk faster')
+def talk_faster(jarvis, s):
+ jarvis.change_speech_rate(25)
+
+@plugin('talk slower')
+def talk_slower(jarvis, s):
+ jarvis.ch... |
cbabdf4210313f934ae90d9a853834d9494b3ad5 | tests/conftest.py | tests/conftest.py | import pytest
from tests.utils import PYTEST_6
pytest_plugins = "pytester"
def pytest_generate_tests(metafunc):
if "pytest_params" in metafunc.fixturenames:
if PYTEST_6:
parametrizations = [
pytest.param([], id="no-import-mode"),
pytest.param(["--import-mode=p... | import pytest
from tests.utils import PYTEST_6
pytest_plugins = "pytester"
def pytest_generate_tests(metafunc):
if "pytest_params" in metafunc.fixturenames:
if PYTEST_6:
parametrizations = [
pytest.param([], id="no-import-mode"),
pytest.param(["--import-mode=p... | Add configuration to collect types from pytest runs | Add configuration to collect types from pytest runs
| Python | mit | pytest-dev/pytest-bdd | ---
+++
@@ -20,3 +20,30 @@
"pytest_params",
parametrizations,
)
+
+
+# TODO: Remove these before merge
+def pytest_collection_finish(session):
+ """Handle the pytest collection finish hook: configure pyannotate.
+ Explicitly delay importing `collect_types` until all tests have... |
2f1d32ba80816e3880a464a63d8f3f549a2be9e2 | tests/__init__.py | tests/__init__.py | import os
try: # 2.7
# pylint: disable = E0611,F0401
from unittest.case import SkipTest
# pylint: enable = E0611,F0401
except ImportError:
try: # Nose
from nose.plugins.skip import SkipTest
except ImportError: # Failsafe
class SkipTest(Exception):
pass
from mopidy impor... | import os
try: # 2.7
# pylint: disable = E0611,F0401
from unittest.case import SkipTest
# pylint: enable = E0611,F0401
except ImportError:
try: # Nose
from nose.plugins.skip import SkipTest
except ImportError: # Failsafe
class SkipTest(Exception):
pass
from mopidy impor... | Add IsA helper to tests to provde any_int, any_str and any_unicode | Add IsA helper to tests to provde any_int, any_str and any_unicode
| Python | apache-2.0 | bencevans/mopidy,diandiankan/mopidy,ZenithDK/mopidy,vrs01/mopidy,liamw9534/mopidy,dbrgn/mopidy,swak/mopidy,jodal/mopidy,SuperStarPL/mopidy,jmarsik/mopidy,bacontext/mopidy,woutervanwijk/mopidy,ali/mopidy,pacificIT/mopidy,woutervanwijk/mopidy,quartz55/mopidy,jmarsik/mopidy,dbrgn/mopidy,mokieyue/mopidy,bencevans/mopidy,mo... | ---
+++
@@ -22,3 +22,22 @@
path = os.path.abspath(path)
return os.path.join(path, name)
+class IsA(object):
+ def __init__(self, klass):
+ self.klass = klass
+
+ def __eq__(self, rhs):
+ try:
+ return isinstance(rhs, self.klass)
+ except TypeError:
+ return... |
4ef14e5c791fbced79474e82a4268fb15d1c7854 | tests/conftest.py | tests/conftest.py | def setup_hypothesis():
from hypothesis import settings, Verbosity
settings.register_profile("ci", max_examples=1000)
settings.register_profile("dev", max_examples=10)
settings.register_profile("debug", max_examples=10, verbosity=Verbosity.verbose)
setup_hypothesis()
| def setup_hypothesis():
from hypothesis import settings, Verbosity
settings.register_profile("lots", max_examples=100_000)
settings.register_profile("ci", max_examples=1000)
settings.register_profile("dev", max_examples=10)
settings.register_profile("debug", max_examples=10, verbosity=Verbosity.ver... | Add a “lots” Hypothesis profile (max_examples=100_000) | tests: Add a “lots” Hypothesis profile (max_examples=100_000)
This is useful when testing that a new test is (likely) not flaky.
| Python | artistic-2.0 | ppb/ppb-vector,ppb/ppb-vector | ---
+++
@@ -1,6 +1,7 @@
def setup_hypothesis():
from hypothesis import settings, Verbosity
+ settings.register_profile("lots", max_examples=100_000)
settings.register_profile("ci", max_examples=1000)
settings.register_profile("dev", max_examples=10)
settings.register_profile("debug", max_exa... |
cf9012ff2f6bf745d46f35923f95b6ce0b9d91e1 | homeful/views.py | homeful/views.py | from django.shortcuts import render
import logging
from homeful.hud_helper import getSeattleFairMarketRents, getSeattleMultiFamilyProperties
logger = logging.getLogger(__name__)
def index(request):
context = {}
return render(request, 'homeful/index.html', context)
def list(request):
zipcode = request.GET... | from django.shortcuts import render
import logging
from homeful.hud_helper import getSeattleFairMarketRents, getSeattleMultiFamilyProperties
logger = logging.getLogger(__name__)
def index(request):
context = {}
return render(request, 'homeful/index.html', context)
def list(request):
zipcode = request.GET... | Add zipcode filter for MFPs. | Add zipcode filter for MFPs.
| Python | mit | happyhousing/happyhousing | ---
+++
@@ -24,6 +24,8 @@
if fmr['area'] == u'Seattle-Bellevue, WA HUD Metro FMR Area':
seattle_fmr = fmr
+ mfps = filterByZipcode(zipcode, mfps)
+
context['mfps'] = mfps
context['rooms'] = rooms
@@ -33,3 +35,8 @@
context['price_range'] = "$" + "{0:.2f}".format(... |
fdd75e81f6d71a8f82abdd79cff6ecd20cbfdb6d | 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__)))
PNUM = 50
def run_integration_tests():
prin... | Add some pretty to the unit tests | Add some pretty to the unit tests
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | ---
+++
@@ -10,18 +10,32 @@
TEST_DIR = os.path.dirname(os.path.normpath(os.path.abspath(__file__)))
+PNUM = 50
+
def run_integration_tests():
+ print '~' * PNUM
+ print 'Setting up Salt daemons to execute tests'
+ print '~' * PNUM
with TestDaemon():
moduleloader = saltunittest.TestLoader(... |
dd877d22080d8417709fe4b5afacec8f0b32a226 | sendsms.py | sendsms.py | #! /usr/bin/env python3
"""sendsms.py: program for sending SMS."""
from sys import argv
from googlevoice import Voice
from googlevoice.util import LoginError
# E-mail SMTP settings
with open('/home/nick/dev/prv/serupbot/email_password.txt') as email_password:
password = email_password.read().strip()
def send(... | #! /usr/bin/env python3
"""sendsms.py: program for sending SMS."""
from sys import argv
from googlevoice import Voice
from googlevoice.util import LoginError
# E-mail SMTP settings
with open('/home/nick/dev/prv/serupbot/email_password.txt') as email_password:
password = email_password.read().strip()
# Google v... | Include exception when trying send_sms function. | Include exception when trying send_sms function.
| Python | mpl-2.0 | nicorellius/server-upbot | ---
+++
@@ -11,13 +11,13 @@
with open('/home/nick/dev/prv/serupbot/email_password.txt') as email_password:
password = email_password.read().strip()
+# Google voice accaount for nicorellius.mail: (503) 850-8390
+# USERNAME = 'nicorellius.mail@gmail.com'
+USERNAME = 'nicorellius.mail'
+PASSWORD = password
+
... |
621c69b22c6364020cf1ed66e4563bd7b43263fc | src/pytest_django_casperjs/fixtures.py | src/pytest_django_casperjs/fixtures.py | import os
import pytest
from pytest_django.lazy_django import skip_if_no_django
@pytest.fixture(scope='session')
def casper_js(request):
skip_if_no_django()
from pytest_django_casperjs.helper import CasperJSLiveServer
addr = request.config.getvalue('liveserver')
if not addr:
addr = os.gete... | import os
import pytest
from pytest_django.lazy_django import skip_if_no_django
@pytest.fixture(scope='session')
def casper_js(request):
skip_if_no_django()
from pytest_django_casperjs.helper import CasperJSLiveServer
addr = request.config.getvalue('liveserver')
if not addr:
addr = os.gete... | Remove the helper-fixture, we make transactions explicit. Will write documentation about that | Remove the helper-fixture, we make transactions explicit. Will write documentation about that
| Python | bsd-3-clause | EnTeQuAk/pytest-django-casperjs | ---
+++
@@ -21,9 +21,3 @@
request.addfinalizer(server.stop)
return server
-
-
-@pytest.fixture(autouse=True, scope='function')
-def _casper_js_live_server_helper(request):
- if 'capser_js' in request.funcargnames:
- request.getfuncargvalue('transactional_db') |
a3c768ab90d1354441d90699049f7dd946e683c2 | cleverhans/future/torch/attacks/__init__.py | cleverhans/future/torch/attacks/__init__.py | # pylint: disable=missing-docstring
from cleverhans.future.torch.attacks.fast_gradient_method import fast_gradient_method
from cleverhans.future.torch.attacks.projected_gradient_descent import projected_gradient_descent
from cleverhans.future.torch.attacks.noise import noise
from cleverhans.future.torch.attacks.semanti... | # pylint: disable=missing-docstring
from cleverhans.future.torch.attacks.fast_gradient_method import fast_gradient_method
from cleverhans.future.torch.attacks.projected_gradient_descent import projected_gradient_descent
from cleverhans.future.torch.attacks.noise import noise
from cleverhans.future.torch.attacks.semanti... | Allow spsa to be imported from cleverhans.future.torch.attacks | Allow spsa to be imported from cleverhans.future.torch.attacks
| Python | mit | cleverhans-lab/cleverhans,cleverhans-lab/cleverhans,cleverhans-lab/cleverhans | ---
+++
@@ -3,3 +3,4 @@
from cleverhans.future.torch.attacks.projected_gradient_descent import projected_gradient_descent
from cleverhans.future.torch.attacks.noise import noise
from cleverhans.future.torch.attacks.semantic import semantic
+from cleverhans.future.torch.attacks.spsa import spsa |
e572dcb08e9c89d11c4702927561ef9c2ebc3cb1 | custos/notify/http.py | custos/notify/http.py | import logging
import requests
from .base import Notifier
log = logging.getLogger(__name__)
class HTTPNotifier(Notifier):
''' A Notifier that sends http post request to a given url '''
def __init__(self, auth=None, **kwargs):
'''
Create a new HTTPNotifier
:param auth: If given, auth... | import logging
import requests
from .base import Notifier
log = logging.getLogger(__name__)
class HTTPNotifier(Notifier):
''' A Notifier that sends http post request to a given url '''
def __init__(self, auth=None, json=True, **kwargs):
'''
Create a new HTTPNotifier
:param auth: If ... | Add option to send message as json payload in HTTPNotifier | Add option to send message as json payload in HTTPNotifier
| Python | mit | fact-project/pycustos | ---
+++
@@ -8,12 +8,14 @@
class HTTPNotifier(Notifier):
''' A Notifier that sends http post request to a given url '''
- def __init__(self, auth=None, **kwargs):
+ def __init__(self, auth=None, json=True, **kwargs):
'''
Create a new HTTPNotifier
:param auth: If given, auth i... |
c47c334eb10c331266a2469c0975698722c2cbb4 | towel/mt/forms.py | towel/mt/forms.py | """
Forms
=====
These three form subclasses will automatically add limitation by tenant
to all form fields with a ``queryset`` attribute.
.. warning::
If you customized the dropdown using ``choices`` you have to limit the
choices by the current tenant yourself.
"""
from django import forms
from towel impor... | """
Forms
=====
These three form subclasses will automatically add limitation by tenant
to all form fields with a ``queryset`` attribute.
.. warning::
If you customized the dropdown using ``choices`` you have to limit the
choices by the current tenant yourself.
"""
from django import forms
from towel impor... | Stop being secretive about it | Stop being secretive about it
| Python | bsd-3-clause | matthiask/towel,matthiask/towel,matthiask/towel,matthiask/towel | ---
+++
@@ -30,19 +30,19 @@
class Form(forms.Form):
def __init__(self, *args, **kwargs):
- self._request = kwargs.pop('request')
+ self.request = kwargs.pop('request')
super(Form, self).__init__(*args, **kwargs)
- _process_fields(self, self._request)
+ _process_fields(self... |
70ee0532f68a08fa12ba7bbfb217273ca8ef7a48 | bluesky/tests/test_simulators.py | bluesky/tests/test_simulators.py | from bluesky.plans import scan
from bluesky.simulators import print_summary, print_summary_wrapper
def test_print_summary(motor_det):
motor, det = motor_det
print_summary(scan([det], motor, -1, 1, 10))
list(print_summary_wrapper(scan([det], motor, -1, 1, 10)))
| from bluesky.plans import scan
from bluesky.simulators import print_summary, print_summary_wrapper
import pytest
def test_print_summary(motor_det):
motor, det = motor_det
print_summary(scan([det], motor, -1, 1, 10))
list(print_summary_wrapper(scan([det], motor, -1, 1, 10)))
def test_old_module_name(motor... | Test that plan_tools import works but warns. | TST: Test that plan_tools import works but warns.
| Python | bsd-3-clause | ericdill/bluesky,ericdill/bluesky | ---
+++
@@ -1,8 +1,17 @@
from bluesky.plans import scan
from bluesky.simulators import print_summary, print_summary_wrapper
+import pytest
def test_print_summary(motor_det):
motor, det = motor_det
print_summary(scan([det], motor, -1, 1, 10))
list(print_summary_wrapper(scan([det], motor, -1, 1, 1... |
b748de5c965219688562819b3cabad1b7ee357d1 | ibis/__init__.py | ibis/__init__.py | # Copyright 2014 Cloudera 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, so... | # Copyright 2014 Cloudera 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, so... | Add desc to ibis namespace | Add desc to ibis namespace
| Python | apache-2.0 | mariusvniekerk/ibis,koverholt/ibis,shaunstanislaus/ibis,deepfield/ibis,Supermem/ibis,o0neup/ibis,ibis-project/ibis,ashhher3/ibis,fivejjs/ibis,Supermem/ibis,koverholt/ibis,cloudera/ibis,laserson/ibis,mahantheshhv/ibis,cloudera/ibis,korotkyn/ibis,Winterflower/ibis,ibis-project/ibis,fivejjs/ibis,adamobeng/ibis,dboyliao/ib... | ---
+++
@@ -16,6 +16,8 @@
import ibis.expr.api as api
import ibis.expr.types as ir
+from ibis.expr.api import desc
+
import ibis.config_init
from ibis.config import options
|
e43c03fbb04de6ef067a22b62ce5c8049020831a | cw_find_the_unique_number.py | cw_find_the_unique_number.py | """Codewars: Find the unique number
6 kyu
URL: https://www.codewars.com/kata/find-the-unique-number-1/
There is an array with some numbers. All numbers are equal except for one.
Try to find it!
find_uniq([ 1, 1, 1, 2, 1, 1 ]) == 2
find_uniq([ 0, 0, 0.55, 0, 0 ]) == 0.55
It’s guaranteed that array contains more than... | """Codewars: Find the unique number
6 kyu
URL: https://www.codewars.com/kata/find-the-unique-number-1/
There is an array with some numbers. All numbers are equal except for one.
Try to find it!
find_uniq([ 1, 1, 1, 2, 1, 1 ]) == 2
find_uniq([ 0, 0, 0.55, 0, 0 ]) == 0.55
It's guaranteed that array contains more than... | Complete dict sol w/ time/space complexity | Complete dict sol w/ time/space complexity
| Python | bsd-2-clause | bowen0701/algorithms_data_structures | ---
+++
@@ -9,7 +9,7 @@
find_uniq([ 1, 1, 1, 2, 1, 1 ]) == 2
find_uniq([ 0, 0, 0.55, 0, 0 ]) == 0.55
-It’s guaranteed that array contains more than 3 numbers.
+It's guaranteed that array contains more than 3 numbers.
The tests contain some very huge arrays, so think about performance.
@@ -20,12 +20,34 @@
""... |
9ca11ae97ac21d6525da853c9ec3e8007939d187 | Lib/xml/__init__.py | Lib/xml/__init__.py | """Core XML support for Python.
This package contains three sub-packages:
dom -- The W3C Document Object Model. This supports DOM Level 1 +
Namespaces.
parsers -- Python wrappers for XML parsers (currently only supports Expat).
sax -- The Simple API for XML, developed by XML-Dev, led by David
Meggins... | """Core XML support for Python.
This package contains three sub-packages:
dom -- The W3C Document Object Model. This supports DOM Level 1 +
Namespaces.
parsers -- Python wrappers for XML parsers (currently only supports Expat).
sax -- The Simple API for XML, developed by XML-Dev, led by David
Meggins... | Use Guido's trick for always extracting the version number from a CVS Revision string correctly, even under -kv. | Use Guido's trick for always extracting the version number from a
CVS Revision string correctly, even under -kv.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | ---
+++
@@ -15,7 +15,10 @@
__all__ = ["dom", "parsers", "sax"]
-__version__ = "$Revision$".split()[1]
+# When being checked-out without options, this has the form
+# "<dollar>Revision: x.y </dollar>"
+# When exported using -kv, it is "x.y".
+__version__ = "$Revision$".split()[-2][0]
_MINIMUM_XMLPLUS_VERSION... |
2b1cc5b2426994953e8f8b937364d91f4e7aadf2 | MyHub/MyHub/urls.py | MyHub/MyHub/urls.py | from django.conf.urls import patterns, include, url
from MyHub.home.views import home_page
from MyHub.resume.views import resume_page
from MyHub.projects.views import projects_page
from MyHub.contact.views import contact_page
from MyHub.views import loader_page
from django.contrib import admin
from django.conf import s... | from django.conf.urls import patterns, include, url
from MyHub.home.views import home_page
from MyHub.resume.views import resume_page
from MyHub.projects.views import projects_page
from MyHub.contact.views import contact_page
from MyHub.views import loader_page
from django.contrib import admin
from django.conf import s... | Change default URL to display home content. Temporary fix. | Change default URL to display home content. Temporary fix.
| Python | mit | sebastienbarbier/sebastienbarbier.com,sebastienbarbier/sebastienbarbier.com,sebastienbarbier/sebastienbarbier.com,sebastienbarbier/sebastienbarbier.com | ---
+++
@@ -14,10 +14,10 @@
# url(r'^$', 'MyHub.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
- url(r'^$', loader_page, name='loader'),
- url(r'^home/$', home_page, name='index'),
- url(r'^resume/$', resume_page, name='resume'),
- url(r'^projects/$', projects_page, name='p... |
86a26fb8a2f9754a27763cb04292735bc31d0fe7 | admin/subjects/views.py | admin/subjects/views.py | from django.contrib.auth.mixins import PermissionRequiredMixin
from django.core.urlresolvers import reverse_lazy
from django.views.generic import ListView, UpdateView
from admin.subjects.forms import SubjectForm
from osf.models.subject import Subject
from osf.models.preprint_provider import PreprintProvider
class Su... | from django.contrib.auth.mixins import PermissionRequiredMixin
from django.core.urlresolvers import reverse_lazy
from django.views.generic import ListView, UpdateView
from admin.subjects.forms import SubjectForm
from osf.models.subject import Subject
from osf.models.preprint_provider import PreprintProvider
class Su... | Change permission to correct codename of change_subject | Change permission to correct codename of change_subject
| Python | apache-2.0 | felliott/osf.io,sloria/osf.io,Johnetordoff/osf.io,Johnetordoff/osf.io,Johnetordoff/osf.io,baylee-d/osf.io,TomBaxter/osf.io,felliott/osf.io,icereval/osf.io,crcresearch/osf.io,icereval/osf.io,caneruguz/osf.io,aaxelb/osf.io,chennan47/osf.io,aaxelb/osf.io,brianjgeiger/osf.io,pattisdr/osf.io,HalcyonChimera/osf.io,adlius/osf... | ---
+++
@@ -28,7 +28,7 @@
class SubjectUpdateView(PermissionRequiredMixin, UpdateView):
form_class = SubjectForm
model = SubjectForm.Meta.model
- permission_required = 'osf.edit_subject'
+ permission_required = 'osf.change_subject'
raise_exception = True
def get_success_url(self, *args, *... |
d0651d590f558f69f2c09230daf59336ac3f6406 | molo/core/api/constants.py | molo/core/api/constants.py | from collections import namedtuple
CONTENT_TYPES = [
("core.ArticlePage", "Article"),
("core.SectionPage", "Section"),
]
ENDPOINTS = [
("page", "api/v1/pages")
]
SESSION_VARS = namedtuple(
"SESSION_VARS",
["first", "second", ]
)
ARTICLE_SESSION_VARS = SESSION_VARS(
first=("url", "content_typ... | from collections import namedtuple
CONTENT_TYPES = [
("core.ArticlePage", "Article"),
("core.SectionPage", "Section"),
]
ENDPOINTS = [
("page", "api/v1/pages")
]
SESSION_VARS = namedtuple(
"SESSION_VARS",
["first", "second", ]
)
ARTICLE_SESSION_VARS = SESSION_VARS(
first=("url", "article_con... | Change article session variable names | Change article session variable names
| Python | bsd-2-clause | praekelt/molo,praekelt/molo,praekelt/molo,praekelt/molo | ---
+++
@@ -15,8 +15,8 @@
)
ARTICLE_SESSION_VARS = SESSION_VARS(
- first=("url", "content_type"),
- second="parent_page_id"
+ first=("url", "article_content_type"),
+ second="article_parent_page_id"
)
API_PAGES_ENDPOINT = "/api/v2/pages/" |
818023e8bdfe607efe9c31bfd70487b0195c4861 | Scapy/ip_forward.py | Scapy/ip_forward.py | #!/etc/usr/python
from scapy.all import *
import sys
iface = "eth0"
filter = "ip"
#victim in this case is the initiator
VICTIM_IP = "192.168.1.121"
MY_IP = "192.168.1.154"
# gateway is the target
GATEWAY_IP = "192.168.1.171"
#VICTIM_MAC = "### don't want so show###"
MY_MAC = "08:00:27:7B:80:18"
#target mac address
GA... | #!/etc/usr/python
from scapy.all import *
import sys
iface = "eth0"
filter = "ip"
#victim in this case is the initiator
VICTIM_IP = "192.168.1.121"
MY_IP = "192.168.1.154"
# gateway is the target
GATEWAY_IP = "192.168.1.171"
#VICTIM_MAC = "### don't want so show###"
MY_MAC = "08:00:27:7b:80:18"
#target mac address
GA... | Add ip forwarding and packet by packet sniffing code. | Add ip forwarding and packet by packet sniffing code.
| Python | mit | illinoistech-itm/pykkon,illinoistech-itm/pykkon,Illinois-tech-ITM/BSMP-2016-ISCSI-Packet-Injection,Illinois-tech-ITM/BSMP-2016-ISCSI-Packet-Injection,illinoistech-itm/pykkon,Illinois-tech-ITM/BSMP-2016-ISCSI-Packet-Injection | ---
+++
@@ -11,7 +11,7 @@
# gateway is the target
GATEWAY_IP = "192.168.1.171"
#VICTIM_MAC = "### don't want so show###"
-MY_MAC = "08:00:27:7B:80:18"
+MY_MAC = "08:00:27:7b:80:18"
#target mac address
GATEWAY_MAC = "08:00:27:24:08:34"
@@ -20,10 +20,11 @@
# we change the packet destination to the targe... |
a65d65ce536a0a6dbc01f7f31db4bbabd08ec223 | project_template/project_settings.py | project_template/project_settings.py | # Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `project_settings_local.py`
from icekit.project.settings.glamkit import * # glamkit, icekit
# Override the def... | # Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `project_settings_local.py`
from icekit.project.settings.icekit import * # glamkit, icekit
# Override the defa... | Use ICEkit settings by default again. | Use ICEkit settings by default again.
| Python | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | ---
+++
@@ -4,6 +4,6 @@
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `project_settings_local.py`
-from icekit.project.settings.glamkit import * # glamkit, icekit
+from icekit.project.settings.icekit import * # glamkit, icekit
# Override the def... |
46f3067650001454ed99351cc5569813a378dcec | mopidy_jukebox/frontend.py | mopidy_jukebox/frontend.py | import pykka
from mopidy import core
class JukeboxFrontend(pykka.ThreadingActor, core.CoreListener):
def __init__(self, config, core):
super(JukeboxFrontend, self).__init__()
self.core = core
def track_playback_ended(self, tl_track, time_position):
# Remove old votes
pass
... | import pykka
from mopidy import core
from models import Vote
class JukeboxFrontend(pykka.ThreadingActor, core.CoreListener):
def __init__(self, config, core):
super(JukeboxFrontend, self).__init__()
self.core = core
core.tracklist.set_consume(True)
def track_playback_ended(self, tl_... | Delete votes when track is over. | Delete votes when track is over.
| Python | mit | qurben/mopidy-jukebox,qurben/mopidy-jukebox,qurben/mopidy-jukebox | ---
+++
@@ -1,16 +1,19 @@
import pykka
from mopidy import core
+
+from models import Vote
class JukeboxFrontend(pykka.ThreadingActor, core.CoreListener):
def __init__(self, config, core):
super(JukeboxFrontend, self).__init__()
self.core = core
+ core.tracklist.set_consume(True)... |
afb1f8ed42c9b4f909f857cd960b526a0a31a901 | src/librement/debug/urls.py | src/librement/debug/urls.py | from django.conf.urls.defaults import patterns, url, include
from django.conf import settings
urlpatterns = patterns('librement.debug.views',
)
if settings.DEBUG:
urlpatterns += patterns('django.views.static',
url(r'^media/(?P<path>.*)$', 'serve',
{'document_root': settings.STATIC_MEDIA_ROOT}... | from django.conf.urls.defaults import patterns, url, include
from django.conf import settings
urlpatterns = patterns('librement.debug.views',
)
if settings.DEBUG:
urlpatterns += patterns('django.views.static',
url(r'^media/(?P<path>.*)$', 'serve',
{'document_root': settings.STATIC_MEDIA_ROOT}... | Enable the user panel properly. | Enable the user panel properly.
Signed-off-by: Chris Lamb <29e6d179a8d73471df7861382db6dd7e64138033@debian.org>
| Python | agpl-3.0 | rhertzog/librement,rhertzog/librement,rhertzog/librement | ---
+++
@@ -16,3 +16,7 @@
urlpatterns += patterns('librement.debug.views',
url(r'^(?P<code>404|500)$', 'error'),
)
+
+ urlpatterns += patterns('',
+ url(r'', include('debug_toolbar_user_panel.urls')),
+ ) |
2336a72c878a58ef8a3a1f47f6ecf9ee9574feca | project_name/project_name/urls.py | project_name/project_name/urls.py | from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
from django.contrib import admin
from django.conf import settings
import views
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', TemplateView.as_view(template_name... | from django.conf.urls import include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
from django.contrib import admin
from django.conf import settings
import views
admin.autodiscover()
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='{{project_name}}/ba... | Update url pattern syntax for django 1.10 | Update url pattern syntax for django 1.10
| Python | mit | tom-henderson/django-template,tom-henderson/django-template | ---
+++
@@ -1,4 +1,4 @@
-from django.conf.urls import patterns, include, url
+from django.conf.urls import include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
from django.contrib import admin
@@ -8,12 +8,12 @@
admin.autodiscover()
-urlpatterns = patterns('',
+... |
7ec478f769350485b6c468308f0785e1d45b0fa8 | testmodel/webapp/selenium/test/templates-test.py | testmodel/webapp/selenium/test/templates-test.py | import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class TemplateTestCase(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.addCleanup(self.browser.quit)
self.browser.get('http://localhost:8080/intermine-test/templates.... | import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class TemplateTestCase(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.addCleanup(self.browser.quit)
self.browser.get('http://localhost:8080/intermine-demo/templates.... | Use the same app as deployed by the setup script | Use the same app as deployed by the setup script
Former-commit-id: 8fa2a956df16ece64642433626314625326d275c | Python | lgpl-2.1 | julie-sullivan/phytomine,julie-sullivan/phytomine,julie-sullivan/phytomine,julie-sullivan/phytomine,julie-sullivan/phytomine,julie-sullivan/phytomine,julie-sullivan/phytomine | ---
+++
@@ -7,7 +7,7 @@
def setUp(self):
self.browser = webdriver.Firefox()
self.addCleanup(self.browser.quit)
- self.browser.get('http://localhost:8080/intermine-test/templates.do')
+ self.browser.get('http://localhost:8080/intermine-demo/templates.do')
def elem(self, sele... |
470752a778476d27fd5f13445b8cd8a79b722591 | cfgov/cfgov/settings/local.py | cfgov/cfgov/settings/local.py | from .base import *
DEBUG = True
INSTALLED_APPS += ('wagtail.contrib.wagtailstyleguide',)
DATABASES = {
'default': {
'ENGINE': MYSQL_ENGINE,
'NAME': os.environ.get('MYSQL_NAME'),
'USER': os.environ.get('MYSQL_USER'),
'PASSWORD': os.environ.get('MYSQL_PW', ''),
'HOST': os.en... | from .base import *
DEBUG = True
INSTALLED_APPS += ('wagtail.contrib.wagtailstyleguide',)
DATABASES = {
'default': {
'ENGINE': MYSQL_ENGINE,
'NAME': os.environ.get('MYSQL_NAME'),
'USER': os.environ.get('MYSQL_USER'),
'PASSWORD': os.environ.get('MYSQL_PW', ''),
'HOST': os.en... | Allow init_command to be set by env | Allow init_command to be set by env
| Python | cc0-1.0 | kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh | ---
+++
@@ -11,7 +11,7 @@
'PASSWORD': os.environ.get('MYSQL_PW', ''),
'HOST': os.environ.get('MYSQL_HOST', ''), # empty string == localhost
'PORT': os.environ.get('MYSQL_PORT', ''), # empty string == default
- 'OPTIONS': {'init_command': 'SET storage_engine=MYISAM', },
+ 'OP... |
a56b69ef48acb0badf04625650dfdc25d1517a81 | resdk/tests/functional/resolwe/e2e_resolwe.py | resdk/tests/functional/resolwe/e2e_resolwe.py | # pylint: disable=missing-docstring
from resdk.tests.functional.base import BaseResdkFunctionalTest
class TestDataUsage(BaseResdkFunctionalTest):
expected_fields = {
'user_id',
'username',
'full_name',
'data_size',
'data_size_normalized',
'data_count',
'dat... | # pylint: disable=missing-docstring
from resdk.tests.functional.base import BaseResdkFunctionalTest
class TestDataUsage(BaseResdkFunctionalTest):
expected_fields = {
'user_id',
'username',
'full_name',
'data_size',
'data_size_normalized',
'data_count',
'dat... | Support collection statistics in data usage tests | Support collection statistics in data usage tests
| Python | apache-2.0 | genialis/resolwe-bio-py | ---
+++
@@ -12,6 +12,8 @@
'data_size_normalized',
'data_count',
'data_count_normalized',
+ 'collection_count',
+ 'collection_count_normalized',
'sample_count',
'sample_count_normalized',
} |
3956293089e500ef1f7d665bc3fcf45706fc5d6b | kombu_fernet/serializers/__init__.py | kombu_fernet/serializers/__init__.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import os
from cryptography.fernet import Fernet, InvalidToken
fernet = Fernet(os.environ['KOMBU_FERNET_KEY'])
def fernet_encode(func):
def inner(message):
return fernet.encrypt(func(message))
return inner
def fernet_de... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import os
from cryptography.fernet import Fernet, InvalidToken
fernet = Fernet(os.environ['KOMBU_FERNET_KEY'])
fallback_fernet = None
try:
fallback_fernet = Fernet(os.environ['OLD_KOMBU_FERNET_KEY'])
except KeyError:
pass
def f... | Add ability to in-place rotate fernet key. | Add ability to in-place rotate fernet key.
| Python | mit | heroku/kombu-fernet-serializers | ---
+++
@@ -5,16 +5,26 @@
from cryptography.fernet import Fernet, InvalidToken
fernet = Fernet(os.environ['KOMBU_FERNET_KEY'])
+fallback_fernet = None
+try:
+ fallback_fernet = Fernet(os.environ['OLD_KOMBU_FERNET_KEY'])
+except KeyError:
+ pass
+
def fernet_encode(func):
def inner(message):
... |
2dac6ebe5bb2185fead39e28bb805ddb473f8aff | gunicorn_cfg.py | gunicorn_cfg.py | """
This file contains gunicorn settings.
To run sqmpy with gunicorn run the following command:
gunicorn -c gunicorn_cfg.py run:app
In order to daemonize gunicorn add -D flag:
gunicorn -c gunicorn_cfg.py run:app -D
"""
import multiprocessing
# Gunicorn will listen on the given host:port
bind = '0.0.0.0:50... | """
This file contains gunicorn settings.
To run sqmpy with gunicorn run the following command:
gunicorn -c gunicorn_cfg.py run:app
In order to daemonize gunicorn add -D flag:
gunicorn -c gunicorn_cfg.py run:app -D
"""
import multiprocessing
# Gunicorn will listen on the given host:port
bind = '0.0.0.0:50... | Disable SSL for default run | Disable SSL for default run
| Python | bsd-3-clause | simphony/sqmpy,mehdisadeghi/sqmpy,mehdisadeghi/sqmpy,mehdisadeghi/sqmpy,simphony/sqmpy,simphony/sqmpy | ---
+++
@@ -28,8 +28,8 @@
daemon = False
# Comment only for development. Use your own certificates here.
-keyfile = 'server.key'
-certfile = 'server.crt'
+#keyfile = 'server.key'
+#certfile = 'server.crt'
# Application log level
loglevel = 'debug' |
212b5a126e464ff46e60e00846bbb87a2de3fbb2 | seleniumbase/config/proxy_list.py | seleniumbase/config/proxy_list.py | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | Update the sample proxy list | Update the sample proxy list
| Python | mit | mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase | ---
+++
@@ -24,7 +24,6 @@
PROXY_LIST = {
"example1": "152.26.66.140:3128", # (Example) - set your own proxy here
"example2": "64.235.204.107:8080", # (Example) - set your own proxy here
- "example3": "82.200.233.4:3128", # (Example) - set your own proxy here
"proxy1": None,
"proxy2": None,
... |
b0ef175fbf5e71c0dbfa8761b5b01b1bc4ff171d | seleniumbase/config/proxy_list.py | seleniumbase/config/proxy_list.py | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | Update the example proxy list | Update the example proxy list
| Python | mit | mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase | ---
+++
@@ -23,7 +23,7 @@
PROXY_LIST = {
"example1": "152.179.12.86:3128", # (Example) - set your own proxy here
- "example2": "176.9.79.126:3128", # (Example) - set your own proxy here
+ "example2": "socks4://50.197.210.138:32100", # (Example)
"proxy1": None,
"proxy2": None,
"proxy3":... |
d88c1221e2d07b300f29ef2605acea18c9e7fbf2 | test/tiny.py | test/tiny.py | from mpipe import OrderedStage, Pipeline
def increment(value):
return value + 1
def double(value):
return value * 2
stage1 = OrderedStage(increment, 3)
stage2 = OrderedStage(double, 3)
stage1.link(stage2)
pipe = Pipeline(stage1)
for number in range(10):
pipe.put(number)
pipe.put(None)
for result in pip... | from mpipe import OrderedStage, Pipeline
def increment(value):
return value + 1
def double(value):
return value * 2
stage1 = OrderedStage(increment, 3)
stage2 = OrderedStage(double, 3)
pipe = Pipeline(stage1.link(stage2))
for number in range(10):
pipe.put(number)
pipe.put(None)
for result in pipe.resu... | Use multi-link pipeline construction syntax. | Use multi-link pipeline construction syntax.
| Python | mit | vmlaker/mpipe | ---
+++
@@ -8,12 +8,12 @@
stage1 = OrderedStage(increment, 3)
stage2 = OrderedStage(double, 3)
-stage1.link(stage2)
-pipe = Pipeline(stage1)
+pipe = Pipeline(stage1.link(stage2))
for number in range(10):
pipe.put(number)
pipe.put(None)
+
for result in pipe.results():
print(result) |
11526af359a19446aa95a74833028329f8969107 | src/common/database.py | src/common/database.py | import pymongo
class Database:
URI = 'mongodb://127.0.0.1:27017'
DATABASE = None
@staticmethod
def initialize():
client = pymongo.MongoClient(Database.URI)
Database.DATABASE = client['fullstack']
@staticmethod
def insert(collection, data):
"""Insert data into a collection"""
Database.DATABASE[collectio... | Add common db static methods | Add common db static methods
| Python | apache-2.0 | asimonia/pricing-alerts,asimonia/pricing-alerts | ---
+++
@@ -0,0 +1,25 @@
+import pymongo
+
+class Database:
+ URI = 'mongodb://127.0.0.1:27017'
+ DATABASE = None
+
+ @staticmethod
+ def initialize():
+ client = pymongo.MongoClient(Database.URI)
+ Database.DATABASE = client['fullstack']
+
+ @staticmethod
+ def insert(collection, data):
+ """Insert data into a co... | |
5864b503bced36d51ab911d5b306284dbc0cdb13 | rest_framework_simplejwt/settings.py | rest_framework_simplejwt/settings.py | from __future__ import unicode_literals
from datetime import timedelta
from django.conf import settings
from rest_framework.settings import APISettings
USER_SETTINGS = getattr(settings, 'SIMPLE_JWT', None)
DEFAULTS = {
'AUTH_HEADER_TYPE': 'Bearer',
'USER_ID_FIELD': 'id',
'USER_ID_CLAIM': 'user_id',
... | from __future__ import unicode_literals
from datetime import timedelta
from django.conf import settings
from rest_framework.settings import APISettings
USER_SETTINGS = getattr(settings, 'SIMPLE_JWT', None)
DEFAULTS = {
'AUTH_HEADER_TYPE': 'Bearer',
'USER_ID_FIELD': 'id',
'USER_ID_CLAIM': 'user_id',
... | Make sliding token lifetime defaults a bit more conservative | Make sliding token lifetime defaults a bit more conservative
| Python | mit | davesque/django-rest-framework-simplejwt,davesque/django-rest-framework-simplejwt | ---
+++
@@ -14,10 +14,10 @@
'USER_ID_CLAIM': 'user_id',
'TOKEN_TYPE_CLAIM': 'token_type',
+ 'SLIDING_REFRESH_EXP_CLAIM': 'refresh_exp',
- 'SLIDING_REFRESH_EXP_CLAIM': 'refresh_exp',
- 'SLIDING_TOKEN_LIFETIME': timedelta(days=1),
- 'SLIDING_TOKEN_REFRESH_LIFETIME': timedelta(days=3),
+ 'SL... |
1c9f3b95cca8439ec8c4a5a5cb1959e8b2edaff2 | osmaxx-py/excerptconverter/converter_helper.py | osmaxx-py/excerptconverter/converter_helper.py | from django.contrib import messages
from django.core.mail import send_mail
from django.utils.translation import ugettext_lazy as _
import stored_messages
from osmaxx.excerptexport import models
class ConverterHelper:
def __init__(self, extraction_order):
self.extraction_order = extraction_order
... | from django.contrib import messages
from django.core.mail import send_mail
from django.utils.translation import ugettext_lazy as _
import stored_messages
from osmaxx.excerptexport import models
# functions using database (extraction_order) must be instance methods of a class
# -> free functions will not work: datab... | Document reason for class instead of free function | Document reason for class instead of free function
| Python | isc | geometalab/drf-utm-zone-info,geometalab/drf-utm-zone-info,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx | ---
+++
@@ -7,6 +7,8 @@
from osmaxx.excerptexport import models
+# functions using database (extraction_order) must be instance methods of a class
+# -> free functions will not work: database connection error
class ConverterHelper:
def __init__(self, extraction_order):
self.extraction_order = extr... |
010416fd3888aeae2ab0b50a5d9b02ad23f5cab3 | setup.py | setup.py | import sys
from setuptools import setup
if sys.version_info < (2, 6):
raise Exception('Wiggelen requires Python 2.6 or higher.')
# Todo: How does this play with pip freeze requirement files?
requires = ['nose']
# Python 2.6 does not include the argparse module.
try:
import argparse
except ImportError:
re... | import sys
from setuptools import setup
if sys.version_info < (2, 6):
raise Exception('Wiggelen requires Python 2.6 or higher.')
# Todo: How does this play with pip freeze requirement files?
requires = ['nose']
# Python 2.6 does not include the argparse module.
try:
import argparse
except ImportError:
re... | Use README.rst as long description for PyPi | Use README.rst as long description for PyPi
| Python | mit | martijnvermaat/wiggelen | ---
+++
@@ -13,13 +13,16 @@
except ImportError:
requires.append('argparse')
+with open('README.rst') as readme:
+ long_description = readme.read()
+
import wiggelen as distmeta
setup(
name='wiggelen',
version=distmeta.__version__,
description='Working with wiggle tracks in Python',
- ... |
efd13e069e7fa986f7fe68dfe5dc5256cfc68750 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from setuptools import setup, find_packages
import opps
install_requires = ["Django>=1.4", "south>=0.7"]
classifiers = ["Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS In... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from setuptools import setup, find_packages
import opps
install_requires = ["Django>=1.5",
"south>=0.7",
"Pillow==1.7.8",
"django-filebrowser==3.5.1",
"django-redis",
"dj... | Add new libs python on install requires Opps CMS | Add new libs python on install requires Opps CMS
| Python | mit | YACOWS/opps,opps/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,opps/opps,williamroot/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,williamroot/opps,opps/opps | ---
+++
@@ -7,7 +7,12 @@
-install_requires = ["Django>=1.4", "south>=0.7"]
+install_requires = ["Django>=1.5",
+ "south>=0.7",
+ "Pillow==1.7.8",
+ "django-filebrowser==3.5.1",
+ "django-redis",
+ "django-redactor"]
... |
47903d4e8ff4e2adfc9a05b8145923154d7ff57e | setup.py | setup.py | #!/usr/bin/env python
from setuptools import find_packages, setup
setup(name='qwertyui',
version='1.0.21',
description='Some common Python functions and algorithms',
author='Przemyslaw Kaminski',
author_email='cgenie@gmail.com',
url='https://github.com/CGenie/qwertyui',
packages=f... | #!/usr/bin/env python
from setuptools import find_packages, setup
setup(name='qwertyui',
version='1.0.22',
description='Some common Python functions and algorithms',
author='Przemyslaw Kaminski',
author_email='cgenie@gmail.com',
url='https://github.com/CGenie/qwertyui',
packages=f... | Update package versions, bump to 1.0.22 | Update package versions, bump to 1.0.22
| Python | mit | CGenie/qwertyui | ---
+++
@@ -4,15 +4,15 @@
setup(name='qwertyui',
- version='1.0.21',
+ version='1.0.22',
description='Some common Python functions and algorithms',
author='Przemyslaw Kaminski',
author_email='cgenie@gmail.com',
url='https://github.com/CGenie/qwertyui',
packages=find_p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.