commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
f20a8f8d05e641a123062e5ad1f9e2f9959f92b6 | Create setup script | jakogut/KiWI | setup.py | setup.py | from distutils.core import setup
setup(
name = 'KiWI',
description = 'Killer Windows Installer',
author = 'Joseph Kogut',
author_email = 'joseph.kogut@gmail.com',
url = 'josephkogut.com/yaknet/kiwi.git',
packages = ['kiwi'],
)
| mit | Python | |
844d9cc7f04ae1a40b54d60cb9d8ad884a8673e0 | make argparse mandatory only for python 2 | unbit/uwsgitop,xrmx/uwsgitop | setup.py | setup.py | from setuptools import setup
import os
VERSION = '0.10'
setup(
maintainer='Riccardo Magliocchetti',
maintainer_email='riccardo.magliocchetti@gmail.com',
name='uwsgitop',
version=VERSION,
description='uWSGI top-like interface',
license='MIT',
long_description=open(os.path.join(os.path.dirna... | from setuptools import setup
import os
VERSION = '0.10'
setup(
maintainer='Riccardo Magliocchetti',
maintainer_email='riccardo.magliocchetti@gmail.com',
name='uwsgitop',
version=VERSION,
description='uWSGI top-like interface',
license='MIT',
long_description=open(os.path.join(os.path.dirna... | mit | Python |
1c4aa1cdb662bbd346e035765dd0a18a43f44552 | Update classifiers in setup.py | lwoydziak/mockito-python,kaste/mockito-python | setup.py | setup.py | from setuptools import setup
import sys
extra = {}
if sys.version_info >= (3,):
extra['use_2to3'] = True
install_requires = ['funcsigs'] if sys.version_info < (3,) else []
setup(name='mockito',
version='1.0.0-pre0',
packages=['mockito', 'mockito_test'],
url='https://github.com/kaste/mockito-pyt... | from setuptools import setup
import sys
extra = {}
if sys.version_info >= (3,):
extra['use_2to3'] = True
install_requires = ['funcsigs'] if sys.version_info < (3,) else []
setup(name='mockito',
version='1.0.0-pre0',
packages=['mockito', 'mockito_test'],
url='https://github.com/kaste/mockito-pyt... | mit | Python |
45ae372229339470bc692e64ed5496763eada76d | Fix installation script | karel-brinda/rnftools,karel-brinda/rnftools | setup.py | setup.py | import sys
import setuptools
from pbr import util
setuptools.setup(
setup_requires=['pbr'],
pbr=True,
)
| import sys
import setuptools
from pbr import util
setuptools.setup(
**util.cfg_to_args()
)
| mit | Python |
8fb538d9ae9562ceb7e4b8bbad7608f1a6d4ffea | Fix lxml dependency. | nberger/airbrake-django,samant/airbrake-django | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='django-airbrake',
version='0.0.1',
description='A Django app for submitting exceptions to Airbrake.io.',
long_description='',
keywords='django, airbrake',
author='Joseph C. Stump',
author_email='joe@stu.mp',
url='https://github.c... | from setuptools import setup, find_packages
setup(
name='django-airbrake',
version='0.0.1',
description='A Django app for submitting exceptions to Airbrake.io.',
long_description='',
keywords='django, airbrake',
author='Joseph C. Stump',
author_email='joe@stu.mp',
url='https://github.c... | bsd-3-clause | Python |
2bc7c9a760cd70b5e0d8f6c91adbb1003648e117 | use find_packages in setup.py | nimbis/django-shop-richproduct,nimbis/django-shop-richproduct | setup.py | setup.py | from setuptools import setup, find_packages
from pip.req import parse_requirements
# parse requirements
reqs = parse_requirements("requirements/common.txt")
# setup the project
setup(
name="django-shop-richproduct",
version="0.1.1",
author="Nimbis Services, Inc.",
author_email="info@nimbisservices.com... | from setuptools import setup
from pip.req import parse_requirements
# parse requirements
reqs = parse_requirements("requirements/common.txt")
# setup the project
setup(
name="django-shop-richproduct",
version="0.1.1",
author="Nimbis Services, Inc.",
author_email="info@nimbisservices.com",
descript... | bsd-3-clause | Python |
17908a0a112a84618bfe469c42c3523dc7099693 | update version | drgrib/dotmap | setup.py | setup.py | from setuptools import setup
setup(
version = '1.2.18',
name = 'dotmap',
packages = ['dotmap'], # this must be the same as the name above
description = 'ordered, dynamically-expandable dot-access dictionary',
author = 'Chris Redford',
author_email = 'credford@gmail.com',
url = 'https://github.com/drgrib/dotmap'... | from setuptools import setup
setup(
version = '1.2.17',
name = 'dotmap',
packages = ['dotmap'], # this must be the same as the name above
description = 'ordered, dynamically-expandable dot-access dictionary',
author = 'Chris Redford',
author_email = 'credford@gmail.com',
url = 'https://github.com/drgrib/dotmap'... | mit | Python |
c4f3238276ef319777bcd5015b87c62a659aa79a | Add default description to pagerduty_event | topmonks/tutum-hipchat,alexdebrie/tutum-stream | integrations/pagerduty.py | integrations/pagerduty.py | import json
import os
import requests
PAGERDUTY_URL = 'https://events.pagerduty.com/generic/2010-04-15/create_event.json'
PAGERDUTY_KEY = os.environ.get('PAGERDUTY_KEY', '')
def pagerduty_event(event_type="trigger", incident_key=None, description=None, client=None, client_url=None, service_key=PAGERDUTY_KEY):
if ... | import json
import os
import requests
PAGERDUTY_URL = 'https://events.pagerduty.com/generic/2010-04-15/create_event.json'
PAGERDUTY_KEY = os.environ.get('PAGERDUTY_KEY', '')
def pagerduty_event(event_type="trigger", incident_key=None, description=None, client=None, client_url=None, service_key=PAGERDUTY_KEY):
if ... | mit | Python |
aa81a9de5f2b8e3e660bb063697e291fb7d50d5d | Use setuptools for develop install. | jgosmann/fridge,jgosmann/fridge | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
import os
import os.path
import shutil
# The test output of the system tests may contain symlinks to non-existing
# files which make distutils throw an exception (even though they are pruned).
test_output_dir = os.path.join(os.curdir, 'systemtests', 'test-output')
if... | #!/usr/bin/env python
from distutils.core import setup
import os
import os.path
import shutil
# The test output of the system tests may contain symlinks to non-existing
# files which make distutils throw an exception (even though they are pruned).
test_output_dir = os.path.join(os.curdir, 'systemtests', 'test-output'... | mit | Python |
52a815599b4a5e168edebc2a63f9176e0c40625d | Bump version to 0.2.0. | lgunsch/django-vmail | setup.py | setup.py | import os
from distutils.core import setup
VERSION = '0.2.0'
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
required = [
'Django >= 1.5.0',
]
setup(
name='django-vmail',
version=VERSION,
description="Virtual mail administration django app",
author="Lewis Gunsch",
... | import os
from distutils.core import setup
VERSION = '0.2.0-dev'
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
required = [
'Django >= 1.5.0',
]
setup(
name='django-vmail',
version=VERSION,
description="Virtual mail administration django app",
author="Lewis Gunsch"... | mit | Python |
bda827001bc110dd58a82013d33667b5b7058dda | Change error messages to warnings when rebuilding thumbnails | SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree | InvenTree/InvenTree/management/commands/rebuild_thumbnails.py | InvenTree/InvenTree/management/commands/rebuild_thumbnails.py | """
Custom management command to rebuild thumbnail images
- May be required after importing a new dataset, for example
"""
import os
import logging
from PIL import UnidentifiedImageError
from django.core.management.base import BaseCommand
from django.conf import settings
from django.db.utils import OperationalError... | """
Custom management command to rebuild thumbnail images
- May be required after importing a new dataset, for example
"""
import os
import logging
from PIL import UnidentifiedImageError
from django.core.management.base import BaseCommand
from django.conf import settings
from django.db.utils import OperationalError... | mit | Python |
845eb9209ebaf7f7acb9e748a94650ec74935ca2 | Update gevent dependency; bump version number | fujita-shintaro/ouimeaux,tomjmul/wemo,drock371/ouimeaux,sstangle73/ouimeaux,aktur/ouimeaux,sstangle73/ouimeaux,rgardner/ouimeaux,m-kiuchi/ouimeaux,tomjmul/wemo,fujita-shintaro/ouimeaux,tomjmul/wemo,rgardner/ouimeaux,bennytheshap/ouimeaux,m-kiuchi/ouimeaux,fritz-fritz/ouimeaux,sstangle73/ouimeaux,bennytheshap/ouimeaux,i... | setup.py | setup.py | from setuptools import setup, find_packages
import sys, os
version = '0.6'
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
description = f.read()
setup(name='ouimeaux',
version=version,
description="Python API to Belkin WeMo devices",
long_description=description,
c... | from setuptools import setup, find_packages
import sys, os
version = '0.5.2'
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
description = f.read()
setup(name='ouimeaux',
version=version,
description="Python API to Belkin WeMo devices",
long_description=description,
... | bsd-3-clause | Python |
5b30416d0fbaf3b89821331eaa872cf5bd278cf4 | add exported routes call, bump version | 20c/pybird | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name='pybird',
version='1.0.8',
description='BIRD interface handler for Python',
author='Erik Romijn',
author_email='eromijn@solidlinks.nl',
license="BSD",
py_modules=["pybird"],
)
| #!/usr/bin/env python
from distutils.core import setup
setup(name='pybird',
version='1.0.7',
description='BIRD interface handler for Python',
author='Erik Romijn',
author_email='eromijn@solidlinks.nl',
license="BSD",
py_modules=["pybird"],
)
| apache-2.0 | Python |
7a589b08ab269d510245918be7e0dbb21508b7f2 | Update evidence for testing | vangj/py-bbn,vangj/py-bbn | start.py | start.py | from pybbn.graph.dag import BbnUtil
from pybbn.graph.jointree import Evidence, EvidenceBuilder, EvidenceType
from pybbn.graph.node import Clique, SepSet
from pybbn.pptc.potentialinitializer import PotentialInitializer
from pybbn.pptc.moralizer import Moralizer
from pybbn.pptc.triangulator import Triangulator
from pybbn... | from pybbn.graph.dag import BbnUtil
from pybbn.graph.jointree import Evidence, EvidenceBuilder, EvidenceType
from pybbn.graph.node import Clique, SepSet
from pybbn.pptc.potentialinitializer import PotentialInitializer
from pybbn.pptc.moralizer import Moralizer
from pybbn.pptc.triangulator import Triangulator
from pybbn... | apache-2.0 | Python |
b4b9ab2bc30aa076f5f6ead5ff72d00684b33c47 | Add enum34 dependency. | codeaudit/nfldb,BurntSushi/nfldb,verdimrc/nfldb,bparafina/nfldb,nivertech/nfldb,BurntSushi/nfldb,bparafina/nfldb,codeaudit/nfldb,verdimrc/nfldb,nivertech/nfldb | setup.py | setup.py | import codecs
from distutils.core import setup
from glob import glob
import os.path as path
cwd = path.dirname(__file__)
longdesc = codecs.open(path.join(cwd, 'longdesc.rst'), 'r', 'utf-8').read()
version = '0.0.0'
with codecs.open(path.join(cwd, 'nfldb/version.py'), 'r', 'utf-8') as f:
exec(f.read())
version... | import codecs
from distutils.core import setup
from glob import glob
import os.path as path
cwd = path.dirname(__file__)
longdesc = codecs.open(path.join(cwd, 'longdesc.rst'), 'r', 'utf-8').read()
version = '0.0.0'
with codecs.open(path.join(cwd, 'nfldb/version.py'), 'r', 'utf-8') as f:
exec(f.read())
version... | unlicense | Python |
2f953002ee861d7c1683989722a244a799a5cf04 | Use README as package description | erocarrera/pydot,pydot/pydot | setup.py | setup.py | #!/usr/bin/env python
"""Installation script."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import codecs
import os
import pydot
CURRENT_DIR = os.path.dirname(__file__)
def get_long_description() -> str:
readme_path = os.path.join(CURRENT_DIR, "README.md")
... | #!/usr/bin/env python
"""Installation script."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import pydot
long_description = '''
A Python interface to GraphViz and the DOT language.
This package includes an interface to GraphViz [1], with classes to represent
graphs... | mit | Python |
dbe724107f7087ec672a2448a46b2acb1e8d1c0b | Bump version number. | KayEss/django-pubsubpull,KayEss/django-pubsubpull,KayEss/django-pubsubpull | setup.py | setup.py | import os
from setuptools import setup
def read(fname1, fname2):
if os.path.exists(fname1):
fname = fname1
else:
fname = fname2
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "django-pubsubpull",
version = "0.0.0.5",
author = "Kirit Saelensmind... | import os
from setuptools import setup
def read(fname1, fname2):
if os.path.exists(fname1):
fname = fname1
else:
fname = fname2
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "django-pubsubpull",
version = "0.0.0.4",
author = "Kirit Saelensmind... | mit | Python |
a30e810572fa78e3f847101930850394f27d44d5 | Change version. | joommf/oommffield | setup.py | setup.py | from setuptools import setup
with open('README.rst') as f:
readme = f.read()
setup(
name='oommffield',
version='0.3',
description='A Python package for analysing and manipulating OOMMF vector field files',
long_description=readme,
author='Computational Modelling Group',
author_email='fango... | from setuptools import setup
with open('README.rst') as f:
readme = f.read()
setup(
name='oommffield',
version='0.2',
description='A Python package for analysing and manipulating OOMMF vector field files',
long_description=readme,
author='Computational Modelling Group',
author_email='fango... | bsd-2-clause | Python |
ef282d7881c2ca2d1073a94632518baf41a14cb4 | Allow disabling C extension | openslide/openslide-python,openslide/openslide-python | setup.py | setup.py | import os
from setuptools import setup, Extension, Feature
# Load version string
_verfile = os.path.join(os.path.dirname(__file__), 'openslide', '_version.py')
with open(_verfile) as _fh:
exec(_fh.read())
setup(
name='openslide-python',
version=__version__,
packages=[
'openslide',
],
f... | import os
from setuptools import setup, Extension
# Load version string
_verfile = os.path.join(os.path.dirname(__file__), 'openslide', '_version.py')
with open(_verfile) as _fh:
exec(_fh.read())
setup(
name='openslide-python',
version=__version__,
packages=[
'openslide',
],
ext_module... | lgpl-2.1 | Python |
aca3f486c2b00897da8428be9220a0868c2bdf0d | Add dependencies to setup.py | DistilledLtd/polly | setup.py | setup.py | from distutils.core import setup
setup(
name='polly',
packages=['polly'],
version='0.3',
description='A library for parsing and validating rel-alternate-hreflang entries on a page.',
author='Tom Anthony',
author_email='tom.anthony@distilled.net',
url='https://github.com/DistilledLtd/polly',
... | from distutils.core import setup
setup(
name='polly',
packages=['polly'],
version='0.3',
description='A library for parsing and validating rel-alternate-hreflang entries on a page.',
author='Tom Anthony',
author_email='tom.anthony@distilled.net',
url='https://github.com/DistilledLtd/polly',
... | apache-2.0 | Python |
e28153f0fad0804ea7160abe5a75c281e1f9258f | Update isort requirement | kvesteri/postgresql-audit | setup.py | setup.py | """
PostgreSQL-Audit
----------------
Versioning and auditing extension for PostgreSQL and SQLAlchemy.
"""
import os
import re
from setuptools import find_packages, setup
HERE = os.path.dirname(os.path.abspath(__file__))
def get_version():
filename = os.path.join(HERE, 'postgresql_audit', '__init__.py')
w... | """
PostgreSQL-Audit
----------------
Versioning and auditing extension for PostgreSQL and SQLAlchemy.
"""
import os
import re
from setuptools import find_packages, setup
HERE = os.path.dirname(os.path.abspath(__file__))
def get_version():
filename = os.path.join(HERE, 'postgresql_audit', '__init__.py')
w... | bsd-2-clause | Python |
196cb648145dc512e95a603db564c7d919cafe40 | Bump release | soasme/flask-perm,soasme/flask-perm,soasme/flask-perm | setup.py | setup.py | """
A permission flask extension inspired by Django.
"""
from setuptools import setup
setup(
name='Flask-Perm',
version='0.1.7',
url='https://github.com/soasme/flask-perm',
license='MIT',
author='Ju Lin',
author_email='soasme@gmail.com',
description='Flask Permission Management Extension'... | """
A permission flask extension inspired by Django.
"""
from setuptools import setup
setup(
name='Flask-Perm',
version='0.1.6',
url='https://github.com/soasme/flask-perm',
license='MIT',
author='Ju Lin',
author_email='soasme@gmail.com',
description='Flask Permission Management Extension'... | mit | Python |
8f8f791c5f3cf1f59851177059bfa5cedd7b603b | Update setup.py (#99) | openai/openai-python | setup.py | setup.py | import os
from setuptools import find_packages, setup
version_contents = {}
version_path = os.path.join(
os.path.abspath(os.path.dirname(__file__)), "openai/version.py"
)
with open(version_path, "rt") as f:
exec(f.read(), version_contents)
setup(
name="openai",
description="Python client library for ... | import os
from setuptools import find_packages, setup
version_contents = {}
version_path = os.path.join(
os.path.abspath(os.path.dirname(__file__)), "openai/version.py"
)
with open(version_path, "rt") as f:
exec(f.read(), version_contents)
setup(
name="openai",
description="Python client library for ... | mit | Python |
8424d9a2c6836743c4e8e1d505a538f9006404c0 | Bump to v21 | Kane610/axis | setup.py | setup.py | """Setup for Axis."""
# https://jeffknupp.com/blog/2013/08/16/open-sourcing-a-python-project-the-right-way/
# http://peterdowns.com/posts/first-time-with-pypi.html
# pip install -e .
# Upload to PyPI Live
# python setup.py sdist bdist_wheel
# twine upload dist/axis-* --skip-existing
from setuptools import setup
setu... | """Setup for Axis."""
# https://jeffknupp.com/blog/2013/08/16/open-sourcing-a-python-project-the-right-way/
# http://peterdowns.com/posts/first-time-with-pypi.html
# pip install -e .
# Upload to PyPI Live
# python setup.py sdist bdist_wheel
# twine upload dist/axis-* --skip-existing
from setuptools import setup
setu... | mit | Python |
0163e8821288db826b595051a6312b19c66e05f0 | Add a conditional to check whther 'arg' is a byte | joausaga/ideascaly | ideascaly/utils.py | ideascaly/utils.py | # IdeaScaly
# Copyright 2015 Jorge Saldivar
# See LICENSE for details.
import six
import dateutil.parser
def parse_datetime(str_date):
try:
date_is = dateutil.parser.parse(str_date)
return date_is
except:
return None
def parse_html_value(html):
return html[html.find('>')+1:html.r... | # IdeaScaly
# Copyright 2015 Jorge Saldivar
# See LICENSE for details.
import six
import dateutil.parser
def parse_datetime(str_date):
try:
date_is = dateutil.parser.parse(str_date)
return date_is
except:
return None
def parse_html_value(html):
return html[html.find('>')+1:html.r... | mit | Python |
3b2b54ee134b62deafb9521d7dcada90d4c44d06 | Migrate python-oslogin synth.py from artman to bazel (#12) | googleapis/python-oslogin,googleapis/python-oslogin | synth.py | synth.py | # Copyright 2018 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 2018 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... | apache-2.0 | Python |
d3c0db05d9fb5adbf7438e005605af437dba61a6 | clean up (#176) | googleapis/nodejs-datalabeling,googleapis/nodejs-datalabeling,googleapis/nodejs-datalabeling | synth.py | synth.py | # Copyright 2018 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 2018 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... | apache-2.0 | Python |
abd5c75dbe8eab93504888c2483f63e77e72ffb2 | Remove setup_log function from misc init (no longer present) | jkitzes/macroeco | macroeco/misc/__init__.py | macroeco/misc/__init__.py | """
===============================
Misc (:mod:`macroeco.misc`)
===============================
This module contains miscellaneous functions that support the functions of
other modules of macroeco.
Support Functions
=================
.. autosummary::
:toctree: generated/
log_start_end
inherit_docstring_fro... | """
===============================
Misc (:mod:`macroeco.misc`)
===============================
This module contains miscellaneous functions that support the functions of
other modules of macroeco.
Support Functions
=================
.. autosummary::
:toctree: generated/
setup_log
log_start_end
inherit_... | bsd-2-clause | Python |
0cbb841ba94c8d813ff81e817154c5491a796f20 | Fix extraction (closes #14043) | spvkgn/youtube-dl,rg3/youtube-dl,dstftw/youtube-dl,vijayanandnandam/youtube-dl,ping/youtube-dl,phihag/youtube-dl,gkoelln/youtube-dl,nyuszika7h/youtube-dl,longman694/youtube-dl,phihag/youtube-dl,kidburglar/youtube-dl,yan12125/youtube-dl,longman694/youtube-dl,ping/youtube-dl,unreal666/youtube-dl,rrooij/youtube-dl,rg3/you... | youtube_dl/extractor/bpb.py | youtube_dl/extractor/bpb.py | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
js_to_json,
determine_ext,
)
class BpbIE(InfoExtractor):
IE_DESC = 'Bundeszentrale für politische Bildung'
_VALID_URL = r'https?://(?:www\.)?bpb\.de/mediathek/(?P<id>[0-9]+)/'
... | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
js_to_json,
determine_ext,
)
class BpbIE(InfoExtractor):
IE_DESC = 'Bundeszentrale für politische Bildung'
_VALID_URL = r'https?://(?:www\.)?bpb\.de/mediathek/(?P<id>[0-9]+)/'
... | unlicense | Python |
d20889e35f153aa12b7315532a1d04bc2c90e355 | remove typo at end | felliott/scrapi,mehanig/scrapi,erinspace/scrapi,fabianvf/scrapi,jeffreyliu3230/scrapi,ostwald/scrapi,erinspace/scrapi,icereval/scrapi,CenterForOpenScience/scrapi,felliott/scrapi,fabianvf/scrapi,mehanig/scrapi,alexgarciac/scrapi,CenterForOpenScience/scrapi | scrapi/consumers/trinity/__init__.py | scrapi/consumers/trinity/__init__.py | """
Harvests metadata from the Digital Commons at Trinity University for the SHARE project
More infomation at https://github.com/CenterForOpenScience/SHARE/blob/master/providers/edu.trinity.md
Example API call: http://digitalcommons.trinity.edu/do/oai/?verb=ListRecords&metadataPrefix=oai_dc&from=2014-09-29T00:00:00Z
... | """
Harvests metadata from the Digital Commons at Trinity University for the SHARE project
More infomation at https://github.com/CenterForOpenScience/SHARE/blob/master/providers/edu.trinity.md
Example API call: http://digitalcommons.trinity.edu/do/oai/?verb=ListRecords&metadataPrefix=oai_dc&from=2014-09-29T00:00:00Z
... | apache-2.0 | Python |
e54c19dec929c52b2bfbeaa33a13cda523036536 | fix log arg | fliem/bidswrapps | scripts/bidswrapps_check_logfiles.py | scripts/bidswrapps_check_logfiles.py | #! /usr/bin/env python
import argparse
import os
from glob import glob
from bidswrapps.bidswrapps_echo_and_run_cmd import print_stars
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Checks bidsapps logfiles')
parser.add_argument('logfiles_dir', nargs='*', default=os.getcwd(),
... | #! /usr/bin/env python
import argparse
import os
from glob import glob
from bidswrapps.bidswrapps_echo_and_run_cmd import print_stars
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Checks bidsapps logfiles')
parser.add_argument('logfiles_dir', default=os.getcwd(),
... | apache-2.0 | Python |
b5fc7ff684284abe9fceabcc2258f311bff763d9 | Update documentation | wikimedia/pywikibot-core,wikimedia/pywikibot-core | scripts/maintenance/preload_sites.py | scripts/maintenance/preload_sites.py | #!/usr/bin/python3
"""Script that preloads site and user info for all sites of given family.
The following parameters are supported:
-worker:<num> The number of parallel tasks to be run. Default is the
number of processors on the machine
Usage:
python pwb.py preload_sites [{<family>}] [-wo... | #!/usr/bin/python3
"""Script that preloads site and user info for all sites of given family.
The following parameters are supported:
-worker:<num> The number of parallel tasks to be run. Default is the
number of precessors on the machine
Usage:
python pwb.py preload_sites [{<family>}] [-wo... | mit | Python |
4925a95081b9b1f33274d7f56f03b3f3f3ad9846 | use pyiem.send2box util function for daily upload | akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem | scripts/util/daily_archive_backup.py | scripts/util/daily_archive_backup.py | """Send a tar file of our daily data to CyBox!
Note, needs a ~/.netrc file with 600 perms
Lets run at 12z for the previous date
"""
import datetime
import subprocess
import os
import sys
import glob
from pyiem.util import send2box
def run(date):
"""Upload this date's worth of data!"""
os.chdir("/mesonet/tmp... | """Send a tar file of our daily data to CyBox!
Note, needs a ~/.netrc file with 600 perms
Lets run at 12z for the previous date
"""
import datetime
import subprocess
import os
import sys
import glob
def run(date):
"""Upload this date's worth of data!"""
os.chdir("/mesonet/tmp")
tarfn = date.strftime("ie... | mit | Python |
18aaec8071c16c0c3f5214eeada23798adf94c1e | Fix shebang | nlindblad/ipplan2sqlite,nlindblad/ipplan2sqlite,nlindblad/ipplan2sqlite,nlindblad/ipplan2sqlite,nlindblad/ipplan2sqlite | ipplan2sqlite/generate.py | ipplan2sqlite/generate.py | #!/usr/bin/env python2
import sqlite3, os, sys, re, json
path = os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib'))
if not path in sys.path:
sys.path.insert(1, path)
del path
SYNTAX = {"^#@" : "master_network", "^#\$" : "host", "^[A-Z]" : "network" }
# Check arguments
if len(sys.argv) < 4:
print "Us... | #!/usr/bin/python
import sqlite3, os, sys, re, json
path = os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib'))
if not path in sys.path:
sys.path.insert(1, path)
del path
SYNTAX = {"^#@" : "master_network", "^#\$" : "host", "^[A-Z]" : "network" }
# Check arguments
if len(sys.argv) < 4:
print "Usage: ... | bsd-3-clause | Python |
4d9d852959e775a00e7ab15a91dd9ee63a773167 | Remove TMSC hardcode to generalise the token symbol | habibmasuro/omniwallet,dexX7/omniwallet,achamely/omniwallet,Nevtep/omniwallet,Nevtep/omniwallet,OmniLayer/omniwallet,habibmasuro/omniwallet,dexX7/omniwallet,achamely/omniwallet,habibmasuro/omniwallet,Nevtep/omniwallet,OmniLayer/omniwallet,VukDukic/omniwallet,OmniLayer/omniwallet,Nevtep/omniwallet,OmniLayer/omniwallet,V... | api/get_balance.py | api/get_balance.py | import urlparse
import os, sys
import json
tools_dir = os.environ.get('TOOLSDIR')
lib_path = os.path.abspath(tools_dir)
sys.path.append(lib_path)
from msc_apps import *
data_dir_root = os.environ.get('DATADIR')
# Get the Mastercoin balances. Not that this is also creating the default balance
# object, and should run... | import urlparse
import os, sys
import json
tools_dir = os.environ.get('TOOLSDIR')
lib_path = os.path.abspath(tools_dir)
sys.path.append(lib_path)
from msc_apps import *
data_dir_root = os.environ.get('DATADIR')
# Get the Mastercoin balances. Not that this is also creating the default balance
# object, and should run... | agpl-3.0 | Python |
7687ae5dac83e664dce3940880ed67bfec96611e | fix coding style [skip ci] | buildtimetrend/service,buildtimetrend/service,buildtimetrend/service | tasks.py | tasks.py | # vim: set expandtab sw=4 ts=4:
"""
Celery Tasks Queue.
Copyright (C) 2014-2015 Dieter Adriaenssens <ruleant@users.sourceforge.net>
This file is part of buildtimetrend/python-service
<https://github.com/buildtimetrend/python-service/>
This program is free software: you can redistribute it and/or modify
it under the ... | # vim: set expandtab sw=4 ts=4:
"""
Celery Tasks Queue.
Copyright (C) 2014-2015 Dieter Adriaenssens <ruleant@users.sourceforge.net>
This file is part of buildtimetrend/python-service
<https://github.com/buildtimetrend/python-service/>
This program is free software: you can redistribute it and/or modify
it under the ... | agpl-3.0 | Python |
42449f17d4afd0587a86b299e8046d8742f165af | FIX class name | ingadhoc/sale,ingadhoc/sale,ingadhoc/sale,ingadhoc/sale | sale_restrict_partners/partner.py | sale_restrict_partners/partner.py | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, fields
class ResPart... | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, fields
class sale_or... | agpl-3.0 | Python |
12d0d6f2ca89e64aef386d0169f43a9a757464e0 | Update retinanet_swin-t-p4-w7_fpn_1x_coco.py (#6973) | open-mmlab/mmdetection,open-mmlab/mmdetection | configs/swin/retinanet_swin-t-p4-w7_fpn_1x_coco.py | configs/swin/retinanet_swin-t-p4-w7_fpn_1x_coco.py | _base_ = [
'../_base_/models/retinanet_r50_fpn.py',
'../_base_/datasets/coco_detection.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
pretrained = 'https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_tiny_patch4_window7_224.pth' # noqa
model = dict(
bac... | _base_ = [
'../_base_/models/retinanet_r50_fpn.py',
'../_base_/datasets/coco_detection.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
pretrained = 'https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_tiny_patch4_window7_224.pth' # noqa
model = dict(
bac... | apache-2.0 | Python |
6dab94bbf811bea6d82271a107d2ce04d47d6f41 | Change test for get_drug_inhibition_stmts | johnbachman/indra,pvtodorov/indra,sorgerlab/belpy,sorgerlab/indra,sorgerlab/belpy,sorgerlab/indra,johnbachman/indra,pvtodorov/indra,bgyori/indra,sorgerlab/indra,johnbachman/indra,pvtodorov/indra,johnbachman/belpy,sorgerlab/belpy,bgyori/indra,johnbachman/belpy,johnbachman/belpy,pvtodorov/indra,bgyori/indra | indra/tests/test_chembl_client.py | indra/tests/test_chembl_client.py | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from indra.statements import Agent
from indra.databases import chembl_client
from indra.util import unicode_strs
vem = Agent('VEMURAFENIB', db_refs={'CHEBI': '63637', 'TEXT': 'VEMURAFENIB'})
az628 = Agent('AZ628', d... | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from indra.statements import Agent
from indra.databases import chembl_client
from indra.util import unicode_strs
vem = Agent('VEMURAFENIB', db_refs={'CHEBI': '63637', 'TEXT': 'VEMURAFENIB'})
az628 = Agent('AZ628', d... | bsd-2-clause | Python |
45530283273049bcb2bc0694c0ac41ea59fa5507 | disable old layout | stonestone/stonefreedomsponsors,freedomsponsors/www.freedomsponsors.org,freedomsponsors/www.freedomsponsors.org,stonestone/stonefreedomsponsors,bankonme/www.freedomsponsors.org,freedomsponsors/www.freedomsponsors.org,bankonme/www.freedomsponsors.org,freedomsponsors/www.freedomsponsors.org,bankonme/www.freedomsponsors.o... | djangoproject/core/views/__init__.py | djangoproject/core/views/__init__.py | __author__ = 'tony'
def is_old_layout(request):
return False
# return 'old_layout' in request.session
def template_folder(request):
return 'core2'
# if is_old_layout(request):
# return 'core/'
# else:
# return 'core2/'
HOME_CRUMB = {
'link': '/',
'name': 'Home'
} | __author__ = 'tony'
def is_old_layout(request):
return 'old_layout' in request.session
def template_folder(request):
if is_old_layout(request):
return 'core/'
else:
return 'core2/'
HOME_CRUMB = {
'link': '/',
'name': 'Home'
} | agpl-3.0 | Python |
a4d392ae597dff47503213ee7e18634e5496cc8b | Improve error handling for CPUByCommandLine.py | google/UIforETW,google/UIforETW,google/UIforETW,google/UIforETW | bin/CPUByCommandLine.py | bin/CPUByCommandLine.py | # Copyright 2019 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2019 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 | Python |
f738812169c14265236e3c304befc7ad0ec776ef | fix gaussian peak random model generator | SasView/sasmodels,SasView/sasmodels,SasView/sasmodels,SasView/sasmodels | sasmodels/models/gaussian_peak.py | sasmodels/models/gaussian_peak.py | r"""
Definition
----------
This model describes a Gaussian shaped peak on a flat background
.. math::
I(q) = (\text{scale}) \exp\left[ -\tfrac12 (q-q_0)^2 / \sigma^2 \right]
+ \text{background}
with the peak having height of *scale* centered at $q_0$ and having a standard
deviation of $\sigma$. The FWH... | r"""
Definition
----------
This model describes a Gaussian shaped peak on a flat background
.. math::
I(q) = (\text{scale}) \exp\left[ -\tfrac12 (q-q_0)^2 / \sigma^2 \right]
+ \text{background}
with the peak having height of *scale* centered at $q_0$ and having a standard
deviation of $\sigma$. The FWH... | bsd-3-clause | Python |
9fe706244e51040afa19eaa1f4c4f315df66e495 | fix python 3 syntax error | knixeur/django-smart-selects,savoirfairelinux/django-smart-selects,knixeur/django-smart-selects,johtso/django-smart-selects,johtso/django-smart-selects,digi604/django-smart-selects,savoirfairelinux/django-smart-selects,digi604/django-smart-selects | smart_selects/utils.py | smart_selects/utils.py | # -*- coding: utf-8 -*-
from django.utils.encoding import force_text
try:
from django.apps import apps
get_model = apps.get_model
except ImportError:
from django.db.models.loading import get_model
def unicode_sorter(input):
""" This function implements sort keys for the german language according to
... | # -*- coding: utf-8 -*-
from django.utils.encoding import force_text
try:
from django.apps import apps
get_model = apps.get_model
except ImportError:
from django.db.models.loading import get_model
def unicode_sorter(input):
""" This function implements sort keys for the german language according to
... | bsd-3-clause | Python |
60723016d4d662caf11600cc0508d971dc22ebdd | Update version to 0.7.3 for release | ayust/evelink | evelink/__init__.py | evelink/__init__.py | """EVELink - Python bindings for the EVE API."""
import logging
from evelink import account
from evelink import api
from evelink import char
from evelink import constants
from evelink import corp
from evelink import eve
from evelink import map
from evelink import server
__version__ = "0.7.3"
# Implement NullHandler... | """EVELink - Python bindings for the EVE API."""
import logging
from evelink import account
from evelink import api
from evelink import char
from evelink import constants
from evelink import corp
from evelink import eve
from evelink import map
from evelink import server
__version__ = "0.7.2"
# Implement NullHandler... | mit | Python |
a34b7c83526b3a5563a7198ec5209299d7851223 | Update mapfunctions.py | suzannerohrback/somaticCNVpipeline,suzannerohrback/somaticCNVpipeline | bin/map/mapfunctions.py | bin/map/mapfunctions.py | #!/usr/bin/python
import sys
import os
import inspect
import subprocess as sub
import shlex
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
import common
import config as cfg
def getBowtieCmd(trim, in... | #!/usr/bin/python
import subprocess as sub
import shlex
| mit | Python |
b92ff3e5b1d17343b918c464eec6db6e243fbc3b | normalize based on data range instead of around zero | RedKrieg/pysparklines | spark.py | spark.py | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
import sys
spark_chars = u"▁▂▃▄▅▆▇█"
def convert_to_float(i):
try:
return float(i)
except:
return None
# Read all data from stdin, split by whitespace
series_data_raw = [ i.strip() for i in sys.stdin.read().split() ]
# Convert valid float... | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
import sys
spark_chars = u"▁▂▃▄▅▆▇█"
def convert_to_float(i):
try:
return float(i)
except:
return None
# Read all data from stdin, split by whitespace
series_data_raw = [ i.strip() for i in sys.stdin.read().split() ]
# Convert valid float... | bsd-2-clause | Python |
ef6b0f75b2823c41d00e2c0d0860fd803d2ba6b9 | remove space | comynli/m | m/ext.py | m/ext.py | class Extension:
def __init__(self, **kwargs):
self.app = kwargs.get('app')
self._initialized = False
def initialize(self, app):
self.app = app
self._initialized = True
@property
def initialized(self):
return self._initialized
|
class Extension:
def __init__(self, **kwargs):
self.app = kwargs.get('app')
self._initialized = False
def initialize(self, app):
self.app = app
self._initialized = True
@property
def initialized(self):
return self._initialized
| apache-2.0 | Python |
855c389081cc17bcb45d82b6977fbbc5dc940d2a | make speedtest and html generation deactivatable | tonka3000/speedtester,tonka3000/speedtester | speed.py | speed.py | #!/usr/bin/env python
import os, argparse
from app.speed import getDownloadSpeed
from app.conv import convertToHtml
from datetime import datetime
import config
# pylint: disable=C0103
__dir = os.path.dirname(os.path.abspath(__file__))
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='speed... | #!/usr/bin/env python
import os
from app.speed import getDownloadSpeed
from app.conv import convertToHtml
from datetime import datetime
import config
# pylint: disable=C0103
__dir = os.path.dirname(os.path.abspath(__file__))
if __name__ == "__main__":
data_directory = os.path.abspath(config.data_directory)
i... | mit | Python |
edb73a4d8bba1c1265bfc00e5a765ff47c120e02 | Add assertIdentical support from twisted.trial | hydralabs/plasma,hydralabs/plasma | plasma/test/__init__.py | plasma/test/__init__.py | # Copyright (c) 2007-2009 The Plasma Project.
# See LICENSE.txt for details.
import unittest
def failUnlessIdentical(self, first, second, msg=None):
"""
Fail the test if C{first} is not C{second}. This is an
obect-identity-equality test, not an object equality (i.e. C{__eq__}) test.
@param msg: if ... | # Copyright (c) 2007-2009 The Plasma Project.
# See LICENSE.txt for details.
| mit | Python |
c57204c95e218feb4d5f6c11f1150214c7f9067a | Make sure db's clean before testing | mehtadev17/mapusaurus,mehtadev17/mapusaurus,mehtadev17/mapusaurus | institutions/respondants/tests.py | institutions/respondants/tests.py | from django.test import TestCase
from respondants import zipcode_utils
from respondants.models import ZipcodeCityState
from respondants.management.commands import load_reporter_panel
# Create your tests here.
class ZipcodeUtilsTests(TestCase):
def test_createzipcode(self):
ZipcodeCityState.objects.all().de... | from django.test import TestCase
from respondants import zipcode_utils
from respondants.models import ZipcodeCityState
from respondants.management.commands import load_reporter_panel
# Create your tests here.
class ZipcodeUtilsTests(TestCase):
def test_createzipcode(self):
zipcode = zipcode_utils.create_zi... | cc0-1.0 | Python |
96083f8c9f0a28cca152fbf08187cbb9bb50f515 | Update bleach/encoding.py | kiawin/bleach | bleach/encoding.py | bleach/encoding.py | import datetime
from decimal import Decimal
import types
def is_protected_type(obj):
"""Determine if the object instance is of a protected type.
Objects of protected types are preserved as-is when passed to
force_unicode(strings_only=True).
"""
return isinstance(obj, (
types.NoneType,
... | import datetime
from decimal import Decimal
import types
def is_protected_type(obj):
"""Determine if the object instance is of a protected type.
Objects of protected types are preserved as-is when passed to
force_unicode(strings_only=True).
"""
return isinstance(obj, (
types.NoneType,
... | bsd-3-clause | Python |
6cf4e65c672338a0dac73a9db1c31d887e7e5918 | set overscan finished | danielforgacs/MayaTools,danielforgacs/Maya-tools,danielforgacs/Maya-tools,danielforgacs/Maya-tools,danielforgacs/MayaTools,danielforgacs/MayaTools | utils/setoverscan.py | utils/setoverscan.py | """
calculate and set camera values
for overscan in one camera setup
overscan is not uniform. It matches
image proportions - rounded
if the selected camera has post scale
you get an error - no duplaicate overscan
default overscan:
10 / 10 pixels :: top / bottom
Select camera, call: main(); main(pixels=30)
for t... | """
calculate and set camera values
for overscan in one camera setup
overscan is not uniform. It matches
image proportions
default overscan:
10 / 10 pixels :: left / right
without selection only the render
resolution is set!
render resolution is always set!
"""
from fractions import Fraction
import pymel.core
... | mit | Python |
5f5530205b54ca7929376c3c8e8d2c1fd68378a4 | Add typing support for Starlette-based apps | rollbar/pyrollbar | rollbar/contrib/asgi/__init__.py | rollbar/contrib/asgi/__init__.py | import rollbar
try:
from starlette.types import ASGIApp, Scope, Receive, Send
except ImportError:
STARLETTE_INSTALLED = False
else:
STARLETTE_INSTALLED = True
if STARLETTE_INSTALLED is True:
class ASGIMiddleware:
def __init__(self, app: ASGIApp) -> None:
self.app = app
as... | import rollbar
class ASGIMiddleware:
def __init__(self, app):
self.app = app
async def __call__(self, scope, receive, send):
try:
await self.app(scope, receive, send)
except Exception:
rollbar.report_exc_info()
raise
def _hook(request, data):
... | mit | Python |
0099be0c1080bd0b8cfc55898cfc009c8a25141c | make code compatible for python 3.x | WKPlus/rangedict | tests.py | tests.py | import unittest
from nose.tools import assert_equal
from nose.tools import assert_true
from rangedict import RangeDict
from rangedict import Color, node_color
def test_insert():
rd = RangeDict()
rd[(1, 2)] = 1.5
rd[(3, 5)] = 4
assert_true(4 in rd)
assert_equal(rd[4], 4)
def test_delete():
... | import unittest
from nose.tools import assert_equal
from nose.tools import assert_true
from rangedict import RangeDict
from rangedict import Color, node_color
def test_insert():
rd = RangeDict()
rd[(1, 2)] = 1.5
rd[(3, 5)] = 4
assert_true(4 in rd)
assert_equal(rd[4], 4)
def test_delete():
... | mit | Python |
23cc21bd441ac0c058d9df43276085badb27d905 | Use the appropriate path separator | mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge | srrun.py | srrun.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import copy
import os
import platform
import subprocess
import sys
mypath = os.path.abspath(__fil... | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import copy
import os
import platform
import subprocess
import sys
mypath = os.path.abspath(__fil... | mpl-2.0 | Python |
89720c6083312b9dbfdd7aa6ff19681c3363526d | Make `show_panel` a normal argument to `GitSavvyError` | divmain/GitSavvy,divmain/GitSavvy,divmain/GitSavvy | core/exceptions.py | core/exceptions.py | import sublime
from ..common import util
MYPY = False
if MYPY:
from typing import Sequence
class GitSavvyError(Exception):
def __init__(self, msg, *args, cmd=None, stdout="", stderr="", show_panel=True, **kwargs):
# type: (str, object, Sequence[str], str, str, bool, object) -> None
super(Git... | import sublime
from ..common import util
MYPY = False
if MYPY:
from typing import Sequence
class GitSavvyError(Exception):
def __init__(self, msg, *args, cmd=None, stdout="", stderr="", **kwargs):
# type: (str, object, Sequence[str], str, str, object) -> None
super(GitSavvyError, self).__ini... | mit | Python |
47a9483cf6c6af654c22acfece7bc20af22cc3f0 | make work dist script use multiprocess | pymor/dune-gdt | cmake/scripts/distribute_testing.py | cmake/scripts/distribute_testing.py | #!/usr/bin/env python3
import os
import pickle
import sys
from pprint import pprint
import subprocess
import time
from contextlib import contextmanager
import binpacking
from multiprocessing import Pool
MAXTIME = 45*60
pickle_file = 'totals.pickle'
@contextmanager
def elapsed_timer():
clock = time.time
sta... | #!/usr/bin/env python3
import os
import pickle
import sys
from pprint import pprint
import subprocess
import time
from contextlib import contextmanager
import binpacking
MAXTIME = 45*60
pickle_file = 'totals.pickle'
@contextmanager
def elapsed_timer():
clock = time.time
start = clock()
elapser = lambda:... | bsd-2-clause | Python |
3271f8c5071aea5e55411905558d7f3f773dd954 | Build script for Cron | mbits-os/JiraDesktop,mbits-os/JiraDesktop,mbits-os/JiraDesktop | installer/build.py | installer/build.py | #!/usr/python
import os, sys, subprocess, _winreg
class buffer:
def __init__(self): self.content = ""
def write(self, str): self.content += str
def flush(self): pass
out = buffer()
def present(args):
global out, LOGFILE
out.write("$_ ")
out.write(" ".join(args))
out.write("\n")
out.flush()
def cal... | #!/usr/python
import os, sys, subprocess, _winreg
def call(*args):
ret = subprocess.call(args)
if ret: exit(ret)
def call_(*args):
return subprocess.call(args)
def MSBuildPath():
with _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\14.0") as key:
return _winreg.QueryV... | mit | Python |
3cea53bc4190cc74a6e787d7d6ec4a1d62ab68ea | select is broken in my version of Firefox | tubaman/seleniumpy | tests.py | tests.py | import unittest
import seleniumpy
from selenium.common.exceptions import TimeoutException
class WebDriverTestCase(unittest.TestCase):
def setUp(self):
self.driver = seleniumpy.webdriver.Chrome()
def tearDown(self):
self.driver.quit()
class TestDriverContextManager(unittest.TestCase):
... | import unittest
import seleniumpy
from selenium.common.exceptions import TimeoutException
class WebDriverTestCase(unittest.TestCase):
def setUp(self):
self.driver = seleniumpy.webdriver.Firefox()
def tearDown(self):
self.driver.quit()
class TestDriverContextManager(unittest.TestCase):
... | bsd-3-clause | Python |
652eed2c96dff9576a73095e0b23548e22d0c37f | Update example to work on flux | astrobarn/BumpCalculator | examples/example.py | examples/example.py | from __future__ import absolute_import
import numpy as np
import bump_calculator
import pylab as plt
plt.ioff()
data = np.loadtxt('SN2007af_r.dat')
results = bump_calculator.get_bump_flux(data[:, 0], np.exp(-data[:, 1]),
np.exp(-data[:, 1]) * data[:, 2])
x_pred = np.arange(-... | from __future__ import absolute_import
import numpy as np
import bump_calculator
import pylab as plt
plt.ioff()
data = np.loadtxt('SN2007af_r.dat')
results = bump_calculator.get_bump(data[:, 0], data[:, 1], data[:, 2])
print(results)
results.gp_model.plot()
plt.axvline(results.bump_time, color='b')
plt.ylim(-data[... | agpl-3.0 | Python |
1be415cd9631f49e4cebeb6115fb6bffb9fcbe64 | Update fasta_generate_regions.py | ekg/freebayes,ekg/freebayes,ekg/freebayes,ekg/freebayes,ekg/freebayes | scripts/fasta_generate_regions.py | scripts/fasta_generate_regions.py | #!/usr/bin/env python
from __future__ import print_function
import sys
if len(sys.argv) == 1:
print("usage: {} <fasta file or index file> <region size>").format(sys.argv[0])
print("generates a list of freebayes/bamtools region specifiers on stdout")
print("intended for use in creating cluster jobs")
ex... | #!/usr/bin/env python
import sys
if len(sys.argv) == 1:
print "usage: ", sys.argv[0], " <fasta file or index file> <region size>"
print "generates a list of freebayes/bamtools region specifiers on stdout"
print "intended for use in creating cluster jobs"
exit(1)
fasta_index_file = sys.argv[1]
if not... | mit | Python |
72d817be342ca56c8813599581134c2f6d6b91f8 | Fix article tests | dracidoupe/graveyard,dracidoupe/graveyard,dracidoupe/graveyard,dracidoupe/graveyard | ddcz/tests/test_integration/test_common_article.py | ddcz/tests/test_integration/test_common_article.py | from django.test import Client, TestCase
from ddcz.creations import ApprovalChoices
from ddcz.models import CommonArticle
class ArticleAccessTestCase(TestCase):
fixtures = ["pages"]
def setUp(self):
super().setUp()
self.client = Client()
self.article = CommonArticle(
pk=... | from django.test import Client, TestCase
from ddcz.models import CommonArticle
class ArticleAccessTestCase(TestCase):
fixtures = ["pages"]
def setUp(self):
super().setUp()
self.client = Client()
self.article = CommonArticle(pk=1, name="xoxo")
self.article.save()
def tes... | mit | Python |
e8af462a3216861a0dd7f60950bc840e0527d7df | add correct URL | fabianvf/scrapi,CenterForOpenScience/scrapi,CenterForOpenScience/scrapi,fabianvf/scrapi,erinspace/scrapi,erinspace/scrapi | scrapi/harvesters/wash_state_u.py | scrapi/harvesters/wash_state_u.py | '''
Harvester for the Washington State University Research Exchange for the SHARE project
Example API call: http://research.wsulibs.wsu.edu:8080/oai/request?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from scrapi.base import OAIHarvester
class WashuHarvester(OAIHarvester):
... | '''
Harvester for the Washington State University Research Exchange for the SHARE project
Example API call: http://research.wsulibs.wsu.edu:8080/oai/request?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from scrapi.base import OAIHarvester
class WashuHarvester(OAIHarvester):
... | apache-2.0 | Python |
70fa6ac180957ee4d6604c27510dc02d95f966af | Add regex | Deesus/Punt | minify.py | minify.py | """
Copyright 2016 Dee Reddy
"""
import sys
import re
args = sys.argv[1:]
def minify(filepath, comments=False):
""" Minifies/uglifies file
:param
file_:
comments: Boolean. If False, deletes comments during output.
:return:
Minified string.
"""
pattern = re.compile(r"... | """
Copyright 2016 Dee Reddy
"""
import sys
import re
args = sys.argv[1:]
def minify(filepath, comments=False):
""" Minifies/uglifies file
:param
file_:
comments: Boolean. If False, deletes comments during output.
:return:
Minified string.
"""
output = ''
with op... | apache-2.0 | Python |
498fa285bc421f9948235732a25bfb7b9b1ad7f5 | fix flake8 error for ope/__init__.py | st-tech/zr-obp | obp/ope/__init__.py | obp/ope/__init__.py | from obp.ope.estimators import BaseOffPolicyEstimator
from obp.ope.estimators import ReplayMethod
from obp.ope.estimators import InverseProbabilityWeighting
from obp.ope.estimators import SelfNormalizedInverseProbabilityWeighting
from obp.ope.estimators import DirectMethod
from obp.ope.estimators import DoublyRobust
fr... | from .estimators import *
from .meta import *
from .regression_model import *
__all_estimators__ = [
"ReplayMethod",
"InverseProbabilityWeighting",
"SelfNormalizedInverseProbabilityWeighting",
"DirectMethod",
"DoublyRobust",
"DoublyRobustWithShrinkage",
"SwitchDoublyRobust",
"SelfNormal... | apache-2.0 | Python |
4c172759cc02cad523a6dcfc6f777cbf6d895ad7 | Remove the sys.stdin stuff. | SymbiFlow/conda-packages,litex-hub/litex-conda-prog,timvideos/conda-hdmi2usb-packages,timvideos/conda-misoc-lm32,litex-hub/litex-conda-eda,timvideos/conda-hdmi2usb-packages,litex-hub/litex-conda-compilers,timvideos/conda-misoc-lm32,SymbiFlow/conda-packages | .travis-output.py | .travis-output.py | #!/usr/bin/env python3
import io
import pexpect
import string
import sys
import time
output_to=sys.stdout
args = list(sys.argv[1:])
logfile = open(args.pop(0), "w")
child = pexpect.spawn(' '.join(args))
def output_line(line_bits, last_skip):
line = "".join(line_bits)
sline = line.strip()
skip = True
if lin... | #!/usr/bin/env python3
import io
import pexpect
import string
import sys
import time
sys.stdin = io.TextIOWrapper(sys.stdin.detach(), newline='')
output_to=sys.stdout
args = list(sys.argv[1:])
logfile = open(args.pop(0), "w")
child = pexpect.spawn(' '.join(args))
def output_line(line_bits, last_skip):
line = "".... | apache-2.0 | Python |
971b36aedd700b23d791b72f60a9a534cc1be0ec | Use numpy functions to allow future vectorization | SALib/SALib,jdherman/SALib,jdherman/SALib | src/SALib/test_functions/Ishigami.py | src/SALib/test_functions/Ishigami.py | from __future__ import division
import numpy as np
# Non-monotonic Ishigami Function (3 parameters)
# Using Saltelli sampling with a sample size of ~1000
# the expected first-order indices would be:
# x1: 0.3139
# x2: 0.4424
# x3: 0.0
def evaluate(values):
Y = np.zeros(values.shape[0])
A = 7
... | from __future__ import division
import math
import numpy as np
# Non-monotonic Ishigami Function (3 parameters)
# Using Saltelli sampling with a sample size of ~1000
# the expected first-order indices would be:
# x1: 0.3139
# x2: 0.4424
# x3: 0.0
def evaluate(values):
Y = np.zeros([values.shape[0]... | mit | Python |
71c56ade256920f8dc0c1ab0771aa3ec1d349a92 | Add workaround if gpg signing can't compute keyid | secure-systems-lab/securesystemslib,secure-systems-lab/securesystemslib | securesystemslib/gpg/functions.py | securesystemslib/gpg/functions.py | """
<Module Name>
gpg/functions.py
<Author>
Santiago Torres-Arias <santiago@nyu.edu>
<Started>
Nov 15, 2017
<Copyright>
See LICENSE for licensing information.
<Purpose>
publicly-usable functions for exporting public-keys, signing data and
verifying signatures.
"""
import subprocess
import shlex
import ... | """
<Module Name>
gpg/functions.py
<Author>
Santiago Torres-Arias <santiago@nyu.edu>
<Started>
Nov 15, 2017
<Copyright>
See LICENSE for licensing information.
<Purpose>
publicly-usable functions for exporting public-keys, signing data and
verifying signatures.
"""
import subprocess
import shlex
from in... | mit | Python |
504764d36344921b1c765f6ef19b21bbe0a29653 | Revert "Get version using importlib" | johnveitch/cpnest | cpnest/__init__.py | cpnest/__init__.py | import logging
from .logger import CPNestLogger
from .cpnest import CPNest
# Get the version number from git tag
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
__version__ = "dev"... | import logging
from .logger import CPNestLogger
from .cpnest import CPNest
# Get the version number from git tag
from importlib.metadata import version, PackageNotFoundError
try:
__version__ = version(__name__)
except PackageNotFoundError:
# package is not installed
__version__ = "unknown"
logging.setLog... | mit | Python |
779125d3ff3cfdfa52e93840f7ab86b41bf8deec | Handle release without images | jodal/comics,datagutten/comics,datagutten/comics,klette/comics,datagutten/comics,datagutten/comics,jodal/comics,klette/comics,jodal/comics,jodal/comics,klette/comics | comics/core/utils/comic_releases.py | comics/core/utils/comic_releases.py | """Utility functions for the view generic_show."""
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Max
from comics.core.models import Image, Release
def get_comic_releases_struct(comics, latest=False,
start_date=None, end_date=None):
"""
Takes a ... | """Utility functions for the view generic_show."""
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Max
from comics.core.models import Image, Release
def get_comic_releases_struct(comics, latest=False,
start_date=None, end_date=None):
"""
Takes a ... | agpl-3.0 | Python |
a899a38ba408e22477638f1b4620a05db5f06afc | add get_galaxy_connection() to the predefined options | bgruening/docker-ipython-notebook,bgruening/docker-ipython-notebook,bgruening/docker-ipython-notebook,bgruening/docker-jupyter-notebook,bgruening/docker-jupyter-notebook,bgruening/docker-jupyter-notebook | ipython-profile.py | ipython-profile.py | from galaxy import get, put, get_galaxy_connection
| from galaxy import get, put
| mit | Python |
4ea38fedf77482c42c6cdc21ebbf495886a11774 | check valid username | quokkaproject/quokka-fundraising,quokkaproject/quokka-fundraising | pipelines.py | pipelines.py | # coding: utf-8
from flask import request
from quokka.modules.cart.pipelines.base import CartPipeline
from quokka.utils import get_current_user
from .models import Donation
class SetDonor(CartPipeline):
def process(self):
user = get_current_user()
donations = Donation.objects.filter(
... | # coding: utf-8
from flask import request
from quokka.modules.cart.pipelines.base import CartPipeline
from quokka.utils import get_current_user
from .models import Donation
class SetDonor(CartPipeline):
def process(self):
user = get_current_user()
donations = Donation.objects.filter(
... | mit | Python |
fa07eded66aa0d0e8d1eeb127e9d29a3df971cbc | Add filter by tags in CaseAdmin | watchdogpolska/poradnia,watchdogpolska/poradnia,watchdogpolska/poradnia.siecobywatelska.pl,rwakulszowa/poradnia,watchdogpolska/poradnia.siecobywatelska.pl,rwakulszowa/poradnia,watchdogpolska/poradnia,watchdogpolska/poradnia,rwakulszowa/poradnia,rwakulszowa/poradnia,watchdogpolska/poradnia.siecobywatelska.pl | poradnia/cases/admin.py | poradnia/cases/admin.py | from django.utils.translation import ugettext as _
from django.contrib import admin
from guardian.admin import GuardedModelAdmin
from records.models import Record
from .models import Case, PermissionGroup
class RecordInline(admin.StackedInline):
'''
Stacked Inline View for Record
'''
model = Recor... | from django.utils.translation import ugettext as _
from django.contrib import admin
from guardian.admin import GuardedModelAdmin
from records.models import Record
from .models import Case, PermissionGroup
class RecordInline(admin.StackedInline):
'''
Stacked Inline View for Record
'''
model = Recor... | mit | Python |
e5b49fa53356d1edb2870934d01fb1cde0f6e6ca | make sure AGG backend is used for windrose generation | akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem | scripts/windrose/make_windrose.py | scripts/windrose/make_windrose.py | """
Drive a windrose for a given network and site
"""
from __future__ import print_function
import datetime
import sys
# we need this to make sure the AGG backend is used...
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from pyiem.network import Table as NetworkTable
from pyiem.windrose_utils... | """
Drive a windrose for a given network and site
"""
from __future__ import print_function
import datetime
import sys
import matplotlib.pyplot as plt
from pyiem.network import Table as NetworkTable
from pyiem.windrose_utils import windrose
def main():
"""Go Main"""
net = sys.argv[1]
nt = NetworkTable(ne... | mit | Python |
7133c641d83338b12e3fa8749543602ef8903675 | Change to pytest fixtures FitPageTest.py | SasView/sasview,SasView/sasview,SasView/sasview,SasView/sasview,SasView/sasview,SasView/sasview | src/sas/qtgui/Perspectives/Fitting/UnitTesting/FitPageTest.py | src/sas/qtgui/Perspectives/Fitting/UnitTesting/FitPageTest.py | import sys
import pytest
# Tested module
from sas.qtgui.Perspectives.Fitting.FitPage import FitPage
class FitPageTest:
'''Test the FitPage methods'''
@pytest.fixture(autouse=True)
def page(self, qapp):
'''Create/Destroy the AboutBox'''
p = FitPage()
yield p
def testDefaults(... | import sys
import unittest
# set up import paths
import sas.qtgui.path_prepare
# Tested module
from sas.qtgui.Perspectives.Fitting.FitPage import *
class FitPageTest(unittest.TestCase):
'''Test the FitPage methods'''
def setUp(self):
self.page = FitPage()
def tearDown(self):
del self.pa... | bsd-3-clause | Python |
fcda0b3bbe83b68b72d320b0c0287da0506fc942 | Correct a parsing of functions arguments. | thewizardplusplus/micro,thewizardplusplus/micro,thewizardplusplus/micro | micro.py | micro.py | #!/usr/bin/env python
from sys import argv
from operator import add, sub, mul, div
from uuid import uuid4
class function:
def __init__(self, handle, arguments=None, arity=None):
self.handle = handle
self.arguments = arguments
if arity is None:
self.arity = len(arguments)
else:
self.arity = arity
def ... | #!/usr/bin/env python
from sys import argv
from operator import add, sub, mul, div
from uuid import uuid4
class function:
def __init__(self, number_of_arguments, handle):
self.number_of_arguments = number_of_arguments
self.handle = handle
def __repr__(self):
return '({:d}, {!s})'.format(self.number_of_argume... | mit | Python |
948b6f414e3a22d7d88217657b855001f7f23c14 | Comment sample code | waltermoreira/serfnode,waltermoreira/serfnode,waltermoreira/serfnode | serfnode/build/handler/serfnode.py | serfnode/build/handler/serfnode.py | import supervisor
def spawn(volumes):
# supervisor.install_launcher('foo', 'ubuntu sleep infinity')
pass
| import supervisor
def spawn(volumes):
supervisor.install_launcher('foo', 'ubuntu sleep infinity')
| mit | Python |
62eb6644c4ae9240c16329fa360d39545268d04e | Update example proxy string | mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase | 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... | mit | Python |
9b1d08e175b47c9e10be70477c5577fb27983f23 | add a missing import (exceptions) | MarkusTeufelberger/openobject-server,MarkusTeufelberger/openobject-server,MarkusTeufelberger/openobject-server | openerp/__init__.py | openerp/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 | Python |
48484e31a06705a4fcf02f2886d37313bfcbf7eb | make exif orientation optional | SmileyChris/easy-thumbnails,jaddison/easy-thumbnails,sandow-digital/easy-thumbnails-cropman,siovene/easy-thumbnails,jrief/easy-thumbnails,emschorsch/easy-thumbnails,Mactory/easy-thumbnails,jrief/easy-thumbnails,emschorsch/easy-thumbnails,sandow-digital/easy-thumbnails-cropman | easy_thumbnails/source_generators.py | easy_thumbnails/source_generators.py | try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
from PIL import Image
except ImportError:
import Image
from easy_thumbnails import utils
def pil_image(source, exif_orientation=True, **options):
"""
Try to open the source file directly using PIL, ign... | try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
from PIL import Image
except ImportError:
import Image
from easy_thumbnails import utils
def pil_image(source, **options):
"""
Try to open the source file directly using PIL, ignoring any errors.
"... | bsd-3-clause | Python |
143fdcefeab4596e7ae73bbb467df38bb58f58a0 | remove unused import | byteweaver/django-eca-catalogue | eca_catalogue/text/abstract_admin.py | eca_catalogue/text/abstract_admin.py | from django.contrib import admin
from django.db import models
class AbstractSellingPointAdmin(admin.ModelAdmin):
"""name your foreign key to product model "product" in order to fully utilize this class"""
search_fields = ['text', 'product__name', 'product__item_number',]
list_display = ['product', 'text',... | from django.contrib import admin
from django.db import models
from abstract_models import AbstractSellingPoint
class AbstractSellingPointAdmin(admin.ModelAdmin):
"""name your foreign key to product model "product" in order to fully utilize this class"""
search_fields = ['text', 'product__name', 'product__ite... | bsd-3-clause | Python |
0bfca866b768f4985583de54c9afd836cb0ee57c | Update MailWrap for Mail 11.0 and macOS 10.13 'High Sierra' | arachsys/mailwrap | install.py | install.py | from distutils.core import setup
import os
import platform
import py2app
import sys
install_path = os.environ["HOME"] + '/Library/Mail/Bundles'
mail_path = '/Applications/Mail.app/Contents/Info'
command = 'defaults read %s CFBundleShortVersionString' % mail_path
if tuple(map(int, os.popen(command).read().strip().spli... | from distutils.core import setup
import os
import py2app
import sys
install_path = os.environ["HOME"] + '/Library/Mail/Bundles'
mail_path = '/Applications/Mail.app/Contents/Info'
command = 'defaults read %s CFBundleShortVersionString' % mail_path
if tuple(map(int, os.popen(command).read().strip().split('.'))) < (10, ... | mit | Python |
6c2deab13e5b608fe29d18ddb27c63945d883530 | Update install.py adding support for uploads | m4tx/techswarm-server | install.py | install.py | import os
import sys
import tsserver
from tsserver import configutils
def msg(s, end=''):
if end == '':
s += ' '
print(s, file=sys.stderr, end=end)
def msg_line(s):
msg(s, os.linesep)
#
# Uploads
#
def save_test():
with open(os.path.join(upload_folder, test_filename), 'w') as f:
f.... | import sys
import tsserver
print("Creating database...", file=sys.stderr)
print("Database URL: %s" % tsserver.db.engine.url, file=sys.stderr)
tsserver.db.create_all()
print("Everything is done!", file=sys.stderr)
| mit | Python |
f95a8e84231071f9e5ecf31dc7c4de5f8d557f9d | Update my_bot.py | voidabhi/cricinfo,voidabhi/cricinfo | cricinfo/my_bot.py | cricinfo/my_bot.py |
import requests
from bs4 import BeautifulSoup
CRICINFO_RSS_URL = 'http://static.cricinfo.com/rss/livescores.xml'
# Fetching matches
def get_matches():
r = requests.get(CRICINFO_RSS_URL)
soup = BeautifulSoup(r.text)
return soup.find_all('item')
matches = get_matches()
for match in matches:
print match.contents... |
import requests
from bs4 import BeautifulSoup
CRICINFO_RSS_URL = 'http://static.cricinfo.com/rss/livescores.xml'
def get_matches():
r = requests.get(CRICINFO_RSS_URL)
soup = BeautifulSoup(r.text)
return soup.find_all('item')
matches = get_matches()
for match in matches:
print match.contents['title']
print ma... | mit | Python |
e2de39420b6a985a5d7d7a6054ba3c7e38a85cf5 | Set up models | xniccum/chorewheel,xniccum/chorewheel,xniccum/chorewheel | models.py | models.py | from google.appengine.ext import ndb
class User(ndb.Model):
email = ndb.StringProperty()
groups = ndb.KeyProperty(kind='Group', repeated=True)
class Group(ndb.Model):
admins = ndb.KeyProperty(kind='User', repeated=True)
members = ndb.KeyProperty(kind='User', repeated=True)
name = ndb.StringPr... | from google.appengine.ext import ndb
class Kid(ndb.Model):
name = ndb.StringProperty()
month = ndb.StringProperty()
day = ndb.StringProperty()
year = ndb.StringProperty() | mit | Python |
5da3dbbf62b5888eb2cd9395dd9608912192bfe2 | change the logger info under the shed.start() | elixirhub/events-portal-scraping-scripts | ScheduleAddData.py | ScheduleAddData.py | __author__ = 'chuqiao'
from apscheduler.schedulers.blocking import BlockingScheduler
import EventsPortal
import sys
import logging
def logger():
"""
Function that initialises logging system
"""
global logger
# create logger with 'syncsolr'
logger = logging.getLogger('scheduleAddData')
... | __author__ = 'chuqiao'
from apscheduler.schedulers.blocking import BlockingScheduler
import EventsPortal
import sys
import logging
def logger():
"""
Function that initialises logging system
"""
global logger
# create logger with 'syncsolr'
logger = logging.getLogger('scheduleAddData')
... | mit | Python |
3ca4088a12080a41a5f7d0aca9adc84a8670cd24 | Add get_view_restrictions test | fatboystring/Wagtail-MVC,fatboystring/Wagtail-MVC | wagtail_mvc/tests.py | wagtail_mvc/tests.py | # -*- coding: utf-8 -*-
"""
wagtail_mvc tests
"""
from __future__ import unicode_literals
from django.test import TestCase
from mock import Mock
from wagtail_mvc.models import WagtailMvcViewWrapper
class WagtailMvcViewWrapperTestCase(TestCase):
"""
Tests the WagtailMvcViewWrapper
"""
def setUp(self):
... | # -*- coding: utf-8 -*-
"""
wagtail_mvc tests
"""
from __future__ import unicode_literals
from django.test import TestCase
from mock import Mock
from wagtail_mvc.models import WagtailMvcViewWrapper
class WagtailMvcViewWrapperTestCase(TestCase):
"""
Tests the WagtailMvcViewWrapper
"""
def setUp(self):
... | mit | Python |
76670ad5d4765c71d2ed0ec5442d3ecad16bf245 | read any interface | tzulberti/entrenamiento-arqueria,tzulberti/entrenamiento-arqueria,tzulberti/entrenamiento-arqueria | entrenamiento/commands/run_server.py | entrenamiento/commands/run_server.py | # -*- coding: utf-8 -*-
from flask.ext.script import Command, Option
class RunServer(Command):
''' Se encarga de levantar el servidor web.
'''
option_list = (
Option('--port', '-p', dest='port', default=8000, type=int),
)
def run(self, port):
from entrenamiento.app.app import ap... | # -*- coding: utf-8 -*-
from flask.ext.script import Command, Option
class RunServer(Command):
''' Se encarga de levantar el servidor web.
'''
option_list = (
Option('--port', '-p', dest='port', default=8000, type=int),
)
def run(self, port):
from entrenamiento.app.app import ap... | mit | Python |
ef6b3b78d47c86954b3e38828c0ca2e61bd838bc | set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#113) | googleapis/nodejs-firestore-session,googleapis/nodejs-firestore-session,googleapis/nodejs-firestore-session | synth.py | synth.py | import synthtool as s
import synthtool.gcp as gcp
import logging
logging.basicConfig(level=logging.DEBUG)
AUTOSYNTH_MULTIPLE_COMMITS = True
common_templates = gcp.CommonTemplates()
templates = common_templates.node_library(source_location='build/src')
s.copy(templates)
| import synthtool as s
import synthtool.gcp as gcp
import logging
logging.basicConfig(level=logging.DEBUG)
common_templates = gcp.CommonTemplates()
templates = common_templates.node_library(source_location='build/src')
s.copy(templates)
| apache-2.0 | Python |
1faca8400c8c689fb15cc8861385cccd89d1c948 | use java helper for templates (#229) | googleapis/java-bigquery,googleapis/java-bigquery,googleapis/java-bigquery | synth.py | synth.py | # Copyright 2019 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 2019 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... | apache-2.0 | Python |
22bb313ed8f48ae0d66dac4567f10bdda93b63f1 | bump version | brentp/cyvcf2,brentp/cyvcf2,brentp/cyvcf2 | cyvcf2/__init__.py | cyvcf2/__init__.py | from .cyvcf2 import (VCF, Variant, Writer, r_ as r_unphased, par_relatedness,
par_het)
Reader = VCFReader = VCF
__version__ = "0.11.7"
| from .cyvcf2 import (VCF, Variant, Writer, r_ as r_unphased, par_relatedness,
par_het)
Reader = VCFReader = VCF
__version__ = "0.11.6"
| mit | Python |
68b863e046e86cf173283def0a6f61219ceefd38 | delete any None rows from redis (bug 648646) | wagnerand/addons-server,atiqueahmedziad/addons-server,mstriemer/addons-server,koehlermichael/olympia,mdaif/olympia,muffinresearch/addons-server,jbalogh/zamboni,beni55/olympia,crdoconnor/olympia,andymckay/addons-server,ddurst/zamboni,kmaglione/olympia,johancz/olympia,ingenioustechie/zamboni,magopian/olympia,ngokevin/zam... | apps/perf/tasks.py | apps/perf/tasks.py | import json
import logging
import redisutils
from celeryutils import task
from addons.models import Addon
from .models import Performance
log = logging.getLogger('z.perf.task')
@task(rate_limit='1/s')
def update_perf(baseline, perf, **kw):
log.info('[%s@%s] Updating perf' %
(len(perf), update_perf... | import json
import logging
import redisutils
from celeryutils import task
from addons.models import Addon
from .models import Performance
log = logging.getLogger('z.perf.task')
@task(rate_limit='1/s')
def update_perf(baseline, perf, **kw):
log.info('[%s@%s] Updating perf' %
(len(perf), update_perf... | bsd-3-clause | Python |
776d116faa98815eddc3cfec99989ab4daaa42bb | Remove unused variables, rename dsn -> url | uvNikita/appstats,uvNikita/appstats,uvNikita/appstats | appstats_client.py | appstats_client.py | # encoding: utf-8
import json
import threading
from time import time
import requests
lock = threading.Lock()
class AppStatsClient(object):
count_limit = 100
desired_interval = 600
def __init__(self, url):
self.url = url
self._session = requests.session()
self._acc = {}
... | # encoding: utf-8
import json
import threading
from time import time
from urlparse import urlparse
import requests
lock = threading.Lock()
class AppStatsClient(object):
count_limit = 100
desired_interval = 600
def __init__(self, dsn):
urlparts = urlparse(dsn)
self.protocol = urlparts... | mit | Python |
b1a21354735e3e4b58cf63c3fc81b6e8e2ee5ed7 | Disable PXF in ORCA CI | greenplum-db/gpdb,xinzweb/gpdb,adam8157/gpdb,adam8157/gpdb,greenplum-db/gpdb,lisakowen/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,lisakowen/gpdb,lisakowen/gpdb,Chibin/gpdb,lisakowen/gpdb,Chibin/gpdb,adam8157/gpdb,Chibin/gpdb,Chibin/gpdb,xinzweb/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,edespino/gpdb,janebeckman/gpdb,janebeckman/gpdb,... | concourse/scripts/builds/GpBuild.py | concourse/scripts/builds/GpBuild.py | import os
import subprocess
import sys
from GpdbBuildBase import GpdbBuildBase
class GpBuild(GpdbBuildBase):
def __init__(self, mode):
self.mode = 'on' if mode == 'orca' else 'off'
def configure(self):
return subprocess.call(["./configure",
"--enable-mapreduce",... | import os
import subprocess
import sys
from GpdbBuildBase import GpdbBuildBase
class GpBuild(GpdbBuildBase):
def __init__(self, mode):
self.mode = 'on' if mode == 'orca' else 'off'
def configure(self):
return subprocess.call(["./configure",
"--enable-mapreduce",... | apache-2.0 | Python |
e27df745f18fdcefc9cffc03325fd5055c08018e | Update change_names_miseq.py | lauringlab/variant_pipeline,lauringlab/variant_pipeline,lauringlab/variant_pipeline,lauringlab/variant_pipeline | scripts/change_names_miseq.py | scripts/change_names_miseq.py | #import sys
import os
import argparse
import shutil
parser = argparse.ArgumentParser(description='This program takes Miseq fastq files and renames them as sample.read_direction.#.fastq and keeps a log of the change')
parser.add_argument('-s',action='store',dest='s',help='The sorce directory containing the original fas... | #import sys
import os
import argparse
import shutil
parser = argparse.ArgumentParser(description='This program takes Miseq fastq files and renames them as sample.read_direction.#.fastq and keeps a log of the change')
parser.add_argument('-s',action='store',dest='s',help='The sorce directory containing the original fas... | apache-2.0 | Python |
c3876cd1ad2c73fa4278469b75c6d42b89fac8ea | Sort the resulted list of items | tonirilix/apache-spark-hands-on | Friends-By-Age.py | Friends-By-Age.py | from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("FriendsByAge")
sc = SparkContext(conf = conf)
def parseLine(line):
fields = line.split(',')
age = int(fields[2])
numFriends = int(fields[3])
return (age, numFriends)
lines = sc... | from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("FriendsByAge")
sc = SparkContext(conf = conf)
def parseLine(line):
fields = line.split(',')
age = int(fields[2])
numFriends = int(fields[3])
return (age, numFriends)
lines = sc... | mit | Python |
256af078e586914e9eb408d0365928e56fb8e3a0 | change output format for Binary | penginryo/AsciiConverterPlugin,penginryo/AsciiConverterPlugin | ascii_converter.py | ascii_converter.py | import sublime, sublime_plugin
class ExampleCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.insert(edit, 0, "Hello, World!")
class AsciiToDecimalCommand(sublime_plugin.TextCommand):
def run(self, edit):
for selected_word in self.view.sel():
if not selected_word.empty():
target_string ... | import sublime, sublime_plugin
class ExampleCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.insert(edit, 0, "Hello, World!")
class AsciiToDecimalCommand(sublime_plugin.TextCommand):
def run(self, edit):
for selected_word in self.view.sel():
if not selected_word.empty():
target_string ... | mit | Python |
790ff3e652d3fd8441126f206b46ae73c43f353b | Update ipu_res.py | akul08/IPU-Result-Checker | ipu_res.py | ipu_res.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: akul08
from bs4 import BeautifulSoup as bs # To parse the html page
import subprocess # To run a command to download pdf.
import requests # To Download the Html page of GGSIPU Results
url = "http://ggsipuresults.nic.in/ipu/results/resultsmain.htm"
link = ''
r =... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: akul08
from bs4 import BeautifulSoup as bs # To parse the html page
import subprocess # To run a command to download pdf.
import requests # To Download the Html page of GGSIPU Results
url = "http://ggsipuresults.nic.in/ipu/results/resultsmain.htm"
link = ''
r =... | mit | Python |
d7725f7580b87e663500e14a386f1228ff835825 | Handle weeks without tweets (what you say?!?) | bbolli/twitter-monday | monday.py | monday.py | #! /usr/bin/env python
"""Run this during the week to write last week's short-form entry"""
from __future__ import print_function
from datetime import datetime, timedelta
import errno
import operator
import os
import sys
### date handling ###
def sunday_after(dt, offset=1):
"""offset == 3 means 3rd Sunday from... | #! /usr/bin/env python
"""Run this during the week to write last week's short-form entry"""
from __future__ import print_function
from datetime import datetime, timedelta
import errno
import operator
import os
import sys
### date handling ###
def sunday_after(dt, offset=1):
"""offset == 3 means 3rd Sunday from... | mit | Python |
4a854fdf3b3f060fffa909b18731b73fc5447aef | Add documentation to cansen.py | bryanwweber/CanSen,kyleniemeyer/CanSen | cansen.py | cansen.py | #! /usr/bin/python3
# Standard libraries
import os
import sys
import utils
#Local imports
from printer import Tee
from run_cases import SimulationCase
def main(argv):
"""The main driver function of CanSen."""
__version__ = '0.0.1'
# Parse the command line input
filenames,convert, = utils.cli_par... | #! /usr/bin/python3
import os
import sys
import utils
import printer
from run_cases import SimulationCase
def main(argv):
filenames,convert, = utils.cli_parser(argv)
output_filename = filenames['output_filename']
out = printer.Tee(output_filename, 'w')
version = '0.0.1'
print("This is Ca... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.