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 |
|---|---|---|---|---|---|---|---|---|
a4b242ebd107f9321cc5b87aee2cf608940007f4 | Make permission name more consistent. | borderitsolutions/amadaa,borderitsolutions/amadaa,borderitsolutions/amadaa | product/migrations/0005_auto_20161015_1536.py | product/migrations/0005_auto_20161015_1536.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-15 15:36
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('product', '0004_auto_20161015_1534'),
]
operations = [
migrations.AlterModelOptions... | mit | Python | |
b0a4f510ed343825a8073a68c4dc0e3066b560ec | add example canICA | abenicho/isvr | nilearn/example_canICA.py | nilearn/example_canICA.py | # -*- coding: utf-8 -*-
from nilearn import datasets
dataset = datasets.fetch_adhd()
func_files = dataset.func # The list of 4D nifti files for each subject
### Apply CanICA ##############################################################
from nilearn.decomposition.canica import CanICA
n_components = 20
canica = CanIC... | bsd-3-clause | Python | |
25c2502fce4556b5b72e96116745c83d1689677f | Add tests for artist serializers | FreeMusicNinja/api.freemusic.ninja | artists/tests/test_serializers.py | artists/tests/test_serializers.py | from unittest import TestCase
from ..models import Artist, Hyperlink
from ..serializers import ArtistSerializer, HyperlinkSerializer
class HyperlinkSerializerTest(TestCase):
"""Tests for Hyperlink serializer."""
def test_valid_fields(self):
id_ = 4
name = 'jamendo'
display_name = "J... | bsd-3-clause | Python | |
5e2cb194b174b8e9b99777d125f1fdaaf0eddace | add config handling, #25 | openego/eDisGo,openego/eDisGo | edisgo/tools/config.py | edisgo/tools/config.py | """This file is part of eDisGo, a python package for distribution grid
analysis and optimization.
It is developed in the project open_eGo: https://openegoproject.wordpress.com
eDisGo lives at github: https://github.com/openego/edisgo/
The documentation is available on RTD: http://edisgo.readthedocs.io
Based on code ... | agpl-3.0 | Python | |
79563ccb72b50ad9b0a7cf037ad46efc98a1f79b | Create call.py | gappleto97/Senior-Project | common/call.py | common/call.py | def call(mod,cmd,*args,**kargs):
"""Calls arbitrary python code
Arguments:
mod - The module from which you are calling
cmd - The command in said module
*args - Any arguments you need to give to it
index=0 - A specific index at which to return
end=0 - An end r... | mit | Python | |
686da2bf6b71961ea82e72640b7e6ff16c4723d7 | Add bubblesort example. Have problems with type inference. | seibert/numba,jriehl/numba,pombredanne/numba,sklam/numba,seibert/numba,GaZ3ll3/numba,GaZ3ll3/numba,seibert/numba,sklam/numba,seibert/numba,IntelLabs/numba,stefanseefeld/numba,IntelLabs/numba,IntelLabs/numba,stonebig/numba,gmarkall/numba,ssarangi/numba,sklam/numba,numba/numba,jriehl/numba,ssarangi/numba,stonebig/numba,p... | examples/bubblesort.py | examples/bubblesort.py | from numba import *
import numpy as np
from timeit import default_timer as timer
#@autojit
#def bubbleswap(X, i):
# tmp = X[i]
# X[i] = X[i + 1]
# X[i + 1] = tmp
def bubblesort(X, doprint):
N = X.shape[0]
for end in range(N, 1, -1):
for i in range(end - 1):
cur = X[i]
... | bsd-2-clause | Python | |
8c9ff0787d1d862765bbd657b09357d31a402e1f | add collector for https://torstatus.blutmagie.de/ | spantons/attacks-pages-collector | collectors/torstatus.blutmagie.py | collectors/torstatus.blutmagie.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import re
from bs4 import BeautifulSoup
import requests
import ipwhois
from pprint import pprint
def get_url(url):
try:
res = requests.get(url)
except requests.exceptions.ConnectionError:
raise requests.exceptions.ConnectionError("DNS lo... | mit | Python | |
265b47de5a54d7c3a6a7be70b10f16b05f40d0b2 | add tests for "$ oj login --check URL" | kmyk/online-judge-tools,kmyk/online-judge-tools | tests/command_login.py | tests/command_login.py | import os
import subprocess
import sys
import time
import unittest
import tests.utils
class LoginTest(unittest.TestCase):
def snippet_call_login_check_failure(self, url):
ojtools = os.path.abspath('oj')
with tests.utils.sandbox(files=[]) as tempdir:
env = dict(**os.environ)
... | mit | Python | |
0681d3833cd3c82d95ce80f12b492706f26b5ffa | add geco_slo_channel_plot in progress | stefco/geco_data,stefco/geco_data,stefco/geco_data | geco_slow_channel_plot.py | geco_slow_channel_plot.py | #!/usr/bin/env python
# (c) Stefan Countryman 2017
import matplotlib.pyplot as plt
import numpy as np
import geco_gwpy_dump as g
import gwpy.segments
import gwpy.time
import sys
if len(sys.argv) == 1:
job = g.Job.load()
else:
job = g.Job.load(sys.argv[1])
segs = gwpy.segments.DataQualityFlag.query_segdb('L1:... | mit | Python | |
fa6f2e35db07571759d654088d77cb7a206c5722 | Create test.py | skellykiernan/pylearn,skellykiernan/pylearn | test.py | test.py | import unittest
import awesome
class TestMethods(unittest.TestCase):
def test_add(self):
self.assertEqual(awesome.smile(), ":)")
if __name__ == '__main__':
unittest.main()
| bsd-3-clause | Python | |
8bda92da85bd666aa91b657319a019e00bf27126 | add sample configuration file | TakeshiTseng/ryu,Zouyiran/ryu,zyq001/ryu,o3project/ryu-oe,pichuang/ryu,habibiefaried/ryu,gopchandani/ryu,zangree/ryu,ynkjm/ryu,takahashiminoru/ryu,torufuru/oolhackathon,gopchandani/ryu,yamada-h/ryu,zangree/ryu,John-Lin/ryu,habibiefaried/ryu,OpenState-SDN/ryu,elahejalalpour/ELRyu,haniehrajabi/ryu,lsqtongxin/ryu,umkcdcrg... | ryu/services/protocols/bgp/bgp_sample_conf.py | ryu/services/protocols/bgp/bgp_sample_conf.py | import os
# =============================================================================
# BGP configuration.
# =============================================================================
BGP = {
# General BGP configuration.
'routing': {
# ASN for this BGP instance.
'local_as': 64512,
... | apache-2.0 | Python | |
1fb737426f69d5e5dbe48dd66a13a38918707f23 | Add tests to detcatscores | pySTEPS/pysteps | pysteps/tests/test_detcatscores.py | pysteps/tests/test_detcatscores.py | # -*- coding: utf-8 -*-
import pytest
import numpy as np
from pysteps.verification import det_cat_fcst
from numpy.testing import assert_array_almost_equal
# CREATE A LARGE DATASET TO MATCH
# EXAMPLES IN
# http://www.cawcr.gov.au/projects/verification/
fct_hits = 1.0*np.ones(82)
obs_hits = 1.0*np.ones(82)
fct_fa = 1.... | bsd-3-clause | Python | |
42af700af58588fccaa84f5348a5c854d095d1a9 | Add ex2.2: multiple simple requests | MA3STR0/PythonAsyncWorkshop | code/ex2.2-simple_requests.py | code/ex2.2-simple_requests.py | from urllib.request import urlopen
import time
URLS = [
'http://127.0.0.1:8000',
'http://127.0.0.1:8000',
'http://127.0.0.1:8000',
]
def request_greetings():
responses = []
for url in URLS:
resp = urlopen(url)
responses.append(resp.read().decode('utf-8'))
texts = '\n'.join(resp... | mit | Python | |
f2ac12e66aa2209f98e6eed2283005f2a9e74768 | Create perm_missing_elem.py | py-in-the-sky/challenges,py-in-the-sky/challenges,py-in-the-sky/challenges | codility/perm_missing_elem.py | codility/perm_missing_elem.py | """
https://codility.com/programmers/task/perm_missing_elem/
Given array A of integers. N = len(A). Integers are distinct and taken from
range 1..(N+1), which means exactly one integer from 1..(N+1) is missing from
A. Find the missing integer.
Runtime: O(N)
Extra Space: O(1)
"""
def solution(A):
total1 = sum... | mit | Python | |
785af4d73a158fdf43ceff8bb4c974a0215606fd | add missing test file | douban/python-libmemcached,douban/python-libmemcached | tests/test_set_long.py | tests/test_set_long.py | import cmemcached
import unittest
import subprocess
import time
TEST_SERVER = "localhost"
memcached_process = None
def setup():
global memcached_process
memcached_process = subprocess.Popen(['memcached'])
time.sleep(0.5)
def teardown():
memcached_process.terminate()
class TestCmemcached_for_long(u... | bsd-3-clause | Python | |
d59e49ddf95c20b51ac285dccb0a1b43936d97ef | Test that some credential setting properly switches endpoint schemes | typepad/python-typepad-api | tests/test_tpclient.py | tests/test_tpclient.py | # Copyright (c) 2009-2010 Six Apart Ltd.
# 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 an... | bsd-3-clause | Python | |
4008a230fb64d059d9449a39f32abe245692d582 | Create VirgilContext implementation | VirgilSecurity/virgil-sdk-python | virgil_sdk/api/virgil_context.py | virgil_sdk/api/virgil_context.py | # Copyright (C) 2016 Virgil Security Inc.
#
# Lead Maintainer: Virgil Security Inc. <support@virgilsecurity.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:
#
# (1) Redistributions of ... | bsd-3-clause | Python | |
9ad8a03eac3d9fc94122ee2494ff1f6398467cfc | Add files via upload | SeanBeseler/data-structures | pque.py | pque.py | class Pque(object):
"""make as priority queue priority scale is 0 through -99
0 has greatest priority with ties being first come first pop"""
def __init__(self):
self.next_node = None
self.priority = 0
self.value = None
self.tail = None
self.head = None
s... | mit | Python | |
b480a21d58c1fc1b8ad66442bd65a7d892d8efa1 | Create Blink.py | AnandVetcha/IntelEdison_Python | Blink.py | Blink.py | import time
import mraa
###### Programe Begins ####
print (mraa.getVersion())
Led = mraa.Gpio(4)
Led.dir(mraa.DIR_OUT)
Led.write(1)
value = 0
while 1:
if value == 0:
value = 1
else:
value = 0
Led.write(value)
print "LED "+str(value)
time.sleep(1)
| mit | Python | |
36af8c98005bfb6d51344b80a59cb6e48c8b55fb | Add outputter to display overstate stages | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/output/overstatestage.py | salt/output/overstatestage.py | '''
Display clean output of an overstate stage
'''
#[{'group2': {'match': ['fedora17-2', 'fedora17-3'],
# 'require': ['group1'],
# 'sls': ['nginx', 'edit']}
# }
# ]
# Import Salt libs
import salt.utils
def output(data):
'''
Format the data for printing stage ... | apache-2.0 | Python | |
c278a1659e488df5917d77dd7e002d065e1c7586 | test db mysql | Fy-Network/fysql | tests/test_db_mysql.py | tests/test_db_mysql.py | # -*- coding: utf-8 -*-
import unittest
from fysql import *
database = MySQLDatabase('fysql', host='localhost', user='fysql', passwd='dev')
class DevTables(Table):
db = database
class User(DevTables):
firstname = CharColumn(max_length=150)
lastname = CharColumn(max_length=150)
role ... | mit | Python | |
1085114668dc13d86dac8de70557cd4242ab9d20 | Add tests for parse_csv, weighted_mode and weighted_replicate (#210) | Chipe1/aima-python,AWPorter/aima-python,JoeLaMartina/AlphametricProject,abbeymiles/aima-python,Fruit-Snacks/aima-python,grantvk/aima-python,willhess/aima-python,JoeLaMartina/AlphametricProject,willhess/aima-python,JamesDickenson/aima-python,jo-tez/aima-python,JamesDickenson/aima-python,chandlercr/aima-python,WhittKinle... | tests/test_learning.py | tests/test_learning.py | import pytest
from learning import parse_csv, weighted_mode, weighted_replicate
def test_parse_csv():
assert parse_csv('1, 2, 3 \n 0, 2, na') == [[1, 2, 3], [0, 2, 'na']]
def test_weighted_mode():
assert weighted_mode('abbaa', [1,2,3,1,2]) == 'b'
def test_weighted_replicate():
assert weighted_replicate('ABC', [... | mit | Python | |
8d88336d831eeb5e6603b9ff66f2e4906c4f9e2e | Create test.py | YigengZhang/DL4SRL | test.py | test.py | print "Hello world!"
| apache-2.0 | Python | |
a72a80ce70b8c08ef5e33c41ee467f6ad7157f71 | test contains scripts for making and trying out new colormaps | kthyng/cmocean,matplotlib/cmocean | test.py | test.py | '''
Making and testing colormaps.
'''
import numpy as np
from matplotlib import cm, colors
import matplotlib.pyplot as plt
import pdb
import matplotlib as mpl
from skimage import color
def cmap(rgbin, N=10):
'''
Input an array of rgb values to generate a colormap.
Inputs:
rgbin is an [mx3] array... | mit | Python | |
6aec92990790dd5ba04ca1079dbc5fe9106f8747 | Add test suite | Maome/pygooglesms | test.py | test.py | import sys
import unittest
import pygooglesms
from pygooglesms import GoogleSMS
class TestPyGoogleSMS(unittest.TestCase):
GOOD_LOGIN = 'CHANGEME'
GOOD_PASSWD = 'CHANGEME'
TEST_NUMBER = 'CHANGEME'
BAD_LOGIN = 'nobody@gmail.com'
BAD_PASSWD = 'terrible'
BAD_AUTH_MSG = 'No auth token provided by... | mit | Python | |
197685058df0fdee0cefa0e59f0faa038d809730 | Rename and use Maze base class | tijko/PyMaze | Prims.py | Prims.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import random
from maze import *
from itertools import product
from collections import defaultdict
os.environ['SDL_VIDEO_WINDOW_POS'] = '600, 30'
class Prims(Maze):
def __init__(self):
super(Prims, self).__init__()
self.maze = list()
... | mit | Python | |
b7ff7ee179f7d973051ca7f70a04f27322c07cf2 | Create Redis.py | wolfdale/Redis | Redis.py | Redis.py | #Intro to Redis (NoSql)
import redis
| mit | Python | |
7d8ad6124cd838f3b2507e43c2c89e8a4873465e | fix case with no provider | simonvh/genomepy | test.py | test.py | from genomepy.provider import ProviderBase
from genomepy import Genome
import sys
genome_name = "ce10"
genome = Genome(genome_name)
tax_id = genome.tax_id
#p = ProviderBase.create("UCSC")
#print(p.assembly_accession("ci3"))
#sys.exit()
p = ProviderBase.create("Ensembl")
name, accession, *rest = [row for row in p.se... | mit | Python | |
eabe6103860fd7b04e52f2e5181affbb55e93273 | add wsgi script | Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok | wsgi.py | wsgi.py | #!/usr/bin/env python3
# To run:
# gunicorn -b 0.0.0.0:5000 wsgi:app
import os
from server import create_app, generate
from server.models import db, User
env = os.environ.get('OK_ENV', 'dev')
app = create_app('settings/%s.py' % env)
| apache-2.0 | Python | |
89c4f92d56ab445d86dfdd321bca6c7e0f30855e | Create admin.py | yuhengqiu/mezzanine-weibopub | weibopub/admin.py | weibopub/admin.py | from __future__ import unicode_literals
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.template.defaultfilters import truncatechars
from mezzanine.weibopub import get_auth_settings
FORMFIELD_HTML = """
<div class='send_weibo_container'>
<input id... | mit | Python | |
626662f0f3ef2ce7de63c424da89263443243e97 | Fix SpiderState bug in Windows platforms | yarikoptic/scrapy,godfreyy/scrapy,coderabhishek/scrapy,coderabhishek/scrapy,yidongliu/scrapy,yusofm/scrapy,hectoruelo/scrapy,csalazar/scrapy,Timeship/scrapy,wangjun/scrapy,Zephor5/scrapy,profjrr/scrapy,Geeglee/scrapy,olafdietsche/scrapy,Geeglee/scrapy,beni55/scrapy,kimimj/scrapy,mlyundin/scrapy,amboxer21/scrapy,ramiro/... | scrapy/contrib/spiderstate.py | scrapy/contrib/spiderstate.py | import os, cPickle as pickle
from scrapy import signals
class SpiderState(object):
"""Store and load spider state during a scraping job"""
def __init__(self, jobdir=None):
self.jobdir = jobdir
@classmethod
def from_crawler(cls, crawler):
obj = cls(crawler.settings.get('JOBDIR'))
... | import os, cPickle as pickle
from scrapy import signals
class SpiderState(object):
"""Store and load spider state during a scraping job"""
def __init__(self, jobdir=None):
self.jobdir = jobdir
@classmethod
def from_crawler(cls, crawler):
obj = cls(crawler.settings.get('JOBDIR'))
... | bsd-3-clause | Python |
af6eef23e60b88209ce4e9601f0cf457ee421bdc | add zone no crawler | EclipseXuLu/DataHouse,EclipseXuLu/DataHouse | DataHouse/crawler/zone_no_crawler.py | DataHouse/crawler/zone_no_crawler.py | """
not finish yet
"""
import requests
from bs4 import BeautifulSoup
def crawl():
url = 'http://quhao.tianqi.com/'
headers = {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Host': 'quhao.tianqi.com',
'Referer': 'https://www.baidu.c... | mit | Python | |
5fc6d9fc05bc4cae5588489c576744a518155461 | Add Sin, Cos and Tan function classes | jackromo/mathLibPy | trig.py | trig.py | import function
import math
class Sin(function.Function):
def _evaluate(self, x):
return math.sin(x)
class Cos(function.Function):
def _evaluate(self, x):
return math.cos(x)
class Tan(function.Function):
def _evaluate(self, x):
sin = Sin()
cos = Cos()
if cos(... | mit | Python | |
d101e1bae5b083b436411507ebe73f12f8088075 | Create solution.py | rmotr-curriculum-testing/learn-testing-repo | unit-3-mixed-reading-and-assignment-lessons/lesson-3-assignment-one-code-block/solutions/solution.py | unit-3-mixed-reading-and-assignment-lessons/lesson-3-assignment-one-code-block/solutions/solution.py | def convert_temperature(temperature, to='celsius'):
def to_fahrenheit():
return (temperature * 9 / 5) + 32
def to_celsius():
return (temperature - 32) * 5 / 9
return (to_celsius if to == 'celsius' else to_fahrenheit)()
| mit | Python | |
f375be2ac11aa9648c77392cec36900db900c6ef | Add Flask server. | vmlaker/wabbit,vmlaker/wabbit,vmlaker/wabbit,vmlaker/wabbit | serve.py | serve.py | import sys
import flask
import sqlalchemy as sa
import coils
import tables
app = flask.Flask(__name__)
@app.route('/')
def root():
# Load configuration file.
CONFIG = sys.argv[1] if len(sys.argv)>=2 else 'wabbit.cfg'
config = coils.Config(CONFIG)
# Connect to database engine.
engine = sa.create_... | mit | Python | |
f3ab43a3c24851ca5a6e68c04e56af8c8f9a0fd1 | add setup.py | jupyter/jupyter-drive,jupyter/jupyter-drive,jupyter/jupyter-drive,Carreau/jupyter-drive,Carreau/jupyter-drive | setup.py | setup.py | from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
#with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-... | bsd-2-clause | Python | |
1b77c721b53d59e1b6242906780941d262d070e8 | add basic setup.py | Kyria/EsiPy,a-tal/EsiPy | setup.py | setup.py | from setuptools import setup
from esipy import __version__
# install requirements
install_requirements = [
"requests",
"pyswagger",
"six"
]
# test requirements
test_requirements = [
"coverage",
"coveralls",
"httmock",
"nose",
"mock",
"future",
"python-memcach... | bsd-3-clause | Python | |
518e1d56a23eb1d5b4bb31ae46c958e519addfc0 | add setup file | lewismc/topik,kcompher/topik,ContinuumIO/topik,lewismc/topik,kcompher/topik,kcompher/topik,lewismc/topik,ContinuumIO/topik | setup.py | setup.py | #!/usr/bin/env python
from os.path import exists
from setuptools import setup, find_packages
setup(name='topik',
version='0.1.0',
description='A Topic Modeling high-level interface',
url='http://github.com/ContinuumIO/topik/',
author='Christine Doig',
author_email='christine.doig@continu... | bsd-3-clause | Python | |
07cda3fee1215f4d28e3885796c5d5f02ec28918 | add beginning for D4 qcodes wrapper | Rubenknex/SPI-rack,peendebak/SPI-rack | D4/D4.py | D4/D4.py | from qcodes import Instrument
from qcodes.utils.validators import Numbers
from .D4_module import D4_module
class D4(Instrument):
"""
Qcodes driver for the D4 ADC SPI-rack module.
"""
def __init__(self, name, spi_rack, module, **kwargs):
super().__init__(name, **kwargs)
self.d4 = D4_m... | mit | Python | |
0cce9a108d97b61bc36c1d6873a801ae5a02ee10 | Add setup.py script. | anthrotype/booleanOperations,moyogo/booleanoperations,typemytype/booleanOperations | setup.py | setup.py | from distutils.core import setup
setup(
name="booleanOperations",
version="0.1",
description="Boolean operations on paths.",
author="Frederik Berlaen",
url="https://github.com/typemytype/booleanOperations",
license="MIT",
packages=["booleanOperations"],
package_dir={"": "Lib"},
pack... | mit | Python | |
6edea0e1f15c3905251793238fe88641a5935fed | Update version to 3.6.2 | zl352773277/django-redis,smahs/django-redis,yanheng/django-redis,lucius-feng/django-redis,GetAmbassador/django-redis | setup.py | setup.py | from setuptools import setup
description = """
Full featured redis cache backend for Django.
"""
setup(
name = "django-redis",
url = "https://github.com/niwibe/django-redis",
author = "Andrei Antoukh",
author_email = "niwi@niwi.be",
version='3.6.2',
packages = [
"redis_cache",
... | from setuptools import setup
description = """
Full featured redis cache backend for Django.
"""
setup(
name = "django-redis",
url = "https://github.com/niwibe/django-redis",
author = "Andrei Antoukh",
author_email = "niwi@niwi.be",
version='3.6.1',
packages = [
"redis_cache",
... | bsd-3-clause | Python |
709aef34e608eb86dc7cbffd5635f78d8b5f59f3 | add fasta2bed.py | likit/BioUtils,likit/BioUtils | fasta2bed.py | fasta2bed.py | '''Credit: Elijah Lowe'''
'''Read in sequences in FASTA format and print out BED format.'''
import screed, sys
infile = sys.argv[1]
for n, record in enumerate(screed.open(infile)):
print record['name']+"\t0\t",len(record['sequence'])
| bsd-2-clause | Python | |
58e4c8c5cd3c47fb4dc4e6e772b0f300fe890225 | Add missed setup.py | vine/mysql-prefetcher | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='myprefetch',
version='0.1',
description='MySQL Replication Prefetcher',
packages=find_packages(),
long_description=open('README.md').read(),
license=open('LICENSE').read(),
url='https://github.com/vine/mysql-pref... | apache-2.0 | Python | |
46b723ad4b48e29225cf8fcc44fa90bc9cfc3e21 | Enable distutils for package | c-w/GettyArt | setup.py | setup.py | from distutils.core import setup
setup(
name='Getty',
version='0.0.1',
author='Clemens Wolff',
author_email='clemens.wolff+pypi@gmail.com',
packages=['getty'],
url='https://github.com/c-w/Getty',
download_url='http://pypi.python.org/pypi/Getty',
license='LICENSE.txt',
description='S... | mit | Python | |
b4a41b129a33361ebcb45de87a236952943ab3c3 | Create setup.py | jbeliao/swipe-installer,jbeliao/swipe-installer,jbeliao/swipe-installer,jbeliao/swipe-installer | setup.py | setup.py | #!/usr/bin/env python
#
# Copyright (c) 2009-2013 Kyle Gorman
#
# 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, cop... | mit | Python | |
3af11eab7373a937f8df9858efbc41cdc9cfc940 | Package Linehaul | pypa/linehaul | setup.py | setup.py | from setuptools import setup, find_packages
install_requires = []
with open("requirements/main.in", "r") as fp:
for line in fp:
line.strip()
if line:
install_requires.append(line)
setup(
name="linehaul",
use_scm_version={
"local_scheme": lambda v: "+{.node}{}".format(v... | apache-2.0 | Python | |
f743220b6d6868b3a489a1843dda329ed0a7d5c4 | Add Python setup file | Twi/amaya | setup.py | setup.py | from setuptools import setup
setup(name='amaya',
version='0.1',
description='IRCv3 capable bot framework',
url='http://github.com/bookhorse/amaya',
author='Nicole Brennan',
author_email='twipony.ts@gmail.com',
license='ZLib',
packages=['amaya'])
| mit | Python | |
250261038893c7f5b004776c4aec01ebfc1d9012 | Fix a typo | moypray/flocker,AndyHuu/flocker,moypray/flocker,1d4Nf6/flocker,1d4Nf6/flocker,w4ngyi/flocker,hackday-profilers/flocker,LaynePeng/flocker,moypray/flocker,hackday-profilers/flocker,mbrukman/flocker,agonzalezro/flocker,agonzalezro/flocker,agonzalezro/flocker,wallnerryan/flocker-profiles,hackday-profilers/flocker,Azulinho/... | setup.py | setup.py | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
#
# Generate a Flocker package that can be deployed onto cluster nodes.
#
import os.path
from setuptools import setup
path = os.path.join(os.path.dirname(__file__), b"flocker/version")
with open(path) as fObj:
version = fObj.read().strip()
del path
se... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
#
# Generate a Flocker package that canbe deployed onto cluster nodes.
#
import os.path
from setuptools import setup
path = os.path.join(os.path.dirname(__file__), b"flocker/version")
with open(path) as fObj:
version = fObj.read().strip()
del path
set... | apache-2.0 | Python |
b46119ada62fbcb4791cd8ce210e34a43564df5b | Add setup_tools cruft | garethr/mnml,bradleywright/mnml,bradwright/mnml | setup.py | setup.py | from distutils.core import setup
setup(name = 'MNML',
description = 'A very lightweight WSGI Python web framework',
author = 'Bradley Wright',
author_email = 'me@bradleywright.name',
url = 'http://github.com/bradleywright/mnml',
version = '0.1',
py_modul... | mit | Python | |
328204f4158a829c6922019dcd83d3afbca2536d | bump to 0.4 | pbs/zencoder-py,torchbox/zencoder-py,zencoder/zencoder-py | setup.py | setup.py |
from distutils.core import setup
setup(name='zencoder',
version='0.4',
description='Integration library for Zencoder',
author='Alex Schworer',
author_email='alex.schworer@gmail.com',
url='http://github.com/schworer/zencoder-py',
license="MIT License",
install_requires=['httpl... |
from distutils.core import setup
setup(name='zencoder',
version='0.3',
description='Integration library for Zencoder',
author='Alex Schworer',
author_email='alex.schworer@gmail.com',
url='http://github.com/schworer/zencoder-py',
license="MIT License",
install_requires=['httpl... | mit | Python |
bd41935801fb01d85d7f3f600c6b94f077cdf82f | Add solid motor utilities. | mvernacc/proptools | solid.py | solid.py | ''' Solid rocket motor equations.
Matt Vernacchia
proptools
2016 Aug 22
'''
def chamber_pressure(K_n, a, n, rho_solid, c_star):
''' Chamber pressure due to solid propellant combustion.
See equation 12-6 in Rocket Propulsion Elements 8th edition.
Args:
K_n (scalar): Ratio of burning area to throa... | mit | Python | |
62d817cde6a8c58372125f551d8122cc303ac4b5 | Add a new gclient-new-workdir script which clones an existing gclient working directory much like git-new-workdir, but takes into account all sub projects as well. | azunite/chrome_build,smikes/depot_tools,azureplus/chromium_depot_tools,Midrya/chromium,sarvex/depot-tools,Midrya/chromium,Midrya/chromium,kromain/chromium-tools,ajohnson23/depot_tools,chinmaygarde/depot_tools,duanwujie/depot_tools,Chilledheart/depot_tools,SuYiling/chrome_depot_tools,airtimemedia/depot_tools,HackFisher/... | gclient-new-workdir.py | gclient-new-workdir.py | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Usage:
# gclient-new-workdir.py <repository> <new_workdir> [<branch>]
#
import os
import shutil
import subprocess
import sys
d... | bsd-3-clause | Python | |
a45c78d0fcc6d8cd2d8e702917a2dabd7bfc0444 | Add command createaccount | mociepka/saleor,mociepka/saleor,mociepka/saleor | saleor/account/management/commands/createserviceaccount.py | saleor/account/management/commands/createserviceaccount.py | import json
from typing import Any, Dict, List, Optional
import requests
from django.contrib.auth.models import Permission
from django.contrib.sites.models import Site
from django.core.management import BaseCommand, CommandError
from django.core.management.base import CommandParser
from requests.exceptions import Requ... | bsd-3-clause | Python | |
b8029643ca5dd5d559b7411b6fbb20896502fd7b | Create solution.py | lilsweetcaligula/Online-Judges,lilsweetcaligula/Online-Judges,lilsweetcaligula/Online-Judges | hackerrank/algorithms/implementation/medium/almost_sorted/py/solution.py | hackerrank/algorithms/implementation/medium/almost_sorted/py/solution.py | def solution(L):
def isAscending(L):
m = 1
while m < len(L):
if L[m] < L[m - 1]:
return False
m += 1
return True
buffer = list(L[:])
i = 1
while i < len(buffer):
if buffer[i] < buffer[i - 1]:
i -= 1
break... | mit | Python | |
e57c1b157b39eac278552fd6c9a16e004d8be501 | Create task_1_2.py | Mariaanisimova/pythonintask | INBa/2014/Andreev_F_I/task_1_2.py | INBa/2014/Andreev_F_I/task_1_2.py | # Задача 1, Вариант 2
# Напишите программу, которая будет сообщать род деятельности и псевдоним под которым скрывается Мартин Андерсен. После вывода информации программа должна дожидаться пока пользователь нажмет Enter для выхода.
# Андреев Ф.И.
# 23.05.2016
print('Мартин Андерсен известный датский писатель-коммунист... | apache-2.0 | Python | |
1d55ad8fb8309918e7d41b4f443e16ebefbb1895 | Add script for populating elasticsearch. | eggpi/similarity,eggpi/similarity,eggpi/similarity | populate_elasticsearch.py | populate_elasticsearch.py | #!/usr/bin/env python
import os
import sys
import json
import requests
import multiprocessing
import mwparserfromhell as mwp
ES_URL = 'http://localhost:9200'
SECTIONS_TO_REMOVE = set([
'references', 'see also', 'external links', 'footnotes'
])
def put_document(path):
id = os.path.basename(path)
doc = js... | mit | Python | |
1362703d4068a03c2970962ef2c05c3b128edcf1 | Create 5function.py | avsingh999/Learn_python | introduction/5function.py | introduction/5function.py | def fun():
name = "av"
age = int(19)
print("%s is %d years old."% (name, age))
return "end"
print(fun())
| mit | Python | |
2d4f6dd040d6f92b0865421cddf6c9ce16eff08e | add sample python module | tangym/autoapi | my_amazing_python_module.py | my_amazing_python_module.py | def some_function(name):
return "Hello, %s!" % name | apache-2.0 | Python | |
ff2b86d90ecbc2da25ddc05b0430555861104cac | Add an example for HybridContentsManager. | quantopian/pgcontents | examples/hybrid_manager_example.py | examples/hybrid_manager_example.py | # This example shows how to configure Jupyter/IPython to use the more complex
# HybridContentsManager.
# A HybridContentsManager implements the contents API by delegating requests to
# other contents managers. Each sub-manager is associated with a root
# directory, and all requests for data within that directory are r... | apache-2.0 | Python | |
b53eec31cdb77690bebf17427a30ba6e36156cad | Add some tests for DestroyPool(). | stratis-storage/stratis-cli,stratis-storage/stratis-cli | tests/dbus/manager/test_destroy.py | tests/dbus/manager/test_destroy.py | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 | Python | |
d68109c2fb7bb324c93506d26a1a7cf996134da3 | Allow `soulmate_finder` to be imported | erkghlerngm44/r-anime-soulmate-finder | soulmate_finder/__init__.py | soulmate_finder/__init__.py | # allow `soulmate_finder` to be imported
# FIXME: This is bad
from .__main__ import *
| mit | Python | |
79fe576ec71552633c7e5a2a646567beecfa3b5b | Add a test | KaiSforza/pywer | test/pkgbuildtest.py | test/pkgbuildtest.py | #!/usr/bin/env python3
import sys
import os
import unittest
sys.path[0] = os.path.abspath('..')
import libaur.PKGBUILD as P
class PkgbuildTest(unittest.TestCase):
KNOWN_VALUES = [
('''pkgname=foobar\n''',
{'pkgname':['foobar']}),
('''pkgname=(foobar)\n''',
... | mit | Python | |
44a785b456ad1d1bd9c866b79cadaec4c1d5bab5 | Add sample template file (#24) | tianhao64/vsphere-automation-sdk-python,tianhao64/vsphere-automation-sdk-python,pgbidkar/vsphere-automation-sdk-python,pgbidkar/vsphere-automation-sdk-python | samples/vsphere/common/sample_template.py | samples/vsphere/common/sample_template.py | #!/usr/bin/env python
"""
* *******************************************************
* Copyright (c) VMware, Inc. 2017. All Rights Reserved.
* SPDX-License-Identifier: MIT
* *******************************************************
*
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
* WARRANTIES OR CONDITIONS... | mit | Python | |
7d5407a98ef8b0d025532d9675b7109a4c4713f4 | add send sms python post code | fullstackpython/blog-code-examples,fullstackpython/blog-code-examples,fullstackpython/blog-code-examples | send-sms-text-messages-python/send_sms.py | send-sms-text-messages-python/send_sms.py | # we import the Twilio client from the dependency we just installed
from twilio.rest import TwilioRestClient
# the following line needs your Twilio Account SID and Auth Token
client = TwilioRestClient("ACxxxxxxxxxxxxxx", "zzzzzzzzzzzzz")
# change the "from_" number to your Twilio number and the "to" number
# to the p... | mit | Python | |
9e200c1e5d666c3ab151c96fcc1190c70ddcb02c | Add pagination utility. | kurtraschke/cadors-parse,kurtraschke/cadors-parse | src/cadorsfeed/views/pagination.py | src/cadorsfeed/views/pagination.py | from werkzeug import cached_property
from flask import url_for
class Pagination(object):
def __init__(self, db, key, per_page, page, endpoint):
self.db = db
self.query = key
self.per_page = per_page
self.page = page
self.endpoint = endpoint
@cached_property
def cou... | mit | Python | |
9f3c1ee68e6bb40c519e898a8a5aedd1ec42bc1f | add radar proxy | MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI | testing/ROS/serial_reader_radar.py | testing/ROS/serial_reader_radar.py | #!/usr/bin/env python
from __future__ import division
import serial
import rospy
import os
import sys
import math
import tf
from sensor_msgs.msg import Range
def RadianToDegree(rad):
return (rad * 4068) / 71.0
def DegreeToRadian(deg):
return (deg * 71) / 4068.0
if __name__=="__main__":
uid = str(os.get... | apache-2.0 | Python | |
c03b1c16938572aea70dd22b838459aeec585b0d | add tests for `dvc tag` | dmpetrov/dataversioncontrol,efiop/dvc,dmpetrov/dataversioncontrol,dataversioncontrol/dvc,efiop/dvc,dataversioncontrol/dvc | tests/test_tag.py | tests/test_tag.py | import os
import shutil
import filecmp
from dvc.main import main
from dvc.logger import logger
from tests.basic_env import TestDvc
from tests.utils import reset_logger_standard_output, reset_logger_error_output
from tests.utils.logger import MockLoggerHandlers, ConsoleFontColorsRemover
class TestTag(TestDvc):
... | apache-2.0 | Python | |
3506cb01b0ce03d834c61ff28dd5d35785b999d3 | add initial coverage implementation (#39) | crobby/oshinko-cli,radanalyticsio/oshinko-cli,radanalyticsio/oshinko-cli,radanalyticsio/oshinko-cli,tmckayus/oshinko-cli,tmckayus/oshinko-cli,crobby/oshinko-cli,crobby/oshinko-cli,tmckayus/oshinko-cli | tools/coverage.py | tools/coverage.py | #!/bin/env python
"""coverage.py
This script is for checking the code coverage of unit tests in the
oshinko-rest project. It is meant to be invoked from the top level of the
repository.
Example invocation:
$ tools/coverage.py -h
"""
import argparse
import copy
import re
import subprocess
oshinko_repo = 'githu... | apache-2.0 | Python | |
63eaadad7a5169ec6219d33f9b39ce27859684c2 | Add script to automate notebooks testing | openfisca/openfisca-tunisia,openfisca/openfisca-tunisia | notebooks/test_notebooks.py | notebooks/test_notebooks.py | # -*- coding: utf-8 -*-
'''
Checks notebook execution result.
Equal to this command + error management:
jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=60 --output executed_notebook.ipynb demo.ipynb
For jupyter configuration information, run: jupyter --path
'''
# Dependencies: nbformat, nbc... | agpl-3.0 | Python | |
37c151de6b2241e68f7287349b43f6dce1150093 | add an API module for core.ui | dmsurti/mayavi,alexandreleroux/mayavi,dmsurti/mayavi,liulion/mayavi,alexandreleroux/mayavi,liulion/mayavi | enthought/mayavi/core/ui/api.py | enthought/mayavi/core/ui/api.py | from enthought.mayavi.tools.mlab_scene_model import MlabSceneModel
from enthought.mayavi.core.ui.mayavi_scene import MayaviScene
from enthought.tvtk.pyface.scene_editor import SceneEditor
from enthought.mayavi.core.ui.engine_view import EngineView
from enthought.mayavi.core.ui.engine_rich_view import EngineRichView
| bsd-3-clause | Python | |
4fc098ade74a9b46f11937e229cba75b83f0c9a4 | Create Utils.py | abulbasar/machine-learning,abulbasar/machine-learning,abulbasar/machine-learning | Utils.py | Utils.py | class Batchable:
def __init__(self, X, y, batch_size = 256, seed = None):
import math
import numpy as np
if seed:
np.random.seed(seed)
idx = np.arange(X.shape[1])
np.random.shuffle(idx)
self.X = X[:, idx]
self.y = y[:, idx]
self.start = 0
... | apache-2.0 | Python | |
65bc771c1cff47fcd49486915a0ff27d635b4056 | Add Missionaries_and_cannibals_problem | ZoranPandovski/al-go-rithms,manikTharaka/al-go-rithms,ZoranPandovski/al-go-rithms,arijitkar98/al-go-rithms,arijitkar98/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,EUNIX-TRIX/al-go-rithms,arijitkar98/al-go-rithms,ZoranPandovski/al-go-rithms,EUNIX-TRIX/al-go-rithms,ZoranPandovski/al-go-rithms,ari... | data_structures/dictionary/missionaries_and_cannibals_problem.py | data_structures/dictionary/missionaries_and_cannibals_problem.py | shore = {1:['m1','m2','m3','c1','c2','c3'],2:[]}
boat = {1:True,2:False}
boat_cap = 0
boat_hold = []
choice = 'y'
count = 0
glob = 1
def pick():
print("Pick a person to put on boat/or press enter")
return input()
def check(person,flag,avail_p):
if(person in shore[flag] or person == "" or person in boat_hold... | cc0-1.0 | Python | |
87564dcb55e1130a0c4c306a241649d9f9bfd378 | Add categorize_forwarded_files_from_Sumologic.py | BinhMisfit/Sumologic-plugins | categorize_forwarded_files_from_Sumologic.py | categorize_forwarded_files_from_Sumologic.py | # --------------------------------------------------
# Author: Binh Nguyen
# Email: "binh@misfitwearables.com" or ntbinhptnk@gmail.com
# Feel free to ask me any question.
# --------------------------------------------------
# Description:
# When working with Sumologic, one usually uses the feature "Data Forwarding" fo... | mit | Python | |
4083cac3c0ec107df68cdecb8fc52c00e2684b08 | Add b3 format benchmark tests (#1489) | open-telemetry/opentelemetry-python,open-telemetry/opentelemetry-python | propagator/opentelemetry-propagator-b3/tests/performance/benchmarks/trace/propagation/test_benchmark_b3_format.py | propagator/opentelemetry-propagator-b3/tests/performance/benchmarks/trace/propagation/test_benchmark_b3_format.py | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | apache-2.0 | Python | |
4a5767c18b3d75420c5498341012fa98e74edba6 | Create 2string_join.py | avsingh999/Learn_python | string/2string_join.py | string/2string_join.py | s1="hello"
s2="world"
print(s1+s2)
print("\n"," ".join(s2),"\n")
print("length of s1=",len(s1))
| mit | Python | |
c1f02399ad3ce9c4009e297be58aa6e1f10337cb | Add utility getrecord.py to retrieve single records from lib | olympiag3/olypy,olympiag3/olypy,olympiag3/olypy,olympiag3/olypy | getrecord.py | getrecord.py | #!/usr/bin/python
#
# retrieve specified record from lib
#
import sys
import olypy.oio as oio
from olypy.oid import to_oid, to_int
import olypy.dbck as dbck
import pathlib
from jinja2 import Environment, PackageLoader, select_autoescape
from olymap.loc import build_complete_loc_dict
from olymap.ship import build_comp... | apache-2.0 | Python | |
502a95b4bcf54792b5755c9ea6f03a8f9572a271 | test resize | embali/imgpy | tests/test_resize.py | tests/test_resize.py | from tempfile import TemporaryFile
import pytest
from imgpy import Img
@pytest.mark.parametrize('image', ({
'sub': 'anima/bordered.gif',
'size': (100, 100)
}, {
'sub': 'anima/clear.gif',
'size': (100, 100)
}, {
'sub': 'fixed/bordered.jpg',
'size': (100, 100)
}, {
'sub': 'fixed/clear.jpg'... | mit | Python | |
f4bb4d17214f4e359455cf7b5fb7ab973508049b | Add missing module for merge script | comphist/cora,comphist/cora,comphist/cora,comphist/cora,comphist/cora | bin/diffMatcher.py | bin/diffMatcher.py | #!/usr/bin/python
# coding=utf-8
import subprocess
class DiffMatcher(object):
def __init__(self, listA, listB):
self.listA = listA
self.listB = listB
def create_diff(self, listA, listB,case_sensitive):
new_list = []
#compare the two files
try:
if (cas... | mit | Python | |
7b0044d3ccb617e92ee8523be949966f1188c742 | add unittest | elkingtonmcb/nupic,arhik/nupic,cngo-github/nupic,blueburningcoder/nupic,numenta-ci/nupic,passiweinberger/nupic,neuroidss/nupic,mcanthony/nupic,lscheinkman/nupic,neuroidss/nupic,rcrowder/nupic,pap/nupic,go-bears/nupic,numenta-ci/nupic,breznak/nupic,SaganBolliger/nupic,glorizen/nupic,blueburningcoder/nupic,go-bears/nupic... | tests/unit/py2/nupic/encoders/utility_test.py | tests/unit/py2/nupic/encoders/utility_test.py | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... | agpl-3.0 | Python | |
2ac66bef27652dec67b90cb428031e4954da8e21 | Create download-search.py | DataViva/dataviva-scripts,DataViva/dataviva-scripts | lattes/download-search.py | lattes/download-search.py | import urllib2
import codecs
import os
try: os.makedirs('data')
except: pass
inc = 10000
offset = 0
limit = 211056
while (offset < 211057):
urlpath = 'http://buscatextual.cnpq.br/buscatextual/busca.do?metodo=forwardPaginaResultados®istros=' + str(offset) + ';' + str(inc) + '&query=%28+%2Bidx_particao%3A1+%2Bidx_... | mit | Python | |
6a95d0df59f5ab03cb8537014e0102e5300a544a | Add Docker driver | redixin/rally-ci,redixin/rally-ci,redixin/rally-ci,aarexer/rally-ci,aarexer/rally-ci | docker.py | docker.py |
import random, string
import sys, subprocess
from log import logging
LOG = logging.getLogger(__name__)
class Driver(object):
def __init__(self, name, dockerfilepath):
self.name = name
self.dockerfilepath = dockerfilepath
self.tag = "rallyci:" + dockerfilepath
self.number = 0
... | apache-2.0 | Python | |
f3c622a3dc9573c8244bf01408c1ff4620080c99 | Create views module | mpiannucci/crosswynds-promo,mpiannucci/crosswynds-promo,mpiannucci/crosswynds-promo,mpiannucci/crosswynds-promo | views/__init__.py | views/__init__.py | mit | Python | ||
07148136d8dcc165fc72d3ef264d721c652db025 | Test cases for ZPool | Xaroth/libzfs-python,Xaroth/libzfs-python,Xaroth/libzfs-python | test/002_test_zpool.py | test/002_test_zpool.py | import unittest
import os
from .test_utils import _LibZFSHandleCase
from libzfs.zpool import ZPool, zpool_prop_t
LIBZFS_TEST_POOL = os.environ.get("LIBZFS_TEST_POOL", False)
@unittest.skipUnless(LIBZFS_TEST_POOL, "LIBZFS_TEST_POOL not set, so we do not test to a specific pool")
class Test_ZPool(_LibZFSHandleCase):
... | mit | Python | |
ba8be59db72c958e2ff20b9ae7fe81c400b40f9c | Make start of ongoing and deadline activities just a date | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/time_based/migrations/0008_auto_20201023_1443.py | bluebottle/time_based/migrations/0008_auto_20201023_1443.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2020-10-23 12:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('time_based', '0007_auto_20201023_1433'),
]
operations = [
migrations.Alter... | bsd-3-clause | Python | |
b869748e4bc0ee6986fa280aa69027aaf8607dcb | allow set_ev_handler without dispatchers | unifycore/ryu,diogommartins/ryu,torufuru/OFPatchPanel,jalilm/ryu,gopchandani/ryu,darjus-amzn/ryu,umkcdcrg01/ryu_openflow,elahejalalpour/ELRyu,openvapour/ryu,lzppp/mylearning,fkakuma/ryu,torufuru/oolhackathon,ykaneko/ryu,torufuru/oolhackathon,TakeshiTseng/ryu,alyosha1879/ryu,jazzmes/ryu,fujita/ryu,umkcdcrg01/ryu_openflo... | ryu/controller/handler.py | ryu/controller/handler.py | # Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
... | # Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# 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 |
7f49a34e605d701168ee88c8cff0e3b8ed9a68d6 | Add GPG-related minor migration | artefactual/archivematica-storage-service,artefactual/archivematica-storage-service,artefactual/archivematica-storage-service,artefactual/archivematica-storage-service | storage_service/locations/migrations/0017_gpg_space_minor_migration.py | storage_service/locations/migrations/0017_gpg_space_minor_migration.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('locations', '0016_mirror_location_aip_replication'),
]
operations = [
migrations.AlterField(
model_name='space',... | agpl-3.0 | Python | |
579d21e001f5cd61702dc086d36c1a5f764ffb45 | Add app.wsgi to run under Apache | johnmarcampbell/is-democracy-on-fire,johnmarcampbell/is-democracy-on-fire | app.wsgi | app.wsgi | import app
site = app.create_app()
site.run()
| mit | Python | |
194abec2ae2066a4ab77db2d46822115350d8086 | Add script brand-exclusion.py | SnakeHunt2012/word2vec,SnakeHunt2012/word2vec,SnakeHunt2012/word2vec,SnakeHunt2012/word2vec,SnakeHunt2012/word2vec | brand-exclusion.py | brand-exclusion.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import getsizeof
from time import time
from codecs import open
from numpy import array, matrix
from numpy.random import random
from argparse import ArgumentParser
from itertools import combinations
from heapq import nlargest
BRAND_EXCLUDED = False
def duration(s... | apache-2.0 | Python | |
38090ac06a48a4205cbc2318e3ad9296d5b08ea5 | Add migration to populate Broadcast.base_language | pulilab/rapidpro,tsotetsi/textily-web,tsotetsi/textily-web,pulilab/rapidpro,tsotetsi/textily-web,tsotetsi/textily-web,pulilab/rapidpro,tsotetsi/textily-web,pulilab/rapidpro,pulilab/rapidpro | temba/msgs/migrations/0069_populate_broadcast_base_lang.py | temba/msgs/migrations/0069_populate_broadcast_base_lang.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import defaultdict
from django.db import migrations
from temba.utils import chunk_list
def do_populate(Broadcast, FlowStep):
BroadcastSteps = FlowStep.broadcasts.through
broadcast_ids = list(Broadcast.objects.values_list('id', f... | agpl-3.0 | Python | |
42cc997aea3f71d9b0db37d36a895e68994616ea | Add Jansson (#2287) | TheTimmy/spack,krafczyk/spack,tmerrick1/spack,TheTimmy/spack,iulian787/spack,iulian787/spack,tmerrick1/spack,LLNL/spack,LLNL/spack,lgarren/spack,mfherbst/spack,tmerrick1/spack,krafczyk/spack,EmreAtes/spack,LLNL/spack,matthiasdiener/spack,matthiasdiener/spack,lgarren/spack,EmreAtes/spack,lgarren/spack,TheTimmy/spack,mat... | var/spack/repos/builtin/packages/jansson/package.py | var/spack/repos/builtin/packages/jansson/package.py | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python | |
9cbcf5ce7b6363e267e8923fe88e4ebf78107f8a | Add extractor for synthesis of Symbtr scores | MTG/pycompmusic | compmusic/extractors/makam/scoresynthesis.py | compmusic/extractors/makam/scoresynthesis.py | import json
import urllib2
import compmusic.dunya.conn
import compmusic.dunya.docserver
import compmusic.extractors
import pydub
from symbtrsynthesis.adaptivesynthesizer import AdaptiveSynthesizer
from symbtrsynthesis.musicxmlreader import MusicXMLReader
class ScoreSynthesis(compmusic.extractors.ExtractorModule):
... | agpl-3.0 | Python | |
e63a623452d9aa64c2dd392442f1f09f8e0924ef | make it work on python 2.6 | vstoykov/django-pipeline,lexqt/django-pipeline,mweibel/django-pipeline,pombredanne/django-pipeline-1,theatlantic/django-pipeline,cyberdelia/django-pipeline,Tekco/django-pipeline,perdona/django-pipeline,edwinlunando/django-pipeline,edwinlunando/django-pipeline,caioariede/django-pipeline,zapier/django-pipeline,novapost/d... | compress/filters/css_url_replace/__init__.py | compress/filters/css_url_replace/__init__.py | import re
from django.conf import settings
from compress.filter_base import FilterBase
CSS_REPLACE = getattr(settings, 'COMPRESS_CSS_URL_REPLACE', [])
class CSSURLReplace(FilterBase):
def filter_css(self, css):
for pattern, repl in CSS_REPLACE.iteritems():
css = re.sub(pattern, repl, css)
... | import re
from django.conf import settings
from compress.filter_base import FilterBase
CSS_REPLACE = getattr(settings, 'COMPRESS_CSS_URL_REPLACE', [])
class CSSURLReplace(FilterBase):
def filter_css(self, css):
for pattern, repl in CSS_REPLACE.iteritems():
css = re.sub(pattern, repl, css, fla... | mit | Python |
feee17d37fdef9b2b511366f42599ceb1b7fdd50 | Add migration | qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq | corehq/apps/sms/migrations/0019_add_new_registration_invitation_fields.py | corehq/apps/sms/migrations/0019_add_new_registration_invitation_fields.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('sms', '0018_check_for_phone_number_migration'),
]
operations = [
migrations.AddField(
mo... | bsd-3-clause | Python | |
0002ec236c63bf64a112eb3767137588ebe83403 | Add band-pass fourier filter. | rshkarin/afm-particle-analysis | band_pass.py | band_pass.py | import numpy as np
import matplotlib.pyplot as plt
def next_length_pow2(x):
return 2 ** np.ceil(np.log2(abs(x)))
def filter(fft_data, filter_large_dia, filter_small_dia):
fft_data_shape = fft_data.shape
side_len = fft_data_shape[0]
filter_large = 2.0 * filter_large_dia / side_len
filter_small = 2... | mit | Python | |
c54f7c8157b390aa73d3a395bd00a00de3b632c8 | Add twisted bot | honza/nigel | ircLogBot.py | ircLogBot.py | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An example IRC log bot - logs a channel's events to a file.
If someone says the bot's name in the channel followed by a ':',
e.g.
<foo> logbot: hello!
the bot will reply:
<logbot> foo: I am a log bot
Run this script with two argument... | bsd-2-clause | Python | |
1cee75aec336b6ba7d21cb9aa18b238e68ce2fd0 | add script to export data from database | DeepController/tellina,DeepController/tellina,DeepController/tellina | website/scripts/export_pairs.py | website/scripts/export_pairs.py | from website.models import Annotation
nl_list = []
cm_list = []
for annotation in Annotation.objects.all():
nl_list.append(annotation.nl.str)
cm_list.append(annotation.cmd.str)
with open('nl.txt', 'w') as o_f:
for nl in nl_list:
o_f.write('{}\n'.format(nl.strip()))
with open('cm.txt', 'w') as o_f... | mit | Python | |
74df88d572c8b6efabcde5e1803245d1bf31cc39 | Switch to GitHub-esque event names | mvaled/sentry,JamesMura/sentry,looker/sentry,jokey2k/sentry,alexm92/sentry,boneyao/sentry,Kryz/sentry,TedaLIEz/sentry,llonchj/sentry,fotinakis/sentry,nicholasserra/sentry,wong2/sentry,beeftornado/sentry,imankulov/sentry,JackDanger/sentry,kevinastone/sentry,argonemyth/sentry,zenefits/sentry,ifduyue/sentry,imankulov/sent... | src/sentry/models/auditlogentry.py | src/sentry/models/auditlogentry.py | """
sentry.models.auditlogentry
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
from django.db import models
from django.utils import timezone
from django.uti... | """
sentry.models.auditlogentry
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
from django.db import models
from django.utils import timezone
from django.uti... | bsd-3-clause | Python |
2457eaf72e0379d0e8915906ba7f7faa9b3f2f03 | add plotter for glitch offset | zlongshen/InertialNav,zlongshen/InertialNav,flyingk/InertialNav,zlongshen/InertialNav,ek99800/InertialNav,flyingk/InertialNav,vergil1874/InertialNav,flyingk/InertialNav,ek99800/InertialNav,priseborough/InertialNav,vergil1874/InertialNav,vergil1874/InertialNav,AlexHAHA/InertialNav,priseborough/InertialNav,AlexHAHA/Inert... | code/plot_glitchOffset.py | code/plot_glitchOffset.py | #!/bin/python
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
import numpy as np
import math
data = np.genfromtxt('GlitchOffsetOut.txt', delimiter=' ', skip_header=1,
skip_footer=1, names=['time', 'north', 'east'])
fig = plt.figure()
ax1 = fig.add_subplot(211)
ax1.set_tit... | bsd-3-clause | Python | |
526faad8c83d1385cc31ed3db85249a9f5882893 | Create myproject.py | nickczj/puts,nickczj/puts,nickczj/puts | myproject.py | myproject.py | from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def home():
return render_template("home.html")
if __name__ == "__main__":
app.run(host='0.0.0.0', debug=True)
| mit | Python | |
c6fbea313571cff4383ce57c689e5aac25537144 | add command to run VCLWriter | tsuru/varnishapi,tsuru/varnishapi | run_vcl_writer.py | run_vcl_writer.py | # Copyright 2014 varnishapi authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import argparse
from feaas import api, vcl_writer
def run(storage):
parser = argparse.ArgumentParser("VCL Writer runner")
parser.add_argument("-i", ... | bsd-3-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.