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 |
|---|---|---|---|---|---|---|---|---|
934bd6c894dc461282d5ff2f450672eb76476698 | Fix typo. | opencivicdata/opencivicdata.org,opencivicdata/opencivicdata.org,opencivicdata/opencivicdata.org | upload/backend/importer.py | upload/backend/importer.py | from pupa.scrape import (Jurisdiction, Person, Organization, Membership, Post)
from pupa.importers import (OrganizationImporter, PersonImporter, PostImporter,
MembershipImporter)
from django.db import transaction
def do_import(stream, stransaction):
stream = list(stream)
jurisdicti... | from pupa.scrape import (Jurisdiction, Person, Organization, Membership, Post)
from pupa.importers import (OrganizationImporter, PersonImporter, PostImporter,
MembershipImporter)
from django.db import transaction
def do_import(stream, transaction):
stream = list(stream)
jurisdictio... | bsd-3-clause | Python |
bfd4bf6118d69a70926982c602d411dc6f9ab1d4 | Check return value of bdist_egg command | pypa/setuptools,pypa/setuptools,pypa/setuptools | tests/test_python33_bdist_egg.py | tests/test_python33_bdist_egg.py | import sys
import os
import tempfile
import unittest
import shutil
import copy
CURDIR = os.path.abspath(os.path.dirname(__file__))
TOPDIR = os.path.split(CURDIR)[0]
sys.path.insert(0, TOPDIR)
from distribute_setup import (use_setuptools, _build_egg, _python_cmd,
_do_download, _install, D... | import sys
import os
import tempfile
import unittest
import shutil
import copy
CURDIR = os.path.abspath(os.path.dirname(__file__))
TOPDIR = os.path.split(CURDIR)[0]
sys.path.insert(0, TOPDIR)
from distribute_setup import (use_setuptools, _build_egg, _python_cmd,
_do_download, _install, D... | mit | Python |
825502e2fab40a930bfa6ba678c6a9bbcd939c7f | rename local variable for attribute names | geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx,geometalab/drf-utm-zone-info,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/drf-utm-zone-info,geometalab/osmaxx-frontend | yamltomd.py | yamltomd.py | from jinja2 import Template
import yaml
def yaml_to_md(table):
out.write('## ' + table + '\n\n')
data = yaml.load(inp)
attribute_names = data['layers'][table]['attributes'].keys()
dicts = data['layers'][table]['attributes']
dicts2 = dicts['type']['values']
key2 = dicts2.keys()
with open... | from jinja2 import Template
import yaml
def yaml_to_md(table):
out.write('## ' + table + '\n\n')
data = yaml.load(inp)
key1 = data['layers'][table]['attributes'].keys()
dicts = data['layers'][table]['attributes']
dicts2 = dicts['type']['values']
key2 = dicts2.keys()
with open('templates... | mit | Python |
9855e7b0acf70266a3280e0c699961a587d62d57 | Add string representation for ExperimentAction | bburan/psiexperiment | psi/controller/experiment_action.py | psi/controller/experiment_action.py | import logging
log = logging.getLogger(__name__)
from functools import partial
from atom.api import Unicode, Int, Dict, Bool, Typed, Callable, List
from enaml.core.api import Declarative, d_
from psi.util import get_dependencies
class ExperimentState(Declarative):
'''
Allows for indication of a state (e.g.... | import logging
log = logging.getLogger(__name__)
from functools import partial
from atom.api import Unicode, Int, Dict, Bool, Typed, Callable, List
from enaml.core.api import Declarative, d_
from psi.util import get_dependencies
class ExperimentState(Declarative):
'''
Allows for indication of a state (e.g.... | mit | Python |
4241e8f5ca6114e6bcc5b9fda2e79cfa83ba6f3b | Test for ScheduledAnalysis get_sample | mass-project/mass_api_client,mass-project/mass_api_client | tests/test_scheduled_analysis.py | tests/test_scheduled_analysis.py | import json
from mass_api_client import ConnectionManager
from mass_api_client.resources import ScheduledAnalysis
from mass_api_client.resources import FileSample
from tests.serialization_test_case import SerializationTestCase
from tests.httmock_test_case import HTTMockTestCase
from httmock import HTTMock, urlmatch
c... | import json
from mass_api_client.resources import ScheduledAnalysis
from tests.serialization_test_case import SerializationTestCase
class ScheduledAnalysisTestCase(SerializationTestCase):
def test_is_data_correct_after_serialization(self):
with open('tests/data/scheduled_analysis.json') as data_file:
... | mit | Python |
dba40486c0f8e0ff22f2b3491a179ef7d6d664b7 | Check for owner in the loader module | MoroseMagician/discolyte | acolyte/modules/loader.py | acolyte/modules/loader.py | from discord.ext import commands
from discord.ext.commands.errors import ExtensionAlreadyLoaded
from discord.ext.commands.errors import ExtensionNotFound
from discord.ext.commands.errors import ExtensionNotLoaded
class Loader(commands.Cog):
""" Module loader """
def __init__(self, bot):
self.bot = bot... | from discord.ext import commands
from discord.ext.commands.errors import ExtensionAlreadyLoaded
from discord.ext.commands.errors import ExtensionNotFound
from discord.ext.commands.errors import ExtensionNotLoaded
class Loader(commands.Cog):
""" Module loader """
def __init__(self, bot):
self.bot = bot... | mit | Python |
e342a9eef2f4d1bef28f9284feecd18c6c9b941e | fix to m2m | joeyuan19/flaming-bear,joeyuan19/flaming-bear,joeyuan19/flaming-bear,joeyuan19/flaming-bear | PersonalSite/analytics/models.py | PersonalSite/analytics/models.py | from django.db import models
# Create your models here.
class Visit(models.Model):
url = models.CharField(max_length=256)
date = models.DateTimeField(editable=False)
visitor = models.ForeignKey('Visitor')
# Possibly extend this class in the future to make a tree
# that gives something like "/ -> /... | from django.db import models
# Create your models here.
class Visit(models.Model):
url = models.CharField(max_length=256)
date = models.DateTimeField(editable=False)
visitor = models.ForeignKey('Visitor',related_name)
# Possibly extend this class in the future to make a tree
# that gives something... | apache-2.0 | Python |
5224d55d4b65ae7142a51bf2ce58221cd69102f6 | fix race condition in issue6171-sdk-start-crash | nwjs/nw.js,nwjs/nw.js,nwjs/nw.js,nwjs/nw.js,nwjs/nw.js,nwjs/nw.js | test/sanity/issue6171-sdk-start-crash/test.py | test/sanity/issue6171-sdk-start-crash/test.py | import time
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from nw_util import *
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__fi... | import time
import os
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__)))
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
... | mit | Python |
d0bf235af3742a17c722488fe3679d5b73a0d945 | Fix gemm calls in Softmax | spacy-io/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc | thinc/neural/_classes/softmax.py | thinc/neural/_classes/softmax.py | from .affine import Affine
from ... import describe
from ...describe import Dimension, Synapses, Biases
from ...check import has_shape
from ... import check
@describe.attributes(
W=Synapses("Weights matrix",
lambda obj: (obj.nO, obj.nI),
lambda W, ops: None)
)
class Softmax(Affine):
name = 'so... | from .affine import Affine
from ... import describe
from ...describe import Dimension, Synapses, Biases
from ...check import has_shape
from ... import check
@describe.attributes(
W=Synapses("Weights matrix",
lambda obj: (obj.nO, obj.nI),
lambda W, ops: None)
)
class Softmax(Affine):
name = 'so... | mit | Python |
13723e6238f3026b9f37909c3e2a0e1668c8a1b9 | Update quiz-eliecer.py | eliecer11/Uip-prog3 | laboratorios/quiz1/quiz-eliecer.py | laboratorios/quiz1/quiz-eliecer.py | #calcular el area y perimetro de un rectangulo
#base=5
#altura=7 convertir area y perimetro en metros y pulgadas
base=5
altura=7
perimetro=2*5+2*7
print ("mi perimetro es" + str(perimetro))
area=5*7
print ("mi area es" + str (area))
metrop=perimetro/100
print ("mi perimetro en metro es" + str(metrop))
pulgadap=p... |
base=5
altura=7
perimetro=2*5+2*7
print ("mi perimetro es" + str(perimetro))
area=5*7
print ("mi area es" + str (area))
metrop=perimetro/100
print ("mi perimetro en metro es" + str(metrop))
pulgadap=perimetro/2.54
print ("mi perimetro en pulgada es" + str(pulgadap))
metroa=area/100
print ("mi area en metro es" +... | mit | Python |
93304e3a498e24f16894a8e3f75da61bb1383a45 | check if document associated to a file | bricaud/wevia,bricaud/wevia,bricaud/wevia | advancedSettings/views.py | advancedSettings/views.py | from django.shortcuts import render
import os
#from django.conf import settings
from classif.models import Cluster
from fileupload.models import Document
from graphdesign.models import GraphNode
def index(request):
output = ''
if(request.GET.get('check_db')):
output = run_check_db()
if(request.GET.get('clean_d... | from django.shortcuts import render
import os
#from django.conf import settings
from classif.models import Cluster
from fileupload.models import Document
from graphdesign.models import GraphNode
def index(request):
output = ''
if(request.GET.get('check_db')):
output = run_check_db()
if(request.GET.get('clean_d... | agpl-3.0 | Python |
7cb1199d0904e3799a3695bdef465bc8021a2ff4 | Fix pt_br | lk-geimfari/mimesis,lk-geimfari/church,lk-geimfari/elizabeth,lk-geimfari/mimesis | tests/test_builtins/pt_br/test_brazil_spec.py | tests/test_builtins/pt_br/test_brazil_spec.py | import re
import pytest
from mimesis.builtins import BrazilSpecProvider
@pytest.fixture
def pt_br():
return BrazilSpecProvider()
def test_cpf(pt_br):
# test if the cpf has 14 digits with the mask
cpf_with_mask = pt_br.cpf()
assert len(cpf_with_mask) == 14
# test the mask
non_numeric_digits... | import re
import pytest
from mimesis.builtins import BrazilSpecProvider
@pytest.fixture
def pt_br():
return BrazilSpecProvider()
def test_cpf(pt_br):
# test if the cpf has 14 digits with the mask
cpf_with_mask = pt_br.cpf()
assert len(cpf_with_mask) == 14
# test the mask
non_numeric_digits... | mit | Python |
b9d8434d310ceb0654c8d69a0c54309bb33ccfe2 | Fix docstring typo. | tensorflow/agents,tensorflow/agents | tf_agents/environments/atari_wrappers_test.py | tf_agents/environments/atari_wrappers_test.py | # coding=utf-8
# Copyright 2018 The TF-Agents 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... | # coding=utf-8
# Copyright 2018 The TF-Agents 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... | apache-2.0 | Python |
f8bf6f54c8700d2031c6bd833ad57ccb090730ad | fix pylint:no-self-use of .backend.cbor.Parser._load | ssato/python-anyconfig,ssato/python-anyconfig | anyconfig/backend/cbor.py | anyconfig/backend/cbor.py | #
# Copyright (C) 2017 Satoru SATOH <ssato @ redhat.com>
# License: MIT
#
r"""CBOR backend:
- Format to support: CBOR, http://cbor.io, https://tools.ietf.org/html/rfc7049
- Requirements: cbor, https://pypi.python.org/pypi/cbor
- Development Status :: 4 - Beta
- Limitations: None obvious
- Special options:
- All opt... | #
# Copyright (C) 2017 Satoru SATOH <ssato @ redhat.com>
# License: MIT
#
r"""CBOR backend:
- Format to support: CBOR, http://cbor.io, https://tools.ietf.org/html/rfc7049
- Requirements: cbor, https://pypi.python.org/pypi/cbor
- Development Status :: 4 - Beta
- Limitations: None obvious
- Special options:
- All opt... | mit | Python |
2d3d1d63f616fe0ccafad8a04f412f93e86ee72c | Expand geo-alchemy example. | mikelambert/flask-admin,jamesbeebop/flask-admin,flabe81/flask-admin,lifei/flask-admin,iurisilvio/flask-admin,quokkaproject/flask-admin,lifei/flask-admin,LennartP/flask-admin,Kha/flask-admin,jschneier/flask-admin,plaes/flask-admin,plaes/flask-admin,jschneier/flask-admin,torotil/flask-admin,jschneier/flask-admin,phantomx... | examples/geo-alchemy/app.py | examples/geo-alchemy/app.py | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import flask_admin as admin
from geoalchemy2.types import Geometry
from flask_admin.contrib.geoa import ModelView
# Create application
app = Flask(__name__)
# Create dummy secrey key so we can use sessions
app.config['SECRET_KEY'] = '123456790'
app.co... | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import flask_admin as admin
from geoalchemy2.types import Geometry
from flask_admin.contrib.geoa import ModelView
# Create application
app = Flask(__name__)
# Create dummy secrey key so we can use sessions
app.config['SECRET_KEY'] = '123456790'
app.co... | bsd-3-clause | Python |
0d4093c768ee107eb962f7bb3142048493ff7f5e | Update processMIMTokens.py to remove abbreviations. | Eyra-is/Eyra,Eyra-is/Eyra,Eyra-is/Eyra,Eyra-is/Eyra,Eyra-is/Eyra,Eyra-is/Eyra | Backend/scripts/processMIMTokens.py | Backend/scripts/processMIMTokens.py | import sys
import os
import re
wordsToRemove = [
'hv',
'hæstv'
]
def process(sortedSentDir, lowerWCBound, upperWCBound, dest):
with open(dest, 'w', encoding='utf8') as f:
for i in range(int(lowerWCBound), int(upperWCBound)+1):
pathToWords = os.path.join(sortedSentDir, str(i), 'sentence... | import sys
import os
import re
def process(sortedSentDir, lowerWCBound, upperWCBound, dest):
with open(dest, 'w', encoding='utf8') as f:
for i in range(int(lowerWCBound), int(upperWCBound)+1):
pathToWords = os.path.join(sortedSentDir, str(i), 'sentences.words')
if (os.path.exists(pa... | apache-2.0 | Python |
0dece1167815327a272b590a7cec9a99464bf5ed | Bump version | encode/uvicorn,encode/uvicorn | uvicorn/__init__.py | uvicorn/__init__.py | from uvicorn.run import run
__version__ = '0.1.0'
__all__ = ['run']
| from uvicorn.run import run
__version__ = '0.0.15'
__all__ = ['run']
| bsd-3-clause | Python |
215cbbb4f9d9127d8ce2e60c9e49cb597e9d1633 | add BANNED_LINKS | topher200/hearthstone_reddit_card_bot | generate_card_csv.py | generate_card_csv.py | """Fetches latest card names and links from hearthpwn.
Outputs to cards.csv.
"""
import bs4
import collections
import csv
import httplib2
import logging
import util
# These cards cause too many false positives
BANNED_CARD_LIST = [
"Bananas",
"Blizzard",
"Boar",
"Silence",
"Charge",
"Chicken",
"Claw",
... | """Fetches latest card names and links from hearthpwn.
Outputs to cards.csv.
"""
import bs4
import collections
import csv
import httplib2
import logging
import util
BANNED_CARD_LIST = [
"Bananas",
"Blizzard",
"Boar",
"Silence",
"Charge",
"Chicken",
"Claw",
"DEBUG",
"Defender",
"Dream",
"Dispel"... | mit | Python |
d13dca630b2d34a7a0c41b8c3ef5dd79c75ec6cb | Update proxy examples | mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase | seleniumbase/config/proxy_list.py | seleniumbase/config/proxy_list.py | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | """
Proxy Server "Phone Book".
Simplify running browser tests through a proxy server
by adding your frequently-used proxies here.
Now you can do something like this on the command line:
"pytest SOME_TEST.py --proxy=proxy1"
Format of PROXY_LIST server entries:
* "ip_address:port" OR "username:password@ip_address:po... | mit | Python |
9448c082b158dcab960d33982e8189f2d2da4729 | Fix flake8 | gitpython-developers/gitpython,gitpython-developers/GitPython,gitpython-developers/GitPython,gitpython-developers/gitpython | git/compat/typing.py | git/compat/typing.py | # -*- coding: utf-8 -*-
# config.py
# Copyright (C) 2021 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import sys
if sys.version_info[:2] >= (3, 8):
from typing import Final, Litera... | # -*- coding: utf-8 -*-
# config.py
# Copyright (C) 2021 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import sys
if sys.version_info[:2] >= (3, 8):
from typing import Final, Litera... | bsd-3-clause | Python |
99cf264a53025f8c80688f4ce89410a678eee876 | update import statements | MrYsLab/PyMata | examples/pymata_i2c_read.py | examples/pymata_i2c_read.py | __author__ = 'Copyright (c) 2013 Alan Yorinks All rights reserved.'
"""
Copyright (c) 2013 Alan Yorinks All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 3 of the ... | __author__ = 'Copyright (c) 2013 Alan Yorinks All rights reserved.'
"""
Copyright (c) 2013 Alan Yorinks All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 3 of the ... | agpl-3.0 | Python |
007a4a1ba529e2913357387c1f42b6028860fe98 | Clean up coverage_coverage.py | 7WebPages/coveragepy,larsbutler/coveragepy,jayhetee/coveragepy,7WebPages/coveragepy,jayhetee/coveragepy,blueyed/coveragepy,larsbutler/coveragepy,jayhetee/coveragepy,7WebPages/coveragepy,larsbutler/coveragepy,hugovk/coveragepy,blueyed/coveragepy,hugovk/coveragepy,blueyed/coveragepy,nedbat/coveragepy,blueyed/coveragepy,n... | test/coverage_coverage.py | test/coverage_coverage.py | """Coverage-test Coverage.py itself."""
import os, shutil, sys
import nose
HTML_DIR = "htmlcov"
def run_tests_with_coverage():
"""Run the test suite with coverage measuring itself."""
import coverage
tracer = os.environ.get('COVERAGE_TEST_TRACER', 'c')
version = "%s%s" % sys.version_info[:2]
... | """Coverage-test Coverage.py itself."""
import os, shutil, sys
import nose
HTML_DIR = "htmlcov"
def run_tests_with_coverage():
import coverage
tracer = os.environ.get('COVERAGE_TEST_TRACER', 'c')
version = "%s%s" % sys.version_info[:2]
suffix = ".%s_%s" % (version, tracer)
cov = coverage.co... | apache-2.0 | Python |
6881525aaada9b8a6c895be4dbc40b2fddc6eec6 | Update booted.py | jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi | apps/led_berepi/booted.py | apps/led_berepi/booted.py | ## This code for HW init
## It will show LED Blue ON, 30secs after booting
## We can easily check the booting has problem
thispath='...BerePi/trunk/apps/led_berepi'
import sys
from ledinit import *
debug_print = 1
def BootLed():
ledb_on()
time.sleep(1)
ledb_off()
time.sleep(1)
if __name__== "__main__" :
if... | ## This code for HW init
## It will show LED Blue ON, 30secs after booting
## We can easily check the booting has problem
thispath='...BerePi/trunk/apps/led_berepi'
import sys
from ledinit import *
debug_print = 1
def BootLed():
ledr_on()
time.sleep(1)
ledr_off()
time.sleep(1)
if __name__== "__main__" :
if... | bsd-2-clause | Python |
246971d8dd7d6c5fdc480c55e4e79ffd7a840b9b | Add a render method to view that should be reimplemented | onitake/Uranium,onitake/Uranium | Cura/View/View.py | Cura/View/View.py | #Abstract for all views
class View(object):
def __init__(self):
self._renderer = None
def render(self, glcontext):
pass
| #Abstract for all views
class View(object):
def __init__(self):
self._renderer = None | agpl-3.0 | Python |
169746eea4f8b520af9b7388ae62cdf903dd288b | remove redundant lambda usage | picsadotcom/maguire | backend/maguire/celery.py | backend/maguire/celery.py | from __future__ import absolute_import
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'maguire.settings')
app = Celery('maguire')
# Using a string here means the worker will not have to
# pickle the object when u... | from __future__ import absolute_import
import os
from celery import Celery
from django.conf import settings
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'maguire.settings')
app = Celery('maguire')
# Using a string here means the worker will not... | bsd-3-clause | Python |
920209c1bb25ca59161414b285551a08da44a7b2 | Add sponsors to admin | patrick91/pycon,patrick91/pycon | backend/sponsors/admin.py | backend/sponsors/admin.py | from django.contrib import admin
from .models import Sponsor, SponsorLevel
@admin.register(SponsorLevel)
class SponsorLevelAdmin(admin.ModelAdmin):
list_display = ("name", "conference")
@admin.register(Sponsor)
class SponsorAdmin(admin.ModelAdmin):
pass
| # from django.contrib import admin
# from .models import Post
# @admin.register(Post)
# class PostAdmin(admin.ModelAdmin):
# list_display = ("title", "published", "author")
| mit | Python |
ca674b743b6d48593f45d999335ae893cf2a90d6 | Add github and facebook oauth credentials. | klen/Flask-Foundation,klen/fquest,klen/tweetchi | base/config/production.py | base/config/production.py | " Production settings must be here. "
from .core import *
from os import path as op
SECRET_KEY = 'SecretKeyForSessionSigning'
ADMINS = frozenset([MAIL_USERNAME])
# flask.ext.collect
# -----------------
COLLECT_STATIC_ROOT = op.join(op.dirname(ROOTDIR), 'static')
# auth.oauth
# ----------
OAUTH_TWITTER = dict(
... | " Production settings must be here. "
from .core import *
from os import path as op
SECRET_KEY = 'SecretKeyForSessionSigning'
ADMINS = frozenset([MAIL_USERNAME])
# flask.ext.collect
# -----------------
COLLECT_STATIC_ROOT = op.join(op.dirname(ROOTDIR), 'static')
# auth.oauth
# ----------
OAUTH_TWITTER = dict(
... | bsd-3-clause | Python |
436495835604d58b5c188bb0151e88d11e8e5de2 | fix httprpc_soap_basic.py | arskom/spyne,martijnvermaat/rpclib,martijnvermaat/rpclib,arskom/spyne,arskom/spyne,martijnvermaat/rpclib | src/rpclib/test/interop/server/httprpc_soap_basic.py | src/rpclib/test/interop/server/httprpc_soap_basic.py | #!/usr/bin/env python
#
# rpclib - Copyright (C) Rpclib contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ... | #!/usr/bin/env python
#
# rpclib - Copyright (C) Rpclib contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ... | lgpl-2.1 | Python |
70332af1d948c882372c91264d776d73b0bcfb29 | Bump version | thombashi/sqliteschema | sqliteschema/__version__.py | sqliteschema/__version__.py | # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.15.4"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.15.3"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| mit | Python |
c7b6e04c9cc2c218ef816619320d1dc17420ae4c | Bump version | thombashi/sqliteschema | sqliteschema/__version__.py | sqliteschema/__version__.py | __author__ = "Tsuyoshi Hombashi"
__copyright__ = f"Copyright 2016, {__author__}"
__license__ = "MIT License"
__version__ = "1.2.1"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| __author__ = "Tsuyoshi Hombashi"
__copyright__ = f"Copyright 2016, {__author__}"
__license__ = "MIT License"
__version__ = "1.2.0"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| mit | Python |
931e88af93a0ad9f234be0db0056610037f7a289 | improve print msg | tanghaibao/goatools,tanghaibao/goatools | tests/test_nb_relationships_change_dcnt_values.py | tests/test_nb_relationships_change_dcnt_values.py | #!/usr/bin/env python
"""Test notebook code"""
from goatools.base import get_godag
from goatools.gosubdag.gosubdag import GoSubDag
from goatools.gosubdag.plot.gosubdag_plot import GoSubDagPlot
def test_nb():
"""Test notebook code"""
godag = get_godag("go-basic.obo", optional_attrs={'relationship'})
go_le... | #!/usr/bin/env python
"""Test notebook code"""
from goatools.base import get_godag
from goatools.gosubdag.gosubdag import GoSubDag
from goatools.gosubdag.plot.gosubdag_plot import GoSubDagPlot
def test_nb():
"""Test notebook code"""
godag = get_godag("go-basic.obo", optional_attrs={'relationship'})
go_lea... | bsd-2-clause | Python |
b24de4ee1e641194b378b99462ec1db1d5c4ad2c | Remove unnecessary TODO. | praekelt/airtime-service | airtime_service/service.py | airtime_service/service.py | from twisted.application import strports
from twisted.internet import reactor
from twisted.python import usage
from twisted.web import server
from .api import AirtimeServiceApp
DEFAULT_PORT = '8080'
class Options(usage.Options):
"""Command line args when run as a twistd plugin"""
optParameters = [["port", ... | from twisted.application import strports
from twisted.internet import reactor
from twisted.python import usage
from twisted.web import server
from .api import AirtimeServiceApp
DEFAULT_PORT = '8080'
class Options(usage.Options):
"""Command line args when run as a twistd plugin"""
# TODO other args
optP... | bsd-3-clause | Python |
53dd5ef261d0b7e2e406d0a4a97c4b5d5b691b70 | use mock in testing output function | OrlandoSoto/retirement,OrlandoSoto/retirement,marteki/retirement,OrlandoSoto/retirement,marteki/retirement,niqjohnson/retirement,mistergone/retirement,marteki/retirement,mistergone/retirement,mistergone/retirement,niqjohnson/retirement,niqjohnson/retirement,marteki/retirement | retirement_api/tests/test_models.py | retirement_api/tests/test_models.py | import os
import sys
from retirement_api.models import AgeChoice, Question, Step, Page, Tooltip
import mock
from django.test import TestCase
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
sys.path.append(BASE_DIR)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
class ViewModels(Te... | import os
import sys
from retirement_api.models import AgeChoice, Question, Step, Page, Tooltip
import mock
from django.test import TestCase
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
sys.path.append(BASE_DIR)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
class ViewModels(Te... | cc0-1.0 | Python |
a1dce3d7ab710106bf3bfaaa01536efebb17c44e | Make sqlite wait longer for locked files | zstars/weblabdeusto,morelab/weblabdeusto,morelab/weblabdeusto,weblabdeusto/weblabdeusto,porduna/weblabdeusto,zstars/weblabdeusto,zstars/weblabdeusto,morelab/weblabdeusto,morelab/weblabdeusto,zstars/weblabdeusto,weblabdeusto/weblabdeusto,zstars/weblabdeusto,porduna/weblabdeusto,weblabdeusto/weblabdeusto,weblabdeusto/web... | server/src/voodoo/dbutil.py | server/src/voodoo/dbutil.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2009 University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# listed... | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2009 University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# listed... | bsd-2-clause | Python |
5ffc9dfe861db660018dec42b5145c7ed026a3d0 | add find_git_project_root | Woile/commitizen,Woile/commitizen | commitizen/git.py | commitizen/git.py | import os
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import Optional, List
from commitizen import cmd
def tag(tag: str):
c = cmd.run(f"git tag {tag}")
return c
def commit(message: str, args=""):
f = NamedTemporaryFile("wb", delete=False)
f.write(message.encode("utf... | import os
from tempfile import NamedTemporaryFile
from typing import Optional, List
from commitizen import cmd
def tag(tag: str):
c = cmd.run(f"git tag {tag}")
return c
def commit(message: str, args=""):
f = NamedTemporaryFile("wb", delete=False)
f.write(message.encode("utf-8"))
f.close()
c... | mit | Python |
ccead03e366a2e50c235ee68b999d6fd83354be3 | Reduce log level | rhettg/BlueOx,rhettg/Ziggy | ziggy/__init__.py | ziggy/__init__.py | # -*- coding: utf-8 -*-
"""
Ziggy
~~~~~~~~
:copyright: (c) 2012 by Rhett Garber
:license: ISC, see LICENSE for more details.
"""
__title__ = 'ziggy'
__version__ = '0.0.1'
__build__ = 0
__author__ = 'Rhett Garber'
__license__ = 'ISC'
__copyright__ = 'Copyright 2012 Rhett Garber'
import logging
from . import utils
... | # -*- coding: utf-8 -*-
"""
Ziggy
~~~~~~~~
:copyright: (c) 2012 by Rhett Garber
:license: ISC, see LICENSE for more details.
"""
__title__ = 'ziggy'
__version__ = '0.0.1'
__build__ = 0
__author__ = 'Rhett Garber'
__license__ = 'ISC'
__copyright__ = 'Copyright 2012 Rhett Garber'
import logging
from . import utils
... | isc | Python |
5b4a64baf0261d32bffb4471cd2f51a14a38f075 | Fix a bug | feng-zhe/ZheQuant-brain-python | zq_calc/mv_avg.py | zq_calc/mv_avg.py | from zq_db.mongodb import get_recent_stock_data
from zq_gen.str import cmd_str2dic
def mv_avg(cmd_str):
'''Calculate the top stocks ranked by moving average
Args:
cmd_str: The command string
-d: days range used when calculating moving average
-n: number of th... | from zq_db.mongodb import get_recent_stock_data
from zq_gen.str import cmd_str2dic
def mv_avg(cmd_str):
'''Calculate the top stocks ranked by moving average
Args:
cmd_str: The command string
-d: days range used when calculating moving average
-n: number of th... | apache-2.0 | Python |
eab182efe540f8ace0d2558b8df2ebff1fd0d81a | disable scheduler when download files | revir/Chrombot-server | DownloadThread.py | DownloadThread.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading, urllib, os
from datas import gData
from SUtils import logger
class DownloadThread(threading.Thread):
"""Thread to download files"""
def __init__(self):
self.__name = 'DownloadThread'
threading.Thread.__init__(self, name=self.__nam... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading, urllib, os
from datas import gData
from SUtils import logger
class DownloadThread(threading.Thread):
"""Thread to download files"""
def __init__(self):
self.__name = 'DownloadThread'
threading.Thread.__init__(self, name=self.__nam... | apache-2.0 | Python |
3b5eb8dc66872e9217e52b72ef9bb39aadfd0197 | Correct name of test for element#getElementRect | gotcha/selenium,MCGallaspy/selenium,MCGallaspy/selenium,oddui/selenium,MeetMe/selenium,SevInf/IEDriver,lilredindy/selenium,MeetMe/selenium,jabbrwcky/selenium,houchj/selenium,aluedeke/chromedriver,AutomatedTester/selenium,rrussell39/selenium,Jarob22/selenium,sebady/selenium,tbeadle/selenium,pulkitsinghal/selenium,amikey... | py/test/selenium/webdriver/common/rendered_webelement_tests.py | py/test/selenium/webdriver/common/rendered_webelement_tests.py | # Copyright 2008-2009 WebDriver committers
# Copyright 2008-2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | # Copyright 2008-2009 WebDriver committers
# Copyright 2008-2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 | Python |
33c3f5a39821b28c70a08ebe2742375364e70dc1 | fix small bug with timezones | hackupc/backend,hackupc/backend,hackupc/backend,hackupc/backend | applications/management/commands/expire_applications.py | applications/management/commands/expire_applications.py | from datetime import timedelta
from django.core import mail
from django.core.management.base import BaseCommand
from django.utils import timezone
from applications import models, emails
class Command(BaseCommand):
help = 'Checks invites that have expired and sends reminders 24 before'
def handle(self, *ar... | from datetime import timedelta
from django.core import mail
from django.core.management.base import BaseCommand
from django.utils.datetime_safe import datetime
from applications import models, emails
class Command(BaseCommand):
help = 'Checks invites that have expired and sends reminders 24 before'
def han... | mit | Python |
4f5f073e6aa693117142bc8fff4cd8a71f2da601 | document ipv6 behavior | MalloZup/sumaform,moio/sumaform,MalloZup/sumaform,MalloZup/sumaform,moio/sumaform,moio/sumaform,MalloZup/sumaform | salt/default/set_ip_in_etc_hosts.py | salt/default/set_ip_in_etc_hosts.py | #!/usr/bin/python
import errno
import os
import re
import socket
import subprocess
import sys
if len(sys.argv) != 3:
print("Usage: set_ip_in_etc_hosts.py <HOSTNAME> <DOMAIN>")
sys.exit(1)
_, hostname, domain = sys.argv
fqdn = hostname + "." + domain
def guess_address(fqdn, hostname, socket_type, invalid_pref... | #!/usr/bin/python
import errno
import os
import re
import socket
import subprocess
import sys
if len(sys.argv) != 3:
print("Usage: set_ip_in_etc_hosts.py <HOSTNAME> <DOMAIN>")
sys.exit(1)
_, hostname, domain = sys.argv
fqdn = hostname + "." + domain
def guess_address(fqdn, hostname, socket_type, invalid_pref... | bsd-3-clause | Python |
2a073d94fcc9c6c9519e74a0c125d4fbb920885b | Add GNG module. | makism/dyfunconn | dyfunconn/cluster/__init__.py | dyfunconn/cluster/__init__.py | # -*- coding: utf-8 -*-
"""
"""
# Author: Avraam Marimpis <avraam.marimpis@gmail.com>
from .ng import NeuralGas
from .mng import MergeNeuralGas
from .rng import RelationalNeuralGas
from .gng import GrowingNeuralGas
from .som import SOM
from .umatrix import umatrix
__all__ = [
"NeuralGas",
"MergeNeuralGas",... | # -*- coding: utf-8 -*-
"""
"""
# Author: Avraam Marimpis <avraam.marimpis@gmail.com>
from .ng import NeuralGas
from .mng import MergeNeuralGas
from .rng import RelationalNeuralGas
from .som import SOM
from .umatrix import umatrix
__all__ = ['NeuralGas',
'MergeNeuralGas',
'RelationalNeuralGas... | bsd-3-clause | Python |
29db07c8892fc066917654aa3553140d92d8449b | remove unused imports | cuckoobox/cuckoo,cuckoobox/cuckoo,cuckoobox/cuckoo,cuckoobox/cuckoo,rodionovd/cuckoo-osx-analyzer,cuckoobox/cuckoo,rodionovd/cuckoo-osx-analyzer,rodionovd/cuckoo-osx-analyzer | analyzer/darwin/lib/core/filetimes.py | analyzer/darwin/lib/core/filetimes.py | # Copyright (c) 2009, David Buxton <david@gasmark6.com>
# 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 li... | # Copyright (c) 2009, David Buxton <david@gasmark6.com>
# 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 li... | mit | Python |
1cc6c0271a70742818662c4c3630084136dd5b14 | Fix redundant second arg | ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner | app/data_model/questionnaire_store.py | app/data_model/questionnaire_store.py | import logging
from app.storage.storage_factory import StorageFactory
from flask import g
import jsonpickle
logger = logging.getLogger(__name__)
class QuestionnaireStore:
def __init__(self, user_id, user_ik):
self.data = {}
if user_id and user_ik:
self.user_id = user_id
... | import logging
from app.storage.storage_factory import StorageFactory
from flask import g
import jsonpickle
logger = logging.getLogger(__name__)
class QuestionnaireStore:
def __init__(self, user_id, user_ik):
self.data = {}
if user_id and user_ik:
self.user_id = user_id
... | mit | Python |
f84c09a979547a159d39922a75941873f4ecf041 | add display capability | pletzer/icqsol,gregvonkuster/icqsol,pletzer/icqsol,pletzer/icqsol,gregvonkuster/icqsol,gregvonkuster/icqsol,gregvonkuster/icqsol,pletzer/icqsol | examples/colorSurfaceField.py | examples/colorSurfaceField.py | #!/usr/bin/env python
"""
Color a surface field
"""
import argparse
import time
import os
import re
import sys
from icqsol.shapes.icqShapeManager import ShapeManager
from icqsol import util
# time stamp
tid = re.sub(r'\.', '', str(time.time()))
parser = argparse.ArgumentParser(description='Color surface field')
p... | #!/usr/bin/env python
"""
Color a surface field
"""
import argparse
import time
import os
import re
import sys
from icqsol.shapes.icqShapeManager import ShapeManager
from icqsol import util
# time stamp
tid = re.sub(r'\.', '', str(time.time()))
parser = argparse.ArgumentParser(description='Color surface field')
p... | unknown | Python |
482749c384bbbef0bea8fba25b8ac0f94a7e56a5 | Add missing dot and correctly sort imports in soc.logic.helper.notifications module. | SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange | app/soc/logic/helper/notifications.py | app/soc/logic/helper/notifications.py | #!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | #!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | apache-2.0 | Python |
d9e4978912c1c0dfd0c0fa667fede94c70634774 | Move logger into get_events so displays with main script | laurenrevere/osf.io,erinspace/osf.io,acshi/osf.io,acshi/osf.io,acshi/osf.io,icereval/osf.io,monikagrabowska/osf.io,pattisdr/osf.io,Nesiehr/osf.io,Nesiehr/osf.io,cwisecarver/osf.io,cwisecarver/osf.io,mfraezz/osf.io,rdhyee/osf.io,cslzchen/osf.io,Johnetordoff/osf.io,baylee-d/osf.io,aaxelb/osf.io,caneruguz/osf.io,brianjgei... | scripts/analytics/node_log_count.py | scripts/analytics/node_log_count.py | import time
import logging
import argparse
from modularodm import Q
from datetime import datetime, timedelta
from dateutil.parser import parse
from website.app import init_app
from website.project.model import NodeLog
from website.settings import KEEN as keen_settings
from keen.client import KeenClient
logger = loggi... | import time
import logging
import argparse
from modularodm import Q
from datetime import datetime, timedelta
from dateutil.parser import parse
from website.app import init_app
from website.project.model import NodeLog
from website.settings import KEEN as keen_settings
from keen.client import KeenClient
logger = loggi... | apache-2.0 | Python |
2f8ac0d7c22fd316aa30505e0d6732ea81a19a5e | Make possible to set a custom view to the controlcenter | byashimov/django-controlcenter,byashimov/django-controlcenter,byashimov/django-controlcenter | controlcenter/views.py | controlcenter/views.py | from django.conf.urls import url
from django.contrib import admin
from django.contrib.admin.views.decorators import staff_member_required
from django.core.exceptions import ImproperlyConfigured
from django.http import Http404
from django.utils.decorators import method_decorator
from django.utils.module_loading import i... | from importlib import import_module
from django.conf.urls import url
from django.contrib import admin
from django.contrib.admin.views.decorators import staff_member_required
from django.core.exceptions import ImproperlyConfigured
from django.http import Http404
from django.utils.decorators import method_decorator
from... | bsd-3-clause | Python |
bbb2871bfba427654d70592f0f4fa0d1806a3fa0 | Fix PEP8 for generate-keyword-tests | GBGamer/rust,AerialX/rust,cllns/rust,richo/rust,pshc/rust,aneeshusa/rust,sae-bom/rust,pelmers/rust,dwillmer/rust,mvdnes/rust,miniupnp/rust,victorvde/rust,andars/rust,avdi/rust,kwantam/rust,mahkoh/rust,mvdnes/rust,gifnksm/rust,AerialX/rust,AerialX/rust-rt-minimal,ruud-v-a/rust,aidancully/rust,jroesch/rust,rohitjoshi/rus... | src/etc/generate-keyword-tests.py | src/etc/generate-keyword-tests.py | #!/usr/bin/env python
#
# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
#... | #!/usr/bin/env python
#
# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
#... | apache-2.0 | Python |
ac6c34c13ade272a7b7ae5b587fa97fdd04b161a | Remove unused pipe_client1 from test | transceptor-technology/siridb-server,transceptor-technology/siridb-server,transceptor-technology/siridb-server,transceptor-technology/siridb-server | test/test_pipe_support.py | test/test_pipe_support.py | import os
import asyncio
import functools
import random
import time
from testing import Client
from testing import default_test_setup
from testing import gen_data
from testing import gen_points
from testing import gen_series
from testing import InsertError
from testing import PoolError
from testing import QueryError
fr... | import os
import asyncio
import functools
import random
import time
from testing import Client
from testing import default_test_setup
from testing import gen_data
from testing import gen_points
from testing import gen_series
from testing import InsertError
from testing import PoolError
from testing import QueryError
fr... | mit | Python |
ac50044c16e2302e7543923d562cca5ba715e311 | Switch from () to __call__() | masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api | web/impact/impact/v1/events/base_history_event.py | web/impact/impact/v1/events/base_history_event.py | from abc import (
ABCMeta,
abstractmethod,
)
from impact.v1.helpers import (
STRING_FIELD,
)
class BaseHistoryEvent(object):
__metaclass__ = ABCMeta
CLASS_FIELDS = {
"event_type": STRING_FIELD,
"datetime": STRING_FIELD,
"latest_datetime": STRING_FIELD,
"description... | from abc import (
ABCMeta,
abstractmethod,
)
from impact.v1.helpers import (
STRING_FIELD,
)
class BaseHistoryEvent(object):
__metaclass__ = ABCMeta
CLASS_FIELDS = {
"event_type": STRING_FIELD,
"datetime": STRING_FIELD,
"latest_datetime": STRING_FIELD,
"description... | mit | Python |
30e84d34f7d2e75ca9052f1e702cdcdea738fb5e | add ContactRelationship to admin | shebeerki/django-crm,alviandk/django-crm,blag/django-crm,firth/django-crm,shebeerki/django-crm,susheels/django-crm,alviandk/django-crm,Tiam0202/django-crm,blag/django-crm,firth/django-crm,Vegulla/django-crm,susheels/django-crm,shebeerki/django-crm,jcortes0309/django-crm,alviandk/django-crm,sebastien247/django-crm,aviab... | crm/admin.py | crm/admin.py | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# $Id: admin.py 433 2009-07-14 04:10:28Z tobias $
# ----------------------------------------------------------------------------
#
# Copyright (C) 2008 Caktus Consulting Group, LLC
#
# This file is part of minib... | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# $Id: admin.py 433 2009-07-14 04:10:28Z tobias $
# ----------------------------------------------------------------------------
#
# Copyright (C) 2008 Caktus Consulting Group, LLC
#
# This file is part of minib... | bsd-3-clause | Python |
6722e16aef43f9cfe03e7e76fc578582139721f6 | Split file collecting algorithm to FileFilter | Kuniwak/vint,RianFuro/vint,RianFuro/vint,Kuniwak/vint | vint/linting/env.py | vint/linting/env.py | import os
import os.path
from pathlib import Path
from vint.linting.file_filter import find_vim_script
def build_environment(cmdargs):
return {
'cmdargs': cmdargs,
'home_path': _get_home_path(cmdargs),
'cwd': _get_cwd(cmdargs),
'file_paths': _get_file_paths(cmdargs)
}
def _ge... | import os
import os.path
import re
import logging
from pathlib import Path
VIM_SCRIPT_FILE_NAME_PATTERNS = r'(?:[\._]g?vimrc|.*\.vim$)'
def build_environment(cmdargs):
return {
'cmdargs': cmdargs,
'home_path': _get_home_path(cmdargs),
'cwd': _get_cwd(cmdargs),
'file_paths': _get_f... | mit | Python |
075c64f41c686186ea16d0da4e63be1a4473c483 | use installed version of cros_workon | bpsinc-native/src_third_party_chromite,zhang0137/chromite,bpsinc-native/src_third_party_chromite,coreos/chromite,bpsinc-native/src_third_party_chromite,coreos/chromite,zhang0137/chromite,zhang0137/chromite,chadversary/chromiumos.chromite,chadversary/chromiumos.chromite,coreos/chromite | shell/subcmds/workon_cmd.py | shell/subcmds/workon_cmd.py | # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Implementation of the 'workon' chromite command."""
import chromite.lib.cros_build_lib as cros_lib
from chromite.shell import subcmd
class Work... | # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Implementation of the 'workon' chromite command."""
import chromite.lib.cros_build_lib as cros_lib
from chromite.shell import subcmd
class Work... | bsd-3-clause | Python |
e9e288d1bd4e55519eeb580ac809d70dfa1fcf4e | Improve TLS/SSL support (#9 progress) | stampery/mongoaudit | src/testers/tls.py | src/testers/tls.py | # -*- coding: utf-8 -*-
import ssl
def available(test):
"""
Check if MongoDB is compiled with OpenSSL support
"""
return 'OpenSSLVersion' in test.tester.info \
or 'openssl' in test.tester.info
def enabled(test):
"""
Check if TLS/SSL is enabled on the server side
"""
if not avai... | # -*- coding: utf-8 -*-
def available(test):
"""
Check if MongoDB is compiled with OpenSSL support
"""
return 'OpenSSLVersion' in test.tester.info \
or 'openssl' in test.tester.info
def enabled(test):
"""
Check if TLS/SSL is enabled on the server side
"""
if not available(test)... | mit | Python |
10b4a5384b130ff85ac73587830a414a1187dab0 | Fix field name | Turupawn/website,Turupawn/website,lutris/website,lutris/website,lutris/website,Turupawn/website,Turupawn/website,lutris/website | runners/models.py | runners/models.py | from django.db import models
from django.utils.translation import ugettext as _
from platforms.models import Platform
class Runner(models.Model):
""" Model definition for the runners """
name = models.CharField(_("Name"), max_length=127)
slug = models.SlugField(unique=True)
website = models.CharField... | from django.db import models
from django.utils.translation import ugettext as _
from platforms.models import Platform
class Runner(models.Model):
""" Model definition for the runners """
name = models.CharField(_("Name"), max_length=127)
slug = models.SlugField(unique=True)
website = models.CharField... | agpl-3.0 | Python |
8e0a8adf81ef7ff59c3c964eaabce25b6cd43cab | Delete a few names we import that are not intended for the user | mwcraig/vpython-jupyter,mwcraig/vpython-jupyter,mwcraig/vpython-jupyter,BruceSherwood/vpython-jupyter,BruceSherwood/vpython-jupyter,BruceSherwood/vpython-jupyter,mwcraig/vpython-jupyter,BruceSherwood/vpython-jupyter | vpython/__init__.py | vpython/__init__.py | import os
from ._version import get_versions
from .gs_version import glowscript_version
__version__ = get_versions()['version']
__gs_version__ = glowscript_version()
del get_versions
del glowscript_version
# Keep the remaining imports later to ensure that __version__ and
# __gs_version__ exist before importing vpyth... | import os
from ._version import get_versions
from .gs_version import glowscript_version
__version__ = get_versions()['version']
__gs_version__ = glowscript_version()
del get_versions
del glowscript_version
# Keep the remaining imports later to ensure that __version__ and
# __gs_version__ exist before importing vpyth... | mit | Python |
416a42bc01fc5c5c218a43bf5af11bad922c78d2 | update collection selection for record_db | guoyr/geo-caching | coordinator_factory.py | coordinator_factory.py | from twisted.protocols.amp import AMP
from twisted.internet.protocol import Factory
from coordinator_commands import *
from pymongo import MongoClient
class CoordinatorProtocol(AMP):
@FetchData.responder
def fetchData(self, msg):
#TODO: msg contains the
pass
@GetMaster.responder
def ... | from twisted.protocols.amp import AMP
from twisted.internet.protocol import Factory
from coordinator_commands import *
from pymongo import MongoClient
class CoordinatorProtocol(AMP):
@FetchData.responder
def fetchData(self, msg):
#TODO: msg contains the
pass
@GetMaster.responder
def ... | mit | Python |
8e423ce743dc5f1cd4dcd6e4ff45e7e29504b02b | Update lev_group.py | jcchin/Hyperloop_v2,jcchin/MagnePlane,jcchin/MagnePlane,andipeng/MagnePlane,jcchin/Hyperloop_v2,kennethdecker/MagnePlane,andipeng/MagnePlane,kennethdecker/MagnePlane | src/hyperloop/Python/lev_group.py | src/hyperloop/Python/lev_group.py | from openmdao.api import Group, Problem, IndepVarComp
from src.hyperloop.Python.breakpointlev import Drag, Mass
class LevGroup(Group):
"""Group containing the breakpointlev.py classes Drag and Mass"""
def __init__(self):
super(LevGroup, self).__init__()
# Creates components of the group.
... | from openmdao.api import Group, Problem, IndepVarComp
from breakpointlev import Drag, Mass
class LevGroup(Group):
"""Group containing the breakpointlev.py classes Drag and Mass"""
def __init__(self):
super(LevGroup, self).__init__()
# Creates components of the group.
self.add('Drag', ... | apache-2.0 | Python |
0209f3a8a3cff785628d6e32cefb676eb0a0b61c | Add comment | techbureau/zaifbot,techbureau/zaifbot | zaifbot/exchange/action.py | zaifbot/exchange/action.py | from abc import ABCMeta, abstractclassmethod
def Action(action):
for cls in _TradeAction.__subclasses__():
if isinstance(action, str):
if cls.is_my_action(action):
return cls(action)
continue
if isinstance(action, _TradeAction):
return action
... | from abc import ABCMeta, abstractclassmethod
def Action(action):
for cls in _TradeAction.__subclasses__():
if isinstance(action, str):
if cls.is_my_action(action):
return cls(action)
continue
if isinstance(action, _TradeAction):
return action
... | mit | Python |
db0aad8333266905bb730f928e7f1c6dfc77f7e4 | Fix some missing imports | tchx84/debian-pkg-sugar-toolkit,Daksh/sugar-toolkit-gtk3,tchx84/sugar-toolkit-gtk3,ceibal-tatu/sugar-toolkit,gusDuarte/sugar-toolkit-gtk3,puneetgkaur/sugar-toolkit-gtk3,samdroid-apps/sugar-toolkit-gtk3,tchx84/debian-pkg-sugar-toolkit-gtk3,tchx84/sugar-toolkit-gtk3,gusDuarte/sugar-toolkit-gtk3,puneetgkaur/backup_sugar_s... | examples/terminal/terminal.py | examples/terminal/terminal.py | import os
import gtk
import vte
import pango
from sugar.activity.Activity import Activity
_TERMINAL_ACTIVITY_TYPE = "_terminal._tcp"
class Terminal(gtk.HBox):
def __init__(self):
gtk.HBox.__init__(self, False, 4)
self._vte = vte.Terminal()
self._configure_vte()
self._vte.set_size(30, 5)
self._vte.set_si... | import os
import gtk
import vte
from sugar.activity.Activity import Activity
_TERMINAL_ACTIVITY_TYPE = "_terminal._tcp"
class Terminal(gtk.HBox):
def __init__(self):
gtk.HBox.__init__(self, False, 4)
self._vte = vte.Terminal()
self._configure_vte()
self._vte.set_size(30, 5)
self._vte.set_size_request(20... | lgpl-2.1 | Python |
9e0d37d581b22b46b60bb563beb8fe3c44063a37 | fix download view for locked items: allow for admin, 403 for everybody else | makefu/bepasty-server,bepasty/bepasty-server,makefu/bepasty-server,bepasty/bepasty-server,bepasty/bepasty-server,bepasty/bepasty-server,makefu/bepasty-server | bepasty/views/download.py | bepasty/views/download.py | # Copyright: 2013 Bastian Blank <bastian@waldi.eu.org>
# License: BSD 2-clause, see LICENSE for details.
import errno
import time
from flask import Response, current_app, render_template, stream_with_context, abort
from flask.views import MethodView
from werkzeug.exceptions import NotFound
from ..utils.name import I... | # Copyright: 2013 Bastian Blank <bastian@waldi.eu.org>
# License: BSD 2-clause, see LICENSE for details.
import errno
import time
from flask import Response, current_app, render_template, stream_with_context
from flask.views import MethodView
from werkzeug.exceptions import NotFound
from ..utils.name import ItemName... | bsd-2-clause | Python |
2f6aae3c0ec7280b0992ac80da25e08525852d35 | change module getattr import error to attribute error | machow/siuba | siuba/sql/verbs/__init__.py | siuba/sql/verbs/__init__.py | from . import (
arrange,
compute,
conditional,
count,
distinct,
explain,
filter,
group_by,
head,
join,
mutate,
select,
summarize,
)
def __getattr__(name):
import warnings
if name == "LazyTbl":
from ..backend import LazyTbl
warnings.warn(
... | from . import (
arrange,
compute,
conditional,
count,
distinct,
explain,
filter,
group_by,
head,
join,
mutate,
select,
summarize,
)
def __getattr__(name):
import warnings
if name == "LazyTbl":
from ..backend import LazyTbl
warnings.warn(
... | mit | Python |
c231cc4a54e792d1e0c5f8d4f9540670004505a5 | Add prediction module | johnmartinsson/bird-species-classification,johnmartinsson/bird-species-classification | predict.py | predict.py | from bird import utils
from bird.models.cuberun import CubeRun
import bird.loader as loader
import bird.signal_processing as sp
import scipy
import numpy as np
def predict(model, segment_names, directory):
class_index = loader.build_class_index(directory)
batch = []
for segment_name in segment_names:
... | from models.cuberun import CubeRun
import numpy as np
import utils
def get_model():
nb_classes = 19
input_shape = (257, 624, 1)
model = CubeRun(nb_classes=nb_classes, input_shape=input_shape)
model.load_weights("../weights/2016_11_16_06:31:03_cuberun.h5")
return model
def predict(model, filenam... | mit | Python |
7429372801d6b4cc3a0a3235f41c0b97d17ce1aa | Test `max_elements_per_line` setting for primitive arrays | Squareys/PyDDL | tests/DdlTextWrterTest.py | tests/DdlTextWrterTest.py | import os
import unittest
from pyddl import *
from pyddl.enum import *
__author__ = "Jonathan Hale"
class DdlTextWriterTest(unittest.TestCase):
def tearDown(self):
try:
os.remove("test.oddl")
except FileNotFoundError:
pass # test_empty failed?
def test_empty(self):
... | import os
import unittest
from pyddl import *
from pyddl.enum import *
__author__ = "Jonathan Hale"
class DdlTextWriterTest(unittest.TestCase):
def tearDown(self):
try:
os.remove("test.oddl")
except FileNotFoundError:
pass # test_empty failed?
def test_empty(self):
... | mit | Python |
698eb220ababb935649860010c0cedd693bcb76a | Refactor form | cuducos/csvsimpletools,cuducos/csvsimpletools,cuducos/csvsimpletools | csvsimpletools/forms.py | csvsimpletools/forms.py | from flask_babel import gettext
from flask_wtf import Form
from flask_wtf.file import FileField, FileRequired, FileAllowed
from wtforms import RadioField, SelectField
from csv_commands import ordered_commands
COMMANDS = tuple((c.method.__name__, c.title) for c in ordered_commands)
DELIMITERS = ((',', ','), (';', ';'... | # coding: utf-8
from csv_commands import command_list, commands
from flask.ext.babel import gettext
from flask_wtf import Form
from flask_wtf.file import FileField, FileRequired, FileAllowed
from wtforms import RadioField, SelectField
class GetCSV(Form):
csv = FileField(
'CSV File',
validators=[F... | mit | Python |
ba8e567592c96dacb697e067004dc71799e4e93f | Store the basename of the generated files, to allow the unittests to clean up in the tearDown method. | sugarmanz/ctypeslib | ctypeslib/test/stdio.py | ctypeslib/test/stdio.py | import os
from ctypeslib.dynamic_module import include
from ctypes import *
if os.name == "nt":
_libc = CDLL("msvcrt")
else:
_libc = CDLL(None)
_gen_basename = include("""\
#include <stdio.h>
#ifdef _MSC_VER
# include <fcntl.h>
#else
# include <sys/fcntl.h>
#endif
/* Silly comment */
""",
persist=... | import os
from ctypeslib.dynamic_module import include
from ctypes import *
if os.name == "nt":
_libc = CDLL("msvcrt")
else:
_libc = CDLL(None)
include("""\
#include <stdio.h>
#ifdef _MSC_VER
# include <fcntl.h>
#else
# include <sys/fcntl.h>
#endif
""",
persist=False)
| mit | Python |
1235955edf07bb3815628200cfd247057b91be19 | fix path | weng-lab/SnoPlowPy | snoPlowPy/tests/conftest.py | snoPlowPy/tests/conftest.py | import pytest
@pytest.fixture
def remote_f():
return ('https://raw.githubusercontent.com/weng-lab/' +
'SnoPlowPy/master/snoPlowPy/tests/data/a')
| import pytest
@pytest.fixture
def remote_f():
return ('https://raw.githubusercontent.com/kepbod/' +
'SnoPlowPy/master/snoPlowPy/tests/data/a')
| mit | Python |
788f0977d21ff88092dacf7840ddf38b0a660288 | Remove unused constant | lowRISC/ot-sca,lowRISC/ot-sca | cw/cw305/util/device.py | cw/cw305/util/device.py | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
r"""CW305 utility functions. Used to configure FPGA with OpenTitan design."""
import subprocess
import time
import chipwhisperer as cw
class OpenTitan(object):
def __i... | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
r"""CW305 utility functions. Used to configure FPGA with OpenTitan design."""
import subprocess
import time
import chipwhisperer as cw
SPIFLASH=r'bin/linux/spiflash'
... | apache-2.0 | Python |
bd677acb1869a4137e78ee137ed1a676928dadf1 | Update test_complexityclass_comparisons.py | pberkes/big_O | big_o/test/test_complexityclass_comparisons.py | big_o/test/test_complexityclass_comparisons.py | import unittest
from big_o.complexities import ComplexityClass
class FirstComplexityClass(ComplexityClass):
order = 1
class AltFirstComplexityClass(ComplexityClass):
order = 1
class SecondComplexityClass(ComplexityClass):
order = 2
class TestComplexities(unittest.TestCase):
def setUp(self):
... | import unittest
import numpy as np
from big_o.complexities import ComplexityClass
class FirstComplexityClass(ComplexityClass):
order = 1
class AltFirstComplexityClass(ComplexityClass):
order = 1
class SecondComplexityClass(ComplexityClass):
order = 2
class TestComplexities(unittest.TestCase):
... | bsd-3-clause | Python |
40eda9e5d9cb6647e28d433e37457e4e8c86b9ad | Fix inconsistent docstring and ValueError message | deepmind/acme,deepmind/acme | acme/tf/losses/huber.py | acme/tf/losses/huber.py | # python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... | # python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... | apache-2.0 | Python |
b21c2e6f783a97f2dabe9e9cfbe34134f7bad15c | save metadata in scenes | sat-utils/sat-search | satsearch/main.py | satsearch/main.py | import os
import sys
import json
import logging
from .version import __version__
from satsearch import Search, Scenes
from satsearch.parser import SatUtilsParser
logger = logging.getLogger(__name__)
logging.getLogger('requests').setLevel(logging.CRITICAL)
def main(review=False, printsearch=False, printmd=None, prin... | import os
import sys
import json
import logging
from .version import __version__
from satsearch import Search, Scenes
from satsearch.parser import SatUtilsParser
logger = logging.getLogger(__name__)
logging.getLogger('requests').setLevel(logging.CRITICAL)
def main(review=False, printsearch=False, printmd=None, prin... | mit | Python |
c2adfa9e9accfa7ef9c2ff91c8fa23eee5516cf6 | update to upstream core-svn-01-Feb-2014 | Benocs/core,Benocs/core,Benocs/core,Benocs/core,Benocs/core | src/daemon/core/__init__.py | src/daemon/core/__init__.py | # Copyright (c)2010-2012 the Boeing Company.
# See the LICENSE file included in this distribution.
"""core
Top-level Python package containing CORE components.
See http://www.nrl.navy.mil/itd/ncs/products/core and
http://code.google.com/p/coreemu/ for more information on CORE.
Pieces can be imported individually, f... | # Copyright (c)2010-2012 the Boeing Company.
# See the LICENSE file included in this distribution.
"""core
Top-level Python package containing CORE components.
See http://cs.itd.nrl.navy.mil/work/core/ and
http://code.google.com/p/coreemu/ for more information on CORE.
Pieces can be imported individually, for examp... | bsd-3-clause | Python |
89d7c72e0848f0c94e5923e45624bccfb421a641 | change patch list to group_id in runner | johnnygreco/hugs | scripts/runner.py | scripts/runner.py | """
Run hugs-pipe on an HSC patch.
"""
import os
import numpy as np
import hugs_pipe
hugs_pipe_io = os.environ.get('HUGS_PIPE_IO')
def main(tract, patch, config, outdir):
data_id = {'tract': tract, 'patch': patch, 'filter': 'HSC-I'}
hugs_pipe.utils.mkdir_if_needed(outdir)
prefix = os.path.join(outdir, 'hu... | """
Run hugs-pipe on an HSC patch.
"""
import os
import hugs_pipe
def main(tract, patch, config, outdir):
data_id = {'tract': tract, 'patch': patch, 'filter': 'HSC-I'}
hugs_pipe.utils.mkdir_if_needed(outdir)
prefix = os.path.join(outdir, 'hugs-pipe-{}-{}'.format(tract, patch))
if type(config)==str:
... | mit | Python |
7b2adddc368618b6ea035eb93e2b48f612f4cb00 | Remove comment | FlintHill/SUAS-Competition,FlintHill/SUAS-Competition,FlintHill/SUAS-Competition,FlintHill/SUAS-Competition,FlintHill/SUAS-Competition | suasimageparser.py | suasimageparser.py | from SUASImageParser import ImageParser
from options import parseOptions
from options import getOption
import cv2
# ------------------------ Creating option parser -------------------------
parseOptions()
# ------------------------ Loading image & parsing ------------------------
my_parser = ImageParser(mode="ADL... | from SUASImageParser import ImageParser
from options import parseOptions
from options import getOption
import cv2
# ------------------------ Creating option parser -------------------------
parseOptions()
# ------------------------ Loading image & parsing ------------------------
my_parser = ImageParser(mode="ADL... | mit | Python |
71b6af52b1d26b1c6c366758c369ac2e35ee0636 | update the kth | frankgu/3d-DenseNet | data_providers/utils.py | data_providers/utils.py | from .data import DataProvider
def get_data_provider_by_name(name, train_params):
"""Return required data provider class"""
if name == 'UCF101':
return DataProvider(**train_params)
if name == 'MERL':
return DataProvider(**train_params)
if name == 'KTH':
return DataProvider(**tra... | from .data import DataProvider
def get_data_provider_by_name(name, train_params):
"""Return required data provider class"""
if name == 'UCF101':
return DataProvider(**train_params)
if name == 'MERL':
return DataProvider(**train_params)
else:
print("Sorry, data provider for `%s` ... | mit | Python |
d71284dec713f46ae9e6e9c7cf90517cd6ad3e60 | bump version | informatics-isi-edu/synspy,informatics-isi-edu/synspy,informatics-isi-edu/synspy | synspy/__init__.py | synspy/__init__.py |
#
# Copyright 2015 University of Southern California
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
#
#import analyze
#import viewer
__version__ = "20171207.0"
|
#
# Copyright 2015 University of Southern California
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
#
#import analyze
#import viewer
__version__ = "20171206.0"
| bsd-3-clause | Python |
6425471dae9e042c335f93e9f7ca9b2abd47ae04 | Fix callable (2nd) | jar3b/py-phias,jar3b/py-phias,jar3b/py-phias,jar3b/py-phias | aore/miscutils/bottlecl.py | aore/miscutils/bottlecl.py | # -*- coding: utf-8 -*-
from bottle import Bottle
class BottleCL(object):
def __init__(self):
self._app = Bottle()
self.init_routes()
def __call__(self, environ, start_response):
self._app.__call__(environ, start_response)
def init_routes(self):
pass
def add_route(s... | # -*- coding: utf-8 -*-
from bottle import Bottle
class BottleCL(object):
def __init__(self):
self._app = Bottle()
self.init_routes()
def __call__(self, *args):
self._app(*args)
def init_routes(self):
pass
def add_route(self, route_path, handler):
self._app.... | bsd-3-clause | Python |
3123f01f28c68634f3993d40c7c71c4c617c0885 | Add support for tab order specification to QtView extra. | brett-patterson/pyface,geggo/pyface,geggo/pyface,pankajp/pyface | enthought/traits/ui/qt4/extra/qt_view.py | enthought/traits/ui/qt4/extra/qt_view.py | #------------------------------------------------------------------------------
# Copyright (c) 2011, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | #------------------------------------------------------------------------------
# Copyright (c) 2009, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | bsd-3-clause | Python |
1ff4dab34d4aa6935d4d1b54aa354882790b9b44 | Add config items for server, timeout | imbasimba/astroquery,ceb8/astroquery,ceb8/astroquery,imbasimba/astroquery | astroquery/astrometry_net/__init__.py | astroquery/astrometry_net/__init__.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
<Put Your Tool Name Here>
-------------------------
:author: <your name> (<your email>)
"""
# Make the URL of the server, timeout and other items configurable
# See <http://docs.astropy.org/en/latest/config/index.html#developer-usage>
# for docs and... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
<Put Your Tool Name Here>
-------------------------
:author: <your name> (<your email>)
"""
# Make the URL of the server, timeout and other items configurable
# See <http://docs.astropy.org/en/latest/config/index.html#developer-usage>
# for docs and... | bsd-3-clause | Python |
4a5fc15593e2a3acd6928d41989bcdccad77e69b | add word2vec test script | 1900492968/SwiftSnails,Superjom/SwiftSnails,1900492968/SwiftSnails,1900492968/SwiftSnails,Superjom/SwiftSnails,1900492968/SwiftSnails,Superjom/SwiftSnails,Superjom/SwiftSnails | src/tools/gen-word2vec-data.py | src/tools/gen-word2vec-data.py | import sys
import random
def gen_one_record(num_feas):
feas = []
target = random.random()
for i in xrange(random.randint(6, num_feas)):
id = random.randint(0, 300)
feas.append("%d" % id)
return " ".join(feas)
def gen_data(num):
for i in xrange(num):
line = gen_one_reco... | import sys
import random
def gen_one_record(num_feas):
feas = []
target = random.random()
for i in xrange(random.randint(6, num_feas)):
id = random.randint(0, 300)
feas.append("%d" % id)
return " ".join(feas)
def gen_data(num):
for i in xrange(num):
line = gen_one_reco... | apache-2.0 | Python |
bfbc58922efe00a21daa82900c9306419c65a94f | add a (failing) test for _protected variables in fabfiles | ericholscher/fabric,felix-d/fabric,rodrigc/fabric,xLegoz/fabric,tekapo/fabric,rane-hs/fabric-py3,SamuelMarks/fabric,itoed/fabric,tolbkni/fabric,qinrong/fabric,askulkarni2/fabric,ploxiln/fabric,sdelements/fabric,MjAbuz/fabric,likesxuqiang/fabric,opavader/fabric,StackStorm/fabric,rbramwell/fabric,hrubi/fabric,elijah513/f... | prototypes/fabfile.py | prototypes/fabfile.py |
def test_local_failures():
local('false 1', fail='ignore')
local('false 2', fail='warn')
local('echo must print')
local('false 3') # default fail is abort
local('echo must NOT print')
def test_remote_failures(**kwargs):
set(fab_hosts = ['127.0.0.1', 'localhost'])
exc = run
if 'sudo' in... |
def test_local_failures():
local('false 1', fail='ignore')
local('false 2', fail='warn')
local('echo must print')
local('false 3') # default fail is abort
local('echo must NOT print')
def test_remote_failures(**kwargs):
set(fab_hosts = ['127.0.0.1', 'localhost'])
exc = run
if 'sudo' in... | bsd-2-clause | Python |
34e67f6e5328fc3a2579debaa9f7901b1422caa1 | Update functional test with new syntax | LauritzThaulow/fakelargefile,LauritzThaulow/fakelargefile | tests/functional_tests.py | tests/functional_tests.py | '''
Created on Oct 25, 2014
@author: lauritz
'''
from fakelargefile import FakeLargeFile, RepeatingSegment
BG = """\
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and ... | '''
Created on Oct 25, 2014
@author: lauritz
'''
from fakelargefile import FakeLargeFile, RepeatingSegment
BG = """\
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and ... | agpl-3.0 | Python |
70b11f2a824fa4b85bc7031aa07271e74d36f7d5 | remove now-unused RwhoClient constructor args | grawity/rwho,grawity/rwho,grawity/rwho,grawity/rwho,grawity/rwho | agent/lib/api_client.py | agent/lib/api_client.py | import json
import requests
import socket
import sys
from .exceptions import *
from .log_util import *
class RwhoClient():
def __init__(self, url,
host_name=None,
host_fqdn=None):
self.url = url
self.host_name = host_name
self.host_fqdn = host_... | import json
import requests
import socket
import sys
from .exceptions import *
from .log_util import *
class RwhoClient():
def __init__(self, url,
host_name=None,
host_fqdn=None,
auth_method=None,
auth_user=None,
... | mit | Python |
221bf7e5faf612feab30680b065a81b85f0ac634 | Upgrade config tests. | tdda/tdda,tdda/tdda,tdda/tdda,tdda/tdda | tdda/testconfig.py | tdda/testconfig.py | import os
import sys
import unittest
class TestSystemConfig(unittest.TestCase):
def test_01_tdda_path(self):
print('\ntype tdda')
with os.popen('type tdda') as f:
path = f.read()
print(path)
print('which tdda')
with os.popen('which tdda') as f:
path ... | import os
import sys
import unittest
class TestSystemConfig(unittest.TestCase):
def test_01_tdda_path(self):
print('\ntype tdda')
os.system('type tdda')
print('which tdda')
os.system('which tdda')
def test_02_path(self):
print('$PATH')
os.system('echo $PATH')
... | mit | Python |
a6bdff1bad08a0395f3ed29004c0d6a064061d99 | Bump version | thombashi/sqliteschema | sqliteschema/__version__.py | sqliteschema/__version__.py | # encoding: utf-8
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016, {}".format(__author__)
__license__ = "MIT License"
__version__ = "0.17.0"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| # encoding: utf-8
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016, {}".format(__author__)
__license__ = "MIT License"
__version__ = "0.16.2"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| mit | Python |
d97947fa3f8ecb145392992a90a1c19b4567ab2c | Tag new release: 2.2.10 | Floobits/floobits-sublime,Floobits/floobits-sublime | floo/version.py | floo/version.py | PLUGIN_VERSION = '2.2.10'
# The line above is auto-generated by tag_release.py. Do not change it manually.
try:
from .common import shared as G
assert G
except ImportError:
from common import shared as G
G.__VERSION__ = '0.03'
G.__PLUGIN_VERSION__ = PLUGIN_VERSION
| PLUGIN_VERSION = '2.2.9'
# The line above is auto-generated by tag_release.py. Do not change it manually.
try:
from .common import shared as G
assert G
except ImportError:
from common import shared as G
G.__VERSION__ = '0.03'
G.__PLUGIN_VERSION__ = PLUGIN_VERSION
| apache-2.0 | Python |
a0cc5b209dd84e58649ea49f3de25472350bd938 | Remove unnecessary print statement | sirmarcel/floq | floq/helpers.py | floq/helpers.py | import numpy as np
def n_to_i(num, n):
"""
Translate num, ranging from
-(n-1)/2 through (n-1)/2
into an index i from 0 to n-1
If num > (n-1)/2, map it into the interval
This is necessary to translate from a physical
Fourier mode number to an index in an array.
"""
cutoff = (n-1)/... | import numpy as np
def n_to_i(num, n):
"""
Translate num, ranging from
-(n-1)/2 through (n-1)/2
into an index i from 0 to n-1
If num > (n-1)/2, map it into the interval
This is necessary to translate from a physical
Fourier mode number to an index in an array.
"""
cutoff = (n-1)/... | mit | Python |
22e2e4887eea8b4ade6da7c72d46f91d74d643e5 | Remove unused string import. | genenetwork/genenetwork2,genenetwork/genenetwork2,genenetwork/genenetwork2,genenetwork/genenetwork2 | wqflask/wqflask/database.py | wqflask/wqflask/database.py | # Module to initialize sqlalchemy with flask
import os
import sys
from typing import Tuple
from urllib.parse import urlparse
import importlib
import contextlib
import MySQLdb
def read_from_pyfile(pyfile, setting):
orig_sys_path = sys.path[:]
sys.path.insert(0, os.path.dirname(pyfile))
module = importlib.... | # Module to initialize sqlalchemy with flask
import os
import sys
from string import Template
from typing import Tuple
from urllib.parse import urlparse
import importlib
import contextlib
import MySQLdb
def read_from_pyfile(pyfile, setting):
orig_sys_path = sys.path[:]
sys.path.insert(0, os.path.dirname(pyfi... | agpl-3.0 | Python |
909711c30817276c8817880a06577d5821d4032c | Update driver.py | apache8080/NVIDIABot,Talos4757/NVIDIABot | tegrabot/driver.py | tegrabot/driver.py | '''
Copyright (c) 2014, Rishi Desai
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 and the following d... | import serial
import time
import math
class Driver:
#ser = serial.Serial("/dev/ttyACM0", 9600)
#motorPorts=[]
#motor setup 2
def __init__(self):
def driveMotor(self, speed):
motorSpeed =90
if(speed > 0):
motorSpeed = speed*90
motorSpeed+=90
... | bsd-2-clause | Python |
5ca5395bce09cdbba40550efdcace2d3faff3c65 | Check for k and R | poliastro/poliastro | tests/test_bodies.py | tests/test_bodies.py | import pytest
from astropy import units as u
from astropy.tests.helper import assert_quantity_allclose
from poliastro.bodies import Body, Earth, Jupiter, Sun
def test_body_has_k_given_in_constructor():
k = 3.98e5 * u.km ** 3 / u.s ** 2
earth = Body(None, k, "")
assert earth.k == k
def test_body_from_pa... | import pytest
from astropy import units as u
from astropy.tests.helper import assert_quantity_allclose
from poliastro.bodies import Body, Earth, Jupiter, Sun
def test_body_has_k_given_in_constructor():
k = 3.98e5 * u.km ** 3 / u.s ** 2
earth = Body(None, k, "")
assert earth.k == k
def test_body_from_pa... | mit | Python |
ca5151ee58f84715850cd90b5c0a431bcc109452 | add not implement error for kugou | smart-techs/you-get,linhua55/you-get,zmwangx/you-get,forin-xyz/you-get,flwh/you-get,candlewill/you-get,CzBiX/you-get,pastebt/you-get,cnbeining/you-get,FelixYin66/you-get,specter4mjy/you-get,runningwolf666/you-get,qzane/you-get,fffonion/you-get,tigerface/you-get,lilydjwg/you-get,shanyimin/you-get,rain1988/you-get,dream1... | src/you_get/extractor/kugou.py | src/you_get/extractor/kugou.py | #!/usr/bin/env python
__all__ = ['kugou_download']
from ..common import *
from json import loads
from base64 import b64decode
def kugou_download(url, output_dir=".", merge=True, info_only=False):
if url.lower().find("5sing")!=-1:
#for 5sing.kugou.com
html=get_html(url)
ticket=r1(r'"ticke... | #!/usr/bin/env python
__all__ = ['kugou_download']
from ..common import *
from json import loads
from base64 import b64decode
def kugou_download(url, output_dir=".", merge=True, info_only=False):
if url.lower().find("5sing")!=-1:
html=get_html(url)
ticket=r1(r'"ticket":\s*"(.*)"',html)
j... | mit | Python |
89e3d4ae0a7be5baef6354324b2e7f8623564c94 | Use 'array' rather than 'real' for data array name in olfactory stimulus generation script. | cerrno/neurokernel | examples/olfaction/data/gen_olf_input.py | examples/olfaction/data/gen_olf_input.py | #!/usr/bin/env python
"""
Generate sample olfactory model stimulus.
"""
import numpy as np
import h5py
osn_num = 1375
dt = 1e-4 # time step
Ot = 2000 # number of data point during reset period
Rt = 1000 # number of data point during odor delivery period
Nt = 4*Ot + 3*Rt # number of data points in time
t = np.arang... | #!/usr/bin/env python
"""
Generate sample olfactory model stimulus.
"""
import numpy as np
import h5py
osn_num = 1375
dt = 1e-4 # time step
Ot = 2000 # number of data point during reset period
Rt = 1000 # number of data point during odor delivery period
Nt = 4*Ot + 3*Rt # number of data points in time
t = np.arang... | bsd-3-clause | Python |
248588d141f350d6b00ef24ed1f99bf1e460b25c | add new test | lapisdecor/bzoinq | tests/test_bzoinq.py | tests/test_bzoinq.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_bzoinq
----------------------------------
Tests for `bzoinq` module.
"""
import pytest
from bzoinq import bzoinq
# @pytest.fixture
# def response():
# """Sample pytest fixture.
# See more at: http://doc.pytest.org/en/latest/fixture.html
# """
# ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_bzoinq
----------------------------------
Tests for `bzoinq` module.
"""
import pytest
from bzoinq import bzoinq
# @pytest.fixture
# def response():
# """Sample pytest fixture.
# See more at: http://doc.pytest.org/en/latest/fixture.html
# """
# ... | mit | Python |
15c039dcf43cc3029ab8524edb17f2c619974757 | Test case of getting core members updated to include Bob Tolbert (either he was added recently to core or I had missed it before some how but test was passing :-/ ) | hylang/hygdrop,hylang/hygdrop | tests/test_github.py | tests/test_github.py | #!/usr/bin/env python
import os
plugin_to_load = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"../plugins/github.hy")
from hy.importer import import_file_to_module
g = import_file_to_module("github", plugin_to_load)
def test_get_github_issue():
expected = " ".join(
... | #!/usr/bin/env python
import os
plugin_to_load = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"../plugins/github.hy")
from hy.importer import import_file_to_module
g = import_file_to_module("github", plugin_to_load)
def test_get_github_issue():
expected = " ".join(
... | mit | Python |
765a6b8e0ea87a5472bd5be393c003739d4fb466 | add argument parser | desihub/desiutil,desihub/desiutil | py/desiutil/census.py | py/desiutil/census.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
===============
desiutil.census
===============
Determine the number of files and size in DESI data file systems.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
===============
desiutil.census
===============
Determine the number of files and size in DESI data file systems.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
... | bsd-3-clause | Python |
87753b0bff057b61879e2dbcc4dceba7aec95451 | Disable pool generation by default | bliksemlabs/bliksemintegration,bliksemlabs/bliksemintegration | settings/const.py | settings/const.py | import urllib2
#Database settings
database_connect = "dbname='ridprod'"
kv1_database_connect = "dbname='kv1tmp'"
iff_database_connect = "dbname='ifftmp'"
pool_generation_enabled = False
#NDOVLoket settings
ndovloket_url = "data.ndovloket.nl"
ndovloket_user = "voorwaarden"
ndovloket_password = "geaccepteerd"
auth_hand... | import urllib2
#Database settings
database_connect = "dbname='ridprod'"
kv1_database_connect = "dbname='kv1tmp'"
iff_database_connect = "dbname='ifftmp'"
pool_generation_enabled = True
#NDOVLoket settings
ndovloket_url = "data.ndovloket.nl"
ndovloket_user = "voorwaarden"
ndovloket_password = "geaccepteerd"
auth_handl... | bsd-2-clause | Python |
26154817691dd5da92d94894e12bb1422c26e038 | Change cli timeout arg to resemble previous interface | sirMackk/py3tftp,sirMackk/py3tftp | py3tftp/cli_parser.py | py3tftp/cli_parser.py | import argparse
import logging
from sys import exit
from py3tftp import __version__
EPILOG = """
Released under the MIT license.
Copyright 2016 Matt O. <matt@mattscodecave.com>
"""
logging_config = {
'format': '%(asctime)s [%(levelname)s] %(message)s',
'level': logging.INFO,
'filename': None
}
def prin... | import argparse
import logging
from sys import exit
from py3tftp import __version__
EPILOG = """
Released under the MIT license.
Copyright 2016 Matt O. <matt@mattscodecave.com>
"""
logging_config = {
'format': '%(asctime)s [%(levelname)s] %(message)s',
'level': logging.INFO,
'filename': None
}
def prin... | mit | Python |
2f0a3071b235ee64f9ebef0b2deba5c5cd30479e | change debug level | guillermooo-forks/dart-sublime-bundle,guillermooo-forks/dart-sublime-bundle,guillermooo/dart-sublime-bundle,guillermooo-forks/dart-sublime-bundle,guillermooo/dart-sublime-bundle,guillermooo/dart-sublime-bundle,guillermooo/dart-sublime-bundle,guillermooo-forks/dart-sublime-bundle | sublime_plugin_lib/__init__.py | sublime_plugin_lib/__init__.py | # Copyright (c) 2014, Guillermo López-Anglada. Please see the AUTHORS file for details.
# All rights reserved. Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.)
import logging
import os
import sublime
class PluginLogger(object):
"""A logger intented to be used ... | # Copyright (c) 2014, Guillermo López-Anglada. Please see the AUTHORS file for details.
# All rights reserved. Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.)
import logging
import os
import sublime
class PluginLogger(object):
"""A logger intented to be used ... | bsd-3-clause | Python |
2c8b160e4b4e4d9f22bbb96bb5c74565595aabd1 | Adjust length of docstring underline | pyfarm/pyfarm-master,pyfarm/pyfarm-master,pyfarm/pyfarm-master | pyfarm/models/disk.py | pyfarm/models/disk.py | # No shebang line, this module is meant to be imported
#
# Copyright 2015 Ambient Entertainment GmbH & Co. KG
# Copyright 2015 Oliver Palmer
#
# 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
#
... | # No shebang line, this module is meant to be imported
#
# Copyright 2015 Ambient Entertainment GmbH & Co. KG
# Copyright 2015 Oliver Palmer
#
# 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
#
... | apache-2.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.