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
c75749922c8be3b70bacd66a6b25b8e50faf7b76
Bump flask from 0.10.1 to 1.0
codehugger/Flask-Starter,codehugger/Flask-Starter
setup.py
setup.py
# -*- coding: utf-8 -*- from setuptools import setup setup( name="myapp", version='0.0.1-dev', description='My Awesome Application', author='**INSERT_AUTHOR_NAME**', author_email='**INSERT_AUTHOR_EMAIL**', packages=[ 'myapp', 'myapp.blueprints' ], url='https://www.gith...
# -*- coding: utf-8 -*- from setuptools import setup setup( name="myapp", version='0.0.1-dev', description='My Awesome Application', author='**INSERT_AUTHOR_NAME**', author_email='**INSERT_AUTHOR_EMAIL**', packages=[ 'myapp', 'myapp.blueprints' ], url='https://www.gith...
bsd-3-clause
Python
787bc6427cc641e3c7a590f1ab57a2b840f471bc
bump to v0.6.0.dev0 (#61)
sinhrks/japandas
setup.py
setup.py
# -*- coding: utf-8 -*- #!/usr/bin/env python import codecs import os from setuptools import setup, find_packages PACKAGE = 'japandas' README = 'README.rst' REQUIREMENTS = 'requirements.txt' VERSION = '0.6.0.dev0' def read(fname): # file must be read as utf-8 in py3 to avoid to be bytes return codecs.open(os.pa...
# -*- coding: utf-8 -*- #!/usr/bin/env python import codecs import os from setuptools import setup, find_packages PACKAGE = 'japandas' README = 'README.rst' REQUIREMENTS = 'requirements.txt' VERSION = '0.5.1' def read(fname): # file must be read as utf-8 in py3 to avoid to be bytes return codecs.open(os.path.jo...
bsd-3-clause
Python
d2f7fce3cac7b2d742ab553325b3394092a0c8f8
Change the name of the package
adolfosilva/libgen.py
setup.py
setup.py
from setuptools import setup setup( name='libgen.py', version='0.1.0', license='MIT', author='Adolfo Silva', author_email='code@adolfosilva.org', url='https://github.com/adolfosilva/libgen.py', description='A script to download books from gen.lib.rus.ec', classifiers=[ 'License ...
from setuptools import setup setup( name='libgen', version='0.1', license='MIT', author='Adolfo Silva', author_email='code@adolfosilva.org', url='https://github.com/adolfosilva/libgen.py', description='A script to download books from gen.lib.rus.ec', tests_requires=['pytest'], py_mo...
mit
Python
46414834ec14f4c70b8c66770aa13570f09b924a
Upgrade content-io to 1.2.2
andreif/djedi-cms,5monkeys/djedi-cms,andreif/djedi-cms,andreif/djedi-cms,5monkeys/djedi-cms,5monkeys/djedi-cms
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages from sys import version_info install_requires = [ 'six', 'content-io >= 1.2.2', 'simplejson >= 3.2.0' ] tests_require = [ 'coverage', 'Markdown <= 2.4.1', 'Pillow', ] if version_info < (3,): tests_require += ['unittest2'] ...
#!/usr/bin/env python from setuptools import setup, find_packages from sys import version_info install_requires = [ 'six', 'content-io >= 1.2.1', 'simplejson >= 3.2.0' ] tests_require = [ 'coverage', 'Markdown <= 2.4.1', 'Pillow', ] if version_info < (3,): tests_require += ['unittest2'] ...
bsd-3-clause
Python
204cb3a68562e4ac7367571071faeb1762031220
Fix silly typo in setup.py
thinkst/opencanary,thinkst/opencanary,thinkst/opencanary,thinkst/opencanary
setup.py
setup.py
from setuptools import setup, find_packages import os import opencanary setup( name='opencanary', version=opencanary.__version__, url='http://www.thinkst.com/', author='Thinkst Applied Research', author_email='info@thinkst.com', description='OpenCanary daemon', long_description='A low inte...
from setuptools import setup, find_packages import os import opencanary setup( name='opencanary', version=opencanary.__version__, url='http://www.thinkst.com/', author='Thinkst Applied Research', author_email='info@thinkst.com', description='OpenCanary daemon', long_description='A low inte...
bsd-3-clause
Python
d6c998868ac89acbbfc232245676449f126f6f19
add subscribed field
lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django
src/people/admin.py
src/people/admin.py
from django.shortcuts import reverse from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from api.admin import admin_site from .models import Person, PersonTag @admin.register(Person, site=admin_site) class PersonAdmin(admin.ModelAdmin): list_display = ('email', 'subscribed',...
from django.shortcuts import reverse from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from api.admin import admin_site from .models import Person, PersonTag @admin.register(Person, site=admin_site) class PersonAdmin(admin.ModelAdmin): list_display = ('email', 'subscribed',...
agpl-3.0
Python
8e211245b786fab5ff8f686b4220f2b0fed2f10e
Update easyium/__init__.py
KarlGong/easyium-python,KarlGong/easyium
easyium/__init__.py
easyium/__init__.py
try: import appium appium_installed = True except ImportError: appium_installed = False from .webdriver import WebDriver, WebDriverType from .staticelement import StaticElement from .identifier import Identifier from .waits.waiter import wait_for __author__ = 'karl.gong'
from .webdriver import WebDriver, WebDriverType from .staticelement import StaticElement from .identifier import Identifier from .waits.waiter import wait_for __author__ = 'karl.gong' try: import appium appium_installed = True except ImportError: appium_installed = False
apache-2.0
Python
80be25e8ff106e0a578cc7ddcfd4aa060ce0ab4f
support deep path
if1live/easylinker
easylinker/links.py
easylinker/links.py
#-*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import print_function import os class LinkException(Exception): pass class Link(object): def __init__(self, src, dst): self.src = src self.dst = dst def pathname_to_valid_pathname(self, pathname): re...
#-*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import print_function import os class LinkException(Exception): pass class Link(object): def __init__(self, src, dst): self.src = src self.dst = dst def create(self): src = self.src dst = sel...
mit
Python
61f78a13362fb75796c423f60a62c865e50e212a
Rewrite command-line. (#9)
IzunaDevs/nsfw_dl
nsfw_dl/__main__.py
nsfw_dl/__main__.py
#!/usr/bin/python3.6 """ Read the license at: https://github.com/IzunaDevs/nsfw_dl/blob/master/LICENSE """ import argparse import sys import os import nsfw_dl def main(argv=sys.argv[1:]): # pylint: disable=dangerous-default-value """ Main entrypoint to nsfw_dl commandline. """ image = argparse.Argu...
#!/usr/bin/python3.6 """ Read the license at: https://github.com/IzunaDevs/nsfw_dl/blob/master/LICENSE """ import argparse import sys import nsfw_dl def download(downloader, args, file, download_file): with nsfw_dl.NSFWDL() as dl: img = dl.download(downloader, args=args) if callable(file): ...
mit
Python
42dba1bb3d86aa7998a55967ef5e7dc0f47c2050
Implement unfreeze.
jackstanek/s3bot
src/s3bot/freeze.py
src/s3bot/freeze.py
"""Wrapper for the freeze.sh bash script.""" import getpass import os import subprocess from s3bot import SHARED_BASE from s3bot.useremails import UserEmailRecord FREEZE_SH_SCRIPT_PATH = os.path.join(SHARED_BASE, "freezer", "freeze.sh") UNFREEZE_SH_SCRIPT_PATH = os.path.join(SHARED_BASE, "freezer", "unfreeze.sh") d...
"""Wrapper for the freeze.sh bash script.""" import getpass import os import subprocess from s3bot import SHARED_BASE from s3bot.useremails import UserEmailRecord FREEZE_SH_SCRIPT_PATH = os.path.join(SHARED_BASE, "freezer", "freeze.sh") def freeze(path): """Queue a freeze.sh job for the specified file.""" u...
mit
Python
c62ceaab233b0e2f60d5553e6b6f359cc6e0ae35
Update string-to-integer-atoi.py
tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,kamyu104/LeetCode,kamyu104/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015
Python/string-to-integer-atoi.py
Python/string-to-integer-atoi.py
# Time: O(n) # Space: O(1) # # Implement atoi to convert a string to an integer. # # Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below # and ask yourself what are the possible input cases. # # Notes: It is intended for this problem to be specified vaguely (ie, no given...
# Time: O(n) # Space: O(1) # # Implement atoi to convert a string to an integer. # # Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below # and ask yourself what are the possible input cases. # # Notes: It is intended for this problem to be specified vaguely (ie, no given...
mit
Python
c5f9a02843fd85e9622597c831f238d3daa86ee4
Update the build number
vlegoff/cocomud
src/version.py
src/version.py
BUILD = 12
BUILD = 11
bsd-3-clause
Python
7d0b81075b26782155cbcb77576e29b72c2fac86
Update forms.py
philippeowagner/django-terms,philippeowagner/django-terms
terms/forms.py
terms/forms.py
# coding: utf-8 from __future__ import unicode_literals from django.conf import settings from django.db.models import Q from django.forms import ModelForm, TextInput, ValidationError from django.utils.translation import ugettext as _ from .models import Term from .settings import AVAILABLE_WIDGETS, TERMS_DEFINITION_WI...
# coding: utf-8 from __future__ import unicode_literals from django.conf import settings from django.db.models import Q from django.forms import ModelForm, TextInput, ValidationError from django.utils.translation import ugettext as _ from .models import Term from .settings import AVAILABLE_WIDGETS, TERMS_DEFINITION_WI...
bsd-3-clause
Python
7b17da483d7aaef5353d3d19ca5a81089c0ad647
remove primitive bad pixels correction
zougloub/libseek,kkalya/seek,zougloub/libseek,kkalya/seek
test-viewer.py
test-viewer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, sys, re, subprocess import numpy as np import cv2 if __name__ == '__main__': cmd = ['./build/seek-test'] proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, ) cv2.namedWindow('seek', cv2.WINDOW_NORMAL) _min = 0x7e00 def minchange(x): global _min ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, sys, re, subprocess import numpy as np import cv2 if __name__ == '__main__': cmd = ['./build/seek-test'] proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, ) grid_fn = '1grid.png' if os.path.exists(grid_fn): grid = cv2.imread('1grid.png')/255 grid...
mit
Python
069512c4d5ee2ffe0ead486138576ac2ae04e0cf
Update version to 1.10.5
wagnerand/amo-validator,diox/amo-validator,wagnerand/amo-validator,mstriemer/amo-validator,diox/amo-validator,diox/amo-validator,wagnerand/amo-validator,mozilla/amo-validator,mozilla/amo-validator,wagnerand/amo-validator,diox/amo-validator,mstriemer/amo-validator,mozilla/amo-validator,mozilla/amo-validator,mstriemer/am...
validator/__init__.py
validator/__init__.py
__version__ = '1.10.5' class ValidationTimeout(Exception): """Validation has timed out. May be replaced by the exception type raised by an external timeout handler when run in a server environment.""" def __init__(self, timeout): self.timeout = timeout def __str__(self): return ...
__version__ = '1.10.4' class ValidationTimeout(Exception): """Validation has timed out. May be replaced by the exception type raised by an external timeout handler when run in a server environment.""" def __init__(self, timeout): self.timeout = timeout def __str__(self): return ...
bsd-3-clause
Python
bbb3274333b7527604bcd8e87bb0e61929a83f78
Set program version to 1.2.0
titusjan/objbrowser,titusjan/objbrowser
objbrowser/version.py
objbrowser/version.py
""" Version info for objbrowser """ import os, sys import objbrowser.qtpy, objbrowser.qtpy._version DEBUGGING = False PROGRAM_NAME = 'objbrowser' PROGRAM_VERSION = '1.2.0' PROGRAM_URL = 'https://github.com/titusjan/objbrowser' PROGRAM_DIRECTORY = os.path.abspath(os.path.dirname(__file__)) PYTHON_VERSION = "%d.%d.%d"...
""" Version info for objbrowser """ import os, sys import objbrowser.qtpy, objbrowser.qtpy._version DEBUGGING = False PROGRAM_NAME = 'objbrowser' PROGRAM_VERSION = '1.2.0-dev' PROGRAM_URL = 'https://github.com/titusjan/objbrowser' PROGRAM_DIRECTORY = os.path.abspath(os.path.dirname(__file__)) PYTHON_VERSION = "%d.%d...
mit
Python
8362da9dbf7f63c37b70c1793b53d867529ef893
Remove left-over debug message
alephobjects/ohai-kit,alephobjects/ohai-kit,alephobjects/ohai-kit
ohai_kit/singleton.py
ohai_kit/singleton.py
# Written by Senko Rasic <senko.rasic@goodcode.io> # Released into Public Domain. Use it as you like. from django.db import models class SingletonModel(models.Model): """Singleton Django Model Ensures there's always only one entry in the database, and can fix the table (by deleting extra entries) even i...
# Written by Senko Rasic <senko.rasic@goodcode.io> # Released into Public Domain. Use it as you like. from django.db import models class SingletonModel(models.Model): """Singleton Django Model Ensures there's always only one entry in the database, and can fix the table (by deleting extra entries) even i...
agpl-3.0
Python
4c5de3c7a031155488248563ab2d98fd6f40ba15
improve http server example
jasonlvhit/whoops
examples/http/http_server.py
examples/http/http_server.py
from http.client import parse_headers from io import BytesIO from whoops import ioloop, async_server class HttpServer(async_server.AsyncServer): def __init__(self, ioloop, address): super(HttpServer, self).__init__(ioloop, address) self.host, self.port = address self.rbufsize = -1 ...
from http.client import parse_headers from io import BytesIO from whoops import ioloop, async_server class HttpServer(async_server.AsyncServer): def __init__(self, ioloop, address): super(HttpServer, self).__init__(ioloop, address) self.rbufsize = -1 self.wbufsize = 0 self.rfile...
mit
Python
024a957e536681b93d2fd84f6c4616fadc689467
Fix typo, thanks to Johannes Schumann
tamasgal/km3pipe,tamasgal/km3pipe
examples/nogallery/module_workflow.py
examples/nogallery/module_workflow.py
#!/usr/bin/env python from __future__ import division, absolute_import, print_function __author__ = 'tamasgal' from km3pipe.core import Pipeline, Module, Pump class DummyPump(Pump): """A pump demonstration with a dummy list as data.""" def configure(self): self.data = [{'nr': 1}, {'nr': 2}] ...
#!/usr/bin/env python from __future__ import division, absolute_import, print_function __author__ = 'tamasgal' from km3pipe.core import Pipeline, Module, Pump class DummyPump(Pump): """A pump demonstration with a dummy list as data.""" def configure(self): self.data = [{'nr': 1}, {'nr': 2}] ...
mit
Python
b90b464b3cf8dc2de0bded8b2554fd53fe9ce4d6
Add test for dict-like
kragniz/json-sempai
test_sempai.py
test_sempai.py
import jsonsempai import os import shutil import sys import tempfile TEST_FILE = '''{ "three": 3, "one": { "two": { "three": 3 } } }''' class TestSempai(object): def setup(self): self.direc = tempfile.mkdtemp(prefix='jsonsempai') sys.path.append(self.dire...
import jsonsempai import os import shutil import sys import tempfile TEST_FILE = '''{ "three": 3, "one": { "two": { "three": 3 } } }''' class TestSempai(object): def setup(self): self.direc = tempfile.mkdtemp(prefix='jsonsempai') sys.path.append(self.dire...
mit
Python
5b9023fd4e338a065f813977c956ea7ac1bfff91
Refactor examples/mnist/train_test.py from testing single epoch to single train step. This is to make the tests across examples consistent.
google/flax,google/flax
examples/mnist/train_test.py
examples/mnist/train_test.py
# Copyright 2020 The Flax 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 law or agreed to in wri...
# Copyright 2020 The Flax 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 law or agreed to in wri...
apache-2.0
Python
9006898036d9f877e450b3dad605450fb98a1f0d
Fix #265 - Wrong introspection rule for GeoDjango 1.0
RaD/django-south,RaD/django-south,philipn/django-south,nimnull/django-south,philipn/django-south,nimnull/django-south,RaD/django-south
south/introspection_plugins/geodjango.py
south/introspection_plugins/geodjango.py
""" GeoDjango introspection rules """ import django from django.conf import settings from south.modelsinspector import add_introspection_rules has_gis = "django.contrib.gis" in settings.INSTALLED_APPS if has_gis: # Alright,import the field from django.contrib.gis.db.models.fields import GeometryField ...
""" GeoDjango introspection rules """ import django from django.conf import settings from south.modelsinspector import add_introspection_rules has_gis = "django.contrib.gis" in settings.INSTALLED_APPS if has_gis: # Alright,import the field from django.contrib.gis.db.models.fields import GeometryField ...
apache-2.0
Python
289f23df515c168ef7d2ae57e6054fefa07def3c
Test beam parsing
honnibal/spaCy,honnibal/spaCy,explosion/spaCy,aikramer2/spaCy,spacy-io/spaCy,recognai/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,aikramer2/spaCy,aikramer2/spaCy,aikramer2/spaCy,recognai/spaCy,recognai/spaCy,recognai/spaCy,spacy-io/spaCy,spacy-io/spaCy,aikramer2/spaCy,recognai/spaCy,honnibal/spa...
spacy/tests/parser/test_neural_parser.py
spacy/tests/parser/test_neural_parser.py
# coding: utf8 from __future__ import unicode_literals from thinc.neural import Model from mock import Mock import pytest import numpy from ..._ml import chain, Tok2Vec, doc2feats from ...vocab import Vocab from ...pipeline import TokenVectorEncoder from ...syntax.arc_eager import ArcEager from ...syntax.nn_parser imp...
# coding: utf8 from __future__ import unicode_literals from thinc.neural import Model from mock import Mock import pytest import numpy from ..._ml import chain, Tok2Vec, doc2feats from ...vocab import Vocab from ...pipeline import TokenVectorEncoder from ...syntax.arc_eager import ArcEager from ...syntax.nn_parser imp...
mit
Python
91f260f2c4c260f51e9a2529da6c028b968e5ce7
Add another test for #1971
explosion/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,honnibal/spaCy,spacy-io/spaCy
spacy/tests/regression/test_issue1971.py
spacy/tests/regression/test_issue1971.py
# coding: utf8 from __future__ import unicode_literals import pytest from spacy.matcher import Matcher from spacy.tokens import Token, Doc @pytest.mark.xfail def test_issue1971(en_vocab): # Possibly related to #2675 and #2671? matcher = Matcher(en_vocab) pattern = [ {"ORTH": "Doe"}, {"ORT...
# coding: utf8 from __future__ import unicode_literals import pytest from spacy.matcher import Matcher from spacy.tokens import Token, Doc @pytest.mark.xfail def test_issue1971(en_vocab): # Possibly related to #2675 and #2671? matcher = Matcher(en_vocab) pattern = [ {"ORTH": "Doe"}, {"ORT...
mit
Python
83f6775d0fb427ef9a15cb9dadd3cdf044620623
Add ondelete.
Scifabric/pybossa,PyBossa/pybossa,PyBossa/pybossa,Scifabric/pybossa
pybossa/model/project_stats.py
pybossa/model/project_stats.py
# -*- coding: utf8 -*- # This file is part of PYBOSSA. # # Copyright (C) 2015 Scifabric LTD. # # PYBOSSA is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your op...
# -*- coding: utf8 -*- # This file is part of PYBOSSA. # # Copyright (C) 2015 Scifabric LTD. # # PYBOSSA is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your op...
agpl-3.0
Python
797bd9842faa4b1cd29d713aa4721379fd56e2b6
Add test-credentials command
leosac/leosac,islog/leosac,leosac/leosac,leosac/leosac,islog/leosac,islog/leosac
python/leosacpy/scripts/cli.py
python/leosacpy/scripts/cli.py
import logging from types import SimpleNamespace import asyncio import click import colorama from click_repl import register_repl import leosacpy.cli.dev.dev from leosacpy.utils import guess_root_dir # The debug flag is set globally. # This is because when running "leosaccli --debug shell" # we want all command runni...
import logging from types import SimpleNamespace import click import colorama from click_repl import register_repl import leosacpy.cli.dev.dev from leosacpy.utils import guess_root_dir # The debug flag is set globally. # This is because when running "leosaccli --debug shell" # we want all command running in the REPL t...
agpl-3.0
Python
f9d606fd7b5833ed43c5f2ae720f7dcc4764543e
Update serializer.py
AndreiDrang/python-rucaptcha
python_rucaptcha/serializer.py
python_rucaptcha/serializer.py
from uuid import uuid4 from pydantic import Field, BaseModel, validator class CaptchaOptionsSer(BaseModel): phrase: bool = False caseSensitive: bool = False numeric: int = 0 calc: bool = False minLen: int = 0 maxLen: int = 0 lang: str = "" hintText: str = "" hintImg: str = "" ...
from datetime import datetime from typing import List, Optional from pydantic import BaseModel from pydantic import BaseModel, ValidationError, validator from uuid import uuid4 class CaptchaOptionsSer(BaseModel): phrase: bool = False caseSensitive: bool = False numeric: int = 0 calc: bool = False ...
mit
Python
3712295e7f3a1e54e468a2d3a1095ebb4d7154db
implement naive bayes fitting
becxer/pytrain
pytrain/nbayes/basic_nbayes.py
pytrain/nbayes/basic_nbayes.py
from numpy import * class basic_nbayes: def __init__(self, mat_data, label_data): self.word_data = mat_data self.num_word = 0 self.cate_data = label_data self.cate_set = {} self.num_cate = 0 self.cate_word = {} self.cate_word_sum = {} ...
class basic_nbayes: def __init__(self, mat_data, label_data): self.mat_data = mat_data self.label_data = label_data pass def fit(self): print "fitting----------------------" num_row = len(self.mat_data) num_col = len(self.mat_data[0]) pass def...
mit
Python
3590b8bfebd14f439270b2fb89e9e6c3c6e5ed6f
fix name of test
eirmag/weboob,nojhan/weboob-devel,Boussadia/weboob,franek/weboob,eirmag/weboob,Boussadia/weboob,Konubinix/weboob,laurent-george/weboob,frankrousseau/weboob,yannrouillard/weboob,willprice/weboob,franek/weboob,sputnick-dev/weboob,frankrousseau/weboob,laurent-george/weboob,Boussadia/weboob,frankrousseau/weboob,RouxRC/webo...
weboob/backends/cragr/test.py
weboob/backends/cragr/test.py
# -*- coding: utf-8 -*- # Copyright(C) 2010 Romain Bignon # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that it will b...
# -*- coding: utf-8 -*- # Copyright(C) 2010 Romain Bignon # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that it will b...
agpl-3.0
Python
cd1b264ea8ee45ecca403dbcd76ef2a21311e8c6
add regex routine
OpenTransitTools/utils
ott/utils/re_utils.py
ott/utils/re_utils.py
import re import logging log = logging.getLogger(__file__) def contains(regexp, str): ''' does string have one or more instances of regexp ''' ret_val = False try: a = re.findall(regexp, str.strip()) if a and len(a) > 0: ret_val = True except: pass return ret...
import re import logging log = logging.getLogger(__file__)
mpl-2.0
Python
f00c0c7d2d275ae8daf4442ab922022b28f67cd8
Add marketing dependencies.
Yajo/website,open-synergy/website,gfcapalbo/website,xpansa/website,LasLabs/website,nuobit/website,Antiun/website,Endika/website,acsone/website,nuobit/website,acsone/website,gfcapalbo/website,Antiun/website,Yajo/website,open-synergy/website,nuobit/website,acsone/website,open-synergy/website,xpansa/website,open-synergy/w...
website_slides/__openerp__.py
website_slides/__openerp__.py
# -*- coding: utf-8 -*- # ############################################################################# # # Odoo, Open Source Management Solution # Copyright (C) 2014-TODAY Odoo SA (<https://www.odoo.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
# -*- coding: utf-8 -*- # ############################################################################# # # Odoo, Open Source Management Solution # Copyright (C) 2014-TODAY Odoo SA (<https://www.odoo.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
agpl-3.0
Python
fe0c7836f054011017c7a5018d433bbf6e26b078
Update agent for environment.
danieloconell/Louis
reinforcement-learning/play.py
reinforcement-learning/play.py
"""This is the agent which currently takes the action with highest immediate reward.""" import env import time env.make("pygame") for episode in range(10): env.reset() episode_reward = 0 for t in range(100): episode_reward += env.actual_reward if env.done: print( ...
"""This is the agent which currently takes the action with highest immediate reward.""" import env env.make("text") for episode in range(10): env.reset() episode_reward = 0 for t in range(100): episode_reward += env.actual_reward if env.done: print( "Episode %d ...
mit
Python
7691287e5f2563db8a0a6dcf2de042306b359d46
Fix buildbots that are failing due to this test by adding all expected fails that TestMultipleDebuggers.py has.
llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb
packages/Python/lldbsuite/test/api/multiple-targets/TestMultipleTargets.py
packages/Python/lldbsuite/test/api/multiple-targets/TestMultipleTargets.py
"""Test the lldb public C++ api when creating multiple targets simultaneously.""" from __future__ import print_function import os import re import subprocess import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestMultipleTargets(Test...
"""Test the lldb public C++ api when creating multiple targets simultaneously.""" from __future__ import print_function import os import re import subprocess import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestMultipleTargets(Test...
apache-2.0
Python
5c851ee3d333518829ce26bfc06fd1038e70651c
Add util to temporarily alter log levels
qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq
corehq/util/decorators.py
corehq/util/decorators.py
from functools import wraps import logging from corehq.util.global_request import get_request from dimagi.utils.logging import notify_exception class ContextDecorator(object): """ A base class that enables a context manager to also be used as a decorator. https://docs.python.org/3/library/contextlib.html#...
from functools import wraps import logging from corehq.util.global_request import get_request from dimagi.utils.logging import notify_exception def handle_uncaught_exceptions(mail_admins=True): """Decorator to log uncaught exceptions and prevent them from bubbling up the call chain. """ def _outer(fn)...
bsd-3-clause
Python
a2c965ea7e8c30378bb8d8f5c7977c45eb830423
Comment on AsyncNotifier upstream's availability
onponomarev/ganeti,andir/ganeti,ganeti-github-testing/ganeti-test-1,apyrgio/ganeti,andir/ganeti,ganeti/ganeti,onponomarev/ganeti,mbakke/ganeti,leshchevds/ganeti,dimara/ganeti,apyrgio/snf-ganeti,apyrgio/snf-ganeti,yiannist/ganeti,leshchevds/ganeti,ganeti-github-testing/ganeti-test-1,mbakke/ganeti,yiannist/ganeti,yiannis...
lib/asyncnotifier.py
lib/asyncnotifier.py
# # # Copyright (C) 2009 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed ...
# # # Copyright (C) 2009 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed ...
bsd-2-clause
Python
a35d6f59d214741f554dde1363d2eac7addb04cb
Add limitations to package documentation
orome/crypto-enigma-py
crypto_enigma/__init__.py
crypto_enigma/__init__.py
#!/usr/bin/env python # encoding: utf8 """An Enigma machine simulator with rich textual display functionality. Limitations ~~~~~~~~~~~ Note that the correct display of some characters used to represent components (thin Naval rotors) assumes support for Unicode, while some aspects of the display of machine state depe...
#!/usr/bin/env python # encoding: utf8 """An Enigma machine simulator with rich textual display functionality.""" from ._version import __version__, __author__ #__all__ = ['machine', 'components'] from .components import * from .machine import *
bsd-3-clause
Python
0fe35173418a52c6ff5ee7d9f61e7b793bd9d2e2
change pmma parameters for bonding monomer
fishstamp82/moltools,fishstamp82/moltools
src/builder.py
src/builder.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import molecules, os, polymer def pmma_monomer(): """Return pmmma monomer building block as defined by SMILES format obtained in avogadro""" builddir = 'build' molfile = 'pmma_monomer.pdb' FILE = os.path.join( os.path.dirname( os.pat...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import molecules, os, polymer def pmma_monomer(): """Return pmmma monomer building block as defined by SMILES format obtained in avogadro""" builddir = 'build' molfile = 'pmma_monomer.pdb' FILE = os.path.join( os.path.dirname( os.pat...
mit
Python
6882cdbbbb66db8289bfb69b8334e7406099d456
remove connector and settings
whaleforever/carilogo,whaleforever/carilogo,whaleforever/carilogo
lib/search/search.py
lib/search/search.py
import argparse import os import cv2 import cluster from shutil import copyfile from fba.preprocess import Preprocess from fba.searcher import Searcher def initialize(): #TODO: need to fix database indexing # create_database() # index.indexing('images/ori_data', using="db") index.indexing('images/ori_...
import argparse import os import cv2 import connector import settings import cluster from shutil import copyfile from fba.preprocess import Preprocess from fba.searcher import Searcher def create_database(): if not os.path.isfile(settings.DATABASE): connector.initial(table="image", feature="text", ...
mit
Python
29dd6496534d32a996891475473e8584a0621871
Fix import problem
imlonghao/yunbi
yunbi/__init__.py
yunbi/__init__.py
from .yunbi import Yunbi
from yunbi import yunbi
mit
Python
ebb65e72b6df662a85819faa0c31b963ed1a9715
allow string OBJID
sagasurvey/saga,sagasurvey/saga
SAGA/spectra/extract_exsiting.py
SAGA/spectra/extract_exsiting.py
import numpy as np from easyquery import Query, QueryMaker from ..utils import fill_values_by_query from .common import SPEED_OF_LIGHT, ensure_specs_dtype from .manual_fixes import fixes_sdss_spec_by_objid __all__ = ["extract_sdss_spectra", "extract_nsa_spectra"] def extract_sdss_spectra(sdss): if sdss is None ...
import numpy as np from easyquery import Query from ..utils import fill_values_by_query from .common import SPEED_OF_LIGHT, ensure_specs_dtype from .manual_fixes import fixes_sdss_spec_by_objid __all__ = ["extract_sdss_spectra", "extract_nsa_spectra"] def extract_sdss_spectra(sdss): if sdss is None: ret...
mit
Python
686666b224d9c8f104cc49a0ac58e170cf5b9477
use get_device_from_array
yuyu2172/chainercv,yuyu2172/chainercv,pfnet/chainercv,chainer/chainercv,chainer/chainercv
chainercv/links/model/ssd/gradient_scaling.py
chainercv/links/model/ssd/gradient_scaling.py
from chainer import cuda class GradientScaling(object): """Optimizer/UpdateRule hook function for scaling gradient. This hook function scales gradient by a constant value. Args: rate (float): Coefficient for scaling. Attributes: rate (float): Coefficient for scaling. """ nam...
from chainer import cuda class GradientScaling(object): """Optimizer/UpdateRule hook function for scaling gradient. This hook function scales gradient by a constant value. Args: rate (float): Coefficient for scaling. Attributes: rate (float): Coefficient for scaling. """ nam...
mit
Python
d44e4bf7f73ecc68ded083008a2e753410edfa0e
implement name_not_equal_shortName
OParl/validator,OParl/validator
oparlvalidator/schema.py
oparlvalidator/schema.py
# -*- encoding: utf-8 -*- from __future__ import (unicode_literals, absolute_import, division, print_function) import json from os.path import dirname, join with open(join(dirname(__file__), 'schema.json')) as json_file: OPARL = json.load(json_file) # Additional validation functions here ...
# -*- encoding: utf-8 -*- from __future__ import (unicode_literals, absolute_import, division, print_function) import json from os.path import dirname, join with open(join(dirname(__file__), 'schema.json')) as json_file: OPARL = json.load(json_file) # Additional validation functions here ...
mit
Python
53ea29812a55a52c1a1b037340a4c4ddb5567197
Add main method using ArgumentParser
danmichaelo/wm_metrics,danmichaelo/wm_metrics,Commonists/wm_metrics,danmichaelo/wm_metrics,Commonists/wm_metrics,Commonists/wm_metrics,danmichaelo/wm_metrics,Commonists/wm_metrics
new_editor.py
new_editor.py
#!/usr/bin/python import json def new_editors(old_period, new_period): # new editors list new_editors = [] # Loading old period json filehandle data_old = json.load(old_period)["result"]["Individual Results"][0] # iteration on each user of individual results list # counts editor w...
#!/usr/bin/python import json def new_editors(old_period, new_period): # new editors list new_editors = [] # Loading old period json filehandle data_old = json.load(old_period)["result"]["Individual Results"][0] # iteration on each user of individual results list # counts editor w...
mit
Python
652b87210168ea046b76240daee51ba7d12bd27a
Bump version to 0.2.3
akolar/ogn-lib
ogn_lib/__init__.py
ogn_lib/__init__.py
from ogn_lib.client import OgnClient # noqa: F401 from ogn_lib.parser import Parser # noqa: F401 from ogn_lib.constants import AirplaneType, AddressType, BeaconType # noqa: F401 __title__ = 'ogn-lib' __description__ = 'Beacon processor for the OGN data stream.' __version__ = '0.2.3' __author__ = 'Anze Kolar' __auth...
from ogn_lib.client import OgnClient # noqa: F401 from ogn_lib.parser import Parser # noqa: F401 from ogn_lib.constants import AirplaneType, AddressType, BeaconType # noqa: F401 __title__ = 'ogn-lib' __description__ = 'Beacon processor for the OGN data stream.' __version__ = '0.2.2' __author__ = 'Anze Kolar' __auth...
mit
Python
3fc0f46fa96615c59cce044e3e58e502923edae4
Use cleaner version from cookiecutter OpenStack template
openstack/oslotest,openstack/oslotest
openstack/common/test.py
openstack/common/test.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2011 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....
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2011 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-2.0
Python
08291f3948108da15b9832c495fade04cf2e22c4
Add test to check title of index
jake-jake-jake/cocktails,jake-jake-jake/cocktails,jake-jake-jake/cocktails,jake-jake-jake/cocktails
tests/tests.py
tests/tests.py
#!/usr/bin/env python3 from selenium import webdriver import unittest class AdminPageTest(unittest.TestCase): def setUp(self): self.browser = webdriver.Firefox() self.browser.implicitly_wait(3) def tearDown(self): self.browser.quit() def test_visit_admin_page(self): # V...
#!/usr/bin/env python3 from selenium import webdriver import unittest class AdminPageTest(unittest.TestCase): def setUp(self): self.browser = webdriver.Firefox() self.browser.implicitly_wait(3) def tearDown(self): self.browser.quit() def test_visit_admin_page(self): # V...
mit
Python
ff1dbbfb83549500a5c0ea1181c8f03fd544a61e
Return True/False from mysql.is_running
efajardo/osg-test,efajardo/osg-test
osgtest/library/mysql.py
osgtest/library/mysql.py
import os import re from osgtest.library import core from osgtest.library import service def name(): if core.el_release() < 7: return 'mysql' else: return 'mariadb' def daemon_name(): if core.el_release() < 7: return 'mysqld' else: return 'mariadb' def pidfile(): ...
import os import re from osgtest.library import core from osgtest.library import service def name(): if core.el_release() < 7: return 'mysql' else: return 'mariadb' def daemon_name(): if core.el_release() < 7: return 'mysqld' else: return 'mariadb' def pidfile(): ...
apache-2.0
Python
878aa7b1f6752d988782ef0a4f9fe05a861e163e
Increment version
explosion/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc
thinc/about.py
thinc/about.py
# inspired from: # https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/ # https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py __name__ = 'thinc' __version__ = '6.10.0' __summary__ = "Practical Machine Learning for NLP" __uri__ = 'https://github.com/explosion/thinc' __a...
# inspired from: # https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/ # https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py __name__ = 'thinc' __version__ = '6.9.1' __summary__ = "Practical Machine Learning for NLP" __uri__ = 'https://github.com/explosion/thinc' __au...
mit
Python
029d556540b8b03b2b260934ca01cd2811cceb99
Set version to v7.1.0
explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc
thinc/about.py
thinc/about.py
# inspired from: # https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/ # https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py __name__ = "thinc" __version__ = "7.1.0" __summary__ = "Practical Machine Learning for NLP" __uri__ = "https://github.com/explosion/thinc" __au...
# inspired from: # https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/ # https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py __name__ = "thinc" __version__ = "7.1.0.dev0" __summary__ = "Practical Machine Learning for NLP" __uri__ = "https://github.com/explosion/thinc"...
mit
Python
9f66ac0a6e5b76b024fe4982fad7d2aec9e7d040
Write output to a file, not just stdout.
jkingdon/jh2gh
convert.py
convert.py
import sys import tokenizer import tree import copy import string_stream class VariableAssigner: def __init__(self, variables): self._variables = copy.deepcopy(variables) def next_name(self, kind): return self._variables[kind].pop(0) class Convert: def __init__(self): self._variables = {} def s...
import sys import tokenizer import tree import copy import string_stream class VariableAssigner: def __init__(self, variables): self._variables = copy.deepcopy(variables) def next_name(self, kind): return self._variables[kind].pop(0) class Convert: def __init__(self): self._variables = {} def s...
apache-2.0
Python
1bd74f8a597eb2e11280eb008c7da8a8d429f2f0
Fix response table title
softlayer/softlayer-python,allmightyspiff/softlayer-python
SoftLayer/CLI/autoscale/scale.py
SoftLayer/CLI/autoscale/scale.py
"""Scales an Autoscale group""" # :license: MIT, see LICENSE for more details. import click from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.managers.autoscale import AutoScaleManager from SoftLayer import utils @click.command() @click.argument('identifier') @click.option('-...
"""Scales an Autoscale group""" # :license: MIT, see LICENSE for more details. import click from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.managers.autoscale import AutoScaleManager from SoftLayer import utils @click.command() @click.argument('identifier') @click.option('-...
mit
Python
8c6386547380eb0a58110ae3e7ef1550627d92c8
Fix #1, non OS dependant speech
SlapBot/stephanie-va
Stephanie/TextManager/speaker.py
Stephanie/TextManager/speaker.py
import os import eyed3 import time from pygame import mixer class Speaker: def __init__(self): self.speak_result = "" self.audio_file = None def speak_from_os(self, speech_result_filename): try: self.speak_result = self.get_abs_filename(speech_result_filename) ...
import os import eyed3 import time from pygame import mixer class Speaker: def __init__(self): self.speak_result = "" self.audio_file = None def speak_from_os(self, speech_result_filename): try: self.speak_result = self.get_abs_filename(speech_result_filename) ...
mit
Python
de98d66f8716b8c71c110f2f57cd3c140cc6d984
Set version to v2.2.2
honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,explosion/spaCy
spacy/about.py
spacy/about.py
# fmt: off __title__ = "spacy" __version__ = "2.2.2" __release__ = True __download_url__ = "https://github.com/explosion/spacy-models/releases/download" __compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json" __shortcuts__ = "https://raw.githubusercontent.com/explosion/s...
# fmt: off __title__ = "spacy" __version__ = "2.2.2.dev5" __release__ = True __download_url__ = "https://github.com/explosion/spacy-models/releases/download" __compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json" __shortcuts__ = "https://raw.githubusercontent.com/explos...
mit
Python
d40049cb81cc83ef69301104065228c62597d666
Update test.py
ggcoke/stocks
com/ggcoke/stocks/test.py
com/ggcoke/stocks/test.py
#! /usr/bin/python # -*- coding: utf-8 -*- __author__ = 'ggcoke' import wmcloud_helper HOST = 'api.wmcloud.com' PORT = 9763 TOKEN = 'token' if __name__ == '__main__': params = {'field': None, 'ticker': '000001', 'secID': None, 'callback': None} path = wmcloud_helpe...
#! /usr/bin/python # -*- coding: utf-8 -*- __author__ = 'ggcoke' import wmcloud_helper HOST = 'api.wmcloud.com' PORT = 9763 TOKEN = 'bc486a2662eb4a2e4d19a0f15abfbddc' if __name__ == '__main__': params = {'field': None, 'ticker': '000001', 'secID': None, 'callback': Non...
apache-2.0
Python
9f23f6a5d40c7aeec1f4759c0837feb46f90b4ea
更新 modules Groups 中的 apps.py, 新增函式功能宣告註解
yrchen/CommonRepo,yrchen/CommonRepo,yrchen/CommonRepo,yrchen/CommonRepo
commonrepo/groups/apps.py
commonrepo/groups/apps.py
# -*- coding: utf-8 -*- # # Copyright 2016 edX PDR Lab, National Central University, Taiwan. # # http://edxpdrlab.ncu.cc/ # # 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://w...
# -*- coding: utf-8 -*- # # Copyright 2016 edX PDR Lab, National Central University, Taiwan. # # http://edxpdrlab.ncu.cc/ # # 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://w...
apache-2.0
Python
cc412d23662b023357b40539edb481832d9e3a2d
change VERSION to 0.2 beta
pglotov/django-rest-framework-gis,illing2005/django-rest-framework-gis,nmandery/django-rest-framework-gis,arjenvrielink/django-rest-framework-gis,nmandery/django-rest-framework-gis,sh4wn/django-rest-framework-gis,barseghyanartur/django-rest-framework-gis,manhg/django-rest-framework-gis,bopo/django-rest-framework-gis,dj...
rest_framework_gis/__init__.py
rest_framework_gis/__init__.py
VERSION = (0, 2, 0, 'beta') __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, 1, 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
2d71fb157bf53dfde30af5f352656b6de68cba13
Fix for better test.
charanpald/APGL
exp/sandbox/test/RandomisedSVDTest.py
exp/sandbox/test/RandomisedSVDTest.py
import unittest import numpy import scipy.sparse from exp.sandbox.RandomisedSVD import RandomisedSVD from apgl.util.Util import Util import numpy.testing as nptst class RandomisedSVDTest(unittest.TestCase): def setUp(self): numpy.random.rand(21) numpy.set_printoptions(suppress=True, linewidth...
import unittest import numpy import scipy.sparse from exp.sandbox.RandomisedSVD import RandomisedSVD from apgl.util.Util import Util import numpy.testing as nptst class RandomisedSVDTest(unittest.TestCase): def setUp(self): numpy.random.rand(21) numpy.set_printoptions(suppress=True, linewidth...
bsd-3-clause
Python
9bfcc3f837df2b9342dfb4d7f3616ca4d9401969
add unfolding of symlink into a directory of symlinks
arecarn/dploy
dploy/__init__.py
dploy/__init__.py
""" dploy script is an attempt at creating a clone of GNU stow that will work on Windows as well as *nix """ import sys assert sys.version_info >= (3, 4), 'Requires Python 3.4 or Greater' import os import pathlib from dploy.util import resolve_abs_path def dploy(source, dest): """ main script entry point ...
""" dploy script """ import sys assert sys.version_info >= (3, 4), 'Requires Python 3.4 or Greater' import os import pathlib from dploy.util import resolve_abs_path def dploy(source, dest): """ main script entry point """ source_absolute = resolve_abs_path(source) dest_absolute = resolve_abs_pat...
mit
Python
67e41dadd80d5ac9dc419d4883906ce505bffa17
Add interface
pySTEPS/pysteps
nowcasts/interface.py
nowcasts/interface.py
from . import simple_advection from . import steps def get_method(name): """Return one callable function to produce deterministic or ensemble precipitation nowcasts.\n\ Methods for precipitation nowcasting: +-------------------+-------------------------------------------------------+ | N...
def get_method(): """""" pass
bsd-3-clause
Python
52e51af4b9aaa274ef727ce428f129d042dfc595
Complete delete_min() and its helper functions
bowen0701/algorithms_data_structures
ds_binary_heap.py
ds_binary_heap.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function class BinaryHeap(object): def __init__(self): # Put single zero as the 1st element, so that # integer division can be used in later methods. self.heap_ls = [0] self.current_...
from __future__ import absolute_import from __future__ import division from __future__ import print_function class BinaryHeap(object): def __init__(self): # Put single zero as the 1st element, so that # integer division can be used in later methods. self.heap_ls = [0] self.current_...
bsd-2-clause
Python
411672c069638c9d6dd5b3aab7dfcc23894f7ae1
Update the pic build flag used for Sun CC
hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR
waflib/Tools/suncc.py
waflib/Tools/suncc.py
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) # Ralf Habacker, 2006 (rh) from waflib import Utils from waflib.Tools import ccroot, ar from waflib.Configure import conf @conf def find_scc(conf): """ Detect the Sun C compiler """ v = conf.env cc = conf.find_program('cc', var='CC') try: ...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) # Ralf Habacker, 2006 (rh) from waflib import Utils from waflib.Tools import ccroot, ar from waflib.Configure import conf @conf def find_scc(conf): """ Detect the Sun C compiler """ v = conf.env cc = conf.find_program('cc', var='CC') try: ...
agpl-3.0
Python
44520918dc0fad40f3afcfc2cdfde6f3208543cd
Use wiringPiSetupGpio, which required root. With wiringPiSetupSys some gpios stayed on low after boot.
ammannbros/garden-lighting,ammannbros/garden-lighting,ammannbros/garden-lighting,ammannbros/garden-lighting
garden_lighting/MCP23017/raspberry.py
garden_lighting/MCP23017/raspberry.py
import time import wiringpi from garden_lighting.MCP23017.MCP23017 import MCP23017 class RaspberryMCP23017(MCP23017): def __init__(self, dev_addr, rst_pin=0xFF, i2cport=1): super().__init__(dev_addr, rst_pin, i2cport) def initDevice(self): ''' Does a reset to put all registers in init...
import time import os import wiringpi from garden_lighting.MCP23017.MCP23017 import MCP23017 class RaspberryMCP23017(MCP23017): def __init__(self, dev_addr, rst_pin=0xFF, i2cport=1): super().__init__(dev_addr, rst_pin, i2cport) def initDevice(self): ''' Does a reset to put all registe...
mit
Python
8b6aafdac18e4a8b2e929619d8f668edb01ad1aa
fix typo in participant gender enum
NCI-GDC/gdcdatamodel,NCI-GDC/gdcdatamodel
gdcdatamodel/models/nodes/clinical.py
gdcdatamodel/models/nodes/clinical.py
from psqlgraph import Node, pg_property class Clinical(Node): __nonnull_properties__ = [] @pg_property(str, enum=['male', 'female']) def gender(self, value): self._set_property('gender', value) @pg_property(str, enum=[ 'not reported', 'white', 'american indian or ala...
from psqlgraph import Node, pg_property class Clinical(Node): __nonnull_properties__ = [] @pg_property(str, enum=['male', 'femle']) def gender(self, value): self._set_property('gender', value) @pg_property(str, enum=[ 'not reported', 'white', 'american indian or alas...
apache-2.0
Python
c1d60b3930d9a85c5d41d3bacc81316b2865c3a2
bump version
ickc/pantable
pantable/version.py
pantable/version.py
__version__ = '0.0.8'
__version__ = '0.0.7'
bsd-3-clause
Python
f201fc9efd56c78d37432402501fed47992553df
Remove unused imports
vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks
backend/globaleaks/tests/handlers/test_custodian.py
backend/globaleaks/tests/handlers/test_custodian.py
# -*- coding: utf-8 -*- import unittest from twisted.internet.defer import inlineCallbacks from globaleaks.tests import helpers from globaleaks.handlers import custodian class TestIdentityAccessRequestInstance(helpers.TestHandlerWithPopulatedDB): _handler = custodian.CustodianIdentityAccessRequestInstance @...
# -*- coding: utf-8 -*- import unittest import random from twisted.internet.defer import inlineCallbacks from globaleaks.tests import helpers from globaleaks.handlers import custodian from globaleaks.rest import errors class TestIdentityAccessRequestInstance(helpers.TestHandlerWithPopulatedDB): _handler = custod...
agpl-3.0
Python
13b613a76e409d352f866dd6de8c199ad8772c2f
Add 5-min timeout
xiao-chen/dist_test,cloudera/dist_test,umbrant/dist_test,xiao-chen/dist_test,cloudera/dist_test,umbrant/dist_test,umbrant/dist_test,umbrant/dist_test,cloudera/dist_test,xiao-chen/dist_test,cloudera/dist_test,xiao-chen/dist_test
parse_for_submit.py
parse_for_submit.py
#!/usr/bin/python import json import sys if len(sys.argv) != 3: print sys.argv[0], "<json file with hashes> <output json file>" sys.exit(1) outmap = { "tasks": [ {"isolate_hash": "fa0fee63c6d4e540802d22464789c21de12ee8f5", "description": "andrew test task"} ] } tasks = [] inmap = j...
#!/usr/bin/python import json import sys if len(sys.argv) != 3: print sys.argv[0], "<json file with hashes> <output json file>" sys.exit(1) outmap = { "tasks": [ {"isolate_hash": "fa0fee63c6d4e540802d22464789c21de12ee8f5", "description": "andrew test task"} ] } tasks = [] inmap = j...
apache-2.0
Python
643f4d8e178e35337381f5afbb3c926be153743a
remove x-based matplotlib rendering
mahnen/gamma_limits_sensitivity
gamma_limits_sensitivity/tests/test_high_level_api.py
gamma_limits_sensitivity/tests/test_high_level_api.py
''' The reader of the paper just saw there is a github repo she installs it with pip install github.com/mahnen/gamma_limits_sensitivity then she finds the callable in her path named also gamma_limits_sensitivity, as stated in the README and wants to try it on an upper limit calculation she calls it as explained: ...
''' The reader of the paper just saw there is a github repo she installs it with pip install github.com/mahnen/gamma_limits_sensitivity then she finds the callable in her path named also gamma_limits_sensitivity, as stated in the README and wants to try it on an upper limit calculation she calls it as explained: ...
mit
Python
cc271c69d2bbc96298b3e914fee3ff46c08e161b
add logger
avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf
src/python/expedient/common/backends/remoteuser.py
src/python/expedient/common/backends/remoteuser.py
''' Created on Jun 15, 2010 @author: jnaous ''' from django.contrib.auth.backends import RemoteUserBackend import logging logger = logging.getLogger("backends.remoteuser") class NoCreateRemoteUserBackend(RemoteUserBackend): """ Extends the RemoteUserBackend by simply setting C{create_unknown_user} to Fal...
''' Created on Jun 15, 2010 @author: jnaous ''' from django.contrib.auth.backends import RemoteUserBackend class NoCreateRemoteUserBackend(RemoteUserBackend): """ Extends the RemoteUserBackend by simply setting C{create_unknown_user} to False instead of the default True, so that unknown users are not crea...
bsd-3-clause
Python
f30a923b881e908fa607e276de1d152d803248f1
Update main to run a profiler
toofishes/python-pgpdump
pgpdump/__main__.py
pgpdump/__main__.py
import sys import cProfile from . import AsciiData, BinaryData def parsefile(name): with open(name) as infile: if name.endswith('.asc'): data = AsciiData(infile.read()) else: data = BinaryData(infile.read()) counter = 0 for packet in data.packets(): counter ...
import sys from . import BinaryData for filename in sys.argv[1:]: with open(filename) as infile: data = BinaryData(infile.read()) for packet in data.packets(): print hex(packet.key_id), packet.creation_date
bsd-3-clause
Python
f4fcf5abee232afb8419ddb43c4662006ad76232
Remove unused import from brain.py
ratchetrobotics/espresso
espresso/brain.py
espresso/brain.py
from tinydb import TinyDB class Brain(object): def __init__(self, db_location): self.db = TinyDB(db_location)
from tinydb import TinyDB from tinydb import where class Brain(object): def __init__(self, db_location): self.db = TinyDB(db_location)
bsd-3-clause
Python
31ea71b07f49df05a646684bb540730da89929db
add 04_division.py
jerodg/hackerrank-python
01_Introduction/04_division.py
01_Introduction/04_division.py
#!/usr/bin/python3.6 """Jerod Gawne, 2017-04-19 Division https://www.hackerrank.com/challenges/python-division/ Editorial a = int(input()) b = int(input()) print(a // b) print(a / b) """ def main(): """ Main-Logic """ a, b = int(input()), int(input()) print((a // b), (a / b), sep='\n') if ...
#!/usr/bin/python3.6 """ Jerod Gawne, 2017-04-19 Division https://www.hackerrank.com/challenges/python-division/ """ def main(): """ Main-Logic """ a = int(input()) b = int(input()) if b != 0: print(a//b) print(a/b) if __name__ == '__main__': try: main() exc...
mit
Python
7cdc7879cc2f9d23f62975d2ede50311db94f501
read MapPackage
c3nav/c3nav,c3nav/c3nav,c3nav/c3nav,c3nav/c3nav
src/c3nav/mapdata/utils/cache/package.py
src/c3nav/mapdata/utils/cache/package.py
import os import struct from collections import namedtuple from io import BytesIO from tarfile import TarFile, TarInfo from c3nav.mapdata.utils.cache import AccessRestrictionAffected, GeometryIndexed, MapHistory CachePackageLevel = namedtuple('CachePackageLevel', ('history', 'restrictions')) class CachePackage: ...
import os import struct from collections import namedtuple from io import BytesIO from tarfile import TarFile, TarInfo from c3nav.mapdata.utils.cache import AccessRestrictionAffected, GeometryIndexed, MapHistory CachePackageLevel = namedtuple('CachePackageLevel', ('history', 'restrictions')) class CachePackage: ...
apache-2.0
Python
14d2d5f2f6c97ccf75373702dd42a335aa0a8063
Allow dots in usernames
pinry/pinry,lapo-luchini/pinry,pinry/pinry,lapo-luchini/pinry,pinry/pinry,lapo-luchini/pinry,lapo-luchini/pinry,pinry/pinry
users/forms.py
users/forms.py
from django import forms from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User class UserCreationForm(forms.ModelForm): """ A form that creates a user, with no privileges, from the given username, email, and password. """ error_messages = { 'du...
from django import forms from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User class UserCreationForm(forms.ModelForm): """ A form that creates a user, with no privileges, from the given username, email, and password. """ error_messages = { 'du...
bsd-2-clause
Python
de875418621c1d604507fbd095cf666ee5cac742
Bump version
matrix-org/synapse,TribeMedia/synapse,matrix-org/synapse,iot-factory/synapse,TribeMedia/synapse,rzr/synapse,howethomas/synapse,iot-factory/synapse,iot-factory/synapse,TribeMedia/synapse,iot-factory/synapse,iot-factory/synapse,matrix-org/synapse,illicitonion/synapse,howethomas/synapse,matrix-org/synapse,illicitonion/syn...
synapse/__init__.py
synapse/__init__.py
# -*- coding: utf-8 -*- # Copyright 2014, 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 applica...
# -*- coding: utf-8 -*- # Copyright 2014, 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 applica...
apache-2.0
Python
fd2070a483cbec1c93bf815130216b97b3ca023b
Improve URL validator
jmagnusson/wtforms,cklein/wtforms,Xender/wtforms,Aaron1992/wtforms,skytreader/wtforms,subyraman/wtforms,crast/wtforms,wtforms/wtforms,pawl/wtforms,pawl/wtforms,hsum/wtforms,Aaron1992/wtforms
wtforms/validators.py
wtforms/validators.py
""" wtforms.validators ~~~~~~~~~~~~~~~~~~ TODO :copyright: 2007-2008 by James Crasta, Thomas Johansson. :license: MIT, see LICENSE.txt for details. """ import re class ValidationError(ValueError): pass def email(form, field): if not re.match(r'^.+@[^.].+\.[a-z]{2,4}$', field.data...
""" wtforms.validators ~~~~~~~~~~~~~~~~~~ TODO :copyright: 2007-2008 by James Crasta, Thomas Johansson. :license: MIT, see LICENSE.txt for details. """ import re class ValidationError(ValueError): pass def email(form, field): if not re.match(r'^.+@[^.].+\.[a-z]{2,4}$', field.data...
bsd-3-clause
Python
bbe4391154f989140cd8b3252c63bc7f1bbd232b
Disable screenshot_sync_tests on Mac. For real, this time.
PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,markYoungH/chromium.src,M4sse/chromium.src,Just-D/chromium-1,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,Fireblend/chromium...
content/test/gpu/gpu_tests/screenshot_sync.py
content/test/gpu/gpu_tests/screenshot_sync.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import screenshot_sync_expectations as expectations from telemetry import test from telemetry.core import util from telemetry.page import page fro...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import screenshot_sync_expectations as expectations from telemetry import test from telemetry.core import util from telemetry.page import page fro...
bsd-3-clause
Python
400c463097d9454a2d3780f2266186d97b2fa7fc
Create __init__.py
dfm/python-finufft,dfm/python-finufft,dfm/python-finufft
finufft/__init__.py
finufft/__init__.py
# -*- coding: utf-8 -*- # # Copyright 2017 Daniel Foreman-Mackey # # 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 appli...
# -*- coding: utf-8 -*- __version__ = "0.0.1.dev0" try: __FINUFFT_SETUP__ except NameError: __FINUFFT_SETUP__ = False if not __FINUFFT_SETUP__: __all__ = ["nufft1d1", "nufft1d2", "nufft1d3"] from .interface import ( nufft1d1, nufft1d2, nufft1d3, )
apache-2.0
Python
b7d65281f83642a5b2563f48a1668fe869529c0b
comment out Sefton election id
DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations
polling_stations/apps/data_collection/management/commands/import_sefton.py
polling_stations/apps/data_collection/management/commands/import_sefton.py
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = 'E08000014' addresses_name = 'Democracy_Club__04May2017 Sefton.tsv' stations_name = 'Democracy_Club__04May2017 Sefton.tsv' elections = [ 'mayor.live...
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = 'E08000014' addresses_name = 'Democracy_Club__04May2017 Sefton.tsv' stations_name = 'Democracy_Club__04May2017 Sefton.tsv' elections = [ 'mayor.live...
bsd-3-clause
Python
c702a996436988550f6aaef606be6371db17a136
split context factory into two classes, a new one when opennsa just performs https requests
NORDUnet/opennsa,jab1982/opennsa,NORDUnet/opennsa,jab1982/opennsa,NORDUnet/opennsa
opennsa/ctxfactory.py
opennsa/ctxfactory.py
""" SSL/TLS context definition. Most of this code is borrowed from the SGAS 3.X LUTS codebase. NORDUnet holds the copyright for SGAS 3.X LUTS and OpenNSA. """ import os from OpenSSL import SSL class RequestContextFactory(object): """ Context Factory for issuing requests to SSL/TLS services without having ...
""" SSL/TLS context definition. Most of this code is borrowed from the SGAS 3.X LUTS codebase. NORDUnet holds the copyright for SGAS 3.X LUTS and OpenNSA. """ import os from OpenSSL import SSL class ContextFactory: def __init__(self, private_key_path, public_key_path, certificate_dir, verify=True): ...
bsd-3-clause
Python
2822df8d958c5497e155843585773d043a7c9b61
Prepare v3.3.19.dev
Flexget/Flexget,Flexget/Flexget,Flexget/Flexget,Flexget/Flexget
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
f10c641074674474ea87bd45e70170e8c4f6ae1f
Prepare v2.0.51.dev
poulpito/Flexget,jacobmetrick/Flexget,sean797/Flexget,OmgOhnoes/Flexget,gazpachoking/Flexget,Danfocus/Flexget,crawln45/Flexget,tobinjt/Flexget,malkavi/Flexget,qk4l/Flexget,qk4l/Flexget,LynxyssCZ/Flexget,tobinjt/Flexget,tobinjt/Flexget,dsemi/Flexget,ianstalk/Flexget,malkavi/Flexget,jacobmetrick/Flexget,oxc/Flexget,Joris...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
ec1b26a0fa246cc1c89dff3a2cb710c561aac2b6
Prepare v1.2.476.dev
tobinjt/Flexget,drwyrm/Flexget,jacobmetrick/Flexget,ianstalk/Flexget,tobinjt/Flexget,jawilson/Flexget,LynxyssCZ/Flexget,malkavi/Flexget,poulpito/Flexget,poulpito/Flexget,qvazzler/Flexget,poulpito/Flexget,dsemi/Flexget,LynxyssCZ/Flexget,Flexget/Flexget,sean797/Flexget,malkavi/Flexget,crawln45/Flexget,antivirtel/Flexget,...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
782c3ebbf0c0028bc212678169accce2e61d572d
Prepare v1.2.493.dev
OmgOhnoes/Flexget,JorisDeRieck/Flexget,qvazzler/Flexget,oxc/Flexget,Flexget/Flexget,Flexget/Flexget,qk4l/Flexget,drwyrm/Flexget,tarzasai/Flexget,antivirtel/Flexget,Flexget/Flexget,crawln45/Flexget,tarzasai/Flexget,jawilson/Flexget,tobinjt/Flexget,drwyrm/Flexget,jacobmetrick/Flexget,tarzasai/Flexget,gazpachoking/Flexget...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
e75ea01cdcbc283f26799fd8a9690b8fa28f2fe1
Fix linter issues
juju/python-libjuju,juju/python-libjuju
juju/charmhub.py
juju/charmhub.py
from .client import client from .errors import JujuError class CharmHub: def __init__(self, model): self.model = model async def info(self, name, channel=None): """info displays detailed information about a CharmHub charm. The charm can be specified by the exact name. Channel...
from .client import client from .errors import JujuError class CharmHub: def __init__(self, model): self.model = model async def info(self, name, channel=None): """info displays detailed information about a CharmHub charm. The charm can be specified by the exact name. Channel...
apache-2.0
Python
fddc7e09bcebf9b4875906ad03e58699237b13be
Enable filtering OpenStack package by tenant.
opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind
src/nodeconductor_assembly_waldur/packages/filters.py
src/nodeconductor_assembly_waldur/packages/filters.py
import django_filters from nodeconductor.core.filters import UUIDFilter from . import models class PackageTemplateFilter(django_filters.FilterSet): name = django_filters.CharFilter(lookup_type='icontains') settings_uuid = UUIDFilter(name='service_settings__uuid') class Meta(object): model = mod...
import django_filters from nodeconductor.core.filters import UUIDFilter from . import models class PackageTemplateFilter(django_filters.FilterSet): name = django_filters.CharFilter(lookup_type='icontains') settings_uuid = UUIDFilter(name='service_settings__uuid') class Meta(object): model = mod...
mit
Python
f5d4f543cc7265433bf6040335b2f6d592b52b91
Add import os in lmod to fix regression
cmd-ntrf/jupyter-lmod,cmd-ntrf/jupyter-lmod,cmd-ntrf/jupyter-lmod
lmod/__init__.py
lmod/__init__.py
import os # require by lmod output evaluated by exec() from functools import partial from os import environ from subprocess import Popen, PIPE LMOD_SYSTEM_NAME = environ.get('LMOD_SYSTEM_NAME', '') def module(command, *args): cmd = (environ['LMOD_CMD'], 'python', '--terse', command) result = Popen(cmd + arg...
from functools import partial from os import environ from subprocess import Popen, PIPE LMOD_SYSTEM_NAME = environ.get('LMOD_SYSTEM_NAME', '') def module(command, *args): cmd = (environ['LMOD_CMD'], 'python', '--terse', command) result = Popen(cmd + args, stdout=PIPE, stderr=PIPE) if command in ('load', ...
mit
Python
6aadb1eae7d0a69556fb84a7404d59edd416d55c
Add logout confirmation message
Kromey/fbxnano,Kromey/fbxnano,Kromey/akwriters,Kromey/fbxnano,Kromey/fbxnano,Kromey/akwriters,Kromey/akwriters,Kromey/akwriters
passwordless/views.py
passwordless/views.py
from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth import authenticate,login,logout from django.contrib import messages from django.shortcuts import render,redirect from django.views import View from django.views.generic.edit import FormView from . import forms from . import models # Crea...
from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth import authenticate,login,logout from django.contrib import messages from django.shortcuts import render,redirect from django.views import View from django.views.generic.edit import FormView from . import forms from . import models # Crea...
mit
Python
8c5935a369190d5e712f7337c72d898caef4cee2
Fix value error when unpacking betclic lines that have no odds
dmartin35/pronosfoot,dmartin35/pronosfoot,dmartin35/pronosfoot
external/odds/betclic/api.py
external/odds/betclic/api.py
import bs4 import requests from collections import namedtuple from memoize import memoize import contextlib from external.odds.betclic import TEAM_MAP from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) BETCLIC_L1_URL = 'https://ww...
import bs4 import requests from collections import namedtuple from memoize import memoize import contextlib from external.odds.betclic import TEAM_MAP from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) BETCLIC_L1_URL = 'https://ww...
mit
Python
c3e9be243f1da9c253302ee4eb8549d8d1b00f69
Update __init__.py
h2non/filetype.py
filetype/__init__.py
filetype/__init__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from .filetype import * # noqa from .helpers import * # noqa from .match import * # noqa # Current package semver version __version__ = version = '1.2.0'
# -*- coding: utf-8 -*- from __future__ import absolute_import from .filetype import * # noqa from .helpers import * # noqa from .match import * # noqa # Current package semver version __version__ = version = '1.1.0'
mit
Python
4794e23607ff0fb18353270e3e5f7090c331a90c
Fix missing import
JustinShenk/party-pi,JustinShenk/party-pi,JustinShenk/party-pi
partypi/utils/tweeter.py
partypi/utils/tweeter.py
import os import tweepy def twitter_api(): consumer_key = None consumer_secret = None access_token = None access_token_secret = None try: from credentials import ( consumer_key, consumer_secret, access_token, access_token_secret ) except: ...
import tweepy def twitter_api(): consumer_key = None consumer_secret = None access_token = None access_token_secret = None try: from credentials import ( consumer_key, consumer_secret, access_token, access_token_secret ) except: try: ...
mit
Python
5d7f2f84600abcede94a0aaee087ef299cf740a6
Add filter on the town field on the Farmer model
tm-kn/farmers-api
farmers_api/farmers/views.py
farmers_api/farmers/views.py
from rest_framework import viewsets from .models import Farmer from .serializers import FarmerSerializer class FarmerViewSet(viewsets.ReadOnlyModelViewSet): queryset = Farmer.objects.all() serializer_class = FarmerSerializer filter_fields = ('town',)
from rest_framework import viewsets from .models import Farmer from .serializers import FarmerSerializer class FarmerViewSet(viewsets.ReadOnlyModelViewSet): queryset = Farmer.objects.all() serializer_class = FarmerSerializer
bsd-2-clause
Python
833ed3352c2e40923c167ddb41edba17db292bb7
Allow mongo returner to update a password protected mongo database.
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/returners/mongo_return.py
salt/returners/mongo_return.py
''' Return data to a mongodb server This is the default interface for returning data for the butter statd subsytem ''' import logging import pymongo log = logging.getLogger(__name__) __opts__ = { 'mongo.host': 'salt', 'mongo.port': 27017, 'mongo.db': 'salt', 'mongo.us...
''' Return data to a mongodb server This is the default interface for returning data for the butter statd subsytem ''' import logging import pymongo log = logging.getLogger(__name__) __opts__ = { 'mongo.host': 'salt', 'mongo.port': 27017, 'mongo.db': 'salt', } def ret...
apache-2.0
Python
4fbac792b89102caa5414db18d1ec39d1ef75a98
Fix One-eyed Cheat
NightKev/fireplace,butozerca/fireplace,Meerkov/fireplace,smallnamespace/fireplace,Ragowit/fireplace,amw2104/fireplace,amw2104/fireplace,liujimj/fireplace,butozerca/fireplace,smallnamespace/fireplace,oftc-ftw/fireplace,liujimj/fireplace,beheh/fireplace,oftc-ftw/fireplace,jleclanche/fireplace,Ragowit/fireplace,Meerkov/fi...
fireplace/cards/gvg/rogue.py
fireplace/cards/gvg/rogue.py
from ..utils import * ## # Minions # Goblin Auto-Barber class GVG_023: action = buffWeapon("GVG_023a") # One-eyed Cheat class GVG_025: def OWN_MINION_SUMMON(self, minion): if minion.race == Race.PIRATE and minion != self: self.stealth = True # Iron Sensei class GVG_027: def OWN_TURN_END(self): mechs = ...
from ..utils import * ## # Minions # Goblin Auto-Barber class GVG_023: action = buffWeapon("GVG_023a") # One-eyed Cheat class GVG_025: def OWN_MINION_SUMMON(self, player, minion): if minion.race == Race.PIRATE and minion != self: self.stealth = True # Iron Sensei class GVG_027: def OWN_TURN_END(self): ...
agpl-3.0
Python
7837ef57c5dcdddc16ad353fa0c992c4403e22dd
change default model for compilation
BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH
Utils/py/BallDetection/RegressionNetwork/devil_code_generator1/compile.py
Utils/py/BallDetection/RegressionNetwork/devil_code_generator1/compile.py
#!/usr/bin/env python3 import argparse import pickle from pathlib import Path from tensorflow.keras.models import load_model from onbcg import keras_compile # can throw linter warnings, but python3 can handle imports like that DATA_DIR = Path(Path(__file__).parent.parent.absolute() / "data").resolve() CPP_DIR = P...
#!/usr/bin/env python3 import argparse import pickle from pathlib import Path from tensorflow.keras.models import load_model from onbcg import keras_compile # can throw linter warnings, but python3 can handle imports like that DATA_DIR = Path(Path(__file__).parent.parent.absolute() / "data").resolve() CPP_DIR = P...
apache-2.0
Python
d8046ebe1974778149bb37ca710df63a1116c115
Bump prerelease (4.0.1-a1) [ci skip]
mar10/pyftpsync
ftpsync/__init__.py
ftpsync/__init__.py
# -*- coding: utf-8 -*- # Make version accessible as 'ftpsync.__version__' # from ftpsync._version import __version__ """ Package version number. See https://www.python.org/dev/peps/pep-0440 Examples Pre-releases (alpha, beta, release candidate): '3.0.0a1', '3.0.0b1', '3.0.0rc1' Final release: ...
# -*- coding: utf-8 -*- # Make version accessible as 'ftpsync.__version__' # from ftpsync._version import __version__ """ Package version number. See https://www.python.org/dev/peps/pep-0440 Examples Pre-releases (alpha, beta, release candidate): '3.0.0a1', '3.0.0b1', '3.0.0rc1' Final release: ...
mit
Python
d4e03bfcbc6292d3a50237f95c9d67ba5d89a475
Use usubscribe rather than popping the broadcaster
sahlinet/swampdragon,boris-savic/swampdragon,michael-k/swampdragon,denizs/swampdragon,aexeagmbh/swampdragon,jonashagstedt/swampdragon,jonashagstedt/swampdragon,d9pouces/swampdragon,boris-savic/swampdragon,sahlinet/swampdragon,aexeagmbh/swampdragon,jonashagstedt/swampdragon,bastianh/swampdragon,boris-savic/swampdragon,m...
swampdragon/pubsub_providers/redis_sub_provider.py
swampdragon/pubsub_providers/redis_sub_provider.py
import json import tornadoredis.pubsub import tornadoredis from .base_provider import BaseProvider class RedisSubProvider(BaseProvider): def __init__(self): self._subscriber = tornadoredis.pubsub.SockJSSubscriber(tornadoredis.Client()) def close(self, broadcaster): for channel in self._subscr...
import json import tornadoredis.pubsub import tornadoredis from .base_provider import BaseProvider class RedisSubProvider(BaseProvider): def __init__(self): self._subscriber = tornadoredis.pubsub.SockJSSubscriber(tornadoredis.Client()) def close(self, broadcaster): for channel in self._subscr...
bsd-3-clause
Python
003089545b47e3fea262d334af94d9e592ec6852
update overall styles
praekelt/molo-gem,praekelt/molo-gem,praekelt/molo-gem
gem/settings/dev.py
gem/settings/dev.py
from .base import * # noqa ALLOWED_HOSTS = [ 'localhost', '.localhost', '127.0.0.1' ] DEBUG = True EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' try: from .local import * # noqa except ImportError: pass try: from secrets import * # noqa except ImportError: pass ...
from .base import * # noqa ALLOWED_HOSTS = [ 'localhost', '.localhost', '127.0.0.1', '172.30.1.238' ] DEBUG = True EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' try: from .local import * # noqa except ImportError: pass try: from secrets import * # noqa except Imp...
bsd-2-clause
Python
22761fa04ca2a93a2c11103fb8f8fca3a51c8626
Call .save() on database model tests to trigger any DB-level constraints
OSSystems/lava-server,Linaro/lava-server,Linaro/lava-server,Linaro/lava-server,OSSystems/lava-server,Linaro/lava-server,OSSystems/lava-server
launch_control/dashboard_app/tests.py
launch_control/dashboard_app/tests.py
""" Unit tests of the Dashboard application """ from django.contrib.contenttypes import generic from django.db import IntegrityError from django.test import TestCase from launch_control.utils.call_helper import ObjectFactoryMixIn from launch_control.dashboard_app.models import ( HardwareDevice, Softwa...
""" Unit tests of the Dashboard application """ from django.contrib.contenttypes import generic from django.db import IntegrityError from django.test import TestCase from launch_control.utils.call_helper import ObjectFactoryMixIn from launch_control.dashboard_app.models import ( HardwareDevice, Softwa...
agpl-3.0
Python
bea5ea8c4bc2b4342adb199d6b7e9012476030a2
implement multimethod for backup backend
cmpitg/mongob
src/backend.py
src/backend.py
import os import gzip from multipledispatch import dispatch from bson.json_util import loads as json_loads from bson.json_util import dumps as json_dumps from pymongo.mongo_client import MongoClient from pymongo.database import Database from pymongo.collection import Collection from io import TextIOBase #####...
from multipledispatch import dispatch from pymongo.mongo_client import MongoClient from io import TextIOBase @dispatch(TextIOBase) def close(f): ############################################################################## def get_db(uri, connections): """ Retrieves database from connection string. The co...
mit
Python
71c63587d86c627434f5683ec1496376fa0e3dde
Fix typo
bfelbo/deepmoji,bfelbo/DeepMoji
scripts/analyze_all_results.py
scripts/analyze_all_results.py
from __future__ import print_function # allow us to import the codebase/keras directory import sys import glob import numpy as np from os.path import dirname, abspath sys.path.insert(0, dirname(dirname(abspath(__file__)))) DATASETS = ['SE0714', 'Olympic', 'PsychExp', 'SS-Twitter', 'SS-Youtube', 'SCv1', 'S...
from __future__ import print_function # allow us to import the codebase/keras directory import sys import glob import numpy as np from os.path import dirname, abspath sys.path.insert(0, dirname(dirname(abspath(__file__)))) DATASETS = ['SE0714', 'Olympic', 'PsychExp', 'SS-Twitter', 'SS-Youtube', 'SCv1', 'S...
mit
Python