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
67d558a06c34e2aa6d97caaa396ca08028ee78d1
bump version in __init__.py
WillianPaiva/1flow,1flow/1flow,1flow/1flow,1flow/1flow,1flow/1flow,WillianPaiva/1flow,WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow
oneflow/__init__.py
oneflow/__init__.py
VERSION = '0.20.0.1'
VERSION = '0.20'
agpl-3.0
Python
31658ad37eb02f0e061ca5c4de36618cab6ea02b
Upgrade to v2.7.16
biolink/ontobio,biolink/ontobio
ontobio/__init__.py
ontobio/__init__.py
from __future__ import absolute_import __version__ = '2.7.16' from .ontol_factory import OntologyFactory from .ontol import Ontology, Synonym, TextDefinition from .assoc_factory import AssociationSetFactory from .io.ontol_renderers import GraphRenderer import logging import logging.handlers from logging.config impo...
from __future__ import absolute_import __version__ = '2.7.15' from .ontol_factory import OntologyFactory from .ontol import Ontology, Synonym, TextDefinition from .assoc_factory import AssociationSetFactory from .io.ontol_renderers import GraphRenderer import logging import logging.handlers from logging.config impo...
bsd-3-clause
Python
6688b604999035c09a7356074ef5061a92a78174
Update cli_object to reflect new usage
timothycrosley/hug,MuhammadAlkarouri/hug,timothycrosley/hug,timothycrosley/hug,MuhammadAlkarouri/hug,MuhammadAlkarouri/hug
examples/cli_object.py
examples/cli_object.py
import hug API = hug.API('git') @hug.object(name='git', version='1.0.0', api=API) class GIT(object): """An example of command like calls via an Object""" @hug.object.cli def push(self, branch='master'): return 'Pushing {}'.format(branch) @hug.object.cli def pull(self, branch='master'): ...
import hug @hug.cli_object(name='git', version='1.0.0') class GIT(object): """An example of command like calls via an Object""" @hug.cli_object() def push(self, branch='master'): return 'Pushing {}'.format(branch) @hug.cli_object() def pull(self, branch='master'): return 'Pulling...
mit
Python
7d9690b974263ba499d026eabee504b5bd6cb8ac
Add logging message when plugin fails to render custom panels
inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,inventree/InvenTree
InvenTree/plugin/views.py
InvenTree/plugin/views.py
import logging import sys import traceback from django.conf import settings from django.views.debug import ExceptionReporter from error_report.models import Error from plugin.registry import registry logger = logging.getLogger('inventree') class InvenTreePluginViewMixin: """ Custom view mixin which adds ...
import sys import traceback from django.conf import settings from django.views.debug import ExceptionReporter from error_report.models import Error from plugin.registry import registry class InvenTreePluginViewMixin: """ Custom view mixin which adds context data to the view, based on loaded plugins. ...
mit
Python
b9f400cc51c542b445fff45b459c610fe671301e
Rename ALLOW_PROXIES to IGNORE_PROXY_HEADER, now disabled by default
whyflyru/django-iprestrict,muccg/django-iprestrict,muccg/django-iprestrict,whyflyru/django-iprestrict,muccg/django-iprestrict,whyflyru/django-iprestrict,whyflyru/django-iprestrict
iprestrict/middleware.py
iprestrict/middleware.py
# vim:fileencoding=utf-8 from django.core import exceptions from django.utils import log from iprestrict.models import ReloadRulesRequest from iprestrict import IPRestrictor from django.conf import settings logger = log.getLogger(__name__) class IPRestrictMiddleware(object): restrictor = None trusted_proxie...
# vim:fileencoding=utf-8 from django.core import exceptions from django.utils import log from iprestrict.models import ReloadRulesRequest from iprestrict import IPRestrictor from django.conf import settings logger = log.getLogger(__name__) class IPRestrictMiddleware(object): restrictor = None trusted_proxie...
bsd-3-clause
Python
6190b42c28ea724350aef57c964d78c9853ab12e
Fix versionadded tag duplicity.
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/sdb/etcd_db.py
salt/sdb/etcd_db.py
# -*- coding: utf-8 -*- ''' etcd Database Module :maintainer: SaltStack :maturity: New :depends: python-etcd :platform: all .. versionadded:: 2015.2.0 This module allows access to the etcd database using an ``sdb://`` URI. This package is located at ``https://pypi.python.org/pypi/python-etcd``. L...
# -*- coding: utf-8 -*- ''' etcd Database Module :maintainer: SaltStack :maturity: New :depends: python-etcd :platform: all .. versionadded:: 2015.2 This module allows access to the etcd database using an ``sdb://`` URI. This package is located at ``https://pypi.python.org/pypi/python-etcd``. Lik...
apache-2.0
Python
9951bc7b3ac43bd0f5ed2b3e9960692fbaff46c0
add test
sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana
test/gui/test_browser.py
test/gui/test_browser.py
from sequana.gui.browser import Browser import pytest from pytestqt.qt_compat import qt_api def test_browser(qtbot): widget = Browser(url="sequana.readthedocs.io") widget.show() qtbot.addWidget(widget) widget.wb.createWindow(None)
from sequana.gui.browser import Browser import pytest from pytestqt.qt_compat import qt_api def test_browser(qtbot): widget = Browser(url="sequana.readthedocs.io") widget.show() qtbot.addWidget(widget)
bsd-3-clause
Python
65b847c5cbea315f2b5b371a3c8fe314096d3426
fix NoneType error with some Py versions
coco-project/coco,coco-project/coco,coco-project/coco,coco-project/coco
ipynbsrv/conf/helpers.py
ipynbsrv/conf/helpers.py
from django_admin_conf_vars.global_vars import config from ipynbsrv.common.utils import ClassLoader import json """ Internal LDAP helpers. """ _INTERNAL_LDAP = None def get_internal_ldap(): """ Return an instance of the internal LDAP backend. """ global _INTERNAL_LDAP if _INTERNAL_LDAP is None: ...
from django_admin_conf_vars.global_vars import config from ipynbsrv.common.utils import ClassLoader import json """ Internal LDAP helpers. """ _INTERNAL_LDAP = None def get_internal_ldap(): """ Return an instance of the internal LDAP backend. """ global _INTERNAL_LDAP if _INTERNAL_LDAP is None: ...
bsd-3-clause
Python
918590bd067b4f6fa192099ae5cbdf444290eee6
remove python_2_unicode_compatible from tests
etianen/django-watson,etianen/django-watson
tests/test_watson/models.py
tests/test_watson/models.py
import uuid from django.db import models from django.utils.encoding import force_text class TestModelBase(models.Model): title = models.CharField( max_length=200, ) content = models.TextField( blank=True, ) description = models.TextField( blank=True, ) is_publish...
import uuid from django.db import models from django.utils.encoding import force_text, python_2_unicode_compatible @python_2_unicode_compatible class TestModelBase(models.Model): title = models.CharField( max_length=200, ) content = models.TextField( blank=True, ) description = m...
bsd-3-clause
Python
7c255cf7b8ac7d79b63c2c91cf2ae3a233cc14f8
Write OLS results to correct shelf
rileymcdowell/genomic-neuralnet,rileymcdowell/genomic-neuralnet,rileymcdowell/genomic-neuralnet
genomic_neuralnet/analyses/optimize_ols_prediction.py
genomic_neuralnet/analyses/optimize_ols_prediction.py
from __future__ import print_function from genomic_neuralnet.methods import get_lr_prediction from genomic_neuralnet.analyses import run_optimization def main(): params = {} run_optimization(get_lr_prediction, params, 'optimal_lr.shelf', 'OLS') if __name__ == '__main__': main()
from __future__ import print_function from genomic_neuralnet.methods import get_lr_prediction from genomic_neuralnet.analyses import run_optimization def main(): params = {} run_optimization(get_lr_prediction, params, 'optimal_en.shelf', 'OLS') if __name__ == '__main__': main()
mit
Python
c51b7d2fe0e5f3466465a9859723897b46de6730
Add node and nodejs as javascript interpreters
chriskuehl/identify,chriskuehl/identify
identify/interpreters.py
identify/interpreters.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals INTERPRETERS = { 'bash': {'shell', 'bash'}, 'dash': {'shell', 'dash'}, 'node': {'javascript'}, 'nodejs': {'javascript'}, 'perl': {'perl'}, 'python': {'python'}, 'python2': {'python', 'pyth...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals INTERPRETERS = { 'bash': {'shell', 'bash'}, 'dash': {'shell', 'dash'}, 'perl': {'perl'}, 'python': {'python'}, 'python2': {'python', 'python2'}, 'python3': {'python', 'python3'}, 'ruby': {...
mit
Python
b29d0788a9c36e5f8bd6ff9ef7ac89e80b2536f2
Revert some conditions
ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube
ideascube/monitoring/migrations/0006_unique_serial.py
ideascube/monitoring/migrations/0006_unique_serial.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-01-27 10:39 from __future__ import unicode_literals from django.db import migrations, models import itertools def ensure_serial_is_unique(apps, schema_editor): Specimen = apps.get_model('monitoring', 'Specimen') db_alias = schema_editor.connection.a...
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-01-27 10:39 from __future__ import unicode_literals from django.db import migrations, models import itertools def ensure_serial_is_unique(apps, schema_editor): Specimen = apps.get_model('monitoring', 'Specimen') db_alias = schema_editor.connection.a...
agpl-3.0
Python
2d1fb057dc88649529fba4961e18a93bf7aea4e4
Use DEVICE for screen title
thelonious/g2x,gizmo-cda/g2x,thelonious/g2x,gizmo-cda/g2x,gizmo-cda/g2x,gizmo-cda/g2x
app/sense.py
app/sense.py
#!/usr/bin/env python3 from Sensor import SenseController from KeyDispatcher import KeyDispatcher from Display import Display from DataLogger import SQLiteLogger import time DEVICE = "PiSense" DELAY = 0.25 class Handler: def __init__(self, display, logger, sensor): self.display = display self.l...
#!/usr/bin/env python3 from Sensor import SenseController from KeyDispatcher import KeyDispatcher from Display import Display from DataLogger import SQLiteLogger import time DEVICE = "PiSense" DELAY = 0.25 class Handler: def __init__(self, display, logger, sensor): self.display = display self.l...
mit
Python
52ead09ef8f53c167fff5b33b6504b0fc3605bb1
use the constant instead of a magic number for default employment_type
pythonph/jobs-board,pythonph/jobs-board,pythonph/jobs-board
jobsboard/jobs/models.py
jobsboard/jobs/models.py
from model_utils.models import TimeStampedModel from django.utils.translation import ugettext_lazy as _ from django.db import models from jobsboard.common.utils import get_default_expiry class Job(TimeStampedModel): EMPLOYMENT_TYPE_PART_TIME = 1 EMPLOYMENT_TYPE_FULL_TIME = 2 EMPLOYMENT_TYPE_FREELANCE =...
from model_utils.models import TimeStampedModel from django.utils.translation import ugettext_lazy as _ from django.db import models from jobsboard.common.utils import get_default_expiry class Job(TimeStampedModel): EMPLOYMENT_TYPE_PART_TIME = 1 EMPLOYMENT_TYPE_FULL_TIME = 2 EMPLOYMENT_TYPE_FREELANCE =...
mit
Python
8d134ee4bb8ecae34a4663e25b045789159b6166
Fix doc checker.
redtoad/python-amazon-product-api,redtoad/python-amazon-product-api,redtoad/python-amazon-product-api
docs/check_sphinx.py
docs/check_sphinx.py
# taken from http://codespeak.net/tox/example/hudson.html import py import subprocess SOURCE = './source' def test_linkcheck(tmpdir): doctrees = tmpdir.join("doctrees") htmldir = tmpdir.join("html") subprocess.check_call( ["sphinx-build", "-W", "-blinkcheck", "-d", str(doctrees), SOURCE...
# taken from http://codespeak.net/tox/example/hudson.html import py import subprocess def test_linkcheck(tmpdir): doctrees = tmpdir.join("doctrees") htmldir = tmpdir.join("html") subprocess.check_call( ["sphinx-build", "-W", "-blinkcheck", "-d", str(doctrees), ".", str(htmldir)]) def te...
bsd-3-clause
Python
0b89da2ea93051ffdd47498bc047cc07885c2957
Add field channel on QuerySet boxes
YACOWS/opps,jeanmask/opps,opps/opps,williamroot/opps,jeanmask/opps,YACOWS/opps,opps/opps,YACOWS/opps,opps/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,opps/opps,williamroot/opps,williamroot/opps,jeanmask/opps
opps/boxes/models.py
opps/boxes/models.py
#!/usr/bin/env python # -*- coding: utf-8 -*- #from django.conf import settings #from django.utils.importlib import import_module from django.db import models from django.utils.translation import ugettext_lazy as _ from opps.core.models import Publishable, BaseBox try: OPPS_APPS = tuple([(u"{0}.{1}".format( ...
#!/usr/bin/env python # -*- coding: utf-8 -*- #from django.conf import settings #from django.utils.importlib import import_module from django.db import models from django.utils.translation import ugettext_lazy as _ from opps.core.models import Publishable, BaseBox try: OPPS_APPS = tuple([(u"{0}.{1}".format( ...
mit
Python
896923e94c6bb66e42508d225b2c0bd3a5f38ac1
Bump version
opensciencegrid/osg-build,opensciencegrid/osg-build,matyasselmeci/osg-build,matyasselmeci/osg-build
osgbuild/version.py
osgbuild/version.py
__version__ = "1.16.1"
__version__ = "1.16.0"
apache-2.0
Python
6dbc3d24d2a85c48a0caa72d1c0b26550fa8393a
Bump version for new health check URL which takes token.
aocks/ox_herd,aocks/ox_herd,aocks/ox_herd
ox_herd/__init__.py
ox_herd/__init__.py
"""The ox_herd package provides a way for herding tests together (like oxen). """ VERSION = '0.6.1'
"""The ox_herd package provides a way for herding tests together (like oxen). """ VERSION = '0.5.3'
bsd-2-clause
Python
9fedb4bc8686368f9a159a2838e450ae227acb75
Simplify inheritance
DirkHoffmann/indico,pferreir/indico,indico/indico,ThiefMaster/indico,DirkHoffmann/indico,indico/indico,DirkHoffmann/indico,pferreir/indico,DirkHoffmann/indico,ThiefMaster/indico,indico/indico,ThiefMaster/indico,indico/indico,pferreir/indico,ThiefMaster/indico,pferreir/indico,mic4ael/indico,mic4ael/indico,mic4ael/indico...
indico/modules/events/editing/controllers/frontend.py
indico/modules/events/editing/controllers/frontend.py
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from flask import session from werkzeug.exceptions import Forbidd...
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from flask import request, session from werkzeug.exceptions impor...
mit
Python
c0973ecb2e6eaa2eb8c09ccfda73a1e6a0faf6df
Revise HTTP Stream collector
aaronkaplan/intelmq,aaronkaplan/intelmq,aaronkaplan/intelmq,certtools/intelmq,certtools/intelmq,certtools/intelmq
intelmq/bots/collectors/http/collector_http_stream.py
intelmq/bots/collectors/http/collector_http_stream.py
# -*- coding: utf-8 -*- """ HTTP collector bot Parameters: http_url: string http_header: dictionary default: {} http_verify_cert: boolean default: True http_username, http_password: string http_proxy, https_proxy: string strip_lines: boolean """ import requests from intelmq.lib.bot import CollectorBot from i...
# -*- coding: utf-8 -*- import requests from intelmq.lib.bot import CollectorBot from intelmq.lib.utils import decode class HTTPStreamCollectorBot(CollectorBot): def process(self): try: req = requests.get(self.parameters.url, stream=True) except requests.exceptions.ConnectionError: ...
agpl-3.0
Python
1d626955615092decf080de1a4f1563bcb0ce14d
add tests for hash256 & hash512 raw api
RaetProtocol/libnacl,saltstack/libnacl
tests/unit/test_raw_hash.py
tests/unit/test_raw_hash.py
# Import nacl libs import libnacl from hashlib import sha256, sha512 # Import python libs import unittest class TestHash(unittest.TestCase): """ Test sign functions """ def test_hash(self): msg1 = b'Are you suggesting coconuts migrate?' msg2 = b'Not at all, they could be carried.' ...
# Import nacl libs import libnacl # Import python libs import unittest class TestHash(unittest.TestCase): ''' Test sign functions ''' def test_hash(self): msg1 = b'Are you suggesting coconuts migrate?' msg2 = b'Not at all, they could be carried.' chash1 = libnacl.crypto_hash(m...
apache-2.0
Python
2a4c8687d916cf6c9d23cb570d4ef363d2c30743
Kill that development rule.
jeremycline/fmn,jeremycline/fmn,jeremycline/fmn
fmn/rules/__init__.py
fmn/rules/__init__.py
from fmn.rules.ansible import * from fmn.rules.askbot import * from fmn.rules.bodhi import * from fmn.rules.buildsys import * from fmn.rules.compose import * from fmn.rules.fas import * from fmn.rules.fedbadges import * from fmn.rules.fedoratagger import * from fmn.rules.generic import * from fmn.rules.git import * fro...
from fmn.rules.ansible import * from fmn.rules.askbot import * from fmn.rules.bodhi import * from fmn.rules.buildsys import * from fmn.rules.compose import * from fmn.rules.fas import * from fmn.rules.fedbadges import * from fmn.rules.fedoratagger import * from fmn.rules.generic import * from fmn.rules.git import * fro...
lgpl-2.1
Python
4ab29d9e998c2dad578702bb8ce067e9b8288f45
update description
karlnapf/kameleon-mcmc,karlnapf/kameleon-mcmc
main/experiments/scripts/RingResults.py
main/experiments/scripts/RingResults.py
import os import sys to_add=os.sep.join(os.path.abspath(os.path.dirname(sys.argv[0])).split(os.sep)[0:-3]) sys.path.append(to_add) from main.experiments.SingleChainAggregator import SingleChainAggregator if __name__ == '__main__': if len(sys.argv)!=4: print "usage:", str(sys.argv[0]), "<idx_from> <idx_to>...
import os import sys to_add=os.sep.join(os.path.abspath(os.path.dirname(sys.argv[0])).split(os.sep)[0:-3]) sys.path.append(to_add) from main.experiments.SingleChainAggregator import SingleChainAggregator if __name__ == '__main__': if len(sys.argv)!=4: print "usage:", str(sys.argv[0]), "<idx_from> <idx_to>...
bsd-2-clause
Python
9576fc5ac009370b689dec3c0233f1b6f92e773d
Bump version to 14.5.4
hhursev/recipe-scraper
recipe_scrapers/__version__.py
recipe_scrapers/__version__.py
__version__ = "14.5.4"
__version__ = "14.5.3"
mit
Python
412457fbd94bceb65f57f79def8fed186670d462
Bump version to 10.1.1
hhursev/recipe-scraper
recipe_scrapers/__version__.py
recipe_scrapers/__version__.py
__version__ = "10.1.1"
__version__ = "10.1.0"
mit
Python
b905b620f0faa374034cfdfcf5dc8c8df781bcdb
Update test_tiled_compound.py
iModels/mbuild,iModels/mbuild,tcmoore3/mbuild,ctk3b/mbuild,sallai/mbuild,tcmoore3/mbuild,summeraz/mbuild,summeraz/mbuild,ctk3b/mbuild,sallai/mbuild
mbuild/tests/test_tiled_compound.py
mbuild/tests/test_tiled_compound.py
import pytest import mbuild as mb from mbuild.tests.base_test import BaseTest class TestTiledCompound(BaseTest): def test_2d_replication(self, betacristobalite): nx = 2 ny = 3 nz = 1 tiled = mb.TiledCompound(betacristobalite, [nx, ny, nz]) assert tiled.n_particles == 1900...
import pytest import mbuild as mb from mbuild.tests.base_test import BaseTest class TestTiledCompound(BaseTest): def test_2d_replication(self, betacristobalite): nx = 2 ny = 3 nz = 1 tiled = mb.TiledCompound(betacristobalite, [nx, ny, nz]) assert tiled.n_particles == 1900...
mit
Python
15c31ad1ba2d934c088829bebba3378205bd4f39
Create .version after all files have been downloaded.
chrisswk/electron,iftekeriba/electron,jlord/electron,ervinb/electron,edulan/electron,John-Lin/electron,fritx/electron,yan-foto/electron,pirafrank/electron,mubassirhayat/electron,christian-bromann/electron,micalan/electron,jjz/electron,renaesop/electron,eric-seekas/electron,gabriel/electron,shockone/electron,tinydew4/el...
script/update-external-binaries.py
script/update-external-binaries.py
#!/usr/bin/env python import errno import sys import os from lib.util import safe_mkdir, rm_rf, extract_zip, tempdir, download VERSION = 'v0.1.0' SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) FRAMEWORKS_URL = 'https://github.com/atom/atom-shell-frameworks/releases' \ '/d...
#!/usr/bin/env python import errno import sys import os from lib.util import safe_mkdir, rm_rf, extract_zip, tempdir, download VERSION = 'v0.1.0' SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) FRAMEWORKS_URL = 'https://github.com/atom/atom-shell-frameworks/releases' \ '/d...
mit
Python
fc012aa8dc7a3c05c1824a2c333d6c73ebc8726e
Fix FilteringStore.get_user_filter to work with postgres
matrix-org/synapse,matrix-org/synapse,TribeMedia/synapse,iot-factory/synapse,matrix-org/synapse,TribeMedia/synapse,iot-factory/synapse,matrix-org/synapse,matrix-org/synapse,iot-factory/synapse,matrix-org/synapse,TribeMedia/synapse,TribeMedia/synapse,iot-factory/synapse,TribeMedia/synapse,iot-factory/synapse
synapse/storage/filtering.py
synapse/storage/filtering.py
# -*- coding: utf-8 -*- # Copyright 2015 OpenMarket Ltd # # 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 la...
# -*- coding: utf-8 -*- # Copyright 2015 OpenMarket Ltd # # 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 la...
apache-2.0
Python
fd26a745ded4af921eccd756b38628ce189c07b5
bump to 0.11.0 final
lyw07/kolibri,lyw07/kolibri,mrpau/kolibri,mrpau/kolibri,lyw07/kolibri,learningequality/kolibri,learningequality/kolibri,indirectlylit/kolibri,mrpau/kolibri,lyw07/kolibri,learningequality/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,learningequality/kolibri,mrpau/kolibri
kolibri/__init__.py
kolibri/__init__.py
""" CAUTION! Keep everything here at at minimum. Do not import stuff. This module is imported in setup.py, so you cannot for instance import a dependency. """ from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from .utils import env from .utils.version ...
""" CAUTION! Keep everything here at at minimum. Do not import stuff. This module is imported in setup.py, so you cannot for instance import a dependency. """ from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from .utils import env from .utils.version ...
mit
Python
10d64c38ca041d22f034c6fa4fd317f99daaa512
fix typo when use type hint (#1123)
ZoranPavlovic/kombu,ZoranPavlovic/kombu,celery/kombu,urbn/kombu
kombu/utils/text.py
kombu/utils/text.py
# -*- coding: utf-8 -*- """Text Utilities.""" # flake8: noqa from __future__ import absolute_import, unicode_literals from difflib import SequenceMatcher from kombu import version_info_t from kombu.five import string_t def escape_regex(p, white=''): # type: (str, str) -> str """Escape string for use within...
# -*- coding: utf-8 -*- """Text Utilities.""" # flake8: noqa from __future__ import absolute_import, unicode_literals from difflib import SequenceMatcher from kombu import version_info_t from kombu.five import string_t def escape_regex(p, white=''): # type: (str, str) -> str """Escape string for use within...
bsd-3-clause
Python
ce141e3b8d1d77eb17070ef5e136cc76d8a0be11
Change end's complement node to floor_div_2 node
muddyfish/PYKE,muddyfish/PYKE
node/end.py
node/end.py
#!/usr/bin/env python from nodes import Node from node.sort import Sort import math class End(Node): char = "e" args = 1 results = 1 contents = math.e @Node.test_func([12], [6]) @Node.test_func([11], [5]) def floor_half(self, inp: Node.number): """inp//2""" return inp/...
#!/usr/bin/env python from nodes import Node from node.sort import Sort import math class End(Node): char = "e" args = 1 results = 1 contents = math.e @Node.test_func([12], [-13]) def complement(self, inp: Node.number): """-(inp+1)""" return ~inp @Node.test_func([...
mit
Python
91617885e193aba7e794e881c3bf65124f2d6a8f
bump to 0.2.5b2
PaloAltoNetworks-BD/pan-stix,PaloAltoNetworks-BD/pan-stix
panstix/__init__.py
panstix/__init__.py
# # Copyright (c) 2014-2015 Palo Alto Networks, Inc. <info@paloaltonetworks.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROV...
# # Copyright (c) 2014-2015 Palo Alto Networks, Inc. <info@paloaltonetworks.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROV...
isc
Python
0b0c942fa74d1dcea8a2853b6baa79e86792bb4e
read key in hex
longaccess/longaccess-client,longaccess/longaccess-client,longaccess/longaccess-client
lacli/cipher/dec.py
lacli/cipher/dec.py
"""decrypt a file using simple AES-CTR-256 Usage: ladec <file> <key> """ import sys from docopt import docopt from base64 import b64decode from .aes import CipherAES from ..crypt import CryptIO from tempfile import NamedTemporaryFile from shutil import copyfileobj def main(args=sys.argv[1:]): options = docopt(_...
"""decrypt a file using simple AES-CTR-256 Usage: ladec <file> <key> """ import sys from docopt import docopt from base64 import b64decode from .aes import CipherAES from ..crypt import CryptIO from tempfile import NamedTemporaryFile from shutil import copyfileobj def main(args=sys.argv[1:]): options = docopt(_...
apache-2.0
Python
bc01c32a52c173f52718cf6d6aba36cee09d9549
Add sale_[start|finish]_datetime fields to Promotion resource
gadventures/gapipy
gapipy/resources/tour/promotion.py
gapipy/resources/tour/promotion.py
# Python 2 and 3 from __future__ import unicode_literals from ...utils import get_resource_class_from_resource_name from ..base import Resource, Product class PromotionProduct(Resource): """ The `products` referenced in a Promotion object are not valid resources (due to the existence of `type`) so they m...
# Python 2 and 3 from __future__ import unicode_literals from ...utils import get_resource_class_from_resource_name from ..base import Resource, Product class PromotionProduct(Resource): """ The `products` referenced in a Promotion object are not valid resources (due to the existence of `type`) so they m...
mit
Python
66604e749349e37eb1e59168d00f52ed7da23029
Implement utc_timeout for PGSQL and MSSQL
openstack/dragonflow,openstack/dragonflow,openstack/dragonflow
dragonflow/db/neutron/models.py
dragonflow/db/neutron/models.py
# Copyright (c) 2015 OpenStack Foundation # 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 ...
# Copyright (c) 2015 OpenStack Foundation # 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 ...
apache-2.0
Python
6ef61b7a0bcc8149155f83668f1fa7400a339998
update version to 0.3.0 alpha
manhg/django-rest-framework-gis,nmandery/django-rest-framework-gis,pglotov/django-rest-framework-gis,illing2005/django-rest-framework-gis,nmandery/django-rest-framework-gis,sh4wn/django-rest-framework-gis,arjenvrielink/django-rest-framework-gis,djangonauts/django-rest-framework-gis,barseghyanartur/django-rest-framework...
rest_framework_gis/__init__.py
rest_framework_gis/__init__.py
VERSION = (0, 3, 0, 'alpha') __version__ = VERSION # alias def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) if VERSION[2]: version = '%s.%s' % (version, VERSION[2]) if VERSION[3:] == ('alpha', 0): version = '%s pre-alpha' % version else: if VERSION[3] != 'final'...
VERSION = (0, 2, 0, 'final') __version__ = VERSION # alias def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) if VERSION[2]: version = '%s.%s' % (version, VERSION[2]) if VERSION[3:] == ('alpha', 0): version = '%s pre-alpha' % version else: if VERSION[3] != 'final'...
mit
Python
47ad5ba1eef3f039c28e5ec52f8ddd51c5348a86
Fix ForkReferenceVisitor.visite_node calling len() on 'children' instead of node['children'].
Legilibre/duralex
duralex/ForkReferenceVisitor.py
duralex/ForkReferenceVisitor.py
from AbstractVisitor import AbstractVisitor from duralex.alinea_parser import * class ForkReferenceVisitor(AbstractVisitor): def visit_node(self, node): if 'type' in node and node['type'].endswith('-reference') and 'children' in node and len(node['children']) > 1: for i in range(1, len(node['c...
from AbstractVisitor import AbstractVisitor from duralex.alinea_parser import * class ForkReferenceVisitor(AbstractVisitor): def visit_node(self, node): if 'type' in node and node['type'].endswith('-reference') and 'children' in node and len('children') > 1: for i in range(1, len(node['childre...
mit
Python
800f8b910c1a299fb412dc5919985e93aa866e86
Archive command for wrangle.
Axilent/ace-client
ace/plugins/wrangle/commands.py
ace/plugins/wrangle/commands.py
""" Commands for Wrangle. """ from ace import client as ac from ace.config import get_cfg, get_env, get_library_key def deploy(args): """ Deploys matching content. """ client = ac.get_client('axilent.library',get_library_key(args),args) workflow_steps = [] if args.workflow_steps: ...
""" Commands for Wrangle. """ from ace import client as ac from ace.config import get_cfg, get_env, get_library_key def deploy(args): """ Deploys matching content. """ client = ac.get_client('axilent.library',get_library_key(args),args) workflow_steps = [] if args.workflow_steps: ...
bsd-3-clause
Python
bf4402627a26ad6ab4ff5dafa20a12ca24693f9b
add on start fps is set in maya
mindbender-studio/core,mindbender-studio/core,getavalon/core,getavalon/core,MoonShineVFX/core,MoonShineVFX/core
mindbender/maya/pythonpath/userSetup.py
mindbender/maya/pythonpath/userSetup.py
"""Maya initialisation for Mindbender pipeline""" from maya import cmds import os fps = os.getenv("MINDBENDER_FPS") def setup(): assert __import__("pyblish_maya").is_setup(), ( "mindbender-core depends on pyblish_maya which has not " "yet been setup. Run pyblish_maya.setup()") from pyblish ...
"""Maya initialisation for Mindbender pipeline""" from maya import cmds def setup(): assert __import__("pyblish_maya").is_setup(), ( "mindbender-core depends on pyblish_maya which has not " "yet been setup. Run pyblish_maya.setup()") from pyblish import api api.register_gui("pyblish_lite...
mit
Python
f64eaa9beb68363ae0950fa9b879639fbc06a74c
update errorcode.py
myzj/dop,myzj/dop,myzj/dop,myzj/dop,myzj/dop,myzj/dop
dop/dop/errorcode.py
dop/dop/errorcode.py
# coding:utf-8 ################### # version 0.1 # author 王节红, ################### # 错误号 英文代码 中文描述 备注 CONSTANT = { "100001": ["Required field can not be empty", u"必填字段不能空"], "100002": ["Request type error", u"请求类型错误"], "100003": ["Check forbidden words throw exception.", u"禁词检查出现异常"], "100004...
# coding:utf-8 ################### # version 0.1 # author 王节红, ################### # 错误号 英文代码 中文描述 备注 CONSTANT = { "100001": ["Required field can not be empty", u"必填字段不能空"], "100002": ["Request type error", u"请求类型错误"], "100003": ["Check forbidden words throw exception.", u"禁词检查出现异常"], "100004...
apache-2.0
Python
e25f960c743ff316922d1b4914fd73b352a20d55
Add tests for is_contact_active
qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq
corehq/apps/sms/tests/test_util.py
corehq/apps/sms/tests/test_util.py
#!/usr/bin/env python from corehq.apps.hqcase.utils import update_case from corehq.apps.sms.mixin import apply_leniency from corehq.apps.sms.util import (clean_phone_number, get_contact, ContactNotFoundException, is_contact_active) from corehq.apps.users.models import CommCareUser from corehq.form_processor.tests.u...
#!/usr/bin/env python from corehq.apps.sms.mixin import apply_leniency from corehq.apps.sms.util import (clean_phone_number, get_contact, ContactNotFoundException) from corehq.apps.users.models import CommCareUser from corehq.form_processor.utils import is_commcarecase from corehq.util.test_utils import create_test...
bsd-3-clause
Python
16b7dddd4829bf3db31f51f87fc915ee4763c356
use thread for inputs
nzjoel1234/sprinkler,nzjoel1234/sprinkler,nzjoel1234/sprinkler,nzjoel1234/sprinkler
driver/lcd_driver.py
driver/lcd_driver.py
#!/usr/bin/python # Example using a character LCD plate. import time import threading import Adafruit_CharLCD as LCD lcd = LCD.Adafruit_CharLCDPlate() # Make list of button value, text, and backlight color. buttons = ( (LCD.SELECT, 'Select', (1,1,1)), (LCD.LEFT, 'Left' , (1,0,0)), (LCD.UP,...
#!/usr/bin/python # Example using a character LCD plate. import time import threading import Adafruit_CharLCD as LCD lcd = LCD.Adafruit_CharLCDPlate() # Make list of button value, text, and backlight color. buttons = ( (LCD.SELECT, 'Select', (1,1,1)), (LCD.LEFT, 'Left' , (1,0,0)), (LCD.UP,...
mit
Python
f159fbdb6010a4ffd7f9e03876edc14497b9530c
update port
P-Space/PSpace-Status-Notifier-Linux-OSX,P-Space/PSpace-Status-Notifier-Linux
notifier.py
notifier.py
import argparse import urllib2 import json from subprocess import call import os import threading import time #home = getenv("HOME") folder = os.path.dirname(os.path.realpath(__file__)) oldstatus=-1 olddate=0 def DisplayMessage(title, message): global home call(['notify-send', title, message,'-t','3000','-i',folder...
import argparse import urllib2 import json from subprocess import call import os import threading import time #home = getenv("HOME") folder = os.path.dirname(os.path.realpath(__file__)) oldstatus=-1 olddate=0 def DisplayMessage(title, message): global home call(['notify-send', title, message,'-t','3000','-i',folder...
mit
Python
ad44759e9f3e1181a932c512a3d8ce17b8304f01
add emailing
penkins/penkins_ci,penkins/penkins_ci
penkins/__init__.py
penkins/__init__.py
import smtplib import yaml import os import datetime class PenkinsConfig: def __init__(self, file_name='/var/lib/penkins/.penkins.yaml'): self.config = self.__read(file_name) def __read(self, config_file): if os.path.isfile('.penkins.yaml'): config = yaml.load(open('.penkins.yaml...
apache-2.0
Python
fcbabb9c34037363ab7eb578b39eadf5da581314
Fix settings
aipescience/django-daiquiri,aipescience/django-daiquiri,aipescience/django-daiquiri
daiquiri/core/settings/daiquiri.py
daiquiri/core/settings/daiquiri.py
import daiquiri.core.env as env ASYNC = env.get_bool('ASYNC') IPV4_PRIVACY_MASK = 16 IPV6_PRIVACY_MASK = 32 SITE_URL = env.get('SITE_URL') SITE_IDENTIFIER = None SITE_TITLE = None SITE_DESCRIPTION = None SITE_LICENSE = None SITE_CREATOR = None SITE_CONTACT = None SITE_PUBLISHER = None SITE_CREATED = None SITE_UPDAT...
import daiquiri.core.env as env ASYNC = env.get_bool('ASYNC') IPV4_PRIVACY_MASK = 16 IPV6_PRIVACY_MASK = 32 SITE_URL = env.get('SITE_URL') SITE_IDENTIFIER = None SITE_TITLE = None SITE_DESCRIPTION = None SITE_LICENSE = None SITE_CREATOR = None SITE_CONTACT = None SITE_PUBLISHER = None SITE_CREATED = None SITE_UPDAT...
apache-2.0
Python
d2971af14f57e925e1500da9ede42adb34d0dc62
Change some naming in AnonymousAuthentication
uranusjr/django-tastypie-crust
tastycrust/authentication.py
tastycrust/authentication.py
#!/usr/bin/env python # -*- coding: utf-8 class AnonymousAuthentication(object): allowed_methods = ['GET'] def __init__(self, allowed=None): if allowed is not None: self.allowed_methods = allowed def is_authenticated(self, request, **kwargs): return (request.method in [s.uppe...
#!/usr/bin/env python # -*- coding: utf-8 class AnonymousAuthentication(object): anonymous_allowed_methods = ['GET'] def __init__(self, allowed=None): if allowed is not None: self.anonymous_allowed_methods = allowed def is_authenticated(self, request, **kwargs): allowed_metho...
bsd-3-clause
Python
de04c1ed525f9af036a6b3e94b0355cf1a975e7b
Update utilities.py
rifqifatih/pokebot-slack
pgoapi/utilities.py
pgoapi/utilities.py
""" pgoapi - Pokemon Go API Copyright (c) 2016 tjado <https://github.com/tejado> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use...
""" pgoapi - Pokemon Go API Copyright (c) 2016 tjado <https://github.com/tejado> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use...
mit
Python
b64292b4f5056f0b9225a28565551f752bbf811e
Format print
LoppA/django-pizza,LoppA/django-pizza
pyexamples/loops.py
pyexamples/loops.py
a, b = 1, 2 pedidos = [ { 'nome': 'Mario', 'sabor': 'portuguesa' }, { 'nome': 'Marco', 'sabor': 'presunto' } ] for pedido in pedidos: print('Nome: {0}\nSabor: {1}' .format(pedido['nome'],pedido['sabor']))
pedidos = [ { 'nome': 'Mario', 'sabor': 'portuguesa' }, { 'nome': 'Marco', 'sabor': 'presunto' } ] for pedido in pedidos: print(pedido['nome'],pedido['sabor'])
cc0-1.0
Python
f307d70fc2b6deec028c34ff75556c632aa71299
add hostname to default information
yosisa/pyfluent,yosisa/pyfluent
pyfluent/logging.py
pyfluent/logging.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging import logging.handlers import socket import msgpack class FluentHandler(logging.handlers.SocketHandler): def __init__(self, host=None, port=24224, tag=None): super(FluentHandler, self).__init__(host or 'localhost', port) ...
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging import logging.handlers import msgpack class FluentHandler(logging.handlers.SocketHandler): def __init__(self, host=None, port=24224, tag=None): super(FluentHandler, self).__init__(host or 'localhost', port) self.clos...
apache-2.0
Python
77b937b0015108cbc4fdb7a6f551c1aa77a52400
drop unused params in Repo.brancher()
efiop/dvc,dmpetrov/dataversioncontrol,dmpetrov/dataversioncontrol,efiop/dvc
dvc/repo/brancher.py
dvc/repo/brancher.py
from funcy import group_by from dvc.ignore import CleanTree from dvc.scm.tree import WorkingTree def brancher( # noqa: E302 self, all_branches=False, all_tags=False, all_commits=False ): """Generator that iterates over specified revisions. Args: branches (list): a list of branches to iterate ov...
from funcy import group_by from dvc.ignore import CleanTree from dvc.scm.tree import WorkingTree def brancher( # noqa: E302 self, branches=None, all_branches=False, tags=None, all_tags=False, all_commits=False, ): """Generator that iterates over specified revisions. Args: br...
apache-2.0
Python
db02d971ab776df82d31238efcd32bc82b4985dc
Set version 1.11.5
atztogo/phono3py,atztogo/phono3py,atztogo/phono3py,atztogo/phono3py
phono3py/version.py
phono3py/version.py
# Copyright (C) 2013 Atsushi Togo # All rights reserved. # # This file is part of phonopy. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notic...
# Copyright (C) 2013 Atsushi Togo # All rights reserved. # # This file is part of phonopy. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
Python
7fbbe6885f0ca4daf4f372e139176b4090cb7da9
Update version to 2.02.2
Synss/pyhard2
pyhard2/__init__.py
pyhard2/__init__.py
__version__ = u"2.02.2 beta"
__version__ = u"2.02.0 beta"
mit
Python
36f3e7a79ec972c181d0677c971bb1536de5f0f0
Update to version number
TJKessler/ECNet
ecnet/error_utils.py
ecnet/error_utils.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # ecnet/error_utils.py # v.1.4.0 # Developed in 2018 by Travis Kessler <Travis_Kessler@student.uml.edu> # # This program contains functions for error calculations # import numpy as np from math import sqrt # Calculates the root-mean-square error between...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # ecnet/error_utils.py # v.1.3.0.dev1 # Developed in 2018 by Travis Kessler <Travis_Kessler@student.uml.edu> # # This program contains functions for error calculations # import numpy as np from math import sqrt # Calculates the root-mean-square error be...
mit
Python
11672c32d09c744447613df955c1e27a2e3a8454
add tests
sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana
test/test_demultiplex.py
test/test_demultiplex.py
from sequana.demultiplex import StatsFile from sequana import sequana_data from easydev import TempFile import os def test_stats_file(): data = sequana_data("test_demultiplex_Stats.json") s = StatsFile(data) with TempFile() as fout: s.to_summary_reads(fout.name) with TempFile() as fout: ...
from sequana.demultiplex import StatsFile from sequana import sequana_data from easydev import TempFile import os def test_stats_file(): data = sequana_data("test_demultiplex_Stats.json") s = StatsFile(data) with TempFile() as fout: s.to_summary_reads(fout.name) with TempFile() as fout: ...
bsd-3-clause
Python
8be06de0af2fcd77c3cba37951cfe7a7b0d7320b
set mail module as dependency of contacts
ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo
addons/contacts/__manifest__.py
addons/contacts/__manifest__.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Contacts', 'category': 'Tools', 'summary': 'Centralize your address book', 'description': """ This module gives you a quick view of your contacts directory, accessible from your home page. You...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Contacts', 'category': 'Tools', 'summary': 'Centralize your address book', 'description': """ This module gives you a quick view of your contacts directory, accessible from your home page. You...
agpl-3.0
Python
64fac96c0d02082aeccb638a283af058e75d9d8e
Rename test to cons
hammerlab/mhctools,hammerlab/mhctools
test/test_netmhc_cons.py
test/test_netmhc_cons.py
from mhctools import NetMHCcons from mhctools.alleles import normalize_allele_name DEFAULT_ALLELE = 'HLA-A*02:01' def test_netmhc_cons(): alleles = [normalize_allele_name(DEFAULT_ALLELE)] cons_predictor = NetMHCcons( alleles=alleles, epitope_lengths=[9]) fasta_dictionary = { "SMAD...
from mhctools import NetMHCcons from mhctools.alleles import normalize_allele_name DEFAULT_ALLELE = 'HLA-A*02:01' def test_netmhc_pan(): alleles = [normalize_allele_name(DEFAULT_ALLELE)] cons_predictor = NetMHCcons( alleles=alleles, epitope_lengths=[9]) fasta_dictionary = { "SMAD4...
apache-2.0
Python
2b3db9d06816ffbdb156a61ac53237a618638136
merge with latest trunk
guewen/OpenUpgrade,slevenhagen/odoo,Kilhog/odoo,hip-odoo/odoo,tinkhaven-organization/odoo,hassoon3/odoo,ThinkOpen-Solutions/odoo,xzYue/odoo,pedrobaeza/OpenUpgrade,fgesora/odoo,klunwebale/odoo,simongoffin/website_version,brijeshkesariya/odoo,minhtuancn/odoo,ChanduERP/odoo,sysadminmatmoz/OCB,BT-rmartin/odoo,stephen144/od...
addons/mail/controllers/main.py
addons/mail/controllers/main.py
import base64 import openerp from openerp import SUPERUSER_ID import openerp.addons.web.http as oeweb from openerp.addons.web.controllers.main import content_disposition #---------------------------------------------------------- # Controller #---------------------------------------------------------- class MailContr...
import base64 import openerp.addons.web.http as oeweb from openerp.addons.web.controllers.main import content_disposition #---------------------------------------------------------- # Controller #---------------------------------------------------------- class MailController(oeweb.Controller): _cp_path = '/mail' ...
agpl-3.0
Python
1d549c6fe3b4275a3ee47cfea94d6b066ec02778
Use 'pythonic' for loop over locales
rolepoint/pyseeyou
pyseeyou/locales.py
pyseeyou/locales.py
from pyseeyou.cldr_rules import cardinals def lookup_closest_locale(locale, available, separator = '_'): ''' Looks up the closest available locale to use for specified locale :param locale: BCP 47 language tag to lookup :param available: Dictionary or list with available locales :param...
from pyseeyou.cldr_rules import cardinals def lookup_closest_locale(locale, available, separator = '_'): ''' Looks up the closest available locale to use for specified locale :param locale: BCP 47 language tag to lookup :param available: Dictionary or list with available locales :param...
mit
Python
5bde94ad5a7816908aef27b292a5f79e049e71f6
Bump version
NOAA-ORR-ERD/pysgrid,ayan-usgs/pysgrid,sgrid/pysgrid,ayan-usgs/pysgrid,sgrid/pysgrid,NOAA-ORR-ERD/pysgrid
pysgrid/__init__.py
pysgrid/__init__.py
from __future__ import (absolute_import, division, print_function) from .sgrid import SGrid, load_grid from . import utils __version__ = '0.3.1' __all__ = ['SGrid', 'load_grid', 'utils']
from __future__ import (absolute_import, division, print_function) from .sgrid import SGrid, load_grid from . import utils __version__ = '0.3.0' __all__ = ['SGrid', 'load_grid', 'utils']
bsd-3-clause
Python
fa885b929f8323c88228dbc4d40ca286d49ee286
Create corresponding SmartTag resource with explicitly defined 'resource_name' attribute that will be used for its TastyFactory key.
juanique/django-chocolate,juanique/django-chocolate,juanique/django-chocolate
test_project/blog/api.py
test_project/blog/api.py
from tastypie.resources import ModelResource from tastypie.api import Api from tastypie import fields from models import Entry, Comment, SmartTag class EntryResource(ModelResource): class Meta: queryset = Entry.objects.all() class CommentResource(ModelResource): entry = fields.ForeignKey("blog.api...
from tastypie.resources import ModelResource from tastypie.api import Api from tastypie import fields from models import Entry, Comment class EntryResource(ModelResource): class Meta: queryset = Entry.objects.all() class CommentResource(ModelResource): entry = fields.ForeignKey("blog.api.EntryReso...
bsd-3-clause
Python
1946fd23ef49c6b0e9f3fec602c7ed724d4b80a5
fix lint
firedrakeproject/dcore,firedrakeproject/gusto
examples/sw_williamson2_triangle.py
examples/sw_williamson2_triangle.py
from dcore import * from firedrake import IcosahedralSphereMesh, Expression, \ VectorFunctionSpace refinements = 3 # number of horizontal cells = 20*(4^refinements) R = 6371220. u_0 = 20.0 # Maximum amplitude of the zonal wind (m/s) mesh = IcosahedralSphereMesh(radius=R, refinemen...
from dcore import * from firedrake import IcosahedralSphereMesh, ExtrudedMesh, Expression, \ VectorFunctionSpace import numpy as np refinements = 3 # number of horizontal cells = 20*(4^refinements) R = 6371220. u_0 = 20.0 # Maximum amplitude of the zonal wind (m/s) mesh = IcosahedralSphereMesh(radius = R, ...
mit
Python
fb3826de0238d9c13785bde4e4f819be29e3c0f9
Add file as parameters
alephmelo/pyncd
pyncd.py
pyncd.py
import lzma import sys x = open(sys.argv[1], 'rb').read() # file 1 of any type y = open(sys.argv[2], '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.compress(x_y) # c...
import lzma x = open('examples/txt/1.txt', 'rb').read() # file 1 of any type y = open('examples/txt/3.txt', '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.compress(x_y) # ...
mit
Python
94cac240e3dd92c671e97f6b775b40d475fa7443
Handle teachers
bomjacob/htxaarhuslan,bomjacob/htxaarhuslan,bomjacob/htxaarhuslan
main/management/commands/load_brugere.py
main/management/commands/load_brugere.py
import json from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from main.models import Profile class Command(BaseCommand): help = 'Loads legacy users from a json file' def add_arguments(self, parser): parser.add_argument('file', nargs='+', ...
import json from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from main.models import Profile class Command(BaseCommand): help = 'Loads legacy users from a json file' def add_arguments(self, parser): parser.add_argument('file', nargs='+', ...
mit
Python
427f1267dfc7f4931ae508365be815b3792925c7
add query stuff
e-beach/amazing-tweets,e-beach/amazing-tweets
query.py
query.py
from pprint import pprint import twitter from credentials import consumer_key, consumer_secret, access_key, access_secret auth = twitter.OAuth(access_key, access_secret, consumer_key, consumer_secret) api= twitter.Twitter(auth = auth) def get_users(topic): results = api.users.search(q = topic) IDs = [ user["id_str"...
from pprint import pprint import twitter from credentials import consumer_key, consumer_secret, access_key, access_secret api= twitter.Twitter( auth = twitter.OAuth(access_key, access_secret, consumer_key, consumer_secret)) def get_users(topic_str): results = api.users.search(q = topic_str) IDs = [ user["...
mit
Python
0f06d86c32736520b1ca021aa811ea50c6683d90
change default project name to 'myproject'
tylerlong/quick_framework
quick.py
quick.py
# coding=utf-8 """ quick ~~~~~ core file for quick framework """ import os, sys from toolkit_library.inspector import ModuleInspector from toolkit_library.input_util import InputUtil def create_project(): """Create a new project""" project_name = InputUtil.get_input('project name', defa...
# coding=utf-8 """ quick ~~~~~ core file for quick framework """ import os, sys from toolkit_library.inspector import ModuleInspector from toolkit_library.input_util import InputUtil def create_project(): """Create a new project""" project_name = InputUtil.get_input('project name', defa...
bsd-3-clause
Python
185dcb9db26bd3dc5f76faebb4d56c7abb87f87f
Test the parsing of all of the uploaded Jaguar files
Clyde-fare/cclib_bak,Clyde-fare/cclib_bak
test/parseJaguar.py
test/parseJaguar.py
import os from cclib.parser import Jaguar os.chdir(os.path.join("..","data","Jaguar","basicJaguar")) files = [ ["eg01","dvb_gopt.out"], ["eg02","dvb_sp.out"], ["eg03","dvb_ir.out"], ["eg06","dvb_un_sp.out"] ] for f in files: t = Jaguar(os.path.join(f[0],f[1])) t.pars...
import os from cclib.parser import Jaguar os.chdir(os.path.join("..","data","Jaguar","basicJaguar")) os.chdir("eg01") for file in ["dvb_gopt.out"]: t = Jaguar(file) t.parse() print t.moenergies[0,:] print t.homos[0] print t.moenergies[0,t.homos[0]]
lgpl-2.1
Python
a798323ff4e3057df4d41d60c137a66b092516b5
Update max_end3.py
RCoon/CodingBat,RCoon/CodingBat
Python/List_1/max_end3.py
Python/List_1/max_end3.py
# Given an array of ints length 3, figure out which is larger between the # first and last elements in the array, and set all the other elements to # be that value. Return the changed array. # max_end3([1, 2, 3]) --> [3, 3, 3] # max_end3([11, 5, 9]) --> [11, 11, 11] # max_end3([2, 11, 3]) --> [3, 3, 3] def max_end3(...
# Given an array of ints length 3, figure out which is larger between the # first and last elements in the array, and set all the other elements to # be that value. Return the changed array. # max_end3([1, 2, 3]) -> [3, 3, 3] # max_end3([11, 5, 9]) -> [11, 11, 11] # max_end3([2, 11, 3]) -> [3, 3, 3] def max_end3(num...
mit
Python
2ddc8e80d5741993a306254e94393547ea41dff3
Update vuln-28.py
gauntlt/gauntlt-demo,mtesauro/gauntlt-demo,gauntlt/gauntlt-demo,mtesauro/gauntlt-demo
examples/webgoat/vuln-28/vuln-28.py
examples/webgoat/vuln-28/vuln-28.py
import argparse import re import json import sys import requests s = requests.Session() response = s.get("http://127.0.0.1:8080/WebGoat/login.mvc") response = s.post("http://127.0.0.1:8080/WebGoat/j_spring_security_check", data={'username': 'guest', 'password': 'guest'}) response = s.get("http://127.0.0.1:8080/WebG...
import argparse import re import json import sys import requests s = requests.Session() response = s.get("http://127.0.0.1:8080/WebGoat/login.mvc") print response.status_code response = s.post("http://127.0.0.1:8080/WebGoat/j_spring_security_check", data={'username': 'guest', 'password': 'guest'}) print response.sta...
mit
Python
1e47a9f90ae7f48cc65056a917cb73dc7afa4548
add first test for the templates base
ivoire/RandoAmisSecours,ivoire/RandoAmisSecours
RandoAmisSecours/tests.py
RandoAmisSecours/tests.py
# -*- coding: utf-8 -*- # vim: set ts=4 # Copyright 2013 Rémi Duraffort # This file is part of RandoAmisSecours. # # RandoAmisSecours 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...
# -*- coding: utf-8 -*- # vim: set ts=4 # Copyright 2013 Rémi Duraffort # This file is part of RandoAmisSecours. # # RandoAmisSecours 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...
agpl-3.0
Python
f5d87a37ece8708735591f0d26213a6b7fd1a191
Put each unexpected dynamic symbols on its own line
thiagopnts/servo,DominoTree/servo,peterjoel/servo,anthgur/servo,larsbergstrom/servo,nnethercote/servo,thiagopnts/servo,szeged/servo,paulrouget/servo,thiagopnts/servo,pyfisch/servo,pyfisch/servo,KiChjang/servo,CJ8664/servo,thiagopnts/servo,pyfisch/servo,fiji-flo/servo,notriddle/servo,ConnorGBrewster/servo,sadmansk/servo...
etc/ci/check_dynamic_symbols.py
etc/ci/check_dynamic_symbols.py
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
mpl-2.0
Python
1ac10f783985f5e8fe6053a58f8aea36d24b642d
ADD repo dependency to adhoc setup
csrocha/account_check,csrocha/account_check
adhoc_base_setup/__openerp__.py
adhoc_base_setup/__openerp__.py
# -*- coding: utf-8 -*- { 'name': 'ADHOC Modules Configuration', 'version': '1.0', 'category': 'ADHOC Modules', 'summary': 'extra, addons, modules', 'description': """ ADHOC Modules Configuration =============================================================================== Here, you can configure ...
# -*- coding: utf-8 -*- { 'name': 'ADHOC Modules Configuration', 'version': '1.0', 'category': 'ADHOC Modules', 'summary': 'extra, addons, modules', 'description': """ ADHOC Modules Configuration =============================================================================== Here, you can configure ...
agpl-3.0
Python
7b6c2080818229a4d3b87c86c2cb73d399bb8879
improve precision by sacrificing recall
charliezon/deep_stock
experiments/exp_20170722_01/main.py
experiments/exp_20170722_01/main.py
import xgboost as xgb # Accuracy on test set: 63% # positive_threshold = 0.50 => accuracy = 4396/6897 = 0.6373, precision = 1663/2651 = 0.62 # positive_threshold = 0.67 => accuracy = 4106/6897 = 0.5953, precision = 492/599 = 0.82 # positive_threshold = 0.80 => accuracy = 3889/6897 = 0.5638, precision = 176/184 = 0.95...
import xgboost as xgb # Accuracy on test set: 63% # read in data dtrain = xgb.DMatrix('../../data/data_20170722_01/train_data.txt') dtest = xgb.DMatrix('../../data/data_20170722_01/test_data.txt') # specify parameters via map, definition are same as c++ version param = {'max_depth':22, 'eta':0.1, 'silent':0, 'object...
mit
Python
bad670aebbdeeb029a40762aae80eec1100268a2
Fix data log fixture foreign keys
porksmash/swarfarm,porksmash/swarfarm,porksmash/swarfarm,porksmash/swarfarm
data_log/management/commands/generate_report_fixture.py
data_log/management/commands/generate_report_fixture.py
from django.core.management.base import BaseCommand from django.core import serializers from data_log import models import json class Command(BaseCommand): help = 'Create Data Log Report fixtures' def handle(self, *args, **kwargs): self.stdout.write(self.style.HTTP_INFO('Creating fixtures for Data L...
from django.core.management.base import BaseCommand from django.core import serializers from data_log import models import json class Command(BaseCommand): help = 'Create Data Log Report fixtures' def handle(self, *args, **kwargs): self.stdout.write(self.style.HTTP_INFO('Creating fixtures for Data L...
apache-2.0
Python
4cdacc11dd007942618eae973ab679ce6815d23a
Fix typo
Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data
scorecard/profile_data/indicators/income_budget_actual.py
scorecard/profile_data/indicators/income_budget_actual.py
from .indicator_calculator import IndicatorCalculator from itertools import groupby from .utils import year_key from functools import reduce import re from collections import defaultdict GROUPS = [ ("Property rates", ["0200", "0300"]), ("Service Charges", ["0400"]), ("Rental income", ["0700"]), ("Inter...
from .indicator_calculator import IndicatorCalculator from itertools import groupby from .utils import year_key from functools import reduce import re from collections import defaultdict GROUPS = [ ("Property rates", ["0200", "0300"]), ("Service Charges", ["0400"]), ("Rental income", ["0700"]), ("Inter...
mit
Python
191d42d206db07c9fa55521e7854b121378a5fc0
Use proper URLconf in spam test_extras
cslzchen/osf.io,brianjgeiger/osf.io,caneruguz/osf.io,brianjgeiger/osf.io,caneruguz/osf.io,hmoco/osf.io,cslzchen/osf.io,CenterForOpenScience/osf.io,caseyrollins/osf.io,leb2dg/osf.io,pattisdr/osf.io,HalcyonChimera/osf.io,crcresearch/osf.io,felliott/osf.io,caneruguz/osf.io,laurenrevere/osf.io,HalcyonChimera/osf.io,icereva...
admin_tests/spam/test_extras.py
admin_tests/spam/test_extras.py
from nose import tools as nt from django.test import SimpleTestCase from django.test.utils import override_settings from admin.spam.templatetags import spam_extras @override_settings(ROOT_URLCONF='admin.base.urls') class TestReverseTags(SimpleTestCase): def test_reverse_spam_detail(self): res = spam_extr...
from nose import tools as nt from django.test import SimpleTestCase from admin.spam.templatetags import spam_extras class TestReverseTags(SimpleTestCase): def test_reverse_spam_detail(self): res = spam_extras.reverse_spam_detail('123ab', page='2', status='4') nt.assert_in('/spam/123ab/?', res) ...
apache-2.0
Python
07e8152bb15efbdef412d29f8b79ea4e75cbe88d
remove obsolete header depdency.
DeadSix27/python_cross_compile_script
packages/dependencies/vulkan_loader.py
packages/dependencies/vulkan_loader.py
{ 'repo_type' : 'git', 'url' : 'https://github.com/KhronosGroup/Vulkan-Loader.git', 'configure_options' : '.. {cmake_prefix_options} -DVULKAN_HEADERS_INSTALL_DIR={target_prefix} ' '-DCMAKE_BUILD_TYPE=Release ' '-DBUILD_TESTS=OFF ' '-DCMAKE_INSTALL_PREFIX={target_prefix} -DCMAKE_ASM_COMPILER={mingw_binpath}/...
{ 'repo_type' : 'git', 'url' : 'https://github.com/KhronosGroup/Vulkan-Loader.git', 'configure_options' : '.. {cmake_prefix_options} -DVULKAN_HEADERS_INSTALL_DIR={target_prefix} ' '-DCMAKE_BUILD_TYPE=Release ' '-DBUILD_TESTS=OFF ' '-DCMAKE_INSTALL_PREFIX={target_prefix} -DCMAKE_ASM_COMPILER={mingw_binpath}/...
mpl-2.0
Python
6c1f01ab1aa412eaa4f2aabfe49514fbc0a7cdbc
Clarify problem59.py
mjwestcott/projecteuler,mjwestcott/projecteuler,mjwestcott/projecteuler
python/problem59.py
python/problem59.py
""" problem59.py https://projecteuler.net/problem=59 Each character on a computer is assigned a unique code and the preferred standard is ASCII (American Standard Code for Information Interchange). For example, uppercase A = 65, asterisk (*) = 42, and lowercase k = 107. A modern encryption method is to take a text f...
""" problem59.py https://projecteuler.net/problem=59 Each character on a computer is assigned a unique code and the preferred standard is ASCII (American Standard Code for Information Interchange). For example, uppercase A = 65, asterisk (*) = 42, and lowercase k = 107. A modern encryption method is to take a text f...
mit
Python
c4153abfc130634ff47844370561d04b3df988c7
Bump version
uzumaxy/pyvalid
pyvalid/__init__.py
pyvalid/__init__.py
from pyvalid.__accepts import Accepts as accepts from pyvalid.__returns import Returns as returns import pyvalid.validators as validators from pyvalid.__exceptions import PyvalidError, ArgumentValidationError, \ InvalidArgumentNumberError, InvalidReturnTypeError version = '1.0.0' __all__ = [ 'accepts', 'r...
from pyvalid.__accepts import Accepts as accepts from pyvalid.__returns import Returns as returns import pyvalid.validators as validators from pyvalid.__exceptions import PyvalidError, ArgumentValidationError, \ InvalidArgumentNumberError, InvalidReturnTypeError version = '0.9.6' __all__ = [ 'accepts', 'r...
bsd-3-clause
Python
e78ee833c9fcb05e06a0f961ae5b525a89b41e2c
remove unnecessary import sys
BradleyMoore/Algorithms
algorithms/sorting/mergesort.py
algorithms/sorting/mergesort.py
def mergesort(unsorted): """Takes an unsorted list as imput and return a sorted list.""" sorted = [] # if length of list is <= 1 it is already sorted if len(unsorted) <= 1: return unsorted # split list into 2 halves left, right = split_list(unsorted) # sort and merge the 2 list ha...
import sys def mergesort(unsorted): """Takes an unsorted list as imput and return a sorted list.""" sorted = [] # if length of list is <= 1 it is already sorted if len(unsorted) <= 1: return unsorted # split list into 2 halves left, right = split_list(unsorted) # sort and merge ...
mit
Python
91e9548fc39c94e272d7f5d5d7734452c68e63dc
Update reader.py
meyersj/geotweet,meyersj/geotweet,meyersj/geotweet
geotweet/mapreduce/utils/reader.py
geotweet/mapreduce/utils/reader.py
import sys import os import urllib2 import hashlib class FileReader(object): """ Read file from the local file system or remote url """ def is_url(self, src): return src.startswith('http') def is_valid_src(self, src): return os.path.isfile(src) or self.is_url(src) def get_location(s...
import sys import os import urllib2 import hashlib class FileReader(object): """ Read file from the local file system or remote url """ def is_url(self, src): return src.startswith('http') def is_valid_src(self, src): return os.path.isfile(src) or self.is_url(src) def get_location(s...
mit
Python
6b1cdde9bf34404b2a5acc65e4aaa94e14abe175
Update version to 0.2.7.9
davidmogar/genderator
genderator/__init__.py
genderator/__init__.py
__version__ = '0.2.7.9' from genderator.parser import Parser
__version__ = '0.2.7.8' from genderator.parser import Parser
mit
Python
ee2f034b1d359aef6de78be50589acd316dff937
fix small bug
alexis-roche/nipy,bthirion/nipy,alexis-roche/register,alexis-roche/niseg,arokem/nipy,nipy/nireg,alexis-roche/nipy,bthirion/nipy,nipy/nipy-labs,alexis-roche/register,alexis-roche/register,arokem/nipy,bthirion/nipy,arokem/nipy,nipy/nireg,alexis-roche/nipy,alexis-roche/niseg,nipy/nipy-labs,alexis-roche/nireg,bthirion/nipy...
examples/quickstart/example2.py
examples/quickstart/example2.py
from neuroimaging.core.image.image import Image from neuroimaging.modalities.fmri import fMRIImage import numpy as N import pylab def mask_and_func(subject=0, run=1, offset=5): M = Image('http://kff.stanford.edu/FIAC/fiac%d/fonc%d/fsl/mask.img' % (subject,run)) m = N.zeros(M.grid.shape) middle = [slice...
from neuroimaging.core.image.image import Image from neuroimaging.modalities.fmri import fMRIImage import numpy as N import pylab def mask_and_func(subject=0, run=1, offset=5): M = Image('http://kff.stanford.edu/FIAC/fiac%d/fonc%d/fsl/mask.img' % (subject,run)) m = N.zeros(M.grid.shape) middle = [slice...
bsd-3-clause
Python
5aa15d9853e7ba7c9d905b0dd7c773a9bf470fbc
Fix CryptoTicker test
qtile/qtile,qtile/qtile
test/widgets/test_crypto_ticker.py
test/widgets/test_crypto_ticker.py
# Copyright (c) 2021 elParaguayo # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distrib...
# Copyright (c) 2021 elParaguayo # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distrib...
mit
Python
fb84036e4269955e26d1e0cefd343f94790839e4
Bump version number.
mdickinson/refcycle
refcycle/version.py
refcycle/version.py
# Copyright 2013 Mark Dickinson # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
# Copyright 2013 Mark Dickinson # # 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,...
apache-2.0
Python
611842279d1f2fe93faacc71e882e17a13be6f1e
update gdc-client version
NCI-GDC/gdc-client,NCI-GDC/gdc-client
gdc_client/version.py
gdc_client/version.py
__version__ = 'v0.2.15.2'
__version__ = 'v0.2.15.1'
apache-2.0
Python
6309031090a135856e6e2b3f8381202d6d17b72f
Send unknown events to HipChat in red
yunojuno/django-trello-webhooks,yunojuno/django-trello-webhooks
test_app/signals.py
test_app/signals.py
# # -*- coding: utf-8 -*- import logging from django.conf import settings from django.dispatch import receiver from trello_webhooks.signals import callback_received from test_app.hipchat import send_to_hipchat logger = logging.getLogger(__name__) @receiver(callback_received, dispatch_uid="callback_received") def ...
# # -*- coding: utf-8 -*- import logging from django.conf import settings from django.dispatch import receiver from trello_webhooks.signals import callback_received from test_app.hipchat import send_to_hipchat logger = logging.getLogger(__name__) @receiver(callback_received, dispatch_uid="callback_received") def ...
mit
Python
c907633842cd1d0725afb08403c95f100ee3c057
use big lda
Sh4kE/fun-with-wiki-science
recom.py
recom.py
from pymongo import MongoClient from gensim import corpora, models, similarities import gensim db = MongoClient().articles.entries lda = gensim.models.LdaModel.load('data/lda400') dic = gensim.corpora.Dictionary.load_from_text('data/wiki_en_wordids.txt') def entry2bow(entry): return dic.doc2bow(entry['text'].low...
from pymongo import MongoClient from gensim import corpora, models, similarities import gensim db = MongoClient().articles.entries lda = gensim.models.LdaModel.load('data/lda_model') dic = gensim.corpora.Dictionary.load_from_text('data/wiki_en_wordids.txt') def entry2bow(entry): return dic.doc2bow(entry['text']....
mit
Python
051e9ca5dd3ceb5b0589d52135bdc6592a8af175
Rename variable to singular form
liuhewei/gotools-sublime
gotools_suggestions.py
gotools_suggestions.py
import sublime import sublime_plugin import json import os import golangconfig from .gotools_util import Buffers from .gotools_util import GoBuffers from .gotools_util import Logger from .gotools_util import ToolRunner class GotoolsSuggestions(sublime_plugin.EventListener): CLASS_SYMBOLS = { "func": "ƒ", "v...
import sublime import sublime_plugin import json import os import golangconfig from .gotools_util import Buffers from .gotools_util import GoBuffers from .gotools_util import Logger from .gotools_util import ToolRunner class GotoolsSuggestions(sublime_plugin.EventListener): CLASS_SYMBOLS = { "func": "ƒ", "v...
mit
Python
fa489634a5e5524679b0554f5147d6e8a0866f06
check for multiple strings in the test
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
tests/integration/runners/state.py
tests/integration/runners/state.py
''' Tests for the salt-run command ''' # Import python libs import os # Import Salt Testing libs from salttesting.helpers import ensure_in_syspath ensure_in_syspath('../../') # Import salt libs import integration class ManageTest(integration.ShellCase): ''' Test the manage runner ''' def test_over_r...
''' Tests for the salt-run command ''' # Import python libs import os # Import Salt Testing libs from salttesting.helpers import ensure_in_syspath ensure_in_syspath('../../') # Import salt libs import integration class ManageTest(integration.ShellCase): ''' Test the manage runner ''' def test_over_r...
apache-2.0
Python
92ee63edf203e20e264e07faba35e6c01fdc8daf
Fix small whitespace prob.
plusky/spec-cleaner,plusky/spec-cleaner,plusky/spec-cleaner,plusky/spec-cleaner,plusky/spec-cleaner
tests/fileutils-tests.py
tests/fileutils-tests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from nose.tools import raises from spec_cleaner.fileutils import FileUtils from spec_cleaner import RpmException class TestFileutils(unittest.TestCase): """ We run few tests to ensure fileutils class works fine """ def setUp(self): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from nose.tools import raises from spec_cleaner.fileutils import FileUtils from spec_cleaner import RpmException class TestFileutils(unittest.TestCase): """ We run few tests to ensure fileutils class works fine """ def setUp(self): ...
bsd-3-clause
Python
292103c19c1d92a28522aac114f0f102a0ee3bfa
add disk-based index test. Use a biger index space for more spaseness and use random floats for the points
parasmehta/tprtree,Toblerity/rtree,mwtoews/rtree,mwtoews/rtree,Toblerity/rtree
tests/benchmarks.py
tests/benchmarks.py
import random import timeit try: import pkg_resources pkg_resources.require('Rtree') except: pass from rtree import Rtree # a very basic Geometry class Point(object): def __init__(self, x, y): self.x = x self.y = y # Scatter points randomly in a 1x1 box # minx = 0 miny = 0 maxx = 6...
import random import timeit try: import pkg_resources pkg_resources.require('Rtree') except: pass from rtree import Rtree # a very basic Geometry class Point(object): def __init__(self, x, y): self.x = x self.y = y # Scatter points randomly in a 1x1 box count = 50000 points = [] ind...
mit
Python
0b83d2bd700540d46f6ef2c677d7f3549bb70479
Remove extra whitespaces and fix too long lines in soc.logic.helper.request module.
MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging
app/soc/logic/helper/request.py
app/soc/logic/helper/request.py
#!/usr/bin/python2.5 # # Copyright 2008 the Melange 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
#!/usr/bin/python2.5 # # Copyright 2008 the Melange 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
Python
40f140682a902957d5875c8afc88e16bc327367f
Move unit tests data in setUp
danmichaelo/wm_metrics,Commonists/wm_metrics,Commonists/wm_metrics,danmichaelo/wm_metrics,Commonists/wm_metrics,danmichaelo/wm_metrics,Commonists/wm_metrics,danmichaelo/wm_metrics
tests/test_cat2cohort.py
tests/test_cat2cohort.py
"""Unit tests for cat2cohort.""" import unittest from wm_metrics.cat2cohort import api_url, _make_CSV_line, _userlist_to_CSV_cohort class TestCat2Cohort(unittest.TestCase): """Test methods from Cat2Cohort.""" def setUp(self): """Set up the tests.""" self.userlist = [('Toto', 'fr'), ('Titi',...
"""Unit tests for cat2cohort.""" import unittest from wm_metrics.cat2cohort import api_url, _make_CSV_line, _userlist_to_CSV_cohort class TestCat2Cohort(unittest.TestCase): """Test methods from Cat2Cohort.""" def test_api_url(self): """Test api_url.""" values = [ ('fr', 'https:/...
mit
Python
e20c4bcc2994a9bd1031aca71b2e8ba7b69558f7
Add ClientDetailView Routing
rexhepberlajolli/RHChallenge,rexhepberlajolli/RHChallenge
app/user_administration/urls.py
app/user_administration/urls.py
from django.conf.urls import url from .views import LoginPage, ClientCreateView, ClientListView, ClientDetailView from django.contrib.auth.views import logout_then_login urlpatterns = [ url(r'^$', ClientListView.as_view(), name='ClientListView'), url(r'^add$', ClientCreateView.as_view(), name='ClientCreateView...
from django.conf.urls import url from .views import LoginPage, ClientCreateView, ClientListView from django.contrib.auth.views import logout_then_login urlpatterns = [ url(r'^$', ClientListView.as_view(), name='ClientListView'), url(r'^add$', ClientCreateView.as_view(), name='ClientCreateView'), url(r'^log...
mit
Python
2acd68798b524004f9b483ade6602ae741f74a3b
fix comment for other stone labels.
vftens/RocAlphaGo,Rochester-NRT/RocAlphaGo,MaMiFreak/RocAlphaGo,Rochester-NRT/AlphaGo,Rochester-NRT/AlphaGo,Rochester-NRT/AlphaGo,wrongu/RocAlphaGo,hiropppe/RocAlphaGo
tests/parseboard.py
tests/parseboard.py
from AlphaGo.go import GameState, BLACK, WHITE def parse(boardstr): '''Parses a board into a gamestate, and returns the location of any moves marked with anything other than 'B', 'X', '#', 'W', 'O', or '.' Rows are separated by '|', spaces are ignored. ''' boardstr = boardstr.replace(' ', '') ...
from AlphaGo.go import GameState, BLACK, WHITE def parse(boardstr): '''Parses a board into a gamestate, and returns the location of any moves marked with anything other than 'X', 'O', or '.' Rows are separated by '|', spaces are ignored. ''' boardstr = boardstr.replace(' ', '') board_size =...
mit
Python
768f16c73fe41d42d7feafa00712a322c2307b74
update tests to v1.1.0 (#1357)
behrtam/xpython,smalley/python,exercism/python,smalley/python,N-Parsons/exercism-python,exercism/xpython,jmluy/xpython,exercism/xpython,jmluy/xpython,exercism/python,behrtam/xpython,N-Parsons/exercism-python
exercises/grains/grains_test.py
exercises/grains/grains_test.py
import unittest from grains import ( on_square, total_after, ) # Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0 class GrainsTest(unittest.TestCase): def test_square_1(self): self.assertEqual(on_square(1), 1) def test_square_2(self): self.assertEqual(on_squ...
import unittest from grains import ( on_square, total_after, ) # Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0 class GrainsTest(unittest.TestCase): def test_square_1(self): self.assertEqual(on_square(1), 1) def test_square_2(self): self.assertEqual(on_squ...
mit
Python
7a904d1bb03be1b976215d533e98b2991abc702d
Move scroll depth order
thecarebot/carebot,thecarebot/carebot,thecarebot/carebot
plugins/registry.py
plugins/registry.py
from plugins.npr.help import NPRHelp from plugins.npr.linger import NPRLingerRate from plugins.npr.scrolldepth import NPRScrollDepth from plugins.npr.start_tracking import NPRStartTracking # Set up the plugins carebot will use PLUGINS = [ NPRHelp(), NPRLingerRate(), NPRScrollDepth(), NPRStartTracking()...
from plugins.npr.help import NPRHelp from plugins.npr.linger import NPRLingerRate from plugins.npr.scrolldepth import NPRScrollDepth from plugins.npr.start_tracking import NPRStartTracking # Set up the plugins carebot will use PLUGINS = [ NPRHelp(), NPRScrollDepth(), NPRLingerRate(), NPRStartTracking()...
mit
Python
8d9c63e079b5facc375a9420e27cc86c5edc7037
Fix precesion_and_recall function when there is non-existing label in the selector
VaclavDedik/triager,VaclavDedik/triager,VaclavDedik/triager,VaclavDedik/classifier
triager/classifier/tests.py
triager/classifier/tests.py
import numpy as np def accuracy(model, documents_cv, n=1): """Computes accuracy of the model. :param model: Prediction model. :param documents_cv: List of documents. :param n: Number of "suggested" options. """ n_cv = len(documents_cv) tpn = sum([1 for i in range(n_cv) if do...
import numpy as np def accuracy(model, documents_cv, n=1): """Computes accuracy of the model. :param model: Prediction model. :param documents_cv: List of documents. :param n: Number of "suggested" options. """ n_cv = len(documents_cv) tpn = sum([1 for i in range(n_cv) if do...
mit
Python
41f0dc14b240d3e42f000c79c31bc2759f36915c
Test page switching
GNOME/gnome-characters,GNOME/gnome-characters,GNOME/gnome-characters,GNOME/gnome-characters,GNOME/gnome-characters
tests/smoke_test.py
tests/smoke_test.py
#! /usr/bin/python from testutil import * from gi.repository import Gio, GLib import os, sys import pyatspi from dogtail import tree from dogtail import utils from dogtail.procedural import * def active(widget): return widget.getState().contains(pyatspi.STATE_ARMED) def visible(widget): return widget.getSta...
#! /usr/bin/python from testutil import * from gi.repository import Gio, GLib import os, sys import pyatspi from dogtail import tree from dogtail import utils from dogtail.procedural import * def active(widget): return widget.getState().contains(pyatspi.STATE_ARMED) def visible(widget): return widget.getSta...
bsd-3-clause
Python
867448759d4030e4b4ba9ba92bdc5cc2d52d74a0
Fix 404
Pylons/kai,Pylons/kai
kai/controllers/error.py
kai/controllers/error.py
import cgi import os.path from paste.urlparser import StaticURLParser from pylons import tmpl_context as c, request from pylons.controllers.util import abort, forward from pylons.middleware import error_document_template, media_path from webhelpers.html.builder import literal from kai.lib.base import BaseController, ...
import cgi import os.path from paste.urlparser import StaticURLParser from pylons import request from pylons.controllers.util import forward from pylons.middleware import error_document_template, media_path from pylons import tmpl_context as c from webhelpers.html.builder import literal from kai.lib.base import BaseC...
bsd-3-clause
Python