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 |
|---|---|---|---|---|---|---|---|---|
420af24020a5a1d90f7ea6d4459e9a983ce11032 | update : add APIview url | deadlylaid/book_connect,deadlylaid/book_connect,deadlylaid/book_connect | wef/wef/urls.py | wef/wef/urls.py | """wef URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/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')
Class-based v... | """wef URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/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')
Class-based v... | mit | Python |
6c5aa31911a0cedecc8d5af5d95caebeaa27a2c5 | Comment in migration wagtailsearch.0003_remove_editors_picks | takeflight/wagtail,JoshBarr/wagtail,mayapurmedia/wagtail,bjesus/wagtail,Klaudit/wagtail,gogobook/wagtail,Toshakins/wagtail,inonit/wagtail,gasman/wagtail,Toshakins/wagtail,thenewguy/wagtail,mjec/wagtail,mixxorz/wagtail,timorieber/wagtail,tangentlabs/wagtail,wagtail/wagtail,gogobook/wagtail,JoshBarr/wagtail,nimasmi/wagta... | wagtail/wagtailsearch/migrations/0003_remove_editors_pick.py | wagtail/wagtailsearch/migrations/0003_remove_editors_pick.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wagtailsearch', '0002_add_verbose_names'),
]
operations = [
# EditorsPicks have been moved to the "wagtailsearchpromotions" module.
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wagtailsearch', '0002_add_verbose_names'),
]
operations = [
migrations.SeparateDatabaseAndState(
state_operations=[
... | bsd-3-clause | Python |
13a1acc7e2d4d7ad9812be8769671b79bdf402dc | Add start_foreground() method. | chrisdearman/micropython,toolmacher/micropython,Peetz0r/micropython-esp32,chrisdearman/micropython,bvernoux/micropython,adafruit/micropython,MrSurly/micropython-esp32,matthewelse/micropython,toolmacher/micropython,ryannathans/micropython,swegener/micropython,dxxb/micropython,adafruit/circuitpython,lowRISC/micropython,j... | esp8266/scripts/webrepl.py | esp8266/scripts/webrepl.py | # This module should be imported from REPL, not run from command line.
import socket
import uos
import network
import websocket
import websocket_helper
import _webrepl
listen_s = None
client_s = None
def setup_conn(port, accept_handler):
global listen_s
listen_s = socket.socket()
listen_s.setsockopt(socke... | # This module should be imported from REPL, not run from command line.
import socket
import uos
import network
import websocket
import websocket_helper
import _webrepl
listen_s = None
client_s = None
def setup_conn(port, accept_handler):
global listen_s, client_s
listen_s = socket.socket()
listen_s.setsoc... | mit | Python |
be40174929193085ccd38683e64944fb4aabb26b | Add option to timestamp each line from serial | recursify/serial-debug-tool | serial_reader.py | serial_reader.py | #!/usr/bin/env python
from argparse import ArgumentParser
import sys
import serial
from datetime import datetime
def run(device, baud, prefix=None):
with serial.Serial(device, baud, timeout=0.1) as ser:
while True:
line = ser.readline()
if not line:
continue
... | #!/usr/bin/env python
from argparse import ArgumentParser
import sys
import serial
def run(device, baud):
with serial.Serial(device, baud, timeout=0.1) as ser:
while True:
line = ser.readline()
if line:
sys.stdout.write(line)
if __name__ == '__main__':
parser =... | unlicense | Python |
e58d1595134dc6bcee2f466ddc9db4fd6c722b44 | Add test for get_user_docs_by_username | qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq | corehq/apps/users/tests/test_db_accessors.py | corehq/apps/users/tests/test_db_accessors.py | from django.test import TestCase
from corehq.apps.users.models import WebUser, CommCareUser
from corehq.apps.users.dbaccessors.all_commcare_users import (
get_all_commcare_users_by_domain,
get_user_docs_by_username
)
from corehq.apps.domain.models import Domain
class AllCommCareUsersTest(TestCase):
def se... | from django.test import TestCase
from corehq.apps.users.models import WebUser, CommCareUser
from corehq.apps.users.dbaccessors.all_commcare_users import get_all_commcare_users_by_domain
from corehq.apps.domain.models import Domain
class AllCommCareUsersTest(TestCase):
def setUpClass(cls):
cls.ccdomain = D... | bsd-3-clause | Python |
415514b4fb1e584072d1bc49516e3691e41a131d | Update pytorch.py | vadimkantorov/wigwam | wigs/pytorch.py | wigs/pytorch.py | class pytorch(PythonWig):
git_uri = 'https://github.com/pytorch/pytorch'
dependencies = ['numpy', 'cmake', 'pip-pyyaml', 'pip-cffi'] #, 'pip']
optional_dependencies = ['magma']
supported_features = ['cuda']
default_features = ['+cuda']
# TODO: set env CUDA_HOME for custom CUDA path
def switch_cuda(self, on):
... | class pytorch(PythonWig):
git_uri = 'https://github.com/pytorch/pytorch'
dependencies = ['numpy', 'cmake', 'pip-pyyaml', 'pip-cffi'] #, 'pip']
optional_dependencies = ['magma']
supported_features = ['cuda']
default_features = ['+cuda']
def switch_cuda(self, on):
if on:
self.require('magma')
else:
self.... | mit | Python |
d8323f147bc02abec84db1fab08bd5f61fead27f | remove hard written allowed hosts | SoftwareHeritage/swh-web-ui,SoftwareHeritage/swh-web-ui,SoftwareHeritage/swh-web-ui | swh/web/settings/production.py | swh/web/settings/production.py | # Copyright (C) 2017-2019 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
"""
Django production settings for swh-web.
"""
from .common... | # Copyright (C) 2017-2019 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
"""
Django production settings for swh-web.
"""
from .common... | agpl-3.0 | Python |
d7a40fb053345e9b1501424296f306f32b5a748e | allow matching by geometry | micolous/geojsontools | geojsondiff.py | geojsondiff.py | #!/usr/bin/env python
"""
geojsondiff
Finds the differences in points between two GeoJSON files
Copyright 2014-2015 Michael Farrell <http://micolous.id.au>
License: 3-clause BSD, see COPYING
"""
import geojson, argparse
def hash_coords(lng, lat=None, *args):
if lat is None:
print lng
raise Exception
return '%s... | #!/usr/bin/env python
"""
geojsondiff
Finds the differences in points between two GeoJSON files
Copyright 2014 Michael Farrell <http://micolous.id.au>
License: 3-clause BSD, see COPYING
"""
import geojson, argparse
def loadpoints(layer, id_field):
points = {}
for point in layer:
if point.geometry.type != 'Point'... | bsd-3-clause | Python |
c2e8bfec04cd350c1ddd0e9e0b071c73b03d7657 | clean k23 | WatsonDNA/nlp100,wtsnjp/nlp100,WatsonDNA/nlp100,wtsnjp/nlp100 | chap03/k23/k23.py | chap03/k23/k23.py | import sys
import re
file_name = sys.argv[1]
with open(file_name) as f:
for l in f:
r = re.compile("(=+)(.*?)=+")
m = r.match(l)
if m:
print(m.group(2).strip(), len(m.group(1))-1)
| import sys
import re
file_name = sys.argv[1]
with open(file_name) as f:
for l in f:
r = re.compile("(=+)(.*?)=+")
if r.match(l):
m = r.match(l)
print(m.group(2).strip(), len(m.group(1))-1)
| unlicense | Python |
50104da5757f9bbc0a3a04b3bca4ed228dc1169a | Change posts back to dict in blog.py | ollien/Timpani,ollien/Timpani,ollien/Timpani | py/blog.py | py/blog.py | import collections
import database
import configmanager
def getMainConnection():
return database.ConnectionManager.getConnection("main")
mainConnection = getMainConnection()
def getPosts(connection = mainConnection):
global mainConnection
if connection == mainConnection and mainConnection == None:
mainConnecti... | import collections
import database
import configmanager
def getMainConnection():
return database.ConnectionManager.getConnection("main")
mainConnection = getMainConnection()
def getPosts(connection = mainConnection):
global mainConnection
if connection == mainConnection and mainConnection == None:
mainConnecti... | mit | Python |
f035ea7fb453d09b37f5187c4f61e855b048cbd5 | Use sessions to Tie it a with language. Also helps us to retrieve session code later " " | jatindhankhar/aslo-v3,jatindhankhar/aslo-v3,jatindhankhar/aslo-v3,jatindhankhar/aslo-v3 | aslo/web/__init__.py | aslo/web/__init__.py | from flask import Blueprint, g, session
web = Blueprint('web', __name__, template_folder='templates',
static_folder='static',
static_url_path='/web/static',
url_prefix='/<lang_code>')
@web.url_defaults
def add_language_code(endpoint, values):
values.setdefault('lan... | from flask import Blueprint, g
web = Blueprint('web', __name__, template_folder='templates',
static_folder='static',
static_url_path='/web/static',
url_prefix='/<lang_code>')
@web.url_defaults
def add_language_code(endpoint, values):
values.setdefault('lang_code', ... | mit | Python |
747dd542314525690db2a746d3168e4cee8ccc48 | handle Nitos users also | yippeecw/sfa,onelab-eu/sfa,onelab-eu/sfa,onelab-eu/sfa,yippeecw/sfa,yippeecw/sfa | sfa/client/client_helper.py | sfa/client/client_helper.py |
def pg_users_arg(records):
users = []
for record in records:
if record['type'] != 'user':
continue
user = {'urn': record['geni_urn'],
'keys': record['keys']}
users.append(user)
return users
def sfa_users_arg(records, slice_record):
users = []
... |
def pg_users_arg(records):
users = []
for record in records:
if record['type'] != 'user':
continue
user = {'urn': record['geni_urn'],
'keys': record['keys']}
users.append(user)
return users
def sfa_users_arg(records, slice_record):
users = []
... | mit | Python |
5beacd1a3dce93099b974ea03f2f827259119cf6 | Fix mini batch | uaca/deepy,uaca/deepy,zomux/deepy,zomux/deepy,uaca/deepy | deepy/dataset/mini_batch.py | deepy/dataset/mini_batch.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from . import Dataset
import numpy as np
class MiniBatches(Dataset):
def __init__(self, dataset, batch_size=20):
self.origin = dataset
self.size = batch_size
self._train_set = None
self._valid_set = None
self._test_set = None
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from . import Dataset
import numpy as np
class MiniBatches(Dataset):
def __init__(self, dataset, batch_size=20):
self.origin = dataset
self.size = batch_size
self._train_set = None
self._valid_set = None
self._test_set = None
... | mit | Python |
5e398d0bc8e990a86dba27949b25e8ba41805b81 | Update copyright for 2015 | bwhmather/cryptography,Hasimir/cryptography,sholsapp/cryptography,kimvais/cryptography,Ayrx/cryptography,Hasimir/cryptography,Ayrx/cryptography,skeuomorf/cryptography,sholsapp/cryptography,skeuomorf/cryptography,Ayrx/cryptography,kimvais/cryptography,Ayrx/cryptography,sholsapp/cryptography,kimvais/cryptography,bwhmathe... | src/cryptography/__about__.py | src/cryptography/__about__.py | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__... | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__... | bsd-3-clause | Python |
fa82a0851865496d48684fed10b8a168deaa1ded | Update Option.__unicode__() | moqada/django-simple-spam-blocker | simplespamblocker/models.py | simplespamblocker/models.py | # -*- coding: utf-8 -*-
import re
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.db import models
from django.utils.translation import ugettext_lazy as _
from simplespamblocker.fields import ValidRegexField
from simplespamblocker.settings import CACHE_KEY
class Option(mod... | # -*- coding: utf-8 -*-
import re
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.db import models
from django.utils.translation import ugettext_lazy as _
from simplespamblocker.fields import ValidRegexField
from simplespamblocker.settings import CACHE_KEY
class Option(mod... | bsd-3-clause | Python |
695ba37fe157d2241906d647e327b24af476ef58 | Add path to scripts | rickmcgeer/geni-expt-engine,rickmcgeer/geni-expt-engine,rickmcgeer/geni-expt-engine,rickmcgeer/geni-expt-engine | slice-scripts/slice-daemon.py | slice-scripts/slice-daemon.py | #!/usr/bin/python
# A daemon which serializes create-slice.sh and delete-slice.sh requests, to
# avoid multiple simultaneous requests to the Ansible scripts
from pymongo import MongoClient
import subprocess
import time
import os
#
# Connect to the db server on the mongo container. This needs to be reset here
# if it... | #!/usr/bin/python
# A daemon which serializes create-slice.sh and delete-slice.sh requests, to
# avoid multiple simultaneous requests to the Ansible scripts
from pymongo import MongoClient
import subprocess
import time
#
# Connect to the db server on the mongo container. This needs to be reset here
# if it changes. ... | mit | Python |
09bd0d64f2642c385fea00b2ace1548343251218 | Fix Content-Security-Policy (syntax + content) | c4rlo/vimhelp,c4rlo/vimhelp,c4rlo/vimhelp | vimhelp/webapp.py | vimhelp/webapp.py | # import gevent
import gevent.monkey
# gevent.config.track_greenlet_tree = False
gevent.monkey.patch_all()
import grpc.experimental.gevent # noqa: E402
grpc.experimental.gevent.init_gevent()
import flask # noqa: E402
import logging # noqa: E402
_CSP = "default-src 'self' 'unsafe-inline' " \
"https://googl... | # import gevent
import gevent.monkey
# gevent.config.track_greenlet_tree = False
gevent.monkey.patch_all()
import grpc.experimental.gevent # noqa: E402
grpc.experimental.gevent.init_gevent()
import flask # noqa: E402
import logging # noqa: E402
_CSP = "default-src: 'self' https://google.com https://*.google.c... | mit | Python |
63925d3044f1aa329f1cb8e45c93300527643c78 | Apply auto-formatting rules | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | travistooling/decisions.py | travistooling/decisions.py | # -*- encoding: utf-8
class Decision(Exception):
"""
The base class for all decisions.
"""
path = None
def __init__(self, path):
self.path == path
super(Decision, self).__init__()
class SignificantFile(Decision):
"""
This file might an effect on the outcome of the current... | # -*- encoding: utf-8
class Decision(Exception):
"""
The base class for all decisions.
"""
path = None
def __init__(self, path):
self.path == path
super(Decision, self).__init__()
class SignificantFile(Decision):
"""
This file might an effect on the outcome of the current... | mit | Python |
a0bd44f04735ffa16527a2fd49471a9fd4d32d0e | add debug log | Answeror/torabot,Answeror/torabot,Answeror/torabot | torabot/frontend/m/main.py | torabot/frontend/m/main.py | import json
import base64
import jsonpickle
from flask import current_app, abort
from logbook import Logger
from ...core.backends.redis import Redis
from ...core.make.task import Task
from ...core.mod import mod
from . import bp
log = Logger(__name__)
@bp.route('/gist/<id>', methods=['GET'])
def gist(id):
log.d... | import json
import base64
import jsonpickle
from flask import current_app, abort
from ...core.backends.redis import Redis
from ...core.make.task import Task
from ...core.mod import mod
from . import bp
@bp.route('/gist/<id>', methods=['GET'])
def gist(id):
q = mod('gist').search(
text=json.dumps(dict(meth... | mit | Python |
5d332259e16758bc43201073db91409390be9134 | Remove removeOperation from grouped operation | onitake/Uranium,onitake/Uranium | UM/Operations/GroupedOperation.py | UM/Operations/GroupedOperation.py | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from . import Operation
## An operation that groups several other operations together.
#
# The intent of this operation is to hide an underlying chain of operations
# from the user if they correspond to only one in... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from . import Operation
## An operation that groups several other operations together.
#
# The intent of this operation is to hide an underlying chain of operations
# from the user if they correspond to only one in... | agpl-3.0 | Python |
ee76cb118316f082a51ef178829800dcc0f6e97a | Add connection check methods | MA3STR0/simpletor | simpletor/tor.py | simpletor/tor.py | import socks
import socket
import json
from stem.control import Controller
from stem import Signal
try:
from urllib2 import urlopen # python2
except ImportError:
from urllib.request import urlopen # python3
class Tor(object):
"""Tor class for socks proxy and controller"""
def __init__(self, socks_... | import socks
import socket
import json
from stem.control import Controller
from stem import Signal
try:
from urllib2 import urlopen # python2
except ImportError:
from urllib.request import urlopen # python3
class Tor(object):
"""Tor class for socks proxy and controller"""
def __init__(self, socks_... | mit | Python |
69318cfc493ed7cfe6103df96d2fac1a71cddab6 | fix flake8(E222) | python-social-auth/social-core,python-social-auth/social-core | social_core/backends/kakao.py | social_core/backends/kakao.py | """
Kakao OAuth2 backend, docs at:
https://python-social-auth.readthedocs.io/en/latest/backends/kakao.html
"""
from .oauth import BaseOAuth2
class KakaoOAuth2(BaseOAuth2):
"""Kakao OAuth authentication backend"""
name = 'kakao'
AUTHORIZATION_URL = 'https://kauth.kakao.com/oauth/authorize'
ACCESS_T... | """
Kakao OAuth2 backend, docs at:
https://python-social-auth.readthedocs.io/en/latest/backends/kakao.html
"""
from .oauth import BaseOAuth2
class KakaoOAuth2(BaseOAuth2):
"""Kakao OAuth authentication backend"""
name = 'kakao'
AUTHORIZATION_URL = 'https://kauth.kakao.com/oauth/authorize'
ACCESS_T... | bsd-3-clause | Python |
35b34162111ec3a1833251de4512b770c58baa1c | use __ for unused variable | mysz/ff,msztolcman/ff | plugins/ffplugin_test_size.py | plugins/ffplugin_test_size.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Plugin script for `ff` (https://github.com/mysz/ff).
"""
from __future__ import print_function, unicode_literals
import os.path
def _test_greater(arg1, arg2):
""" Test for being greater then.
"""
return arg1 > arg2
def _test_less(arg1, arg2):
""" Te... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Plugin script for `ff` (https://github.com/mysz/ff).
"""
from __future__ import print_function, unicode_literals
import os.path
def _test_greater(arg1, arg2):
""" Test for being greater then.
"""
return arg1 > arg2
def _test_less(arg1, arg2):
""" Te... | mit | Python |
7d10ce5d25efb3686006465ab1f8b2f6df16d5d4 | raise version number | NLeSC/pyxenon,NLeSC/pyxenon | xenon/version.py | xenon/version.py | xenon_version = "2.2.0"
xenon_grpc_version = "2.0.1"
pyxenon_version = "2.2.2"
| xenon_version = "2.2.0"
xenon_grpc_version = "2.0.1"
pyxenon_version = "2.2.1"
| apache-2.0 | Python |
b62c2099080fbb529cb146103e4b7c07b20f9154 | Bump version number | jarekwg/pyxero,opendesk/pyxero,schinckel/pyxero,jaymcconnell/pyxero,thisismyrobot/pyxero,wegotpop/pyxero,freakboy3742/pyxero,direvus/pyxero,unomena/pyxeropos | xero/__init__.py | xero/__init__.py | from .api import Xero
__version__ = "0.7.0"
| from .api import Xero
__version__ = "0.7.0-alpha2"
| bsd-3-clause | Python |
accceba322b431376a2913582416c373bd2230de | Add "gluu_version" and comments | GluuFederation/community-edition-setup,GluuFederation/community-edition-setup,GluuFederation/community-edition-setup | static/scripts/change_hostname/change_config.py | static/scripts/change_hostname/change_config.py | import os, sys
from change_gluu_host import Installer, FakeRemote, ChangeGluuHostname
name_changer = ChangeGluuHostname(
# Change these parameters here. If there are '' marks, leave them only replacing <entry> with your information.
# The hostname currently in Gluu Server's configuration
old_host... | import os, sys
from change_gluu_host import Installer, FakeRemote, ChangeGluuHostname
name_changer = ChangeGluuHostname(
old_host='<current_hostname>',
new_host='<new_hostname>',
cert_city='<city>',
cert_mail='<email>',
cert_state='<state_or_region>',
cert_country='<country>',
server='<actu... | mit | Python |
51962af0696a9c8b7875e7c0fe0e0b1f3168bee4 | Replace native.git_repository with skylark rule | GerritCodeReview/plugins_importer,GerritCodeReview/plugins_importer,GerritCodeReview/plugins_importer,GerritCodeReview/plugins_importer | bazlets.bzl | bazlets.bzl | load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
NAME = "com_googlesource_gerrit_bazlets"
def load_bazlets(
commit,
local_path = None):
if not local_path:
git_repository(
name = NAME,
remote = "https://gerrit.googlesource.com/bazlets",
... | NAME = "com_googlesource_gerrit_bazlets"
def load_bazlets(
commit,
local_path = None):
if not local_path:
native.git_repository(
name = NAME,
remote = "https://gerrit.googlesource.com/bazlets",
commit = commit,
)
else:
native.local_rep... | apache-2.0 | Python |
ce857c2aecfe5e05eb64cab43f26a638bea896c6 | Add function test into NN and serialization test. | JosephCatrambone/PyNeuralNetwork | neuralnetwork/tests/test_nn.py | neuralnetwork/tests/test_nn.py |
import sys, os
import tempfile
import pickle
from unittest import TestCase
import numpy
import neuralnetwork.neuralnetwork as nn
class TestNet(TestCase):
def test_xor(self):
net = nn.NeuralNetwork([2, 3, 1], ['tanh', 'tanh', 'tanh'])
examples = numpy.asarray([ [0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [1.0, 0.1] ])
... | import sys, os
import pickle
from unittest import TestCase
import neuralnetwork.neuralnetwork as nn
class TestNet(TestCase):
def test_xor(self):
net = nn.NeuralNetwork([2, 3, 1], ['tanh', 'tanh', 'tanh'])
examples = numpy.asarray([ [0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [1.0, 0.1] ])
labels = numpy.asarray([ [0.0... | mit | Python |
aabebd22079ab45d3068205c3551e4e4c9ccf1dd | bump repo version | omry/omegaconf | omegaconf/version.py | omegaconf/version.py | import sys # pragma: no cover
__version__ = "2.0.0rc29"
msg = """OmegaConf 2.0 and above is compatible with Python 3.6 and newer.
You have the following options:
1. Upgrade to Python 3.6 or newer.
This is highly recommended. new features will not be added to OmegaConf 1.4.
2. Continue using OmegaConf 1.4:
You... | import sys # pragma: no cover
__version__ = "2.0.0rc28"
msg = """OmegaConf 2.0 and above is compatible with Python 3.6 and newer.
You have the following options:
1. Upgrade to Python 3.6 or newer.
This is highly recommended. new features will not be added to OmegaConf 1.4.
2. Continue using OmegaConf 1.4:
You... | bsd-3-clause | Python |
78e87559dd0afd48528d599c5c7b79d5c154b718 | Fix https://github.com/pyload/pyload/issues/1397 | vuolter/pyload,vuolter/pyload,vuolter/pyload | module/plugins/hooks/LinkdecrypterComHook.py | module/plugins/hooks/LinkdecrypterComHook.py | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.MultiHook import MultiHook
class LinkdecrypterComHook(MultiHook):
__name__ = "LinkdecrypterComHook"
__type__ = "hook"
__version__ = "1.05"
__config__ = [("activated" , "bool" , "Activated" , Tr... | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.MultiHook import MultiHook
class LinkdecrypterComHook(MultiHook):
__name__ = "LinkdecrypterComHook"
__type__ = "hook"
__version__ = "1.04"
__config__ = [("activated" , "bool" , "Activated" , Tr... | agpl-3.0 | Python |
5531422c670c29539e59908764917e073f58d60b | Fix logging commands. | eReuse/device-inventory,eReuse/device-inventory,eReuse/workbench,eReuse/workbench | device_inventory/storage.py | device_inventory/storage.py | import logging
import paramiko
import pyudev
import shutil
import time
from . import utils
def copy_file_to_server(localpath, remotepath, username, password, server):
"""
Any other exception will be passed through.
:raises AuthenticationException: if authentication failed
:raises SSHException: i... | import logging
import paramiko
import pyudev
import shutil
import time
from . import utils
def copy_file_to_server(localpath, remotepath, username, password, server):
"""
Any other exception will be passed through.
:raises AuthenticationException: if authentication failed
:raises SSHException: i... | agpl-3.0 | Python |
59f2da1603d3548f54ea11fb2a67d349a21bb889 | comment out svc_account_passwd | asrozar/perception | perception/config/configuration-example.py | perception/config/configuration-example.py | # ------------------
# Configuration File
# ------------------
# --------------
# Time Zone Info
# --------------
timezone = 'US/Eastern'
# -------------
# Database Info
# -------------
db_drivername = 'postgres'
db_host = 'localhost'
database = 'perceptiondb'
db_username = 'perception'
db_password = 'perception_pas... | # ------------------
# Configuration File
# ------------------
# --------------
# Time Zone Info
# --------------
timezone = 'US/Eastern'
# -------------
# Database Info
# -------------
db_drivername = 'postgres'
db_host = 'localhost'
database = 'perceptiondb'
db_username = 'perception'
db_password = 'perception_pas... | mit | Python |
97492aaf63ab4d361d0366084f8f0500a5fd737b | Update manager.py | Tendrl/node-agent,Tendrl/node_agent,Tendrl/node-agent,r0h4n/node-agent,r0h4n/node-agent,Tendrl/node-agent,r0h4n/node-agent,Tendrl/node_agent | tendrl/node_agent/discovery/platform/manager.py | tendrl/node_agent/discovery/platform/manager.py | import importlib
import inspect
import os
from tendrl.commons.event import Event
from tendrl.commons.message import ExceptionMessage
from tendrl.node_agent.discovery.platform import base
class PlatformManager(object):
def __init__(self):
try:
self.load_plugins()
except (SyntaxError,... | import importlib
import inspect
import os
from tendrl.commons.event import Event
from tendrl.commons.message import ExceptionMessage
from tendrl.node_agent.discovery.platform import base
class PlatformManager(object):
def __init__(self):
try:
self.load_plugins()
except (SyntaxError,... | lgpl-2.1 | Python |
ef75ec5d27fcbcee1b451b5e22828a1129cfd209 | Add default (7) on limit field queryset model boxes | YACOWS/opps,jeanmask/opps,YACOWS/opps,opps/opps,YACOWS/opps,williamroot/opps,williamroot/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,opps/opps,opps/opps,jeanmask/opps,jeanmask/opps,opps/opps | opps/boxes/models.py | opps/boxes/models.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#from django.conf import settings
#from django.utils.importlib import import_module
from django.db import models
from django.utils.translation import ugettext_lazy as _
from opps.core.models import Publishable, BaseBox
try:
OPPS_APPS = tuple([(u"{0}.{1}".format(
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#from django.conf import settings
#from django.utils.importlib import import_module
from django.db import models
from django.utils.translation import ugettext_lazy as _
from opps.core.models import Publishable, BaseBox
try:
OPPS_APPS = tuple([(u"{0}.{1}".format(
... | mit | Python |
84cb904415d5a0f03da197f4db845e1c3c8a5366 | Update version on master to 2.7.0 | tensorflow/estimator,tensorflow/estimator | tensorflow_estimator/tools/pip_package/setup.py | tensorflow_estimator/tools/pip_package/setup.py | # Copyright 2018 The TensorFlow Authors. 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 applica... | # Copyright 2018 The TensorFlow Authors. 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 applica... | apache-2.0 | Python |
6cf9b785e0b15075dcaccf9c970a633df1f77c64 | Clean up urls.py. | PrecisionMojo/pm-www,PrecisionMojo/pm-www | vsub_site/urls.py | vsub_site/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView
# See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf
admin.auto... | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView
# See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-insta... | mit | Python |
f8c2742829846f0668cbf1de786b0990f6c7abec | Add SlugRedirect to the Django admin | mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola | pombola/slug_helpers/admin.py | pombola/slug_helpers/admin.py | import re
from django.contrib import admin
from django.contrib.gis import db
from django.core.exceptions import ValidationError
from .models import SlugRedirect
def stricter_validate_slug(slug):
if not re.match(r'^[-a-z0-9_]+$', slug):
raise ValidationError(
"Enter a valid 'slug' consisting of... | import re
from django.contrib.gis import db
from django.core.exceptions import ValidationError
def stricter_validate_slug(slug):
if not re.match(r'^[-a-z0-9_]+$', slug):
raise ValidationError(
"Enter a valid 'slug' consisting of only lowercase letters, numbers, underscores or hyphens.")
re... | agpl-3.0 | Python |
7f7229f96a3d03620bc1668e66888123de49c566 | add missing import | thiagoss/splitencoder,thiagoss/splitencoder | zeromq/worker.py | zeromq/worker.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Task worker
#
# Transcodes files
# Connects PULL socket to tcp://localhost:5557
# Connects PUSH socket to tcp://localhost:5558
# Sends results to sink via that socket
#
# Based on sample by: Lev Givon <lev(at)columbia(dot)edu>
import sys
import time
import argparse
imp... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Task worker
#
# Transcodes files
# Connects PULL socket to tcp://localhost:5557
# Connects PUSH socket to tcp://localhost:5558
# Sends results to sink via that socket
#
# Based on sample by: Lev Givon <lev(at)columbia(dot)edu>
import sys
import time
import argparse
imp... | lgpl-2.1 | Python |
314e586e33b36c91b5c2ced9a640cfe58be730c7 | Patch version bump to 8.7.1 | alphagov/notifications-utils | notifications_utils/version.py | notifications_utils/version.py | __version__ = '8.7.1'
| __version__ = '8.7.0'
| mit | Python |
210807fa7e13ba49b65d6e001a9b8bf10762da52 | Bump the version | alphagov/notifications-utils | notifications_utils/version.py | notifications_utils/version.py | __version__ = '13.5.0'
| __version__ = '13.4.0'
| mit | Python |
75ab90017476d08a433171d7c0c2403a53429eca | add docstrings to the countries module | qtux/instmatcher | instmatcher/countries.py | instmatcher/countries.py | # Copyright 2016 Matthias Gazzari
#
# 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 writ... | # Copyright 2016 Matthias Gazzari
#
# 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 writ... | apache-2.0 | Python |
b3253bca90dcfb0c2c0dad360494663355953208 | Bump to 5.0.0 (Will use semver from now on) | bemeurer/beautysh,bemeurer/beautysh | beautysh/__init__.py | beautysh/__init__.py | """__init__: Holds version info."""
from .beautysh import Beautify
__version__ = '5.0.0'
| """__init__: Holds version info."""
from .beautysh import Beautify
__version__ = '4.1'
| mit | Python |
abe8ffd83e3a9ecfb71d4c80d747d25094a6b60e | Fix URLconf imports, the d.c.u.defaults does not work with Django 1.6 anymore | matthiask/zivinetz,matthiask/zivinetz,matthiask/zivinetz,matthiask/zivinetz | zivinetz/urls.py | zivinetz/urls.py | from django.conf.urls import patterns, include, url
from zivinetz.views.modelviews import (assignment_views, drudge_views,
expense_report_views, regional_office_views, scope_statement_views,
specification_views, waitlist_views, jobreference_views)
from zivinetz.views import photos
urlpatterns = patterns('zi... | from django.conf.urls.defaults import patterns, include, url
from zivinetz.views.modelviews import (assignment_views, drudge_views,
expense_report_views, regional_office_views, scope_statement_views,
specification_views, waitlist_views, jobreference_views)
from zivinetz.views import photos
urlpatterns = pat... | mit | Python |
2820eb5a545a940928c45fc1eb9c2e2ccae9e246 | Add compliance with rule E261 to wsgi.py. | eeshangarg/zulip,amanharitsh123/zulip,vaidap/zulip,showell/zulip,brainwane/zulip,mahim97/zulip,jphilipsen05/zulip,ryanbackman/zulip,hackerkid/zulip,j831/zulip,rishig/zulip,jackrzhang/zulip,Galexrt/zulip,eeshangarg/zulip,ryanbackman/zulip,rishig/zulip,j831/zulip,punchagan/zulip,Galexrt/zulip,brainwane/zulip,kou/zulip,zu... | zproject/wsgi.py | zproject/wsgi.py | """
WSGI config for zulip project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` se... | """
WSGI config for zulip project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` se... | apache-2.0 | Python |
06977d737a2689210b11e798801e0bd8c2dbc8c7 | fix default heartbeat location when transport is ipc | ipython/ipython,ipython/ipython | IPython/zmq/heartbeat.py | IPython/zmq/heartbeat.py | """The client and server for a basic ping-pong style heartbeat.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as pa... | """The client and server for a basic ping-pong style heartbeat.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as pa... | bsd-3-clause | Python |
f8d3aedb1dec23c556a633954213efa594850b5d | Remove static label tests Fixes #2989 | SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree | InvenTree/label/tests.py | InvenTree/label/tests.py | # Tests for labels
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.conf import settings
from django.apps import apps
from django.urls import reverse
from django.core.exceptions import ValidationError
from InvenTree.helpers import validateFilterString
from InvenTree.api_tester i... | # Tests for labels
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.conf import settings
from django.apps import apps
from django.urls import reverse
from django.core.exceptions import ValidationError
from InvenTree.helpers import validateFilterString
from InvenTree.api_tester i... | mit | Python |
7da00db307dd1587ebfc78c4396b0ff054fd5390 | Make reindex.py executable | ningyifan/annotator-store,nobita-isc/annotator-store,happybelly/annotator-store,nobita-isc/annotator-store,openannotation/annotator-store,nobita-isc/annotator-store,nobita-isc/annotator-store | reindex.py | reindex.py | #!/usr/bin/env python
import sys
import argparse
from elasticsearch import Elasticsearch
from annotator.reindexer import Reindexer
description = """
Reindex an elasticsearch index.
WARNING: Documents that are created while reindexing may be lost!
"""
def main(argv):
argparser = argparse.ArgumentParser(descript... | import sys
import argparse
from elasticsearch import Elasticsearch
from annotator.reindexer import Reindexer
description = """
Reindex an elasticsearch index.
WARNING: Documents that are created while reindexing may be lost!
"""
def main(argv):
argparser = argparse.ArgumentParser(description=description)
a... | mit | Python |
9a0713b2b2e4d49a22f5f673492a9bf5fd828f27 | Fix Typo in examples/remote_cluster.py | kubernetes-client/python,kubernetes-client/python | examples/remote_cluster.py | examples/remote_cluster.py | # Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | # Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | apache-2.0 | Python |
71662dfdef0d9f1913778c31cb50dba3515308c4 | Rename aggregate function, remove type testing, move result data out of setup | googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks | project/scripts/unit_tests.py | project/scripts/unit_tests.py | #!/usr/bin/env python3
import unittest
import pandas as pd
from datetime import datetime, timedelta
from fetch_trends import aggregate_hourly_to_daily
from dates import get_end_times, get_start_times
class TestFetch(unittest.TestCase):
def setUp(self):
data = {"test" : [1] * 24}
dates = [dateti... | #!/usr/bin/env python3
import unittest
import pandas as pd
from datetime import datetime, timedelta
from fetch_trends import aggregate_hourly_to_daily
from dates import get_end_times, get_start_times
class TestFetch(unittest.TestCase):
def setUp(self):
data = {
"test" : [1] * 24
}
... | apache-2.0 | Python |
31ed64e9b0ba6d2be87d3627b7417335494fa60d | Fix textcat test | honnibal/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy | spacy/tests/test_textcat.py | spacy/tests/test_textcat.py | from __future__ import unicode_literals
import random
import numpy.random
from ..pipeline import TextCategorizer
from ..lang.en import English
from ..vocab import Vocab
from ..tokens import Doc
from ..gold import GoldParse
def test_textcat_learns_multilabel():
random.seed(5)
numpy.random.seed(5)
docs = [... | from __future__ import unicode_literals
import random
import numpy.random
from ..pipeline import TextCategorizer
from ..lang.en import English
from ..vocab import Vocab
from ..tokens import Doc
from ..gold import GoldParse
def test_textcat_learns_multilabel():
random.seed(1)
numpy.random.seed(1)
docs = [... | mit | Python |
a14c8c2b1c9c174bc4b1e39236f439fbb928cbdd | Add logger | dionyziz/rupture,esarafianou/rupture,dionyziz/rupture,dimkarakostas/rupture,esarafianou/rupture,dimriou/rupture,dimkarakostas/rupture,dionyziz/rupture,dionyziz/rupture,esarafianou/rupture,dimkarakostas/rupture,dimriou/rupture,dionyziz/rupture,dimriou/rupture,dimkarakostas/rupture,dimriou/rupture,esarafianou/rupture,dim... | sniffer/sniff.py | sniffer/sniff.py | import logging
from flask import Flask, request, jsonify
app = Flask(__name__)
level = logging.DEBUG
logger = logging.getLogger('sniffer')
logger.setLevel(level)
FORMAT = '%(asctime)s - %(name)s - %(levelname)s: %(message)s'
logging.basicConfig(format=FORMAT)
@app.route('/set_sniffer')
def set_sniffer():
retur... | from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/set_sniffer')
def set_sniffer():
return 'Not implemented', 200
@app.route('/get_capture')
def get_capture():
return 'Not implemented', 200
@app.route('/delete_sniffer')
def delete_sniffer():
return 'Not implemented', 200
i... | mit | Python |
4fa4cd1ac4ea37a5822a567824652f22103705f5 | patch set_existing_dashboard_charts_as_public | yashodhank/frappe,mhbu50/frappe,yashodhank/frappe,saurabh6790/frappe,almeidapaulopt/frappe,adityahase/frappe,StrellaGroup/frappe,frappe/frappe,yashodhank/frappe,mhbu50/frappe,saurabh6790/frappe,mhbu50/frappe,almeidapaulopt/frappe,saurabh6790/frappe,mhbu50/frappe,adityahase/frappe,adityahase/frappe,StrellaGroup/frappe,f... | frappe/patches/v13_0/set_existing_dashboard_charts_as_public.py | frappe/patches/v13_0/set_existing_dashboard_charts_as_public.py | import frappe
def execute():
frappe.reload_doc('desk', 'doctype', 'dashboard_chart')
if not frappe.db.table_exists('Dashboard Chart'):
return
users_with_permission = frappe.get_all(
"Has Role",
fields=["parent"],
filters={"role": ['in', ['System Manager', 'Dashboard Manager']], "parenttype": "User"},
di... | import frappe
def execute():
frappe.reload_doctype('Dashboard Chart')
if not frappe.db.table_exists('Dashboard Chart'):
return
users_with_permission = frappe.get_all(
"Has Role",
fields=["parent"],
filters={"role": ['in', ['System Manager', 'Dashboard Manager']], "parenttype": "User"},
distinct=True,
... | mit | Python |
ab4a1c60d681327b8ee110601ff534067a26070a | fix for https://github.com/sqlalchemy/alembic/issues/843 | silenius/amnesia,silenius/amnesia,silenius/amnesia | amnesia/alembic/versions/20210503_32b12866f6a2_permissions.py | amnesia/alembic/versions/20210503_32b12866f6a2_permissions.py | """permissions
Revision ID: 32b12866f6a2
Revises: e025de45166e
Create Date: 2021-05-03 10:18:09.206486
"""
from pathlib import Path
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '32b12866f6a2'
down_revision = 'e025de45166e'
branch_labels = None
depends_on = None
... | """permissions
Revision ID: 32b12866f6a2
Revises: e025de45166e
Create Date: 2021-05-03 10:18:09.206486
"""
from pathlib import Path
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '32b12866f6a2'
down_revision = 'e025de45166e'
branch_labels = None
depends_on = 'e025... | bsd-2-clause | Python |
38d7092f07884cb2530f95a5dc24ba177bfbe699 | Allow specifying multiple cmd elements | nwautomator/ncclient,joysboy/ncclient,aitorhh/ncclient,ncclient/ncclient,vnitinv/ncclient,cmoberg/ncclient,earies/ncclient,einarnn/ncclient,leopoul/ncclient,kroustou/ncclient,lightlu/ncclient,nnakamot/ncclient,OpenClovis/ncclient,GIC-de/ncclient | ncclient/operations/third_party/nexus/rpc.py | ncclient/operations/third_party/nexus/rpc.py | from lxml import etree
from ncclient.xml_ import *
from ncclient.operations.rpc import RPC
class ExecCommand(RPC):
def request(self, cmds):
node = etree.Element(qualify('exec-command', NXOS_1_0))
for cmd in cmds:
etree.SubElement(node, qualify('cmd', NXOS_1_0)).text = cmd
ret... | from lxml import etree
from ncclient.xml_ import *
from ncclient.operations.rpc import RPC
class ExecCommand(RPC):
def request(self, cmd):
parent_node = etree.Element(qualify('exec-command', NXOS_1_0))
child_node = etree.SubElement(parent_node, qualify('cmd', NXOS_1_0))
child_node.text = c... | apache-2.0 | Python |
13388ea7c9149b374045dc494290825423adcf4b | Remove print statement from controllers | lukaszb/django-projector,lukaszb/django-projector | projector/core/controllers.py | projector/core/controllers.py | from django.template import RequestContext
from django.shortcuts import render_to_response
from django.http import HttpRequest
class BaseView(object):
"""
Base class for django views.
"""
def __new__(cls, request, *args, **kwargs):
view = cls.new(request, *args, **kwargs)
return view.__... | from django.template import RequestContext
from django.shortcuts import render_to_response
from django.http import HttpRequest
class BaseView(object):
"""
Base class for django views.
"""
def __new__(cls, request, *args, **kwargs):
view = cls.new(request, *args, **kwargs)
return view.__... | bsd-3-clause | Python |
060a2863ff8426a9b08499220fe1e9b2972aa5db | fix variable scope issue | albertz/music-player,albertz/music-player,albertz/music-player,albertz/music-player,albertz/music-player,albertz/music-player | socketcontrol.py | socketcontrol.py | # -*- coding: utf-8 -*-
# MusicPlayer, https://github.com/albertz/music-player
# Copyright (c) 2013, Albert Zeyer, www.az2000.de
# All rights reserved.
# This code is under the 2-clause BSD license, see License.txt in the root directory of this project.
import sys, os
import appinfo
import utils
import binstruct
def... | # -*- coding: utf-8 -*-
# MusicPlayer, https://github.com/albertz/music-player
# Copyright (c) 2013, Albert Zeyer, www.az2000.de
# All rights reserved.
# This code is under the 2-clause BSD license, see License.txt in the root directory of this project.
import sys, os
import appinfo
import utils
import binstruct
def... | bsd-2-clause | Python |
0a152c792e2ebf20056780b5a20765175d73108b | Allow toggling active/inactive in VersionAdmin | rlmuraya/ipv6map,rlmuraya/ipv6map,rlmuraya/ipv6map,rlmuraya/ipv6map | ipv6map/geodata/admin.py | ipv6map/geodata/admin.py | from django.contrib import admin
from . import models
@admin.register(models.Version)
class VersionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {
'fields': ['publish_date', 'location_count'],
}),
("Status", {
'fields': ['is_active'],
}),
]
list_dis... | from django.contrib import admin
from . import models
class BaseReadOnlyAdmin(admin.ModelAdmin):
list_display_links = None
def has_change_permission(self, request, obj=None):
return False if obj else True
@admin.register(models.Version)
class VersionAdmin(BaseReadOnlyAdmin):
list_display = ['p... | unlicense | Python |
3b7fbc1a1dd3e0acdfd112ba1863c56770f381bd | Use Python 3 type syntax in zerver/webhooks/gosquared/view.py. | rht/zulip,eeshangarg/zulip,kou/zulip,eeshangarg/zulip,tommyip/zulip,synicalsyntax/zulip,dhcrzf/zulip,zulip/zulip,andersk/zulip,rishig/zulip,zulip/zulip,brainwane/zulip,tommyip/zulip,synicalsyntax/zulip,andersk/zulip,jackrzhang/zulip,brainwane/zulip,shubhamdhama/zulip,punchagan/zulip,showell/zulip,tommyip/zulip,dhcrzf/z... | zerver/webhooks/gosquared/view.py | zerver/webhooks/gosquared/view.py | from typing import Any, Dict, Optional, Text
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.actions import check_send_stream_message
from zerver.lib.request import REQ, has_request_variables
fr... | from typing import Any, Dict, Optional, Text
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.actions import check_send_stream_message
from zerver.lib.request import REQ, has_request_variables
fr... | apache-2.0 | Python |
7342a3ac0ec10bfa7ab3ef58f7563ceb1ba6a407 | Set the application/json content-type header for the player list API call. | gtaylor/zombiepygman | zombiepygman/web_api/resources.py | zombiepygman/web_api/resources.py | """
This JSON API is primarily used for executing Minecraft server commands from
a remote TCP connection. The :class:`APIResource` class is the top-level
entry in here where everything gets started from.
Quick path cheat-sheat
----------------------
* /cmd/listconnected - Connected player list.
"""
from twisted.web.r... | """
This JSON API is primarily used for executing Minecraft server commands from
a remote TCP connection. The :class:`APIResource` class is the top-level
entry in here where everything gets started from.
Quick path cheat-sheat
----------------------
* /cmd/listconnected - Connected player list.
"""
from twisted.web.r... | bsd-3-clause | Python |
afabe86de5d71299b9ffd4c3fee082e6650e9321 | Use CONF.import_opt() for nova.config opts | naterh/ironic,ionutbalutoiu/ironic,naototty/vagrant-lxc-ironic,openstack/ironic,rackerlabs/ironic,pshchelo/ironic,faizan-barmawer/openstack_ironic,Tehsmash/ironic,bacaldwell/ironic,citrix-openstack-build/ironic-lib,openstack/ironic-lib,NaohiroTamura/ironic,ramineni/myironic,Tan0/ironic,dims/ironic,citrix-openstack-buil... | nova/virt/baremetal/db/sqlalchemy/session.py | nova/virt/baremetal/db/sqlalchemy/session.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 NTT DOCOMO, INC.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 NTT DOCOMO, INC.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... | apache-2.0 | Python |
974063b93a542306e28459f2b824fe6e8d130b7c | Fix __all__ for compat | dreid/yunomi | yunomi/compat.py | yunomi/compat.py | from __future__ import division, absolute_import
import sys
if sys.version_info < (3, 0):
_PY3 = False
xrange = xrange
def dict_item_iter(d):
"""
Return an iterator over the dict items.
"""
return d.iteritems()
else:
_PY3 = True
xrange = range
def dict_item_i... | from __future__ import division, absolute_import
import sys
if sys.version_info < (3, 0):
_PY3 = False
xrange = xrange
def dict_item_iter(d):
"""
Return an iterator over the dict items.
"""
return d.iteritems()
else:
_PY3 = True
xrange = range
def dict_item_i... | mit | Python |
ae80f7016aedb7f8676ab57ceae624736b63a28e | clarify docstring in readHashLine(). The hash has to come first (obviously) because filename lengths are not uniform. | j39m/zakopane | zakopane/hash.py | zakopane/hash.py |
import zakopane
import hashlib
hasher = hashlib.sha512
HASHLEN = len(hasher().hexdigest())
HASHSEP = " "
FREADTO = (-HASHLEN - len(HASHSEP))
def readHashLine(line):
"""
Given a line formatted exactly as "<hash> <filename>" (HASHSEP as
separator, NO trailing or leading characters - especially not
whi... |
import zakopane
import hashlib
hasher = hashlib.sha512
HASHLEN = len(hasher().hexdigest())
HASHSEP = " "
FREADTO = (-HASHLEN - len(HASHSEP))
def readHashLine(line):
"""
Given a line formatted exactly as "<filename> <hash>" (single space as
separator, NO trailing or leading characters - especially not
... | bsd-3-clause | Python |
8f55d644eb852e4b0eaa7ecf6c11f20837bf5127 | tweak Search Request | vgrem/Office365-REST-Python-Client | office365/sharepoint/search/searchRequest.py | office365/sharepoint/search/searchRequest.py | from office365.runtime.client_value import ClientValue
class SearchRequest(ClientValue):
def __init__(self, query_text, **kwargs):
self.Querytext = query_text
self.ClientType = None
self.CollapseSpecification = None
self.Culture = None
self.__dict__.update(**kwargs)
@... | from office365.runtime.client_value import ClientValue
class SearchRequest(ClientValue):
def __init__(self, query_text, selected_properties=None, refinement_filters=None, refiners=None,
row_limit=None, rows_per_page=None, start_row=None, timeout=None,
block_dedupe_mode=None, byp... | mit | Python |
a261bf6008699b192aefe5eb3c65323c8146ae18 | Update create_share_user migration | CenterForOpenScience/SHARE,zamattiac/SHARE,aaxelb/SHARE,CenterForOpenScience/SHARE,laurenbarker/SHARE,aaxelb/SHARE,laurenbarker/SHARE,CenterForOpenScience/SHARE,laurenbarker/SHARE,aaxelb/SHARE,zamattiac/SHARE,zamattiac/SHARE | share/migrations/0002_create_share_user.py | share/migrations/0002_create_share_user.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-22 00:27
from __future__ import unicode_literals
from django.db import migrations
def create_share_robot_user(apps, schema_editor):
ShareUser = apps.get_model('share', 'ShareUser')
share_user = ShareUser.objects.create_robot_user(username='share_o... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-22 00:27
from __future__ import unicode_literals
from django.db import migrations
def create_share_harvester_user(apps, schema_editor):
ShareUser = apps.get_model('share', 'ShareUser')
share_user = ShareUser.objects.create_harvester_user(username=... | apache-2.0 | Python |
ab95da3c7d05384e1fa339b18382ba939713ff3b | Make sure that parent directories for the blog's installation path exist. | oberlin/pressgang,cilcoberlin/pressgang,oberlin/pressgang,oberlin/pressgang,cilcoberlin/pressgang,cilcoberlin/pressgang | pressgang/actions/install/steps/wpfiles.py | pressgang/actions/install/steps/wpfiles.py |
from django.utils.translation import ugettext_lazy as _
from pressgang.actions.install.steps import InstallationStep
from pressgang.actions.install.exceptions import InstallationError
import os
import shutil
import tempfile
import urllib
import zipfile
class Step(InstallationStep):
name = _("Core WordPress files"... |
from django.utils.translation import ugettext_lazy as _
from pressgang.actions.install.steps import InstallationStep
from pressgang.actions.install.exceptions import InstallationError
import os
import shutil
import tempfile
import urllib
import zipfile
class Step(InstallationStep):
name = _("Core WordPress files"... | bsd-3-clause | Python |
af5ea3a9e8d1280c55dbb911c57b6b8f707eb8c7 | Add count distinct. | jhanley634/testing-tools,jhanley634/testing-tools,jhanley634/testing-tools,jhanley634/testing-tools,jhanley634/testing-tools,jhanley634/testing-tools,jhanley634/testing-tools | problem/column_explorer/column_explorer.py | problem/column_explorer/column_explorer.py | #! /usr/bin/env python3
# Copyright 2019 John Hanley.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, m... | #! /usr/bin/env python3
# Copyright 2019 John Hanley.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, m... | mit | Python |
da6ee7eadada0fa796f67631bdb44852345a971c | Fix PEP8 | OCA/account-invoicing,OCA/account-invoicing | account_invoice_force_number/__init__.py | account_invoice_force_number/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
# Copyright (C) 2011-2013 Agile Business Group sagl
# (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it a... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
# Copyright (C) 2011-2013 Agile Business Group sagl
# (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and... | agpl-3.0 | Python |
ef59f0df3750035678cd5085feffe2c35e8ff552 | remove arg | vsoch/singularity-python,vsoch/singularity-python | singularity/analysis/reproduce/criteria.py | singularity/analysis/reproduce/criteria.py | '''
Copyright (C) 2017 The Board of Trustees of the Leland Stanford Junior
University.
Copyright (C) 2016-2017 Vanessa Sochat.
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... | '''
Copyright (C) 2017 The Board of Trustees of the Leland Stanford Junior
University.
Copyright (C) 2016-2017 Vanessa Sochat.
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... | agpl-3.0 | Python |
d81bd5c7a8f6f8de542c2ab15c87cc50208170ec | update hall data members | madhav-datt/kgp-hms,madhav-datt/kgp-hms | src/halls/hall.py | src/halls/hall.py | #
# Software Engineering Lab - Assignment 5
# IIT Kharagpur - Hall Management System
#
"""
@ authors: Madhav Datt (14CS30015), Avikalp Srivastava (14CS10008)
"""
from __future__ import division
from database import db_func as db
import warnings
class Hall(object):
"""Contains details of Hall
Attributes:
... | mit | Python | |
5a59be6d3b217c187aa49a094b2aa155c1279dea | fix raw example | uber/tchannel-python,Willyham/tchannel-python,uber/tchannel-python,Willyham/tchannel-python | examples/simple/raw/server.py | examples/simple/raw/server.py | from tornado import gen, ioloop
from tchannel import TChannel, Response
tchannel = TChannel('raw-server', hostport='localhost:54495')
@tchannel.raw.register
@gen.coroutine
def endpoint(request):
assert request.headers == 'req headers'
assert request.body == 'req body'
return Response('resp body', hea... | from tornado import gen, ioloop
from tchannel import TChannel, Response
tchannel = TChannel('raw-server', hostport='localhost:54495')
@tchannel.raw.register
@gen.coroutine
def endpoint(request, response, proxy):
assert request.headers == 'req headers'
assert request.body == 'req body'
return Response... | mit | Python |
4fc8bb105c56f566400500226acfba9d83c51f54 | Fix flake8 issue - module not on the top | andrei-karalionak/ggrc-core,kr41/ggrc-core,NejcZupec/ggrc-core,josthkko/ggrc-core,prasannav7/ggrc-core,j0gurt/ggrc-core,AleksNeStu/ggrc-core,jmakov/ggrc-core,j0gurt/ggrc-core,NejcZupec/ggrc-core,AleksNeStu/ggrc-core,jmakov/ggrc-core,andrei-karalionak/ggrc-core,edofic/ggrc-core,kr41/ggrc-core,josthkko/ggrc-core,AleksNeS... | src/ggrc/migrations/versions/20160119143508_262bbe790f4c_fix_assignee_context_on_requests.py | src/ggrc/migrations/versions/20160119143508_262bbe790f4c_fix_assignee_context_on_requests.py | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
"""Fix assignee context on requests
Revision ID: 262bbe790f4c
Revises: 297131e2... | # Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
"""Fix assignee context on requests
Revision ID: 262bbe790f4c
Revises: 297131e2... | apache-2.0 | Python |
ca18d3c2fa9d8f422b622dacfe58cb5331f098e8 | update tests to v1.1.0 (#1281) | exercism/python,smalley/python,exercism/python,jmluy/xpython,jmluy/xpython,exercism/xpython,behrtam/xpython,behrtam/xpython,N-Parsons/exercism-python,exercism/xpython,smalley/python,N-Parsons/exercism-python | exercises/sieve/sieve_test.py | exercises/sieve/sieve_test.py | import unittest
from sieve import sieve
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
class SieveTest(unittest.TestCase):
def test_no_primes_under_two(self):
self.assertEqual(sieve(1), [])
def test_find_first_prime(self):
self.assertEqual(sieve(2), [2])
de... | import unittest
from sieve import sieve
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
class SieveTest(unittest.TestCase):
def test_no_primes_under_two(self):
self.assertEqual(sieve(1), [])
def test_find_first_prime(self):
self.assertEqual(sieve(2), [2])
de... | mit | Python |
9f262eb5e76f77d0b055a375d2f021cb827117bb | Refactor completed. Kata 'ASCII85 Encoding & Decoding' solved. http://www.codewars.com/kata/5277dc3ff4bfbd9a36000c1c/solutions/python | Peter-Liang/CodeWars-Python | solutions/ASCII85_Encoding_And_Decoding.py | solutions/ASCII85_Encoding_And_Decoding.py | """
ASCII85 Encoding & Decoding
http://www.codewars.com/kata/5277dc3ff4bfbd9a36000c1c/train/python
"""
def toAscii85(data):
hex_str = ''
result = ''
for c in data:
hex_str += format(ord(c), '02x')
index = 0
while index < len(hex_str):
padding = max(((index + 8) - len(hex_str)) / 2,... | """
ASCII85 Encoding & Decoding
http://www.codewars.com/kata/5277dc3ff4bfbd9a36000c1c/train/python
"""
def toAscii85(data):
hex_str = ''
result = ''
for c in data:
hex_str += format(ord(c), '02x')
index = 0
while index < len(hex_str):
padding = max(((index + 8) - len(hex_str)) / 2,... | mit | Python |
25b3cd9a3371560cf04404d9c01f1f7b879a17cf | Update to version 0.3.1 | cjdrake/pyeda,sschnug/pyeda,GtTmy/pyeda,GtTmy/pyeda,pombredanne/pyeda,karissa/pyeda,karissa/pyeda,sschnug/pyeda,cjdrake/pyeda,pombredanne/pyeda,pombredanne/pyeda,sschnug/pyeda,karissa/pyeda,cjdrake/pyeda,GtTmy/pyeda | pyeda/__init__.py | pyeda/__init__.py | """
Python EDA Package
common.py
boolfunc.py -- Boolean functions
expr.py -- Boolean logic expressions
vexpr.py -- Boolean vector logic expressions
"""
__copyright__ = "Copyright (c) 2012, Chris Drake"
__version__ = "0.3.1"
| """
Python EDA Package
common.py
boolfunc.py -- Boolean functions
expr.py -- Boolean logic expressions
vexpr.py -- Boolean vector logic expressions
"""
__copyright__ = "Copyright (c) 2012, Chris Drake"
__version__ = "0.3.0"
| bsd-2-clause | Python |
0aca2daa690e97b174e5bf12a8cb30a1500e295f | fix error | Ghostboy-287/okadminfinder3 | Classes/Credits.py | Classes/Credits.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__version__ = '2.5.3'
__author__ = 'O.Koleda'
__improver__= 'mIcHy AmRaNe'
def getCredits():
return '''
____ __ __ __ _ _______ __
/ __ \/ //_/___ _____/ /___ ___ (_)___ / ____(_)___ ____/ /__ _____
/ / / / ,< / __ `... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__version__ = '2.6.0'
__author__ = 'O.Koleda'
__improver__= 'mIcHy AmRaNe'
def getCredits():
return '''
____ __ __ __ _ _______ __
/ __ \/ //_/___ _____/ /___ ___ (_)___ / ____(_)___ ____/ /__ _____
/ / / / ,< / __ `... | apache-2.0 | Python |
fad01d49fafc851daf1de0b31b0520354d0a471e | Fix compiling on OSX: no linking to lcrypt needed | sendanor/node-crypt3,sendanor/node-crypt3,rolandpoulter/node-crypt3,rolandpoulter/node-crypt3,rolandpoulter/node-crypt3,sendanor/node-crypt3,rolandpoulter/node-crypt3 | binding.gyp | binding.gyp | {
"targets": [
{
"target_name": "crypt3",
"sources": [ "crypt3.cc" ],
"conditions": [
['OS!="mac"', {
'link_settings': { "libraries": [ "-lcrypt" ] }
}]
]
}
]
}
| {
"targets": [
{
"target_name": "crypt3",
"sources": [ "crypt3.cc" ],
'link_settings': {
"libraries": [ "-lcrypt" ]
}
}
]
}
| mit | Python |
a3fd6b07b61a5ba77233368ef413b5ee0807dbbb | Add 4577 to the disabled warnings | atom/node-pathwatcher,ficristo/node-pathwatcher,ficristo/node-pathwatcher,atom/node-pathwatcher,meteor/node-pathwatcher,meteor/node-pathwatcher | binding.gyp | binding.gyp | {
"targets": [
{
"target_name": "pathwatcher",
"sources": [
"src/main.cc",
"src/common.cc",
"src/common.h",
"src/handle_map.cc",
"src/handle_map.h",
"src/unsafe_persistent.h",
],
"include_dirs": [
"src",
'<!(node -e "require(\... | {
"targets": [
{
"target_name": "pathwatcher",
"sources": [
"src/main.cc",
"src/common.cc",
"src/common.h",
"src/handle_map.cc",
"src/handle_map.h",
"src/unsafe_persistent.h",
],
"include_dirs": [
"src",
'<!(node -e "require(\... | mit | Python |
8811fc9cd72acc158d865db04e5def1451506808 | Build routes command update | synw/django-spages,synw/django-spages,synw/django-spages | spages/management/commands/build_routes.py | spages/management/commands/build_routes.py | # -*- coding: utf-8 -*-
import os
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from spages.models import SPage
from django.core.urlresolvers import reverse
class Command(BaseCommand):
help = 'Build routes for spages'
def handle(self, *args, **options):
... | # -*- coding: utf-8 -*-
import os
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from spages.models import SPage
from django.core.urlresolvers import reverse
class Command(BaseCommand):
help = 'Build routes for spages'
def handle(self, *args, **options):
... | mit | Python |
5eb7e836c3e7777e9935a9baa529005f5d47bbda | fix issues #3 | keeganbrown/node-opencv,peterbraden/node-opencv,borromeotlhs/node-opencv,tualo/node-opencv,madshall/node-opencv,bmathews/node-opencv,gregfriedland/node-opencv,abhishekdewan101/RealTimeFaceTracking,piercus/node-opencv,rbtkoz/node-opencv,dropfen/node-opencv,peterbraden/node-opencv,oneminute/node-opencv,autographer/node-o... | binding.gyp | binding.gyp | {
"targets": [{
"target_name": "opencv"
, "sources": [
"src/init.cc"
, "src/Matrix.cc"
, "src/OpenCV.cc"
, "src/CascadeClassifierWrap.cc"
, "src/Contours.cc"
, "src/Point.cc"
, "src/VideoCaptureWrap.cc"
, "src/CamShift.cc"
, "src/... | {
"targets": [{
"target_name": "opencv"
, "sources": [
"src/init.cc"
, "src/Matrix.cc"
, "src/OpenCV.cc"
, "src/CascadeClassifierWrap.cc"
, "src/Contours.cc"
, "src/Point.cc"
, "src/VideoCaptureWrap.cc"
, "src/CamShift.cc"
, "src/... | mit | Python |
64e8787072956e6845cba11543fe588146bcec24 | Create a pidfile. | NCI-Cloud/reporting-api,NeCTAR-RC/reporting-api,NeCTAR-RC/reporting-api,NCI-Cloud/reporting-api | bin/reporting-api.py | bin/reporting-api.py | #!/usr/bin/python
"""
Start the Reporting API application using Paste Deploy.
"""
import os
from paste.deploy import loadapp, loadserver
import logging
import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--confdir', action='store', required=True,
... | #!/usr/bin/python
"""
Start the Reporting API application using Paste Deploy.
"""
import sys
import os
from paste.deploy import loadapp, loadserver
import logging
import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--confdir', action='store', required=True, help="S... | apache-2.0 | Python |
602a4e13bc28f5eb48a7a48422f70c9b80d9a5df | remove open_in_browser method | cobrateam/splinter,cobrateam/splinter,lrowe/splinter,lrowe/splinter,cobrateam/splinter,gjvis/splinter,objarni/splinter,myself659/splinter,myself659/splinter,lrowe/splinter,bmcculley/splinter,underdogio/splinter,bubenkoff/splinter,gjvis/splinter,myself659/splinter,nikolas/splinter,underdogio/splinter,drptbl/splinter,obj... | splinter/driver/__init__.py | splinter/driver/__init__.py | class DriverAPI(object):
@property
def title(self):
raise NotImplementedError
@property
def html(self):
raise NotImplementedError
@property
def url(self):
raise NotImplementedError
def visit(self, url):
raise NotImplementedError
def execute_scr... | import webbrowser
class DriverAPI(object):
@property
def title(self):
raise NotImplementedError
@property
def html(self):
raise NotImplementedError
@property
def url(self):
raise NotImplementedError
def visit(self, url):
raise NotImplementedError
... | bsd-3-clause | Python |
5653e750c92d0843a534fe26e51fac183fb93921 | Set version info version to v0.2.1.dev0 | andfoy/spyder-terminal,andfoy/spyder-terminal,spyder-ide/spyder-terminal,spyder-ide/spyder-terminal,andfoy/spyder-terminal,spyder-ide/spyder-terminal,spyder-ide/spyder-terminal | spyder_terminal/__init__.py | spyder_terminal/__init__.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Spyder Te... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Spyder Te... | mit | Python |
6e22524ac28f484ff74d12853b0a5bf6ba6b0fb2 | Update histogramlut example to allow rgb mode | campagnola/acq4,acq4/acq4,pbmanis/acq4,acq4/acq4,campagnola/acq4,meganbkratz/acq4,meganbkratz/acq4,pbmanis/acq4,meganbkratz/acq4,campagnola/acq4,acq4/acq4,campagnola/acq4,pbmanis/acq4,acq4/acq4,meganbkratz/acq4,pbmanis/acq4 | examples/HistogramLUT.py | examples/HistogramLUT.py | # -*- coding: utf-8 -*-
"""
Use a HistogramLUTWidget to control the contrast / coloration of an image.
"""
## Add path to library (just for examples; you do not need this)
import initExample
import numpy as np
from pyqtgraph.Qt import QtGui, Q... | # -*- coding: utf-8 -*-
"""
Use a HistogramLUTWidget to control the contrast / coloration of an image.
"""
## Add path to library (just for examples; you do not need this)
import initExample
import numpy as np
from pyqtgraph.Qt import QtGui, Q... | mit | Python |
552f6a065f22d1c30d4b654735b3a4a45c4d0ef3 | Increment version number to 0.5.0 | biothings/biothings.api,biothings/biothings.api | biothings/version.py | biothings/version.py | # All biothings versions (including in setup.py) are sourced from these
MAJOR_VER = 0
MINOR_VER = 5
MICRO_VER = 0
| # All biothings versions (including in setup.py) are sourced from these
MAJOR_VER = 0
MINOR_VER = 5
MICRO_VER = "dev"
| apache-2.0 | Python |
3e7e7c2e5908f1428c027a5e5e9a23920389835e | make server.py callable | kilda/MaxiNet,kilda/MaxiNet | MaxiNet/Worker/server.py | MaxiNet/Worker/server.py | __author__ = 'm'
import Pyro4
import logging
import sys, os
import socket
if hasattr(Pyro4.config, 'SERIALIZERS_ACCEPTED'):
# From Pyro 4.25, pickle is not supported by default due to security.
# However, it is required to serialise some objects used by maxinet.
Pyro4.config.SERIALIZERS_ACCEPTED.add('pick... | __author__ = 'm'
import Pyro4
import logging
import sys, os
import socket
if hasattr(Pyro4.config, 'SERIALIZERS_ACCEPTED'):
# From Pyro 4.25, pickle is not supported by default due to security.
# However, it is required to serialise some objects used by maxinet.
Pyro4.config.SERIALIZERS_ACCEPTED.add('pick... | mit | Python |
e579ee8506fb3ea9f2356ebb4aa1b0a1aec6cdd8 | Update docstrings. | DaRasch/spiceminer,DaRasch/spiceminer | spiceminer/kernel/__init__.py | spiceminer/kernel/__init__.py | #!/usr/bin/env python
#-*- coding:utf-8 -*-
from .highlevel import Kernel
def load(path='.', recursive=True, followlinks=False, force_reload=False):
'''Load a kernel file or all kernel files in a directory tree.
Parameters
----------
path: str
Relative or absolute path to the kernel file/dir... | #!/usr/bin/env python
#-*- coding:utf-8 -*-
from .highlevel import Kernel
def load(path='.', recursive=True, followlinks=False, force_reload=False):
return Kernel.load(**locals())
def load_single(cls, path, extension=None, force_reload=False):
return Kernel.load_single(**locals())
def unload(path='.', recu... | mit | Python |
ca8857beaaffacc584db8198d0fa90473533549c | Change from Instance attribute to variable in JdbcOperator.execute (#7819) | airbnb/airflow,bolkedebruin/airflow,mrkm4ntr/incubator-airflow,danielvdende/incubator-airflow,wooga/airflow,wooga/airflow,nathanielvarona/airflow,DinoCow/airflow,cfei18/incubator-airflow,apache/airflow,nathanielvarona/airflow,DinoCow/airflow,mrkm4ntr/incubator-airflow,airbnb/airflow,danielvdende/incubator-airflow,sekik... | airflow/providers/jdbc/operators/jdbc.py | airflow/providers/jdbc/operators/jdbc.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... | #
# 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... | apache-2.0 | Python |
aed3192c029b4c03be1e10b0dd1677fbfb7fa213 | Increase version | TyVik/YaDiskClient | YaDiskClient/__init__.py | YaDiskClient/__init__.py | """
Client for Yandex.Disk.
"""
__version__ = '0.4.5'
| """
Client for Yandex.Disk.
"""
__version__ = '0.4.4'
| mit | Python |
41f11b0c01a323ce265808e099f1d1cb6dd09bf2 | Test for Curve.frames iterator | guerilla-di/framecurve_python | test/test_framecurve_curve.py | test/test_framecurve_curve.py | import framecurve
def test_empty():
c = framecurve.Curve()
assert len(c) == 0
def test_one_tuple():
c = framecurve.Curve()
c.append(framecurve.FrameCorrelation(1, 2.4))
print str(c[0])
assert len(c) == 1
assert c[0] == framecurve.FrameCorrelation(1, 2.4)
assert str(c[0]) == "1\t2.4... | import framecurve
def test_empty():
c = framecurve.Curve()
assert len(c) == 0
def test_one_tuple():
c = framecurve.Curve()
c.append(framecurve.FrameCorrelation(1, 2.4))
print str(c[0])
assert len(c) == 1
assert c[0] == framecurve.FrameCorrelation(1, 2.4)
assert str(c[0]) == "1\t2.4... | mit | Python |
3a9fc0d9f45532bdbfd0f63c06546276c967f787 | Add platform detector. | Labbiness/Pancake,Labbiness/Pancake | Pancake/Core/platform.py | Pancake/Core/platform.py | #
# Copyright (c) 2017 Shota Shimazu
#
# 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 w... | #
# Copyright (c) 2017 Shota Shimazu
#
# 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 w... | apache-2.0 | Python |
dbea06ab72c970bfaa21bd22c6112d6620a00bf8 | fix for dumpdata command | hanuprateek/django-jsonfield,dmkoch/django-jsonfield,bradjasper/django-jsonfield,thenewguy/django-jsonfield,anvil8/django-jsonfield,SpazioDati/django-jsonfield,philippeowagner/django-jsonfield,natgeo/django-jsonfield,rocketrip/django-jsonfield,kazmiruk/django-jsonfield,Natgeoed/django-jsonfield,velfimov/django-jsonfiel... | jsonfield/fields.py | jsonfield/fields.py | from django.db import models
from django.core.serializers.json import DjangoJSONEncoder
from django.utils import simplejson as json
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import Field
from django.forms.util import ValidationError as FormValidationError
class JSONFormField(Fie... | from django.db import models
from django.core.serializers.json import DjangoJSONEncoder
from django.utils import simplejson as json
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import Field
from django.forms.util import ValidationError as FormValidationError
class JSONFormField(Fie... | mit | Python |
3961428d429a44f81f128b84267a4aefc6cc3c10 | Remove mark.xfail | thombashi/tcconfig,thombashi/tcconfig | test/test_tcset_config_file.py | test/test_tcset_config_file.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import division
import json
import pytest
from subprocrunner import SubprocessRunner
@pytest.fixture
def device_option(request):
return request.config.getoption("--device")
class Test_tcconfig(object):
@pyt... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import division
import json
import pytest
from subprocrunner import SubprocessRunner
@pytest.fixture
def device_option(request):
return request.config.getoption("--device")
class Test_tcconfig(object):
@pyt... | mit | Python |
b723cfcb792539f6784474baa7eafcbd617307e1 | Update TOA_Filtering.py | NANOGravDataManagement/bridge,NANOGravDataManagement/bridge,shakeh/bridge | filtering/TOA_Filtering.py | filtering/TOA_Filtering.py | # TOA_Filtering.py
# A script that takes in a .tim file, start time and end time, and an output directory
# as a result, it creates a new file with TOAs in the time range, stored in output directory
# sample input:
# python TOA_Filtering.py /Users/fkeri/Desktop/B1855+09_NANOGrav_9yv0.tim 51000 56000 /Users/fkeri/Deskto... | import sys
import math
import datetime
import jdcal
import glob
import os.path
def date2mjd(year, month, day):
"""
function that converts date in YYYY/MM/DD to MJD
"""
jd = sum(jdcal.gcal2jd(year, month, day))
mjd = jd -2400000.5
return mjd
def isFloat( X ):
try:
float( X )
return True
e... | apache-2.0 | Python |
39c0bb2ad94e2706325ca1c68d122c3c913394ac | Bump version | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | radar/__init__.py | radar/__init__.py | __version__ = '2.43.2'
| __version__ = '2.43.1'
| agpl-3.0 | Python |
f5ca8af37dce132d37809b9f5ff233ef10ec6967 | enforce pdf extension | cuckoobox/cuckoo,cuckoobox/cuckoo,cuckoobox/cuckoo,cuckoobox/cuckoo,cuckoobox/cuckoo | analyzer/windows/modules/packages/pdf.py | analyzer/windows/modules/packages/pdf.py | # Copyright (C) 2010-2013 Claudio Guarnieri.
# Copyright (C) 2014-2016 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import logging
import os
from _winreg import HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER
from lib.common.abstr... | # Copyright (C) 2010-2013 Claudio Guarnieri.
# Copyright (C) 2014-2016 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from _winreg import HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER
from lib.common.abstracts import Package
class... | mit | Python |
aaaaa598733bcc02464268aacba6c229fab12498 | Move get_htids_from_data method into class | mlibrary/image-conversion-and-validation,mlibrary/image-conversion-and-validation | falcom/api/hathi/from_json.py | falcom/api/hathi/from_json.py | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
from json import loads as json_load_str
from .data import HathiData
def get_None_if_empty (container):
return container if container els... | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
from json import loads as json_load_str
from .data import HathiData
def get_None_if_empty (container):
return container if container els... | bsd-3-clause | Python |
62eace17b558113eb66e091abcb618c54210bb4e | Remove Resources::getMesh and add a MeshesLocation that can be used with Resources::locate | onitake/Uranium,onitake/Uranium | Cura/Resources.py | Cura/Resources.py | import os.path
class Resources:
ResourcesLocation = 1
SettingsLocation = 2
PreferencesLocation = 3
MeshesLocation = 4
@classmethod
def locate(cls, type, *args):
path = os.path.join(cls.getPath(type), *args)
if os.path.isfile(path):
return path
return ''
... | import os.path
class Resources:
ResourcesLocation = 1
SettingsLocation = 2
PreferencesLocation = 3
@classmethod
def locate(cls, type, *args):
path = os.path.join(cls.getPath(type), *args)
if os.path.isfile(path):
return path
return ''
## Return a path to ... | agpl-3.0 | Python |
48356b711b4cab11645d0b815be343307b215592 | Update lib_utilities.py | dsilvestro/PyRate,dsilvestro/PyRate,dsilvestro/PyRate,dsilvestro/PyRate | pyrate_continuous/lib_utilities.py | pyrate_continuous/lib_utilities.py | #!/usr/bin/env python
import argparse, os,sys
from numpy import *
import numpy as np
import os, csv, glob
try: from biopy.bayesianStats import hpd as calcHPD
except(ImportError): pass
np.set_printoptions(suppress=True) # prints floats, no scientific notation
np.set_printoptions(precision=3) # rounds all array elemen... | #!/usr/bin/env python
# Created by Daniele Silvestro on 02/03/2012 => dsilvestro@senckenberg.de
import argparse, os,sys
from numpy import *
import numpy as np
import os, csv, glob
try: from biopy.bayesianStats import hpd as calcHPD
except(ImportError): pass
np.set_printoptions(suppress=True) # prints floats, no scien... | agpl-3.0 | Python |
d51155c7ad1bb9a3eccd840c17835c9d8f3bc8db | Update __init__.py | williamFalcon/pytorch-lightning,williamFalcon/pytorch-lightning | pytorch_lightning/__init__.py | pytorch_lightning/__init__.py | """Root package info."""
__version__ = '0.9.0rc17'
__author__ = 'William Falcon et al.'
__author_email__ = 'waf2107@columbia.edu'
__license__ = 'Apache-2.0'
__copyright__ = 'Copyright (c) 2018-2020, %s.' % __author__
__homepage__ = 'https://github.com/PyTorchLightning/pytorch-lightning'
# this has to be simple string,... | """Root package info."""
__version__ = '0.9.0rc16'
__author__ = 'William Falcon et al.'
__author_email__ = 'waf2107@columbia.edu'
__license__ = 'Apache-2.0'
__copyright__ = 'Copyright (c) 2018-2020, %s.' % __author__
__homepage__ = 'https://github.com/PyTorchLightning/pytorch-lightning'
# this has to be simple string,... | apache-2.0 | Python |
91c4e1fa59e95f74184782b63ad9bf00ad675081 | increase release (#4949) | williamFalcon/pytorch-lightning,williamFalcon/pytorch-lightning | pytorch_lightning/__init__.py | pytorch_lightning/__init__.py | """Root package info."""
__version__ = '1.1.0rc0'
__author__ = 'William Falcon et al.'
__author_email__ = 'waf2107@columbia.edu'
__license__ = 'Apache-2.0'
__copyright__ = 'Copyright (c) 2018-2020, %s.' % __author__
__homepage__ = 'https://github.com/PyTorchLightning/pytorch-lightning'
# this has to be simple string, ... | """Root package info."""
__version__ = '1.1.0-dev'
__author__ = 'William Falcon et al.'
__author_email__ = 'waf2107@columbia.edu'
__license__ = 'Apache-2.0'
__copyright__ = 'Copyright (c) 2018-2020, %s.' % __author__
__homepage__ = 'https://github.com/PyTorchLightning/pytorch-lightning'
# this has to be simple string,... | apache-2.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.