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 |
|---|---|---|---|---|---|---|---|---|
b26f5d68a9fccaff63f64b59f69fea21ba8e4f8e | make sure to add reminder touch of file | mooreds/amazonmachinelearning-anintroduction,mooreds/amazonmachinelearning-anintroduction | dataprep/wine.py | dataprep/wine.py | # Prep script for the data found at https://archive.ics.uci.edu/ml/datasets/Wine+Quality
import re
def fix_for_batch(line):
# remove last field, as that is our target field
p = re.compile(',[^,]*$')
line = p.sub("\n", line)
return line
training_number_of_lines = 3898
reminder = open('make-sure-you-mark-quali... | # Prep script for the data found at https://archive.ics.uci.edu/ml/datasets/Wine+Quality
import re
def fix_for_batch(line):
# remove last field, as that is our target field
p = re.compile(',[^,]*$')
line = p.sub("\n", line)
return line
training_number_of_lines = 3898
tobatch = open('whitetotest.csv', 'w')
t... | apache-2.0 | Python |
4278f7348da5ba5de4fa9900dc61857838e07e0a | Improve libx11 package | trigger-happy/conan-packages | libx11/conanfile.py | libx11/conanfile.py | from conans import ConanFile, AutoToolsBuildEnvironment, tools
import os
class Libx11Conan(ConanFile):
name = "libx11"
version = "1.6.5"
license = "Custom https://cgit.freedesktop.org/xorg/lib/libX11/tree/COPYING"
url = "https://github.com/trigger-happy/conan-packages"
description = "X11 client-si... | from conans import ConanFile, AutoToolsBuildEnvironment, tools
import os
class Libx11Conan(ConanFile):
name = "libx11"
version = "1.6.5"
license = "Custom https://cgit.freedesktop.org/xorg/lib/libX11/tree/COPYING"
url = "https://github.com/trigger-happy/conan-packages"
description = "X11 client-si... | mit | Python |
d5c7b2d03418f3c2d7335e086a97d000e219f55a | Exit with status code 1 if dumpling hub encounters an error | mjoblin/netdumplings,mjoblin/netdumplings,mjoblin/netdumplings | netdumplings/console/shifty.py | netdumplings/console/shifty.py | import sys
import click
import netdumplings
from netdumplings.console.shared import CLICK_CONTEXT_SETTINGS
from netdumplings.exceptions import NetDumplingsError
from netdumplings.shared import (
configure_logging, DEFAULT_SHIFTY_HOST, DEFAULT_SHIFTY_IN_PORT,
DEFAULT_SHIFTY_OUT_PORT, SHIFTY_STATUS_FREQ,
)
@c... | import click
import netdumplings
from netdumplings.console.shared import CLICK_CONTEXT_SETTINGS
from netdumplings.exceptions import NetDumplingsError
from netdumplings.shared import (
configure_logging, DEFAULT_SHIFTY_HOST, DEFAULT_SHIFTY_IN_PORT,
DEFAULT_SHIFTY_OUT_PORT, SHIFTY_STATUS_FREQ,
)
@click.command... | mit | Python |
eef348f74a13f42780713aa9dfca9cc617fa52c8 | Make the value of FLOATING_IP match with api resource | openstack/neutron,mahak/neutron,huntxu/neutron,noironetworks/neutron,cloudbase/neutron,eayunstack/neutron,openstack/neutron,mahak/neutron,openstack/neutron,eayunstack/neutron,huntxu/neutron,mahak/neutron,noironetworks/neutron,cloudbase/neutron | neutron/callbacks/resources.py | neutron/callbacks/resources.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 | Python |
a720d4fcdd9eb90a7d6fabc23b0c7c8023002242 | add docstring [skip ci] | datalib/proclib | proclib/__init__.py | proclib/__init__.py | """
proclib
~~~~~~~
Simple high level convenience wrapper over the
stdlib subprocess module.
:copyright: (c) 2015 Eeo Jun
:license: MIT, see LICENSE for details.
"""
__version__ = '0.0.1'
| __version__ = '0.0.1'
| mit | Python |
a4eda75171a5f774bd0b1618c0f217faad7383eb | Prepare v2.2.22.dev | crawln45/Flexget,drwyrm/Flexget,dsemi/Flexget,OmgOhnoes/Flexget,tobinjt/Flexget,Flexget/Flexget,Danfocus/Flexget,tobinjt/Flexget,tarzasai/Flexget,LynxyssCZ/Flexget,OmgOhnoes/Flexget,LynxyssCZ/Flexget,oxc/Flexget,JorisDeRieck/Flexget,Danfocus/Flexget,dsemi/Flexget,drwyrm/Flexget,drwyrm/Flexget,Flexget/Flexget,tarzasai/F... | 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 |
f231c04b8ec6919d2a79e9cf8c7f7627691d939e | Prepare v1.2.425.dev | LynxyssCZ/Flexget,LynxyssCZ/Flexget,Pretagonist/Flexget,LynxyssCZ/Flexget,OmgOhnoes/Flexget,dsemi/Flexget,jawilson/Flexget,poulpito/Flexget,Pretagonist/Flexget,Danfocus/Flexget,sean797/Flexget,sean797/Flexget,qk4l/Flexget,tobinjt/Flexget,ianstalk/Flexget,OmgOhnoes/Flexget,LynxyssCZ/Flexget,Danfocus/Flexget,crawln45/Fle... | 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 |
476361617b88bfb48c38602da1f8d9f6d3542f24 | Prepare v1.2.281.dev | v17al/Flexget,xfouloux/Flexget,oxc/Flexget,antivirtel/Flexget,drwyrm/Flexget,dsemi/Flexget,ratoaq2/Flexget,drwyrm/Flexget,ianstalk/Flexget,v17al/Flexget,jawilson/Flexget,OmgOhnoes/Flexget,tobinjt/Flexget,oxc/Flexget,qk4l/Flexget,grrr2/Flexget,cvium/Flexget,LynxyssCZ/Flexget,jawilson/Flexget,sean797/Flexget,OmgOhnoes/Fl... | 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 |
dc8f82e834f9b0c5fe34d7dba293fb04028dbf75 | Prepare v3.1.152.dev | Flexget/Flexget,crawln45/Flexget,crawln45/Flexget,Flexget/Flexget,Flexget/Flexget,crawln45/Flexget,crawln45/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 |
cddae953d28aac3f9fc79e2d8c9ea23b746e1a02 | Prepare v2.13.12.dev | Danfocus/Flexget,Danfocus/Flexget,JorisDeRieck/Flexget,Flexget/Flexget,malkavi/Flexget,gazpachoking/Flexget,Danfocus/Flexget,tobinjt/Flexget,JorisDeRieck/Flexget,crawln45/Flexget,Danfocus/Flexget,tobinjt/Flexget,LynxyssCZ/Flexget,Flexget/Flexget,gazpachoking/Flexget,crawln45/Flexget,JorisDeRieck/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 |
74f9879cd2e9b542efab82b0dd1a4984caf8fab0 | update version to v0.15.1 | Joshua-Anderson/controller-sdk-go,Joshua-Anderson/controller-sdk-go | deis/__init__.py | deis/__init__.py | """
The Deis main package, including the top-level URLs, Django project
settings, and WSGI setup. Most application domain-specific code lives in
the api, provider, cm, and web Django apps.
"""
from __future__ import absolute_import
__version__ = '0.15.1'
| """
The Deis main package, including the top-level URLs, Django project
settings, and WSGI setup. Most application domain-specific code lives in
the api, provider, cm, and web Django apps.
"""
from __future__ import absolute_import
__version__ = '0.15.0+git'
| apache-2.0 | Python |
190f2778b7b9f0e76136fb590943c725daa177fd | Convert institutions list to pytest | CenterForOpenScience/osf.io,CenterForOpenScience/osf.io,cslzchen/osf.io,sloria/osf.io,brianjgeiger/osf.io,mattclark/osf.io,caseyrollins/osf.io,adlius/osf.io,laurenrevere/osf.io,leb2dg/osf.io,CenterForOpenScience/osf.io,baylee-d/osf.io,HalcyonChimera/osf.io,cslzchen/osf.io,laurenrevere/osf.io,pattisdr/osf.io,adlius/osf.... | api_tests/institutions/views/test_institution_list.py | api_tests/institutions/views/test_institution_list.py | import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import InstitutionFactory
from osf.models import AbstractNode as Node
@pytest.mark.django_db
class TestInstitutionList:
@pytest.fixture()
def institution_one(self):
return InstitutionFactory()
@pytest.fixture... | from nose.tools import * # flake8: noqa
from tests.base import ApiTestCase
from osf_tests.factories import InstitutionFactory
from osf.models import AbstractNode as Node
from api.base.settings.defaults import API_BASE
class TestInstitutionList(ApiTestCase):
def setUp(self):
super(TestInstitutionList, se... | apache-2.0 | Python |
2387061b6ccdb1e51457eb87e18b0a26bcdd1749 | Bump version to 1.2.3 | mbeacom/locust,locustio/locust,mbeacom/locust,mbeacom/locust,locustio/locust,locustio/locust,locustio/locust,mbeacom/locust | locust/__init__.py | locust/__init__.py | # Apply Gevent monkey patching of stdlib
from gevent import monkey as _monkey
_monkey.patch_all()
from .user.sequential_taskset import SequentialTaskSet
from .user import wait_time
from .user.task import task, tag, TaskSet
from .user.users import HttpUser, User
from .user.wait_time import between, constant, constant... | # Apply Gevent monkey patching of stdlib
from gevent import monkey as _monkey
_monkey.patch_all()
from .user.sequential_taskset import SequentialTaskSet
from .user import wait_time
from .user.task import task, tag, TaskSet
from .user.users import HttpUser, User
from .user.wait_time import between, constant, constant... | mit | Python |
a373234ad9ce2c0e5b2c9917e50a2b9d97293674 | Update dsub version to 0.3.11.dev0 | DataBiosphere/dsub,DataBiosphere/dsub | dsub/_dsub_version.py | dsub/_dsub_version.py | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 | Python |
e89b897a1b6c7ea56e95eab4a5ecbe58ff7aaa57 | Upgrade javamelody-core to 1.80.0 | GerritCodeReview/plugins_javamelody,GerritCodeReview/plugins_javamelody,GerritCodeReview/plugins_javamelody | external_plugin_deps.bzl | external_plugin_deps.bzl | load("//tools/bzl:maven_jar.bzl", "maven_jar")
def external_plugin_deps():
maven_jar(
name = "javamelody-core",
artifact = "net.bull.javamelody:javamelody-core:1.80.0",
sha1 = "9499869f068a1e57efefa392a06b5a7635613359",
)
maven_jar(
name = "jrobin",
artifact = "org.... | load("//tools/bzl:maven_jar.bzl", "maven_jar")
def external_plugin_deps():
maven_jar(
name = "javamelody-core",
artifact = "net.bull.javamelody:javamelody-core:1.79.0",
sha1 = "9413e29625402900e69feae8f1948ea694a88244",
)
maven_jar(
name = "jrobin",
artifact = "org.... | apache-2.0 | Python |
c0b2cd2769551a36bdf9e673188b7c6ca4f21e98 | Update mockito-core to 2.24.0 | GerritCodeReview/plugins_webhooks | external_plugin_deps.bzl | external_plugin_deps.bzl | load("//tools/bzl:maven_jar.bzl", "maven_jar")
def external_plugin_deps():
maven_jar(
name = "mockito",
artifact = "org.mockito:mockito-core:2.24.0",
sha1 = "969a7bcb6f16e076904336ebc7ca171d412cc1f9",
deps = [
"@byte-buddy//jar",
"@byte-buddy-agent//jar",
... | load("//tools/bzl:maven_jar.bzl", "maven_jar")
def external_plugin_deps():
maven_jar(
name = "mockito",
artifact = "org.mockito:mockito-core:2.23.4",
sha1 = "a35b6f8ffcfa786771eac7d7d903429e790fdf3f",
deps = [
"@byte-buddy//jar",
"@byte-buddy-agent//jar",
... | apache-2.0 | Python |
7fedc6b85ec4faabb29a15c8d4718c4fad2d423f | update setup.py | sdpython/code_beatrix,sdpython/code_beatrix,sdpython/code_beatrix,sdpython/code_beatrix | src/code_beatrix/__init__.py | src/code_beatrix/__init__.py | #-*- coding: utf-8 -*-
"""
@file
@brief Main file
.. faqref::
:title: Pourquoi Python?
`Python <https://www.python.org/>`_
est un langage de programmation très répandu aujourd'hui
qui fut choisi à l'`ENSAE <http://www.ensae.fr/ensae/fr/>`_ en
2005 pour remplacer le `C++ <https://fr.wikipedia.org/w... | #-*- coding: utf-8 -*-
"""
@file
@brief Main file
.. faqref::
:title: Pourquoi Python?
`Python <https://www.python.org/>`_
est un langage de programmation très répandu aujourd'hui
qui fut choisi à l'`ENSAE <http://www.ensae.fr/ensae/fr/>`_ en
2005 pour remplacer le `C++ <https://fr.wikipedia.org/w... | mit | Python |
c034370551b4ae9e8b1e1765239d5c473c338c5f | allow openaps init | openaps/openaps,openaps/openaps | openaps/builtins.py | openaps/builtins.py |
import init
import alias
import shlex
import cli
from subprocess import call
class BuiltinApp (cli.ConfigApp):
name = 'builtin'
builtins = {
'init': init.init
}
def get_builtins ( ):
app = BuiltinApp([ ])
app.read_config( )
out = alias.get_alias_map(app.config)
out.update(**builtins)
return out
class R... |
import init
import alias
import shlex
import cli
from subprocess import call
class BuiltinApp (cli.ConfigApp):
name = 'builtin'
builtins = {
'init': init.init
}
def get_builtins ( ):
app = BuiltinApp([ ])
app.read_config( )
out = alias.get_alias_map(app.config)
out.update(**builtins)
return out
class R... | mit | Python |
4b95eaa12259dfc0ae21428f7ae92704844ef609 | remove api/api url duplication for jwt | geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx,geometalab/drf-utm-zone-info,geometalab/drf-utm-zone-info,geometalab/osmaxx,geometalab/osmaxx-frontend | conversion_service/rest_api/urls.py | conversion_service/rest_api/urls.py | from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
import conversion_job.views
router = DefaultRouter()
router.register(r'extents', conversion_job.views.ExtentViewSet)
router.register(r'jobs', conversion_job.views.ConversionJobViewSet)
router.register(r'conversion_result', conv... | from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
import conversion_job.views
router = DefaultRouter()
router.register(r'extents', conversion_job.views.ExtentViewSet)
router.register(r'jobs', conversion_job.views.ConversionJobViewSet)
router.register(r'conversion_result', conv... | mit | Python |
44517b8d5762a8aafcc9d9748b733aba928c52c8 | remove unused import | deepchem/deepchem,peastman/deepchem,peastman/deepchem,deepchem/deepchem | deepchem/feat/roberta_tokenizer.py | deepchem/feat/roberta_tokenizer.py | from deepchem.feat.base_classes import MolecularFeaturizer
from transformers import RobertaTokenizerFast
from deepchem.utils.typing import RDKitMol
class RobertaFeaturizer(RobertaTokenizerFast, MolecularFeaturizer):
def __init__(self, **kwargs):
super().__init__(**kwargs)
return
def _featurize(self, mol... | from deepchem.feat.base_classes import MolecularFeaturizer
from transformers import RobertaTokenizerFast
from deepchem.utils.typing import RDKitMol
from torch.utils.data import Dataset
class RobertaFeaturizer(RobertaTokenizerFast, MolecularFeaturizer):
def __init__(self, **kwargs):
super().__init__(**kwargs)
... | mit | Python |
b7f95b1922c0d006843ab54922fbff9c39c4e6bf | Bump to 0.10.6 | flomotlik/formica | formica/__init__.py | formica/__init__.py | import logging
import sys
__version__ = '0.10.6'
CHANGE_SET_FORMAT = "{stack}-change-set"
logger = logging.getLogger('formica')
handler = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter('%(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
| import logging
import sys
__version__ = '0.10.5'
CHANGE_SET_FORMAT = "{stack}-change-set"
logger = logging.getLogger('formica')
handler = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter('%(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
| mit | Python |
5d1a1ad1971cd59d1554fb3312df342f7f3450cf | Remove 301 redirect permanence | DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange | democracylab/urls.py | democracylab/urls.py | """democracylab URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | """democracylab URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | mit | Python |
07f79129bf38cd935fdc185c4c9cc758a6e957a1 | handle missing domain in receiver auth | dimagi/commcare-hq,SEL-Columbia/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,gmimano/commcaretest,SEL-Columbia/commcare-hq,gmimano/commcaretest,qedsoftware/... | corehq/apps/receiverwrapper/auth.py | corehq/apps/receiverwrapper/auth.py | from couchdbkit import DocumentSchema, BooleanProperty, StringProperty, ResourceNotFound
from corehq.apps.domain.models import Domain
class AuthContext(DocumentSchema):
authenticated = BooleanProperty(default=False)
domain = StringProperty()
user_id = StringProperty()
def auth_required(self):
... | from couchdbkit import DocumentSchema, BooleanProperty, StringProperty, ResourceNotFound
from corehq.apps.domain.models import Domain
class AuthContext(DocumentSchema):
authenticated = BooleanProperty(default=False)
domain = StringProperty()
user_id = StringProperty()
def auth_required(self):
... | bsd-3-clause | Python |
2aa41403436a1629d3d0f8c83b51f685f7b0f421 | Fix bug: log dir path: set it thru file location, not current working path | trelay/multi-executor | main/remote_exe.py | main/remote_exe.py | #!/usr/bin/python
import shlex, os
from subprocess import Popen, PIPE
#from time import sleep
import threading
def exe_cmd(log_name, command_line):
args = shlex.split(command_line)
log_dir=os.path.join(os.path.dirname(__file__),"..", "log")
if not os.path.isdir(log_dir):
os.mkdir(log_dir)
file_... | #!/usr/bin/python
import shlex, os
from subprocess import Popen, PIPE
#from time import sleep
import threading
def exe_cmd(log_name, command_line):
args = shlex.split(command_line)
log_dir=os.path.join(os.getcwd(),"..", "log")
if not os.path.isdir(log_dir):
os.mkdir(log_dir)
file_name= os.path.... | mit | Python |
02454937b500afe1dc9b7387e63f9b3327be6a16 | Enable consistent-hashing policy for Collector | Juniper/contrail-provisioning,Juniper/contrail-provisioning | contrail_provisioning/config/templates/contrail_discovery_conf.py | contrail_provisioning/config/templates/contrail_discovery_conf.py | import string
template = string.Template("""
[DEFAULTS]
zk_server_ip=$__contrail_zk_server_ip__
zk_server_port=$__contrail_zk_server_port__
listen_ip_addr=$__contrail_listen_ip_addr__
listen_port=$__contrail_listen_port__
log_local=$__contrail_log_local__
log_file=$__contrail_log_file__
cassandra_server_list=$__contra... | import string
template = string.Template("""
[DEFAULTS]
zk_server_ip=$__contrail_zk_server_ip__
zk_server_port=$__contrail_zk_server_port__
listen_ip_addr=$__contrail_listen_ip_addr__
listen_port=$__contrail_listen_port__
log_local=$__contrail_log_local__
log_file=$__contrail_log_file__
cassandra_server_list=$__contra... | apache-2.0 | Python |
5dbb38eed7f6549e9781196e389143914a2b3037 | update ament_index_python API | ros2/rosidl,ros2/rosidl_typesupport,esteve/rosidl_typesupport,ros2/rosidl,ros2/rosidl_typesupport,ros2/rosidl,ros2/rosidl_typesupport,esteve/rosidl_typesupport,esteve/rosidl_typesupport,ros2/rosidl | rosidl_generator_py/rosidl_generator_py/import_type_support_impl.py | rosidl_generator_py/rosidl_generator_py/import_type_support_impl.py | # Copyright 2016 Open Source Robotics Foundation, 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... | # Copyright 2016 Open Source Robotics Foundation, 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... | apache-2.0 | Python |
68cf2977bacc5ac69036298ac52d16cb56e8d7e8 | update _id field definition | mylokin/mongoext | mongoext/document.py | mongoext/document.py | from __future__ import absolute_import
import mongoext.collection
import mongoext.schema
import mongoext.exc
class MetaSchema(type):
def __new__(cls, name, bases, attrs):
schema = {}
for base in bases:
for name, obj in vars(base).iteritems():
if issubclass(type(obj), m... | from __future__ import absolute_import
import mongoext.collection
import mongoext.schema
import mongoext.exc
class MetaSchema(type):
def __new__(cls, name, bases, attrs):
schema = {}
for base in bases:
for name, obj in vars(base).iteritems():
if issubclass(type(obj), m... | mit | Python |
cf086002350a2c8b0837cf2f8fc63732bff6613e | add name entry to Python itkwasm Image | InsightSoftwareConsortium/ITKBridgeJavaScript,InsightSoftwareConsortium/ITKBridgeJavaScript,InsightSoftwareConsortium/ITKBridgeJavaScript | src/python/itkwasm/image.py | src/python/itkwasm/image.py | from dataclasses import dataclass
from typing import Sequence
try:
from numpy.typing import ArrayLike
except ImportError:
from numpy import ndarray as ArrayLike
@dataclass
class ImageType:
dimension: int
componentType: str
pixelType: str
components: int
@dataclass
class Image:
imageType:... | from dataclasses import dataclass
from typing import Sequence
try:
from numpy.typing import ArrayLike
except ImportError:
from numpy import ndarray as ArrayLike
@dataclass
class ImageType:
dimension: int
componentType: str
pixelType: str
components: int
@dataclass
class Image:
imageType:... | apache-2.0 | Python |
93dd1ad89d030e626c5692954c38526c9b851fd8 | Add target to the warning log message | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/matchers/list_match.py | salt/matchers/list_match.py | # -*- coding: utf-8 -*-
'''
This is the default list matcher.
'''
from __future__ import absolute_import, print_function, unicode_literals
import logging
log = logging.getLogger(__name__)
def match(tgt):
'''
Determines if this host is on the list
'''
try:
if ',' + __opts__['id'] + ',' in tgt ... | # -*- coding: utf-8 -*-
'''
This is the default list matcher.
'''
from __future__ import absolute_import, print_function, unicode_literals
import logging
log = logging.getLogger(__name__)
def match(tgt):
'''
Determines if this host is on the list
'''
try:
if ',' + __opts__['id'] + ',' in tgt ... | apache-2.0 | Python |
36252979bde4ba1720fea0af7cfc97bff81c12c2 | Improve currencies_to_countries migration | kiote/cosmopolitan,openspending/cosmopolitan | extra_countries/migrations/0004_auto_20151217_1853.py | extra_countries/migrations/0004_auto_20151217_1853.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from cities.models import Country
from currencies.models import Currency
def seed_currencies_to_countries(apps, schema_editor):
ExtraCountry = apps.get_model("extra_countries", "ExtraCountry")
for extra_country ... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from cities.models import Country
from currencies.models import Currency
def seed_currencies_to_countries(apps, schema_editor):
ExtraCountry = apps.get_model("extra_countries", "ExtraCountry")
for country in Cou... | mit | Python |
ee12635adae1ee769d11fb6556fc4bd02ae9e34f | comment print | thebenedict/devjargon | detect/models.py | detect/models.py | from django.db import models
import string, textract, nltk
from nltk.stem import PorterStemmer
from nltk.corpus import stopwords
from collections import Counter
class Organization(models.Model):
name = models.CharField(max_length=100)
class Word(models.Model):
stem = models.CharField(max_length=100)
displ... | from django.db import models
import string, textract, nltk
from nltk.stem import PorterStemmer
from nltk.corpus import stopwords
from collections import Counter
class Organization(models.Model):
name = models.CharField(max_length=100)
class Word(models.Model):
stem = models.CharField(max_length=100)
displ... | mit | Python |
32c40710a562b194385f2340bf882cb3709b74e3 | Fix Django 1.10 deprecation warning | erikcw/django-masquerade,erikcw/django-masquerade,erikcw/django-masquerade | masquerade/urls.py | masquerade/urls.py | from django.conf.urls import patterns, url
from masquerade.views import mask
from masquerade.views import unmask
urlpatterns = [
url(r'^mask/$', mask),
url(r'^unmask/$', unmask),
]
| from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^mask/$', 'masquerade.views.mask'),
url(r'^unmask/$', 'masquerade.views.unmask'),
)
| apache-2.0 | Python |
77959096e14da4231a67371e7809eed5e138f486 | Set version to 0.4.1. | OpenCMISS-Bindings/opencmiss.utils | src/opencmiss/utils/__init__.py | src/opencmiss/utils/__init__.py |
__version__ = '0.4.1'
|
__version__ = '0.4.0'
| apache-2.0 | Python |
21772cf4778db3b8284fc704f3aca42dc8c160c2 | use python3 new API for str.maketrans | rlowrance/python_lib,rlowrance/python_lib | applied_data_science/dirutility.py | applied_data_science/dirutility.py | '''utilities for managing directories
Copyright 2017 Roy E. Lowrance
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 ... | '''utilities for managing directories
Copyright 2017 Roy E. Lowrance
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 ... | apache-2.0 | Python |
0008892c72a5a6d00de28ca180f129cf63f9075f | add support to Decimal serialize | yceruto/django-ajax,yceruto/django-ajax | django_ajax/encoder.py | django_ajax/encoder.py | """
Utils
"""
from __future__ import unicode_literals
import json
import decimal
from django.http.response import HttpResponseRedirectBase, HttpResponse
from django.template.response import TemplateResponse
from django.utils.encoding import force_text
from django.db.models.base import ModelBase
class LazyJSONEncode... | """
Utils
"""
from __future__ import unicode_literals
import json
from django.http.response import HttpResponseRedirectBase, HttpResponse
from django.template.response import TemplateResponse
from django.utils.encoding import force_text
from django.db.models.base import ModelBase
class LazyJSONEncoderMixin(object):... | mit | Python |
2d364022fd23559b51cfeaf1448b2e13683233ef | Fix admin list_display for related messages. | kvh/django-mailer-2,tachang/django-mailer-2,maykinmedia/django-mailer-2,maykinmedia/django-mailer-2,morenopc/django-mailer-2,torchbox/django-mailer-2,maykinmedia/django-mailer-2,victorfontes/django-mailer-2,SmileyChris/django-mailer-2,APSL/django-mailer-2,GreenLightGo/django-mailer-2,fenginx/django-mailer-2,k1000/djang... | django_mailer/admin.py | django_mailer/admin.py | from django.contrib import admin
from django_mailer import models
class Message(admin.ModelAdmin):
list_display = ('to_address', 'subject', 'date_created')
class MessageRelatedModelAdmin(admin.ModelAdmin):
list_select_related = True
def message__to_address(self, obj):
return obj.message.to_addr... | from django.contrib import admin
from django_mailer import models
class Message(admin.ModelAdmin):
list_display = ('to_address', 'subject', 'date_created')
class QueuedMessage(admin.ModelAdmin):
list_display = ('id', 'message__to_address', 'message__subject',
'message__date_created', 'pr... | mit | Python |
57adb16468b558b36545269a490f44000d0a12d3 | add line profile decorator | qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq | dimagi/utils/decorators/profile.py | dimagi/utils/decorators/profile.py | import hotshot
import os
from datetime import datetime
from django.conf import settings
try:
PROFILE_LOG_BASE = settings.PROFILE_LOG_BASE
except Exception:
PROFILE_LOG_BASE = "/tmp"
# Source: http://code.djangoproject.com/wiki/ProfilingDjango
def profile(log_file):
"""Profile some callable.
This dec... | import hotshot
import os
from datetime import datetime
from django.conf import settings
try:
PROFILE_LOG_BASE = settings.PROFILE_LOG_BASE
except Exception:
PROFILE_LOG_BASE = "/tmp"
# Source: http://code.djangoproject.com/wiki/ProfilingDjango
def profile(log_file):
"""Profile some callable.
This dec... | bsd-3-clause | Python |
fa64ab15c31a05f394947b5a9c526290bf7fab62 | Fix SessionStatus query | adamchainz/django-mysql,arnau126/django-mysql,graingert/django-mysql,arnau126/django-mysql,nickmeharry/django-mysql,graingert/django-mysql,nickmeharry/django-mysql | django_mysql/status.py | django_mysql/status.py | # -*- coding:utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import contextlib
from django.db import connections
from django.db.utils import DEFAULT_DB_ALIAS
class BaseStatus(object):
"""
Base class for the status classes
"""
que... | # -*- coding:utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import contextlib
from django.db import connections
from django.db.utils import DEFAULT_DB_ALIAS
class BaseStatus(object):
"""
Base class for the status classes
"""
que... | mit | Python |
71e16297d1e0164f3c2633a016fe715e585567b0 | Fix cbr_wrapper to use LICENSE instead of install-deps.sh to find root directory. | sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata | scripts/util/cbr_wrapper.py | scripts/util/cbr_wrapper.py | #!/usr/bin/python
import sys
import os
import os.path
import invoke
import stdio
CBR_WRAPPER = "scripts/util/cbr_wrapper.sh"
def FindRoot(start):
search_offsets = ['.', '..', '../..', '../../..']
# Search directories: locals preferred first
search_dirs = [os.getcwd()]
# Otherwise search system dirs
... | #!/usr/bin/python
import sys
import os
import os.path
import invoke
import stdio
CBR_WRAPPER = "scripts/util/cbr_wrapper.sh"
def FindRoot(start):
search_offsets = ['.', '..', '../..', '../../..']
# Search directories: locals preferred first
search_dirs = [os.getcwd()]
# Otherwise search system dirs
... | bsd-3-clause | Python |
7bf4360d4e05fedb49c0cf0cc106fb76fad12c07 | allow the regex to be in the detector or the filth | deanmalmgren/scrubadub,deanmalmgren/scrubadub,datascopeanalytics/scrubadub,datascopeanalytics/scrubadub | scrubadub/detectors/base.py | scrubadub/detectors/base.py | import re
from .. import exceptions
from ..filth import Filth, RegexFilth
class Detector(object):
filth_cls = None
def iter_filth(self, text):
raise NotImplementedError('must be overridden by base classes')
class RegexDetector(Detector):
"""Base class to match PII with a regex"""
regex = N... | import re
from .. import exceptions
from ..filth import Filth, RegexFilth
class Detector(object):
filth_cls = None
def iter_filth(self, text):
raise NotImplementedError('must be overridden by base classes')
class RegexDetector(Detector):
def iter_filth(self, text):
if not issubclass(s... | mit | Python |
f3ae28ce9ecefbabd397aaa47cfeac3aefab66b1 | fix ExitStack usage | scylladb/scylla-cluster-tests,scylladb/scylla-cluster-tests,scylladb/scylla-cluster-tests,scylladb/scylla-cluster-tests,scylladb/scylla-cluster-tests,scylladb/scylla-longevity-tests,scylladb/scylla-longevity-tests,scylladb/scylla-longevity-tests | sdcm/group_common_events.py | sdcm/group_common_events.py | from contextlib import contextmanager, ExitStack
from sdcm.sct_events import DbEventsFilter, Severity, DatabaseLogEvent, EventsSeverityChangerFilter, YcsbStressEvent, \
PrometheusAlertManagerEvent
@contextmanager
def ignore_alternator_client_errors():
with ExitStack() as stack:
stack.enter_context(Ev... | from contextlib import contextmanager, ExitStack
from sdcm.sct_events import DbEventsFilter, Severity, DatabaseLogEvent, EventsSeverityChangerFilter, YcsbStressEvent, \
PrometheusAlertManagerEvent
@contextmanager
def ignore_alternator_client_errors():
with ExitStack() as stack:
stack.enter_context(Ev... | agpl-3.0 | Python |
7d812a06bdd7509d3c5ce6a66daa6a760bddcd6d | fix flake8 issues for conf/example_apps/motion_lights.py | acockburn/appdaemon,acockburn/appdaemon | conf/example_apps/motion_lights.py | conf/example_apps/motion_lights.py | import hassapi as hass
#
# App to turn lights on when motion detected then off again after a delay
#
# Use with constraints to activate only for the hours of darkness
#
# Args:
#
# sensor: binary sensor to use as trigger
# entity_on : entity to turn on when detecting motion, can be a light, script, scene or anything e... | import hassapi as hass
import globals
#
# App to turn lights on when motion detected then off again after a delay
#
# Use with constraints to activate only for the hours of darkness
#
# Args:
#
# sensor: binary sensor to use as trigger
# entity_on : entity to turn on when detecting motion, can be a light, script, scen... | mit | Python |
d28d8b42793aaa1e50702cd5aec1850ff230a510 | add string representation to ImagerProfile | MigrantJ/django-imager,sjschmidt44/django-imager,sjschmidt44/django-imager,MigrantJ/django-imager,MigrantJ/django-imager,sjschmidt44/django-imager | imagersite/imager_profile/models.py | imagersite/imager_profile/models.py | from django.db import models
from django.contrib.auth.models import User
class ImagerProfile(models.Model):
PHOTO_TYPES = (
('N', 'Nature Photography'),
('P', 'Paranormal Photography'),
('A', 'Aerial Photography'),
('B', 'Black and White Photography'),
('F', 'Forensic Photo... | from django.db import models
from django.contrib.auth.models import User
class ImagerProfile(models.Model):
PHOTO_TYPES = (
('N', 'Nature Photography'),
('P', 'Paranormal Photography'),
('A', 'Aerial Photography'),
('B', 'Black and White Photography'),
('F', 'Forensic Photo... | mit | Python |
a1c69c3c3d1082e55ed3418b9bac1b86403bad25 | Update __version__ | borntyping/python-dice,borntyping/python-dice | dice/__init__.py | dice/__init__.py | """A library for parsing and evaluating dice notation."""
from __future__ import absolute_import, print_function, unicode_literals
from pyparsing import ParseBaseException
import dice.elements
import dice.grammar
import dice.utilities
from dice.constants import DiceExtreme
from dice.exceptions import DiceBaseExcepti... | """A library for parsing and evaluating dice notation."""
from __future__ import absolute_import, print_function, unicode_literals
from pyparsing import ParseBaseException
import dice.elements
import dice.grammar
import dice.utilities
from dice.constants import DiceExtreme
from dice.exceptions import DiceBaseExcepti... | mit | Python |
3ab3e5849b26ca00dd13b011ba5162c71aca2122 | Make wsgi_app accesible from package root. | socialwifi/dila,socialwifi/dila,socialwifi/dila | dila/__init__.py | dila/__init__.py | from .frontend.flask.wsgi import main as wsgi_app
__all__ = [wsgi_app]
| bsd-3-clause | Python | |
3c7f8353ea30ed46267a08dd1d230753def45f71 | Add ted source type | preichenberger/freetalks,preichenberger/freetalks | freetalks/utils/video.py | freetalks/utils/video.py | class Source(object):
def __init__(self, media_id, link_id=None):
self.media_id = media_id
self.link_id = link_id
@property
def embed(self):
raise Exception('Source type not implemented.')
@property
def link(self):
raise Exception('Source type not implemented.')
c... | class Source(object):
def __init__(self, media_id, link_id=None):
self.media_id = media_id
self.link_id = link_id
@property
def embed(self):
raise Exception('Source type not implemented.')
@property
def link(self):
raise Exception('Source type not implemented.')
c... | mit | Python |
53d640936d13e841346fd32153b4a077ba3dd26e | Update documentation | pybel/pybel-tools,pybel/pybel-tools,pybel/pybel-tools | src/pybel_tools/dict_manager.py | src/pybel_tools/dict_manager.py | # -*- coding: utf-8 -*-
"""This class contains an alternate implementation of the PyBEL database manager that only stores graphs
in memory
"""
from pybel.manager import Manager
class _Namespace(object):
pass
class DictManager(Manager):
"""A dictionary-based implementation of the PyBEL Manager"""
def ... | # -*- coding: utf-8 -*-
"""This class contains an alternate implemenation of the PyBEL database manager that only stores graphs
in memory
"""
from pybel.manager import Manager
class _Namespace(object):
pass
class DictManager(Manager):
"""A dictionary-based implementation of the PyBEL Manager"""
def _... | mit | Python |
b98af17e1115ac7c6d591a98d6ac2ddd45e2e3cd | duplicate get method | FBRTMaka/ooi-ui-services,birdage/ooi-ui-services,asascience-open/ooi-ui-services,oceanzus/ooi-ui-services,DanielJMaher/ooi-ui-services,Bobfrat/ooi-ui-services | ooiservices/controller/user.py | ooiservices/controller/user.py | #!/usr/bin/env python
'''
ooiservices.controller.user
UserAdd
UserLogin
'''
from ooiservices.controller.base import ObjectController
from ooiservices.model.user import UserModel
from flask import request
from flask.ext.restful import Resource
__author__ = "Matt Campbell"
class UserAdd(ObjectController):
model ... | #!/usr/bin/env python
'''
ooiservices.controller.user
UserAdd
UserLogin
'''
from ooiservices.controller.base import ObjectController
from ooiservices.model.user import UserModel
from flask import request
from flask.ext.restful import Resource
__author__ = "Matt Campbell"
class UserAdd(ObjectController):
model ... | apache-2.0 | Python |
b859f7a23f2a16c1db91388b6059abf4426eeb56 | Bump version 0.19.0rc2 --> 0.19.0rc3 | lbryio/lbry,lbryio/lbry,lbryio/lbry | lbrynet/__init__.py | lbrynet/__init__.py | import logging
__version__ = "0.19.0rc3"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| import logging
__version__ = "0.19.0rc2"
version = tuple(__version__.split('.'))
logging.getLogger(__name__).addHandler(logging.NullHandler())
| mit | Python |
6604f5d0056208b5a2846d6d97498728dec0e32a | fix interact on py37 (#7) | aamalev/aioworkers,aioworkers/aioworkers | aioworkers/core/interact.py | aioworkers/core/interact.py | import asyncio
import concurrent.futures
from functools import partial
from threading import Thread
def _await(coro, context):
f = concurrent.futures.Future()
async def wrap(coro):
try:
result = await coro
except Exception as e:
f.set_exception(e)
else:
... | import asyncio
import concurrent.futures
from functools import partial
from threading import Thread
def _await(coro, context):
f = concurrent.futures.Future()
async def wrap(coro):
try:
result = await coro
except Exception as e:
f.set_exception(e)
else:
... | apache-2.0 | Python |
69386bee7135fe74161aed74ff2a621c806913b2 | Set version as 0.8.8 | Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend | alignak_backend/__init__.py | alignak_backend/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Alignak REST backend
This module is an Alignak REST backend
"""
# Application version and manifest
VERSION = (0, 8, 0)
__application__ = u"Alignak_Backend"
__short_version__ = '.'.join((str(each) for each in VERSION[:2]))
__version__ = '.'.join((str(each) fo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Alignak REST backend
This module is an Alignak REST backend
"""
# Application version and manifest
VERSION = (0, 7, 4)
__application__ = u"Alignak_Backend"
__short_version__ = '.'.join((str(each) for each in VERSION[:2]))
__version__ = '.'.join((str(each) fo... | agpl-3.0 | Python |
7eb106c739df7cd1af51e7062f72a1def278e26c | Set version as 0.8.17 | Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend | alignak_backend/__init__.py | alignak_backend/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Alignak REST backend
This module is an Alignak REST backend
"""
# Application version and manifest
VERSION = (0, 8, 17)
__application__ = u"Alignak_Backend"
__short_version__ = '.'.join((str(each) for each in VERSION[:2]))
__version__ = '.'.join((str(each) f... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Alignak REST backend
This module is an Alignak REST backend
"""
# Application version and manifest
VERSION = (0, 8, 16)
__application__ = u"Alignak_Backend"
__short_version__ = '.'.join((str(each) for each in VERSION[:2]))
__version__ = '.'.join((str(each) f... | agpl-3.0 | Python |
daf7061984d0b940f56e54003d7a9d039afd8c22 | allow to import from global namespace | cyberdelia/ganglia | ganglia/__init__.py | ganglia/__init__.py | # -*- coding: utf-8 -*-
from ganglia import GMetric
| mit | Python | |
dcbbd1c6f5043126948b6a1d0eadffe09964b852 | Simplify news route | TornikeNatsvlishvili/skivri.ge,TornikeNatsvlishvili/skivri.ge,TornikeNatsvlishvili/skivri.ge,TornikeNatsvlishvili/skivri.ge | backend/skivrige/api/views/news.py | backend/skivrige/api/views/news.py | from flask import render_template, request, current_app, jsonify
from flask.views import MethodView
from skivrige.helpers.pagination import Pagination
from skivrige.helpers.filters import timedelta
from skivrige.extensions import mongo
from pymongo import DESCENDING
class News(MethodView):
def get(self):
l... | from flask import render_template, request, current_app, jsonify
from flask.views import MethodView
from skivrige.helpers.pagination import Pagination
from skivrige.helpers.filters import timedelta
from skivrige.extensions import mongo
class News(MethodView):
def get(self):
language = request.args.get('lan... | mit | Python |
69304be6df25ba2db53985b3d1e2e66954b7d655 | Add argument to @wraps decorator | hatchery/Genepool2,hatchery/genepool | genes/lib/traits.py | genes/lib/traits.py | from functools import wraps
def if_any(*conds):
def wrapper(func):
@wraps(func)
def run_if_any(*args, **kwargs):
if any(conds):
return func(*args, **kwargs)
return run_if_any
return wrapper
def if_all(*conds):
def wrapper(func):
@wraps(func... | from functools import wraps
def if_any(*conds):
def wrapper(func):
@wraps
def run_if_any(*args, **kwargs):
if any(conds):
return func(*args, **kwargs)
return run_if_any
return wrapper
def if_all(*conds):
def wrapper(func):
@wraps
de... | mit | Python |
72e9e138a6e96dcb0049bc5d196636c3843223ed | Update pipeline.py | s4n7h0/intelmq,aaronkaplan/intelmq-old,Phantasus/intelmq,aaronkaplan/intelmq-old,aaronkaplan/intelmq-old | src/lib/pipeline.py | src/lib/pipeline.py | import pika
class Pipeline():
def __init__(self, source_queue, destination_queues, host=None, port=None):
self.source_queue = source_queue
self.destination_queues = destination_queues
self.connect()
def connect(self):
if self.source_queue:
self.source_conn... | import pika
class Pipeline():
def __init__(self, source_queue, destination_queues, host=None, port=None):
if source_queue is not None:
self.source_connection = pika.BlockingConnection()
self.source_channel = self.source_connection.channel()
self.source_channel.q... | agpl-3.0 | Python |
9f217bde44160f3bb71271bd1222c0e6f74b9046 | fix HLS URL regex and plugin (#3185) | streamlink/streamlink,beardypig/streamlink,gravyboat/streamlink,chhe/streamlink,gravyboat/streamlink,bastimeyer/streamlink,bastimeyer/streamlink,chhe/streamlink,streamlink/streamlink,melmorabity/streamlink,melmorabity/streamlink,beardypig/streamlink | src/streamlink/plugins/tv360.py | src/streamlink/plugins/tv360.py | import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream
class TV360(Plugin):
url_re = re.compile(r"https?://(?:www.)?tv360.com.tr/canli-yayin")
hls_re = re.compile(r'''src="(http.*m3u8)"''')
hls_schema = validate.Schema(
v... | from __future__ import print_function
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream
class TV360(Plugin):
url_re = re.compile(r"https?://(?:www.)?tv360.com.tr/canli-yayin")
hls_re = re.compile(r'''hls.loadSource\(["'](http.*m... | bsd-2-clause | Python |
aa476cf4c138d935f90776f891c09c6315d96b49 | update example | arambadk/django-datatable,shymonk/django-datatable,arambadk/django-datatable,shymonk/django-datatable,arambadk/django-datatable,shymonk/django-datatable | example/app/tables.py | example/app/tables.py | #!/usr/bin/env python
# coding: utf-8
from table import Table, Column
class PersonTable(Table):
id = Column(index=True, title=u'序号', width='50%')
name = Column(field='name', title=u'姓名', width='50%')
| #!/usr/bin/env python
# coding: utf-8
from table import Table, Column
class PersonTable(Table):
id = Column(index=True, title=u'序号')
name = Column(attr='name', title=u'姓名')
| mit | Python |
d4d9850379ee3af0689fb182287a62ae4226cf25 | Use plot option to plot the output. | SiccarPoint/landlab,laijingtao/landlab,RondaStrauch/landlab,landlab/landlab,ManuSchmi88/landlab,cmshobe/landlab,laijingtao/landlab,RondaStrauch/landlab,amandersillinois/landlab,csherwood-usgs/landlab,ManuSchmi88/landlab,landlab/landlab,decvalts/landlab,decvalts/landlab,csherwood-usgs/landlab,RondaStrauch/landlab,landla... | landlab/components/flexure/examples/example_random_point_loads.py | landlab/components/flexure/examples/example_random_point_loads.py | #! /usr/bin/env python
import numpy as np
from landlab.components.flexure import FlexureComponent
from landlab import RasterModelGrid
def get_random_load_locations(shape, n_loads):
return np.random.random_integers(0, shape[0] * shape[1] - 1, n_loads)
def get_random_load_magnitudes(n_loads):
return np.rand... | #! /usr/bin/env python
import numpy as np
from landlab.components.flexure import FlexureComponent
from landlab import RasterModelGrid
def get_random_load_locations(shape, n_loads):
return np.random.random_integers(0, shape[0] * shape[1] - 1, n_loads)
def get_random_load_magnitudes(n_loads):
return np.rand... | mit | Python |
3bf30f5ea5d9045f7692b714c9ae18b2c4a46fdf | simplify `tools.number.trimDecimals` | gee-community/gee_tools | geetools/tools/number.py | geetools/tools/number.py | # coding=utf-8
""" Module holding tools for ee.Number """
import ee
import ee.data
def trimDecimals(number, places=2):
""" Decrease the number of decimals in a ee.Number
:param places: number of decimal places to leave
:return: a function to map over a list
"""
factor = ee.Number(10).pow(ee.Numbe... | # coding=utf-8
""" Module holding tools for ee.Number """
import ee
import ee.data
def trimDecimals(number, places=2):
""" Decrease the number of decimals in a ee.Number
:param places: number of decimal places to leave
:return: a function to map over a list
"""
factor = ee.Number(10).pow(ee.Numbe... | mit | Python |
a3233946535723ada5c06b3e10c005270c4d0c90 | Bump version | andrew-plunk/docker-registry,wakermahmud/docker-registry,mboersma/docker-registry,atyenoria/docker-registry,stormltf/docker-registry,dedalusdev/docker-registry,pombredanne/docker-registry,tangkun75/docker-registry,dhiltgen/docker-registry,dedalusdev/docker-registry,Carrotzpc/docker-registry,tangkun75/docker-registry,mb... | docker_registry/server/__init__.py | docker_registry/server/__init__.py | # -*- coding: utf-8 -*-
__author__ = 'Docker Registry Contributors'
__copyright__ = 'Copyright 2014 Docker'
__credits__ = []
__license__ = 'Apache 2.0'
__version__ = '1.0.0-dev'
__maintainer__ = __author__
__email__ = 'docker-dev@googlegroups.com'
__status__ = 'Production'
__title__ = 'docker-registry'
__build__ = 0... | # -*- coding: utf-8 -*-
__author__ = 'Docker Registry Contributors'
__copyright__ = 'Copyright 2014 Docker'
__credits__ = []
__license__ = 'Apache 2.0'
__version__ = '0.9.1'
__maintainer__ = __author__
__email__ = 'docker-dev@googlegroups.com'
__status__ = 'Production'
__title__ = 'docker-registry'
__build__ = 0x000... | apache-2.0 | Python |
63912d5515a5d2c33ab73e1a0c0f2a08480886bb | Add with_metaclass | DasIch/pyalysis,DasIch/pyalysis | pyalysis/_compat.py | pyalysis/_compat.py | # coding: utf-8
"""
pyalysis._compat
~~~~~~~~~~~~~~~~
:copyright: 2014 by Daniel Neuhäuser and Contributors
"""
import sys
try:
import __pypy__
PYPY = True
except ImportError:
PYPY = False
PY2 = sys.version_info[0] == 2
# copied from Flask: flask/_compat.py
# copyright 20... | # coding: utf-8
"""
pyalysis._compat
~~~~~~~~~~~~~~~~
:copyright: 2014 by Daniel Neuhäuser and Contributors
"""
import sys
try:
import __pypy__
PYPY = True
except ImportError:
PYPY = False
PY2 = sys.version_info[0] == 2
| bsd-3-clause | Python |
43b8652174c6f1920bcca82739bed783082432c7 | Use cPickle for six.moves | bwalks/pymemcache,ewdurbin/pymemcache,pinterest/pymemcache,pinterest/pymemcache,sontek/pymemcache,sontek/pymemcache | pymemcache/serde.py | pymemcache/serde.py | # Copyright 2012 Pinterest.com
#
# 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 2012 Pinterest.com
#
# 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 |
b98d0844c1fc3312b8d86745f9a57881fe203096 | make it treat the new changelog as html | guardian/scala-automation | docs/buildChangelog.py | docs/buildChangelog.py | #!/usr/bin/python
import os
import tarfile
import urllib
import subprocess
if not os.path.exists("local.tools/gitchangelog-2.1.3"):
os.mkdir("local.tools")
urllib.URLopener().retrieve("https://pypi.python.org/packages/source/g/gitchangelog/gitchangelog-2.1.3.tar.gz","local.tools/gitchangelog-2.1.3.tar.gz")
... | #!/usr/bin/python
import os
import tarfile
import urllib
import subprocess
if not os.path.exists("local.tools/gitchangelog-2.1.3"):
os.mkdir("local.tools")
urllib.URLopener().retrieve("https://pypi.python.org/packages/source/g/gitchangelog/gitchangelog-2.1.3.tar.gz","local.tools/gitchangelog-2.1.3.tar.gz")
... | apache-2.0 | Python |
a4b2b4efe5a34d8dea43b053abcf5536f84d3504 | BUMP 1.1 | mongodb/mongo-python-driver,jbenet/mongo-python-driver,ShaneHarvey/mongo-python-driver,jameslittle/mongo-python-driver,inspectlabs/mongo-python-driver,aherlihy/mongo-python-driver,aherlihy/mongo-python-driver,develf/mongo-python-driver,develf/mongo-python-driver,mher/pymongo,pigate/mongo-python-driver,ameily/mongo-pyth... | pymongo/__init__.py | pymongo/__init__.py | # Copyright 2009 10gen, 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, soft... | # Copyright 2009 10gen, 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, soft... | apache-2.0 | Python |
501a1cf0c7b31773fb02bc2966f5c1db99311b36 | Remove unnecessary else statement (#7759) | TheAlgorithms/Python | maths/karatsuba.py | maths/karatsuba.py | """ Multiply two numbers using Karatsuba algorithm """
def karatsuba(a, b):
"""
>>> karatsuba(15463, 23489) == 15463 * 23489
True
>>> karatsuba(3, 9) == 3 * 9
True
"""
if len(str(a)) == 1 or len(str(b)) == 1:
return a * b
m1 = max(len(str(a)), len(str(b)))
m2 = m1 // 2
... | """ Multiply two numbers using Karatsuba algorithm """
def karatsuba(a, b):
"""
>>> karatsuba(15463, 23489) == 15463 * 23489
True
>>> karatsuba(3, 9) == 3 * 9
True
"""
if len(str(a)) == 1 or len(str(b)) == 1:
return a * b
else:
m1 = max(len(str(a)), len(str(b)))
... | mit | Python |
0533ed6b2e5754e4fbf45ad55412946a7d7e3cd0 | Bump to 0.2.2 | shezadkhan137/required | src/required/__init__.py | src/required/__init__.py | from __future__ import absolute_import, division, print_function
from .requires import Requires, RequirementError, validate
from .expressions import R
__version__ = "0.2.2"
__title__ = "required"
__description__ = "A easy dependency validator"
__uri__ = "https://github.com/shezadkhan137/required"
__doc__ = __descrip... | from __future__ import absolute_import, division, print_function
from .requires import Requires, RequirementError, validate
from .expressions import R
__version__ = "0.1.4"
__title__ = "required"
__description__ = "A easy dependency validator"
__uri__ = "https://github.com/shezadkhan137/required"
__doc__ = __descrip... | mit | Python |
9cd2cd2fac51425e51455be623833f40890077c3 | add getValue and support datetime object as constructor | jaredly/pyjamas,jaredly/pyjamas,jaredly/pyjamas,jaredly/pyjamas | library/datetime.py | library/datetime.py | class Datetime:
def __init__(self, year=None, month=None, day=None, hours=None, minutes=None, seconds=None):
JS("""
if (seconds != null)
this.date = new Date(year, month, day, hours, minutes, seconds);
else if (minutes != null)
this.date = new Date(year, month, day, hours, minutes);
else if (h... | class Datetime:
def __init__(self, year=None, month=None, day=None, hours=None, minutes=None, seconds=None):
JS("""
if (seconds != null)
this.date = new Date(year, month, day, hours, minutes, seconds);
else if (minutes != null)
this.date = new Date(year, month, day, hours, minutes);
else if (h... | apache-2.0 | Python |
f0ab4bae1592e65049218fa5383ae801ace06d69 | Add image fetching with an ID | terop/latexbot,terop/latexbot | latexbot.py | latexbot.py | #!/usr/bin/env python3
"""A program (bot) for rendering short snippets of LaTeX code as an image.
A LaTeX distribution needs to be installed on the machine where this code
is ran."""
import sys
from io import BytesIO
from tempfile import NamedTemporaryFile
from os.path import basename
import re
from sympy import prev... | #!/usr/bin/env python3
"""A program (bot) for rendering short snippets of LaTeX code as an image.
A LaTeX distribution needs to be installed on the machine where this code
is ran."""
import sys
from io import BytesIO
from tempfile import NamedTemporaryFile
from os.path import basename
import re
from sympy import prev... | mit | Python |
8620b6b2e0b3d00681b317e82270a3843ec403da | fix some processing bugs | ninjaaron/lazydots,ninjaaron/lazydots | lazydots.py | lazydots.py | import unicodedata
from pathlib import Path
import deromanize
import yaml
CONFIG_FILE = Path(__file__).parent/'data.yml'
CACHE_PATH = Path().home()/'.cache'/'lzdcache'
CACHE_PATH.parent.mkdir(exist_ok=True)
with CONFIG_FILE.open(encoding='utf-8') as config:
keys = deromanize.cached_keys(yaml.safe_load, config, CAC... | import unicodedata
from pathlib import Path
import deromanize
import yaml
CONFIG_FILE = Path(__file__).parent/'data.yml'
CACHE_PATH = Path().home()/'.cache'/'lzdcache'
CACHE_PATH.parent.mkdir(exist_ok=True)
with CONFIG_FILE.open(encoding='utf-8') as config:
keys = deromanize.cached_keys(yaml.safe_load, config, CAC... | mpl-2.0 | Python |
76244d9a9750d1e095884b3a453caffa6d1ef3c4 | Hide last task and services with negative score from main page | Davidyuk/witcoin,Davidyuk/witcoin | main/views/views.py | main/views/views.py | from django.shortcuts import render
from main.models import UserProfile, Transaction, Task, Service
from django.db.models import Avg
from voting.models import Vote
def index(request):
users = UserProfile.objects.all()
tasks_last = Task.objects.filter(status=True).order_by('-timestamp_create')[:10]
votes ... | from django.shortcuts import render
from main.models import UserProfile, Transaction, Task, Service
from django.db.models import Avg
def index(request):
users = UserProfile.objects.all()
return render(request, 'main/index.html', {
'users_top_spend': sorted(users, key=lambda a: a.spend(), reverse=True)... | agpl-3.0 | Python |
3f4f490f9a7d5c57f639b7c88dbf1eb6c6b4e87b | Update installer to use guestagent 180. | xenserver/win-installer,xenserver/win-installer,OwenSmith/win-installer,kostaslamda/win-installer,xenserver/win-installer,OwenSmith/win-installer,kostaslamda/win-installer,OwenSmith/win-installer,kostaslamda/win-installer,kostaslamda/win-installer,xenserver/win-installer,kostaslamda/win-installer,xenserver/win-installe... | manifestspecific.py | manifestspecific.py | # Copyright (c) Citrix Systems Inc.
# 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, this list of conditions a... | # Copyright (c) Citrix Systems Inc.
# 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, this list of conditions a... | bsd-2-clause | Python |
c776d792e1a156469b91fbb9205ab8606f318952 | Update version.py | mir-dataset-loaders/mirdata | mirdata/version.py | mirdata/version.py | #!/usr/bin/env python
"""Version info"""
short_version = "0.3"
version = "0.3.4b0"
| #!/usr/bin/env python
"""Version info"""
short_version = "0.3"
version = "0.3.3"
| bsd-3-clause | Python |
fe7165a414976e94c98d03c01f1d7c0ca6f278b6 | change motor | kervi/can-bot | app/controllers/steering.py | app/controllers/steering.py | """ Sample controller """
from kervi.controller import Controller, UINumberControllerInput, UIButtonControllerInput
from kervi.hal import GPIO
from kervi.steering import MotorSteering
from kervi_devices.motors.adafruit_i2c_motor_hat import AdafruitMotorHAT
class SteeringController(Controller):
def __init__(self):
... | """ Sample controller """
from kervi.controller import Controller, UINumberControllerInput, UIButtonControllerInput
from kervi.hal import GPIO
from kervi.steering import MotorSteering
from kervi_devices.motors.adafruit_i2c_motor_hat import AdafruitMotorHAT
class SteeringController(Controller):
def __init__(self):
... | mit | Python |
57a1d57221c3cc2b1871a47fbe46fbd1aff3c726 | Switch get location to convenience method | scolby33/OCSPdash,scolby33/OCSPdash,scolby33/OCSPdash | src/ocspdash/web/blueprints/api.py | src/ocspdash/web/blueprints/api.py | import base64
from hmac import compare_digest
from flask import Blueprint, jsonify, current_app, request
from ...models import Authority, Responder
api = Blueprint('api', __name__)
@api.route('/status')
def get_payload():
"""Spits back the current payload"""
payload = current_app.manager.make_payload()
... | import base64
from hmac import compare_digest
from flask import Blueprint, jsonify, current_app, request
from ...models import Authority, Responder, Location
api = Blueprint('api', __name__)
@api.route('/status')
def get_payload():
"""Spits back the current payload"""
payload = current_app.manager.make_pay... | mit | Python |
e369c68545f3c76e5e799b2d3fc9a1f814bd7036 | Use POST by default. | merll/server-tracking,merll/server-side-tracking | server_tracking/settings.py | server_tracking/settings.py | # -*- coding: utf-8 -*-
from six import iteritems
SST_DEFAULT_SETTINGS = {
'cookie_name': 'vn',
'cookie_action': 'cookie_action',
'cookie_status': 'cookie_status',
'cookie_status_refused': 0,
'cookie_status_accepted': 1,
'cookie_max_age': 63072000,
'cookie_path': '/',
'cookie_salt': ''... | # -*- coding: utf-8 -*-
from six import iteritems
SST_DEFAULT_SETTINGS = {
'cookie_name': 'vn',
'cookie_action': 'cookie_action',
'cookie_status': 'cookie_status',
'cookie_status_refused': 0,
'cookie_status_accepted': 1,
'cookie_max_age': 63072000,
'cookie_path': '/',
'cookie_salt': ''... | mit | Python |
76ae99db1088dfdd3dc8c9e001a53f72f8b1befd | Make Python code PEP 8 compliant | Necior/guess-color-name | guess_color_name.py | guess_color_name.py | #!/usr/bin/env python
colors = [ # names from colourlovers.com
(0, 0, 0, 'white'),
(255, 255, 255, 'black'),
(255, 0, 0, 'red'),
(0, 255, 0, 'green'),
(0, 0, 255, 'blue'),
(22, 147, 165, 'dutch teal'),
(255, 0, 102, 'hot pink'),
(251, 184, 41, 'heart of gold'),
(205, 215, 182, 'hau... | #!/usr/bin/env python
colors = [ # names from colourlovers.com
(0, 0, 0, 'white'),
(255, 255, 255, 'black'),
(255, 0, 0, 'red'),
(0, 255, 0, 'green'),
(0, 0, 255, 'blue'),
(22, 147, 165, 'dutch teal'),
(255, 0, 102, 'hot pink'),
(251, 184, 41, 'heart of gold'),
(205, 215, 182, 'haunted milk'),
(85, 98, 112, 'mighty sl... | mit | Python |
9dace0156af2941fbc8dac29e6333c5fec117c58 | Reformat description text | warnes/irrigatorpro,warnes/irrigatorpro,warnes/irrigatorpro,warnes/irrigatorpro | irrigator_pro/common/middleware.py | irrigator_pro/common/middleware.py | """
Add user created by ('cuser') and modified by ('muser') foreign key
refs to all models that contain these fields.
Based on
http://mindlace.wordpress.com/2012/10/19/automatically-associating-users-with-django-models-on-save/
and https://gist.github.com/mindlace/3918300.
Which was in turn almost entirely taken ... | """
Add user created by ('cuser') and modified by ('muser') foreign key refs to all models that contain these fields.
Based on
http://mindlace.wordpress.com/2012/10/19/automatically-associating-users-with-django-models-on-save/
and https://gist.github.com/mindlace/3918300.
Which was in turn almost entirely taken ... | mit | Python |
2e1f6ffe55df272542b5240ae9084acce40b9c2d | fix corner case | michaellaier/pymor,michaellaier/pymor,michaellaier/pymor,michaellaier/pymor | src/pymor/la/pod.py | src/pymor/la/pod.py | # This file is part of the pyMor project (http://www.pymor.org).
# Copyright Holders: Felix Albrecht, Rene Milk, Stephan Rave
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
import numpy as np
from scipy.linalg import eigh
... | # This file is part of the pyMor project (http://www.pymor.org).
# Copyright Holders: Felix Albrecht, Rene Milk, Stephan Rave
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
import numpy as np
from scipy.linalg import eigh
... | bsd-2-clause | Python |
193856a0363773e8af401617a25d858579434850 | add time | qszhuan/raspberry-pi,qszhuan/raspberry-pi,qszhuan/raspberry-pi | gpio/obstacle-avoidance-sensor-test.py | gpio/obstacle-avoidance-sensor-test.py | import RPi.GPIO as GPIO
import time
import datetime
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
IN_PIN = 18
GPIO.setup(IN_PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
i=GPIO.input(IN_PIN)
if i==0:
print(datetime.date... | import RPi.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
IN_PIN = 18
GPIO.setup(IN_PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
i=GPIO.input(IN_PIN)
if i==0:
print "Obstacle detected",i
... | mit | Python |
1bcbab8d5252c0aebfa924fa1fe90b22c9812152 | fix up run_tests() for CI | hoburg/gpfit,hoburg/gpfit,hoburg/gpfit,convexopt/gpfit,convexopt/gpfit,convexopt/gpfit | gpfit/tests/run_tests.py | gpfit/tests/run_tests.py | import unittest
from gpkit.tests.helpers import run_tests
TESTS = []
import t_LM
TESTS += t_LM.tests
import t_generic_resid_fun
TESTS += t_generic_resid_fun.tests
import t_lse_implicit
TESTS += t_lse_implicit.tests
import t_lse_scaled
TESTS += t_lse_scaled.tests
import t_max_affine_init
TESTS += t_max_affine_init.... | import unittest
TESTS = []
import t_LM
TESTS += t_LM.tests
import t_generic_resid_fun
TESTS += t_generic_resid_fun.tests
import t_lse_implicit
TESTS += t_lse_implicit.tests
import t_lse_scaled
TESTS += t_lse_scaled.tests
import t_max_affine_init
TESTS += t_max_affine_init.tests
import t_max_affine
TESTS += t_max_... | mit | Python |
57cdc95e9850b2f1affb036969316fc49c740fad | replace base_url with request.url_root | hasgeek/boxoffice,hasgeek/boxoffice,hasgeek/boxoffice,hasgeek/boxoffice | boxoffice/views/item_collection.py | boxoffice/views/item_collection.py | from flask import make_response, render_template, jsonify, request
from coaster.views import load_models
from boxoffice import app
from boxoffice.models import ItemCollection
from utils import xhr_only, cors
def jsonify_item(item):
price = item.current_price()
if price:
return {
'name': it... | from flask import make_response, render_template, jsonify, request
from coaster.views import load_models
from boxoffice import app
from boxoffice.models import ItemCollection
from utils import xhr_only, cors
def jsonify_item(item):
price = item.current_price()
if price:
return {
'name': it... | agpl-3.0 | Python |
7e43518d3928ac6ddc933cbc40fd4a30a19072c0 | set nosignal here and disable sigio | pycurl/pycurl,p/pycurl-archived,pycurl/pycurl,pycurl/pycurl,p/pycurl-archived,p/pycurl-archived | examples/xmlrpc_curl.py | examples/xmlrpc_curl.py | #! /usr/bin/env python
# vi:ts=4:et
# $Id$
# We should ignore SIGPIPE when using pycurl.NOSIGNAL - see the libcurl
# documentation `libcurl-the-guide' for more info.
try:
import signal
from signal import SIGPIPE, SIG_IGN
signal.signal(signal.SIGPIPE, signal.SIG_IGN)
except ImportError: pass
import xmlrpc... | #! /usr/bin/env python
# vi:ts=4:et
# $Id$
import xmlrpclib, pycurl
try: import cStringIO as StringIO
except: import StringIO
class CURLTransport(xmlrpclib.Transport):
"""Handles a cURL HTTP transaction to an XML-RPC server."""
xmlrpc_h = [ "User-Agent: PycURL XML-RPC", "Content-Type: text/xml" ]
def... | lgpl-2.1 | Python |
6dbd68c3546f677e662938190fb2134ae056dcb1 | Add input_check_1d function to do 1-D input check. Non-array (e.g. float or int) will be converted into 1-D array 2-D arrays will be reshaped to 1-D and this will check for Nx1 type input. | adhika/NavPy,NavPy/NavPy,hamid-m/NavPy | navpy.py | navpy.py | import numpy as np
def eul2quat(rotAngle1,rotAngle2,rotAngle3,
input_unit='rad',rotation_sequence='ZYX'):
"""
"""
# INPUT CHECK
rotAngle1,N1 = input_check_1d(rotAngle1)
rotAngle2,N2 = input_check_1d(rotAngle2)
rotAngle3,N3 = input_check_1d(rotAngle3)
if( (N1!=... | import numpy as np
def eul2quat(rotAngle1,rotAngle2,rotAngle3,
input_unit='rad',rotation_sequence='ZYX'):
"""
"""
"""
# INPUT CHECK
rotAngle1 = np.array(rotAngle1)
rotAngle2 = np.array(rotAngle2)
rotAngle3 = np.array(rotAngle3)
if(len(rotAngle1.shape)==0):
r... | bsd-3-clause | Python |
ca3572376f1a84da8a288e6c6e24c6c37ff2021e | print stderr from pants run. (#13223) | pantsbuild/pants,pantsbuild/pants,pantsbuild/pants,pantsbuild/pants,benjyw/pants,benjyw/pants,benjyw/pants,benjyw/pants,benjyw/pants,benjyw/pants,benjyw/pants,pantsbuild/pants,pantsbuild/pants,pantsbuild/pants | src/python/pants/backend/docker/goals/run_image_integration_test.py | src/python/pants/backend/docker/goals/run_image_integration_test.py | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from textwrap import dedent
from pants.testutil.pants_integration_test import PantsResult, run_pants, setup_tmpdir
def run_pants_with_sources(sources... | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from textwrap import dedent
from pants.testutil.pants_integration_test import PantsResult, run_pants, setup_tmpdir
def run_pants_with_sources(sources... | apache-2.0 | Python |
5d0c190468ef4323c907cd1091c647b3bee9b5ff | Use batch for foreign_key sqlite | moloch--/RootTheBox,moloch--/RootTheBox,moloch--/RootTheBox,moloch--/RootTheBox | alembic/versions/de5d615ae090_add_user_to_penalty_stat.py | alembic/versions/de5d615ae090_add_user_to_penalty_stat.py | """add user to penalty stat
Revision ID: de5d615ae090
Revises: 31918b83c372
Create Date: 2022-10-14 19:33:02.808038
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.engine.reflection import Inspector
conn = op.get_bind()
inspector = Inspector.from_engine(conn)
tables = inspector.get_table_names()
... | """add user to penalty stat
Revision ID: de5d615ae090
Revises: 31918b83c372
Create Date: 2022-10-14 19:33:02.808038
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.engine.reflection import Inspector
conn = op.get_bind()
inspector = Inspector.from_engine(conn)
tables = inspector.get_table_names()
... | apache-2.0 | Python |
bdeeafddccc49f685e25487153dca841e088cff1 | fix date.from_string() | rmartinjak/mensanotify,rmartinjak/mensanotify | mensanotify/date.py | mensanotify/date.py | import locale
import datetime
ISO_FORMAT = '%Y-%m-%d'
def from_string(datestr, fmt, source_locale):
old_loc = locale.getlocale()
try:
locale.setlocale(locale.LC_TIME, (source_locale, 'UTF-8'))
d = datetime.datetime.strptime(datestr, fmt).date()
finally:
locale.setlocale(locale.LC_... | import locale
import datetime
ISO_FORMAT = '%Y-%m-%d'
def from_string(datestr, fmt, source_locale):
old_loc = locale.getlocale()
try:
locale.setlocale(locale.LC_TIME, (loc, source_locale))
d = datetime.strptime(datestr, fmt).date()
finally:
locale.setlocale(locale.LC_TIME, old_loc... | mit | Python |
946e2bf5518475ed1cd1cbdb05d2c4bfd7eda65c | check for profile | praekelt/django-profile,praekelt/django-userprofile,praekelt/django-userprofile,praekelt/django-profile | profile/__init__.py | profile/__init__.py | from django.contrib.auth.models import SiteProfileNotAvailable
from django.core.exceptions import ImproperlyConfigured
from django.db.models.signals import class_prepared
from django.conf import settings
auth_profile_module = getattr(settings, 'AUTH_PROFILE_MODULE', None)
if not auth_profile_module:
raise Imp... | from django.db.models.signals import class_prepared
from django.contrib.auth.models import SiteProfileNotAvailable
# connect profile property to User model
def connect_profile(sender, **kwargs):
from profile import utils
try:
profile_model = utils.get_profile_model()
except SiteProfileNotAvailabl... | bsd-3-clause | Python |
71aa06ead2671e363937acda8bed62e7e441b90e | add a reverse relation for releases on PackageResource | crateio/crate.io | crate_project/apps/packages/api.py | crate_project/apps/packages/api.py | from tastypie import fields
from tastypie.resources import ModelResource
from packages.models import Package, Release
class PackageResource(ModelResource):
releases = fields.ToManyField("packages.api.ReleaseResource", "releases")
class Meta:
queryset = Package.objects.all()
resource_name = "... | from tastypie import fields
from tastypie.resources import ModelResource
from packages.models import Package, Release
class PackageResource(ModelResource):
class Meta:
queryset = Package.objects.all()
resource_name = "package"
class ReleaseResource(ModelResource):
package = fields.ForeignKe... | bsd-2-clause | Python |
89375f999c3d8e6bd0da64dc58a66ea46f42b541 | Fix disconnect | DavidLP/hass_scripts | hass_scripts/tts.py | hass_scripts/tts.py | import logging
import asyncio
import os
import tempfile
from hbmqtt import client
from hbmqtt.mqtt.constants import QOS_0
from gtts import gTTS
logger = logging.getLogger(__name__)
# Used console command to play mp3 file
MP3_CMD = 'mpg123 -q'
# MQTT settings
MQTT_SERVER = 'mqtts://192.168.1.200:8883'
MQTT_TOPIC = '/... | import logging
import asyncio
import os
import tempfile
from hbmqtt import client
from hbmqtt.mqtt.constants import QOS_0
from gtts import gTTS
logger = logging.getLogger(__name__)
# Used console command to play mp3 file
MP3_CMD = 'mpg123 -q'
# MQTT settings
MQTT_SERVER = 'mqtts://192.168.1.200:8883'
MQTT_TOPIC = '/... | mit | Python |
0b449e2cd19a777cab3a30d24db742e8fcb7fdee | Add blocks of the collector.py | Codeberry-Black/code-quiz,Codeberry-Black/code-quiz | mining/collector.py | mining/collector.py | import urllib2
import urllib
from StringIO import StringIO
import gzip
import json
import os
class Manager():
def __init__(self):
self.atags = {}
self.aids = {}
#self.answer_lock
self.qtags = {}
self.qids = {}
def add_question(self, ID, body, tags):
print(id... | print('START');
| apache-2.0 | Python |
237611fda64dbe457cd4c921dc6dc6655fe3c089 | change " menu >" to "[ menu ▸ ]" | CanonicalLtd/subiquity,CanonicalLtd/subiquity | subiquitycore/ui/buttons.py | subiquitycore/ui/buttons.py | # Copyright 2017 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | # Copyright 2017 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | agpl-3.0 | Python |
5c9d9927d20c7f56b9a0bc9c5c1ae0fe5a58f4bf | remove unneeded custom command | jorgebay/tinkerpop,apache/incubator-tinkerpop,artem-aliev/tinkerpop,apache/tinkerpop,robertdale/tinkerpop,BrynCooke/incubator-tinkerpop,apache/tinkerpop,krlohnes/tinkerpop,robertdale/tinkerpop,jorgebay/tinkerpop,samiunn/incubator-tinkerpop,apache/tinkerpop,artem-aliev/tinkerpop,robertdale/tinkerpop,artem-aliev/tinkerpo... | gremlin-python/src/main/jython/setup.py | gremlin-python/src/main/jython/setup.py | '''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | '''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | apache-2.0 | Python |
54308a0098bd05f308d31297b0aa026246db97c0 | Update docstring | alexandermendes/pybossa-github-builder,alexandermendes/pybossa-github-builder | pybossa_github_builder/__init__.py | pybossa_github_builder/__init__.py | # -*- coding: utf8 -*-
"""
pybossa-github-builder
-------------
A PyBossa plugin for creating projects directly from GitHub repositories.
"""
import os
import json
from flask import current_app as app
from flask.ext.plugins import Plugin
from .extensions import github
__plugin__ = "PyBossaGitHubBuilder"
__version__ ... | # -*- coding: utf8 -*-
"""
pybossa-github-builder
-------------
A PyBossa plugin for creating projects directly from GitHub repositories.
"""
import os
import json
from flask import current_app as app
from flask.ext.plugins import Plugin
from .extensions import github
__plugin__ = "PyBossaGitHubBuilder"
__version__ ... | bsd-3-clause | Python |
b0bc2aae6e80b490277d32b1a2dc19871623749b | Update version | karel-brinda/prophyle,karel-brinda/prophyle,karel-brinda/prophyle,karel-brinda/prophyle | prophyle/version.py | prophyle/version.py | VERSION="0.3.0.0"
| VERSION="0.2.2.0"
| mit | Python |
50fa273d0c94cb54b5b531a74ded0991f53fe038 | fix spelling in comments | alfredodeza/merfi | merfi/decorators.py | merfi/decorators.py | import sys
from merfi.util import red_arrow
from functools import wraps
def catches(catch=None, handler=None, exit=True):
"""
Very simple decorator that tries any of the exception(s) passed in as
a single exception class or tuple (containing multiple ones) returning the
exception message and optionall... | import sys
from merfi.util import red_arrow
from functools import wraps
def catches(catch=None, handler=None, exit=True):
"""
Very simple decorator that tries any of the exception(s) passed in as
a single exception class or tuple (containing multiple ones) returning the
exception message and optionall... | mit | Python |
c6b463183e38d0b5861cb5d07d01209e8f6c46ed | Add unit tests for Tag class | TomGijselinck/mywebsite,TomGijselinck/mywebsite | myblogapp/tests.py | myblogapp/tests.py | from django.test import TestCase
from myblogapp.models import Post, Tag
from django.core.urlresolvers import reverse
class PostTestCase(TestCase):
# models test
def setUp(self):
Post.objects.create(title="R. Feynman and QED", body="It's just revolutionary")
def get_post(self, title="R. Feynman and... | from django.test import TestCase
from myblogapp.models import Post, Tag
from django.core.urlresolvers import reverse
class PostTestCase(TestCase):
# models test
def setUp(self):
Post.objects.create(title="R. Feynman and QED", body="It's just revolutionary")
def get_post(self, title="R. Feynman and... | mit | Python |
cb3312419f20b10d92cff4ec06606a2b7ee91950 | Add Justin to authors, fix comments | cigroup-ol/metaopt,cigroup-ol/metaopt,cigroup-ol/metaopt | metaopt/__init__.py | metaopt/__init__.py | # -*- coding:utf-8 -*-
"""
Root package of MetaOpt.
"""
__author__ = 'Renke Grunwald, Bengt Lüers, Jendrik Poloczek, Justin Heinermann'
__author_email__ = 'info@metaopt.org'
__license__ = '3-Clause BSD'
# __maintainer__ = "first last"
# __maintainer_email__ = "first.last@example.com"
__url__ = 'http://organic-es.tumblr... | # -*- coding:utf-8 -*-
"""
Root package of MetaOpt.
"""
__author__ = 'Renke Grunwald, Bengt Lüers, Jendrik Poloczek'
__author_email__ = 'info@metaopt.org'
__license__ = '3-Clause BSD'
#__maintainer__ = "first last"
#__maintainer_email__ = "first.last@example.com"
__url__ = 'http://organic-es.tumblr.com/'
__version__ = ... | bsd-3-clause | Python |
5b7133200d19d37027b5e7ada0f5a80adb151739 | Set the end time on failure or success. | ionrock/dadd,ionrock/dadd,ionrock/dadd,ionrock/dadd | dadd/master/api/procs.py | dadd/master/api/procs.py | from datetime import datetime
from flask import jsonify, request, make_response, abort
from dadd.master import app
from dadd.master.models import db, Process, Logfile
from sqlalchemy import desc
def set_proc_state(pid, state):
proc = Process.query.get(pid)
if not proc:
app.logger.error('Error setti... | from flask import jsonify, request, make_response, abort
from dadd.master import app
from dadd.master.models import db, Process, Logfile
from sqlalchemy import desc
def set_proc_state(pid, state):
proc = Process.query.get(pid)
if not proc:
app.logger.error('Error settings state %s. Pid %s not found'... | bsd-3-clause | Python |
a09cf17583ca558d3e4c77a1682ed01c223f182d | Support hostname that resolve to IPv6-only address | rtulke/ceph-deploy,ceph/ceph-deploy,codenrhoden/ceph-deploy,imzhulei/ceph-deploy,codenrhoden/ceph-deploy,isyippee/ceph-deploy,alfredodeza/ceph-deploy,ktdreyer/ceph-deploy,branto1/ceph-deploy,SUSE/ceph-deploy,zhouyuan/ceph-deploy,Vicente-Cheng/ceph-deploy,trhoden/ceph-deploy,ceph/ceph-deploy,branto1/ceph-deploy,zhouyuan... | ceph_deploy/util/arg_validators.py | ceph_deploy/util/arg_validators.py | import socket
import argparse
import re
class RegexMatch(object):
"""
Performs regular expression match on value.
If the regular expression pattern matches it will it will return an error
message that will work with argparse.
"""
def __init__(self, pattern, statement=None):
self.strin... | import socket
import argparse
import re
class RegexMatch(object):
"""
Performs regular expression match on value.
If the regular expression pattern matches it will it will return an error
message that will work with argparse.
"""
def __init__(self, pattern, statement=None):
self.strin... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.