commit
stringlengths
40
40
subject
stringlengths
1
1.49k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
new_contents
stringlengths
1
29.8k
old_contents
stringlengths
0
9.9k
lang
stringclasses
3 values
proba
float64
0
1
5adb1ccfa30021bcac68364a032196bfc57098a2
Rewrite show-stack-params-and-outputs.sh in python to get around problems that script has with older jq versions
setup.py
setup.py
# Copyright 2016-2017 Nitor Creations Oy # # 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 ...
# Copyright 2016-2017 Nitor Creations Oy # # 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 ...
Python
0
4ddde13eae99912559fc2fc6434ff16b9dfcf6a3
fix build
setup.py
setup.py
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext setup(name='python-pcl', description='pcl wrapper', url='http://github.com/strawlab/python-pcl', version='0.1', author='John Stowers', author_email='john.stowers@gmail.com', ...
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext setup(name='python-pcl', description='pcl wrapper', url='http://github.com/strawlab/python-pcl', version='0.1', author='John Stowers', author_email='john.stowers@gmail.com', ...
Python
0.000001
b1bb13b56f3eb64f33ce39a153a69d4f0edd05a9
Update django-gcloud-connectors
setup.py
setup.py
import os from setuptools import setup, find_packages NAME = 'djangae' PACKAGES = find_packages() DESCRIPTION = 'Django integration with Google App Engine' URL = "https://github.com/potatolondon/djangae" LONG_DESCRIPTION = open(os.path.join(os.path.dirname(__file__), 'README.md')).read() AUTHOR = 'Potato London Ltd.'...
import os from setuptools import setup, find_packages NAME = 'djangae' PACKAGES = find_packages() DESCRIPTION = 'Django integration with Google App Engine' URL = "https://github.com/potatolondon/djangae" LONG_DESCRIPTION = open(os.path.join(os.path.dirname(__file__), 'README.md')).read() AUTHOR = 'Potato London Ltd.'...
Python
0.000001
cf4caa6abd7756e76ab3e613b183f163fd8d88cc
increment version [ci skip]
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup setup( name='pysrcds', version='0.1.6.dev', description='Python library for interacting with Source engine dedicated' ' servers', author='Peter Rowlands', author_email='peter@pmrowla.com', url='https://github.com/pmrowla/pysrcd...
#!/usr/bin/env python from setuptools import setup setup( name='pysrcds', version='0.1.5', description='Python library for interacting with Source engine dedicated' ' servers', author='Peter Rowlands', author_email='peter@pmrowla.com', url='https://github.com/pmrowla/pysrcds', ...
Python
0
138865c79782875076c91de4252aaf2dd8567101
fix package issue
setup.py
setup.py
from distutils.core import setup import os from setuptools import find_packages base_dir = os.path.dirname(__file__) setup( name='Django-Bootstrap3-Validator', version='0.3.3', author='Xu Yuan', author_email='ankh2008@gmail.com', packages=find_packages(), url="https://github.com/yuanxu/django-b...
from distutils.core import setup import os base_dir = os.path.dirname(__file__) setup( name='Django-Bootstrap3-Validator', version='0.3', author='Xu Yuan', author_email='ankh2008@gmail.com', packages=['bootstrap_validator', 'bootstrap_validator.templatetags','bootstrap_validator.migrations'], u...
Python
0.000001
548893b224bf7addbb56dd19455f0df5c24f7b51
Fix setup.py
setup.py
setup.py
import os.path import sys from autotweet import __version__ as version try: from setuptools import find_packages, setup except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import find_packages, setup def readme(): try: with open(os.path.join(os.path.di...
import os.path import sys from autotweet import __version__ as version try: from setuptools import find_packages, setup except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import find_packages, setup def readme(): try: with open(os.path.join(os.path.di...
Python
0.000001
4aa1f797e8c4e94572c6bc12819abd4501b0d1e4
remove python-memcached from install_requires
setup.py
setup.py
import os from setuptools import setup version = '0.1.0' # taken from django-registration # Compile the list of packages available, because distutils doesn't have # an easy way to do this. packages, data_files = [], [] root_dir = os.path.dirname(__file__) if root_dir: os.chdir(root_dir) for dirpath, dirnames, f...
import os from setuptools import setup version = '0.1.0' # taken from django-registration # Compile the list of packages available, because distutils doesn't have # an easy way to do this. packages, data_files = [], [] root_dir = os.path.dirname(__file__) if root_dir: os.chdir(root_dir) for dirpath, dirnames, f...
Python
0.000001
8cce0f9789673c9b4033fa2685b6da24d8d53147
Bump vers for OE POS taggers
setup.py
setup.py
"""Config for PyPI.""" from setuptools import find_packages from setuptools import setup setup( author='Kyle P. Johnson', author_email='kyle@kyle-p-johnson.com', classifiers=[ 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MI...
"""Config for PyPI.""" from setuptools import find_packages from setuptools import setup setup( author='Kyle P. Johnson', author_email='kyle@kyle-p-johnson.com', classifiers=[ 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MI...
Python
0
b8fb03a8945f1a895c8f5e55f01a6d4219aa745a
Add metadata
setup.py
setup.py
#! /usr/bin/env python # pylint: disable=invalid-name,missing-docstring from setuptools import setup from setuptools.extension import Extension from Cython.Build import cythonize extensions = [ Extension( name='pyglsl_parser.parser', sources=['pyglsl_parser/parser.pyx', 'glsl-par...
#! /usr/bin/env python # pylint: disable=invalid-name,missing-docstring from setuptools import setup from setuptools.extension import Extension from Cython.Build import cythonize extensions = [ Extension( name='pyglsl_parser.parser', sources=['pyglsl_parser/parser.pyx', 'glsl-par...
Python
0.000044
14ec7154a7fe10ddd73c4aac49e6ccc1a3d11c17
Bump sphinx from 4.0.1 to 4.0.2
setup.py
setup.py
import re from setuptools import setup, find_packages FRAMEWORKS = [ "Flask>=0.12.5", "Django>=2.2.0", "bottle>=0.12.13", "tornado>=4.5.2", "pyramid>=1.9.1", "falcon>=2.0.0", "aiohttp>=3.0.8", ] EXTRAS_REQUIRE = { "frameworks": FRAMEWORKS, "tests": [ "pytest", "webte...
import re from setuptools import setup, find_packages FRAMEWORKS = [ "Flask>=0.12.5", "Django>=2.2.0", "bottle>=0.12.13", "tornado>=4.5.2", "pyramid>=1.9.1", "falcon>=2.0.0", "aiohttp>=3.0.8", ] EXTRAS_REQUIRE = { "frameworks": FRAMEWORKS, "tests": [ "pytest", "webte...
Python
0.000037
8cbfbdf0591f6f9e08158350f6b937ac2e04ff49
update utilities
setup.py
setup.py
#!/usr/bin/env python try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup import os import sys # Add /usr/local/include to the path for macs, fixes easy_install for several packages (like gevent and pyyaml) if sys.platform == 'darwin': os.environ['C_INCLU...
#!/usr/bin/env python try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup import os import sys # Add /usr/local/include to the path for macs, fixes easy_install for several packages (like gevent and pyyaml) if sys.platform == 'darwin': os.environ['C_INCLU...
Python
0.000001
a3a51b905ec92b5f11c5dec5d9eed455c992fb86
Update version of cluster package pulled in.
setup.py
setup.py
import sys import os from setuptools import setup long_description = open('README.rst').read() classifiers = [ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Pytho...
import sys import os from setuptools import setup long_description = open('README.rst').read() classifiers = [ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Pytho...
Python
0
27e2b252db2e2372d98996b3768683cfcd5b8bc2
bump version number
setup.py
setup.py
from setuptools import setup, find_packages from os import path here = path.abspath(path.dirname(__file__)) # convert .md to .rst; from here: http://stackoverflow.com/questions/10718767/have-the-same-readme-both-in-markdown-and-restructuredtext try: from pypandoc import convert long_description = convert(path...
from setuptools import setup, find_packages from os import path here = path.abspath(path.dirname(__file__)) # convert .md to .rst; from here: http://stackoverflow.com/questions/10718767/have-the-same-readme-both-in-markdown-and-restructuredtext try: from pypandoc import convert long_description = convert(path...
Python
0.000004
5550b2feb24ee4f8f527182c115018b170f0d2cc
update version in setup file
setup.py
setup.py
import os from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path.join(...
import os from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path.join(...
Python
0
f8babfd27fdc8c618fe8827d8a2cc4cf3153a1ad
support form Flask-WTF bigger then 0.8, aim for python 3
setup.py
setup.py
import os import sys from setuptools import setup, find_packages def fpath(name): return os.path.join(os.path.dirname(__file__), name) def read(fname): return open(fpath(fname)).read() def desc(): return read('README.rst') setup( name='Flask-AppBuilder', version='0.8.1', url='https://github....
import os import sys from setuptools import setup, find_packages def fpath(name): return os.path.join(os.path.dirname(__file__), name) def read(fname): return open(fpath(fname)).read() def desc(): return read('README.rst') setup( name='Flask-AppBuilder', version='0.8.1', url='https://github....
Python
0
b0ec026a6f75f03073de6de3fb2f7bfaff7b6d70
Update version number to 0.11
setup.py
setup.py
# Copyright 2019 The Empirical Calibration Authors. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# Copyright 2019 The Empirical Calibration Authors. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
Python
0.000004
327b4a656347951b1b6bed1f04465dffc5011ec1
Update setup.py
setup.py
setup.py
"""Rachiopy setup script.""" from setuptools import find_packages, setup VERSION = "1.0.0" GITHUB_USERNAME = "rfverbruggen" GITHUB_REPOSITORY = "rachiopy" GITHUB_PATH = f"{GITHUB_USERNAME}/{GITHUB_REPOSITORY}" GITHUB_URL = f"https://github.com/{GITHUB_PATH}" DOWNLOAD_URL = f"{GITHUB_URL}/archive/{VERSION}.tar.gz" P...
"""Rachiopy setup script.""" from setuptools import find_packages, setup from datetime import datetime VERSION = "1.0.0" GITHUB_USERNAME = "rfverbruggen" GITHUB_REPOSITORY = "rachiopy" GITHUB_PATH = f"{GITHUB_USERNAME}/{GITHUB_REPOSITORY}" GITHUB_URL = f"https://github.com/{GITHUB_PATH}" DOWNLOAD_URL = f"{GITHUB_UR...
Python
0.000001
f91007560497d370b7451d212ad91dd23b47c892
Create version 0.3.22
setup.py
setup.py
from setuptools import setup setup(name='DukeDSClient', version='0.3.22', description='Command line tool(ddsclient) to upload/manage projects on the duke-data-service.', url='https://github.com/Duke-GCB/DukeDSClient', keywords='duke dds dukedataservice', author='John Bradley', ...
from setuptools import setup setup(name='DukeDSClient', version='0.3.21', description='Command line tool(ddsclient) to upload/manage projects on the duke-data-service.', url='https://github.com/Duke-GCB/DukeDSClient', keywords='duke dds dukedataservice', author='John Bradley', ...
Python
0.000001
4c15430e02c12f190b95791681f20f1a36a016d9
Add Python 3.4 classifier
setup.py
setup.py
__version__ = '0.21-dev' import os import sys py_version = sys.version_info[:2] PY3 = py_version[0] == 3 if PY3: if py_version < (3, 2): raise RuntimeError('On Python 3, Py65 requires Python 3.2 or later') else: if py_version < (2, 6): raise RuntimeError('On Python 2, Py65 requires Python 2.6...
__version__ = '0.21-dev' import os import sys py_version = sys.version_info[:2] PY3 = py_version[0] == 3 if PY3: if py_version < (3, 2): raise RuntimeError('On Python 3, Py65 requires Python 3.2 or later') else: if py_version < (2, 6): raise RuntimeError('On Python 2, Py65 requires Python 2.6...
Python
0.999999
f31d7a224d0c5a3c2b1d2b16fb4bc74edefacf24
Bump version string
setup.py
setup.py
from setuptools import setup, find_packages setup( name='autobuilder', version='0.6.7', packages=find_packages(), license='MIT', author='Matt Madison', author_email='matt@madison.systems', install_requires=['buildbot>=0.8.12m1'] )
from setuptools import setup, find_packages setup( name='autobuilder', version='0.6.6', packages=find_packages(), license='MIT', author='Matt Madison', author_email='matt@madison.systems', install_requires=['buildbot>=0.8.12m1'] )
Python
0.000001
014acee66b9cff26cb8f02f65c071f78a0a77e19
Bump version to 0.9.4pbs22
setup.py
setup.py
import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() dependency_links = [ 'http://github.com/pbs/django-cms/tarball/support/2.3.x#egg=django-cms-2.3.5pbs.X.dev', 'http://github.com/pbs/django-filer/tarball/master_pbs#egg=...
import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() dependency_links = [ 'http://github.com/pbs/django-cms/tarball/support/2.3.x#egg=django-cms-2.3.5pbs.X.dev', 'http://github.com/pbs/django-filer/tarball/master_pbs#egg=...
Python
0
c53b8a0a06596d9803a8df92e909d4ad28169dda
Update the cookiedomain requirement to 0.6, which has httponly.
setup.py
setup.py
AUTHOR = 'Osmosoft' AUTHOR_EMAIL = 'tiddlyspace@osmosoft.com' NAME = 'tiddlywebplugins.tiddlyspace' DESCRIPTION = 'A discoursive social model for TiddlyWiki' VERSION = '0.2.2' # N.B.: duplicate of tiddlywebplugins.tiddlyspace.__init__ import os from setuptools import setup, find_packages setup( namespace_packa...
AUTHOR = 'Osmosoft' AUTHOR_EMAIL = 'tiddlyspace@osmosoft.com' NAME = 'tiddlywebplugins.tiddlyspace' DESCRIPTION = 'A discoursive social model for TiddlyWiki' VERSION = '0.2.2' # N.B.: duplicate of tiddlywebplugins.tiddlyspace.__init__ import os from setuptools import setup, find_packages setup( namespace_packa...
Python
0
07656b928c506c0f9d602a5c4195793b5e449693
test fix
setup.py
setup.py
from setuptools import setup, find_packages import sys import re with open('requirements.txt') as f: requirements = f.readlines() with open('async_connect/__init__.py') as f: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1) with open('README.rst') as f: read...
from setuptools import setup, find_packages import re with open('requirements.txt') as f: requirements = f.readlines() with open('async_connect/__init__.py') as f: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1) with open('README.rst') as f: readme = f.read...
Python
0.000001
5c1338a623f438c1fdc6ddfcd79baf256819d57e
move tests scripts to parent directory to keep the same path in the source code
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2008-2009 Adriano Monteiro Marques. # # Author: Bartosz SKOWRON <getxsick at gmail dot 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 published # by the Free S...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2008-2009 Adriano Monteiro Marques. # # Author: Bartosz SKOWRON <getxsick at gmail dot 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 published # by the Free S...
Python
0.000007
ca62972886bcaef6375e78e32514883183f50929
bump version UP! Align to pypi
setup.py
setup.py
import os import codecs from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) def read(*parts): """ Build an absolute path from *parts* and and return the contents of the resulting file. Assume UTF-8 encoding. """ with codecs.open(os.path.join(here, *parts...
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) setup( name='instapy-cli', version='0.0.1', description='Python library and cli used to upload photo on Instagram. W/o a phone!', long_description=open('README.md.rst').read(), classifiers=[ ...
Python
0.000008
47dd0d3f9d5d150adad7097bb2a24964f3c732b2
add pytest dep
setup.py
setup.py
#!/usr/bin/env python import setuptools long_description = """python-evtx is a pure Python parser for \ Windows Event Log files (those with the file extension ".evtx"). \ The module provides programmatic access to the File and Chunk headers, \ record templates, and event entries. For example, you can use \ python-evt...
#!/usr/bin/env python import setuptools long_description = """python-evtx is a pure Python parser for \ Windows Event Log files (those with the file extension ".evtx"). \ The module provides programmatic access to the File and Chunk headers, \ record templates, and event entries. For example, you can use \ python-evt...
Python
0.000001
f3cc4d84fbfcb430b004d730e44653079b3b3490
Update version to 1.6
setup.py
setup.py
import os from setuptools import setup def read(file): return open(os.path.join(os.path.dirname(__file__), file)).read() setup( name="vsut", version="1.6", author="Alex Egger", author_email="alex.egger96@gmail.com", description="A simple unit testing framework for Python 3.4", license="MIT...
import os from setuptools import setup def read(file): return open(os.path.join(os.path.dirname(__file__), file)).read() setup( name="vsut", version="1.5.5", author="Alex Egger", author_email="alex.egger96@gmail.com", description="A simple unit testing framework for Python 3.4", license="M...
Python
0
5ea089d150a7e6132670ab92521bf763b1e719bf
bump version to 0.2
setup.py
setup.py
#!/usr/bin/python from setuptools import setup setup( name="htmlgen", version="0.2", description="HTML 5 Generator", author="Sebastian Rittau", author_email="srittau@rittau.biz", url="https://github.com/srittau/python-htmlgen", packages=["htmlgen", "test_htmlgen"], depends=["asserts"]...
#!/usr/bin/python from setuptools import setup setup( name="htmlgen", version="0.1", description="HTML 5 Generator", author="Sebastian Rittau", author_email="srittau@rittau.biz", url="https://github.com/srittau/python-htmlgen", packages=["htmlgen", "test_htmlgen"], depends=["asserts"]...
Python
0.000001
7cfe670f621ac8ee7723e80c279a9794dc0a1bb9
update docker version
setup.py
setup.py
from setuptools import setup setup( name='vent', version='v0.6.9.dev', packages=['vent', 'vent.core', 'vent.core.file_drop', 'vent.core.rq_worker', 'vent.core.rq_dashboard', 'vent.menus', 'vent.core.network_tap', 'vent.core.network_tap.ncontrol', 'vent.core.rmq_es_...
from setuptools import setup setup( name='vent', version='v0.6.9.dev', packages=['vent', 'vent.core', 'vent.core.file_drop', 'vent.core.rq_worker', 'vent.core.rq_dashboard', 'vent.menus', 'vent.core.network_tap', 'vent.core.network_tap.ncontrol', 'vent.core.rmq_es_...
Python
0
046f9e35568c4f647780e504e2000fabf0f9937b
use __version__ from dynash.py
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup from dynash import __version__ SETUP_OPTIONS = dict( name='dynash', version=__version__, description='Command line client for DynamoDB', long_description = open("README.md").read(), author='Raffaele Sena', author_email=...
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup SETUP_OPTIONS = dict( name='dynash', version='0.5.1', description='Command line client for DynamoDB', long_description = open("README.md").read(), author='Raffaele Sena', author_email='raff367@gmail.com', url='https...
Python
0.000043
1f9b2c7836d6738d5a86d93644a04da7729b3688
Prepare openprocurement.api 2.4.5.
setup.py
setup.py
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.rst')) as f: README = f.read() requires = [ 'barbecue', 'chaussette', 'cornice', 'couchdb-schematics', 'gevent', 'iso8601', 'jsonpatch', 'li...
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.rst')) as f: README = f.read() requires = [ 'barbecue', 'chaussette', 'cornice', 'couchdb-schematics', 'gevent', 'iso8601', 'jsonpatch', 'li...
Python
0
cabfe1a7586e5ce313105cab08810f51dae6b479
Update setup.py
setup.py
setup.py
#from distutils.core import setup from setuptools import setup from odplib import meta setup(name="rst2odp", version=meta.__version__, author=meta.__author__, author_email=meta.__email__, description="Converter for rst to OpenOffice Impress", long_description='''Packacking of rst2odp and...
#from distutils.core import setup from setuptools import setup from odplib import meta setup(name="rst2odp", version=meta.__version__, author=meta.__author__, author_email=meta.__email__, description="Converter for rst to OpenOffice Impress", long_description='''Packacking of rst2odp and...
Python
0
1a7eb2627fbf3bc0ddb5d8fd5b051f3139275590
Fix moderation rule
Rules/Moderation.py
Rules/Moderation.py
from ._shared import * class Moderation(Rule): """Handles message to moderate listing""" def __init__(self, bot): self.bot = bot def __call__(self, serv, author, args): """Handles message to moderate listing""" if not self.bot.has_admin_rights(serv, author): return ...
from ._shared import * class Moderation(Rule): """Handles message to moderate listing""" def __init__(self, bot): self.bot = bot def __call__(self, serv, author, args): """Handles message to moderate listing""" if not self.bot.has_admin_rights(serv, author): return ...
Python
0.000048
90c82f0936addeb4469db2c42c1cd48713e7f3cf
Switch from bold to red highlighting.
progress_logger.py
progress_logger.py
# Copyright Google # BSD License import copy import wash # from http://stackoverflow.com/questions/8924173/how-do-i-print-bold-text-in-python class color: PURPLE = '\033[95m' CYAN = '\033[96m' DARKCYAN = '\033[36m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' BOLD = '\033...
# Copyright Google # BSD License import copy import wash # from http://stackoverflow.com/questions/8924173/how-do-i-print-bold-text-in-python class color: PURPLE = '\033[95m' CYAN = '\033[96m' DARKCYAN = '\033[36m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' BOLD = '\033...
Python
0
a25558ef0f1a902e948424bc0a3e137cc4d0f569
implement programming via remote gdb session
scons/site_tools/openocd_remote.py
scons/site_tools/openocd_remote.py
#!/usr/bin/env python # # Copyright (c) 2014, Roboterclub Aachen e.V. # All Rights Reserved. # # The file is part of the xpcc library and is released under the 3-clause BSD # license. See the file `LICENSE` for the full license governing this code. import platform from SCons.Script import * # -----------------------...
#!/usr/bin/env python # # Copyright (c) 2014, Roboterclub Aachen e.V. # All Rights Reserved. # # The file is part of the xpcc library and is released under the 3-clause BSD # license. See the file `LICENSE` for the full license governing this code. import platform from SCons.Script import * # -----------------------...
Python
0
c3f844cfe03a23a5d6207ba99b5dc6abac9b94a1
Add unit test.
awx/main/tests/unit/models/test_job_unit.py
awx/main/tests/unit/models/test_job_unit.py
import pytest import json from awx.main.tasks import RunJob from awx.main.models import Job @pytest.fixture def job(mocker): return mocker.MagicMock(**{ 'display_extra_vars.return_value': '{\"secret_key\": \"$encrypted$\"}', 'extra_vars_dict': {"secret_key": "my_password"}, 'pk': 1, 'job_...
import pytest import json from awx.main.tasks import RunJob from awx.main.models import Job @pytest.fixture def job(mocker): return mocker.MagicMock(**{ 'display_extra_vars.return_value': '{\"secret_key\": \"$encrypted$\"}', 'extra_vars_dict': {"secret_key": "my_password"}, 'pk': 1, 'job_...
Python
0
3b0760ce604ab5e627f8459fc83f4f7b638c224e
Fix flake8 warning
cmsplugin_forms_builder/cms_plugins.py
cmsplugin_forms_builder/cms_plugins.py
from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from cmsplugin_forms_builder.models import PluginForm from django.utils.translation import ugettext_lazy as _ class FormBuilderPlugin(CMSPluginBase): """ Plugin class for form-builder forms. """ model = PluginForm ...
from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from cmsplugin_forms_builder.models import PluginForm from django.utils.translation import ugettext_lazy as _ class FormBuilderPlugin(CMSPluginBase): """ Plugin class for form-builder forms. """ model = PluginForm ...
Python
0
749b05712474ea8695fb6f2d1662399da42b1d32
Update error with user input
SimpleCalculator.py
SimpleCalculator.py
''' Author : DORIAN JAVA BROWN Version : N/A Copyright : All Rights Reserve; You may use, distribute and modify this code. Description : This is a simple calculator that can add, subtract, multiply and divide using functions ''' def calculate(): # operation selection from the user print('\n\n'...
''' Author : DORIAN JAVA BROWN Version : N/A Copyright : All Rights Reserve; You may use, distribute and modify this code. Description : This is a simple calculator that can add, subtract, multiply and divide using functions ''' '''function definitions''' def calculate(): # operation selection f...
Python
0.000001
9302f918390063c1bfedf2724e0b1fb9a3d1effb
Add the required whitespace before css classes This was preventing some email clients from correctly displaying the styling.
portal/models/message.py
portal/models/message.py
"""Model classes for message data""" from datetime import datetime from textwrap import fill from flask import current_app from flask_mail import Message from flask_mail import email_dispatched from ..audit import auditable_event from ..database import db from ..extensions import mail from .user import User def log_...
"""Model classes for message data""" from datetime import datetime from textwrap import fill from flask import current_app from flask_mail import Message from flask_mail import email_dispatched from ..audit import auditable_event from ..database import db from ..extensions import mail from .user import User def log_...
Python
0.00007
1072487ce3ffe96557d5a14efed3715c2592cebc
Fix OSX
prompty/userdir.py
prompty/userdir.py
#!/usr/bin/env python # vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import sys import shutil import errno import distutils.dir_util PROMPTY_USER_D...
#!/usr/bin/env python # vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import sys import shutil import errno import distutils.dir_util PROMPTY_USER_D...
Python
0.000659
101b48fed741c0c95f69e4ce678fbb390d7f709e
Fix flake8
ykman/native/pyusb.py
ykman/native/pyusb.py
# Copyright (c) 2015 Yubico AB # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditi...
# Copyright (c) 2015 Yubico AB # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditi...
Python
0
85912ea3988ffc4e0516ff14fa51c4bab9ac1630
fix string formatting
slask.py
slask.py
#!/usr/bin/env python from __future__ import print_function from glob import glob import importlib import logging import os import re import sys import time import traceback from slackclient import SlackClient def init_log(config): loglevel = config.get("loglevel", logging.INFO) logformat = config.get("logfor...
#!/usr/bin/env python from __future__ import print_function from glob import glob import importlib import logging import os import re import sys import time import traceback from slackclient import SlackClient def init_log(config): loglevel = config.get("loglevel", logging.INFO) logformat = config.get("logfor...
Python
0.000182
fa7fc8181f09340c9778ef6c056674ddc7d3d54e
Add run convergence
tests/convergence_tests/convergence_lspr.py
tests/convergence_tests/convergence_lspr.py
import re import os import sys import time import numpy import pickle import datetime try: import pycuda except ImportError: ans = input('PyCUDA not found. Regression tests will take forever. Do you want to continue? [y/n] ') if ans in ['Y', 'y']: pass else: sys.exit() from pygbe.mai...
import re import os import sys import time import numpy import pickle import datetime try: import pycuda except ImportError: ans = input('PyCUDA not found. Regression tests will take forever. Do you want to continue? [y/n] ') if ans in ['Y', 'y']: pass else: sys.exit() from pygbe.mai...
Python
0.000001
8f815c41b505c01cbc1c57088ddc3a465f1ac07c
Add a configuration key for the URL of the Fedora OpenID server
fmn/web/default_config.py
fmn/web/default_config.py
SECRET_KEY = 'changeme please' # TODO -- May I set this to true? FAS_OPENID_CHECK_CERT = False #ADMIN_GROUPS = ['sysadmin-web'] FMN_FEDORA_OPENID = 'https://id.fedoraproject.org'
SECRET_KEY = 'changeme please' # TODO -- May I set this to true? FAS_OPENID_CHECK_CERT = False #ADMIN_GROUPS = ['sysadmin-web']
Python
0
87b6166bb2f88b54c78569d6b566c4d557733c57
Modify proxy to use inlineCallbacks
proxy.py
proxy.py
from twisted.internet import defer, endpoints, protocol, reactor from twisted.protocols import basic from twisted.web.client import getPage import time class ProxyProtocol(basic.LineReceiver): def lineReceived(self, line): if not line.startswith('http://'): return self.getPage(line) ...
from twisted.internet import endpoints, protocol, reactor from twisted.protocols import basic from twisted.web.client import getPage import time class ProxyProtocol(basic.LineReceiver): def gotPage(self, data, line, start): print 'Fetched {} in {} sec'.format(line, time.time() - start) self.transp...
Python
0
714ecf45aaa233d067768de526955a319ff154f4
Add annotation
nomenklatura/loader.py
nomenklatura/loader.py
import json import logging from nomenklatura.resolver import Resolver from typing import ( Dict, Generator, Generic, Iterable, Iterator, List, Optional, Tuple, TypeVar, ) from followthemoney.proxy import EntityProxy from followthemoney.types import registry from followthemoney.proper...
import json import logging from nomenklatura.resolver import Resolver from typing import ( Dict, Generator, Generic, Iterable, Iterator, List, Optional, Tuple, TypeVar, ) from followthemoney.proxy import EntityProxy from followthemoney.types import registry from followthemoney.proper...
Python
0.000002
33b0113b0a3b5ea11e15265479cfde168ebd8a48
Fix properties of Evaluation when its dates are None
indico/modules/events/evaluation/models/evaluations.py
indico/modules/events/evaluation/models/evaluations.py
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (a...
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (a...
Python
0.999999
d75e1309bf41f05489ffcf8502309b765bc8c359
handle non dev/rc last release (#5133)
scripts/update_bokehjs_versions.py
scripts/update_bokehjs_versions.py
import os import re import sys def check_input(version): pat = r'^(\d+.\d+.\d+)((dev|rc)\d+)?$' if not re.match(pat, version): print("The new version must be in the format X.X.X([dev|rc]X) (ex. '0.12.0')") return False return True def version_update(version, filename): pat = r"""(relea...
import os import re import sys def check_input(version): pat = r'^(\d+.\d+.\d+)((dev|rc)\d+)?$' if not re.match(pat, version): print("The new version must be in the format X.X.X([dev|rc]X) (ex. '0.12.0')") return False return True def version_update(version, filename): pat = r"""(relea...
Python
0
001924264830761cfa5938ca542201f2e8bdaf66
Fix haystack index
freieit/search_indexes.py
freieit/search_indexes.py
from haystack import indexes from .models import ExpertProfile class ExpertProfileIndex(indexes.SearchIndex, indexes.Indexable): #text = indexes.CharField(document=True, use_template=True) text = indexes.EdgeNgramField(document=True, use_template=True) #name = indexes.CharField(model_attr='name') #lo...
from haystack import indexes, site from .models import ExpertProfile class ExpertProfileIndex(indexes.SearchIndex): #text = indexes.CharField(document=True, use_template=True) text = indexes.EdgeNgramField(document=True, use_template=True) #name = indexes.CharField(model_attr='name') #location = inde...
Python
0.000607
270df828dfc76f993a999daeeb8fa8f6c82b1e62
Fix typo in documentation
lib/cmdlib/query.py
lib/cmdlib/query.py
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later...
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later...
Python
0.999937
afc47fd469d7836dcda0eb8bb027cce2a0ed2121
Update MergeSort.py
fundamentals/MergeSort.py
fundamentals/MergeSort.py
""" @author: Maneesh D @email: maneeshd77@gmail.com @date: 24/6/17 Worst Case Analysis: Merge Sort -> O(nlog n) """ from random import randint from timeit import Timer, default_timer def merge_sort(data): if len(data) == 1: return data n = len(data) mid = n // 2 # Divide and sort the sub lis...
""" @author: Maneesh D @email: maneeshd77@gmail.com @date: 24/6/17 Merge Sort -> O(nlog n) """ from random import randint from timeit import Timer, default_timer def merge_sort(data): if len(data) == 1: return data n = len(data) mid = n // 2 # Divide and sort the sub lists left = merge_s...
Python
0
38c96a366b68cd74cbec6e69ca168225ccf3fe18
Patch for an Issue #260
lib/core/convert.py
lib/core/convert.py
#!/usr/bin/env python """ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ try: import hashlib except: import md5 import sha import pickle import re import sys import struct import urllib from lib.core.enums import PLACE from lib.core.s...
#!/usr/bin/env python """ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ try: import hashlib except: import md5 import sha import pickle import re import sys import struct import urllib from lib.core.enums import PLACE from lib.core.s...
Python
0
bebbbed6dba82329fcaab32fdb0109ec78cd7ad9
Use correct subprotocol
ztag/transforms/s7.py
ztag/transforms/s7.py
from ztag.transform import * from ztag import protocols, errors class S7Transform(ZGrabTransform): name = "s7/status" port = 102 protocol = protocols.S7 subprotocol = protocols.S7.SZL def _transform_object(self, obj): zout = ZMapTransformOutput() wrapped = Transformable(obj) ...
from ztag.transform import * from ztag import protocols, errors class S7Transform(ZGrabTransform): name = "s7/status" port = 102 protocol = protocols.S7 subprotocol = protocols.S7.STATUS def _transform_object(self, obj): zout = ZMapTransformOutput() wrapped = Transformable(obj) ...
Python
0.024217
0cd617ddc7e6303139583b6a92e90cfac1e91b31
set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#938)
synth.py
synth.py
import synthtool as s import synthtool.gcp as gcp import logging import subprocess import os logging.basicConfig(level=logging.DEBUG) AUTOSYNTH_MULTIPLE_COMMITS = True gapic = gcp.GAPICGenerator() common_templates = gcp.CommonTemplates() # tasks has two product names, and a poorly named artman yaml version = 'v1' ...
import synthtool as s import synthtool.gcp as gcp import logging import subprocess import os logging.basicConfig(level=logging.DEBUG) gapic = gcp.GAPICGenerator() common_templates = gcp.CommonTemplates() # tasks has two product names, and a poorly named artman yaml version = 'v1' library = gapic.node_library( 'p...
Python
0
59860336a32b4cb438d275ced06a3100a2dd78b6
Update synth.py
synth.py
synth.py
# Copyright 2021 Google LLC # # 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, s...
# Copyright 2020 Google LLC # # 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, s...
Python
0
171950f63b6a1bc1bdb60b10c25f529e51dbfe8b
Split up dev and static servers
tasks.py
tasks.py
from glob import glob from invoke import task @task(aliases=['dev-server']) def dev_server(ctx, pty=True): """Run django dev server.""" ctx.run('python manage.py runserver', pty=pty) @task(aliases=['static-server']) def static_server(ctx, pty=True): """Run servers for static files.""" ctx.run('npm ...
from glob import glob from invoke import task @task(aliases=['dev-server']) def dev_server(ctx, pty=True): """Run django dev server and servers for static files.""" ctx.run('python manage.py runserver | npm run watch-static', pty=pty) @task def build(ctx): """Build docs, static-files, etc.""" ctx.r...
Python
0
0e8994d1dbeb6266156fa9615fc003aa0d0a4822
remove unused import, flake8
tasks.py
tasks.py
# -*- coding: utf-8 -*- import sys from invoke import task, run from waterbutler import settings @task def install(upgrade=False, pip_cache=None, wheel_repo=None): cmd = 'pip install -r dev-requirements.txt' if upgrade: cmd += ' --upgrade' if pip_cache: cmd += ' --download-cache={}'.fo...
# -*- coding: utf-8 -*- import os import sys from invoke import task, run from waterbutler import settings @task def install(upgrade=False, pip_cache=None, wheel_repo=None): cmd = 'pip install -r dev-requirements.txt' if upgrade: cmd += ' --upgrade' if pip_cache: cmd += ' --download-ca...
Python
0
fd9ef4b30ef09d52c120e9e8ab2461cbce939dfd
Add --show-diff-on-failure
tasks.py
tasks.py
# -*- coding: utf-8 -*- import os import sys import webbrowser from invoke import task docs_dir = 'docs' build_dir = os.path.join(docs_dir, '_build') @task def test(ctx, watch=False, last_failing=False): """Run the tests. Note: --watch requires pytest-xdist to be installed. """ import pytest syn...
# -*- coding: utf-8 -*- import os import sys import webbrowser from invoke import task docs_dir = 'docs' build_dir = os.path.join(docs_dir, '_build') @task def test(ctx, watch=False, last_failing=False): """Run the tests. Note: --watch requires pytest-xdist to be installed. """ import pytest syn...
Python
0.000107
59c9e30df3397a9114a59cc8a318cf011ba04085
fix terminal size formatting
.util/cliformatting.py
.util/cliformatting.py
import os import sys import click from math import ceil import shutil columns, _ = shutil.get_terminal_size() RESULTS = {"success": 0, "failure": 0} def header(msg): click.secho(f"\n# {msg}", bold=True) def s(n): if n == 1: return "" return "s" def error(s, details=None): lineart = "*****...
import os import sys import click from math import ceil import shutil rows, columns = shutil.get_terminal_size() RESULTS = {"success": 0, "failure": 0} def header(msg): click.secho(f"\n# {msg}", bold=True) def s(n): if n == 1: return "" return "s" def error(s, details=None): lineart = "**...
Python
0.000007
7b8b4c7f76c4623ee58fc7a05aee8a8d62d99b89
Improve init
polyaxon_cli/cli/init.py
polyaxon_cli/cli/init.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import os import sys import click import clint from polyaxon_cli.cli.getters.project import get_project_or_local from polyaxon_cli.client import PolyaxonClient from polyaxon_cli.client.exceptions import PolyaxonHTTPError, Polya...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import os import sys import click import clint from polyaxon_cli.cli.getters.project import get_project_or_local from polyaxon_cli.client import PolyaxonClient from polyaxon_cli.client.exceptions import PolyaxonHTTPError, Polya...
Python
0.000015
6a651684fa2e3d5d0837ff8ab040493cb0ddb9f3
Booleans are sentence case
pelican/pelicanconf.py
pelican/pelicanconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = u'Rich Cornish' SITENAME = u'Rich learns Python the hard way' SITEURL = '' PATH = 'content' TIMEZONE = 'America/Chicago' DEFAULT_LANG = u'en' # Feed generation is usually not desired when developing FEED_ALL_ATOM = Non...
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = u'Rich Cornish' SITENAME = u'Rich learns Python the hard way' SITEURL = '' PATH = 'content' TIMEZONE = 'America/Chicago' DEFAULT_LANG = u'en' # Feed generation is usually not desired when developing FEED_ALL_ATOM = Non...
Python
0.999999
3b5473048d40feee7807c5ad50f4521113d8216f
copy packages instead of symlinking
buildtools/publish_deb.py
buildtools/publish_deb.py
#!/usr/bin/python2 import os import sys import subprocess import shutil import gzip archive_dir = "%s/packages" % (os.environ["WORKSPACE"]) if not os.path.isdir(archive_dir): print "no artifacts archived. Either this is a failed build or a job that does not archive artifacts" sys.exit(0) deb_packages = filter(l...
#!/usr/bin/python2 import os import sys import subprocess import shutil import gzip archive_dir = "%s/packages" % (os.environ["WORKSPACE"]) if not os.path.isdir(archive_dir): print "no artifacts archived. Either this is a failed build or a job that does not archive artifacts" sys.exit(0) deb_packages = filter(l...
Python
0.000001
7519bd63bfbd175d49289727d7fed234a8ceb7f5
fix tenant properties test
bluebottle/clients/tests/test_properties.py
bluebottle/clients/tests/test_properties.py
import mock from django.test import TestCase from bluebottle.clients.middleware import TenantProperties, TenantPropertiesMiddleware from bluebottle.clients.middleware import properties Mock = mock.Mock class TestProperties(TestCase): def test_property_match(self): """ A match found in the client proper...
import mock from django.test import TestCase from bluebottle.clients.middleware import TenantProperties, TenantPropertiesMiddleware from bluebottle.clients.middleware import properties Mock = mock.Mock class TestProperties(TestCase): def test_property_match(self): """ A match found in the client proper...
Python
0
5e007acb5cf5fafa8d95e012948305157efa1dd7
Refactor and simplify code
bumblebee/modules/cmus.py
bumblebee/modules/cmus.py
# pylint: disable=C0111,R0903 # -*- coding: utf-8 -*- """Displays information about the current song in cmus. Requires the following executable: * cmus-remote Parameters: * cmus.format: Format string for the song information. Tag values can be put in curly brackets (i.e. {artist}) """ from collections impor...
# pylint: disable=C0111,R0903 # -*- coding: utf-8 -*- """Displays information about the current song in cmus. Requires the following executable: * cmus-remote Parameters: * cmus.format: Format string for the song information. Tag values can be put in curly brackets (i.e. {artist}) """ from collections impor...
Python
0
6ac618821c3fb83f439849208742417c50decbd2
Fix forced error message display for non-503 errors
src/adhocracy/controllers/error.py
src/adhocracy/controllers/error.py
import cgi import re from pylons import request, response, tmpl_context as c from pylons.i18n import _ from pylons.controllers.util import abort from paste.urlparser import PkgResourcesParser from pylons.controllers.util import forward from adhocracy import config from adhocracy.lib.base import BaseController from a...
import cgi import re from pylons import request, response, tmpl_context as c from pylons.i18n import _ from pylons.controllers.util import abort from paste.urlparser import PkgResourcesParser from pylons.controllers.util import forward from adhocracy import config from adhocracy.lib.base import BaseController from a...
Python
0.000004
09dbfc7ee6eb6db2ac18a8696406cd8c92dbfef4
fix pylint issues
sdcm/wait.py
sdcm/wait.py
# 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 option) any later version. # # This program is distributed in the hope that it will be usefu...
# 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 option) any later version. # # This program is distributed in the hope that it will be usefu...
Python
0.000001
2f0dc639a4448e0762843fe3c9a4239eb7fac8c6
Fix bug- socks_http does not resolve DNS remotely via Tor
nowallet/socks_http.py
nowallet/socks_http.py
import asyncio import aiohttp import aiosocks from aiosocks.connector import ProxyConnector, ProxyClientRequest class SocksHTTPError(Exception): pass async def urlopen(url: str) -> str: auth5 = aiosocks.Socks5Auth( 'proxyuser1', password='pwd') # type: aiosocks.Socks5Auth conn = ProxyConnector(re...
import asyncio import aiohttp import aiosocks from aiosocks.connector import ProxyConnector, ProxyClientRequest class SocksHTTPError(Exception): pass async def urlopen(url: str) -> str: auth5 = aiosocks.Socks5Auth( 'proxyuser1', password='pwd') # type: aiosocks.Socks5Auth conn = ProxyConnector(re...
Python
0
34016dca73f56c6929bf265f597fee0a0b325434
Add better introspection
barin/manager.py
barin/manager.py
from . import schema as S from . import cursor from . import query class Manager(object): def __init__(self, cname, field_collection, indexes, **options): # schema=S.Missing, db=None): self._cname = cname self.f = field_collection self.indexes = indexes self.query = query....
from . import schema as S from . import cursor from . import query class Manager(object): def __init__(self, cname, field_collection, indexes, **options): # schema=S.Missing, db=None): self._cname = cname self.f = field_collection self.indexes = indexes self.query = query....
Python
0
a68193102354af807285d0238354314c9aa67a25
Move victim selection to enforce
senlin/policies/deletion_policy.py
senlin/policies/deletion_policy.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed unde...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed unde...
Python
0
190abc81176855208847ccb171e88b6c12d57de7
replace a hack with ProtocolDesc
ryu/tests/unit/lib/test_ofp_pktinfilter.py
ryu/tests/unit/lib/test_ofp_pktinfilter.py
# Copyright (C) 2013 Stratosphere 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 ...
# Copyright (C) 2013 Stratosphere 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 ...
Python
0
324d0a201150b72bbf965e81c40dab22ce81374f
Update DataCleaning.py
iembdfa/DataCleaning.py
iembdfa/DataCleaning.py
# -*- coding: utf-8 -*- """ Created on Wed Jun 15 11:39:04 2016 @author: rahulmehra """ # Import the modules import pandas as pd from sklearn.preprocessing import LabelEncoder import numpy as np raw_data = {'patient': [500,1, 1,-2, 2,3,4,5,6,7,None,9,6,3,4,5,6,7,8,9], 'obs': [1, 2, 3, 1, 2,3,4,5,6,7,8,9,6,3,...
# -*- coding: utf-8 -*- """ Created on Wed Jun 15 11:39:04 2016 @author: rahulmehra """ # Import the modules import pandas as pd from sklearn.preprocessing import LabelEncoder import numpy as np raw_data = {'patient': [500,1, 1,-2, 2,3,4,5,6,7,None,9,6,3,4,5,6,7,8,9], 'obs': [1, 2, 3, 1, 2,3,4,5,6,7,8,9,6,3,...
Python
0
b3213feae032032018354548f244a3204f04707f
Change compressor.
pyncd.py
pyncd.py
import lzma x = open('examples/imgs/square.png', 'rb').read() # file 1 of any type y = open('examples/imgs/circle.png', 'rb').read() # file 2 of the same type as file 1 x_y = x + y # the concatenation of files x_comp = lzma.compress(x) # compress file 1 y_comp = lzma.compress(y) # compress file 2 x_y_comp = lzma.comp...
import gzip x = open('1.png', 'rb').read() # file 1 of any type y = open('2.png', 'rb').read() # file 2 of the same type as file 1 x_y = x + y # the concatenation of files x_comp = gzip.compress(x) # compress file 1 y_comp = gzip.compress(y) # compress file 2 x_y_comp = gzip.compress(x_y) # compress file concatenated...
Python
0
033a236767329263d55bd9d0cefd681d030a10bf
Separated the SEA goal from the joint goal
pysea.py
pysea.py
from PyDynamixel import * class Spring(Joint): ''' This class derives from Joint to implement a Spring feedback board. It works exactly like joint, except that we can't set torques or goal angles. We can only read its current angle.''' def __init__(self, spring_id, centerValue = 0): ''...
from PyDynamixel import * class Spring(Joint): ''' This class derives from Joint to implement a Spring feedback board. It works exactly like joint, except that we can't set torques or goal angles. We can only read its current angle.''' def __init__(self, spring_id, centerValue = 0): ''...
Python
0.999959
111e1d1b92860a4342c3499ca9eb0e5623b4974c
Increase RQ default_timeout to one hour (in case we have very very long running jobs)
call_server/extensions.py
call_server/extensions.py
# define flask extensions in separate file, to resolve import dependencies from flask_sqlalchemy import SQLAlchemy as _BaseSQLAlchemy # workaround to enable pool_pre_ping # per https://github.com/pallets/flask-sqlalchemy/issues/589#issuecomment-361075700 class SQLAlchemy(_BaseSQLAlchemy): def apply_pool_defaults(s...
# define flask extensions in separate file, to resolve import dependencies from flask_sqlalchemy import SQLAlchemy as _BaseSQLAlchemy # workaround to enable pool_pre_ping # per https://github.com/pallets/flask-sqlalchemy/issues/589#issuecomment-361075700 class SQLAlchemy(_BaseSQLAlchemy): def apply_pool_defaults(s...
Python
0
e8fdbc786b7a8391014199366a71b290b49efb4c
Fix views decorators (ref #141)
caminae/trekking/views.py
caminae/trekking/views.py
from django.utils.decorators import method_decorator from caminae.authent.decorators import trekking_manager_required from caminae.mapentity.views import (MapEntityLayer, MapEntityList, MapEntityJsonList, MapEntityDetail, MapEntityCreate, MapEntityUpdate, MapEntityDelete) from .models ...
from caminae.authent.decorators import trekking_manager_required from caminae.mapentity.views import (MapEntityLayer, MapEntityList, MapEntityJsonList, MapEntityDetail, MapEntityCreate, MapEntityUpdate, MapEntityDelete) from .models import Trek, POI from .filters import TrekFilter, POIF...
Python
0
c0c3d63c6124549008a2dc17c1e691e799129444
Fix getting unwatched episodes from Plex
plex2myshows/modules/plex/plex.py
plex2myshows/modules/plex/plex.py
class Plex(object): def __init__(self, plex): self.plex = plex def get_watched_episodes(self, section_name): watched_episodes = [] shows = self.plex.library.section(section_name).searchShows() for show in shows: watched_episodes.extend(show.watched()) return ...
class Plex(object): def __init__(self, plex): self.plex = plex def get_watched_episodes(self, section_name): watched_episodes = set(self.plex.library.section(section_name).searchEpisodes(unwatched=False)) return watched_episodes
Python
0.000001
d8da358042e6b02426804783b20e256398c6c467
Remove decimals from y-axis percentage label
capstone/rl/utils/plot.py
capstone/rl/utils/plot.py
from __future__ import division import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter from .callbacks import Callback from ...game.players import GreedyQ, RandPlayer from ...game.utils import play_series class EpisodicWLDPlotter(Callback): ''' Plot...
from __future__ import division import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter from .callbacks import Callback from ...game.players import GreedyQ, RandPlayer from ...game.utils import play_series class EpisodicWLDPlotter(Callback): ''' Plot...
Python
0.998577
b77685c442fcc769727c443a59ac2bb620d90bdc
update copyright year
casingSimulations/info.py
casingSimulations/info.py
__version__ = '0.1.0b0' __author__ = 'Lindsey Heagy' __license__ = 'MIT' __copyright__ = 'Copyright 2018-2019 Lindsey Heagy'
__version__ = '0.1.0b0' __author__ = 'Lindsey Heagy' __license__ = 'MIT' __copyright__ = 'Copyright 2018 Lindsey Heagy'
Python
0.000001
bed15fe0680277cefb0c02fddfe566a73e0dc2ba
refresh_token is bac
keystoneauth_oidc_refreshtoken/tests/unit/test_oidc.py
keystoneauth_oidc_refreshtoken/tests/unit/test_oidc.py
# coding=utf-8 # Copyright 2017 JOSÉ JOAQUÍN ESCOBAR GÓMEZ # File: test_oidc.py # Description: # # 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/license...
# coding=utf-8 # Copyright 2017 JOSÉ JOAQUÍN ESCOBAR GÓMEZ # File: test_oidc.py # Description: # # 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/license...
Python
0.999995
ff93b501d489f182617e7f8f497747f26e91f39e
add older experiments
kid_readout/analysis/resources/starcryo_experiments.py
kid_readout/analysis/resources/starcryo_experiments.py
import bisect from kid_readout.utils.time_tools import date_to_unix_time by_unix_time_table = [ ('2014-07-03', 'STAR Cryo 4x5 0813f12 Al horn package, AR chip, LPF, copper shield, IR LED fiber', 'light'), ('2014-04-28', 'STAR Cryo 4x5 0813f12 Al horn package, AR chip, LPF, copper shield...
import bisect from kid_readout.utils.time_tools import date_to_unix_time by_unix_time_table = [('2014-04-28', 'STAR Cryo 4x5 0813f12 Al horn package, AR chip, LPF, copper shield', 'light'), ('2014-04-16', 'STAR Cryo 4x5 0813f12 Al horn package, AR chip, fully taped', 'dark'), ('2014-04-...
Python
0.000654
8f13dedde762edc6b1b02e7dc2b4675a7fc13514
Fix problem with watcher failing. Resolve issue #36
hamlpy/hamlpy_watcher.py
hamlpy/hamlpy_watcher.py
# haml-watcher.py # Author: Christian Stefanescu (st.chris@gmail.com) # # Watch a folder for files with the given extensions and call the HamlPy # compiler if the modified time has changed since the last check. import sys import codecs import os import os.path import time from hamlpy import Compiler EXTENSIONS = ['.h...
# haml-watcher.py # Author: Christian Stefanescu (st.chris@gmail.com) # # Watch a folder for files with the given extensions and call the HamlPy # compiler if the modified time has changed since the last check. import sys import codecs import os import os.path import time from hamlpy import Compiler EXTENSIONS = ['.h...
Python
0
a21b87c92295fe650222ee27910efba1e912fa6c
Add TODO comment for a unit test failure due to timezone changes
Test/test_Format.py
Test/test_Format.py
import unittest from NanoPcap import Format class FormatTest(unittest.TestCase): def setUp(self): self._initialHeader = (1234, 5678, 9102, -1, 3456, 7890, 4321) self._initialRecordHeader = (1463179445, 10 * 1000 * 1000, 9102, 3456) def test_header(self): self.assertEqual(Format.PCAP...
import unittest from NanoPcap import Format class FormatTest(unittest.TestCase): def setUp(self): self._initialHeader = (1234, 5678, 9102, -1, 3456, 7890, 4321) self._initialRecordHeader = (1463179445, 10 * 1000 * 1000, 9102, 3456) def test_header(self): self.assertEqual(Format.PCAP...
Python
0
89dae839a950bc0e45a7e94d142eafcb45cf2a43
Resolve pylint warning about executable without the executable bit.
tests/external/py2/testfixture_test.py
tests/external/py2/testfixture_test.py
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditio...
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditio...
Python
0
957d31218e44c12dc56dd64a98e62b851c683bf9
update static root
cfbets/cfbets/settings.py
cfbets/cfbets/settings.py
""" Django settings for cfbets project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
""" Django settings for cfbets project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
Python
0.000001
c91a593507cea9c6ba2777eff741b9e7ec7fdf0f
Fix test to give more data on failure
tests/integration/cli/custom_module.py
tests/integration/cli/custom_module.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Daniel Mizyrycki (mzdaniel@glidelink.net)` tests.integration.cli.custom_module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Test salt-ssh sls with a custom module work. $ cat srv/custom_module.sls custom-module: module.run: - name: test.r...
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Daniel Mizyrycki (mzdaniel@glidelink.net)` tests.integration.cli.custom_module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Test salt-ssh sls with a custom module work. $ cat srv/custom_module.sls custom-module: module.run: - name: test.r...
Python
0.000001
ccc8c0d885c9eaafeba2e91e248bf3febc484ab5
change default port to IANA and allow to change peer port
pifpaf/drivers/etcd.py
pifpaf/drivers/etcd.py
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
Python
0
9044657473e949138343132bbfb4c96b137c6abb
Use NotImplementedError
chainerrl/agents/sarsa.py
chainerrl/agents/sarsa.py
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() # NOQA from chainerrl.agents import dqn class SARSA(dqn.DQN): ...
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() # NOQA from chainerrl.agents import dqn class SARSA(dqn.DQN): ...
Python
0.000002
6ab7c268d21ada1c30414551bdbb03190560ae55
Fix typo in runserver.py breaking debug mode.
runserver.py
runserver.py
#!/usr/bin/env python import argparse from wake import app parser = argparse.ArgumentParser() parser.add_argument( '--host', default='127.0.0.1', help='hostname to listen on', ) parser.add_argument( '--port', type=int, default=5000, help='port to listen on', ) parser.add_argument( '--...
#!/usr/bin/env python import argparse from wake import app parser = argparse.ArgumentParser() parser.add_argument( '--host', default='127.0.0.1', help='hostname to listen on', ) parser.add_argument( '--port', type=int, default=5000, help='port to listen on', ) parser.add_argument( '--...
Python
0
e69deed27176406c499cb332c76d3c9ffcecd786
Add test for get_dates().
tests.py
tests.py
#!/usr/bin/env python # encoding: utf-8 import datetime import unittest import mock import pandas as pd import pandas_finance from pandas.util.testing import assert_frame_equal from nose.tools import assert_equal from freezegun import freeze_time class GetStockTestCase(unittest.TestCase): @mock.patch('pandas_fi...
#!/usr/bin/env python # encoding: utf-8 import datetime import unittest import mock import pandas as pd import pandas_finance from pandas.util.testing import assert_frame_equal from nose.tools import assert_equal class GetStockTestCase(unittest.TestCase): @mock.patch('pandas_finance.web.DataReader') def tes...
Python
0
64605573382f1c9fb2170d0cdbcd007f5ddae8d6
Fix to pass all test
tests/players/sample/console_player_test.py
tests/players/sample/console_player_test.py
from tests.base_unittest import BaseUnitTest from pypokerengine.players.sample.console_player import PokerPlayer as ConsolePlayer class ConsolePlayerTest(BaseUnitTest): def setUp(self): self.valid_actions = [\ {'action': 'fold', 'amount': 0},\ {'action': 'call', 'amount': 10},\ {'action'...
from tests.base_unittest import BaseUnitTest from pypokerengine.players.sample.console_player import PokerPlayer as ConsolePlayer class ConsolePlayerTest(BaseUnitTest): def setUp(self): self.valid_actions = [\ {'action': 'fold', 'amount': 0},\ {'action': 'call', 'amount': 10},\ {'action'...
Python
0.000002
c9cd0ed7b8d9d43c4143074489fcd5e14137b45a
implement list method main loop and quit action
queue.py
queue.py
#!/usr/bin/python3.4 # -*-coding:Utf-8 -* '''module that contain queue class''' from renderingTask import renderingTask import os class queue: '''class who contain the list of all the rendering task to manage''' def __init__(self,xml=False): '''initialize queue object with empty queue who is filled with values...
#!/usr/bin/python3.4 # -*-coding:Utf-8 -* '''module that contain queue class''' from renderingTask import renderingTask class queue: '''class who contain the list of all the rendering task to manage''' def __init__(self,xml=False): '''initialize queue object with empty queue who is filled with values extract f...
Python
0
1bafd352110d186d1371d14714abd8de7e6e590f
Update prompt
pwndbg/__init__.py
pwndbg/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import gdb import pwndbg.arch import pwndbg.arguments import pwndbg.disasm import pwndbg.disasm.arm import pwndbg.disasm.jump import pwndbg.disasm.mips import pwndbg.disasm.ppc import pwndbg.disasm.sparc import pwndbg.disasm.x86 import pwndbg.vmmap import pwndbg.dt import ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import gdb import pwndbg.arch import pwndbg.arguments import pwndbg.disasm import pwndbg.disasm.arm import pwndbg.disasm.jump import pwndbg.disasm.mips import pwndbg.disasm.ppc import pwndbg.disasm.sparc import pwndbg.disasm.x86 import pwndbg.vmmap import pwndbg.dt import ...
Python
0.000001
ea2faeb88d2b6ddc98a9a10c760574dca993673c
change func1 to accept args
py/decorator_ex.py
py/decorator_ex.py
def entryExitFunc(f): def newFunc(): print "inside decorator function" print "entering", f.__name__ f() print "exited", f.__name__ return newFunc class entryExit(object): ''' If there are no decorator arguments, the function to be decorated is passed to the constr...
def entryExitFunc(f): def newFunc(): print "inside decorator function" print "entering", f.__name__ f() print "exited", f.__name__ return newFunc class entryExit(object): def __init__(self, f): ''' If there are no decorator arguments, the function to be decorated ...
Python
0.000001
b553029859b55db2963b15694f5f17714ac8c079
Update Futures_demo.py
examples/Futures_demo.py
examples/Futures_demo.py
import matplotlib.pyplot as plt import OnePy as op ####### Strategy Demo class MyStrategy(op.StrategyBase): # 可用参数: # list格式: self.cash, self.position, self.margin, # self.total, self.unre_profit def __init__(self,marketevent): super(MyStrategy,self).__init__(mar...
import matplotlib.pyplot as plt import OnePy as op ####### Strategy Demo class MyStrategy(op.StrategyBase): # 可用参数: # list格式: self.cash, self.position, self.margin, # self.total, self.unre_profit def __init__(self,marketevent): super(MyStrategy,self).__init__(mar...
Python
0.000001
a49c58450316fd87676da9ca8b58acc71b1062b9
Removed import of __future__ print
pydy/viz/server.py
pydy/viz/server.py
#!/usr/bin/env python import os import signal import socket import webbrowser import BaseHTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler __all__ = ['Server'] class StoppableHTTPServer(BaseHTTPServer.HTTPServer): """ Overrides BaseHTTPServer.HTTPServer to include a stop function. ""...
#!/usr/bin/env python from __future__ import print_function import os import signal import socket import webbrowser import BaseHTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler __all__ = ['Server'] class StoppableHTTPServer(BaseHTTPServer.HTTPServer): """ Overrides BaseHTTPServer.HTTPServer...
Python
0.998496
0ed07211d62044a42e1b0ff024f8feb20435270d
Use strings for IDs in Committee Popolo
pombola/south_africa/views/api.py
pombola/south_africa/views/api.py
from django.http import JsonResponse from django.views.generic import ListView from pombola.core.models import Organisation # Output Popolo JSON suitable for WriteInPublic for any committees that have an # email address. class CommitteesPopoloJson(ListView): queryset = Organisation.objects.filter( kind__...
from django.http import JsonResponse from django.views.generic import ListView from pombola.core.models import Organisation # Output Popolo JSON suitable for WriteInPublic for any committees that have an # email address. class CommitteesPopoloJson(ListView): queryset = Organisation.objects.filter( kind__...
Python
0.000001
c606e5d1481ae82072cccd4b9edb6b7d73933277
update version in preparation for release
pyface/__init__.py
pyface/__init__.py
#------------------------------------------------------------------------------ # Copyright (c) 2005-2011, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions des...
#------------------------------------------------------------------------------ # Copyright (c) 2005-2011, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions des...
Python
0
3429e18dd112f4c5058d0e27662379c2860baded
Fix indentation on string_methods.py
exercises/concept/little-sisters-essay/string_methods.py
exercises/concept/little-sisters-essay/string_methods.py
def capitalize_title(title): """ :param title: str title string that needs title casing :return: str title string in title case (first letters capitalized) """ pass def check_sentence_ending(sentence): """ :param sentence: str a sentence to check. :return: bool True if punctuated ...
def capitalize_title(title): """ :param title: str title string that needs title casing :return: str title string in title case (first letters capitalized) """ pass def check_sentence_ending(sentence): """ :param sentence: str a sentence to check. :return: bool True if punctuated ...
Python
0.998856
d779c126e922b6b9907100ac4fc75de9d085b98a
Revert "Update runc4.py"
MR-OCP/MROCPdjango/ocpipeline/procs/runc4.py
MR-OCP/MROCPdjango/ocpipeline/procs/runc4.py
#!/usr/bin/env python # Copyright 2014 Open Connectome Project (http://openconnecto.me) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
#!/usr/bin/env python # Copyright 2014 Open Connectome Project (http://openconnecto.me) # # 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 # #...
Python
0
217d1f94f03b5cda709798dda98380362b937bd3
update comment
samples/python/topology/games/fizz_buzz.py
samples/python/topology/games/fizz_buzz.py
from streamsx.topology.topology import Topology import streamsx.topology.context import fizz_buzz_functions def main(): """ Plays Fizz Buzz (https://en.wikipedia.org/wiki/Fizz_buzz) Example: python3 fizz_buzz.py Output: 1 2 Fizz! 4 Buzz! Fiz...
from streamsx.topology.topology import Topology import streamsx.topology.context import fizz_buzz_functions def main(): """ Plays Fizz Buzz (https://en.wikipedia.org/wiki/Fizz_buzz) Example: python3 fizz_buzz.py Output: 1 2 Fizz! 4 Buzz! Fiz...
Python
0