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
0e46b47a3053e63f50d6fd90b1ba810e4694c9be
Implement system configurations load from file.
10nin/blo,10nin/blo
blo/__init__.py
blo/__init__.py
import configparser from blo.BloArticle import BloArticle from blo.DBControl import DBControl class Blo: def __init__(self, config_file_path): config = configparser.ConfigParser() config.read(config_file_path) self.template_dir = config['TEMPLATE']['TEMPLATE_DIR'] self.db_file_path...
from blo.BloArticle import BloArticle from blo.DBControl import DBControl class Blo: def __init__(self, db_file_path, template_dir=""): self.template_dir = template_dir # create tables self.db_file_path = db_file_path self.db_control = DBControl(self.db_file_path) self.db_c...
mit
Python
5576ad27979a4143c2194e1ba2ab47a007e42ea9
update utils/add_articles.py
longjj/BeeBlog,longjj/BeeBlog
utils/add_articles.py
utils/add_articles.py
#!usr/bin/python3 """ This module is used to assist me to add articles faster. """ import os import yaml import datetime import shutil def modification_date(filename): t = os.path.getmtime(filename) return datetime.datetime.fromtimestamp(t) def add_config(postname): target_path = '../articles/config' ...
#!usr/bin/python3 """ This module is used to assist me to add articles faster. """ import os import yaml import datetime import shutil def modification_date(filename): t = os.path.getmtime(filename) return datetime.datetime.fromtimestamp(t) def add_config(postname): target_path = '../articles/config' ...
mit
Python
d15d9c49183af21f020750475427c51e611ade4a
check if there is a token
okfn-brasil/viralata,okfn-brasil/viralata,okfn-brasil/viralata,okfn-brasil/viralata
viralata/utils.py
viralata/utils.py
#!/usr/bin/env python # coding: utf-8 def decode_validate_token(token, sv, api): """This tries to be a general function to decode and validade any token. Receives a token, a SignerVerifier and an API. """ if not token: api.abort(400, "Error: No token received!") try: decoded = sv.d...
#!/usr/bin/env python # coding: utf-8 def decode_validate_token(token, sv, api): """This tries to be a general function to decode and validade any token. Receives a token, a SignerVerifier and an API. """ try: decoded = sv.decode(token) # options={"verify_exp": False}) except sv.Ex...
agpl-3.0
Python
87ebf8c9c096939e52f35f0b717add165d2288ad
Add query caching for nhmmer
RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode
rnacentral/nhmmer/models.py
rnacentral/nhmmer/models.py
""" Copyright [2009-2014] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
""" Copyright [2009-2014] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
apache-2.0
Python
e616538202111d823cb23941bd8e0fa0ecb4f052
Read the docs.
morganbengtsson/mos
doc/source/conf.py
doc/source/conf.py
import sys import os import subprocess #Read the docs #read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True' #if read_the_docs_build: # subprocess.call('cd ../; make xml', shell=True) def run_doxygen(folder): """Run the doxygen make command in the designated folder""" try: retcode = s...
import sys import os import subprocess #Read the docs #read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True' #if read_the_docs_build: # subprocess.call('cd ../; make xml', shell=True) def run_doxygen(folder): """Run the doxygen make command in the designated folder""" try: retcode = s...
mit
Python
91d24b3ce272ff166d1e828f0822e7b9a0124d2c
Fix broken tests after moving _autoconvert to autotype
hkbakke/zfssnap,hkbakke/zfssnap
tests/test_dataset.py
tests/test_dataset.py
import pytest from zfssnap import autotype, Host, Dataset import subprocess PROPERTY_PREFIX = 'zfssnap' class TestDataset(object): @pytest.fixture def fs(self): fs_name = 'zpool/dataset' host = Host() return Dataset(host, fs_name) @pytest.fixture def ssh_fs(self): ss...
import pytest from zfssnap import Host, Dataset import subprocess PROPERTY_PREFIX = 'zfssnap' class TestDataset(object): @pytest.fixture def fs(self): fs_name = 'zpool/dataset' host = Host() return Dataset(host, fs_name) @pytest.fixture def ssh_fs(self): ssh_user = '...
mit
Python
ff71d66c2763adf554e07fdd42ae83437eef1f75
Add bna.__version__
Adys/python-bna,jleclanche/python-bna
bna/__init__.py
bna/__init__.py
""" python-bna Battle.net Authenticator routines in Python. Specification can be found here: * <http://bnetauth.freeportal.us/specification.html> Note: Link likely dead. Check webarchive. """ import pkg_resources from .crypto import get_restore_code, get_token from .http import HTTPError, get_time_offset, request_ne...
""" python-bna Battle.net Authenticator routines in Python. Specification can be found here: * <http://bnetauth.freeportal.us/specification.html> Note: Link likely dead. Check webarchive. """ from .crypto import get_restore_code, get_token from .http import get_time_offset, HTTPError, request_new_serial, restore from...
mit
Python
4aae64f59707d0fdedb4bf729655c735f2c751a3
refactor unit test for ensembl service
Proteogenomics/trackhub-creator,Proteogenomics/trackhub-creator
tests/test_ensembl.py
tests/test_ensembl.py
# # Author    : Manuel Bernal Llinares # Project   : trackhub-creator # Timestamp : 03-07-2017 11:51 # --- # © 2017 Manuel Bernal Llinares <mbdebian@gmail.com> # All rights reserved. # """ Unit tests for Ensembl module """ import unittest # App modules import main_app import config_manager import ensembl.service ...
# # Author    : Manuel Bernal Llinares # Project   : trackhub-creator # Timestamp : 03-07-2017 11:51 # --- # © 2017 Manuel Bernal Llinares <mbdebian@gmail.com> # All rights reserved. # """ Unit tests for Ensembl module """ import unittest # App modules import main_app import config_manager from ensembl.service impo...
apache-2.0
Python
bc2395eb473a203d11df52d48968b6ab61e2c95e
Fix keyring issue where there were name space problems
varunarya10/python-openstackclient,openstack/python-openstackclient,openstack/python-openstackclient,BjoernT/python-openstackclient,dtroyer/python-openstackclient,metacloud/python-openstackclient,varunarya10/python-openstackclient,metacloud/python-openstackclient,dtroyer/python-openstackclient,redhat-openstack/python-o...
openstackclient/common/openstackkeyring.py
openstackclient/common/openstackkeyring.py
# Copyright 2011-2013 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
# Copyright 2011-2013 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
Python
ab07caf8c00e8e2047e7c45cde89e8980fde325c
Stop using intersphinx
klmitch/python-glanceclient,alexpilotti/python-glanceclient,varunarya10/python-glanceclient,JioCloud/python-glanceclient,mmasaki/python-glanceclient,klmitch/python-glanceclient,alexpilotti/python-glanceclient,openstack/python-glanceclient,JioCloud/python-glanceclient,mmasaki/python-glanceclient,varunarya10/python-glanc...
doc/source/conf.py
doc/source/conf.py
# -*- coding: utf-8 -*- # import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))) # -- General configuration ---------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions ...
# -*- coding: utf-8 -*- # import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))) # -- General configuration ---------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions ...
apache-2.0
Python
d6b6b789a90a49ca74fb2cf3b2349e5722ba9c5e
Fix conf.py for the ReadTheDocs site
stackforge/fuel-plugin-influxdb-grafana,stackforge/fuel-plugin-influxdb-grafana,stackforge/fuel-plugin-influxdb-grafana,stackforge/fuel-plugin-influxdb-grafana
doc/source/conf.py
doc/source/conf.py
extensions = [] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'The InfluxDB-Grafana plugin for Fuel' copyright = u'2015, Mirantis Inc.' version = '0.9' release = '0.9.0' exclude_patterns = [] pygments_style = 'sphinx' html_theme = 'default' html_static_path = ['_static'] ...
# Always use the default theme for Readthedocs RTD_NEW_THEME = True extensions = [] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'The InfluxDB-Grafana plugin for Fuel' copyright = u'2015, Mirantis Inc.' version = '0.9' release = '0.9.0' exclude_patterns = [] pygments_sty...
apache-2.0
Python
45b4cf15128e0b422a55b905ef936ca24f7cafe5
Update longest-common-prefix.py
yiwen-luo/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,githubutilities/LeetCode,yiwen-luo/LeetCode,kamyu104/LeetCode,githubutilities/LeetCode,githubutilities/LeetCode,jaredkoontz/leetcode,jaredkoontz/leetcode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11...
Python/longest-common-prefix.py
Python/longest-common-prefix.py
# Time: O(n1 + n2 + ...) # Space: O(1) # # Write a function to find the longest common prefix string amongst an array of strings. # class Solution: # @return a string def longestCommonPrefix(self, strs): if not strs: return "" longest = strs[0] for string in strs[1:]: ...
# Time: O(n1 + n2 + ...) # Space: O(1) # # Write a function to find the longest common prefix string amongst an array of strings. # class Solution: # @return a string def longestCommonPrefix(self, strs): if len(strs) == 0: return "" longest = strs[0] for string in strs[1:]:...
mit
Python
eecd2913380717be5b59d290bc933992ed549447
remove useless test data in test_init_db.py
JING-TIME/ustc-course,JING-TIME/ustc-course,JING-TIME/ustc-course,JING-TIME/ustc-course,JING-TIME/ustc-course
tests/test_init_db.py
tests/test_init_db.py
#!/usr/bin/env python3 # A SQLite database will be created at /tmp/test.db # If you want to clear the database, just delete /tmp/test.db import sys sys.path.append('..') # fix import directory from app import app,db from app.models import * from random import randint app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite...
#!/usr/bin/env python3 # Test database creation and basic data insertion # A SQLite database will be created at /tmp/test.db # If you want to clear the database, just delete /tmp/test.db import sys sys.path.append('..') # fix import directory from app import app,db from app.models import * from random import randin...
agpl-3.0
Python
a0a1606d115efd3521ac957aa9a39efec60eda8c
Test the first item of the list, not the last
mollie/mollie-api-python
tests/test_issuers.py
tests/test_issuers.py
from mollie.api.objects.issuer import Issuer from .utils import assert_list_object def test_get_issuers(client, response): """Get all the iDeal issuers via the include querystring parameter.""" response.get('https://api.mollie.com/v2/methods/ideal?include=issuers', 'method_get_ideal_with_includes') issu...
from mollie.api.objects.issuer import Issuer from .utils import assert_list_object def test_get_issuers(client, response): """Get all the iDeal issuers via the include querystring parameter.""" response.get('https://api.mollie.com/v2/methods/ideal?include=issuers', 'method_get_ideal_with_includes') issu...
bsd-2-clause
Python
df836309dfe3ae1a6f34e23fd823e0888d883824
use auth prod
mozilla-iam/cis,mozilla-iam/cis
e2e/test_person_api.py
e2e/test_person_api.py
import boto3 import json import jsonschema import http.client from cis_profile import fake_profile from cis_profile import WellKnown client_id_name = '/iam/cis/development/change_client_id' client_secret_name = '/iam/cis/development/change_service_client_secret' base_url = 'api.dev.sso.allizom.org' client = boto3.clie...
import boto3 import json import jsonschema import http.client from cis_profile import fake_profile from cis_profile import WellKnown client_id_name = '/iam/cis/development/change_client_id' client_secret_name = '/iam/cis/development/change_service_client_secret' base_url = 'api.dev.sso.allizom.org' client = boto3.clie...
mpl-2.0
Python
08bfc1171c8f66fbf2ca161a9ee1fcf002a50e0f
implement tests for old routes
em92/pickup-rating,em92/quakelive-local-ratings,em92/quakelive-local-ratings,em92/pickup-rating,em92/quakelive-local-ratings,em92/quakelive-local-ratings,em92/quakelive-local-ratings,em92/pickup-rating
tests/test_matches.py
tests/test_matches.py
from collections import OrderedDict from .fixture import AppTestCase class TestMatches(AppTestCase): ORDER = 4 def test_matches_all(self): cases = [ ("/matches/", 0, None, 2), ("/matches/1/", 1, None, 2), ("/matches/ad/", 0, "ad", 1), ("/matches/ad/1/"...
from collections import OrderedDict from .fixture import AppTestCase class TestMatches(AppTestCase): ORDER = 4 def test_matches_all(self): cases = [ ("/matches/", 0, None, 2), ("/matches/1/", 1, None, 2), ("/matches/ad/", 0, "ad", 1), ("/matches/ad/1/"...
agpl-3.0
Python
1ccd9e7f15cfaccfadf7e4e977dbde724885cab9
Add a `PlayRec` app unit test
sangoma/switchy,wwezhuimeng/switch
tests/test_sync_call.py
tests/test_sync_call.py
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. """ Tests for synchronous call helper """ import time from switchy import sync_caller from switchy.apps.players import To...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. """ Tests for synchronous call helper """ import time from switchy import sync_caller from switchy.apps.players import To...
mpl-2.0
Python
e0c05f524b475b7c72e02ff602f24a2fd3dd74b3
Integrate Highlight Build Errors
deadfoxygrandpa/Elm.tmLanguage,sekjun9878/Elm.tmLanguage,sekjun9878/Elm.tmLanguage,rtfeldman/Elm.tmLanguage,deadfoxygrandpa/Elm.tmLanguage,rtfeldman/Elm.tmLanguage
elm_make.py
elm_make.py
import json import re from importlib import import_module try: default_exec = import_module('Highlight Build Errors').HighlightBuildErrors except: import Default.exec as default_exec class ElmMakeCommand(default_exec.ExecCommand): '''Inspired by: http://www.sublimetext.com/forum/viewtopic.php?t=12028 ...
import json import re import Default.exec as default_exec class ElmMakeCommand(default_exec.ExecCommand): '''Inspired by: http://www.sublimetext.com/forum/viewtopic.php?t=12028 https://github.com/search?q=sublime+filename%3Aexec.py https://github.com/search?q=finish+ExecCommand+NOT+ProcessListener+exte...
mit
Python
5073bb5ac1527108e1d3894902071d677a4477c6
fix exception in exception handling
edx-solutions/edx-platform,edx-solutions/edx-platform,edx-solutions/edx-platform,edx-solutions/edx-platform
openedx/core/djangoapps/course_groups/migrations/0003_populate_membership_data.py
openedx/core/djangoapps/course_groups/migrations/0003_populate_membership_data.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.db import migrations log = logging.getLogger(__name__) def forwards(apps, schema_editor): """ Populates data in CohortMembership table """ CohortMembership = apps.get_model("course_groups", "CohortMembership"...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.db import migrations log = logging.getLogger(__name__) def forwards(apps, schema_editor): """ Populates data in CohortMembership table """ CohortMembership = apps.get_model("course_groups", "CohortMembership"...
agpl-3.0
Python
14217dd3d225924d197527c8e97ba78724ff2c14
update docs
deepchem/deepchem,deepchem/deepchem,peastman/deepchem,peastman/deepchem
deepchem/feat/reaction_featurizer.py
deepchem/feat/reaction_featurizer.py
from deepchem.feat import Featurizer from typing import List import numpy as np try: from transformers import RobertaTokenizerFast except ModuleNotFoundError: raise ImportError( 'Transformers must be installed for RxnFeaturizer to be used!') pass class RxnFeaturizer(Featurizer): """Reaction Featurizer....
from deepchem.feat import Featurizer from typing import List import numpy as np try: from transformers import RobertaTokenizerFast except ModuleNotFoundError: raise ImportError( 'Transformers must be installed for RxnFeaturizer to be used!') pass class RxnFeaturizer(Featurizer): """Reaction Featurizer....
mit
Python
dd7a2b8abc37262d801c36baa427b3a05f6f0938
Add instance() method
Mause/statistical_atlas_of_au
saau/sections/__init__.py
saau/sections/__init__.py
SERVICES = [ 'aus_map.AusMap', 'towns.TownsData' ] def get_key(cls): return cls.__module__ + '.' + cls.__name__ def instance(cls): try: return Singleton.table[get_key(cls)] except KeyError: raise KeyError('Singleton uninitialized') class Singleton(type): table = {} def...
SERVICES = [ 'aus_map.AusMap', 'towns.TownsData' ] class Singleton(type): table = {} def __call__(cls, *args, **kw): key = cls.__module__ + '.' + cls.__name__ try: return Singleton.table[key] except KeyError: pass Singleton.table[key] = cls.__...
mit
Python
6adf760df12882cdcc9c4da5e2e1b4d79188d0bc
Send a receipt_email attribute when charging a card so the user gets sent a receipt by Stripe.
mwillmott/techbikers,Techbikers/techbikers,mwillmott/techbikers,Techbikers/techbikers,mwillmott/techbikers,Techbikers/techbikers,mwillmott/techbikers,Techbikers/techbikers
sales/models.py
sales/models.py
import stripe from datetime import datetime from django.db import models from django.contrib.auth.models import User from django.conf import settings class Sale(models.Model): sale_date = models.DateTimeField(default=datetime.now()) charge_id = models.CharField(max_length=32) # store the stripe charge id f...
import stripe from datetime import datetime from django.db import models from django.contrib.auth.models import User from django.conf import settings class Sale(models.Model): sale_date = models.DateTimeField(default=datetime.now()) charge_id = models.CharField(max_length=32) # store the stripe charge id f...
mit
Python
ba4485ec05206d126cb4833ab743a9707b20567d
Bump version 0.1.2.
junaruga/rpm-py-installer,junaruga/rpm-py-installer
rpm_py_installer/version.py
rpm_py_installer/version.py
VERSION = '0.1.2'
VERSION = '0.1.1'
mit
Python
fff4a95b0d2ecea47442ab5e319f330d1ac6c145
bump version
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/version.py
salt/version.py
import sys __version_info__ = (0, 10, 3) __version__ = '.'.join(map(str, __version_info__)) def versions_report(): libs = ( ("Jinja2", "jinja2", "__version__"), ("M2Crypto", "M2Crypto", "version"), ("msgpack-python", "msgpack", "version"), ("msgpack-pure", "msgpack_pure", "version...
import sys __version_info__ = (0, 10, 3, 'd') __version__ = '.'.join(map(str, __version_info__)) def versions_report(): libs = ( ("Jinja2", "jinja2", "__version__"), ("M2Crypto", "M2Crypto", "version"), ("msgpack-python", "msgpack", "version"), ("msgpack-pure", "msgpack_pure", "ve...
apache-2.0
Python
f91efb2c5d161bb5d13ffa1f2dd9037bcdf270da
allow users to specify commit message
reincubate/django-templatesadmin,buriy/django-templatesadmin,pombredanne/django-templatesadmin,reincubate/django-templatesadmin,dkopitsa/django-templatesadmin,bartTC/django-templatesadmin,buriy/django-templatesadmin,barrabinfc/django-templatesadmin,rlaager/django-templatesadmin,dkopitsa/django-templatesadmin,Alarik/dja...
edithooks/gitcommit.py
edithooks/gitcommit.py
from django import forms from django.utils.translation import ugettext_lazy from templatesadmin import TemplatesAdminException from templatesadmin.forms import TemplateForm import subprocess import os class ChangeCommentTemplateForm(TemplateForm): backup = forms.CharField( widget=forms.TextInput(attrs={'s...
from django import forms from templatesadmin.forms import TemplateForm from templatesadmin import TemplatesAdminException import subprocess import os class GitCommitHook(): ''' Backup File before saving ''' @classmethod def pre_save(cls, request, form, template_path): pass @classmeth...
bsd-3-clause
Python
9d7d643af005a204dc1851d370747775f729d7c8
make turbomole parsing less strict
hein09/pwtoolbox,hein09/pwtoolbox
vipster/ftypeplugins/turbomole.py
vipster/ftypeplugins/turbomole.py
# -*- coding: utf-8 -*- from ..molecule import Molecule name = 'turbomole' extension = 'turbo' argument = 'turbo' param = None def parser(name,data): """ Parse turbomole specific input file """ tmol = Molecule(name) for i in range(len(data)): if "$coord" in data[i]: for l in data[i+1:...
# -*- coding: utf-8 -*- from ..molecule import Molecule name = 'turbomole' extension = '' argument = 'turbomole' param = None def parser(name,data): """ Parse turbomole specific input file """ tmol = Molecule(name) tmol.setVec([[1,0,0],[0,1,0],[0,0,1]]) tmol.setCellDim(40.0) for l in data[1:]: ...
bsd-2-clause
Python
8793b1a2c4adf480534cf2a669337032edf77020
Remove header, this will be imported by a runner
hatchery/Genepool2,hatchery/genepool
golang/main.py
golang/main.py
from evolution_master.runners import pkg, download # Install for Arch with pkg.pacman() as pkg_man: pkg_man.install('go') # Install for Debian & Ubuntu with pkg.apt() as pkg_man: pkg_man.install('golang') # Install for OSX with pkg.brew() as pkg_man: pkg_man.install('go') # Install for Windows with dow...
#!/usr/bin/env python from evolution_master.runners import pkg, download # Install for Arch with pkg.pacman() as pkg_man: pkg_man.install('go') # Install for Debian & Ubuntu with pkg.apt() as pkg_man: pkg_man.install('golang') # Install for OSX with pkg.brew() as pkg_man: pkg_man.install('go') # Instal...
mit
Python
72c2d987f541e8136aa8c89c122739c9f3ed82b9
Add unit tests for the internal _getprofiledir function.
makerbot/s3g,Jnesselr/s3g,Jnesselr/s3g,makerbot/s3g,makerbot/s3g,makerbot/s3g
tests/test_profile.py
tests/test_profile.py
import os import sys lib_path = os.path.abspath('../') sys.path.append(lib_path) import unittest import json import s3g import s3g.profile class ProfileInitTests(unittest.TestCase): def test_bad_profile_name(self): bad_name = 'this_is_going_to_fail :(' self.assertRaises(IOError, s3g.Profile, bad_name) ...
import os import sys lib_path = os.path.abspath('../') sys.path.append(lib_path) import unittest import json import s3g class ProfileInitTests(unittest.TestCase): def test_bad_profile_name(self): bad_name = 'this_is_going_to_fail :(' self.assertRaises(IOError, s3g.Profile, bad_name) def test_good_profi...
agpl-3.0
Python
578dffb174ef6601fbd90d811033d9a3442f0616
set flags dump_sql and dry_run
moskytw/mosql,uranusjr/mosql
tests/test_result2.py
tests/test_result2.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import psycopg2 from mosql.result2 import Model class PostgreSQL(Model): getconn = classmethod(lambda cls: psycopg2.connect(database='mosky')) putconn = classmethod(lambda cls, conn: None) class Person(PostgreSQL): clauses = dict(table='person') arrange_b...
#!/usr/bin/env python # -*- coding: utf-8 -*- import psycopg2 from mosql.result2 import Model class PostgreSQL(Model): getconn = classmethod(lambda cls: psycopg2.connect(database='mosky')) putconn = classmethod(lambda cls, conn: None) class Person(PostgreSQL): clauses = dict(table='person') arrange_b...
mit
Python
2483e38054d12d315fd6aa3395aa9dd0126bcfea
fix broken test
chfw/pyexcel,chfw/pyexcel
tests/test_sources.py
tests/test_sources.py
from nose.tools import raises, eq_ from pyexcel.sources.factory import Source from pyexcel.sources.factory import FileSource from pyexcel.sources.factory import InputSource from pyexcel.sources.file_source_output import WriteSheetToMemory from pyexcel.sources.file_source_output import OutputSource def test_io_sourc...
from nose.tools import raises, eq_ from pyexcel.sources.factory import Source from pyexcel.sources.factory import FileSource from pyexcel.sources.file_source_output import WriteSheetToMemory from pyexcel.sources.file_source_output import OutputSource from pyexcel.sources.file_source_input import InputSource def tes...
bsd-3-clause
Python
a34c85063567adf09363cc9ad5670ad2e0ddf926
Bump to 3.3
ghickman/tvrenamr,wintersandroid/tvrenamr
tvrenamr/__init__.py
tvrenamr/__init__.py
__author__ = 'George Hickman' __copyright__ = 'Copyright 2012 George Hickman' __license__ = 'MIT' __title__ = 'tvrenamr' __version__ = '3.3'
__author__ = 'George Hickman' __copyright__ = 'Copyright 2012 George Hickman' __license__ = 'MIT' __title__ = 'tvrenamr' __version__ = '3.2.1'
mit
Python
2ccb49b541caee6abfdc36dd4dae9ce9dab43c16
add docstring
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/states/nfs_export.py
salt/states/nfs_export.py
# -*- coding: utf-8 -*- ''' Management of NFS exports =============================================== To ensure an NFS export exists: .. code-block:: yaml add_simple_export: nfs_export.present: - name: '/srv/nfs' - hosts: '10.0.2.0/24' - options: 'rw' For more complex expor...
# -*- coding: utf-8 -*- ''' Management of NFS exports =============================================== To ensure an NFS export exists: .. code-block:: yaml add_simple_export: nfs_export.present: - name: '/srv/nfs' - hosts: '10.0.2.0/24' - options: 'rw' For more complex expo...
apache-2.0
Python
a1151be46a0ea78e5b53bb48bc125da026f7c2f7
test example update
chenjiandongx/pyecharts,chenjiandongx/pyecharts,chenjiandongx/pyecharts
test/test_graph.py
test/test_graph.py
#!/usr/bin/env python # coding=utf-8 from __future__ import unicode_literals import os import sys from pyecharts import Graph PY2 = sys.version_info[0] == 2 def test_graph(): # graph_0 nodes = [{"name": "结点1", "symbolSize": 10}, {"name": "结点2", "symbolSize": 20}, {"name": "结点3", ...
#!/usr/bin/env python # coding=utf-8 from __future__ import unicode_literals import os import sys from pyecharts import Graph PY2 = sys.version_info[0] == 2 def test_graph(): # graph_0 nodes = [{"name": "结点1", "symbolSize": 10}, {"name": "结点2", "symbolSize": 20}, {"name": "结点3", ...
mit
Python
bd0bfcd33052d7bedcda95b9cf9da204f93c06f0
Add DotDict nesting test
thiderman/piper
test/test_utils.py
test/test_utils.py
from piper.utils import DotDict from piper.utils import dynamic_load import pytest class TestDotDict(object): def test_get_nonexistant_raises_keyerror(self): with pytest.raises(KeyError): dd = DotDict({}) dd.does_not_exist def test_get_item(self): dd = DotDict({'dange...
from piper.utils import DotDict from piper.utils import dynamic_load import pytest class TestDotDict(object): def test_get_nonexistant_raises_keyerror(self): with pytest.raises(KeyError): dd = DotDict({}) dd.does_not_exist def test_get_item(self): dd = DotDict({'dange...
mit
Python
e81f93ea925861ccd426f7f7682e25fb3d183e13
Modify laser ldr code
CarlosPena00/Mobbi,CarlosPena00/Mobbi
Rasp/laser/laser.py
Rasp/laser/laser.py
import RPi.GPIO as GPIO import time import Adafruit_ADS1x15 import sys #from mpu6050 import mpu6050 #sensor = mpu6050(0x68) class Laser: adc = Adafruit_ADS1x15.ADS1015() def __init__(self, gain): self.gain = gain print('Reading ADS1x15 values, press Ctrl-C to quit...') print('| {0:>6}...
import RPi.GPIO as GPIO import time import Adafruit_ADS1x15 import sys #from mpu6050 import mpu6050 #sensor = mpu6050(0x68) class Laser: adc = Adafruit_ADS1x15.ADS1015() def __init__(self, gain): self.gain = gain print('Reading ADS1x15 values, press Ctrl-C to quit...') print('| {0:>6}...
mit
Python
c85fb3d130cfae8ba9b1c0b9d009a1d8b235589d
Update version
luckytianyiyan/TyStrings,luckytianyiyan/TyStrings
tystrings/version.py
tystrings/version.py
__version__ = '1.2.0'
__version__ = '1.1.2'
mit
Python
c403df0facd9e3751dabdf9bcd1f22540acb218a
remove unnecessary dict boxing
dragoon/kilogram,dragoon/kilogram,dragoon/kilogram
mapreduce/dbpedia_dbm.py
mapreduce/dbpedia_dbm.py
""" Creates DBPedia labels-types Shelve file of the following format: { LABEL: {'types': [Type1, Type2, ...]}, ...} For example: Tramore: Town, Settlement, PopulatedPlace, Place Tramore,_Ireland: Town, Settlement, PopulatedPlace, Place """ import subprocess import urllib from collections import defau...
""" Creates DBPedia labels-types Shelve file of the following format: { LABEL: {'types': [Type1, Type2, ...]}, ...} For example: Tramore: Town, Settlement, PopulatedPlace, Place Tramore,_Ireland: Town, Settlement, PopulatedPlace, Place """ import subprocess import urllib from collections import defau...
apache-2.0
Python
3270b0013e19ec8d33f33eae051fb08e2c5f1b52
stop pop code ... placeholder
OpenTransitTools/otp_client_py
ott/otp_client/pyramid/views.py
ott/otp_client/pyramid/views.py
from pyramid.response import Response from pyramid.view import view_config from ott.otp_client.transit_index.routes import Routes from ott.otp_client.transit_index.stops import Stops import logging log = logging.getLogger(__file__) cache_long=5555 def do_view_config(cfg): cfg.add_route('stops', '/stops') c...
from pyramid.response import Response from pyramid.view import view_config from ott.otp_client.transit_index.routes import Routes from ott.otp_client.transit_index.stops import Stops import logging log = logging.getLogger(__file__) cache_long=5555 def do_view_config(cfg): cfg.add_route('stops', '/stops') c...
mpl-2.0
Python
41ea993a2bd795e4a2aa9b054f0820664a34573e
Test fixes
Vanuan/mock,5monkeys/mock
tests/testcallable.py
tests/testcallable.py
# Copyright (C) 2007-2011 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # http://www.voidspace.org.uk/python/mock/ from tests.support import unittest2 from mock import Mock, MagicMock, NonCallableMagicMock, NonCallableMock class TestCallable(unittest2.TestCase): def test_non_call...
# Copyright (C) 2007-2011 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # http://www.voidspace.org.uk/python/mock/ from tests.support import unittest2 from mock import Mock, MagicMock, NonCallableMagicMock, NonCallableMock class TestCallable(unittest2.TestCase): def test_non_call...
bsd-2-clause
Python
831eeb1ea0503782eb8ed08170776a1c2c0dbdeb
Fix hashing bug in createUser arguments in travis-setup
ollien/Timpani,ollien/Timpani,ollien/Timpani
tests/travis-setup.py
tests/travis-setup.py
import bcrypt import sys sys.path.insert(0, "..") import timpani connection = timpani.database.DatabaseConnection() timpani.database.ConnectionManager.addConnection(connection, "main") timpani.auth.createUser("tests", "Timpani Tests", "password", True, True) connection.close()
import bcrypt import sys sys.path.insert(0, "..") import timpani connection = timpani.database.DatabaseConnection() timpani.database.ConnectionManager.addConnection(connection, "main") hashedPassword = bcrypt.hashpw(bytes("password", "utf-8"), bcrypt.gensalt()).decode("utf-8") timpani.auth.createUser("tests", "Timpani...
mit
Python
b916b702419a90f26ae18b5ac31bda3972d98832
Bump version
dianchen96/gym,machinaut/gym,Farama-Foundation/Gymnasium,dianchen96/gym,Farama-Foundation/Gymnasium,d1hotpep/openai_gym,machinaut/gym,d1hotpep/openai_gym
gym/version.py
gym/version.py
VERSION = '0.1.1'
VERSION = '0.1.0'
mit
Python
6f24aa5e1e1ff78e95ed17ff75acc2646280bdd8
Add None identifier / repr print
puhitaku/typedmarshal
typedmarshal/util.py
typedmarshal/util.py
def pretty_print_recursive(obj, indent=0): def i_print(s): print(' ' * indent + s) if obj is None: i_print('None') elif isinstance(obj, (int, float, str)): i_print(f'{obj}') elif isinstance(obj, list): for l in obj: pretty_print_recursive(l, indent=indent+2) ...
def pretty_print_recursive(obj, indent=0): def i_print(s): print(' ' * indent + s) if obj is None: i_print('None') elif isinstance(obj, (int, float, str)): i_print(f'{obj}') elif isinstance(obj, list): for l in obj: pretty_print_recursive(l, indent=indent+2) ...
bsd-3-clause
Python
34cbdc805209b44da099a4c603431b34dc2c99ab
add loginShell
gruunday/useradm,gruunday/useradm,gruunday/useradm
rbopt.py
rbopt.py
#-----------------------------------------------------------------------------# # MODULE DESCRIPTION # #-----------------------------------------------------------------------------# """RedBrick Options Module; contains RBOpt class.""" #------------------------...
#-----------------------------------------------------------------------------# # MODULE DESCRIPTION # #-----------------------------------------------------------------------------# """RedBrick Options Module; contains RBOpt class.""" #------------------------...
unlicense
Python
d96770a6702379881d47582d954595cc155a40b3
add ability to probe VPC
smithfarm/ceph-auto-aws,smithfarm/ceph-auto-aws
handson/aws.py
handson/aws.py
# -*- mode: python; coding: utf-8 -*- # # Copyright (c) 2016, SUSE LLC # All rights reserved. # # 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 notice, ...
# -*- mode: python; coding: utf-8 -*- # # Copyright (c) 2016, SUSE LLC # All rights reserved. # # 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 notice, ...
bsd-3-clause
Python
488ea145b1f1179bb5bac21959cfaa4b32ec8d0f
add a download_url to setup
argriffing/hmmus,argriffing/hmmus,argriffing/hmmus
hmmus/setup.py
hmmus/setup.py
""" This is the setup script. This script is automatically run by easy_install or by pip on the user's machine when she installs the module from pypi. Here is some documentation for this process. http://docs.python.org/extending/building.html More info: http://wiki.python.org/moin/Distutils/Tutorial Register the met...
""" This is the setup script. This script is automatically run by easy_install or by pip on the user's machine when she installs the module from pypi. Here is some documentation for this process. http://docs.python.org/extending/building.html More info: http://wiki.python.org/moin/Distutils/Tutorial Register the met...
mit
Python
557b97e8424996450e53804a9543629731d5a400
update call to constructor of `git.GitCommandError`
tulip-control/tulip-control,tulip-control/tulip-control,tulip-control/tulip-control,tulip-control/tulip-control
tests/version_test.py
tests/version_test.py
"""Test the management of `tulip.__version__`.""" import imp import os import os.path import git import mock from nose.tools import assert_raises from setuptools.version import pkg_resources import tulip import tulip._version def test_tulip_has_pep440_version(): """Check that `tulip.__version__` complies to PEP...
"""Test the management of `tulip.__version__`.""" import imp import os import os.path import git import mock from nose.tools import assert_raises from setuptools.version import pkg_resources import tulip import tulip._version def test_tulip_has_pep440_version(): """Check that `tulip.__version__` complies to PEP...
bsd-3-clause
Python
689781f7adba3b7ec6df8fa0e84547610f5eb3e4
test that viewset calls utm_zones_for_representing with correctly constructed geometry
geometalab/drf-utm-zone-info,geometalab/drf-utm-zone-info
tests/viewset_test.py
tests/viewset_test.py
import pytest from django.contrib.gis.geos import Polygon from rest_framework import status from rest_framework.reverse import reverse from rest_framework.test import APIClient import utm_zone_info def test_posting_valid_data_returns_utm_zones(mocker, api_client, utm_zone_post_url, payload): utm_zone_mock = mock...
import pytest from rest_framework import status from rest_framework.reverse import reverse from rest_framework.test import APIClient def test_posting_valid_data_returns_utm_zones(mocker, api_client, utm_zone_post_url, payload): utm_zone_mock = mocker.Mock() utm_zone_mock.srid = 123456 mocker.patch('utm_zo...
isc
Python
4c8dd2b074d2c2227729ff0bd87cf60d06e97485
Extend custom exception and add additional logging
duboviy/misc
retry.py
retry.py
# Helper script with retry utility function # set logging for `retry` channel import logging logger = logging.getLogger('retry') # Define Exception class for retry class RetryException(Exception): DESCRIPTION = "Exception ({}) raised after {} tries." def __init__(self, exception, max_retry): self.ex...
# Define retry util function class RetryException(Exception): pass def retry(func, max_retry=10): """ @param func: The function that needs to be retry (to pass function with arguments use partial object) @param max_retry: Maximum retry of `func` function, default is `10` @return...
mit
Python
6e3dac3e54c53fc9d97956f6e051096267facd5a
install new board: atmega8 8Mhz
ponty/confduino
confduino/examples/custom_boards.py
confduino/examples/custom_boards.py
from __future__ import division from confduino.boardinstall import install_board from confduino.util import AutoBunch from entrypoint2 import entrypoint TEMPL_NAME = '{mcu}@{f_cpu}' TEMPL_ID = '{mcu}_{f_cpu}' def format_freq(f): if f >= 1000000: f = f / 1000000.0 suffix = 'MHz' elif f >= 1000...
from __future__ import division from confduino.boardinstall import install_board from confduino.util import AutoBunch from entrypoint2 import entrypoint TEMPL_NAME = '{mcu}@{f_cpu}' TEMPL_ID = '{mcu}_{f_cpu}' def format_freq(f): if f >= 1000000: f = f / 1000000.0 suffix = 'MHz' elif f >= 1000...
bsd-2-clause
Python
15112f3c3b1eafc178eeecf830fd2c7a47e18f50
fix close
legnaleurc/wcpan.worker
wcpan/worker/queue.py
wcpan/worker/queue.py
import functools as ft from typing import Callable from tornado import queues as tq, locks as tl, ioloop as ti from wcpan.logger import DEBUG, EXCEPTION from .task import regular_call, ensure_task, MaybeTask, TerminalTask class AsyncQueue(object): def __init__(self, maximum=None): self._max = 1 if maxi...
import functools as ft from typing import Callable from tornado import queues as tq, locks as tl, ioloop as ti from wcpan.logger import DEBUG, EXCEPTION from .task import regular_call, ensure_task, MaybeTask, TerminalTask class AsyncQueue(object): def __init__(self, maximum=None): self._max = 1 if maxi...
mit
Python
86d8a4ff50881840d0b9d8581b3049844273cdb0
Fix encoding error with path to ssh
thaim/ansible,thaim/ansible
lib/ansible/utils/ssh_functions.py
lib/ansible/utils/ssh_functions.py
# (c) 2016, James Tanner # (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (...
# (c) 2016, James Tanner # (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (...
mit
Python
5bcce0a022956a25ca41be8a6325d4bccf68f221
implement HTTP Date class, which parses and converts HTTP dates
spaceone/httoop,spaceone/httoop,spaceone/httoop
httoop/date.py
httoop/date.py
# -*- coding: utf-8 -*- """HTTP date .. seealso:: :rfc:`2616#section-3.3` """ __all__ = ['Date'] from httoop.util import HTTPString from functools import partial try: from email.utils import formatdate, parsedate formatdate = partial(formatdate, usegmt=True) except ImportError: from rfc822 import formatdate, pa...
# -*- coding: utf-8 -*- """HTTP date .. seealso:: :rfc:`2616#section-3.3` """ __all__ = ['Date'] # ripped from cherrypy (http://www.cherrypy.org/) (MIT license) # TODO: implement the function wrapper thing from circuits.web try: from email.utils import formatdate def Date(timeval=None): return formatdate(timeval...
mit
Python
f91ea2b07274391024fb10ec3f699747deacc29e
Update dependency bazelbuild/bazel to latest version
google/copybara,google/copybara,google/copybara
third_party/bazel.bzl
third_party/bazel.bzl
# Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
# Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
Python
c65c9ad42584823694f54b0b5d00d2952ae166f3
Add complete robot figures
arunlakshmanan/robot-trajectory-tracking,arunlakshmanan/robot-trajectory-tracking,arunlakshmanan/robot-trajectory-tracking,arunlakshmanan/robot-trajectory-tracking
pathgen.py
pathgen.py
import socket import struct #Room size room_length = 5.5 room_width = 3.35 scale_img = 120.0 #Robot dimensions rob_scale = 1.2 rob_rect_x = int(0.15 * scale_img * rob_scale) rob_rect_y = int(0.2 * scale_img * rob_scale) rob_trapz_wid = int(0.05 * scale_img * rob_scale) rob_trapz_side = int(0.07 * scale_img * rob_scal...
import socket import struct #Room size room_length = 5.5 room_width = 3.35 scale_img = 120.0 #Robot dimensions rob_x = int(0.15 * scale_img) rob_y = int(0.2 * scale_img) UDP = "localhost" PORT = 20000 sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM) sock.bind((UDP,PORT)) print("\n\nPress ctrl + C to exit\n\n"...
apache-2.0
Python
b3f00b40ad4e95f500e42cf05fd00a901da14f72
make sure that timestamps do not have trailing L
hypebeast/etapi,hypebeast/etapi,hypebeast/etapi,hypebeast/etapi
etapi/weather/views.py
etapi/weather/views.py
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from flask import (Blueprint, request, render_template) from etapi.lib.helpers import get_timestamps from etapi.lib.helpers import get_todays_date from etapi.weather.helpers import get_daily_temperature_series weather = Blueprint('weather', __name__, ...
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from flask import (Blueprint, request, render_template) from etapi.lib.helpers import get_timestamps from etapi.lib.helpers import get_todays_date from etapi.weather.helpers import get_daily_temperature_series weather = Blueprint('weather', __name__, ...
bsd-3-clause
Python
863068145060aa32d464aafab8cf2ebd43d129ca
update dev version to 0.16.0-dev after tagging 0.15.2
emory-libraries/eulexistdb,emory-libraries/eulexistdb,emory-libraries/eulexistdb
eulexistdb/__init__.py
eulexistdb/__init__.py
# file eulexistdb/__init__.py # # Copyright 2010,2011 Emory University Libraries # # 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 ...
# file eulexistdb/__init__.py # # Copyright 2010,2011 Emory University Libraries # # 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 ...
apache-2.0
Python
71ccbb5d89406f178e157bcd7aed59dab4c7957a
update version in number in prep for new release
emory-libraries/eulexistdb,emory-libraries/eulexistdb,emory-libraries/eulexistdb
eulexistdb/__init__.py
eulexistdb/__init__.py
# file eulexistdb/__init__.py # # Copyright 2010,2011 Emory University Libraries # # 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 #...
# file eulexistdb/__init__.py # # Copyright 2010,2011 Emory University Libraries # # 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 ...
apache-2.0
Python
dcb369282a40bcc88eefa4771ecc90d79e7a956e
Make sure that the logistic regression does inherit from ClassifierMixin.
equialgo/scikit-learn,vigilv/scikit-learn,jkarnows/scikit-learn,iismd17/scikit-learn,jmetzen/scikit-learn,procoder317/scikit-learn,jlegendary/scikit-learn,moutai/scikit-learn,betatim/scikit-learn,russel1237/scikit-learn,gclenaghan/scikit-learn,zhenv5/scikit-learn,xwolf12/scikit-learn,jjx02230808/project0223,jereze/scik...
scikits/learn/logistic.py
scikits/learn/logistic.py
import numpy as np from . import _liblinear from .base import ClassifierMixin from .svm import BaseLibLinear class LogisticRegression(BaseLibLinear, ClassifierMixin): """ Logistic Regression. Implements L1 and L2 regularized logistic regression. Parameters ---------- X : array-like, shape = ...
import numpy as np from . import _liblinear from .svm import BaseLibLinear class LogisticRegression(BaseLibLinear): """ Logistic Regression. Implements L1 and L2 regularized logistic regression. Parameters ---------- X : array-like, shape = [n_samples, n_features] Training vector, whe...
bsd-3-clause
Python
4e2ed175dd2fe3d5f82f9652564bc2053f80a472
fix allure attachments
skostya64/Selenium_tasks
pages/admin_panel_login_page.py
pages/admin_panel_login_page.py
from allure.constants import AttachmentType from selenium.webdriver.support.wait import WebDriverWait import allure class AdminPanelLoginPage: def __init__(self, driver): self.driver = driver self.wait = WebDriverWait(driver, 10) def open(self): self.driver.get("http://localhost/lite...
from allure.constants import AttachmentType from selenium.webdriver.support.wait import WebDriverWait import allure class AdminPanelLoginPage: def __init__(self, driver): self.driver = driver self.wait = WebDriverWait(driver, 10) def open(self): self.driver.get("http://localhost/lite...
apache-2.0
Python
b6c30758642bce1e07129e9b62970b3129de63a2
use tltd.git.Repo
rciorba/tldt,rciorba/tldt
src/tldt/tldt.py
src/tldt/tldt.py
from __future__ import absolute_import import contextlib import ConfigParser import importlib import os import subprocess from tldt import git @contextlib.contextmanager def chdir(dirname): cwd = os.getcwd() os.chdir(dirname) yield os.chdir(cwd) class Project(object): def __init__(self, head_r...
import contextlib import ConfigParser import importlib import os import subprocess @contextlib.contextmanager def chdir(dirname): cwd = os.getcwd() os.chdir(dirname) yield os.chdir(cwd) class Project(object): def __init__(self, head_repo, head_sha, base_repo, base_sha, configur...
unlicense
Python
b1ea108f8bb78ce862896e26e15d86ab6bff5c9a
remove broken debug print in silent_socket.py
DrDaveD/cvmfs,alhowaidi/cvmfsNDN,alhowaidi/cvmfsNDN,alhowaidi/cvmfsNDN,DrDaveD/cvmfs,cvmfs/cvmfs,Moliholy/cvmfs,alhowaidi/cvmfsNDN,trshaffer/cvmfs,Gangbiao/cvmfs,cvmfs/cvmfs,cvmfs/cvmfs,Gangbiao/cvmfs,reneme/cvmfs,reneme/cvmfs,djw8605/cvmfs,Moliholy/cvmfs,cvmfs/cvmfs,djw8605/cvmfs,trshaffer/cvmfs,Gangbiao/cvmfs,Molihol...
test/common/mock_services/silent_socket.py
test/common/mock_services/silent_socket.py
#!/usr/bin/python import socket import SocketServer import sys import time import threading import os import datetime def usage(): print >> sys.stderr, "This opens a socket on a given port number and waits for connection." print >> sys.stderr, "Connecting programs can send but will not receive anything." print >> ...
#!/usr/bin/python import socket import SocketServer import sys import time import threading import os import datetime def usage(): print >> sys.stderr, "This opens a socket on a given port number and waits for connection." print >> sys.stderr, "Connecting programs can send but will not receive anything." print >> ...
bsd-3-clause
Python
8337977e155d22d139059a919c5e3b99637d3218
Clarify docstring for update_in
Julian-O/toolz,quantopian/toolz,llllllllll/toolz,quantopian/toolz,pombredanne/toolz,whilo/toolz,obmarg/toolz,bartvm/toolz,cpcloud/toolz,obmarg/toolz,machinelearningdeveloper/toolz,karansag/toolz,jdmcbr/toolz,berrytj/toolz,simudream/toolz,jdmcbr/toolz,bartvm/toolz,whilo/toolz,berrytj/toolz,jcrist/toolz,pombredanne/toolz...
toolz/dicttoolz/core.py
toolz/dicttoolz/core.py
def merge(*dicts): """ Merge a collection of dictionaries >>> merge({1: 'one'}, {2: 'two'}) {1: 'one', 2: 'two'} Later dictionaries have precedence >>> merge({1: 2, 3: 4}, {3: 3, 4: 4}) {1: 2, 3: 3, 4: 4} """ rv = dict() for d in dicts: rv.update(d) return rv def val...
def merge(*dicts): """ Merge a collection of dictionaries >>> merge({1: 'one'}, {2: 'two'}) {1: 'one', 2: 'two'} Later dictionaries have precedence >>> merge({1: 2, 3: 4}, {3: 3, 4: 4}) {1: 2, 3: 3, 4: 4} """ rv = dict() for d in dicts: rv.update(d) return rv def val...
bsd-3-clause
Python
bd8c02201e5daa31bdd5a1ad21cae42d3a260a50
Add test for File#__iter__
aldanor/blox
tests/test_file.py
tests/test_file.py
# -*- coding: utf-8 -*- import io import py.path from pytest import raises_regexp from blox.file import File, is_blox, FORMAT_STRING, FORMAT_VERSION from blox.utils import write_i64 def test_is_blox(tmpfile): assert is_blox(tmpfile) assert not is_blox('/foo/bar/baz') with io.open(tmpfile, 'wb') as f: ...
# -*- coding: utf-8 -*- import io import py.path from pytest import raises_regexp from blox.file import File, is_blox, FORMAT_STRING, FORMAT_VERSION from blox.utils import write_i64 def test_is_blox(tmpfile): assert is_blox(tmpfile) assert not is_blox('/foo/bar/baz') with io.open(tmpfile, 'wb') as f: ...
mit
Python
bd8582b3d335bcbd40c60b799938fa91319e82f9
Update queue_info.py
PlatformLSF/platform-python-lsf-api,linearregression/platform-python-lsf-api,xlyang0211/platform-python-lsf-api
examples/queue_info.py
examples/queue_info.py
#!/usr/bin/python from pythonlsf import lsf def query_queue(queue_name): """ "query queue info" """ if lsf.lsb_init("test") > 0: return -1; intp_num_queues = lsf.new_intp(); lsf.intp_assign(intp_num_queues, 1); strArr = lsf.new_stringArray(1); #print lsf.intp_value(intp_num_q...
#!/usr/bin/python from pythonlsf import lsf def query_queue(queue_name): """ "query queue info" """ if lsf.lsb_init("test") > 0: return -1; intp_num_queues = lsf.new_intp(); lsf.intp_assign(intp_num_queues, 1); strArr = lsf.new_stringArray(1); #print lsf.intp_value(intp_num_q...
epl-1.0
Python
3dd70323fc6a9f71e466fd3e9c1e2e929fe27bc4
create required img field
cpodlesny/lisbon,pfskiev/lisbon,cpodlesny/lisbon,cpodlesny/lisbon,cpodlesny/lisbon,pfskiev/lisbon
src/related_links/models.py
src/related_links/models.py
from django.db import models class RelatedLink(models.Model): title_PT = models.CharField(max_length=100, blank=True, null=False) title_EN = models.CharField(max_length=100, blank=True, null=False) title_DE = models.CharField(max_length=100, blank=True, null=False) description_PT = models.TextField(ma...
from django.db import models class RelatedLink(models.Model): title_PT = models.CharField(max_length=100, blank=True, null=False) title_EN = models.CharField(max_length=100, blank=True, null=False) title_DE = models.CharField(max_length=100, blank=True, null=False) description_PT = models.TextField(ma...
mit
Python
511bef25eb3e8aae420db21875b7f0e64db1f391
Format using black and remove comments
tensorflow/cloud,tensorflow/cloud
src/python/tensorflow_cloud/core/tests/examples/multi_file_example/train_model.py
src/python/tensorflow_cloud/core/tests/examples/multi_file_example/train_model.py
# Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
# Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
Python
675b1c0933d3078ec0b0c91ed0bddfae7721c0b5
Remove legend
jvivian/rnaseq-lib,jvivian/rnaseq-lib
src/rnaseq_lib/plot/opts.py
src/rnaseq_lib/plot/opts.py
gene_curves_opts = { 'Curve': {'plot': dict(height=120, width=600, tools=['hover'], invert_xaxis=True, yrotation=45, yaxis='left'), 'style': dict(line_width=1.5)}, 'Curve.Percentage_of_Normal_Samples': {'plot': dict(xaxis=None, invert_yaxis=True), 'style'...
gene_curves_opts = { 'Curve': {'plot': dict(height=120, width=600, tools=['hover'], invert_xaxis=True, yrotation=45, yaxis='left'), 'style': dict(line_width=1.5)}, 'Curve.Percentage_of_Normal_Samples': {'plot': dict(xaxis=None, invert_yaxis=True), 'style'...
mit
Python
cd123204c3384bd3847b34452fc125a7e3a6bf47
Remove excess whitespace.
higgsd/euler,higgsd/euler
py/24.py
py/24.py
# 2783915460 import euler N = 10 T = 1000000 f = euler.product(xrange(1, N)) v = T - 1 a = [] d = [n for n in xrange(N)] for n in xrange(N): x = v / f v %= f a.append(d[x]) del d[x] if n + 1 != N: f /= N - n - 1 print ''.join([str(x) for x in a])
# 2783915460 import euler N = 10 T = 1000000 f = euler.product(xrange(1, N)) v = T - 1 a = [] d = [n for n in xrange(N)] for n in xrange(N): x = v / f v %= f a.append(d[x]) del d[x] if n + 1 != N: f /= N - n - 1 print ''.join([str(x) for x in a])
bsd-2-clause
Python
1b8f483e8d32df0de2dd8f798432172d6abd5a84
Fix non thunk dispatch calls for python 3.4
ariddell/aioredux
examples/todo_thunk.py
examples/todo_thunk.py
import asyncio import enum import logging import types import toolz try: from types import coroutine except ImportError: from asyncio import coroutine import aioredux import aioredux.middleware logger = logging.getLogger(__name__) # action types @enum.unique class ActionTypes(enum.Enum): ADD_TODO = 1 ...
import asyncio import enum import logging import types import toolz try: from types import coroutine except ImportError: from asyncio import coroutine import aioredux import aioredux.middleware logger = logging.getLogger(__name__) # action types @enum.unique class ActionTypes(enum.Enum): ADD_TODO = 1 ...
mpl-2.0
Python
7cc998358ceca6cadd1569064ec8473ea9f46364
Update views.py
karec/cookiecutter-flask-restful
{{cookiecutter.project_name}}/{{cookiecutter.app_name}}/api/views.py
{{cookiecutter.project_name}}/{{cookiecutter.app_name}}/api/views.py
from flask import Blueprint, current_app, jsonify from flask_restful import Api from marshmallow import ValidationError from {{cookiecutter.app_name}}.extensions import apispec from {{cookiecutter.app_name}}.api.resources import UserResource, UserList from {{cookiecutter.app_name}}.api.resources.user import UserSchema...
from flask import Blueprint, current_app, jsonify from flask_restful import Api from marshmallow import ValidationError from {{cookiecutter.app_name}}.extensions import apispec from {{cookiecutter.app_name}}.api.resources import UserResource, UserList from {{cookiecutter.app_name}}.api.resources.user import UserSchema...
mit
Python
7ee7835907da63de698c86931efb040aaf83973a
Install biopython in setup.py
MicrosoftResearch/Azimuth
setup.py
setup.py
# from Cython.Build import cythonize from setuptools import setup setup(name='Azimuth', version='0.4', author='Nicolo Fusi and Jennifer Listgarten', author_email="fusi@microsoft.com, jennl@microsoft.com", description=("Machine Learning-Based Predictive Modelling of CRISPR/Cas9 guide efficiency...
# from Cython.Build import cythonize from setuptools import setup setup(name='Azimuth', version='0.4', author='Nicolo Fusi and Jennifer Listgarten', author_email="fusi@microsoft.com, jennl@microsoft.com", description=("Machine Learning-Based Predictive Modelling of CRISPR/Cas9 guide efficiency...
bsd-3-clause
Python
c5a97d164bf74d1f4394cd9eb5970e1805643898
Remove old code
IATI/IATI-Website-Tests
tests/test_test.py
tests/test_test.py
import pytest from web_test_base import * """ A class to test new features without running all of the tests. Usage: py.test tests/test_test.py -rsx """ class TestTest(WebTestBase): urls_to_get = [ "http://iatistandard.org/" , "http://iatistandard.org/202/namespaces-extensions/" ] @pyt...
import pytest from web_test_base import * """ A class to test new features without running all of the tests. Usage: py.test tests/test_test.py -rsx """ class TestTest(WebTestBase): urls_to_get = [ "http://iatistandard.org/" , "http://iatistandard.org/202/namespaces-extensions/" ] text_...
mit
Python
c26cb4701ea568b369c878194e0f8bde16d040b1
check systemd PID
wanghongjuan/meta-iotqa-1,ostroproject/meta-iotqa,daweiwu/meta-iotqa-1,daweiwu/meta-iotqa-1,wanghongjuan/meta-iotqa-1,ostroproject/meta-iotqa,daweiwu/meta-iotqa-1,daweiwu/meta-iotqa-1,wanghongjuan/meta-iotqa-1,daweiwu/meta-iotqa-1,wanghongjuan/meta-iotqa-1,wanghongjuan/meta-iotqa-1,ostroproject/meta-iotqa,ostroproject/...
lib/oeqa/runtime/sanity/baseos.py
lib/oeqa/runtime/sanity/baseos.py
#[PROTEXCAT] #\License: ALL RIGHTS RESERVED #\Author: Wang, Jing <jing.j.wang@intel.com> '''base os test module''' from oeqa.oetest import oeRuntimeTest class BaseOsTest(oeRuntimeTest): '''Base os health check''' def test_baseos_dmesg(self): '''check dmesg command''' (status, output) = self.ta...
#[PROTEXCAT] #\License: ALL RIGHTS RESERVED #\Author: Wang, Jing <jing.j.wang@intel.com> '''base os test module''' from oeqa.oetest import oeRuntimeTest class BaseOsTest(oeRuntimeTest): '''Base os health check''' def test_baseos_dmesg(self): '''check dmesg command''' (status, output) = self.ta...
mit
Python
a6bf64319ba77b8b178646d84f7e16dcc63b4ccb
Bump verison to 2.0
someonehan/raven-python,Photonomie/raven-python,ewdurbin/raven-python,smarkets/raven-python,openlabs/raven,recht/raven-python,beniwohli/apm-agent-python,jbarbuto/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,icereval/raven-python,recht/raven-python,jmp0xf/raven-python,smarkets/raven-python,Goldmund-Wyldebea...
setup.py
setup.py
#!/usr/bin/env python import sys try: from setuptools import setup, find_packages, Command except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages, Command tests_require = [ 'Django>=1.2,<1.4', 'django-celery', 'celery', 'b...
#!/usr/bin/env python import sys try: from setuptools import setup, find_packages, Command except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages, Command tests_require = [ 'Django>=1.2,<1.4', 'django-celery', 'celery', 'b...
bsd-3-clause
Python
71931f36315ab97e875af138b1e80f3ca2ebc583
Upgrade to 1.2.1 version.
mocketize/python-mocket,mindflayer/python-mocket
setup.py
setup.py
from setuptools import setup, find_packages, os # Hack to prevent stupid "TypeError: 'NoneType' object is not callable" error # in multiprocessing/util.py _exit_function when running `python # setup.py test` (see # http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html) for m in ('multiprocessing', 'billiard'): ...
from setuptools import setup, find_packages, os # Hack to prevent stupid "TypeError: 'NoneType' object is not callable" error # in multiprocessing/util.py _exit_function when running `python # setup.py test` (see # http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html) for m in ('multiprocessing', 'billiard'): ...
bsd-3-clause
Python
a540e2234b27130ceba9e908f2833417814c6d14
Prepare openprocurement.planning.api 2.3.5.
openprocurement/openprocurement.planning.api
setup.py
setup.py
from setuptools import setup, find_packages import os version = '2.3.5' requires = [ 'setuptools', 'openprocurement.api>=2.3', ] test_requires = requires + [ 'webtest', 'python-coveralls', ] docs_requires = requires + [ 'sphinxcontrib-httpdomain', ] entry_points = { 'openprocurement.api.plugi...
from setuptools import setup, find_packages import os version = '2.3.4' requires = [ 'setuptools', 'openprocurement.api>=2.3', ] test_requires = requires + [ 'webtest', 'python-coveralls', ] docs_requires = requires + [ 'sphinxcontrib-httpdomain', ] entry_points = { 'openprocurement.api.plugi...
apache-2.0
Python
e419e72dce748654fe9f4277a6326108b521bd1d
add meme as default cog
Naught0/qtbot
qtbot.py
qtbot.py
#!/bin/env python import discord import json import aiohttp from datetime import datetime from discord.ext import commands # Init bot des = 'qtbot is a big qt written in python3 and love.' bot = commands.Bot(command_prefix='.', description=des, pm_help=True) # Get bot's token with open('data/apikeys.json') as f: ...
#!/bin/env python import discord import json import aiohttp from datetime import datetime from discord.ext import commands # Init bot des = 'qtbot is a big qt written in python3 and love.' bot = commands.Bot(command_prefix='.', description=des, pm_help=True) # Get bot's token with open('data/apikeys.json') as f: ...
mit
Python
421564a3be13fdfa04f775900a05f4d518767c0c
Add pycoin.ui to setup.py.
mperklin/pycoin,mperklin/pycoin
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup from pycoin.version import version setup( name="pycoin", version=version, packages=[ "pycoin", "pycoin.blockchain", "pycoin.cmds", "pycoin.contrib", "pycoin.convention", "pycoin.ecdsa", "pycoin.ecds...
#!/usr/bin/env python from setuptools import setup from pycoin.version import version setup( name="pycoin", version=version, packages=[ "pycoin", "pycoin.blockchain", "pycoin.cmds", "pycoin.contrib", "pycoin.convention", "pycoin.ecdsa", "pycoin.ecds...
mit
Python
0304e4f8f99dd8cd5e51c8332ab3c2b5bcf30d62
Use latest yelp-cheetah
asottile/cheetah_lint
setup.py
setup.py
# -*- coding: utf-8 -*- from setuptools import find_packages from setuptools import setup setup( name='cheetah_lint', description='Linting tools for the Cheetah templating language.', url='https://github.com/asottile/cheetah_lint', version='0.3.1', author='Anthony Sottile', author_email='asott...
# -*- coding: utf-8 -*- from setuptools import find_packages from setuptools import setup setup( name='cheetah_lint', description='Linting tools for the Cheetah templating language.', url='https://github.com/asottile/cheetah_lint', version='0.3.1', author='Anthony Sottile', author_email='asott...
mit
Python
4d89756d432bcf8cede033cef6058681fda3fd6c
Bump to v0.13.1
gisce/enerdata
setup.py
setup.py
import sys from setuptools import setup, find_packages INSTALL_REQUIRES = ['pytz', 'workalendar'] if sys.version_info < (2, 7): INSTALL_REQUIRES += ['backport_collections'] setup( name='enerdata', version='0.13.1', packages=find_packages(), url='http://code.gisce.net', license='MIT', auth...
import sys from setuptools import setup, find_packages INSTALL_REQUIRES = ['pytz', 'workalendar'] if sys.version_info < (2, 7): INSTALL_REQUIRES += ['backport_collections'] setup( name='enerdata', version='0.13.0', packages=find_packages(), url='http://code.gisce.net', license='MIT', auth...
mit
Python
9fe7ab80870b2c7de8380ab8013fbb33df7ee847
Update to 0.3
jdfreder/jupyter-pip
setup.py
setup.py
# -*- coding: utf-8 -*- from setuptools import setup setup( name='jupyter-pip', version='0.3', description='Allows IPython notebook extension authors to make their extension pip installable!', author='Jonathan Frederic', author_email='jon.freder@gmail.com', license='New BSD License', url='h...
# -*- coding: utf-8 -*- from setuptools import setup setup( name='jupyter-pip', version='0.2', description='Allows IPython notebook extension authors to make their extension pip installable!', author='Jonathan Frederic', author_email='jon.freder@gmail.com', license='New BSD License', url='h...
bsd-3-clause
Python
21ae601f31a6ef53ce87a14531c458ef8ab91c08
Add try/except block for dequeue to deal with AttributeErrors from empty queue
jwarren116/data-structures-deux
queue.py
queue.py
#!/usr/bin/env python '''Implementation of a simple queue data structure. The queue has `enqueue`, `dequeue`, and `peek` methods. Items in the queue have `value` and `behind` attributes. The queue has a `front` attribute. ''' class Item(object): def __init__(self, value, behind=None): self.value = value ...
#!/usr/bin/env python '''Implementation of a simple queue data structure. The queue has `enqueue`, `dequeue`, and `peek` methods. Items in the queue have `value` and `behind` attributes. The queue has a `front` attribute. ''' class Item(object): def __init__(self, value, behind=None): self.value = value ...
mit
Python
12b5631fc02ad2073672a3f8d5712ef3be1bc01a
Bump api dependency.
Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server
setup.py
setup.py
#!/usr/bin/env python """Kegbot Beer Kegerator Server package. Kegbot is a hardware and software system to record and monitor access to a beer kegerator. For more information and documentation, see http://kegbot.org/ """ from setuptools import setup, find_packages VERSION = '0.9.19-pre' DOCLINES = __doc__.split('\...
#!/usr/bin/env python """Kegbot Beer Kegerator Server package. Kegbot is a hardware and software system to record and monitor access to a beer kegerator. For more information and documentation, see http://kegbot.org/ """ from setuptools import setup, find_packages VERSION = '0.9.19-pre' DOCLINES = __doc__.split('\...
mit
Python
b14e9a48e25b83cf43c3932bb466ce283dc02b0d
fix project url
pytest-dev/pytest-xdist,nicoddemus/pytest-xdist,RonnyPfannschmidt/pytest-xdist
setup.py
setup.py
from setuptools import setup setup( name="pytest-xdist", use_scm_version={'write_to': 'xdist/_version.py'}, description='py.test xdist plugin for distributed testing' ' and loop-on-failing modes', long_description=open('README.rst').read(), license='MIT', author='holger krekel a...
from setuptools import setup setup( name="pytest-xdist", use_scm_version={'write_to': 'xdist/_version.py'}, description='py.test xdist plugin for distributed testing' ' and loop-on-failing modes', long_description=open('README.rst').read(), license='MIT', author='holger krekel a...
mit
Python
a571caf3b44eb2a5e302f91fd06b01b32479a685
Add history
sfanous/Pyecobee
setup.py
setup.py
from setuptools import setup with open('README.rst', 'r') as f: readme = f.read() with open('HISTORY.rst', 'r', 'utf-8') as f: history = f.read() setup( name='pyecobee', version='1.2.1', description='A Python implementation of the ecobee API', long_description=readme + '\n\n' + history, u...
from setuptools import setup with open('README.rst', 'r') as f: readme = f.read() setup( name='pyecobee', version='1.2.1', description='A Python implementation of the ecobee API', long_description=readme, url='https://github.com/sfanous/Pyecobee', author='Sherif Fanous', author_email='...
mit
Python
af74c291edcb63d8248ac3e36fb1c741144edf28
install without egg (#11961)
iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/py-basemap/package.py
var/spack/repos/builtin/packages/py-basemap/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * import os class PyBasemap(PythonPackage): """The matplotlib basemap toolkit is a library for plo...
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * import os class PyBasemap(PythonPackage): """The matplotlib basemap toolkit is a library for plo...
lgpl-2.1
Python
8c5e95a9477654a81d3efcb6f7fc438324c86fdc
Fix unhashable types-bug
mopsalarm/pr0gramm-meta,mopsalarm/pr0gramm-meta
webapp/service.py
webapp/service.py
from functools import lru_cache import time import bottle import datadog from bottle.ext import sqlite from attrdict import AttrDict as attrdict print("initialize datadog metrics") datadog.initialize() stats = datadog.ThreadStats() stats.start() print("open database at pr0gramm-meta.sqlite3") bottle.install(sqlite...
from functools import lru_cache import time import bottle import datadog from bottle.ext import sqlite from attrdict import AttrDict as attrdict print("initialize datadog metrics") datadog.initialize() stats = datadog.ThreadStats() stats.start() print("open database at pr0gramm-meta.sqlite3") bottle.install(sqlite...
apache-2.0
Python
14d1f65699a79f879dde8fb6da2e3b1be72a7266
Fix NoSuchOptError in lbaas agent test
mandeepdhami/neutron,vijayendrabvs/hap,infobloxopen/neutron,barnsnake351/neutron,dhanunjaya/neutron,noironetworks/neutron,eonpatapon/neutron,gkotton/neutron,watonyweng/neutron,Juniper/neutron,apporc/neutron,silenci/neutron,vveerava/Openstack,SamYaple/neutron,SamYaple/neutron,paninetworks/neutron,glove747/liberty-neutro...
neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_agent.py
neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_agent.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 New Dream Network, LLC (DreamHost) # # 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/li...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 New Dream Network, LLC (DreamHost) # # 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/li...
apache-2.0
Python
7c7441648a8adee4250002481d7ee60315bc8e74
use latest setuptest
praekelt/jmbo-calendar,praekelt/jmbo-calendar
setup.py
setup.py
from setuptools import setup, find_packages setup( name='jmbo-calendar', version='0.0.2', description='Jmbo calendar app.', long_description = open('README.rst', 'r').read() + open('AUTHORS.rst', 'r').read() + open('CHANGELOG.rst', 'r').read(), author='Praekelt Foundation', author_email='dev@pr...
from setuptools import setup, find_packages from setuptools.command.test import test def run_tests(self): from setuptest.runtests import runtests return runtests(self) test.run_tests = run_tests setup( name='jmbo-calendar', version='0.0.2', description='Jmbo calendar app.', long_description = ...
bsd-3-clause
Python
c08640067d5ab81ee35a03f9482009e856ee732d
update create super user script to use new custom user model
poldracklab/cogat,rwblair/cogat,poldracklab/cogat,poldracklab/cogat,poldracklab/cogat,rwblair/cogat,rwblair/cogat,rwblair/cogat
scripts/create_superuser.py
scripts/create_superuser.py
from cognitive.apps.users.models import User username = 'admin' password = 'adminpassword' if not User.objects.get(username): User.objects.create_superuser(username=username, password=password, email='') else: msg = ("User {} already exists, update scripts/create_superuser.py if you " "would like a ...
from django.contrib.auth.models import User username = 'admin' password = 'adminpassword' if not User.objects.get(username): User.objects.create_superuser(username=username, password=password, email='') else: msg = ("User {} already exists, update scripts/create_superuser.py if you " "would like a d...
mit
Python
cf00e42a82c233da2a215d7e0cd1ef2e62e617ac
update doc
snower/torpeewee,snower/torpeewee
torpeewee/__init__.py
torpeewee/__init__.py
''' torpeewee: Tornado and asyncio asynchronous ORM by peewee. The MIT License (MIT) Copyright (c) 2014, 2015 torpeewee contributors 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 restr...
''' torpeewee: Tornado and asyncio asynchronous ORM by peewee. The MIT License (MIT) Copyright (c) 2014, 2015 TorMySQL contributors 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 restri...
mit
Python
b5684f602b779842953416732117f184e7431492
Use ordered dictionaries in generateChipDtsi.py
jasmin-j/distortos,jasmin-j/distortos,CezaryGapinski/distortos,CezaryGapinski/distortos,DISTORTEC/distortos,DISTORTEC/distortos,CezaryGapinski/distortos,CezaryGapinski/distortos,CezaryGapinski/distortos,DISTORTEC/distortos,jasmin-j/distortos,jasmin-j/distortos,DISTORTEC/distortos,jasmin-j/distortos
scripts/generateChipDtsi.py
scripts/generateChipDtsi.py
#!/usr/bin/env python # # file: generateChipDtsi.py # # author: Copyright (C) 2017 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info # # This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not # distributed with this file, You can obtain on...
#!/usr/bin/env python # # file: generateChipDtsi.py # # author: Copyright (C) 2017 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info # # This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not # distributed with this file, You can obtain on...
mpl-2.0
Python
5fbb833cf5fa33f2d364d6b56fcc90240297a57b
Handle sample rate in counts
JackDanger/sentry,zenefits/sentry,argonemyth/sentry,jean/sentry,zenefits/sentry,nicholasserra/sentry,1tush/sentry,songyi199111/sentry,JamesMura/sentry,korealerts1/sentry,gg7/sentry,jean/sentry,zenefits/sentry,argonemyth/sentry,boneyao/sentry,Kryz/sentry,jean/sentry,vperron/sentry,kevinastone/sentry,looker/sentry,ifduyu...
src/sentry/utils/metrics.py
src/sentry/utils/metrics.py
from __future__ import absolute_import __all__ = ['timing', 'incr'] from django_statsd.clients import statsd from django.conf import settings from random import random def _get_key(key): prefix = settings.SENTRY_METRICS_PREFIX if prefix: return '{}{}'.format(prefix, key) return key def incr(ke...
from __future__ import absolute_import __all__ = ['timing', 'incr'] from django_statsd.clients import statsd from django.conf import settings from random import random def _get_key(key): prefix = settings.SENTRY_METRICS_PREFIX if prefix: return '{}{}'.format(prefix, key) return key def incr(ke...
bsd-3-clause
Python
745cc40a3eb35f55c9fedbff708e5bebb17d7195
Update __init__.py
Alan-Jairo/topgeo
topgeo/__init__.py
topgeo/__init__.py
""" Esta libreria funciona para realizar calculos topograficos <topgeo.calcoor("csv")> #Calcula las coordenadas (x,y,z) de un 'csv'. <topgeo.caldist("csv")> #Calcula las distancias horizontales e inclinadas.""" from coordenada import calcoor from distancia import caldist pd.read_csv('Lev_canal.csv') pd.read_csv('Pun...
""" Esta libreria funciona para realizar calculos topograficos <topgeo.calcoor("csv")> #Calcula las coordenadas (x,y,z) de un 'csv'. <topgeo.caldist("csv")> #Calcula las distancias horizontales e inclinadas.""" from coordenada import calcoor from distancia import caldist
mit
Python
d2e2d8961bb17948579c21cf793ad3f0e2babea7
fix install_requires
ponty/discogui,ponty/discogui
setup.py
setup.py
import os.path from setuptools import setup NAME = "discogui" # get __version__ __version__ = None exec(open(os.path.join(NAME, "about.py")).read()) VERSION = __version__ URL = "https://github.com/ponty/discogui" DESCRIPTION = "GUI discovery" LONG_DESCRIPTION = """discogui discovers GUI elements Documentation: htt...
import os.path from setuptools import setup NAME = "discogui" # get __version__ __version__ = None exec(open(os.path.join(NAME, "about.py")).read()) VERSION = __version__ URL = "https://github.com/ponty/discogui" DESCRIPTION = "GUI discovery" LONG_DESCRIPTION = """discogui discovers GUI elements Documentation: htt...
bsd-2-clause
Python
e7ada76aaecca014f40cf8172a7eec5d75cace7f
Allow updating the next year's courses in March
StoDevX/course-data-tools,StoDevX/course-data-tools
scripts/lib/find_terms.py
scripts/lib/find_terms.py
from argparse import ArgumentParser from datetime import datetime from .year_plus_term import year_plus_term def find_terms_for_year(year): now = datetime.now() current_month = now.month current_year = now.year all_terms = [1, 2, 3, 4, 5] limited_terms = [1, 2, 3] # St. Olaf publishes initial Fall, Interim...
from argparse import ArgumentParser from datetime import datetime from .year_plus_term import year_plus_term def find_terms_for_year(year): now = datetime.now() current_month = now.month current_year = now.year all_terms = [1, 2, 3, 4, 5] limited_terms = [1, 2, 3] # St. Olaf publishes initial Fall, Interim...
mit
Python
e0f008a35eb38f6fb86ad0e17b0ba4f0208d0337
Add more unit tests for linked list
ueg1990/aids
tests/test_linked_list/test_linked_list.py
tests/test_linked_list/test_linked_list.py
import unittest from aids.linked_list.linked_list import LinkedList class LinkedListTestCase(unittest.TestCase): ''' Unit tests for the Linked List data structure ''' def setUp(self): self.test_linked_list = LinkedList() def test_stack_initialization(self): self.assertTrue(isinstance(self.tes...
import unittest from aids.linked_list.linked_list import LinkedList class LinkedListTestCase(unittest.TestCase): ''' Unit tests for the Linked List data structure ''' def setUp(self): self.test_linked_list = LinkedList() def test_stack_initialization(self): self.assertTrue(isinstance(self.tes...
mit
Python
c2138a35123969651212b1d9cd6cdefef89663ec
Modify existing Programs migration to account for help_text change
shurihell/testasia,fintech-circle/edx-platform,doganov/edx-platform,synergeticsedx/deployment-wipro,proversity-org/edx-platform,stvstnfrd/edx-platform,shurihell/testasia,amir-qayyum-khan/edx-platform,RPI-OPENEDX/edx-platform,analyseuc3m/ANALYSE-v1,kmoocdev2/edx-platform,devs1991/test_edx_docmode,UOMx/edx-platform,solas...
openedx/core/djangoapps/programs/migrations/0003_auto_20151120_1613.py
openedx/core/djangoapps/programs/migrations/0003_auto_20151120_1613.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('programs', '0002_programsapiconfig_cache_ttl'), ] operations = [ migrations.AddField( model_name='programsapicon...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('programs', '0002_programsapiconfig_cache_ttl'), ] operations = [ migrations.AddField( model_name='programsapicon...
agpl-3.0
Python
d64235531fae49b3e76e9c904a9a2b0a08db0cf6
Change version to 0.2.
TyVik/YaDiskClient
YaDiskClient/__init__.py
YaDiskClient/__init__.py
""" Client for Yandex.Disk. """ __version__ = '0.2' from YaDiskClient import YaDiskException, YaDisk
""" Client for Yandex.Disk. """ __version__ = '0.1' from YaDiskClient import YaDiskException, YaDisk
mit
Python
c4e83ae47cac80cc4287bc7acfac5c8e6b4a7c4c
bump to 1.2.3 (#123)
twitterdev/twitter-python-ads-sdk,twitterdev/twitter-python-ads-sdk
twitter_ads/__init__.py
twitter_ads/__init__.py
# Copyright (C) 2015 Twitter, Inc. VERSION = (1, 2, 3) from twitter_ads.utils import get_version __version__ = get_version()
# Copyright (C) 2015 Twitter, Inc. VERSION = (1, 2, 2) from twitter_ads.utils import get_version __version__ = get_version()
mit
Python