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
841fb156fff3d257d39afdc9d3d4e587427fe2cf
Add new file missed in earlier commit place holder for projects that do not load for some reason
barry-scott/git-workbench,barry-scott/scm-workbench,barry-scott/scm-workbench,barry-scott/git-workbench,barry-scott/scm-workbench
Source/Scm/wb_scm_project_place_holder.py
Source/Scm/wb_scm_project_place_holder.py
''' ==================================================================== Copyright (c) 2016 Barry A Scott. All rights reserved. This software is licensed as described in the file LICENSE.txt, which you should have received as part of this distribution. ===========================================================...
apache-2.0
Python
f1ba45809e6682235c07ab89e4bc32e56b2fa84f
Create i_love_lance_janice.py
hirenvasani/foobar
i_love_lance_janice.py
i_love_lance_janice.py
""" I Love Lance & Janice ===================== You've caught two of your fellow minions passing coded notes back and forth - while they're on duty, no less! Worse, you're pretty sure it's not job-related - they're both huge fans of the space soap opera "Lance & Janice". You know how much Commander Lambda hates waste, ...
mit
Python
a08a7da41300721e07c1bff8e36e3c3d69af06fb
Add py-asdf package (#12817)
iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack
var/spack/repos/builtin/packages/py-asdf/package.py
var/spack/repos/builtin/packages/py-asdf/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 PyAsdf(PythonPackage): """The Advanced Scientific Data Format (ASDF) is a next-generation ...
lgpl-2.1
Python
7f4642fc2e0edba668482f2ebbb64ab8870e709a
Initialize P01_basics
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
books/AutomateTheBoringStuffWithPython/Chapter01/P01_basics.py
books/AutomateTheBoringStuffWithPython/Chapter01/P01_basics.py
# This program performs basic Python instructions # Expressions print(2 + 2) print(2 + 3 * 6) print((2 + 3) * 6) print(48565878 * 578453) print(2 ** 8) print(23 / 7) print(23 // 7) print(23 % 7) print(2 + 2) print((5 - 1) * ((7 + 1) / (3 - 1))) # Uncomment to see what happens #print(5 + ) #print(42 + 5 +...
mit
Python
ea6d73ac2b9274eae0a866acd1e729854c59fb17
Add update.py to drive the update loop.
kargakis/test-infra,rmmh/kubernetes-test-infra,ixdy/kubernetes-test-infra,cjwagner/test-infra,spxtr/test-infra,kargakis/test-infra,pwittrock/test-infra,pwittrock/test-infra,jessfraz/test-infra,krzyzacy/test-infra,krousey/test-infra,mindprince/test-infra,kewu1992/test-infra,jlowdermilk/test-infra,cblecker/test-infra,cbl...
kettle/update.py
kettle/update.py
#!/usr/bin/env python # Copyright 2017 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
5114f177741b105f33819b98415702e53b52eb01
Add script to update site setup which is used at places like password reset email [skip ci]
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/hqadmin/management/commands/update_site_setup.py
corehq/apps/hqadmin/management/commands/update_site_setup.py
from django.core.management.base import BaseCommand, CommandError from django.contrib.sites.models import Site from django.conf import settings class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument( 'site_address', help="the new site address that should b...
bsd-3-clause
Python
6fd0cee9bca0449aa6aab6a62e470ba8ff909cbb
print all caesar rotations for some string
edunham/toys,edunham/toys,edunham/toys,edunham/toys,edunham/toys
language/rotN.py
language/rotN.py
#! /usr/bin/env python import string ciphered = "LVFU XAN YIJ UVXRB RKOYOFB" def make_rot_n(n): # http://stackoverflow.com/questions/3269686/short-rot13-function lc = string.ascii_lowercase uc = string.ascii_uppercase trans = string.maketrans(lc + uc, lc[n:] + lc[:n] + uc[...
mit
Python
d3dbb797575221d574fdda9c3d087d8696f6091a
Add netstring lib
bjencks/captiveportal,bjencks/captiveportal
lib/netstring.py
lib/netstring.py
def encode_netstring(s): return str(len(s)).encode('ascii') + b':' + s + b',' def consume_netstring(s): """If s is a bytestring beginning with a netstring, returns (value, rest) where value is the contents of the netstring, and rest is the part of s after the netstring. Raises ValueError if s ...
apache-2.0
Python
9f5c3715f4b3cd5bf451bdc504cded6459e8ee79
add one test file and add content to it
WheatonCS/Lexos,WheatonCS/Lexos,WheatonCS/Lexos
test/unit_test/test_similarity2.py
test/unit_test/test_similarity2.py
from lexos.helpers.error_messages import MATRIX_DIMENSION_UNEQUAL_MESSAGE count_matrix = [['', 'The', 'all', 'bobcat', 'cat', 'caterpillar', 'day.', 'slept'], ['catBobcat', 9.0, 9.0, 5.0, 4.0, 0.0, 9.0, 9.0], ['catCaterpillar', 9.0, 9.0, 0.0, 4.0, 5.0, 9.0, 9.0], ...
mit
Python
44863ff1f7064f1d9a9bb897822834eb6755ed59
Add SMTP auth server
Debetux/sr.ht,Ninja3047/sr.ht,Ninja3047/sr.ht,Debetux/sr.ht,Debetux/sr.ht,Ninja3047/sr.ht,Ninja3047/sr.ht,Debetux/sr.ht
authserver.py
authserver.py
import bcrypt import asyncore from secure_smtpd import SMTPServer, FakeCredentialValidator from srht.objects import User class UserValidator(object): def validate(self, username, password): user = User.query.filter(User.username == username).first() if not user: return False ret...
mit
Python
f56e390be0e2cea8e08080029aad756a6ab3c91f
Add lc0253_meeting_rooms_ii.py from Copenhagen :)
bowen0701/algorithms_data_structures
lc0253_meeting_rooms_ii.py
lc0253_meeting_rooms_ii.py
"""Leetcode 253. Meeting Rooms II (Premium) Medium URL: https://leetcode.com/problems/meeting-rooms-ii Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference rooms required. """ class Solution2(object): # @param {Interval[...
bsd-2-clause
Python
8b4c34e84d306b5f9021de47bc3ae9050e2fc2b3
Fix loading of ply files exported by meshlab
drewm1980/multi_view_stereo_benchmark,drewm1980/multi_view_stereo_benchmark,drewm1980/multi_view_stereo_benchmark
compare_clouds.py
compare_clouds.py
#!/usr/bin/env python3 from pathlib import Path """Code for comparing point clouds""" cloud1Path = Path("./data/reconstructions/2016_10_24__17_43_17/reference.ply") cloud2Path = Path("./data/reconstructions/2016_10_24__17_43_17/high_quality.ply") from load_ply import load_ply cloud1PointData = load_ply(cloud1Path)...
mit
Python
4f70773bb9041c44b0f83ef61a46d5fa974b366e
Create conwaytesting.py
peterbynum/Conway-Life,peterbynum/Conway-Life
conwaytesting.py
conwaytesting.py
mit
Python
73d753e315c7feb18af39360faf4d6fc6d10cedf
test to demonstrate bug 538
cledio66/pyglet,arifgursel/pyglet,gdkar/pyglet,Austin503/pyglet,arifgursel/pyglet,mpasternak/pyglet-fix-issue-552,Austin503/pyglet,shaileshgoogler/pyglet,mpasternak/pyglet-fix-issue-518-522,kmonsoor/pyglet,mpasternak/michaldtz-fix-552,odyaka341/pyglet,shaileshgoogler/pyglet,mpasternak/michaldtz-fixes-518-522,google-cod...
tests/text/ELEMENT_CHANGE_STYLE.py
tests/text/ELEMENT_CHANGE_STYLE.py
#!/usr/bin/env python '''Test that inline elements can have their style changed, even after text has been deleted before them. [This triggers bug 538 if it has not yet been fixed.] To run the test, delete the first line, one character at a time, verifying that the element remains visible and no tracebacks are printed...
bsd-3-clause
Python
2e796f38dbdc1044c13a768c76fa733ad07b9829
Add astro/21cm/extract_slice.py
liweitianux/atoolbox,liweitianux/atoolbox,liweitianux/atoolbox,liweitianux/atoolbox,liweitianux/atoolbox,liweitianux/atoolbox
astro/21cm/extract_slice.py
astro/21cm/extract_slice.py
#!/usr/bin/env python3 # # Copyright (c) 2017 Weitian LI <weitian@aaronly.me> # MIT License # """ Extract a slice from the 21cm cube and save as FITS image. """ import os import sys import argparse import numpy as np import astropy.io.fits as fits def main(): outfile_default = "{prefix}_z{z:05.2f}_N{Nside}_L{L...
mit
Python
0bf7d9fb20a3d2588ffc0e8341ec2af3df5fe300
Add test for depot index page
verleihtool/verleihtool,verleihtool/verleihtool,verleihtool/verleihtool,verleihtool/verleihtool
depot/tests/test_depot_index.py
depot/tests/test_depot_index.py
from django.test import TestCase, Client from depot.models import Depot def create_depot(name, state): return Depot.objects.create(name=name, active=state) class DepotIndexTestCase(TestCase): def test_depot_index_template(self): response = self.client.get('/depots/') self.assertTemplateUsed...
agpl-3.0
Python
2a903d721c44f9c6b53c8516b28b9dd6c1faa5e0
Create crawler_utils.py
nikohernandiz/TVLineFinder
crawler_utils.py
crawler_utils.py
import json import os.path def comments_to_json(comments): result = [] for comment in comments: result.append({"score": comment.score, "url": comment.permalink, "body": comment.body, "id": comment.id, "replies"...
mit
Python
d81a1f3ef63aef7f003a018f26ea636cf47cfc5d
Add init file for installation
coded-by-hand/mass,coded-by-hand/mass
jswatchr/__init__.py
jswatchr/__init__.py
from jswatchr import *
bsd-2-clause
Python
7850371982cc50dc2a5a59c7b01d5a1bec80cf3f
Add FairFuzz tool spec
dbeyer/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,dbeyer/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec
benchexec/tools/fairfuzz.py
benchexec/tools/fairfuzz.py
""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2007-2015 Dirk Beyer 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 ht...
apache-2.0
Python
a39fbd74eaf84c757f15d14bfc728bd1d0f63bd4
Create blockchain.py
openblockchains/awesome-blockchains,openblockchains/awesome-blockchains,openblockchains/awesome-blockchains,openblockchains/awesome-blockchains,openblockchains/awesome-blockchains,openblockchains/awesome-blockchains,openblockchains/awesome-blockchains
blockchain.py/blockchain.py
blockchain.py/blockchain.py
########################### # build your own blockchain from scratch in python3! # # inspired by # Let's Build the Tiniest Blockchain In Less Than 50 Lines of Python by Gerald Nash # see https://medium.com/crypto-currently/lets-build-the-tiniest-blockchain-e70965a248b # # # to run use: # $ python ./block...
cc0-1.0
Python
37db687b4167aee0e88036c5d85995de891453ed
Create cbalusek_01.py
GT-IDEaS/SkillsWorkshop2017,GT-IDEaS/SkillsWorkshop2017,GT-IDEaS/SkillsWorkshop2017
Week01/Problem01/cbalusek_01.py
Week01/Problem01/cbalusek_01.py
#This project defines a function that takes any two numbers and sums their multiples to some cutoff value def sum(val1, val2, test): i = 1 j = 1 cum = 0 while i*val1 < test: cum += i*val1 i += 1 while j*val2 < test: if j*val2%val1 != 0: cum += j*val2 ...
bsd-3-clause
Python
089f93bcf7157ee3eaf83964294c5c2df19683f0
Create retweet.py
kingoak/firstapp
settings-search_query-yourHashtag-Leave-empty-for-all-languages-tweet_language-Create-your-app-on-http/retweet.py
settings-search_query-yourHashtag-Leave-empty-for-all-languages-tweet_language-Create-your-app-on-http/retweet.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, ConfigParser, tweepy, inspect, hashlib path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) # read config config = ConfigParser.SafeConfigParser() config.read(os.path.join(path, "config")) # your hashtag or search query and tweet l...
mpl-2.0
Python
cc79ee252e09ade17961d03265c61a87e270bd88
Make color emoji use character sequences instead of PUA.
davelab6/nototools,anthrotype/nototools,pathumego/nototools,googlei18n/nototools,davelab6/nototools,pahans/nototools,moyogo/nototools,googlefonts/nototools,namemealrady/nototools,googlei18n/nototools,moyogo/nototools,dougfelt/nototools,googlefonts/nototools,pahans/nototools,googlei18n/nototools,googlefonts/nototools,da...
nototools/map_pua_emoji.py
nototools/map_pua_emoji.py
#!/usr/bin/python # # Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
apache-2.0
Python
2a5b7773af3e9516d8a4a3df25c0b829598ebb1c
Remove redundant str typecasting
klmitch/nova,jianghuaw/nova,mahak/nova,rajalokan/nova,jianghuaw/nova,openstack/nova,mahak/nova,hanlind/nova,hanlind/nova,Juniper/nova,gooddata/openstack-nova,rahulunair/nova,alaski/nova,gooddata/openstack-nova,mikalstill/nova,sebrandon1/nova,jianghuaw/nova,sebrandon1/nova,mahak/nova,Juniper/nova,rajalokan/nova,jianghua...
nova/tests/uuidsentinel.py
nova/tests/uuidsentinel.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
Python
ac673650673f7d6b9785d577499037bf9db4435a
refactor prompt abstraction
mattvonrocketstein/smash,mattvonrocketstein/smash,mattvonrocketstein/smash,mattvonrocketstein/smash
lib/smashlib/prompt.py
lib/smashlib/prompt.py
""" smash.prompt """ from smashlib.data import PROMPT_DEFAULT as DEFAULT class Prompt(dict): def __setitem__(self, k, v, update=True): if k in self: raise Exception,'prompt component is already present: ' + str(k) super(Prompt, self).__setitem__(k, v) if update: sel...
mit
Python
2c178c5ea05d2454ef6896aaf9c58b6536f5a15f
Create bubblesort.py
GabrielGhe/MyAlgorithms,GabrielGhe/MyAlgorithms
bubblesort.py
bubblesort.py
def bubblesort(lst): #from last index to second for passes in range(len(lst) - 1, 0, -1): #from [0,passes[ keep swapping to put the largest #number at index passes for i in range(passes): if lst[i] > lst[i+1]: swap(lst, i, i+1) return lst def ...
mit
Python
9e954d5181d36762a8c34e69516c7f5510bae5a7
add exception class to use for mtconvert errors
ryanraaum/oldowan.mtconvert
oldowan/mtconvert/error.py
oldowan/mtconvert/error.py
class MtconvertError(Exception): """Exception raised for errors in the mtconvert module. Attributes: expression -- input expression in which the error occurred message -- explanation of the error """ def __init__(self, expression, message): self.expression = expression ...
mit
Python
3adcefcad4fc3ecb85aa4a22e8b3c4bf5ca4e6f5
Add tests for revision updates via import
edofic/ggrc-core,selahssea/ggrc-core,edofic/ggrc-core,plamut/ggrc-core,josthkko/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,edofic/ggrc-core,jo...
test/integration/ggrc/converters/test_import_update.py
test/integration/ggrc/converters/test_import_update.py
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Tests for bulk updates with CSV import.""" from integration.ggrc.converters import TestCase from ggrc import models class TestImportUpdates(TestCase): """ Test importing of already existing objects...
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> from integration.ggrc.converters import TestCase from ggrc import models class TestImportUpdates(TestCase): """ Test importing of already existing objects """ def setUp(self): TestCase.setUp(sel...
apache-2.0
Python
f79d10de2adb99e3a3d07caa2a00359208186c15
Add twext.python.datetime tests
trevor/calendarserver,trevor/calendarserver,trevor/calendarserver
twext/python/test/test_datetime.py
twext/python/test/test_datetime.py
## # Copyright (c) 2006-2010 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
Python
157cb4518412a6e6de9c3d0d64c68ac0af276c6a
Access checking unit tests added for FormPage view.
rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son
tests/app/soc/modules/gsoc/views/test_student_forms.py
tests/app/soc/modules/gsoc/views/test_student_forms.py
# Copyright 2013 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
Python
e48caa4bb61cce466ad5eb9bffbfba8e33312474
Add Python EC2 TerminateInstances example
awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,a...
python/example_code/ec2/terminate_instances.py
python/example_code/ec2/terminate_instances.py
# snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] # snippet-sourcedescription:[terminate_instances.py demonstrates how to terminate an Amazon EC2 instance.] # snippet-service:[ec2] # snippet-keyword:[Amazon EC2] # snippet-keyword:[Python] # snippet-keyword:[AWS SDK for Python (Bot...
apache-2.0
Python
34c0ca7ba0f8d2ac51583dfab4ea2f4cee7a62d5
add script to read csv files to list
qingkaikong/useful_script,qingkaikong/useful_script,qingkaikong/useful_script,qingkaikong/useful_script,qingkaikong/useful_script
python/read_formated_txt_file/read_csv2list.py
python/read_formated_txt_file/read_csv2list.py
import csv def csv_to_list(csv_file, delimiter=','): """ Reads in a CSV file and returns the contents as list, where every row is stored as a sublist, and each element in the sublist represents 1 cell in the table. """ with open(csv_file, 'r') as csv_con: reader = csv.reader(csv_c...
bsd-3-clause
Python
d402c25a6b257778e08e6db2890ae575432daed0
Add new linkedlist file for intersection
keon/algorithms,amaozhao/algorithms
linkedlist/intersection.py
linkedlist/intersection.py
def intersection(h1, h2): """ This function takes two lists and returns the node they have in common, if any. In this example: 1 -> 3 -> 5 \ 7 -> 9 -> 11 / 2 -> 4 -> 6 ...we would return 7. Note that the node itself is the unique identifier, n...
mit
Python
8f1cf446a0b602e6e64ccebaa794e7ec6a2f840d
add support routines for oversampling
harpolea/pyro2,zingale/pyro2,zingale/pyro2,harpolea/pyro2
compressible_fv4/initialization_support.py
compressible_fv4/initialization_support.py
"""Routines to help initialize cell-average values by oversampling the initial conditions on a finer mesh and averaging down to the requested mesh""" import mesh.fv as fv def get_finer(myd): mgf = myd.grid.fine_like(4) fd = fv.FV2d(mgf) for v in myd.names: fd.register_var(v, myd.BCs[v]) fd....
bsd-3-clause
Python
4227cef6567023717c8d66f99ce776d9d8aa0929
Add OS::Contrail::PhysicalRouter
safchain/contrail-heat
contrail_heat/resources/physical_router.py
contrail_heat/resources/physical_router.py
from heat.engine import properties from vnc_api import vnc_api from contrail_heat.resources import contrail import uuid class HeatPhysicalRouter(contrail.ContrailResource): PROPERTIES = ( NAME, ) = ( 'name', ) properties_schema = { NAME: properties.Schema( properti...
apache-2.0
Python
5cebd0b56f81dfc02feb5511dade82ebf6db99ff
add presence.py
nullpixel/litecord,nullpixel/litecord
litecord/presence.py
litecord/presence.py
''' presence.py - presence management Sends PRESENCE_UPDATE to clients when needed ''' class PresenceManager: def __init__(self, server): self.server = server async def update_presence(self, user_id, status): ''' PresenceManager.update_presence(user_id, status) Updates the pr...
mit
Python
02c59aa1d2eec43442f4bcf1d6662535e094bffd
add move pics by modified date
mcxiaoke/python-labs,mcxiaoke/python-labs,mcxiaoke/python-labs,mcxiaoke/python-labs,mcxiaoke/python-labs
media/pic_date_move.py
media/pic_date_move.py
''' File: pic_date_move.py Created: 2021-04-01 10:46:38 Modified: 2021-04-01 10:46:43 Author: mcxiaoke (github@mcxiaoke.com) License: Apache License 2.0 ''' import os import sys import shutil from datetime import date, datetime import pathlib def move_one_file(src_file): old_file = pathlib.Path(src_file) old...
apache-2.0
Python
3ae5dc9a4325251033d3db9cae0d80eb4812815d
Add lazy iterator
krishnasrinivas/minio-py,minio/minio-py,NitishT/minio-py,harshavardhana/minio-py,NitishT/minio-py,minio/minio-py,donatello/minio-py
minio/lazy_iterator.py
minio/lazy_iterator.py
# Minimal Object Storage Library, (C) 2015 Minio, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
Python
860f93d2bb4c08b63c64fe9e5b7b620b824d8490
test ++/--/+
smspillaz/pychecker,smspillaz/pychecker,smspillaz/pychecker
pychecker/pychecker2/utest/ops.py
pychecker/pychecker2/utest/ops.py
from pychecker2 import TestSupport from pychecker2 import OpChecks class OpTests(TestSupport.WarningTester): def testOperator(self): for op in ['--', '++']: self.warning('def f(x):\n' ' return %sx' % op, 2, OpChecks.OpCheck.operator, op) ...
bsd-3-clause
Python
58fee826ab5298f7de036bf320bbc109b853eec8
Add null check for sds sync thread which can be optional
Tendrl/commons,rishubhjain/commons,r0h4n/commons
tendrl/commons/manager/__init__.py
tendrl/commons/manager/__init__.py
import abc import logging import six from tendrl.commons import jobs LOG = logging.getLogger(__name__) @six.add_metaclass(abc.ABCMeta) class Manager(object): def __init__( self, sds_sync_thread, central_store_thread, ): self._central_store_thread = central_store_...
import abc import logging import six from tendrl.commons import jobs LOG = logging.getLogger(__name__) @six.add_metaclass(abc.ABCMeta) class Manager(object): def __init__( self, sds_sync_thread, central_store_thread, ): self._central_store_thread = central_store_...
lgpl-2.1
Python
27cce3b6708a17f813f0a82871c988fec3a36517
Add quart to contrib (#300)
rollbar/pyrollbar
rollbar/contrib/quart/__init__.py
rollbar/contrib/quart/__init__.py
""" Integration with Quart """ from quart import request import rollbar def report_exception(app, exception): rollbar.report_exc_info(request=request) def _hook(request, data): data['framework'] = 'quart' if request: data['context'] = str(request.url_rule) rollbar.BASE_DATA_HOOK = _hook
mit
Python
e5a39d4e17a0555cb242731b34f0ee480367b4fe
Add task that sends out notifications
stefanw/foireminder,stefanw/foireminder
foireminder/foireminder/reminders/tasks.py
foireminder/foireminder/reminders/tasks.py
from django.utils import timezone from .models import ReminderRequest, EmailReminder def send_todays_notifications(self): today = timezone.now() reminders = ReminderRequest.objects.filter( start__year=today.year, start__month=today.month, start__day=today.da ) for reminder in ...
mit
Python
9efda5a5a2b7aa16423e68fb10e1a0cb94c1f33e
Create rectangles_into_squares.py
Kunalpod/codewars,Kunalpod/codewars
rectangles_into_squares.py
rectangles_into_squares.py
#Kunal Gautam #Codewars : @Kunalpod #Problem name: Rectangles into Squares #Problem level: 6 kyu def sqInRect(lng, wdth): if lng==wdth: return None li=[] while lng and wdth: if lng>wdth: lng-=wdth li.append(wdth) else: wdth-=lng li.append(lng)...
mit
Python
c5fc38749dcf966787f6c6a201e23c310a22358c
Add script to update UniProt protein names
clulab/bioresources
src/main/resources/org/clulab/reach/update_uniprot.py
src/main/resources/org/clulab/reach/update_uniprot.py
import os import re import csv import requests import itertools from gilda.generate_terms import parse_uniprot_synonyms # Base URL for UniProt uniprot_url = 'http://www.uniprot.org/uniprot' # Get protein names, gene names and the organism columns = ['id', 'protein%20names', 'genes', 'organism'] # Only get reviewed en...
apache-2.0
Python
aeadfbd4ae1f915291328f040cda54f309743024
Add main application code
Elemental-IRCd/oline-gangnam-style,Elemental-IRCd/oline-gangnam-style
oline-gangnam-style.py
oline-gangnam-style.py
from jinja2 import Environment, FileSystemLoader import json import os import sys env = Environment(loader=FileSystemLoader(".")) template = env.get_template('ircd.conf.jinja') config = {} with open(sys.argv[1] if len(sys.argv) > 1 else "config.json", "r") as fin: config = json.loads(fin.read()) network = conf...
bsd-2-clause
Python
7a6b5396ce760eaa206bfb9b556a374c9c17f397
Add DecisionTree estimator.
LeartS/kaggle-competitions
bike-sharing/2-decision-tree.py
bike-sharing/2-decision-tree.py
import math import argparse from datetime import datetime import numpy as np from sklearn import cross_validation from sklearn import tree from sklearn import metrics def load_data(path, **kwargs): return np.loadtxt(path, **kwargs) def save_data(path, data, **kwargs): np.savetxt(path, data, **kwargs) def hou...
mit
Python
c58c58d5bf1394e04e30f5eeb298818558be027f
Add directory for tests of rules removin
PatrikValkovic/grammpy
tests/rules_tests/clearAfterNonTermRemove/__init__.py
tests/rules_tests/clearAfterNonTermRemove/__init__.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 17.08.2017 22:06 :Licence GNUv3 Part of grammpy """
mit
Python
9a7091c1502b9758c1492a1c99ace7d4ad74026c
move integer_divions to syntax
ratnania/pyccel,ratnania/pyccel
tests/pyccel/parser/scripts/syntax/integer_division.py
tests/pyccel/parser/scripts/syntax/integer_division.py
5 // 3 a // 3 5 // b a // b 5.// 3. a // 3. 5.// b a // b
mit
Python
17e0b81463e3c4c9b62f95f40912b270652a8e63
Create new package (#6376)
iulian787/spack,mfherbst/spack,EmreAtes/spack,matthiasdiener/spack,LLNL/spack,LLNL/spack,LLNL/spack,krafczyk/spack,matthiasdiener/spack,mfherbst/spack,tmerrick1/spack,EmreAtes/spack,krafczyk/spack,krafczyk/spack,iulian787/spack,iulian787/spack,EmreAtes/spack,tmerrick1/spack,LLNL/spack,krafczyk/spack,mfherbst/spack,tmer...
var/spack/repos/builtin/packages/r-ggridges/package.py
var/spack/repos/builtin/packages/r-ggridges/package.py
############################################################################## # Copyright (c) 2013-2017, 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
1c2292dcd47865a3dbd3f7b9adf53433f6f34770
Create new package. (#6215)
LLNL/spack,skosukhin/spack,tmerrick1/spack,krafczyk/spack,mfherbst/spack,matthiasdiener/spack,iulian787/spack,LLNL/spack,skosukhin/spack,matthiasdiener/spack,matthiasdiener/spack,krafczyk/spack,iulian787/spack,skosukhin/spack,iulian787/spack,krafczyk/spack,krafczyk/spack,EmreAtes/spack,mfherbst/spack,mfherbst/spack,iul...
var/spack/repos/builtin/packages/r-timedate/package.py
var/spack/repos/builtin/packages/r-timedate/package.py
############################################################################## # Copyright (c) 2013-2017, 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
5ba4fce42892634213bede09759bbca1cd56e346
add package py-brian2 (#3617)
iulian787/spack,iulian787/spack,matthiasdiener/spack,EmreAtes/spack,lgarren/spack,mfherbst/spack,matthiasdiener/spack,iulian787/spack,matthiasdiener/spack,skosukhin/spack,LLNL/spack,skosukhin/spack,mfherbst/spack,krafczyk/spack,iulian787/spack,krafczyk/spack,skosukhin/spack,mfherbst/spack,lgarren/spack,mfherbst/spack,s...
var/spack/repos/builtin/packages/py-brian2/package.py
var/spack/repos/builtin/packages/py-brian2/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
26525354e7bf2465a561a5172a0d9fef4205e77d
move column defs to singleton object
rlowrance/re-avm
chart06columns.py
chart06columns.py
'''define columns in all reports produced by chart06''' import numpy as np # all possible column definition _defs = { 'median_absolute_error': [6, '%6d', (' ', 'MAE'), 'median absolute error'], 'model': [5, '%5s', (' ', 'model'), 'model name (en = elastic net, gd = gradient boosting, rf = random...
bsd-3-clause
Python
32740172d4258a95145a5bb68be315fe1640db23
Add alpha version of bootstraps script
cpvargas/stacklib
bootstraps.py
bootstraps.py
''' Does N times random stacks of X maps of large L in pixels. At each stacks it gets the central temperature, makes a histogram for all stacks, then fits a normal distribution for the histogram. ''' N = 100000 X = 10 L = 16 import stacklib as sl import numpy as np from scipy.stats import norm import matplotlib.p...
mit
Python
a3bfe6b91cbd87cb4292e92d7bf1ac4a44afd462
Add struct.py mirroring C struct declarations.
kaushik94/tardis,Tobychev/tardis,kaushik94/tardis,Tobychev/tardis,orbitfold/tardis,orbitfold/tardis,Tobychev/tardis,kaushik94/tardis,kaushik94/tardis,orbitfold/tardis,orbitfold/tardis
tardis/montecarlo/struct.py
tardis/montecarlo/struct.py
from ctypes import Structure, POINTER, c_int, c_int64, c_double, c_ulong class RPacket(Structure): _fields_ = [ ('nu', c_double), ('mu', c_double), ('energy', c_double), ('r', c_double), ('tau_event', c_double), ('nu_line', c_double), ('current_shell_id', c_...
bsd-3-clause
Python
89b10996cfe6e60870e55b7c759aa73448bfa4d8
remove off curve pen
typemytype/RoboFontExamples
pens/removeOffcurvesPen.py
pens/removeOffcurvesPen.py
## use BasePen as base class from fontTools.pens.basePen import BasePen class RemoveOffcurvesPen(BasePen): """ A simple pen drawing a contour without any offcurves. """ def __init__(self, glyphSet): BasePen.__init__(self, glyphSet) self._contours = [] self._components =...
mit
Python
10952213496e8a1cbf80ba1eee7a0e968bdea14a
add missing test
puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq
corehq/ex-submodules/couchforms/tests/test_errors.py
corehq/ex-submodules/couchforms/tests/test_errors.py
from django.test import TestCase from casexml.apps.case.exceptions import IllegalCaseId from corehq.apps.receiverwrapper import submit_form_locally from couchforms.models import XFormError class CaseProcessingErrorsTest(TestCase): def test_no_case_id(self): """ submit form with a case block that h...
bsd-3-clause
Python
f120e2524f09ed462bca52dbc83863ba74291dd5
Fix backend import.
jodal/mopidy-gmusic,jeh/mopidy-gmusic,hechtus/mopidy-gmusic,elrosti/mopidy-gmusic,mopidy/mopidy-gmusic,jaibot/mopidy-gmusic,jaapz/mopidy-gmusic,Tilley/mopidy-gmusic
tests/test_extension.py
tests/test_extension.py
import unittest from mopidy_gmusic import GMusicExtension, actor as backend_lib class ExtensionTest(unittest.TestCase): def test_get_default_config(self): ext = GMusicExtension() config = ext.get_default_config() self.assertIn('[gmusic]', config) self.assertIn('enabled = true',...
import unittest from mopidy_gmusic import GMusicExtension, backend as backend_lib class ExtensionTest(unittest.TestCase): def test_get_default_config(self): ext = GMusicExtension() config = ext.get_default_config() self.assertIn('[gmusic]', config) self.assertIn('enabled = true...
apache-2.0
Python
b705c79b911ae201e9a79786e61ec36bd4a9be0f
add tests for revisions api
Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok
tests/test_revisions.py
tests/test_revisions.py
import datetime import json from werkzeug.exceptions import BadRequest from server.models import db, Backup, Group, Message, Version, Score from tests import OkTestCase class TestRevision(OkTestCase): """Tests revision API submission and scoring.""" def setUp(self): """ Add submissions for 3 users. ...
apache-2.0
Python
7e15f973f0ee898a0c06e50151ada675be46263d
add basic data, query method and method scaffolds
mrtazz/notifo.py
notifo/notifo.py
notifo/notifo.py
# encoding: utf-8 """ notifo.py - python wrapper for notifo.com """ import json import urllib import urllib2 class Notifo: """ Class for wrapping notifo.com """ def __init__(self, user, api_secret): self.user = user self.api_secret = api_secret self.root_url = "https://api.notifo.com/...
mit
Python
d40fb122d7083b9735728df15120ed682431be79
Create script for generating analysis seeds.
woodmd/haloanalysis,woodmd/haloanalysis
scripts/make_fhes_seeds.py
scripts/make_fhes_seeds.py
import yaml import sys import numpy as np from astropy.table import Table from astropy.coordinates import SkyCoord from fermipy.catalog import * from fermipy.utils import * def get_coord(name,tab): row = tab[tab['Source_Name'] == name] return SkyCoord(float(row['RAJ2000']), float(row['DEJ2000']),unit='deg') ...
bsd-3-clause
Python
9696acf13a6b25b1935b7fcaae5763db8e16e83a
Create MyoRemote.py
MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab
home/Alessandruino/MyoRemote.py
home/Alessandruino/MyoRemote.py
from com.thalmic.myo.enums import PoseType remote = Runtime.start("remote","RemoteAdapter") remote.setDefaultPrefix("raspi") remote.connect("tcp://192.168.0.5:6767") roll = 0.0 sleep(2) python.send("raspiarduino", "connect","/dev/ttyUSB0") sleep(1) python.send("raspiarduino", "digitalWrite",2,1) python.send("raspi...
apache-2.0
Python
6bd3869a2c2a6041e47da01ddaaa15b309bf90d7
Add example checkerscript
fausecteam/ctf-gameserver,fausecteam/ctf-gameserver,fausecteam/ctf-gameserver,fausecteam/ctf-gameserver,fausecteam/ctf-gameserver
checker/examples/dummyrunner.py
checker/examples/dummyrunner.py
#!/usr/bin/python3 import sys import time import os import codecs def generate_flag(tick, payload=None): if payload is None: sys.stdout.write("FLAG %d\n" % (tick,)) else: sys.stdout.write("FLAG %d %s\n" % (tick, codecs.encode(os.urandom(8), 'hex').decode('latin-1'))) sys.stdout.flush() ...
isc
Python
4a782b2930210053bcc2fc705d55e56af5900771
Create dispatch_curve_cooling_plant.py
architecture-building-systems/CEAforArcGIS,architecture-building-systems/CEAforArcGIS
cea/plots/supply_system/dispatch_curve_cooling_plant.py
cea/plots/supply_system/dispatch_curve_cooling_plant.py
""" Show a Pareto curve plot for individuals in a given generation. """ from __future__ import division from __future__ import print_function import plotly.graph_objs as go import cea.plots.supply_system from cea.plots.variable_naming import NAMING, COLOR __author__ = "Jimeno Fonseca" __copyright__ = "Copyright 2019...
mit
Python
3026c007a4f9cbb6befa1599c8a8390a96d8396b
test import checks
thomasvs/pychecker,akaihola/PyChecker,akaihola/PyChecker,thomasvs/pychecker
pychecker2/utest/import.py
pychecker2/utest/import.py
from pychecker2.TestSupport import WarningTester from pychecker2 import ImportChecks class ImportTestCase(WarningTester): def testImportChecks(self): self.silent('import sys; print sys.argv') self.silent('import pychecker2; print pychecker2') self.silent('import pychecker2.utest; print pych...
bsd-3-clause
Python
5219e970f1b09d8f2d41bf61a3b9f9803a8aed1d
Add database.py with working db find function
parisandmilo/Ko-lect-FoC2015,saulsmcouk/LostMyNameYRS2015,saulsmcouk/LostMyNameYRS2015,parisandmilo/Ko-lect-FoC2015,saulsmcouk/LostMyNameYRS2015,parisandmilo/Ko-lect-FoC2015
python-backend/database.py
python-backend/database.py
from pymongo import MongoClient client = MongoClient() client = MongoClient('localhost', 27017) # `community` database db = client.community; # Database find wrapper def db_find( db_collection, db_query, find_one = False ): # Get collection collection = db[db_collection] if (find_one): result = collect...
mit
Python
271dca123ff9bb3004cbd2cfa366f606dd250f94
Add test for configmap
fiaas/k8s
tests/k8s/test_configmap.py
tests/k8s/test_configmap.py
#!/usr/bin/env python # -*- coding: utf-8 import mock import pytest from k8s.client import NotFound from k8s.models.common import ObjectMeta from k8s.models.configmap import ConfigMap NAME = "my-name" NAMESPACE = "my-namespace" @pytest.mark.usefixtures("k8s_config") class TestIngress(object): def test_created_i...
apache-2.0
Python
db912d4097da45c2b14cce4f8f852cbc1e720750
add test framework
ahwagner/g2p-federated
tests/test_clientManager.py
tests/test_clientManager.py
from unittest import TestCase class TestClientManager(TestCase): def test_add_http_client(self): self.fail() def test_add_local_client(self): self.fail() def test_restrictClient(self): self.fail() def test_load_clients_from_config(self): self.fail() def test_fed...
apache-2.0
Python
401a1aabde600336bd129cce8fb3884ed8945272
Create HCS_interpreter.py
helton-hcs/hcs_programming_language
HCS_interpreter.py
HCS_interpreter.py
#!/usr/bin/env python3 from HCS import HCS def interpret_loop(): hcs = HCS() while True: print(">> ", end="") try: command = input() except EOFError as e: print() return if command in ['quit', 'exit']: return t...
apache-2.0
Python
d58d2c6bb2805c8ebc95fe3445dc973560de9c79
Create generate.py
pranshumalviya2/playwith_rnn
Names/generate.py
Names/generate.py
import numpy as np from keras.models import Sequential from keras.layers import Dense, Activation from keras.layers import LSTM from keras.callbacks import ModelCheckpoint from keras.utils import np_utils from random import randint inp = 'name.txt' with open(inp) as f: content = f.readlines() content = [x.lower()...
mit
Python
d4a04d4a0fffd8dbb006d86504fc3593ae800cc6
add bitly shorten function in proper directory
grahamhayes/will,mike-love/will,woohgit/will,dmuntean/will,mike-love/will,dmuntean/will,ammartins/will,skoczen/will,dmuntean/will,jacobbridges/will,pcurry/will,wontonst/will,mvanbaak/will,grahamhayes/will,Ironykins/will,pcurry/will,mvanbaak/will,chillipeper/will,wontonst/will,pcurry/will,woohgit/will,grahamhayes/will,f...
will/plugins/productivity/bitly.py
will/plugins/productivity/bitly.py
# coding: utf-8 import bitly_api # pip install bitly_api from will.plugin import WillPlugin from will.decorators import (respond_to, periodic, hear, randomly, route, rendered_template, require_settings) from will import settings # BITLY_ACCESS_TOKEN = ' <get_access_token_from_bitly....
mit
Python
6922ad3922d187a3e05d339a49449292a1d7efd6
add Prototype pattern
JakubVojvoda/design-patterns-python
prototype/Prototype.py
prototype/Prototype.py
# # Python Design Patterns: Prototype # Author: Jakub Vojvoda [github.com/JakubVojvoda] # 2016 # # Source code is licensed under MIT License # (for more details see LICENSE) # import sys import copy # # Prototype # declares an interface for cloning itself # class Prototype: def clone(self): pass def getTy...
mit
Python
841487ab4d0e05fa6f0780cf39973072417ec701
Complete cherry-pick of PR#95
CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend
service/management/commands/start_celery.py
service/management/commands/start_celery.py
import os from django.core.management.base import BaseCommand from subprocess import call class Command(BaseCommand): help = 'Custom manage.py command to start celery.' def handle(self, *args, **options): logfile = "celery_node.log" if not os.path.isfile(logfile): with open(logfile...
apache-2.0
Python
d1ee86414d45c571571d75434b8c2256b0120732
Add py solution for 563. Binary Tree Tilt
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
py/binary-tree-tilt.py
py/binary-tree-tilt.py
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def findTilt(self, root): """ :type root: TreeNode :rtype: int """ return self.do...
apache-2.0
Python
34bfea59b600f9dac457e2a16a812ce2fb768d15
Add graph.py to collect runtime data on workers and tasks (#8)
matyasselmeci/dask_condor,matyasselmeci/dask_condor
chtc/graph.py
chtc/graph.py
#!/usr/bin/env python from __future__ import print_function import csv import itertools import time from distributed import Client START_TIMEOUT = 900 # 15 min MAX_COLLECT_TIME = 86400 # 1 day def running_task_list(cli): return list(itertools.chain.from_iterable(cli.processing().values())) cli = Client('1...
apache-2.0
Python
925ff38344b5058ce196877e1fdcf79a1d1f6719
Add basic test for checking messages are received correctly
m2u/m2u
ue4/tests/test_messaging.py
ue4/tests/test_messaging.py
import pytest from m2u.ue4 import connection def test_send_message_size(): """Send a big message, larger than buffer size, so the server has to read multiple chunks. """ message = "TestMessageSize " + ("abcdefg" * 5000) connection.connect() result = connection.send_message(message) asser...
mit
Python
ff700e5d6fc5e0c5062f687110563d7f0312a3f0
Set up test suite to ensure server admin routes are added.
sheagcraig/sal,salopensource/sal,salopensource/sal,sheagcraig/sal,salopensource/sal,sheagcraig/sal,sheagcraig/sal,salopensource/sal
server/tests/test_admin.py
server/tests/test_admin.py
"""General functional tests for the API endpoints.""" from django.test import TestCase, Client # from django.urls import reverse from rest_framework import status from server.models import ApiKey, User # from api.v2.tests.tools import SalAPITestCase class AdminTest(TestCase): """Test the admin site is configu...
apache-2.0
Python
2913d840b63746669ac5695bd244abd6db24fe5a
Create script that prepares LaGeR strings for use with a machine learning training algorithms
andresodio/lager,andresodio/lager,andresodio/lager,andresodio/lager
lager_ml/lager_training_prep.py
lager_ml/lager_training_prep.py
#!/usr/bin/env python3 # This program prepares LaGeR strings for use with a machine learning training # algorithm. # # It expands the string or set of strings to specific length (number of # features), then generates variants for each of those. Finally, it converts # the variants into numbers and adds the result to a ...
mit
Python
352379690275e970693a06ed6981f530b6704354
Add index to Task.status
dropbox/changes,dropbox/changes,dropbox/changes,dropbox/changes
migrations/versions/181adec926e2_add_status_index_to_task.py
migrations/versions/181adec926e2_add_status_index_to_task.py
"""Add status index to task Revision ID: 181adec926e2 Revises: 43397e521791 Create Date: 2016-10-03 17:41:44.038137 """ # revision identifiers, used by Alembic. revision = '181adec926e2' down_revision = '43397e521791' from alembic import op def upgrade(): op.create_index('idx_task_status', 'task', ['status'],...
apache-2.0
Python
6ccf99966461bd8545654084584d58093dac03d5
Add missing version file
pyranges/pyrle,pyranges/pyrle
pyrle/version.py
pyrle/version.py
__version__ = "0.0.17"
mit
Python
f4e08d41d53cf74f8a53efeb7e238de6a98946cc
add script to find allreferenced hashes
trshaffer/cvmfs,djw8605/cvmfs,alhowaidi/cvmfsNDN,DrDaveD/cvmfs,DrDaveD/cvmfs,MicBrain/cvmfs,djw8605/cvmfs,cvmfs/cvmfs,trshaffer/cvmfs,cvmfs-testing/cvmfs,trshaffer/cvmfs,djw8605/cvmfs,Moliholy/cvmfs,Gangbiao/cvmfs,cvmfs-testing/cvmfs,trshaffer/cvmfs,Gangbiao/cvmfs,alhowaidi/cvmfsNDN,Moliholy/cvmfs,reneme/cvmfs,reneme/c...
add-ons/tools/get_referenced_hashes.py
add-ons/tools/get_referenced_hashes.py
#!/usr/bin/env python import sys import cvmfs def usage(): print sys.argv[0] + " <local repo name | remote repo url> [root catalog]" print "This script walks the catalogs and generates a list of all referenced content hashes." # get referenced hashes from a single catalog (files, chunks, nested catalogs) def...
bsd-3-clause
Python
df852b2ee81756fa62a98e425e156530333bf5a1
add migration to change order of participation choices
liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin
meinberlin/apps/plans/migrations/0033_change_order_participation_choices.py
meinberlin/apps/plans/migrations/0033_change_order_participation_choices.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-01-28 13:27 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('meinberlin_plans', '0032_rename_topic_field'), ] operations = [ migrations...
agpl-3.0
Python
92debba4bb0b0064b865a53b40476effa4d09c78
Undo Framework example
satishgoda/learningqt,satishgoda/learningqt
pyside/demos/framework/undo/document.py
pyside/demos/framework/undo/document.py
from collections import namedtuple from PySide.QtGui import QWidget, QPalette, QPainter from PySide.QtCore import Qt, QRect ShapeType = namedtuple('ShapeType', 'Rectangle Circle Triangle')(*range(3)) class Shape(object): def __init__(self, type=ShapeType.Rectangle, color=Qt.red, rect=QRect()): self._ty...
mit
Python
fe08242647962af0fdfab0ce34417b6a6079ed65
add another import now missing
drufat/sympy,drufat/sympy,chaffra/sympy,chaffra/sympy,postvakje/sympy,Titan-C/sympy,kaushik94/sympy,mafiya69/sympy,rahuldan/sympy,yashsharan/sympy,jerli/sympy,sampadsaha5/sympy,jaimahajan1997/sympy,aktech/sympy,madan96/sympy,jerli/sympy,jaimahajan1997/sympy,ChristinaZografou/sympy,postvakje/sympy,souravsingh/sympy,yash...
sympy/strategies/tests/test_traverse.py
sympy/strategies/tests/test_traverse.py
from sympy.strategies.traverse import (top_down, bottom_up, sall, top_down_once, bottom_up_once, basic_fns) from sympy.strategies.util import expr_fns from sympy import Basic, symbols, Symbol, S zero_symbols = lambda x: S.Zero if isinstance(x, Symbol) else x x,y,z = symbols('x,y,z') def test_sall(): zero_...
from sympy.strategies.traverse import (top_down, bottom_up, sall, top_down_once, bottom_up_once, expr_fns, basic_fns) from sympy import Basic, symbols, Symbol, S zero_symbols = lambda x: S.Zero if isinstance(x, Symbol) else x x,y,z = symbols('x,y,z') def test_sall(): zero_onelevel = sall(zero_symbols) ...
bsd-3-clause
Python
0c29b431a0f5ce9115d7acdcaaabbd27546949c6
Add test for contact success view.
cdriehuys/chmvh-website,cdriehuys/chmvh-website,cdriehuys/chmvh-website
chmvh_website/contact/tests/views/test_success_view.py
chmvh_website/contact/tests/views/test_success_view.py
from django.test import RequestFactory from django.urls import reverse from contact.views import SuccessView class TestSuccessView(object): """Test cases for the success view""" url = reverse('contact:success') def test_get(self, rf: RequestFactory): """Test sending a GET request to the view. ...
mit
Python
f66a60411b4e1cb30ac1fde78735ba38e99289cf
Create cfprefs.py
dataJAR/jnuc2016
cfprefs.py
cfprefs.py
#!/usr/bin/python import CoreFoundation domain = 'com.apple.appstore' key = 'restrict-store-require-admin-to-install' key_value = CoreFoundation.CFPreferencesCopyAppValue(key, domain) print 'Key Value = ', key_value key_forced = CoreFoundation.CFPreferencesAppValueIsForced(key, domain) print 'Key Forced = ', key_f...
apache-2.0
Python
e5fecce2693056ac53f7d34d00801829ea1094c3
add JPEG decoder CPU perf bench
yao-matrix/mProto,yao-matrix/mProto,yao-matrix/mProto,yao-matrix/mProto,yao-matrix/mProto
tools/jpegdec_perf/reader_perf_multi.py
tools/jpegdec_perf/reader_perf_multi.py
import cv2 import os from turbojpeg import TurboJPEG, TJPF_GRAY, TJSAMP_GRAY, TJFLAG_PROGRESSIVE import time import threading # specifying library path explicitly # jpeg = TurboJPEG(r'D:\turbojpeg.dll') # jpeg = TurboJPEG('/usr/lib64/libturbojpeg.so') # jpeg = TurboJPEG('/usr/local/lib/libturbojpeg.dylib') # using de...
apache-2.0
Python
4e5c0ea499dd596d3719717166172113e7209d1e
check in script, authored by Joseph Bisch
Winetricks/winetricks,Winetricks/winetricks
src/github-api-releases.py
src/github-api-releases.py
# Homepage: https://github.com/josephbisch/test-releases-api/blob/master/github-api-releases.py # # Copyright # Copyright (C) 2016 Joseph Bisch <joseph.bisch AT gmail.com> # # License # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # L...
lgpl-2.1
Python
e10f6ebf9eba5cf734bbeead68a3b36f9db8dae8
add ridesharing
kinnou02/navitia,xlqian/navitia,Tisseo/navitia,pbougue/navitia,pbougue/navitia,Tisseo/navitia,xlqian/navitia,kinnou02/navitia,Tisseo/navitia,kinnou02/navitia,CanalTP/navitia,Tisseo/navitia,CanalTP/navitia,kinnou02/navitia,xlqian/navitia,pbougue/navitia,xlqian/navitia,xlqian/navitia,pbougue/navitia,CanalTP/navitia,Canal...
source/jormungandr/jormungandr/street_network/ridesharing.py
source/jormungandr/jormungandr/street_network/ridesharing.py
# Copyright (c) 2001-2016, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public t...
agpl-3.0
Python
c650d64247d63d2af7a8168795e7edae5c9ef6ef
Add realtime chart plotting example
voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts
realtime-plot.py
realtime-plot.py
import time, random import math from collections import deque start = time.time() class RealtimePlot: def __init__(self, axes, max_entries = 100): self.axis_x = deque(maxlen=max_entries) self.axis_y = deque(maxlen=max_entries) self.axes = axes self.max_entries = max_entries ...
mit
Python
8ae82037dde45019cae8912f45a36cf3a362c444
Revert "HAProxy uses milliseconds ..."
stackforge/python-openstacksdk,openstack/python-openstacksdk,dtroyer/python-openstacksdk,openstack/python-openstacksdk,stackforge/python-openstacksdk,dtroyer/python-openstacksdk,briancurtin/python-openstacksdk,briancurtin/python-openstacksdk
openstack/network/v2/health_monitor.py
openstack/network/v2/health_monitor.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
Python
f7e4ca11c7bfc35bf0fd6becd2a5d5fdd2ca5ed5
Add a script to split data with partitions.
juckele/ddr-grader,juckele/ddr-grader
src/main/python/partition_data.py
src/main/python/partition_data.py
import csv; import random; import sys; in_file = str(sys.argv[1]) out_file = str(sys.argv[2]) num_partitions = int(sys.argv[3]) header = []; partitions = []; for i in range(num_partitions): partitions.append([]) # Load all the training rows row_num = 0; with open(in_file) as file: reader = csv.reader(file); ...
mit
Python
dc76e7c085e7462d75567bf3d0228defb6bbbc58
Add tests for converter
stormaaja/csvconverter,stormaaja/csvconverter,stormaaja/csvconverter
tests/test_csv_converter.py
tests/test_csv_converter.py
import os import sys sys.path.insert(0, os.path.dirname(__file__)) sys.path.insert(1, os.path.dirname("..")) import unittest from csv_converter import CsvConverter class TestCsvConverter(unittest.TestCase): def test_parse_csv(self): converter = CsvConverter("tests/data/data_1.csv") converter.setS...
mit
Python
645507ed9ec43b354880673fbc75afe169ef6697
Add test capturing bad implementation of contains handler.
jawilson/pmxbot,jawilson/pmxbot
tests/unit/test_handlers.py
tests/unit/test_handlers.py
from pmxbot import core def test_contains_always_match(): """ Contains handler should always match if no rate is specified. """ handler = core.ContainsHandler(name='#', func=None) assert handler.match('Tell me about #foo', channel='bar')
bsd-3-clause
Python
d61c42221774f36477b1288396f4e7e7337e905c
add data migration
eldarion/formly,eldarion/formly
formly/migrations/0012_fix_multi_text_answer_data.py
formly/migrations/0012_fix_multi_text_answer_data.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2018-01-23 13:46 from __future__ import unicode_literals import json from django.db import migrations def migrate_data(apps, schema_editor): FieldResult = apps.get_model("formly", "FieldResult") # alias for Field.MULTIPLE_TEXT MULTIPLE_TEXT_TYPE = 8...
bsd-3-clause
Python
a1f864de0c5e71f0e9dc0ff4a23dc8101556832b
add new script
open-rdc/icart_mini,open-rdc/icart,open-rdc/icart_mini,open-rdc/icart
icart_mini_navigation/scripts/navigation_strategy.py
icart_mini_navigation/scripts/navigation_strategy.py
#!/usr/bin/env python # -*- coding: utf-8 -*- try: import roslib; roslib,load_manifest('rospeex_if') except: pass import rospy import re from rospeex_if import ROSpeexInterface from std_msgs.msg import String syscommand_pub = rospy.Publisher('syscommand', String, queue_size=10) rospy.init_node('navigation_s...
bsd-2-clause
Python
b3e9075e819402f93f7dc2e29b61e3e621ab7355
Add unit tests for avging imputations
eltonlaw/impyute
impy/imputations/tests/test_averaging_imputations.py
impy/imputations/tests/test_averaging_imputations.py
"""test_averaging_imputations.py""" import unittest import numpy as np from impy.imputations import mean_imputation from impy.imputations import mode_imputation from impy.imputations import median_imputation from impy.datasets import random_int class TestAveraging(unittest.TestCase): """ Tests for Averaging """ ...
mit
Python
dd784f9035f66fd7d4febb8e43a09353821312b9
add solution for Kth Largest Element in an Array
zhyu/leetcode,zhyu/leetcode
algorithms/KthLargestElementInAnArray/KthLargestElementInAnArray.py
algorithms/KthLargestElementInAnArray/KthLargestElementInAnArray.py
class Solution: # @param {integer[]} nums # @param {integer} k # @return {integer} def findKthLargest(self, nums, k): k = len(nums) - k def quickselect(st, ed): pivot = nums[ed] pos = st for i in xrange(st, ed): if nums[i] < pivot: ...
mit
Python
d3afe17fa3f259e2b09f76e4b486e4cbf9e659c3
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
aa411ddcd62b824c0bfe8660c795b71e6e6929ea
add reset command.
grue/django-axes,svenhertle/django-axes,django-pci/django-axes,SteveByerly/django-axes,nidhi-delhivery/django-axes,zoten/django-axes,SteveByerly/django-axes,jazzband/django-axes
axes/utils.py
axes/utils.py
from axes.models import AccessAttempt def reset(ip=None, silent=False): if not ip: attempts = AccessAttempt.objects.all() if attempts: for attempt in AccessAttempt.objects.all(): attempt.delete() else: if not silent: print 'No attempts...
mit
Python
ceb8a32637bc0fd9ab0517be7f025755e19ec2c7
add leetcode Excel Sheet Column Number
Fity/2code,Fity/2code,Fity/2code,Fity/2code,Fity/2code,Fity/2code
leetcode/ExcelSheetColumnNumber/solution.py
leetcode/ExcelSheetColumnNumber/solution.py
# -*- coding:utf-8 -*- class Solution: # @param s, a string # @return an integer def titleToNumber(self, s): col = 0 for c in s: col = col * 26 + ord(c) - ord('A') + 1 return col
mit
Python