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 |
|---|---|---|---|---|---|---|---|---|
30bd54621ce649e90f4a1717d6709652a2c77351 | Add missing migration | whitesmith/hawkpost,whitesmith/hawkpost,whitesmith/hawkpost | humans/migrations/0013_auto_20201204_1807.py | humans/migrations/0013_auto_20201204_1807.py | # Generated by Django 2.2.13 on 2020-12-04 18:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('humans', '0012_remove_user_server_signed'),
]
operations = [
migrations.AlterField(
model_name='user',
name='last_n... | mit | Python | |
a8bf127b1e17b4ce9c2a5c4e6d2bbbc19faa0141 | Create snapper_chain.py | py-in-the-sky/challenges,py-in-the-sky/challenges,py-in-the-sky/challenges | google-code-jam/snapper_chain.py | google-code-jam/snapper_chain.py | """
https://code.google.com/codejam/contest/433101/dashboard
"""
def light_on(n, k):
bits = bin(k)[2:]
if len(bits) < n:
return False
return all(b == '1' for b in list(reversed(bits))[:n])
def main():
T = int(raw_input())
for t in xrange(1, T+1):
n, k = map(int, raw_input().str... | mit | Python | |
76fe998ad769e97b3424f2a3b8a5cccf2496816f | add very rudimentary/prototype range splitter program, without robust input checking | bpcox/rangesplitter | rangesplitter.py | rangesplitter.py | #! /usr/bin/env python3.4
import ipaddress
import math
toSplit=False
while not toSplit:
inputRange = input('Input the IP range you would like to split into subranges: ')
try:
toSplit =ipaddress.ip_network(inputRange)
except:
ValueError
rangeSize = False
default = False
while (not rangeSize and not default):
... | mit | Python | |
b2661e8156f9a4e96cce3cc720563b1589037ad5 | Add frequency_estimator.py | shnizzedy/SM_openSMILE,shnizzedy/SM_openSMILE,shnizzedy/SM_openSMILE,shnizzedy/SM_openSMILE,shnizzedy/SM_openSMILE | mhealthx/extractors/frequency_estimator.py | mhealthx/extractors/frequency_estimator.py | #!/usr/bin/env python
"""
This program implements some of the frequency estimation functions from:
https://gist.github.com/endolith/255291 and
https://github.com/endolith/waveform-analyzer
"""
def freq_from_autocorr(signal, fs):
"""
Estimate frequency using autocorrelation.
Pros: Best method for finding ... | apache-2.0 | Python | |
d2a80a76fdf28625ad36b2fd71af56938b9b9506 | Add needed track known class. | stober/lspi | src/trackknown.py | src/trackknown.py | #!/usr/bin/env python
'''
@author jstober
Simple class to track knowledge of states and actions. Based on
L. Li, M. L. Littman, and C. R. Mansley, “Online exploration in least-squares policy iteration” AAMAS, 2009.
'''
import numpy as np
import pdb
class TrackKnown:
"""
Track knowledge of states and action... | bsd-2-clause | Python | |
5dfa4397a282ddbafb57d990bc7d630fb6f927de | Add helper method for execute a commands | alexandrucoman/bcbio-dev-conda,alexandrucoman/bcbio-dev-conda | build.py | build.py | """Update conda packages on binstars with latest versions"""
import os
import six
import subprocess
import time
ATTEMPTS = 3
RETRY_INTERVAL = 0.1
def execute(command, **kwargs):
"""Helper method to shell out and execute a command through subprocess.
:param attempts: How many times to retry running th... | mit | Python | |
387758ebcc2a0fa29e9e7744eacc6c753ae5284e | add example for FIFOQueue and coordinate application | iViolinSolo/DeepLearning-GetStarted,iViolinSolo/DeepLearning-GetStarted | TF-Demo/QueueRunnerDemo/queue_runner_demo.py | TF-Demo/QueueRunnerDemo/queue_runner_demo.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Author: violinsolo
# Created on 12/12/2017
import tensorflow as tf
# define FIFO queue
q = tf.FIFOQueue(capacity=1000, dtypes='float32')
# define ops
counter = tf.Variable(initial_value=0, dtype='float32')
counter_increment_op = tf.assign_add(counter, 1.)
queue_enqueue_op... | apache-2.0 | Python | |
20b2e70fe732b6f0cc049d18da9cac717cd7e967 | Remove groups from admin | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | polyaxon/db/admin/groups.py | polyaxon/db/admin/groups.py | from django.contrib import admin
from django.contrib.auth.models import Group
admin.site.unregister(Group)
| apache-2.0 | Python | |
4a7fc9efce33bba3aa9ea818d09f6e9b621ab152 | add script to pull out contacts csv | DOAJ/doaj,DOAJ/doaj,DOAJ/doaj,DOAJ/doaj | portality/migrate/emails.py | portality/migrate/emails.py | from portality.models import Account
import csv
OUT = "emails.csv"
f = open(OUT, "wb")
writer = csv.writer(f)
writer.writerow(["ID", "Name", "Journal Count", "Email"])
for a in Account.iterall():
id = a.id
name = a.name
count = len(a.journal) if a.journal is not None else 0
email = a.email
if nam... | apache-2.0 | Python | |
9639ab62ed0f6e0c5229be9820a9b902e5870a67 | update readme and make command line script | randlet/dianonymous,randlet/dianonymous | scripts/dianon.py | scripts/dianon.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import dicom
import sys
if __name__ == "__main__": #pragma nocover
from dianonymous.dianonymous import anonymize
parser = argparse.ArgumentParser(description="Anonymize DICOM files")
parser.add_argument(
'-r', '--recurse',
defa... | bsd-3-clause | Python | |
bd371ecbd2ac163e44f104a775390b2ca2b88d35 | Add migration for index on departement | openmaraude/APITaxi,openmaraude/APITaxi | migrations/versions/75704b2e975e_add_index_on_departement_for_numero.py | migrations/versions/75704b2e975e_add_index_on_departement_for_numero.py | """Add index on Departement for numero
Revision ID: 75704b2e975e
Revises: 34c2049aaee2
Create Date: 2019-10-22 17:27:10.925104
"""
# revision identifiers, used by Alembic.
revision = '75704b2e975e'
down_revision = '34c2049aaee2'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgres... | agpl-3.0 | Python | |
70428a920ae9e02820e63e7dba98fc16faab6f10 | add benchmark for linalg.logm | zerothi/scipy,vigna/scipy,scipy/scipy,Eric89GXL/scipy,mdhaber/scipy,matthew-brett/scipy,ilayn/scipy,rgommers/scipy,endolith/scipy,mdhaber/scipy,Eric89GXL/scipy,grlee77/scipy,grlee77/scipy,rgommers/scipy,mdhaber/scipy,tylerjereddy/scipy,anntzer/scipy,endolith/scipy,andyfaff/scipy,scipy/scipy,perimosocordiae/scipy,tylerj... | benchmarks/benchmarks/linalg_logm.py | benchmarks/benchmarks/linalg_logm.py | """ Benchmark linalg.logm for various blocksizes.
"""
import numpy as np
try:
import scipy.linalg
except ImportError:
pass
from .common import Benchmark
class Logm(Benchmark):
params = [
['float64', 'complex128'],
[64, 256],
['gen', 'her', 'pos']
]
param_names = ['dtype'... | bsd-3-clause | Python | |
4be38d1f523696a48333797cbdb4a99a874a9cd5 | Create albumCoverFinder.py | btran29/yet-another-album-cover-finder | albumCoverFinder.py | albumCoverFinder.py | # albumCoverFinder - Brian Tran, btran29@gmail.com
# This program scans a tree of directories containing mp3 files. For
# each directory, it attempts to download the cover image from the
# Apple iTunes service. Subdirectories must be named <Artist>/<Album>
# contain .mp3 files to be considered. The cover will be saved... | mit | Python | |
e7e37e9b1fd56d18711299065d6f421c1cb28bac | Add some Feed test cases | pombredanne/moksha,lmacken/moksha,pombredanne/moksha,mokshaproject/moksha,lmacken/moksha,mokshaproject/moksha,ralphbean/moksha,pombredanne/moksha,pombredanne/moksha,ralphbean/moksha,mokshaproject/moksha,lmacken/moksha,mokshaproject/moksha,ralphbean/moksha | moksha/tests/test_feed.py | moksha/tests/test_feed.py | from tw.api import Widget
from moksha.feed import Feed
class TestFeed(object):
def test_feed_subclassing(self):
class MyFeed(Feed):
url = 'http://lewk.org/rss'
feed = MyFeed()
assert feed.url == 'http://lewk.org/rss'
assert feed.num_entries() > 0
for entry in fe... | apache-2.0 | Python | |
d308695c79face90ba7f908230edb5e2e2437cbd | Decrypt file using XOR | paulherman/mu | tools/xor_decryptor.py | tools/xor_decryptor.py | #! /usr/bin/env python3
import sys
import os
from ctypes import c_ubyte
keys = [0xd1, 0x73, 0x52, 0xf6, 0xd2, 0x9a, 0xcb, 0x27, 0x3e, 0xaf, 0x59, 0x31, 0x37, 0xb3, 0xe7, 0xa2]
initial_key = 0x5e
delta_key = 0x3d
if __name__ == '__main__':
for path in sys.argv[1:]:
if os.path.isfile(path):
wi... | mit | Python | |
7a02f383986f347d208f69ba59526d9ce7df59bf | Add access grant functions | gryffon/SusumuTakuan,gryffon/SusumuTakuan | access.py | access.py | #
# access.py
#
# functions for dealing with access to Discord bot commands
#
def grant_user_access(user, commandclass):
new_grant = CommandClassAccess(user_id = user.id, command_class_id = commandclass.id)
session.add(new_grant)
session.commit()
def grant_role_access(role, commandclass):
new_grant = CommandClas... | mit | Python | |
c4001a95dee88bc98eda5ce67a2f14485f4e85a5 | Add configurations | 317070/kaggle-heart | configurations/initial.py | configurations/initial.py | #TODO: add code
| mit | Python | |
226cf36e4b4d069a920785b492804b78eebc34a5 | Make non-commtrack location types administrative | dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq | corehq/apps/locations/management/commands/migrate_admin_status.py | corehq/apps/locations/management/commands/migrate_admin_status.py | # One-off migration from 2016-04-04
from optparse import make_option
from time import sleep
from django.core.management.base import BaseCommand
from corehq.apps.locations.models import LocationType, SQLLocation
from corehq.apps.es import DomainES
from corehq.util.log import with_progress_bar
def get_affected_location... | bsd-3-clause | Python | |
be2ac14fbb228e5a5addd393867b9b3c7267ba89 | Add and define string_permu_check problem. | nguyentu1602/pyexp | pyexp/string_permu_check.py | pyexp/string_permu_check.py | '''Module to solve the algoritm question:
Given a string S, how to count how many permutations
of S is in a longer string L, assuming, of course, that
permutations of S must be in contagious blocks in L.
I will solve it in O(len(L)) time.
'''
| mit | Python | |
a59682d4b8bd4f594dce72b0f86f2ed4096c4178 | Add missing migration file | akvo/akvo-rsr,akvo/akvo-rsr,akvo/akvo-rsr,akvo/akvo-rsr | akvo/rsr/migrations/0127_auto_20180529_0955.py | akvo/rsr/migrations/0127_auto_20180529_0955.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import akvo.rsr.fields
class Migration(migrations.Migration):
dependencies = [
('rsr', '0126_auto_20180320_1252'),
]
operations = [
migrations.AlterField(
model_name='rep... | agpl-3.0 | Python | |
4322ca998fadbd0e380626b895415bf75c4f7214 | change ordering on ability levels | numbas/editor,numbas/editor,numbas/editor | editor/migrations/0043_auto_20160303_1138.py | editor/migrations/0043_auto_20160303_1138.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('editor', '0042_remove_comment_date'),
]
operations = [
migrations.AlterModelOptions(
name='abilitylevel',
... | apache-2.0 | Python | |
774b0b3d11aaf3fd529f95233eb13e87829802f7 | create catalog script written | gnowledge/gstudio,makfire/gstudio,gnowledge/gstudio,gnowledge/gstudio,makfire/gstudio,makfire/gstudio,AvadootNachankar/gstudio,AvadootNachankar/gstudio,makfire/gstudio,AvadootNachankar/gstudio,AvadootNachankar/gstudio,gnowledge/gstudio,gnowledge/gstudio | gnowsys-ndf/gnowsys_ndf/ndf/management/commands/create_catalog.py | gnowsys-ndf/gnowsys_ndf/ndf/management/commands/create_catalog.py | import subprocess
from django.core.management.base import BaseCommand, CommandError
from gnowsys_ndf.factory_type import *
from gnowsys_ndf.ndf.models import *
class Command(BaseCommand):
def handle(self,*args,**options):
#print factory_attribute_types
GSystemTypeList = [i['name'] for i in factory_gsystem_typ... | agpl-3.0 | Python | |
65d7e81510980d85af5b52504e6d98e45943cc36 | Create getdata.py | wikkii/raspluonto,wikkii/raspluonto,wikkii/raspluonto,wikkii/raspluonto,wikkii/raspluonto | python_flask/public_html/nuotiovahti/nuotiovahti/getdata.py | python_flask/public_html/nuotiovahti/nuotiovahti/getdata.py | import paho.mqtt.client as mqtt
import mysql.connector
from flask import Flask, jsonify, json, request
app = Flask(__name__)
app.route("/")
with app.app_context():
def fetchfrombase():
try:
cnx = mysql.connector.connect(option_files='/home/mint/connectors.cnf')
except mysql.connector.Error as err:
... | mit | Python | |
26fcd91313b15ee2426aec36817a3f29734f4b93 | add diagonal gaussian demo | mattjj/pybasicbayes,michaelpacer/pybasicbayes,fivejjs/pybasicbayes | examples/demo-diaggaussian.py | examples/demo-diaggaussian.py | from __future__ import division
import numpy as np
np.seterr(invalid='raise')
from matplotlib import pyplot as plt
import copy
from pybasicbayes import models, distributions
from pybasicbayes.util.text import progprint_xrange
alpha_0=5.0
obs_hypparams=dict(
mu_0=np.zeros(2),
alphas_0=2*np.ones(2),
... | mit | Python | |
f48535102b6f71ba802e9b656c73cdd3ec746a3b | Add the test_repeat_layer.py | tensor-tang/Paddle,luotao1/Paddle,lcy-seso/Paddle,chengduoZH/Paddle,chengduoZH/Paddle,QiJune/Paddle,lispc/Paddle,putcn/Paddle,lispc/Paddle,pkuyym/Paddle,luotao1/Paddle,jacquesqiao/Paddle,hedaoyuan/Paddle,lcy-seso/Paddle,chengduoZH/Paddle,putcn/Paddle,PaddlePaddle/Paddle,PaddlePaddle/Paddle,reyoung/Paddle,pengli09/Paddl... | python/paddle/trainer_config_helpers/tests/configs/test_repeat_layer.py | python/paddle/trainer_config_helpers/tests/configs/test_repeat_layer.py | from paddle.trainer_config_helpers import *
settings(batch_size=1000, learning_rate=1e-5)
din = data_layer(name='data', size=30)
outputs(
repeat_layer(
input=din, num_repeats=10, as_row_vector=True),
repeat_layer(
input=din, num_repeats=10, act=TanhActivation(), as_row_vector=False))
| apache-2.0 | Python | |
aa5c8164b26c388b6a3a1efe8ea402a63a1c7ae8 | add migrations file | djangothon/django-db-meter,djangothon/django-db-meter,djangothon/django-db-meter | django_db_meter/migrations/0003_testmodel.py | django_db_meter/migrations/0003_testmodel.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('django_db_meter', '0002_appwiseaggregated... | apache-2.0 | Python | |
4db578f728a1eeda337f642513c57814fa9ec855 | create module to save script to s3 bucket | ryninho/session2s3 | session2s3.py | session2s3.py | """
Save session to S3 bucket. Ex: ses2s3.workspace_to_s3('my-project-script')
"""
from datetime import datetime
import re
import boto3
import dill
def session_to_s3(prefix, bucket_name, timestamp=True):
"""Save session to S3 bucket. Login via ~/.aws/credentials as per boto3."""
if timestamp:
now_str = str(da... | mit | Python | |
a6ac0949b32e8e02d26fe0eff159fd057c11c8e2 | rename test_shore.py in test_shore_odf.py | FrancoisRheaultUS/dipy,Messaoud-Boudjada/dipy,JohnGriffiths/dipy,nilgoyyou/dipy,Messaoud-Boudjada/dipy,rfdougherty/dipy,beni55/dipy,demianw/dipy,sinkpoint/dipy,rfdougherty/dipy,StongeEtienne/dipy,demianw/dipy,JohnGriffiths/dipy,mdesco/dipy,jyeatman/dipy,matthieudumont/dipy,villalonreina/dipy,samuelstjean/dipy,oesteban/... | dipy/reconst/tests/test_shore_odf.py | dipy/reconst/tests/test_shore_odf.py | import numpy as np
from dipy.data import get_data, two_shells_voxels, three_shells_voxels, get_sphere
from dipy.data.fetcher import (fetch_isbi2013_2shell, read_isbi2013_2shell,
fetch_sherbrooke_3shell, read_sherbrooke_3shell)
from dipy.reconst.shore import ShoreModel
from dipy.recon... | bsd-3-clause | Python | |
76ac913fc0862421b7e4ef1f32994c8084a21f86 | Add influx component | shaftoe/home-assistant,mKeRix/home-assistant,kyvinh/home-assistant,miniconfig/home-assistant,alexmogavero/home-assistant,ewandor/home-assistant,PetePriority/home-assistant,Duoxilian/home-assistant,titilambert/home-assistant,open-homeautomation/home-assistant,emilhetty/home-assistant,philipbl/home-assistant,Theb-1/home-... | homeassistant/components/influx.py | homeassistant/components/influx.py | """
homeassistant.components.influx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InfluxDB component which allows you to send data to an Influx database.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/influx/
Configuration:
influx:
host: localhost
port: 8086
... | mit | Python | |
730c8bf23dbd687b3070eae58378ebcccf523736 | add 'split' filter | serge-name/myansible,serge-name/myansible,serge-name/myansible | filter_plugins/split.py | filter_plugins/split.py | class FilterModule(object):
''' A comment '''
def filters(self):
return {
'split': self.split,
}
def split(self, input_value, separator):
return input_value.split(separator)
| mit | Python | |
938a6fabbc67feb409f6874966b30cb5c3e927a6 | Create myotpsecrets.py | mortn/docker-py3bottle | app/myotpsecrets.py | app/myotpsecrets.py | ttp_user = 'admin'
http_pass = 'admin'
codes = {
'account1': 'pefjehegNusherewSunaumIcwoafIfyi',
'account2': 'memJarrIfomWeykvajLyutIkJeafcoyt',
'account3': 'rieshjaynEgDoipEjkecPopHiWighath',
}
| mit | Python | |
eb396c12cccbda03a46381b5a54ff55d8f876152 | Fix NameError | untitaker/vdirsyncer,untitaker/vdirsyncer,untitaker/vdirsyncer,hobarrera/vdirsyncer,hobarrera/vdirsyncer | vdirsyncer/__init__.py | vdirsyncer/__init__.py | # -*- coding: utf-8 -*-
'''
vdirsyncer is a synchronization tool for vdir. See the README for more details.
'''
from __future__ import print_function
PROJECT_HOME = 'https://github.com/untitaker/vdirsyncer'
DOCS_HOME = 'https://vdirsyncer.readthedocs.org/en/stable'
try:
from .version import version as __version_... | # -*- coding: utf-8 -*-
'''
vdirsyncer is a synchronization tool for vdir. See the README for more details.
'''
from __future__ import print_function
try:
from .version import version as __version__ # noqa
except ImportError: # pragma: no cover
raise ImportError(
'Failed to find (autogenerated) vers... | mit | Python |
0e3711000bcf7d59f75baa68f357f49f5246f812 | Add video capturing functionality | vladimiroff/humble-media,vladimiroff/humble-media | humblemedia/resources/utils/video_capture.py | humblemedia/resources/utils/video_capture.py | import subprocess
import re
def get_video_duration(filename):
# returns duration in seconds
command = 'ffmpeg -i %s 2>&1 | grep "Duration"' % filename
result = subprocess.Popen(command,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
stdout_lines = result.stdout.readlines()
du... | mit | Python | |
ff63bb34aaf01cd9cd7eff89c0c94135f896640f | Create mqtt_easydriver_stepper.py | pumanzor/iot-redlibre,pumanzor/iot-redlibre | linkit/easydriver/mqtt_easydriver_stepper.py | linkit/easydriver/mqtt_easydriver_stepper.py | import paho.mqtt.client as mqtt
import json, time
import mraa
pin19 = mraa.Pwm(19)
pin0 = mraa.Gpio(0)
pin0.dir(mraa.DIR_OUT)
# ----- CHANGE THESE FOR YOUR SETUP -----
MQTT_HOST = "190.97.168.236"
MQTT_PORT = 1883
def on_connect(client, userdata, rc):
print("\nConnected with result code " + str(rc) + "\n")
... | mit | Python | |
2ae6f4183b2096287f8155d7db7e2ed0444618c4 | Add first version of Day One entry splitter | rdocking/bits_and_bobs | day_one_entry_splitter.py | day_one_entry_splitter.py | #!/usr/bin/env python
# encoding: utf-8
"""
day_one_entry_splitter.py
Created by Rod Docking on 2017-01-01.
All rights reserved.
"""
import sys
def main():
"""Split entries from Day One export into separate files"""
# Entry headers look like:
# "Date: February 14, 2005 at 9:00 AM"
# Need to:
# ... | mit | Python | |
d73070f268e240439c71ffd193a18c477403dd2e | Add project model class | JrGoodle/clowder,JrGoodle/clowder,JrGoodle/clowder | clowder/project.py | clowder/project.py | import argparse
import sys
class Project(object):
def __init__(self, name, path, url):
self.name = name
self.path = path
self.url = url
| mit | Python | |
dd708956ed19a38be09597cae94172e0b9863623 | Add signing thanks @jmcarp | kwierman/waterbutler,TomBaxter/waterbutler,Ghalko/waterbutler,rafaeldelucena/waterbutler,icereval/waterbutler,CenterForOpenScience/waterbutler,rdhyee/waterbutler,RCOSDP/waterbutler,hmoco/waterbutler,chrisseto/waterbutler,cosenal/waterbutler,Johnetordoff/waterbutler,felliott/waterbutler | waterbutler/signing.py | waterbutler/signing.py | # encoding: utf-8
import hmac
import json
import base64
import collections
from waterbutler import settings
# Written by @jmcarp originally
def order_recursive(data):
"""Recursively sort keys of input data and all its nested dictionaries.
Used to ensure consistent ordering of JSON payloads.
"""
if i... | apache-2.0 | Python | |
553624fcd4d7e8a4c561b182967291a1cc44ade9 | Add algorithm for Casimir Effect (#7141) | TheAlgorithms/Python | physics/casimir_effect.py | physics/casimir_effect.py | """
Title : Finding the value of magnitude of either the Casimir force, the surface area
of one of the plates or distance between the plates provided that the other
two parameters are given.
Description : In quantum field theory, the Casimir effect is a physical force
acting on the macroscopic boundaries of a confined... | mit | Python | |
cad438214ec55684bfc7d5f1d5383109934f29ff | add weboob.tools.application.prompt.PromptApplication | Konubinix/weboob,nojhan/weboob-devel,nojhan/weboob-devel,laurent-george/weboob,sputnick-dev/weboob,laurent-george/weboob,sputnick-dev/weboob,frankrousseau/weboob,frankrousseau/weboob,Boussadia/weboob,laurent-george/weboob,Konubinix/weboob,Boussadia/weboob,willprice/weboob,nojhan/weboob-devel,eirmag/weboob,franek/weboob... | weboob/tools/application/prompt.py | weboob/tools/application/prompt.py | # -*- coding: utf-8 -*-
"""
Copyright(C) 2010 Romain Bignon
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, version 3 of the License.
This program is distributed in the hope that it will be useful... | agpl-3.0 | Python | |
1b3d7078a4ca91ef07f90d1645f26761d1f7abac | Add example of using lower-level plotting methods directly | joferkington/mplstereonet | examples/scatter.py | examples/scatter.py | """
Example of how `ax.scatter` can be used to plot linear data on a stereonet
varying color and/or size by other variables.
This also serves as a general example of how to convert orientation data into
the coordinate system that the stereonet plot uses so that generic matplotlib
plotting methods may be used.
"""
impo... | mit | Python | |
7383cc2a4b6ad21c747794dbb3d33338d8eea528 | Add another example. | nihilifer/txsocksx,locusf/txsocksx,habnabit/txsocksx | examples/tor-irc.py | examples/tor-irc.py | # Copyright (c) Aaron Gallagher <_@habnab.it>
# See COPYING for details.
from twisted.internet.defer import Deferred
from twisted.internet.endpoints import TCP4ClientEndpoint
from twisted.internet.protocol import ClientFactory
from twisted.internet.task import react
from twisted.words.protocols.irc import IRCClient
fr... | isc | Python | |
7a3e85231efeb5c03cab944f6da346d138f6fcb1 | Add tests for pips | wicksy/laptop-build,wicksy/laptop-build,wicksy/laptop-build,wicksy/laptop-build | test/test_pips.py | test/test_pips.py | import pytest
@pytest.mark.parametrize("name", [
("awscli"),
("boto3"),
("docker-py"),
("GitPython"),
("mkdocs"),
("pep8"),
("virtualenv"),
("virtualenvwrapper"),
])
def test_pips(host, name):
assert name in host.pip_package.get_packages() | mit | Python | |
8b4d27851889bccc87392b14557ce63d3f95e426 | add build.py | greggman/hft-unity3d,greggman/hft-unity3d,greggman/hft-unity3d,greggman/hft-unity3d | build.py | build.py | #!/usr/bin/python
import glob
import gzip
import os
import platform
import re
import sh
import shutil
import subprocess
import sys
import time
from optparse import OptionParser
log = lambda *a: None
def VerbosePrint(*args):
# Print each argument separately so caller doesn't need to
# stuff everything to be pr... | bsd-3-clause | Python | |
4a97d5b9f9998a5b8ca8509547dabf8d757e70d9 | Add build script. | ryansturmer/gitmake | build.py | build.py | import version
print "Reading gitmake.py..."
with open('gitmake.py') as fp:
lines = fp.readlines()
print "Rewriting gitmake.py..."
with open('gitmake.py', 'w') as fp:
for line in lines:
if line.startswith('version_info ='):
fp.write('version_info = (%d,%d,%d,\'%s\')\n' % (version.major, ve... | mit | Python | |
6dabd92990df570d81a621e51d7119345671d4c0 | Create Neopixel_Serial.py (#43) | MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab | home/moz4r/Neopixel_Serial.py | home/moz4r/Neopixel_Serial.py | #Just a poc maybe there is a best method
#Flash Neopixel_MRL.ino
import time
serial = Runtime.createAndStart("serial","Serial")
Runtime.createAndStart("mouth", "AcapelaSpeech")
serial.connect("COM7", 9600, 8, 1, 0)
sleep(5)
mouth.speak("Hi everybody this is neo pixel ring controled by my robot lab")
sleep(3)
mouth.spea... | apache-2.0 | Python | |
86ae30203475a2ac718cf3839e38522e8e1aa203 | Add tests package #5 | 7pairs/kac6vote | tests/__init__.py | tests/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2017 Jun-ya HASEBA
#
# 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 r... | apache-2.0 | Python | |
0fec255426bc48e7674cc1391bdb3e1f64386be6 | Add disk_variability script, used to generate box plot for paper | jcarreira/ramcloud,SMatsushi/RAMCloud,rstutsman/RAMCloud,behnamm/cs244b_project,rstutsman/RAMCloud,jcarreira/ramcloud,jcarreira/ramcloud,SMatsushi/RAMCloud,jcarreira/ramcloud,alexandermerritt/ramcloud,mrdiegoa/ramcloud,QingkaiLu/RAMCloud,QingkaiLu/RAMCloud,taschik/ramcloud,DavidLi2010/ramcloud,jcarreira/ramcloud,taschi... | scripts/disk_variability.py | scripts/disk_variability.py | #!/usr/bin/env python
# Copyright (c) 2011 Stanford University
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ... | isc | Python | |
d519c7f171d7e89f30f073616f71af24654d223d | add solution for Rotate List | zhyu/leetcode,zhyu/leetcode | src/rotateList.py | src/rotateList.py | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param head, a ListNode
# @param k, an integer
# @return a ListNode
def rotateRight(self, head, k):
if not head:
return None
... | mit | Python | |
5828823d505aae1425fd2353f898c5b18722e6e5 | Introduce base class and ProgressObserver for renaming occurences. | caio2k/RIDE,fingeronthebutton/RIDE,fingeronthebutton/RIDE,robotframework/RIDE,robotframework/RIDE,robotframework/RIDE,HelioGuilherme66/RIDE,caio2k/RIDE,caio2k/RIDE,fingeronthebutton/RIDE,robotframework/RIDE,HelioGuilherme66/RIDE,HelioGuilherme66/RIDE,HelioGuilherme66/RIDE | src/robotide/ui/progress.py | src/robotide/ui/progress.py | # Copyright 2008-2009 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | # Copyright 2008-2009 Nokia Siemens Networks Oyj
#
# 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 |
0d7b1d848d7ab80cc9054931f14b98bc123287bf | Create test_bulkresize.py file | sukeesh/Jarvis,sukeesh/Jarvis,sukeesh/Jarvis,sukeesh/Jarvis | jarviscli/plugins/test_bulkresize.py | jarviscli/plugins/test_bulkresize.py | from unittest import mock
import unittest
import os
from Jarvis import Jarvis
from plugins.bulkresize import spin
from plugins import bulkresize
from tests import PluginTest
CURRENT_PATH = os.path.dirname(os.path.abspath(__file__))
DATA_PATH = os.path.join(CURRENT_PATH, '..', 'data/')
class Bulkresize(PluginTest):... | mit | Python | |
a8a87818094f0cf9954815caca9fb586ddb4099b | Add a gallery example to show coloring of points by categories (#1006) | GenericMappingTools/gmt-python,GenericMappingTools/gmt-python | examples/gallery/symbols/points_categorical.py | examples/gallery/symbols/points_categorical.py | """
Color points by categories
---------------------------
The :meth:`pygmt.Figure.plot` method can be used to plot symbols which are
color-coded by categories. In the example below, we show how the
`Palmer Penguins dataset <https://github.com/allisonhorst/palmerpenguins>`__
can be visualized. Here, we can pass the ind... | bsd-3-clause | Python | |
7ff0c1fd4eb77129c7829f92fc176678a06abe19 | add solution for Balanced Binary Tree | zhyu/leetcode,zhyu/leetcode | src/balancedBinaryTree.py | src/balancedBinaryTree.py | # Definition for a binary tree node
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param root, a tree node
# @return a boolean
def isBalanced(self, root):
return self.getDepth(root) != -1
def ge... | mit | Python | |
81a79933aa593f79ae054053068b04073f9db68f | Add hit calibration example | tamasgal/km3pipe,tamasgal/km3pipe | examples/plot_calibrating_hits.py | examples/plot_calibrating_hits.py | #!/usr/bin/env python
# coding: utf-8 -*-
"""
==================
Calibrating Hits
==================
Hits stored in ROOT and HDF5 files are usually not calibrated, which
means that they have invalid positions, directions and uncorrected hit times.
This example shows how to assign the PMT position and direction to eac... | mit | Python | |
d19599227935139585a013227e816090a48e3a83 | Create bh.py | supthunder/amdRestock | bh.py | bh.py | import requests
import re
import tweepy
import os
from time import gmtime, strftime, sleep
import json
from random import uniform
def getName(name):
product = "RX "
if "570" in name:
product += "570"
else:
product += "580"
if "4G" in name:
product += " 4GB"
else:
product += " 8GB"
return product
def s... | mit | Python | |
8bc4dddfad944d385c02e2a6ebd8031bfb6bfae8 | Test dynamic_length | raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten | extenteten/dynamic_length_test.py | extenteten/dynamic_length_test.py | import numpy as np
import tensorflow as tf
from .dynamic_length import *
def test_id_tree_to_root_width():
with tf.Session() as session, session.as_default():
id_tree = tf.constant([[[1], [2], [3], [0], [0]]])
assert id_tree_to_root_width(id_tree).eval() == np.array([3])
def test_id_sequence_to... | unlicense | Python | |
471d60f41a283e5a2b2fb4a364cde67150de8acd | Create pmcolor.py | TingPing/plugins,TingPing/plugins | HexChat/pmcolor.py | HexChat/pmcolor.py | __module_name__ = "PMColor"
__module_author__ = "TingPing"
__module_version__ = "1"
__module_description__ = "Color PM tabs like Hilights"
import xchat
def pm_cb(word, word_eol, userdata):
xchat.command('GUI COLOR 3')
return None
xchat.hook_print("Private Message to Dialog", pm_cb)
xchat.hook_print("Private Actio... | mit | Python | |
8b5c9a434b1d8ae8d46a34d45114bc9c71dac0ea | Create install for nginx | hatchery/genepool,hatchery/Genepool2 | genes/nginx/main.py | genes/nginx/main.py | from genes.apt import commands as apt
from genes.brew import commands as brew
from genes.debian.traits import is_debian
from genes.mac.traits import is_osx
from genes.ubuntu.traits import is_ubuntu
def main():
if is_ubuntu() or is_debian():
apt.update()
apt.install('nginx')
elif is_osx():
... | mit | Python | |
e1a40e6a43915f8e8be2aa27387cd0d25f05ed67 | Create Multiplication_Of_2_Numbers.py | HarendraSingh22/Python-Guide-for-Beginners | Code/Multiplication_Of_2_Numbers.py | Code/Multiplication_Of_2_Numbers.py | a=input("Enter a number -->")
b=input("Enter a number -->")
print a*b
| mit | Python | |
2059aa7776a8e0c947b68e9401d74bdd146a59cd | Test passed for week day | sitdh/com-prog | ch03_04.py | ch03_04.py | (day, month, year) = input().split()
day = int(day); month = int(month); year = int(year)
if month < 3:
month += 12
year -= 1
c = year / 100
k = year % 100
week_day = int( day + (26 * (month + 1) / 10) + k + ( k / 4 ) + ( c / 4 ) + ( 5 * c ) ) % 7
week_day_name = ''
# 1. Follow from flowchart
if 0 == week_... | mit | Python | |
bda7ef0f449c40d572cc4fe40aaaa2f60996bde5 | add spider for solitaireonline.com | simonsdave/gaming-spiders,simonsdave/gaming_spiders,simonsdave/gaming-spiders,simonsdave/gaming-spiders,simonsdave/gaming_spiders | gaming_spiders/solitaireonline.py | gaming_spiders/solitaireonline.py | #!/usr/bin/env python
import json
from cloudfeaster import spider
from zygomatic import ZygomaticSpider
class SolitaireOnlineSpider(ZygomaticSpider):
@classmethod
def get_metadata(cls):
return {
"url": "http://www.solitaireonline.com/?sort=mostPlayed",
}
if __name__ == "__mai... | mit | Python | |
868293aee14d6216c69446dc367491b25469f6e8 | add import_question_metadata to import display_text and key for questions from csv file | klpdotorg/dubdubdub,klpdotorg/dubdubdub,klpdotorg/dubdubdub,klpdotorg/dubdubdub | apps/stories/management/commands/import_question_metadata.py | apps/stories/management/commands/import_question_metadata.py | from django.core.management.base import BaseCommand
import csv
from stories.models import Question, Questiongroup, QuestiongroupQuestions
class Command(BaseCommand):
args = "filename to import from"
help = """Import Key and Display Text metadata for questions
python manage.py import_question_me... | mit | Python | |
9f1dfbf4bf36c0e3ef991a66c5a68b2674223b19 | Add a constant decoractor | iluxonchik/lyricist | const.py | const.py | def constant(func):
""" Decorator used to emulate constant values """
def fset(self, value):
raise TypeError("Cannot modify the value of a constant.")
def fget(self):
return func()
return property(fget, fset) | mit | Python | |
2ee04a1b668501eb41ce4b08e6c92ffe4f57d861 | Build dependencies were borken because something sorts 1.0.1-XX and 1.0-YY wrong | quixey/python-aliyun,easemob/python-aliyun | aliyun/__init__.py | aliyun/__init__.py | """
Aliyun API
==========
The Aliyun API is well-documented at `dev.aliyun.com <http://dev.aliyun.com/thread.php?spm=0.0.0.0.MqTmNj&fid=8>`_.
Each service's API is very similar: There are regions, actions, and each action has many parameters.
It is an OAuth2 API, so you need to have an ID and a secret. You can get the... | """
Aliyun API
==========
The Aliyun API is well-documented at `dev.aliyun.com <http://dev.aliyun.com/thread.php?spm=0.0.0.0.MqTmNj&fid=8>`_.
Each service's API is very similar: There are regions, actions, and each action has many parameters.
It is an OAuth2 API, so you need to have an ID and a secret. You can get the... | apache-2.0 | Python |
c480982a09f354a05c5e5ff0dc8a7c93f13f3970 | add config for quakenet script | PaulSalden/vorobot | config/quakenet.py | config/quakenet.py | settings = {
"authname": "authname",
"password": "authpw",
"channels": "#pwnagedeluxe"
} | mit | Python | |
6b0721b6aeda6d3ec6f5d31be7c741bc7fcc4635 | bump release for 18.0.1 development | zeroSteiner/boltons | setup.py | setup.py | """Functionality that should be in the standard library. Like
builtins, but Boltons.
Otherwise known as, "everyone's util.py," but cleaned up and
tested.
Contains over 160 BSD-licensed utility types and functions that can be
used as a package or independently. `Extensively documented on Read
the Docs <http://boltons.... | """Functionality that should be in the standard library. Like
builtins, but Boltons.
Otherwise known as, "everyone's util.py," but cleaned up and
tested.
Contains over 160 BSD-licensed utility types and functions that can be
used as a package or independently. `Extensively documented on Read
the Docs <http://boltons.... | bsd-3-clause | Python |
95d3306f2f7c492ea5f58c86b86165544273e6b9 | Create mp.py | Askars/bio_one_line_magic | mp.py | mp.py | import multiprocessing as mp
import time
THREADS=10
def f(x):
print("Starting...." + str(x))
time.sleep(5)
print("Finishing...."+ str(x))
processes = [None] * THREADS
print(processes)
def add_to_processes(args):
while True:
for idx, process in enumerate(processes):
if process is ... | unlicense | Python | |
934c4136c6415b76577d206739b352ad965210f0 | Create test_postures.py | mecax/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,mecax/pyrobotlab,MyRobotLab/pyrobotlab,sstocker46/pyrobotlab,sstocker46/pyrobotlab,sstocker46/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab | home/beetlejuice/test_postures.py | home/beetlejuice/test_postures.py | # Sweety's postures test
import random
Runtime.createAndStart("sweety", "Sweety")
sweety.arduino.setBoard("atmega2560")
sweety.connect("COM9")
sleep(1) # give a second to the arduino for connect
sweety.attach()
sweety.mouthState("smile")
sleep(1)
# set delays for led sync (delayTime, delayTimeStop, delayTimeLetter)
... | apache-2.0 | Python | |
89714cf01186e9aa5575fadf45c6c1fa70812871 | Create count.py | iwyos13/Robosys2 | count.py | count.py | #!/usr/bin/env python
import rospy
from std_msgs.msg import Int32
if __name__ == '__main__':
rospy.init_node('count')
pub = rospy.Publisher('count_up', Int32, queue_size=1)
rate = rospy.Rate(10)
n = 0
while not rospy.is_shutdown():
n += 1
pub.publ... | bsd-2-clause | Python | |
9f443a5af6537867712f12419d93a5b8c824858a | Add Notify-osd option for linux based systems | jacobmetrick/Flexget,ratoaq2/Flexget,thalamus/Flexget,X-dark/Flexget,patsissons/Flexget,asm0dey/Flexget,LynxyssCZ/Flexget,jawilson/Flexget,tobinjt/Flexget,poulpito/Flexget,sean797/Flexget,thalamus/Flexget,OmgOhnoes/Flexget,camon/Flexget,gazpachoking/Flexget,tsnoam/Flexget,v17al/Flexget,vfrc2/Flexget,drwyrm/Flexget,tsno... | flexget/plugins/output/notify_osd.py | flexget/plugins/output/notify_osd.py | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget.plugin import register_plugin, priority, DependencyError
from flexget.utils.template import RenderError, render_from_task
log = logging.getLogger('notify_osd')
class OutputNotifyOsd(object):
def validator(self):
... | mit | Python | |
77922e6527ad0e2c223983c59329dea127cd38ef | Create heuristic_test | frila/agente-minimax | models/players/heuristic_test.py | models/players/heuristic_test.py | from models.algorithm.minimax import Heuristic
from models.algorithm.minimax import Minimax
| apache-2.0 | Python | |
93b2d737407389a1c4dbc67836a949663eeba948 | Call the new presubmit checks from chrome/ code, with a blacklist. | junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,dushu1203/chromium.src,jaruba/chromium.src,Jo... | chrome/PRESUBMIT.py | chrome/PRESUBMIT.py | # Copyright (c) 2009 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.
"""Makes sure that the chrome/ code is cpplint clean."""
INCLUDE_CPP_FILES_ONLY = (
r'.*\.cc$', r'.*\.h$'
)
EXCLUDE = (
# Objective C confuses ever... | bsd-3-clause | Python | |
923786f0ee9e5128337997b6687374f74388c1c2 | add leetcode Find Minimum in Rotated Sorted Array | Fity/2code,Fity/2code,Fity/2code,Fity/2code,Fity/2code,Fity/2code | leetcode/FindMinimuminRotatedSortedArray/solution.py | leetcode/FindMinimuminRotatedSortedArray/solution.py | # -*- coding:utf-8 -*-
class Solution:
# @param num, a list of integer
# @return an integer
def findMin(self, num):
l = 0
h = len(num) - 1
while l < h:
mid = (l + h) // 2
if num[l] > num[mid]:
h = mid
elif num[h] < num[mid]:
... | mit | Python | |
227e38318e41b3c11ee818fdb08b273f527ba686 | add test_source_stream.pyc | longaccess/longaccess-client,longaccess/longaccess-client,longaccess/longaccess-client | lacli/t/test_source_stream.py | lacli/t/test_source_stream.py | import os
from testtools import TestCase
from lacli.decorators import coroutine
class StreamSourceTest(TestCase):
def setUp(self):
super(StreamSourceTest, self).setUp()
self.home = os.path.join('t', 'data', 'home')
self.testfile = os.path.join('t', 'data', 'longaccess-74-5N93.html')
d... | apache-2.0 | Python | |
f8c7a80fc8500d53cacef904c4a7caea88263465 | Add 20150608 question. | fantuanmianshi/Daily,fantuanmianshi/Daily | LeetCode/gas_station.py | LeetCode/gas_station.py |
class Solution:
# @param {integer[]} gas
# @param {integer[]} cost
# @return {integer}
def canCompleteCircuit(self, gas, cost):
diff = []
i = 0
while i < len(gas):
diff.append(gas[i] - cost[i])
i += 1
leftGas, sumCost, start = 0, 0, 0
i =... | mit | Python | |
08e57c27c47437b46c557f4697dd32d00f27fd7f | Create whatIsYourName.py | AlexEaton1105/computerScience | whatIsYourName.py | whatIsYourName.py | a = 20
b = 130
c = a + b
print (c)
d = 100
e = 2
f = d / e
print (f)
g = 34
h = 47
i = 82
j= g + h + i
print (j)
name = input("What is your name? ")
print("hello, ", name)
| mit | Python | |
4f99ffbc3deb321ba3ff76b23bacb889b11e1f4d | add to index solved | xala3pa/Computer-Science-cs101 | Lesson4/add_to_index.py | Lesson4/add_to_index.py | # Define a procedure, add_to_index,
# that takes 3 inputs:
# - an index: [[<keyword>,[<url>,...]],...]
# - a keyword: String
# - a url: String
# If the keyword is already
# in the index, add the url
# to the list of urls associated
# with that keyword.
# If the keyword is not in the index,
# add an entry to the inde... | mit | Python | |
d824d2fc32774ce51e4f36d702a2a6cc131db558 | add migration file to automatically parse citations | sloria/osf.io,mfraezz/osf.io,leb2dg/osf.io,adlius/osf.io,crcresearch/osf.io,HalcyonChimera/osf.io,erinspace/osf.io,caseyrollins/osf.io,Johnetordoff/osf.io,icereval/osf.io,TomBaxter/osf.io,leb2dg/osf.io,adlius/osf.io,chennan47/osf.io,Johnetordoff/osf.io,saradbowman/osf.io,Johnetordoff/osf.io,CenterForOpenScience/osf.io,... | osf/migrations/0074_parse_citation_styles.py | osf/migrations/0074_parse_citation_styles.py | # This migration port `scripts/parse_citation_styles` to automatically parse citation styles.
# Additionally, this set the corresponding `has_bibliography` field to `False` for all citation formats whose CSL files do not
# include a bibliography section. As a result, all such citation formats would not show up in OSF
#... | apache-2.0 | Python | |
9f46cf4836ad555a54dc9c47b8b2843643a878f2 | Create migration for draft dos1 briefs to dos2 | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | migrations/versions/840_migrate_draft_dos1_briefs_to_draft_dos2.py | migrations/versions/840_migrate_draft_dos1_briefs_to_draft_dos2.py | """Migrate draft DOS1 briefs to draft DOS2 briefs
Revision ID: 840
Revises: 830
Create Date: 2017-02-07 15:31:50.715832
"""
# revision identifiers, used by Alembic.
revision = '840'
down_revision = '830'
from alembic import op
def upgrade():
# Change framework of draft DOS1 briefs from DOS1 (framework_id == 5)... | mit | Python | |
4a3d56589cbf4e94618795d3f1bc09fa0f59e5ca | Add "ROV_SRS_Library.py" file containing functions for main script. | Spongeneers/rov-srs-control | ROV_SRS_Library.py | ROV_SRS_Library.py | # ROV_SRS_Library
#
#
# Overview: A collection of helper functions used by the BeagleBone
# to control the ROV SRS Actuators.
#
# Authors: Jonathan Lee (2015)
#
import Adafruit_BBIO.GPIO as GPIO
import Adafruit_BBIO.PWM as PWM
def calc_pulse_width(pin_name):
"""Calculates the pulse width of a PWM signal input.
St... | bsd-3-clause | Python | |
0a45c8f0632f3e8ca5502b9e4fdbaef410b07c71 | rename settings.py | Masakichi/books | config.py | config.py | # -*- coding: utf-8 -*-
from flask import Flask
app = Flask(__name__)
| mit | Python | |
1d35451387f9cab55df12f28e71824b2dbe37153 | add back after exposing my key | meg2208/automash | config.py | config.py | ECHO_NEST_API_KEY = "INSERT ECHO NEST API KEY HERE" | mit | Python | |
88a1f41c99320117bedb9d9922f3737fa820768a | fix import in config | nerk/BookPlayer,grvrulz/BookPlayer | config.py | config.py |
#!/usr/bin/env python
# encoding: utf-8
"""
config.py
Application configurations
db_file : the SQLite file used to store the progress
serial : settings for the serial port that the RFID reader connects to
mpd_conn : the connection details for the MPD client
gpio_pins : the ids of the GPIO input pins and their callb... |
#!/usr/bin/env python
# encoding: utf-8
"""
config.py
Application configurations
db_file : the SQLite file used to store the progress
serial : settings for the serial port that the RFID reader connects to
mpd_conn : the connection details for the MPD client
gpio_pins : the ids of the GPIO input pins and their callb... | mit | Python |
a335c9dbaa2da6dc429c9e280c6a6786422f0809 | Add code that generates byte encodings for various x86-32 instructions, with holes for constant operands | mseaborn/x86-decoder,mseaborn/x86-decoder | encoder.py | encoder.py |
import re
import subprocess
def write_file(filename, data):
fh = open(filename, "w")
try:
fh.write(data)
finally:
fh.close()
def Encode(instr):
write_file('tmp.S', instr + '\n')
subprocess.check_call(['as', '--32', 'tmp.S', '-o', 'tmp.o'])
proc = subprocess.Popen(['objdump', '-d', 'tmp.o'],
... | bsd-3-clause | Python | |
ffca5ea26c02170cc5edf6eea25ec9ef2c0c72bf | Disable trix serializer tests with Jython | ssssam/rdflib,armandobs14/rdflib,RDFLib/rdflib,marma/rdflib,marma/rdflib,yingerj/rdflib,RDFLib/rdflib,dbs/rdflib,RDFLib/rdflib,armandobs14/rdflib,marma/rdflib,armandobs14/rdflib,avorio/rdflib,yingerj/rdflib,ssssam/rdflib,ssssam/rdflib,ssssam/rdflib,avorio/rdflib,dbs/rdflib,yingerj/rdflib,avorio/rdflib,yingerj/rdflib,RD... | test/test_trix_serialize.py | test/test_trix_serialize.py | #!/usr/bin/env python
import unittest
from rdflib.graph import ConjunctiveGraph
from rdflib.term import URIRef, Literal
from rdflib.graph import Graph
try:
from io import BytesIO
except ImportError:
from StringIO import StringIO as BytesIO
class TestTrixSerialize(unittest.TestCase):
def setUp(self):
... | #!/usr/bin/env python
import unittest
from rdflib.graph import ConjunctiveGraph
from rdflib.term import URIRef, Literal
from rdflib.graph import Graph
try:
from io import BytesIO
except ImportError:
from StringIO import StringIO as BytesIO
class TestTrixSerialize(unittest.TestCase):
def setUp(self):
... | bsd-3-clause | Python |
ba6dc4269f96903f863748a779521d2bd8803d4f | Create Process.py | MariusWirtz/TM1py,OLAPLINE/TM1py | Samples/Process.py | Samples/Process.py | __author__ = 'Marius'
from TM1py import TM1Queries, Process
import uuid
import unittest
class TestAnnotationMethods(unittest.TestCase):
q = TM1Queries(ip='', port=8008, user='admin', password='apple', ssl=True)
random_string = str(uuid.uuid4()).replace('-', '_')
p_none = Process(name='unittest_none_' + r... | mit | Python | |
f26bdfa1ff0a388fb7bd2d473cf7b4b03fa61f6d | add unit test | DOAJ/doaj,DOAJ/doaj,DOAJ/doaj,DOAJ/doaj | doajtest/unit/event_consumers/test_application_publisher_revision_notify.py | doajtest/unit/event_consumers/test_application_publisher_revision_notify.py | from portality import models
from portality import constants
from portality.bll import exceptions
from doajtest.helpers import DoajTestCase
from doajtest.fixtures import ApplicationFixtureFactory
import time
from portality.events.consumers.application_publisher_revision_notify import ApplicationPublisherRevisionNotify... | apache-2.0 | Python | |
d24e8c746359169058e9c0577c2f843695ca3b55 | Add 2 instance with EBS test. | citrix-openstack-build/heat,JioCloud/heat,dragorosson/heat,rh-s/heat,rickerc/heat_audit,noironetworks/heat,pshchelo/heat,jasondunsmore/heat,rh-s/heat,NeCTAR-RC/heat,cwolferh/heat-scratch,cryptickp/heat,miguelgrinberg/heat,varunarya10/heat,pratikmallya/heat,takeshineshiro/heat,ntt-sic/heat,pratikmallya/heat,redhat-opens... | heat/tests/functional/test_WordPress_2_Instances_With_EBS.py | heat/tests/functional/test_WordPress_2_Instances_With_EBS.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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 applicabl... | apache-2.0 | Python | |
24c5248d578774d13d69b001fad8f50e2eac192a | Add tracepoint_variable_sized_types.py | iovisor/bpftrace,iovisor/bpftrace,iovisor/bpftrace,iovisor/bpftrace | scripts/tracepoint_variable_sized_types.py | scripts/tracepoint_variable_sized_types.py | # This script lists all the types in the kernel's tracepoint format files
# which appear with more than one size. This script's output should be
# compared to the code in TracepointFormatParser::adjust_integer_types()
import glob
field_types = {}
for format_file in glob.iglob("/sys/kernel/debug/tracing/events/*/*/fo... | apache-2.0 | Python | |
15cf70107d999c673a6bd6a4e026f04396ceb5f3 | create basic and compatability test for nixio_fr | samuelgarcia/python-neo,JuliaSprenger/python-neo,NeuralEnsemble/python-neo,apdavison/python-neo,rgerkin/python-neo,INM-6/python-neo | neo/test/iotest/test_nixio_fr.py | neo/test/iotest/test_nixio_fr.py | import numpy as np
import unittest
from neo.io.nixio_fr import NixIO as NixIOfr
import quantities as pq
from neo.io.nixio import NixIO
class TestNixfr(unittest.TestCase):
files_to_test = ['nixio_fr.nix']
def setUp(self):
self.testfilename = 'nixio_fr.nix'
self.reader_fr = NixIOfr(filename=se... | bsd-3-clause | Python | |
673dac79cbab6de0be5650d46840a3bc9858b2b4 | Add a help script to clear the test bucket | glasslion/django-qiniu-storage,jeffrey4l/django-qiniu-storage,Mark-Shine/django-qiniu-storage,jackeyGao/django-qiniu-storage | tests/clear_qiniu_bucket.py | tests/clear_qiniu_bucket.py | import os
from qiniu import Auth, BucketManager
QINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY')
QINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_KEY')
QINIU_BUCKET_NAME = os.environ.get('QINIU_BUCKET_NAME')
QINIU_BUCKET_DOMAIN = os.environ.get('QINIU_BUCKET_DOMAIN')
def main():
auth = Auth(QINIU_ACCESS_KEY... | mit | Python | |
da7deee98bb8d6a92d2ab1b8ad5c3e550a24fc83 | add `Config` class tests | pine/opoona | tests/config/test_config.py | tests/config/test_config.py | # -*- coding: utf-8 -*-
import os
import tempfile
import unittest
from mock import patch
from opoona.config import Config
class TestInvalidSyntaxException(unittest.TestCase):
@patch('os.path.expanduser')
def test_init(self, expanduser):
expanduser.return_value = 'HOME/.opoona.yaml'
config = ... | mit | Python | |
ae92573d2c86fa1e83b636c17c443cc8f97f4040 | Add unittest for ElementaryLine. | PytLab/catplot | tests/elementary_line_test.py | tests/elementary_line_test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Test case for ElementaryLine.
"""
import unittest
from catplot.ep_components.ep_lines import ElementaryLine
class ElementaryLineTest(unittest.TestCase):
def setUp(self):
self.maxDiff = True
def test_construction_and_query(self):
""" Test w... | mit | Python | |
666d9c467806782827edac4b2c0c13d494e41250 | Add a test for the status server | adamnew123456/jobmon | jobmon/test/test_status_server.py | jobmon/test/test_status_server.py | import os
import select
import socket
import time
import unittest
from jobmon.protocol import *
from jobmon import protocol, status_server, transport
PORT = 9999
class StatusRecorder:
def __init__(self):
self.records = []
def process_start(self, job):
self.records.append(('started', job))
... | bsd-2-clause | Python | |
09ea74a9b3b3f518c67f719c3525b14058b528af | add files | shwnbrgln/metes-and-bounds | declination.py | declination.py | # -*- coding: utf-8 -*-
"""
Created on Sun Jul 20 21:11:52 2014
@author: SB
###############################################################################
This function gets the declination using webservices hosted
by the National Oceanic and Atmospheric Administration (NOAA)
Declination is a function... | mit | Python | |
27bfb211b4f10a6a61e53b613b9074e90f417321 | create BST.py | ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs... | BST.py | BST.py | class BinaryNode:
def __init__(self ):
self.data = None
self.left = None
self.right = None
self.parent = None
class Binarytree:
def __init__(self,data=None):
self.root = BinaryNode()
self.root.data = data
def search(self,k):
return self.searchtree(se... | cc0-1.0 | Python | |
1a9f379ed121945a79eff5c2fdd468c98f0381d7 | add Jeu.py | SUPINFOLaboDev/TheSnake | Jeu.py | Jeu.py | import pygame
import sys
from pygame.locals import *
class Jeu:
def Jeu(self):
self.__score = 0
print('Jeu creer')
def augmenter_Score(self):
return 0
def recup_score(self):
return 0
def score(self):
return 0
def tableau_jeu(self):
return 0
... | mit | Python | |
63d7639f6c0e470575820be2b51444f34aa4bf2d | add flask app | Nuve17/Meruem | app.py | app.py | import jinja2
from flask import Flask, jsonify, make_response
from pdf_getter import main
app = Flask(__name__)
@app.route('/planning', methods=['GET'])
def get_planning():
pdf_filename = main()
if pdf_filename:
binary_pdf = open("./planning.pdf", "rb")
binary_pdf = binary_pdf.read()
... | apache-2.0 | Python | |
ec78a2b7551838ab05dce6c2c93c8c42b76fc850 | Add utility functions (1) | quqixun/BrainTumorClassification,quqixun/BrainTumorClassification | src/btc_utilities.py | src/btc_utilities.py | # Brain Tumor Classification
# Script for Utility Functions
# Author: Qixun Qu
# Create on: 2017/10/11
# Modify on: 2017/10/11
# ,,, ,,,
# ;" '; ;' ",
# ; @.ss$$$$$$s.@ ;
# `s$$$$$$$$$$$$$$$'
# $$$$$$$$$$$$$$$$$$
# $$$$P""Y$$$Y""W$$$$$
# $$$$ p"$$$"q $$$$$
# $$$$ .$$$$$. $$$$'
# ... | mit | Python | |
1d8ff137f4792121bdf0cb52f719dbd5966dc87b | Add missing cct.py | progers/cctdb,progers/cctdb | cct.py | cct.py | # cct.py - calling context tree
#
# A Calling Context Tree (CCT) has a single root which contains multiple calls to Functions which
# can themselves have other calls.
from collections import defaultdict
import json
class Function(object):
def __init__(self, name):
self.calls = []
self.name = name... | apache-2.0 | Python | |
800df7bcaa57e0935c0836f1f49de6407c55c212 | add tests for clock exercise | mcdickenson/python-washu-2014 | day2/clock_test.py | day2/clock_test.py | import unittest
import clock
class ClockTest(unittest.TestCase):
def test_on_the_hour(self):
self.assertEqual("08:00", Clock.at(8).__str__() )
self.assertEqual("09:00", Clock.at(9).__str__() )
def test_past_the_hour(self):
self.assertEqual("11:09", Clock.at(11, 9).__str__() )
def test_add_a_few_mi... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.