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
3aa898bd9b97a446eb547e3eaedc9894ff3b2428
Create got1.py
abhinavk/hackerRank,abhinavk/hackerRank
euler/got1.py
euler/got1.py
# Game of thrones got = input() occ_table = {} for i in got: if i not in occ_table: occ_table[i]=1 else: occ_table[i]+=1 unpaired_chars=0 for i in occ_table.keys(): if occ_table[i]%2 is 1: unpaired_chars+=1 if unpaired_chars > 1: print('NO') else: print('YES')
mit
Python
7303129af58af071ee8fb78303704ec3fc221153
Add missing migration.
City-of-Helsinki/smbackend,City-of-Helsinki/smbackend
services/migrations/0008_auto_20161106_1125.py
services/migrations/0008_auto_20161106_1125.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('services', '0007_auto_20160815_1415'), ] operations = [ migrations.AlterField( model_name='unit', na...
agpl-3.0
Python
8e2a4cab394493558cdce933a9cfbbb8b5734622
add test_sql.py module
DGrady/pandas,toobaz/pandas,cbertinato/pandas,cython-testbed/pandas,linebp/pandas,jorisvandenbossche/pandas,gfyoung/pandas,TomAugspurger/pandas,kdebrab/pandas,gfyoung/pandas,linebp/pandas,DGrady/pandas,zfrenchee/pandas,cython-testbed/pandas,GuessWhoSamFoo/pandas,linebp/pandas,jorisvandenbossche/pandas,MJuddBooth/pandas...
pandas/io/tests/test_sql.py
pandas/io/tests/test_sql.py
from cStringIO import StringIO import unittest import sqlite3 import sys import pandas.io.sql as sql import pandas.util.testing as tm class TestSQLite(unittest.TestCase): def setUp(self): self.db = sqlite3.connect(':memory:') def test_basic(self): frame = tm.makeTimeDataFrame() self....
bsd-3-clause
Python
71cd470f727c61330d22fda8b9a9f94e47b6353f
Add a unit test for the logistic module.
eliteraspberries/avena
avena/tests/test-logistic.py
avena/tests/test-logistic.py
#!/usr/bin/env python from numpy import all, array, random from .. import logistic def test_logistic(): x = random.random_sample(100) x *= 10.0 x -= 5.0 for k in [1.0, 2.0, 5.0, 10.0]: y = logistic._logistic(k, x) assert all(y >= 0.0) and all(y <= 1.0) if __name__ == '__main__': ...
isc
Python
ccb140d5bbebcafb355fb4d62f0e3b0f9d48a910
add missing file
uber/tchannel-python,uber/tchannel-python,Willyham/tchannel-python,Willyham/tchannel-python
tchannel/enum.py
tchannel/enum.py
# Copyright (c) 2015 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
mit
Python
9bd40abfba2b5ba3456cf14777378a077e980840
Add sendmail backend
jluttine/leffalippu.fi,jluttine/leffalippu.fi
leffalippu/sendmail.py
leffalippu/sendmail.py
"""sendmail email backend class.""" import threading from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend from subprocess import Popen,PIPE class EmailBackend(BaseEmailBackend): def __init__(self, fail_silently=False, **kwargs): super(EmailBackend, self).__init__(f...
agpl-3.0
Python
bbc9baba5f34cc29582378c433bd16588c07e85d
add new example
pignacio/python-nvd3,BibMartin/python-nvd3,mgx2/python-nvd3,liang42hao/python-nvd3,Coxious/python-nvd3,BibMartin/python-nvd3,mgx2/python-nvd3,liang42hao/python-nvd3,yelster/python-nvd3,pignacio/python-nvd3,vdloo/python-nvd3,pignacio/python-nvd3,vdloo/python-nvd3,oz123/python-nvd3,yelster/python-nvd3,oz123/python-nvd3,m...
examples01.py
examples01.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Examples for Python-nvd3 is a Python wrapper for NVD3 graph library. NVD3 is an attempt to build re-usable charts and chart components for d3.js without taking away the power that d3.js gives you. Project location : https://github.com/areski/python-nvd3 """ import nvd3 ...
mit
Python
24cf12a47c95883fc431d4ee295bbe763a107c93
Drop dates and comments from Czech templates.
eggpi/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt,guilherme-pg/citationhunt
snippet_parser/cs.py
snippet_parser/cs.py
from base import * class SnippetParser(SnippetParserBase): def strip_template(self, template, normalize, collapse): if self.is_citation_needed(template): # These templates often contain other information # (date/justification), so we drop it all here return CITATION_NEED...
mit
Python
b5935ab11f326395bd8128243b1d096f8ea429f4
Create solution.py
lilsweetcaligula/Online-Judges,lilsweetcaligula/Online-Judges,lilsweetcaligula/Online-Judges
leetcode/easy/intersection_of_two_arrays/py/solution.py
leetcode/easy/intersection_of_two_arrays/py/solution.py
# # Python provides for an elegant solution of the intersection problem. # We simply convert both arrays to sets, thus eliminating any duplicates # in the process, and then call the set.intersection method to have the # highly optimized library do the job for us. Mission accomplished. # class Solution(object): def...
mit
Python
2d9082329f27f67c48d5abf69ca6f52a4b7b1bfa
Add tests for function data source.
tommy-u/chaco,tommy-u/chaco,tommy-u/chaco
chaco/tests/function_data_source_test_case.py
chaco/tests/function_data_source_test_case.py
""" Test of basic dataseries behavior. """ import unittest2 as unittest from numpy import array, linspace, nan, ones from numpy.testing import assert_array_equal import numpy as np from chaco.api import DataRange1D from chaco.function_data_source import FunctionDataSource from traits.testing.unittest_tools import Un...
bsd-3-clause
Python
0f9bbffabaec2a68eaad1f69097d0a5aa5a30aca
Create spaceshooterggame.py
phstearns/ggame-tutorials
spaceshooterggame.py
spaceshooterggame.py
""" spaceshooterggame.py Author: <your name here> Credit: <list sources used, if any> Assignment: Write and submit a program that implements the spacewar game: https://github.com/HHS-IntroProgramming/Spacewar """ from ggame import App, RectangleAsset, ImageAsset, Sprite, LineStyle, Color, Frame SCREEN_WIDTH = 640 SCR...
mit
Python
4c05d0c4cb45b59c2ed8a5cb6d15bf69ac33e653
Create outbound_mp3_call.py
lucyzee/plivo_apps,lucyzee/plivo_apps
outbound_mp3_call.py
outbound_mp3_call.py
from flask import Flask, request, make_response import plivo, plivoxml app = Flask(__name__) @app.route('/play/', methods=['GET','POST']) def play_xml(): # Generate a Play XML with the details of audio file to play during the call body = "https://s3.amazonaws.com/plivocloud/Trumpet.mp3" r = plivoxml.Res...
mit
Python
d3ff5c8966ebfe80e198619dcb43f462436019c8
Add files via upload
bzhou26/leetcode_sol,bzhou26/leetcode_sol
p31_Next_permutation.py
p31_Next_permutation.py
''' - Leetcode problem: 31 - Difficulty: Medium - Brief problem description: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascendi...
mit
Python
08bc0c9ddb4667df8cf13dbcafd285ad7e6d6fe2
Add the init method to the vote model.
yiyangyi/cc98-tornado
model/vote.py
model/vote.py
class VoteModel(Query): def __init__(self): self.db = db self.table_name = "vote" super(VoteModel, self).__init__()
mit
Python
6ff447d5417c506748d96be01a2db1a54cfd3792
add urls file to money app.
zee93/PocketControl,zee93/PocketControl,zee93/PocketControl,zee93/PocketControl
money/urls.py
money/urls.py
from django.conf.urls import url from .views import LatestExpensesListView urlpatterns = [ url(r'^latest_expenses/$', LatestExpensesListView.as_view(), name='users_logout'), ]
mit
Python
607946b45cb9064e75e0483b71f1c20f4cfc2f48
Create Dataset.py
aamcgdsa21/GDSA,aamcgdsa21/GDSA
Descriptor/modules/Dataset.py
Descriptor/modules/Dataset.py
import os class Dataset: """ This class load or creates a text file with all the file rootnames contained in a directory. This is useful for large datasets when the listing operation can be slow. I also allows manually modifying a larger list to work with a reduced amount of data """ def _...
mit
Python
3314f7e0af0e4a19ecc2e764a44ff3d5c4cd2906
Update __init__.py
Tendrl/node-agent,Tendrl/node_agent,r0h4n/node-agent,Tendrl/node-agent,Tendrl/node_agent,r0h4n/node-agent,r0h4n/node-agent,Tendrl/node-agent
tendrl/node_agent/objects/compiled_definition/__init__.py
tendrl/node_agent/objects/compiled_definition/__init__.py
from ruamel import yaml from tendrl.commons import etcdobj from tendrl.commons import objects # Definitions need there own special init and have to be present in the NS # before anything else, Hence subclassing BaseObject from tendrl.node_agent.objects.compiled_definition import definitions class CompiledDefinitions...
from ruamel import yaml from tendrl.commons import etcdobj from tendrl.commons import objects # Definitions need there own special init and have to be present in the NS # before anything else, Hence subclassing BaseObject from tendrl.node_agent.objects.compiled_definition import definitions class CompiledDefinitions...
lgpl-2.1
Python
b9fbe184c005de283ab5f4222931bf82dde9682c
Create gandi-ddns.py
matt1/gandi-ddns
gandi-ddns.py
gandi-ddns.py
import xmlrpclib import urllib2 import sys # gandi.net API (Production) key apikey = '<CHANGE ME>' # Domain domain = '<CHANGE ME>' # A-record name a_name = '@' # TTL (seconds = 5 mintes to 30 days) ttl = 900 # Production API api = xmlrpclib.ServerProxy('https://rpc.gandi.net/xmlrpc/', verbose=False) # Used to cache th...
mit
Python
26b505b245889a84379170ecc2cf05c90cb8b1b4
fix test case typo
zstackio/zstack-woodpecker,quarkonics/zstack-woodpecker,quarkonics/zstack-woodpecker,zstackorg/zstack-woodpecker,zstackorg/zstack-woodpecker,zstackorg/zstack-woodpecker,zstackio/zstack-woodpecker,zstackio/zstack-woodpecker
integrationtest/vm/virt_plus/test_expunge_vm2.py
integrationtest/vm/virt_plus/test_expunge_vm2.py
''' New Integration Test for expunging KVM VM. @author: Youyk ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_state as test_state import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.operations.resource_operations as res_ops import zstackwoodpecker.zstack_te...
''' New Integration Test for expunging KVM VM. @author: Youyk ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_state as test_state import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.operations.resource_operations as res_ops import zstackwoodpecker.zstack_te...
apache-2.0
Python
81da55d285f19bedf20a2dc2cb88165a5c895e27
Create padJewelHeraEth.py
Adolfoi/padmitmproxyscript
padJewelHeraEth.py
padJewelHeraEth.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, re, json import cStringIO import gzip, zlib def response(context, flow): gfile = gzip.GzipFile(fileobj=cStringIO.StringIO(flow.response.content)) if 'sneak_dungeon&' in flow.request.path: data = json.loads(gfile.read()) if data['res'] == 0: ...
mit
Python
5dcdda38a992ca9e255d1fb519611f7e342c3772
add migration
clone1612/appstore,clone1612/appstore,nextcloud/appstore,nextcloud/appstore,clone1612/appstore,nextcloud/appstore,clone1612/appstore,clone1612/appstore,nextcloud/appstore,nextcloud/appstore,nextcloud/appstore
nextcloudappstore/core/migrations/0005_auto_20160718_2039.py
nextcloudappstore/core/migrations/0005_auto_20160718_2039.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-07-18 20:39 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core', '0004_auto_20160705_2119'), ] operations = [ migrations.AlterModelOptions( ...
agpl-3.0
Python
682f942799c15acadea1a707261ed606b4c1e245
Add migrations for new fields.
winfieldco/django-mail-queue,styrmis/django-mail-queue,Goury/django-mail-queue,dstegelman/django-mail-queue,dstegelman/django-mail-queue,Goury/django-mail-queue
mailqueue/migrations/0003_auto__add_field_mailermessage_bcc_address__add_field_mailermessage_las.py
mailqueue/migrations/0003_auto__add_field_mailermessage_bcc_address__add_field_mailermessage_las.py
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'MailerMessage.bcc_address' db.add_column('mailqueue_mailermessage', 'bcc_address', ...
mit
Python
691b2ad71cdc44d40a0428fcb851ca1e56bc510f
Add a new script to parse image shas for new tags.
kubernetes/dns,kubernetes/dns,kubernetes/dns
parse-image-sha.py
parse-image-sha.py
#!/usr/bin/env python # Copyright 2021 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
Python
796454e6408ecd2e0b7321bfd066638c7b5ad4a5
Add exercise 2.2 (python)
perryleo/sicp,perryleo/sicp,perryleo/sicp
chapter_02/python/sicpc2e02.py
chapter_02/python/sicpc2e02.py
## The solution of exercise 2.2 ## Consider the problem of representing line segments in a plane. Each ## segment is represented as a pair of points: a starting point and an ## ending point. Define a constructor `make-segment` and selectors `start- ## segment` and `end-segment` that define the representation of segment...
mit
Python
4e3328722f167dd0165ad24dcd2a709bb248784f
Add a sample to show how to filter Events for a VM for relocate
pathcl/pyvmomi-community-samples,prziborowski/pyvmomi-community-samples,vmware/pyvmomi-community-samples,jm66/pyvmomi-community-samples,ddcrjlalumiere/pyvmomi-community-samples
samples/relocate_events.py
samples/relocate_events.py
#!/usr/bin/env python """ Written by Nathan Prziborowski Github: https://github.com/prziborowski This code is released under the terms of the Apache 2 http://www.apache.org/licenses/LICENSE-2.0.html Simple example for getting the vMotion/relocate events of a VM. There are additional filters for time that I didn't inc...
apache-2.0
Python
a2b41893d8e8bd82e53727bf2c6a69dac627b9f7
add sensehat support (based on #31) - still untested
wellenvogel/avnav,wellenvogel/avnav,wellenvogel/avnav,wellenvogel/avnav,wellenvogel/avnav,wellenvogel/avnav,wellenvogel/avnav,wellenvogel/avnav,wellenvogel/avnav
server/handler/sensehat.py
server/handler/sensehat.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ts=2 sw=2 et ai ############################################################################### # Copyright (c) 2012,2013-2017 Andreas Vogel andreas@wellenvogel.net # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software ...
mit
Python
2ab27ff2b26e469bec11856a61086562db8c01db
Create comunicacion_serial.py
alienneo666/Rob_Bat
Raspberry_py/comunicacion_serial.py
Raspberry_py/comunicacion_serial.py
#! /usr/bin/env python import serial import time arduino = serial.Serial('/dev/ttyUSB0', 115200) time.sleep(2) print("preparado...") print('enviando comandos....') arduino.write(b'SV0001400') time.sleep(1) arduino.write(b'SH1400000') time.sleep(1) arduino.write(b'SV0700700') time.sleep(1) arduino.write(b'SH1200000'...
mit
Python
358f94e58557f9c2cec21a2ec8fb55cb8def0e34
Add pyplot script for plotting prior miss timeseries
eastlhu/losslessh264,erillfire/wusunyasuo,itplanes/losslessh264,xiangshuai/losslessh264,xiangshuai/losslessh264,noname007/losslessh264,TonySheh/losslessh264,common2015/losslessh264,krsjoseph/losslessh264,krsjoseph/losslessh264,sunfei/losslessh264,sunfei/losslessh264,aquar25/losslessh264,yurenyong123/losslessh264,lioonl...
plot_prior_misses.py
plot_prior_misses.py
# Run h264dec on a single file compiled with PRIOR_STATS and then run this script # Outputs timeseries plot at /tmp/misses.pdf import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages import os def temporal_misses(key): values = data[key] numbins = 100 binsize = len(values) // n...
bsd-2-clause
Python
53bb8366e3261f3f31b23c672be53923ac969aaa
Implement a basic markov chain command.
PcBoy111/PCBOT,pckv/pcbot,PcBoy111/PC-BOT-V2
plugins/summary.py
plugins/summary.py
""" Plugin for generating markov text, or a summary if you will. """ import re from collections import defaultdict import random import discord import asyncio import markovify from pcbot import utils, Annotate import plugins # The messages stored per session, where every key is a channel id stored_messages = defau...
mit
Python
71d11296e9e02ee4bdaec7c6b5da3c6b90ddca83
Write a quick script to fix None-columns in the dataset
nettrom/importance,nettrom/importance,nettrom/importance
python/fix-none.py
python/fix-none.py
#!/usr/env/python # -*- coding: utf-8 -*- ''' Script that fixes None-values in the art_is_redirect column in our importance dataset. Copyright (c) 2017 Morten Wang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal...
mit
Python
0e49ccade0f91c288f06205f81c3023aed313aa8
create the base module structure
ceph/remoto,alfredodeza/remoto
remoto/__init__.py
remoto/__init__.py
__version__ = '0.0.1'
mit
Python
f646c6f8391914a840b0e99babea49c204b588a1
Create __init__.py
andrewtong/ursa-enhanced
stringmatching/__init__.py
stringmatching/__init__.py
apache-2.0
Python
19ef0a19a04c0792117f56609b7e8f1abea2c835
add skeleton for function to pull data from prod api
unicef/polio,unicef/rhizome,SeedScientific/polio,unicef/polio,SeedScientific/polio,unicef/rhizome,SeedScientific/polio,unicef/rhizome,unicef/polio,SeedScientific/polio,unicef/polio,SeedScientific/polio,unicef/rhizome
bin/pull_prod_db_from_api.py
bin/pull_prod_db_from_api.py
#!/usr/cat /hom bin/python import sys import json import urllib2 import subprocess from time import sleep from urllib import urlencode from uuid import uuid4 class DBRefreshTask(object): def __init__(self): print '...initializing...' def main(self): print 'MAIN FUNCTION!' forms_to...
agpl-3.0
Python
2188fd8fad03ef23867a1ae5392b13a8c57e851b
Change the filename because the git_ignore file matchs it
telefonicaid/fiware-orion,guerrerocarlos/fiware-orion,guerrerocarlos/fiware-orion,guerrerocarlos/fiware-orion,Fiware/data.Orion,fiwareulpgcmirror/fiware-orion,Fiware/data.Orion,telefonicaid/fiware-orion,Fiware/data.Orion,McMutton/fiware-orion,jmcanterafonseca/fiware-orion,fortizc/fiware-orion,Fiware/context.Orion,McMut...
test/acceptance/integration/steps_lib/builds_payload.py
test/acceptance/integration/steps_lib/builds_payload.py
# -*- coding: utf-8 -*- """ # Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U # # This file is part of Orion Context Broker. # # Orion Context Broker is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public License as # published by the Free Software Foun...
agpl-3.0
Python
5e58945f78205776e35ca3d9874780359a865f92
Create mcoccalendars.py
monhustla/line-bot-sdk-python
mcoccalendars.py
mcoccalendars.py
# -*- coding: utf-8 -*- """calendar module.""" import cmd2 from linebot.models import ( MessageEvent, TextMessage, TextSendMessage, SourceUser, SourceGroup, SourceRoom, TemplateSendMessage, ConfirmTemplate, MessageTemplateAction, ButtonsTemplate, URITemplateAction, PostbackTemplateAction, Carouse...
apache-2.0
Python
1ac917ca792974f8f9bf51b5681bb8927dd92668
Create afXform.py
aaronfang/personal_scripts
scripts/afXform.py
scripts/afXform.py
# Store XFormation grpNma = cmds.ls(sl=True,type='transform')[0] grpTa = cmds.xform(grpNma,ws=1,piv=1,q=1) grpRa = cmds.xform(grpNma,ws=1,ro=1,q=1) # grpSa = cmds.xform(grpNma,ws=1,s=1,q=1) # xform grpNmb = cmds.ls(sl=True,type='transform')[0] cmds.xform(grpNmb,ws=1,t=(grpTa[0],grpTa[1],grpTa[2])) cmds.xform(grpNmb,r...
mit
Python
8c5de67f525acd440290f44639a9a3e685ba9854
add ebBinom
probml/pyprobml,probml/pyprobml,probml/pyprobml,probml/pyprobml
scripts/ebBinom.py
scripts/ebBinom.py
# -*- coding: utf-8 -*- """ Author: Ang Ming Liang Based on https://github.com/probml/pmtk3/blob/master/demos/ebBinom.m """ import numpy as np from scipy.stats import beta import matplotlib.pyplot as plt from scipy.special import digamma import pyprobml_utils as pml y = np.array([ 0, 0, 0, 0, 0, 0...
mit
Python
39ac2ead68276aca5fba4c35fa1bf7705bc34355
add another selenium test that uses the volvox data. this shares a lot of copied code with the other selenium test, this needs a refactor. will do that after after i get the tests to actually pass
GMOD/jbrowse,SuLab/jbrowse,igemsoftware/Shenzhen_BGIC_0101_2013,erasche/jbrowse,limeng12/jbrowse,GreggHelt2/apollo-test,nathandunn/jbrowse,SuLab/jbrowse,igemsoftware/Shenzhen_BGIC_0101_2013,erasche/jbrowse,nathandunn/jbrowse,Arabidopsis-Information-Portal/jbrowse,GMOD/jbrowse,erasche/jbrowse,GreggHelt2/apollo-test,Arab...
tests/selenium_tests/volvox_biodb_test.py
tests/selenium_tests/volvox_biodb_test.py
from selenium import webdriver from selenium.webdriver import ActionChains from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.keys import Keys from subprocess import check_call as call import os import time def test_volvox(): format_volvox() browser = webdriver.Firefox...
lgpl-2.1
Python
91d37572785bb3a336407fb085ba47ea281f6729
Add logging module based on tensorflow
J535D165/recordlinkage,J535D165/recordlinkage
recordlinkage/rl_logging.py
recordlinkage/rl_logging.py
"""Logging utilities.""" # Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
bsd-3-clause
Python
c4b72f98776feb22112a355d4720da34d3cff54a
Create Prereq.py
AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb
backend/Controllers/Prereq.py
backend/Controllers/Prereq.py
from Framework.Controller import Controller from Database.Controllers.Prereq import Prereq as BDPrereq from Models.Prereq.RespostaListar import RespostaListar class Prereq(Controller): def Listar(self,pedido_listar): return RespostaListar(BDPrereq().pegarPrereqs("WHERE id_disc_pre = %s AND ...
mit
Python
2264244a341a7d8e41fa1ad90cea1b9bd6880f99
Add Z-function algorithm implementation (#2067)
TheAlgorithms/Python
strings/z_function.py
strings/z_function.py
""" https://cp-algorithms.com/string/z-function.html Z-function or Z algorithm Efficient algorithm for pattern occurrence in a string Time Complexity: O(n) - where n is the length of the string """ def z_function(input_str: str) -> list: """ For the given string this function computes value for each index...
mit
Python
65365778fd40bddddab83e3593da9b88992824ef
Add tests for str.strip
xhat/micropython,noahchense/micropython,adafruit/circuitpython,mhoffma/micropython,firstval/micropython,deshipu/micropython,rubencabrera/micropython,SungEun-Steve-Kim/test-mp,Peetz0r/micropython-esp32,emfcamp/micropython,noahchense/micropython,turbinenreiter/micropython,mpalomer/micropython,dhylands/micropython,dhyland...
tests/basics/string_strip.py
tests/basics/string_strip.py
print("".strip()) print(" \t\n\r\v\f".strip()) print(" T E S T".strip()) print("abcabc".strip("ce")) print("aaa".strip("b")) print("abc efg ".strip("g a"))
mit
Python
06588147b5296e894cec2bd745b34c5865ab6426
add imap_check.py
mrtazz/bin,mrtazz/bin,mrtazz/bin
imap_check.py
imap_check.py
#!/usr/bin/env python """ small script to check for unread count on imap inbox, the printed output format is especially useful for the tmux status bar """ import imaplib import sys import netrc accounts = ("mail", "etsymail") results = [] hosts = netrc.netrc().hosts for account in accounts: # I'm using t...
mit
Python
b70a5245f2613bb2e08339298153a68a9b9093e2
add new package : libfastcommon (#14303)
iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/libfastcommon/package.py
var/spack/repos/builtin/packages/libfastcommon/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Libfastcommon(Package): """ Libfastcommon is a c common functions library extracted fr...
lgpl-2.1
Python
bcf7604414b94a35c265072a2a6c5a6ddb9138ca
Create helper_arg.py
jadnohra/hinges_py
helper_arg.py
helper_arg.py
import sys ################################################################################ # Helper Miscellaneous ################################################################################ if ( hasattr(sys, 'argv')): g_argv = sys.argv else: g_argv = [] g_arg_queried = {} g_arg_help_on = '-help' in g_a...
unlicense
Python
2a9cd65436ed569713a2540236342b98cc560c7f
Add a CalcLoadSequence method to standalone
benschmaus/catapult,benschmaus/catapult,catapult-project/catapult-csm,benschmaus/catapult,dstockwell/catapult,catapult-project/catapult,zeptonaut/catapult,SummerLW/Perf-Insight-Report,sahiljain/catapult,SummerLW/Perf-Insight-Report,0x90sled/catapult,sahiljain/catapult,modulexcite/catapult,danbeam/catapult,catapult-proj...
trace_viewer/build/generate_standalone_timeline_view.py
trace_viewer/build/generate_standalone_timeline_view.py
# Copyright (c) 2014 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. import base64 import optparse import sys import os import re import tvcm from trace_viewer import trace_viewer_project def _sopen(filename, mode): if ...
# Copyright (c) 2014 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. import base64 import optparse import sys import os import re import tvcm from trace_viewer import trace_viewer_project def _sopen(filename, mode): if ...
bsd-3-clause
Python
c32a9416ec706191ca996013086cdd6afb5b877b
add package py-tabulate (#3263)
lgarren/spack,EmreAtes/spack,EmreAtes/spack,skosukhin/spack,lgarren/spack,LLNL/spack,krafczyk/spack,tmerrick1/spack,matthiasdiener/spack,mfherbst/spack,skosukhin/spack,LLNL/spack,matthiasdiener/spack,TheTimmy/spack,EmreAtes/spack,lgarren/spack,TheTimmy/spack,skosukhin/spack,EmreAtes/spack,LLNL/spack,LLNL/spack,lgarren/...
var/spack/repos/builtin/packages/py-tabulate/package.py
var/spack/repos/builtin/packages/py-tabulate/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
0d8de102202f05b9180fc4573b3201469e182faa
Add smoketest for register_builtin_handlers
ericdill/databroker,ericdill/databroker
databroker/tests/test_handler_registration.py
databroker/tests/test_handler_registration.py
from databroker import handler_registration def test_register_builtin_handlers(): # smoketest! handler_registration.register_builtin_handlers()
bsd-3-clause
Python
54a96cd333c6036abbd825c39f1b90450b3291d9
Create FindMininRSA_001.py
Chasego/cod,cc13ny/algo,Chasego/codi,cc13ny/algo,Chasego/codirit,Chasego/codi,cc13ny/Allin,Chasego/cod,Chasego/cod,Chasego/codi,Chasego/codi,cc13ny/Allin,cc13ny/algo,cc13ny/Allin,Chasego/codirit,Chasego/cod,Chasego/codirit,cc13ny/algo,Chasego/codirit,Chasego/codi,cc13ny/Allin,Chasego/codirit,Chasego/cod,cc13ny/algo,cc1...
leetcode/153-Find-Minimum-in-Rotated-Sorted-Array/FindMininRSA_001.py
leetcode/153-Find-Minimum-in-Rotated-Sorted-Array/FindMininRSA_001.py
class Solution: # @param num, a list of integer # @return an integer def findMin(self, num): L = 0 R = len(num) - 1 while L < R and num[L] > num[R]: M = (L + R)/2 if num[L] > num[M]: R = M else: L =...
mit
Python
1b80b93859bde18b5fd6c85de2c1687f63c3fac2
Write example of algorithms using the wrapper.
jonancm/viennagrid-python,jonancm/viennagrid-python,jonancm/viennagrid-python
doc/examples/viennagrid_wrapper/algorithms.py
doc/examples/viennagrid_wrapper/algorithms.py
#!/usr/bin/env python # # This example shows how to use the different algorithms provided by # the low-level ViennaGrid wrapper for Python (viennagrid.wrapper). from __future__ import print_function # In this example, we will set up a domain of triangles in the cartesian 2D # space from the contents of a Netgen mesh...
mit
Python
3b0bddcfba39e4b25a460a92784d66b2e3d411b2
copy params, grads
Wanwannodao/DeepLearning
basic_sample/params_grads_sample.py
basic_sample/params_grads_sample.py
import multiprocessing as mp import numpy as np import chainer from chainer import functions as F from chainer import links as L # This sample spread params of master network to workers # and set gradients of master network to those of workers # meaningless dummy network class DummyNet(chainer.Chain): def __init_...
mit
Python
d2e4086d012dcc486c46728d6d5b108df33c5ae6
Add tests/__main__.py for running yappi on the test suite
tempbottle/pykka,jodal/pykka,tamland/pykka
tests/__main__.py
tests/__main__.py
import nose import yappi try: yappi.start() nose.main() finally: yappi.print_stats()
apache-2.0
Python
ae535222049b30f18ed4e6f423853ad9ccb74965
Create initial conftest.py for global fixtures
cichm/cookiecutter,willingc/cookiecutter,0k/cookiecutter,nhomar/cookiecutter,takeflight/cookiecutter,willingc/cookiecutter,hackebrot/cookiecutter,vincentbernat/cookiecutter,vincentbernat/cookiecutter,Springerle/cookiecutter,lgp171188/cookiecutter,venumech/cookiecutter,agconti/cookiecutter,jhermann/cookiecutter,agconti/...
tests/conftest.py
tests/conftest.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Contains pytest fixtures which are globally available throughout the suite. """ import pytest @pytest.fixture def foobar(): pass
bsd-3-clause
Python
cb19f0cf7559de55d3fbaf0f44bffca26351bcc5
Add tornado test
yukirin/skel_tornado,yukirin/skel_tornado,yukirin/skel_tornado,yukirin/skel_tornado
tests/test_app.py
tests/test_app.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from main import TornadoApp from tornado.testing import AsyncHTTPTestCase, gen_test class TornadoAppTest(AsyncHTTPTestCase): def get_app(self): return TornadoApp() @gen_test def test_app(self): response = yield self.http_client.fetch(self.get...
mit
Python
5e7866a897562b87f0c0ffa763c08f91c1aacccd
Add some basic CLI tests
khaledhosny/psautohint,khaledhosny/psautohint
tests/test_cli.py
tests/test_cli.py
from __future__ import print_function, division, absolute_import import glob from os.path import basename import py.path import pytest from psautohint.autohint import ACFontError from psautohint.__main__ import main as psautohint from . import DATA_DIR UFO_FONTS = glob.glob("%s/*/*/font.ufo" % DATA_DIR) OTF_FONTS ...
apache-2.0
Python
e77bb03ecb85bd90cd542eb5dddbda8c2af3df53
Add a wormhole object as a quick-hack to make risk connections work. (Pending tp04 being finished.)
thousandparsec/libtpproto-py,thousandparsec/libtpproto-py
tp/netlib/objects/ObjectExtra/Wormhole.py
tp/netlib/objects/ObjectExtra/Wormhole.py
from xstruct import pack from objects import Object class Wormhole(Object): """\ The Wormhole is a top level object that links to locations together. It was added as a quick hack to make the Risk ruleset a little easier to play. It has 3 int64 arguments which are the "other end" of the wormhole. """ subtype =...
lgpl-2.1
Python
0c2424ecbcf8848ea56efeb5b1353e5e9a04500e
add script to generate env file for docker on ci
wwu-numerik/scripts,wwu-numerik/scripts,wwu-numerik/scripts
python/make_env_file.py
python/make_env_file.py
#!/usr/bin/env python import os from os.path import expanduser home = expanduser("~") prefixes = os.environ.get('ENV_PREFIXES', 'TRAVIS CI encrypt TOKEN TESTS').split(' ') env_file = os.environ.get('ENV_FILE', os.path.join(home, 'env')) with open(env_file, 'wt') as env: for k,v in os.environ.items(): for ...
bsd-2-clause
Python
7f500befa41112de5c9cccb103d57b4d12611b84
Add auth mixins for REST
limbera/django-nap
nap/rest/auth.py
nap/rest/auth.py
from nap import auth class LoginRequiredMixin(object): @auth.permit_logged_in def dispatch(self, *args, **kwargs): return super(LoginRequiredMixin, self).dispatch(*args, **kwargs) class StaffRequiredMixin(object): @auth.permit_staff def dispatch(self, *args, **kwargs): return supe...
bsd-3-clause
Python
15fec2dc39dbac26f006171b7a5d0547fb40f254
Add first draft of Google refresh-token script
myersjustinc/stitchbot
get_google_token.py
get_google_token.py
#!/usr/bin/env python import os import sys import webbrowser from oauth2client.client import OAuth2WebServerFlow def get_credentials(scopes): flow = OAuth2WebServerFlow( client_id=os.environ['GOOGLE_CLIENT_ID'], client_secret=os.environ['GOOGLE_CLIENT_SECRET'], scope=' '.join(scopes), ...
bsd-2-clause
Python
8455c8f9670ee1558407a6a1a33ab78bf32b8bd2
implement SDR classifier factory
subutai/nupic,cogmission/nupic,EricSB/nupic,blueburningcoder/nupic,subutai/nupic,breznak/nupic,cogmission/nupic,marionleborgne/nupic,rcrowder/nupic,scottpurdy/nupic,EricSB/nupic,numenta/nupic,numenta/nupic,rhyolight/nupic,ywcui1990/nupic,numenta/nupic,breznak/nupic,blueburningcoder/nupic,numenta-ci/nupic,lscheinkman/nu...
src/nupic/algorithms/sdr_classifier_factory.py
src/nupic/algorithms/sdr_classifier_factory.py
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
Python
6b4ad5947bcaf226ce9bd973e3f75f02b62566b1
Create install-openerp.py
FreeGeekTwinCities/install-openerp
install-openerp.py
install-openerp.py
#!/usr/bin/python
mit
Python
bbfc5549fb632d535ed1934e0d2bd1226ccd4507
Add a command to start the WebUI using oq
gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine
openquake/commands/webui.py
openquake/commands/webui.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2016, GEM Foundation # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Licen...
agpl-3.0
Python
0380c2c6b0dd3783e16630eacd2a12c79de72439
add RTC test on aarch64
firecracker-microvm/firecracker,firecracker-microvm/firecracker,firecracker-microvm/firecracker,firecracker-microvm/firecracker,firecracker-microvm/firecracker
tests/integration_tests/functional/test_rtc.py
tests/integration_tests/functional/test_rtc.py
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """Check the well functioning af the RTC device on aarch64 platforms.""" import re import platform import pytest import framework.utils as utils from host_tools.network import SSHConnection DMESG_LOG_REGEX ...
apache-2.0
Python
0433c32cd4212947517e57b6dc24d7d215123df9
Add unit test to make sure no work isn't an error.
data-refinery/data_refinery,data-refinery/data_refinery,data-refinery/data_refinery
workers/data_refinery_workers/downloaders/test_utils.py
workers/data_refinery_workers/downloaders/test_utils.py
import os from django.test import TestCase, tag from typing import List from unittest.mock import patch, call from urllib.error import URLError from data_refinery_workers.downloaders import utils class UtilsTestCase(TestCase): def test_no_jobs_to_create(self): """Make sure this function doesn't raise an ...
bsd-3-clause
Python
fc20e3dbaabe8293e69365a5f79af0d3bb6f004c
add long_lines script
tangledhelix/dp_pp_utils,tangledhelix/dp_pp_utils
long_lines.py
long_lines.py
#!/usr/bin/env python3 """ Find and display long lines in an ebook text file. """ # Lines should not be longer than this MAX_LEN = 72 import sys if len(sys.argv) < 2: sys.exit("Missing argument: filename") lineno = 0 with open(sys.argv[1], "r") as f: for line in f: lineno += 1 line = line....
mit
Python
2cb151c6a2ac1f10cf6a854b9521fb125f51ef6d
Create 02.Bricks.py
stoyanov7/SoftwareUniversity,stoyanov7/SoftwareUniversity,stoyanov7/SoftwareUniversity,stoyanov7/SoftwareUniversity
.ProgramingBasics/SampleCoding101Exam-Jan2016/02.Bricks.py
.ProgramingBasics/SampleCoding101Exam-Jan2016/02.Bricks.py
import math bricks = int(input()) workers = int(input()) bricksPerWorker = int(input()) bricksPerWork = workers * bricksPerWorker coursesCount = math.ceil(bricks / bricksPerWork) print(coursesCount)
mit
Python
2dde65974696a5386046b4bd3e76700c1de33942
add tests to model.Organization.get_num_of_repos
cloudify-cosmo/tattle
tattle/tests/test_model.py
tattle/tests/test_model.py
import unittest import json import mock from tattle import model from tattle.model import GitHubObject from tattle.model import Organization from tattle.model import Repo from tattle.model import Branch class GitHubObjectTestCase(unittest.TestCase): def test_eq(self): self.assertEqual(GitHubObject('...
apache-2.0
Python
8f21fcc4611bba391761df517de8dec3c8e53d9a
Add file to create all files to rais.
DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site
scripts/data_download/rais/create_all_files.py
scripts/data_download/rais/create_all_files.py
import os import commands import time import logging import sys if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']): print "ERROR! Use:\n python scripts/data_download/rais/create_files.py en/pt output_path\n" exit() logging.basicConfig(filename=os.path.abspath(os.path.join(sys.argv[2],str(sys.argv[...
mit
Python
a198720528fff41b4a4cbdf8dd6f4448ba7ebe07
fix cron bug
nficano/gendo
gendo/scheduler.py
gendo/scheduler.py
from __future__ import absolute_import #!/usr/bin/env/python # -*- coding: utf-8 -*- import datetime from crontab import CronTab class Task(object): def __init__(self, schedule, fn, **options): self.schedule = schedule self.fn = fn self.options = options self.next_run = self.get_ne...
from __future__ import absolute_import #!/usr/bin/env/python # -*- coding: utf-8 -*- import datetime from crontab import CronTab class Task(object): def __init__(self, schedule, fn, **options): self.schedule = schedule self.fn = fn self.options = options self.next_run = self.get_ne...
mit
Python
f0491ab15fe5c2b9b0f74ae1c0a407dad6b05ea1
Add misc.pidfile component
jacobq/csci5221-viro-project,andiwundsam/_of_normalize,andiwundsam/_of_normalize,VamsikrishnaNallabothu/pox,waltznetworks/pox,andiwundsam/_of_normalize,chenyuntc/pox,VamsikrishnaNallabothu/pox,noxrepo/pox,VamsikrishnaNallabothu/pox,xAKLx/pox,denovogroup/pox,jacobq/csci5221-viro-project,diogommartins/pox,jacobq/csci5221...
pox/misc/pidfile.py
pox/misc/pidfile.py
# Copyright 2013 James McCauley # # 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 writi...
apache-2.0
Python
b6f666815a8bd886210d4b2d22efea9b282b95b9
Add base file for standard library
yeardancing/twink,hkwi/twink
twink/standard.py
twink/standard.py
import logging import SocketServer import StringIO import socket from twink import * class StandardChannel(Channel): def __init__(self, *args, **kwargs): self.socket = kwargs["socket"] self.peer = kwargs["peer"] self.server = kwargs["server"] def direct_send(self, message): self.socket.sendto(...
apache-2.0
Python
ef82f7a5c271f3169e717f3c09231b38c30ae395
Add example module
medbenmakhlouf/pyzipcodeapi,medbenmakhlouf/pyzipcodeapi
pyzipcodeapi/example.py
pyzipcodeapi/example.py
# -*- coding: utf-8 -*- from pyzipcodeapi.api import ZipCodeApi API_KEY = '3dAoRheoltlrRLipalNn8LkhJAh59P5c2GAUXOjjhEK9p2zAomYw7iORS5X1U2eX' if __name__ == '__main__': # set different inputs f = 'json' u = 'km' ou = 'degrees' obj = ZipCodeApi(API_KEY) # https://www.zipcodeapi.com/rest/<api_ke...
bsd-3-clause
Python
a5b726ae5582b59c24f436426d54f002bbd81663
bump version
cenkalti/kuyruk,cenkalti/kuyruk
kuyruk/__init__.py
kuyruk/__init__.py
import logging from .kuyruk import Kuyruk from .task import Task from .worker import Worker from .queue import Queue from .exceptions import Reject __version__ = '0.3.3' try: # not available in python 2.6 from logging import NullHandler except ImportError: class NullHandler(logging.Handler): def...
import logging from .kuyruk import Kuyruk from .task import Task from .worker import Worker from .queue import Queue from .exceptions import Reject __version__ = '0.3.2' try: # not available in python 2.6 from logging import NullHandler except ImportError: class NullHandler(logging.Handler): def...
mit
Python
eb0e316d6d6e40a17eb1c57840ca06843219693b
add lab-vpn.py
greyshell/linuxJuicer,greyshell/Exploit-Dev
lab-vpn/lab-vpn.py
lab-vpn/lab-vpn.py
#!/usr/bin/env python # author: greyshell # description: use openvpn to access offensive security labs import base64 import optparse import subprocess import time import pexpect # setting up emails emailFrom = 'enter your email address' emailFromEncodedPass = 'enter base64 encoded password' class LoginVpn(object)...
mit
Python
1e114c68fc9e165be9f35da23e3df865aeaea345
Add bitbucket_id.
gmist/my-gae-init-auth,gmist/alice-box,gmist/alice-box
main/model.py
main/model.py
# -*- coding: utf-8 -*- from google.appengine.ext import ndb from uuid import uuid4 import os import modelx # The timestamp of the currently deployed version TIMESTAMP = long(os.environ.get('CURRENT_VERSION_ID').split('.')[1]) >> 28 class Base(ndb.Model, modelx.BaseX): created = ndb.DateTimeProperty(auto_now_add...
# -*- coding: utf-8 -*- from google.appengine.ext import ndb from uuid import uuid4 import os import modelx # The timestamp of the currently deployed version TIMESTAMP = long(os.environ.get('CURRENT_VERSION_ID').split('.')[1]) >> 28 class Base(ndb.Model, modelx.BaseX): created = ndb.DateTimeProperty(auto_now_add...
mit
Python
8d52cf8aa1f2ae918a492e73ea9fd016858aa7a9
Move sorter operations to single file
giantas/sorter,giantas/sorter
operations.py
operations.py
#! /usr/bin/env python3 import argparse import os from glob import glob from sdir import File, Folder from filegroups import typeGroups def is_writable(folder_path): try: permissions_dir = os.path.join(folder_path, 'sorter_dir') os.makedirs(permissions_dir) os.rmdir(permissions_dir) e...
bsd-3-clause
Python
3de3f40b997a665d5cb3e8f32c7c09cc8b3ee7c1
add test for csv output.
openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,zimmerman-zimmerman/OIPA,openaid-IATI/OIPA,openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,zimmerman-zimmerman/OIPA,openaid-IATI/OIPA,openaid-IATI/OIPA,zimmerman-zimmerman/OIPA
OIPA/api/activity/tests/test_activities_csv_endpoints.py
OIPA/api/activity/tests/test_activities_csv_endpoints.py
import csv from django.test import RequestFactory from django.urls import reverse from rest_framework import status from rest_framework.test import APIClient, APITestCase from iati.factory import iati_factory from iati.permissions.factories import OrganisationUserFactory class TestActivityCSVEndpoints(APITestCase):...
agpl-3.0
Python
4a5b2ffabba997a649be1b3198ca034e8bae6c84
Add Operating System detection
cread/ecks,cread/ecks
ecks/plugins/os.py
ecks/plugins/os.py
""" Ecks plugin to collect the Operating System String Copyright 2011 Chris Read (chris.read@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/...
apache-2.0
Python
8225c5b98e80ea8cf33a039ad88f729da74fdb35
Add generic api url
YACOWS/opps,williamroot/opps,jeanmask/opps,opps/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,opps/opps,williamroot/opps,YACOWS/opps,opps/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,opps/opps
opps/api/urls.py
opps/api/urls.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.conf.urls import patterns, url, include from rest_framework import routers router = routers.DefaultRouter() urlpatterns = patterns( '', url(r'^', include(router.urls)), url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')) )
mit
Python
177a1fdb394eee4a41a3667b0f138a1f2d8b59ca
Add example of connected viewers/plugins
chintak/scikit-image,blink1073/scikit-image,michaelpacer/scikit-image,rjeli/scikit-image,dpshelio/scikit-image,michaelaye/scikit-image,oew1v07/scikit-image,almarklein/scikit-image,paalge/scikit-image,robintw/scikit-image,bsipocz/scikit-image,ClinicalGraphics/scikit-image,SamHames/scikit-image,chintak/scikit-image,jwigg...
viewer_examples/plugins/probabilistic_hough.py
viewer_examples/plugins/probabilistic_hough.py
import numpy as np from skimage import data from skimage import draw from skimage.transform import probabilistic_hough_line from skimage.viewer import ImageViewer from skimage.viewer.widgets import Slider from skimage.viewer.plugins.overlayplugin import OverlayPlugin from skimage.viewer.plugins.canny import CannyPlug...
bsd-3-clause
Python
47410ebd3ae30cc22df106d233e2184d417c2b42
Add a new tool to list libraries deps
freedesktop-unofficial-mirror/gstreamer-sdk__cerbero,freedesktop-unofficial-mirror/gstreamer-sdk__cerbero,BigBrother-International/gst-cerbero,BigBrother-International/gst-cerbero,freedesktop-unofficial-mirror/gstreamer-sdk__cerbero,BigBrother-International/gst-cerbero,freedesktop-unofficial-mirror/gstreamer-sdk__cerbe...
cerbero/tools/depstracker.py
cerbero/tools/depstracker.py
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2013 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
Python
ffc8c48ce5ac77eab1b09e134c52a6592b53aa65
use different now
qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,gmimano/commcaretest,dimagi/commcare-hq,puttarajubr/commcare-hq,SEL-Columbia/commcare-hq,gmimano/commcaretest,puttarajubr/commcare-hq,SEL-Columbia/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/c...
corehq/apps/receiverwrapper/tasks.py
corehq/apps/receiverwrapper/tasks.py
from functools import wraps from celery.log import get_task_logger from celery.task import periodic_task from datetime import datetime, timedelta from django.core.cache import cache from corehq.apps.receiverwrapper.models import RepeatRecord, FormRepeater from couchdbkit.exceptions import ResourceConflict from couchfor...
from functools import wraps from celery.log import get_task_logger from celery.task import periodic_task from datetime import datetime, timedelta from django.core.cache import cache from corehq.apps.receiverwrapper.models import RepeatRecord, FormRepeater from couchdbkit.exceptions import ResourceConflict from couchfor...
bsd-3-clause
Python
a235f7754a2a2bc914eacae26408d025434925bd
Add special error class
LawnmowerIO/plaid-python
plaid/PlaidMfaResetError.py
plaid/PlaidMfaResetError.py
class PlaidMfaResetError(Exception): pass
mit
Python
39864fd6229824ce8ff25d8816e42446fc5af239
Add nose dependency
thelinuxkid/pygeocode
setup.py
setup.py
#!/usr/bin/python from setuptools import setup, find_packages EXTRAS_REQUIRES = dict( test=[ 'fudge>=1.0.3', 'nose>=1.1.2', ], ) for k,v in EXTRAS_REQUIRES.iteritems(): if k == 'test': continue EXTRAS_REQUIRES['test'] += v setup( name='pygeocode', version='0.0....
#!/usr/bin/python from setuptools import setup, find_packages EXTRAS_REQUIRES = dict( test=[ 'fudge' ], ) for k,v in EXTRAS_REQUIRES.iteritems(): if k == 'test': continue EXTRAS_REQUIRES['test'] += v setup( name='pygeocode', version='0.0.3', description="pygeocode ...
mit
Python
a3af50f94ab29de9ada2366ddaf66c2b989e743f
Create run.py
Chippers255/MarkovTextGenerator
markov/run.py
markov/run.py
import markov file_ = open('dream.txt') # file_ = open('alice.txt') # file_ = open('test.txt') text = markov.Markov(file_) print text.generate_markov_text()
mit
Python
ad23e162c1a52879d290fd78aab8a6dc82db45bf
添加setup.py…
JetDrag/RichPackager
setup.py
setup.py
# coding=utf-8 import codecs from setuptools import setup __author__ = 'lawrentwang' VERSION = '0.1.1' with codecs.open('main_version', 'w', encoding='utf8') as fw: fw.write(VERSION) with codecs.open("README.md", "r", encoding='utf8') as fp: long_description = fp.read() setup( name='RichPackager', ...
mit
Python
5b85b86ea943550153d3151f40798a600f408846
add setup script. you can now do: python setup.py develop (to install dependencies), and python setup.py test (to run tests)
dssg/givinggraph,erichilarysmithsr/givinggraph,dssg/givinggraph,math4youbyusgroupillinois/givinggraph,math4youbyusgroupillinois/givinggraph,dssg/givinggraph,erichilarysmithsr/givinggraph,math4youbyusgroupillinois/givinggraph,erichilarysmithsr/givinggraph
setup.py
setup.py
from setuptools import setup, command import os import sys import urllib import tarfile '''setuptools works by triggering subcommands from higher level commands. The default commands 'install' and 'develop' trigger the following sequences: install: 1. build 2. build_py 3. install_lib 4. install_egg_info 5. ...
mit
Python
6038c707fe91a4cbf54a364c12f7086b19505f8b
Allow package to be installed with command line ingestor tool
omad/datacube-experiments
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup setup( name='datacube-experiments', description='Experimental Datacube v2 Ingestor', version='0.0.1', packages=['ingestor'], url='http://github.com/omad/datacube-experiments', install_requires=[ 'click', 'eodatasets', '...
bsd-3-clause
Python
d231f054adae7bd02e662902ee3b4dbe229fd130
Create __init__.py
zbigniewz/jenkins-build-failure-analyzer,ZbigniewZabost/jenkins-build-failure-analyzer,zbigniewz/jenkins-build-failure-analyzer,ZbigniewZabost/jenkins-build-failure-analyzer
utils/__init__.py
utils/__init__.py
apache-2.0
Python
dca07fae86a75a17c1f9e78c695c30caf07b0b8f
Create 6kyu_simple_encryption_alternating_split.py
Orange9000/Codewars,Orange9000/Codewars
Solutions/6kyu/6kyu_simple_encryption_alternating_split.py
Solutions/6kyu/6kyu_simple_encryption_alternating_split.py
from itertools import zip_longest as zlo def decrypt(enc, n): if not isinstance(enc, str): return None part = len(enc)//2 for rep in range(n): a,b = enc[:part], enc[part:] enc = ''.join(j+i for i,j in zlo(a,b, fillvalue = '')) return enc def encrypt(text, n): if not is...
mit
Python
df6a526107242f0cf36ec65f5cfbccbf8779ddcd
Add paths.
neurodata/ndstore,openconnectome/open-connectome,openconnectome/open-connectome,openconnectome/open-connectome,openconnectome/open-connectome,neurodata/ndstore,neurodata/ndstore,neurodata/ndstore,openconnectome/open-connectome,openconnectome/open-connectome
web/ingest/ssmith/empaths.py
web/ingest/ssmith/empaths.py
# # Code to load project paths # import os, sys EM_BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.." )) EM_UTIL_PATH = os.path.join(EM_BASE_PATH, "util" ) EM_DBCONFIG_PATH = os.path.join(EM_BASE_PATH, "dbconfig" ) EM_EMCA_PATH = os.path.join(EM_BASE_PATH, "emca" ) sys.path += [ EM_UTIL_PATH...
apache-2.0
Python
05b5a753b73a856ab39a364b53a22b18fc73d984
test custom cairo+pixbuf draw from the blueman project
FilipDominec/plotcommander
examples3/cell_renderer_github/test.py
examples3/cell_renderer_github/test.py
from gi.repository import Gtk, Gdk, GLib from gi.repository import GdkPixbuf import cairo class CellRenderFade(Gtk.CellRenderer): def __init__(self, param): super(CellRenderFade, self).__init__() self.alpha = 0 self.step = param def do_render(self, cr, widget, bg_area, cell_area, flags...
mit
Python
6eec94962e786d615c35cb55c95a9d4a2f8f9e32
Create __init__.py
Fillll/reddit2telegram,Fillll/reddit2telegram
reddit2telegram/channels/r_wireguard/__init__.py
reddit2telegram/channels/r_wireguard/__init__.py
# Just empty file
mit
Python
ace358ae153e9e291787889572c9d5ac05fd017e
Create a migration helper
urda/django-letsencrypt,urda/django-letsencrypt,urda/django-letsencrypt
migrations.py
migrations.py
#!/usr/bin/env python """ Copyright 2016 Peter Urda 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 i...
apache-2.0
Python
e638bd5f14cb69c8db46b547f2c587dfd7045b61
Add svm script
math4youbyusgroupillinois/givinggraph,erichilarysmithsr/givinggraph,math4youbyusgroupillinois/givinggraph,erichilarysmithsr/givinggraph,dssg/givinggraph,math4youbyusgroupillinois/givinggraph,erichilarysmithsr/givinggraph,dssg/givinggraph,dssg/givinggraph
givinggraph/companycause/company_cause_svm.py
givinggraph/companycause/company_cause_svm.py
#!/usr/bin/env python # # Description: This runs a support vector machine (SVM) on the # labelled dataset (company summary, donation cause). # import pickle import string import re import numpy as np from nltk.corpus import stopwords from sklearn.feature_extraction.text import TfidfVectorizer from sklearn import cros...
mit
Python
880dd782a91fc68536ef9ce1048a5987a1ac06fe
add helper for linkage prep step
ufbmi/onefl-deduper
scripts/extract_existing_rawpatid_to_uuid_map.py
scripts/extract_existing_rawpatid_to_uuid_map.py
#!/usr/bin/env python """ Goal: Extract existing linkage mappings from the database @authors: Andrei Sura <sura.andrei@gmail.com> """ # flake8: noqa import sqlalchemy as db import pandas as pd from collections import namedtuple from urllib import parse from config import DB_HOST, DB_USER, DB_PASS, DB_NAME OUT_SE...
mit
Python
0e29d44bfe6993c99af7cd850625afb999b79cc9
Create BinTreePreTraversal_002.py
Chasego/codi,Chasego/cod,Chasego/cod,Chasego/codi,Chasego/cod,cc13ny/Allin,Chasego/codi,cc13ny/algo,Chasego/codirit,Chasego/codi,Chasego/codirit,cc13ny/Allin,cc13ny/algo,Chasego/codi,Chasego/codirit,cc13ny/Allin,cc13ny/Allin,Chasego/codirit,cc13ny/algo,cc13ny/algo,cc13ny/algo,Chasego/cod,cc13ny/Allin,Chasego/cod,Chaseg...
leetcode/144-Binary-Tree-Preorder-Traversal/BinTreePreTraversal_002.py
leetcode/144-Binary-Tree-Preorder-Traversal/BinTreePreTraversal_002.py
class Solution: # @param root, a tree node # @return a list of integers def iterative_preorder(self, root, list): stack = [] while root or stack: if root: list.append(root.val) stack.append(root) root = root.left else: ...
mit
Python
087d0aeabcd5d88714651ed160a121863077d06f
add subscription class
andela-sjames/paystack-python
paystackapi/subscription.py
paystackapi/subscription.py
"""Script used to define Paystack subscription class""" from paystackapi.base import PayStackBase class Subscription(PayStackBase): """docstring for Subscription.""" @classmethod def create(cls, **kwargs): """ Create subscription. Args: customer: Customer's email add...
mit
Python
5fd97c93833b0a6c851cccc23a7efeaec686cd74
Solve problem 21
mazayus/ProjectEuler
problem021.py
problem021.py
#!/usr/bin/env python3 from functools import * from itertools import * def divisors(n): for d in takewhile(lambda d: d * d <= n, count(1)): if n % d == 0: yield d if n // d != d: yield n // d @lru_cache(maxsize=None) def sum_proper_divisors(n): return sum(divis...
mit
Python
93e75a7a33faa427e680a384c9fadee7889b0f9d
Create auto-fcc-qa.py
discountry/itchat-examples
examples/auto-fcc-qa.py
examples/auto-fcc-qa.py
#!/usr/bin/env python3 from peewee import * db = MySQLDatabase('xxxxx', user='xxxxxx', password='xxxxxxxx', charset='utf8mb4') class BaseModel(Model): class Meta: database = db class Question(BaseModel): title = CharField(unique=True,max_length=100) counter = I...
mit
Python