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
34fff4bf13fa2c4d481a06339981db08239138ae
add test case of petitlyrics
franklai/lyric-get,franklai/lyric-get,franklai/lyric-get,franklai/lyric-get
lyric_engine/tests/test_petitlyrics.py
lyric_engine/tests/test_petitlyrics.py
# coding: utf-8 import os import sys module_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'modules') sys.path.append(module_dir) import unittest from petitlyrics import PetitLyrics as Lyric class PetitLyricsTest(unittest.TestCase): def test_url_01(self): url = 'http://petitlyrics.c...
mit
Python
16fd4ba06b6da8ec33a83a8cfe2e38a130fb47b3
Add a module for common plotting routines that will be used.
dalepartridge/seapy,ocefpaf/seapy,powellb/seapy
plot.py
plot.py
#!/usr/bin/env python """ plot.py State Estimation and Analysis for PYthon Module with plotting utilities Written by Brian Powell on 10/18/13 Copyright (c)2013 University of Hawaii under the BSD-License. """ from __future__ import print_function import numpy as np from scipy import ndimage import os imp...
mit
Python
94d40dfcf574d61df7def99a43d5b9fa0c75e244
Add py solution for 406. Queue Reconstruction by Height
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
py/queue-reconstruction-by-height.py
py/queue-reconstruction-by-height.py
from collections import defaultdict class Solution(object): def insert(self, now, p, front): lsize = 0 if now.left is None else now.left.val[1] if front <= lsize: if now.left is None: now.left = TreeNode((p, 1)) else: self.insert(now.left, p, f...
apache-2.0
Python
8fb97711dd84512a8a654de3dca2bee24689a2a7
add a test for pytestmark
s0undt3ch/pytest-tornado,eugeniy/pytest-tornado
pytest_tornado/test/test_fixtures.py
pytest_tornado/test/test_fixtures.py
import pytest from tornado import gen _used_fixture = False @gen.coroutine def dummy(io_loop): yield gen.Task(io_loop.add_callback) raise gen.Return(True) @pytest.fixture(scope='module') def preparations(): global _used_fixture _used_fixture = True pytestmark = pytest.mark.usefixtures('preparatio...
apache-2.0
Python
76ce9117ed92a743734cd5ba7e209617a7664ad1
Add partial benchmarking file for gala
janelia-flyem/gala,jni/gala
benchmarks/bench_gala.py
benchmarks/bench_gala.py
import os from gala import imio, features, agglo, classify rundir = os.path.dirname(__file__) dd = os.path.abspath(os.path.join(rundir, '../tests/example-data')) em3d = features.default.paper_em() def setup_trdata(): wstr = imio.read_h5_stack(os.path.join(dd, 'train-ws.lzf.h5')) prtr = imio.read_h5_stack...
bsd-3-clause
Python
79fb9449da73e70ef7ed9e1e6862da41fc42ab75
Add finalized source codes
chpoon92/network-analysis-2-anaconda-python
src/hw1.py
src/hw1.py
import networkx as nx import numpy as np import matplotlib.pyplot as plt import pylab G = nx.Graph() G.add_edges_from([('1','2'),('1','4'),('2','3'),('2','4'),('3','4'),('4','5'),('5','6'),('5','7'),('6','7')]) # create the graph print G.nodes(), '\n', G.edges(), '\n', G.degree().values() # check graph is correct ...
mit
Python
180faadb24bf3b4d153f1c46c4883bdcc0b987ff
add a manifest (.cvmfspublished) abstraction class
djw8605/cvmfs,cvmfs-testing/cvmfs,DrDaveD/cvmfs,cvmfs/cvmfs,trshaffer/cvmfs,cvmfs-testing/cvmfs,cvmfs-testing/cvmfs,alhowaidi/cvmfsNDN,trshaffer/cvmfs,cvmfs/cvmfs,DrDaveD/cvmfs,Gangbiao/cvmfs,alhowaidi/cvmfsNDN,trshaffer/cvmfs,Gangbiao/cvmfs,djw8605/cvmfs,djw8605/cvmfs,DrDaveD/cvmfs,DrDaveD/cvmfs,djw8605/cvmfs,MicBrain...
python/cvmfs/manifest.py
python/cvmfs/manifest.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created by René Meusel This file is part of the CernVM File System auxiliary tools. """ import datetime class UnknownManifestField: def __init__(self, key_char): self.key_char = key_char def __str__(self): return self.key_char class ManifestV...
bsd-3-clause
Python
e044dceeb4f6dd91a1e29228cde7906a114f36ba
add ping-listener.py
it-forensics/forensics
src/ping-listener.py
src/ping-listener.py
#!/usr/bin/python # This tool is for educational use only! # Description: Listen on a networkinterface for incomming pings (ICMP packets) # and display this pings on the console # Requirements: scapy + root privileges import sys from scapy.all import * from pprint import * def printusage(): """ Prints usage info...
mit
Python
a2dd80d7bcd1096b554c43d085eabe1eb858fec8
Add code to create test data
berkeley-stat159/project-delta
code/make_test_data.py
code/make_test_data.py
from __future__ import absolute_import, division, print_function import nibabel as nib import numpy as np import os # Paths to directories containing the test subject's data path_data = "../data/ds005/testsub/" path_BOLD = path_data + "BOLD/task001_testrun/bold.nii.gz" path_behav = path_data + "behav/task001_testrun/...
bsd-3-clause
Python
f2fb5fc41c78ac7722812aa1cdb54078bcbc70fe
Add Node test cases
kovacsbalu/coil,kovacsbalu/coil,tectronics/coil,marineam/coil,tectronics/coil,marineam/coil
coil/test/test_node.py
coil/test/test_node.py
"""Tests for coil.struct.Node""" import unittest from coil import errors from coil.struct import Node class BasicTestCase(unittest.TestCase): def testInit(self): r = Node() a = Node(r, "a") b = Node(a, "b") self.assertEquals(b.node_name, "b") self.assertEquals(b.node_path,...
mit
Python
942b7c519a07a84c7f26077b78c23c60174e1141
Add VCF precalculator
geary/claslite,geary/claslite,geary/claslite,geary/claslite
scripts/precalc.py
scripts/precalc.py
# -*- coding: utf-8 -*- ''' Earth Engine precalculator for CLASlite Requires Python 2.6+ Public Domain where allowed, otherwise: Copyright 2010 Michael Geary - http://mg.to/ Use under MIT, GPL, or any Open Source license: http://www.opensource.org/licenses/ ''' import cgi, json, os, sys, time, urllib2 sys.pat...
unlicense
Python
8b9a8f6443c1a5e184ececa4ec03baabca0973de
Add support for Pocket
foauth/foauth.org,foauth/foauth.org,foauth/oauth-proxy,foauth/foauth.org
services/pocket.py
services/pocket.py
from werkzeug.urls import url_decode import requests import foauth.providers class Pocket(foauth.providers.OAuth2): # General info about the provider provider_url = 'http://getpocket.com/' docs_url = 'http://getpocket.com/developer/docs/overview' category = 'News' # URLs to interact with the API ...
bsd-3-clause
Python
8244d71a41032e41bd79741ec649fa78c6317efa
add mixins for tweaking smartmin behavior more easily
caktus/smartmin,nyaruka/smartmin,caktus/smartmin,nyaruka/smartmin,caktus/smartmin,nyaruka/smartmin,caktus/smartmin
smartmin/mixins.py
smartmin/mixins.py
# simple mixins that keep you from writing so much code class PassRequestToFormMixin(object): def get_form_kwargs(self): kwargs = super(PassRequestToFormMixin, self).get_form_kwargs() kwargs['request'] = self.request return kwargs
bsd-3-clause
Python
32dd2099f97add61cb31df7af796876a95695bb1
Add a sample permission plugin for illustrating the check on realm resources, related to #6211.
jun66j5/trac-ja,netjunki/trac-Pygit2,walty8/trac,jun66j5/trac-ja,walty8/trac,walty8/trac,jun66j5/trac-ja,walty8/trac,jun66j5/trac-ja,netjunki/trac-Pygit2,netjunki/trac-Pygit2
sample-plugins/public_wiki_policy.py
sample-plugins/public_wiki_policy.py
from fnmatch import fnmatchcase from trac.config import Option from trac.core import * from trac.perm import IPermissionPolicy class PublicWikiPolicy(Component): """Sample permission policy plugin illustrating how to check permission on realms. Don't forget to integrate that plugin in the appropriate pl...
bsd-3-clause
Python
1c39eb113be409ff304a675ef8a85e96a97b1d87
Add files via upload
EvanMPutnam/RIT_BrickHack_2017_3,EvanMPutnam/RIT_BrickHack_2017_3
basicTwitter.py
basicTwitter.py
''' RIT SPEX: Twitter posting basic. Basic python script for posting to twitter. Pre-Req: Python3 Tweepy library twitter Contributors: Evan Putnam Henry Yaeger John LeBrun Helen O'Connell ''' import tweepy #Tweet a picutre def tweetPicture(api ,picUrl): api.update_with_media(picUrl) ...
mit
Python
eb170653e64c5a874a773dc37c99dccb4dd42608
Add tools.color module (#41, #36))
a5kin/hecate,a5kin/hecate
xentica/tools/color.py
xentica/tools/color.py
"""A collection of color conversion helpers.""" def hsv2rgb(hue, sat, val): """ Convert HSV color to RGB format. :param hue: Hue value [0, 1] :param sat: Saturation value [0, 1] :param val: Brightness value [0, 1] :returns: tuple (red, green, blue) """ raise NotImplementedError de...
mit
Python
1d5f1576a5f92c1917fa29c457e4b7ad055f41ca
Add info for mono@5.4.0.167 (#5405)
EmreAtes/spack,matthiasdiener/spack,LLNL/spack,TheTimmy/spack,krafczyk/spack,LLNL/spack,EmreAtes/spack,lgarren/spack,skosukhin/spack,mfherbst/spack,EmreAtes/spack,tmerrick1/spack,matthiasdiener/spack,lgarren/spack,tmerrick1/spack,EmreAtes/spack,LLNL/spack,iulian787/spack,TheTimmy/spack,iulian787/spack,mfherbst/spack,lg...
var/spack/repos/builtin/packages/mono/package.py
var/spack/repos/builtin/packages/mono/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-6...
############################################################################### # 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-6...
lgpl-2.1
Python
d03edd6670c130925fa8b947ebde03f2026602c3
remove redundant verbose prints
xfxf/veyepar,yoe/veyepar,CarlFK/veyepar,EricSchles/veyepar,EricSchles/veyepar,yoe/veyepar,yoe/veyepar,xfxf/veyepar,yoe/veyepar,xfxf/veyepar,CarlFK/veyepar,EricSchles/veyepar,yoe/veyepar,xfxf/veyepar,EricSchles/veyepar,CarlFK/veyepar,CarlFK/veyepar,xfxf/veyepar,EricSchles/veyepar,CarlFK/veyepar
dj/scripts/mk_public.py
dj/scripts/mk_public.py
#!/usr/bin/python # mk_public.py - flip state on hosts from private to public # private = not listed, can be seen if you know the url # the presenters have been emaild the URL, # they are encouraged to advertise it. # public = advertised, it is ready for the world to view. # It will be tweeted at @NextD...
#!/usr/bin/python # mk_public.py - flip state on hosts from private to public # private = not listed, can be seen if you know the url # the presenters have been emaild the URL, # they are encouraged to advertise it. # public = advertised, it is ready for the world to view. # It will be tweeted at @NextD...
mit
Python
197fb6ec004c0bf47ec7e2fd25b75564a3ecf6c4
Add tests for logging of rest requests
RafaelPalomar/girder,manthey/girder,manthey/girder,Kitware/girder,girder/girder,kotfic/girder,jbeezley/girder,manthey/girder,Kitware/girder,data-exp-lab/girder,jbeezley/girder,data-exp-lab/girder,Kitware/girder,RafaelPalomar/girder,kotfic/girder,girder/girder,RafaelPalomar/girder,kotfic/girder,manthey/girder,RafaelPalo...
test/audit_logs/test_audit_log.py
test/audit_logs/test_audit_log.py
import datetime import pytest from girder import auditLogger @pytest.fixture def recordModel(): from girder.plugins.audit_logs import Record yield Record() @pytest.fixture def resetLog(): yield auditLogger for handler in auditLogger.handlers: auditLogger.removeHandler(handler) @pytest.mar...
apache-2.0
Python
9e96a7ff9ad715f58d07341bd571e63ef233ffdb
Create fizzbuzz.py
vladshults/python_modules,vladshults/python_modules
job_interview_algs/fizzbuzz.py
job_interview_algs/fizzbuzz.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- ''' Created on 24 02 2016 @author: vlad ''' def multiple_of_3(number): return number % 3 == 0 def multiple_of_5(number): return number % 5 == 0 for i in range(1, 100): if not multiple_of_3(i) and not multiple_of_5(i): print i continue ...
mit
Python
8089750d5dccadb0603068eefec869df4f8360cc
Add fizzbuzz.py in strings folder
keon/algorithms,amaozhao/algorithms
strings/fizzbuzz.py
strings/fizzbuzz.py
""" Wtite a function that returns an array containing the numbers from 1 to N, where N is the parametered value. N will never be less than 1. Replace certain values however if any of the following conditions are met: If the value is a multiple of 3: use the value 'Fizz' instead If the value is a multiple of 5: use t...
mit
Python
9ea3c14983c7b2e32132f1ffe6bbbe7b4d19000c
Add Flyweight.py
MoriokaReimen/DesignPattern,MoriokaReimen/DesignPattern
Python/Flyweight/Flyweight.py
Python/Flyweight/Flyweight.py
#! /usr/bin/python # -*- coding: utf-8 -*- ''' Flyweight Pattern Author: Kei Nakata Data: Oct.14.2014 ''' class FlyweightFactory(object): def __init__(self): self.instances = dict() def getInstance(self, a, b): if (a, b) not in self.instances: self.instances[(a,b)] = Flyweight(a, b...
mit
Python
868a771e0ba049edd55ddf38db852c4d34824297
Add pod env tests
polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon
tests/test_spawner/test_pod_environment.py
tests/test_spawner/test_pod_environment.py
from unittest import TestCase from scheduler.spawners.templates.pod_environment import ( get_affinity, get_node_selector, get_tolerations ) class TestPodEnvironment(TestCase): def test_pod_affinity(self): assert get_affinity(None, None) is None assert get_affinity({'foo': 'bar'}, None...
apache-2.0
Python
1c1e933fa9c6af1aa9d73f276ac7b79c2b86bdc3
add svn-clean-external-file.py
peutipoix/dotfiles,peutipoix/dotfiles
scripts/svn-clean-external-file.py
scripts/svn-clean-external-file.py
# written by Thomas Watnedal # http://stackoverflow.com/questions/239340/automatically-remove-subversion-unversioned-files import os import re def removeall(path): if not os.path.isdir(path): os.remove(path) return files=os.listdir(path) for x in files: fullpath=os.path.join(path, ...
unlicense
Python
3ef1e39d476a8b3e41ff0b06dcd6f700c083682d
Add an ABC for all sub classes of `DataController`
MaT1g3R/Roboragi
data_controller/abc.py
data_controller/abc.py
from typing import Dict, Optional from data_controller.enums import Medium, Site from utils.helpers import await_func class DataController: """ An ABC for all classes that deals with database read write. """ __slots__ = () def get_identifier(self, query: str, medium: Mediu...
mit
Python
2ce67897ade1ce8ae8b0fd00671fe61f4164a2bc
Add missing migration
mikkokeskinen/tunnistamo,mikkokeskinen/tunnistamo
oidc_apis/migrations/0002_add_multiselect_field_ad_groups_option.py
oidc_apis/migrations/0002_add_multiselect_field_ad_groups_option.py
# Generated by Django 2.0.9 on 2018-10-15 08:08 from django.db import migrations import multiselectfield.db.fields class Migration(migrations.Migration): dependencies = [ ('oidc_apis', '0001_initial'), ] operations = [ migrations.AlterField( model_name='api', nam...
mit
Python
785a5767ee3482fddee37327b4bf3edeed94ff46
Add shootout attempt item definition
leaffan/pynhldb
db/shootout_attempt.py
db/shootout_attempt.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import uuid from db.common import Base from db.specific_event import SpecificEvent from db.player import Player from db.team import Team class ShootoutAttempt(Base, SpecificEvent): __tablename__ = 'shootout_attempts' __autoload__ = True STANDARD_ATTRS = [ ...
mit
Python
1dcf698a286dcdf0f2c5a70d3e9bb2b32d046604
add TestBEvents, currently skipped
alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl,TaiSakuma/AlphaTwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl
tests/unit/Events/test_BEvents.py
tests/unit/Events/test_BEvents.py
from AlphaTwirl.Events import BEvents as Events from AlphaTwirl.Events import Branch import unittest import ROOT ##____________________________________________________________________________|| inputPath = '/Users/sakuma/work/cms/c150130_RA1_data/c150130_01_PHYS14/20150331_SingleMu/TTJets/treeProducerSusyAlphaT/tree.r...
bsd-3-clause
Python
05a8129787d32bb605fee9b85c1c11e8c582c43e
Add messages utility tests
Brickstertwo/git-commands
tests/unit/utils/test_messages.py
tests/unit/utils/test_messages.py
import mock import sys import unittest from bin.commands.utils import messages class TestMessages(unittest.TestCase): def setUp(self): # store private methods so they can be restored after tests that mock them self._print = messages._print def tearDown(self): messages._print = self....
mit
Python
adf65027521124ea89e9c6c5ee2baf7366b2da46
Add example settings file for makam extractors
MTG/pycompmusic
compmusic/extractors/makam/settings.example.py
compmusic/extractors/makam/settings.example.py
token = "" # Dunya API Token
agpl-3.0
Python
9722bc3fc0a3cf8c95e91571b4b085e07e5a124c
Create 6kyu_message_from_aliens.py
Orange9000/Codewars,Orange9000/Codewars
Solutions/6kyu/6kyu_message_from_aliens.py
Solutions/6kyu/6kyu_message_from_aliens.py
import re from collections import Counter d={ '|-|':'h', '[-':'e', '()':'o', '3]':'b', '_|':'l', '|':'i', '^|':'p', '/`':'y', ')(':'o', '?/':'r', '\/':'a', '|\|':'n', '</':'k', '~|~':'t', '=/':'f', ')|':'d', '|_|':'u', '(':'c', '-[':'e', '~\_':'s', '-[':'e', ']3':'b', '_/~':'z', '/\\/\\':'w', '<>':'x', '/\\':'v', '|/\...
mit
Python
125c75ea246c2d95f0addbb31b2d82dde588f21d
Add a unit test for KaggleKernelCredentials.
Kaggle/docker-python,Kaggle/docker-python
tests/test_kaggle_kernel_credentials.py
tests/test_kaggle_kernel_credentials.py
import unittest from kaggle_secrets import GcpTarget from kaggle_gcp import KaggleKernelCredentials class TestKaggleKernelCredentials(unittest.TestCase): def test_default_target(self): creds = KaggleKernelCredentials() self.assertEqual(GcpTarget.BIGQUERY, creds.target)
apache-2.0
Python
5e7f29a66e440e440b1f7a4848d17bb7ae01139b
Update from template.
ionelmc/python-nameless
ci/bootstrap.py
ci/bootstrap.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import os import sys from os.path import exists from os.path import join if __name__ == "__main__": base_path = join(".tox", "configure") if sys.platform == "win32": bin_path = join(...
bsd-2-clause
Python
db76495b4f41021e2613d79b6f5cb30c96fb4290
Add PriorityStore and PriorityItem
SanDisk-Open-Source/desmod,bgmerrell/desmod
desmod/prioritystore.py
desmod/prioritystore.py
from collections import namedtuple from heapq import heappush, heappop from simpy import Store class PriorityItem(namedtuple('PriorityItem', 'priority item')): def __lt__(self, other): return self.priority < other.priority class PriorityStore(Store): def _do_put(self, event): if len(self.it...
mit
Python
c74170968b3a200f17af083f027fe3b657cf6041
Add giveup function (#12)
singer-io/singer-python
singer/requests.py
singer/requests.py
def giveup_on_http_4xx_except_429(error): response = error.response if response is None: return False return not (response.status_code == 429 or response.status_code >= 500)
apache-2.0
Python
b59745e72a3c0a98da517f00e95fbafcff0cee3d
Remove unnecessary import.
lildadou/Flexget,lildadou/Flexget,lildadou/Flexget
tests/test_charts_snep_input.py
tests/test_charts_snep_input.py
from __future__ import unicode_literals, division, absolute_import from tests import FlexGetBase, use_vcr class TestChartsSnepInput(FlexGetBase): __yaml__ = """ tasks: test: charts_snep_input: radio """ @use_vcr def test_input(self): self.execute_task('test') ...
mit
Python
ce01cc61ea62c717503d991826e6b9915b23900b
Fix usage print
LeoTsui/6.858_lab,emzhang/6858lab2,darkmatter08/6858_labs_1_to_4,LeoTsui/6.858_lab,rychipman/858-labs,darkmatter08/6858_labs_1_to_4,rychipman/858-labs,rychipman/858-labs,darkmatter08/6858_labs_1_to_4,LeoTsui/6.858_lab,rychipman/858-labs,darkmatter08/6858_labs_1_to_4,emzhang/6858lab2,LeoTsui/6.858_lab,rychipman/858-labs...
check-bugs.py
check-bugs.py
#!/usr/bin/python import sys import re import pprint import collections Head = collections.namedtuple("Head", "file line") def parse(pn): ans = collections.defaultdict(str) head = None for l in open(pn): # ignore comments if l.startswith("#"): continue # found a head...
#!/usr/bin/python import sys import re import pprint import collections Head = collections.namedtuple("Head", "file line") def parse(pn): ans = collections.defaultdict(str) head = None for l in open(pn): # ignore comments if l.startswith("#"): continue # found a head...
mit
Python
d6fa7713556582bab54efc3ba53d27b411d8e23c
update import statements
Ezhil-Language-Foundation/open-tamil,atvKumar/open-tamil,atvKumar/open-tamil,atvKumar/open-tamil,Ezhil-Language-Foundation/open-tamil,arcturusannamalai/open-tamil,Ezhil-Language-Foundation/open-tamil,tuxnani/open-telugu,Ezhil-Language-Foundation/open-tamil,arcturusannamalai/open-tamil,tshrinivasan/open-tamil,tshrinivas...
tamil/__init__.py
tamil/__init__.py
# -*- coding: utf-8 -*- # # (C) 2013 Muthiah Annamalai <ezhillang@gmail.com> # Library provides various encoding services for Tamil libraries # import utf8 import tscii import txt2unicode import txt2ipa def printchar( letters ): for c in letters: print(c, u"\\u%04x"%ord(c)) P = lambda x: u" ".join(x)
# -*- coding: utf-8 -*- # # (C) 2013 Muthiah Annamalai <ezhillang@gmail.com> # Library provides various encoding services for Tamil libraries # from . import utf8 from . import tscii from . import txt2unicode from . import txt2ipa def printchar( letters ): for c in letters: print(c, u"\\u%04x"%ord(c)) ...
mit
Python
97a8c8c2baffdeaf6b710cf875d2f8641b999338
Create adapter_16mers.py
hackseq/2017_project_6,hackseq/2017_project_6,hackseq/2017_project_6,hackseq/2017_project_6
select_random_subset/adapter_16mers.py
select_random_subset/adapter_16mers.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sat Oct 21 14:15:18 2017 @author: nikka.keivanfar """ #see also: adapters.fa P5 = 'AATGATACGGCGACCACCGA' P7 = 'CAAGCAGAAGACGGCATACGAGAT' read1 = 'GATCTACACTCTTTCCCTACACGACGCTC' read2 = 'GTGACTGGAGTTCAGACGTGT' adapters = [P5, P7, read1, read2] #to do: s...
mit
Python
cfabe41b0d2f0cea143360fa1610baaaa87f8946
add python wrapper for network builder
Lemma1/MAC-POSTS,Lemma1/MAC-POSTS,Lemma1/MAC-POSTS,Lemma1/MAC-POSTS,Lemma1/MAC-POSTS,Lemma1/MAC-POSTS,Lemma1/MAC-POSTS
side_project/network_builder/MNM_nb.py
side_project/network_builder/MNM_nb.py
import os import numpy as np import networkx as nx DLINK_ENUM = ['CTM', 'LQ', 'LTM', 'PQ'] DNODE_ENUM = ['FWJ', 'GRJ', 'DMOND', 'DMDND'] class MNM_dlink(): def __init__(self): self.ID = None self.len = None self.typ = None self.ffs = None self.cap = None self.rhoj = None self.lanes = No...
mit
Python
ca043c2d3fe5fbdd37f372e8a3ad8bfd1b501c89
Correct Workitem._execute monkeypatch
bmya/odoo_addons,odoocn/odoo_addons,chadyred/odoo_addons,tiexinliu/odoo_addons,ovnicraft/odoo_addons,odoocn/odoo_addons,odoocn/odoo_addons,ovnicraft/odoo_addons,tiexinliu/odoo_addons,chadyred/odoo_addons,ovnicraft/odoo_addons,chadyred/odoo_addons,bmya/odoo_addons,bmya/odoo_addons,tiexinliu/odoo_addons
smile_action_rule/workflow/workitem.py
smile_action_rule/workflow/workitem.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 Smile (<http://www.smile.fr>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Aff...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 Smile (<http://www.smile.fr>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Aff...
agpl-3.0
Python
107e33ab3982f3f7fb56a1a2ac2b0eec0b67091b
Use universal newlines in gyp_helper.
ondra-novak/chromium.src,anirudhSK/chromium,Jonekee/chromium.src,M4sse/chromium.src,hujiajie/pa-chromium,crosswalk-project/chromium-crosswalk-efl,Chilledheart/chromium,ondra-novak/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,Fireblend/chromium-crosswa...
build/gyp_helper.py
build/gyp_helper.py
# Copyright (c) 2012 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. # This file helps gyp_chromium and landmines correctly set up the gyp # environment from chromium.gyp_env on disk import os SCRIPT_DIR = os.path.dirnam...
# Copyright (c) 2012 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. # This file helps gyp_chromium and landmines correctly set up the gyp # environment from chromium.gyp_env on disk import os SCRIPT_DIR = os.path.dirnam...
bsd-3-clause
Python
fbbaa3fc5b99eed88e039c232f129aaeab0a6f54
Bring table test coverage to 100%
caleb531/cache-simulator
tests/test_table.py
tests/test_table.py
#!/usr/bin/env python3 import nose.tools as nose from table import Table def test_init_default(): """should initialize table with required parameters and default values""" table = Table(num_cols=5, width=78) nose.assert_equal(table.num_cols, 5) nose.assert_equal(table.width, 78) nose.assert_equal...
mit
Python
f392a90ae12a5f9aab04b22e82d493d0f93db9fd
Add first test
9seconds/sshrc,9seconds/concierge
tests/test_utils.py
tests/test_utils.py
def test_ok(): assert True
mit
Python
e56a9781f4e7e8042c29c9e54966659c87c5c05c
Add a test for our more general views.
hello-base/web,hello-base/web,hello-base/web,hello-base/web
tests/test_views.py
tests/test_views.py
import pytest from django.core.urlresolvers import reverse def test_site_view(client): response = client.get(reverse('site-home')) assert response.status_code == 200 assert 'landings/home_site.html' in [template.name for template in response.templates]
apache-2.0
Python
675b7fc917b5f99120ca4d6dcb79b3e821dbe72a
add Olin specific script
corydolphin/mailman-downloader
downloadOlin.py
downloadOlin.py
import os from downloadMailmanArchives import main class Struct: def __init__(self, **entries): self.__dict__.update(entries) if __name__ == '__main__': args = { 'archive_root_url': ['https://lists.olin.edu/mailman/private/carpediem/', 'https://lists.olin.edu/mailman/private/helpme/'], 'passwo...
mit
Python
a46f0a709747dbe90f0495e7e6b12c7b511baa7f
Delete duplicate wapp images
kingspp/Ubuntu-AIO,kingspp/Ubuntu-AIO
dupe_deleter.py
dupe_deleter.py
""" # Install QPython3 for android # https://github.com/qpython-android/qpython3/releases # Execute the below script in QPython3 """ import os, hashlib from operator import itemgetter from itertools import groupby image_list = [] folder_list = [r'/storage/emulated/0/whatsapp/media/whatsapp images/', r'...
mit
Python
9f4452983e38d002e141ed0d2a9c865656a553ce
add todo stuff
Padavan/khren
main.py
main.py
#!/usr/bin/env python # __author__ = 'Dmitry Shihaleev' # __version__= '0.2' # __email__ = 'padavankun@gmail.com' # __license__ = 'MIT License'
mit
Python
ab7c0d05a6bcf8be83409ccd96f2ed4a6fe65a73
Create main.py
mosajjal/ircbackdoor
main.py
main.py
#!/usr/bin/env python3 import sys import socket import string HOST = "chat.freenode.net" # You can change this to whatever you want PORT = 6667 NICK = "Your Nick Name" IDENT = "Your Identity" REALNAME = "Your REAL Name" MASTER = "The Master of this particular Slave" CHANNEL = "The Channel To join" readbuffer = "" ...
mit
Python
12490fa92e54becca77c70d124d807b19d71afa1
Create main.py
paranut1/waypoint,paranut1/waypoint,paranut1/waypoint
main.py
main.py
# waypointviewer.py Waypoint Viewer Google Maps/Google AppEngine application # Copyright (C) 2011 Tom Payne # # This program 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 versi...
agpl-3.0
Python
34847fbe0e04a2da8957a0ba5de92856ca73c8cc
Add missing migration
brianjgeiger/osf.io,mattclark/osf.io,aaxelb/osf.io,cslzchen/osf.io,baylee-d/osf.io,HalcyonChimera/osf.io,icereval/osf.io,laurenrevere/osf.io,leb2dg/osf.io,sloria/osf.io,baylee-d/osf.io,HalcyonChimera/osf.io,aaxelb/osf.io,caseyrollins/osf.io,adlius/osf.io,sloria/osf.io,mattclark/osf.io,sloria/osf.io,Johnetordoff/osf.io,...
osf/migrations/0054_auto_20170823_1555.py
osf/migrations/0054_auto_20170823_1555.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-23 20:55 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('osf', '0053_add_quickfiles'), ] operations = [ migrations.AlterField( ...
apache-2.0
Python
4102ab8fc24265aaee1ecbf673bec260b3b3e5df
add max sub arr impl
YcheLanguageStudio/PythonStudy
bioinformatics/dynamic_programming/max_sum_sub_arr1.py
bioinformatics/dynamic_programming/max_sum_sub_arr1.py
def max_sum_sub_arr(arr): score_vector = [0 for _ in range(len(arr))] def max_sum_sub_arr_detail(beg_idx): if beg_idx >= len(arr): return 0 elif arr[beg_idx] >= 0: score_vector[beg_idx] = arr[beg_idx] + max_sum_sub_arr_detail(beg_idx + 1) return score_vector[...
mit
Python
1043acdfe324e02bc2a8629ef8a47d6ae9befd7c
Add python script to get ECC608 Public Key
google/aiyprojects-raspbian,google/aiyprojects-raspbian,google/aiyprojects-raspbian,google/aiyprojects-raspbian,google/aiyprojects-raspbian
src/aiy/_drivers/_ecc608_pubkey.py
src/aiy/_drivers/_ecc608_pubkey.py
#!/usr/bin/env python3 import base64 import ctypes import sys CRYPTO_ADDRESS_DICT = { 'Vision Bonnet': 0x60, 'Voice Bonnet': 0x62, } class AtcaIfaceCfgLong(ctypes.Structure): _fields_ = ( ('iface_type', ctypes.c_ulong), ('devtype', ctypes.c_ulong), ('slave_address', ctypes.c_ubyte...
apache-2.0
Python
b04503bddfa3b0d737308ac8ecb7f06ac866e6eb
Create __init__.py
scienceopen/histutils,scienceopen/histutils
__init__.py
__init__.py
mit
Python
0b891e401bf0e671d3bc6f0347a456f1cc5b07b3
add __init__.py for root package
nakagami/janome,mocobeta/janome,nakagami/janome,mocobeta/janome
__init__.py
__init__.py
import sysdic
apache-2.0
Python
14f175c294ec6b5dcd75887a031386c1c9d7060d
add __main__
minacle/yarh
__main__.py
__main__.py
from . import parser import sys if len(sys.argv) == 1: print("compile yarh to html") print("usage: yarh [YARH_FILE]...") print(" yarh -- [YARH_STRING]") print(" yarh [YARH_FILE]... -- [YARH_STRING]") sys.exit(1) fromfile = True for arg in sys.argv[1:]: if arg == "--": from...
bsd-2-clause
Python
e29c8e2d55464ac765db60a5cc213bb943b60742
add [[Portal:Beer]] and [[Portal:Wine]] tagging request script
legoktm/legobot-old,legoktm/legobot-old
trunk/portalbeer.py
trunk/portalbeer.py
#!usr/bin/python import sys, os, re sys.path.append(os.environ['HOME'] + '/stuffs/pywiki/pywikipedia') import wikipedia as wiki site = wiki.getSite() page = 'Portal:Beer/Selected picture/' #get page list pages = [] num = 0 content = """\ {{Selected picture | image = | size = | caption = | text = | credi...
mit
Python
b56525d084ccbf1fe569900338f00a37e763d7dd
Add test_runtime_performance test
openstack/congress,ramineni/my_congress,ramineni/my_congress,ramineni/my_congress,ekcs/congress,openstack/congress,ramineni/my_congress,ekcs/congress,ekcs/congress,ekcs/congress
congress/tests/policy/test_runtime_performance.py
congress/tests/policy/test_runtime_performance.py
# Copyright (c) 2015 VMware, 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 b...
apache-2.0
Python
525a6d214d3f6f9731c16bbf10ed150d1fa24021
Create betweenness.py
vitongos/mbitschool-bigdata-neo4j
src/betweenness.py
src/betweenness.py
''' Created on Feb 20, 2019 @author: Victor ''' from neo4j.v1 import GraphDatabase, basic_auth driver = GraphDatabase.driver("bolt://localhost") session = driver.session() query = '''CALL algo.betweenness.sampled.stream(null, null, {strategy:'random', probability:1.0, maxDepth:1, direction: 'both'}) YIELD nodeId,...
mit
Python
2e467774d83e14baf6fb2fec1fa4e0f6c1f8f88d
Disable webrtc benchmark on Android
axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,Jonekee/chromium.src,littlstar/chromium.src,TheTypoMaster/chromium-crosswalk,ltilve/chromium,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,TheTypoMaster/chr...
tools/perf/benchmarks/webrtc.py
tools/perf/benchmarks/webrtc.py
# Copyright 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. from measurements import webrtc import page_sets from telemetry import benchmark @benchmark.Disabled('android') # crbug.com/390233 class WebRTC(benchmark....
# Copyright 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. from measurements import webrtc import page_sets from telemetry import benchmark class WebRTC(benchmark.Benchmark): """Obtains WebRTC metrics for a real-...
bsd-3-clause
Python
d9e11e2c5f14cee0ead87ced9afe85bdd299ab35
Add python script to extract
sukanyapatra/Disatweet
extract_text.py
extract_text.py
import json f=open('raw.json') g=open('extracted1','a') i=1 for s in f: j=json.loads(s) j=j['text'] h=json.dumps(j) number=str(i) + ':' + ' ' g.write(h) g.write('\n\n') i=i+1
mit
Python
370d3a122fa0bfc4c6f57a5cd6e518968205611a
add another linechart example showing new features
yelster/python-nvd3,mgx2/python-nvd3,oz123/python-nvd3,pignacio/python-nvd3,liang42hao/python-nvd3,Coxious/python-nvd3,vdloo/python-nvd3,oz123/python-nvd3,BibMartin/python-nvd3,mgx2/python-nvd3,mgx2/python-nvd3,pignacio/python-nvd3,BibMartin/python-nvd3,liang42hao/python-nvd3,liang42hao/python-nvd3,oz123/python-nvd3,Bi...
examples/lineChartXY.py
examples/lineChartXY.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 """ from nvd3 imp...
mit
Python
aa4a3011775c12c19d690bbca91a07df4e033b1f
add urls for admin, zinnia, and serving static files
mwcz/phyton,mwcz/phyton,mwcz/phyton,mwcz/phyton,mwcz/phyton,mwcz/phyton
src/phyton/urls.py
src/phyton/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf import settings from django.conf.urls.static import static admin.autodiscover() urlpatterns = patterns('', # Admin URLs url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', inclu...
agpl-3.0
Python
b31def01a04a6ddb90e780985e43e8ad8e57e457
Create uber.py
jasuka/pyBot,jasuka/pyBot
modules/uber.py
modules/uber.py
def uber(self): self.send_chan("Moi")
mit
Python
27ab8b0436d784f44220512a91e699006b735d82
test mpi
ratnania/pyccel,ratnania/pyccel
tests/test_mpi.py
tests/test_mpi.py
# coding: utf-8 ierr = mpi_init() comm = mpi_comm_world print("mpi_comm = ", comm) size, ierr = mpi_comm_size(comm) print("mpi_size = ", size) rank, ierr = mpi_comm_rank(comm) print("mpi_rank = ", rank) #abort, ierr = mpi_abort(comm) #print("mpi_abort = ", abort) ierr = mpi_finalize()
mit
Python
2ad40dc0e7f61e37ab768bedd53572959a088bb0
Make app package
andela-akiura/bucketlist
app/__init__.py
app/__init__.py
from flask import Flask def create_app(config_name): pass
mit
Python
4981a1fa0d94020e20a8e7714af62a075f7d7874
delete customers
devops-alpha-s17/customers,devops-alpha-s17/customers
delete_customers.py
delete_customers.py
@app.route('/customers/<int:id>', methods=['DELETE']) def delete_customers(id): index = [i for i, customer in enumerate(customers) if customer['id'] == id] if len(index) > 0: del customers[index[0]] return make_response('', HTTP_204_NO_CONTENT)
apache-2.0
Python
bc34aa231a3838ad7686541ed4bce58374a40b19
Create __init__.py
janpipek/physt
physt/__init__.py
physt/__init__.py
mit
Python
2b6c13f883a8e914a3f719447b508430c2d51e5a
Add Tower Label module (#21485)
thaim/ansible,thaim/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_label.py
lib/ansible/modules/web_infrastructure/ansible_tower/tower_label.py
#!/usr/bin/python #coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your optio...
mit
Python
e93bbc1b5091f9b6d583437aea05aa59c8233d2d
add audiotsmcli
Muges/audiotsm
examples/audiotsmcli.py
examples/audiotsmcli.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ audiotsmcli ~~~~~~~~~~~ Change the speed of an audio file without changing its pitch. """ import argparse import os from audiotsm.ola import ola from audiotsm.io.wav import WavReader, WavWriter def main(): """Change the speed of an audio file without changing...
mit
Python
2b1dc56193f3a81e5aba237f3ad59aa9113dcb6e
Create ui.py
taygetea/scatterplot-visualizer
ui.py
ui.py
from visual import * from visual.controls import * import wx import scatterplot import ui_functions debug = True L = 320 Hgraph = 400 # Create a window. Note that w.win is the wxPython "Frame" (the window). # window.dwidth and window.dheight are the extra width and height of the window # compared to the display regio...
mit
Python
6dd52499de049d76a1bea5914f47dc5b6aae23d7
Add gspread example
voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts
xl.py
xl.py
#!/usr/bin/python #csv upload to gsheet import logging import json import gspread import time import re from oauth2client.client import SignedJwtAssertionCredentials from Naked.toolshed.shell import muterun_rb logging.basicConfig(filename='/var/log/gspread.log',format='%(asctime)s %(levelname)s:%(message)s',level=lo...
mit
Python
3e10a9fcb15e06699aa90016917b4ec5ec857faa
Solve task #506
Zmiecer/leetcode,Zmiecer/leetcode
506.py
506.py
class Solution(object): def findRelativeRanks(self, nums): """ :type nums: List[int] :rtype: List[str] """ def reverse_numeric(x, y): return y - x kek = sorted(nums, cmp=reverse_numeric) l = len(nums) if l > 0: nums[nums.index(k...
mit
Python
0040a9e9417ab8becac64701b3c4fc6d94410a21
Create Mc3.py
monhustla/line-bot-sdk-python
Mc3.py
Mc3.py
# -*- coding: utf-8 -*- """Mc3 module.""" import cmd2 from linebot.models import ( MessageEvent, TextMessage, TextSendMessage, SourceUser, SourceGroup, SourceRoom, TemplateSendMessage, ConfirmTemplate, MessageTemplateAction, ButtonsTemplate, URITemplateAction, PostbackTemplateAction, CarouselTemp...
apache-2.0
Python
6c3867275693d4a771b9ff8df55aab18818344cd
add first app
RyouZhang/nori,RyouZhang/noir
app.py
app.py
import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello, world") def make_app(): return tornado.web.Application([ (r"/", MainHandler), ]) if __name__ == "__main__": app = make_app() app.listen(8888) tornado.ioloo...
mit
Python
8080153c65f4aa1d875a495caeee290fb1945081
Add migration
Harvard-ATG/media_management_api,Harvard-ATG/media_management_api
media_management_api/media_auth/migrations/0005_delete_token.py
media_management_api/media_auth/migrations/0005_delete_token.py
# Generated by Django 3.2.7 on 2021-09-15 20:00 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('media_auth', '0004_auto_20160209_1902'), ] operations = [ migrations.DeleteModel( name='Token', ), ]
bsd-3-clause
Python
40b0f1cd33a053be5ab528b4a50bda404f0756dc
Add managment command Add_images_to_sections
praekelt/molo-gem,praekelt/molo-gem,praekelt/molo-gem
gem/management/commands/Add_images_to_sections.py
gem/management/commands/Add_images_to_sections.py
from __future__ import absolute_import, unicode_literals import csv from babel import Locale from django.core.management.base import BaseCommand from wagtail.wagtailimages.tests.utils import Image from molo.core.models import Languages, SectionPage, Main, SectionIndexPage class Command(BaseCommand): def add_argu...
bsd-2-clause
Python
69b900580e614ce494b9d1be0bee61464470cef7
Create 6kyu_digital_root.py
Orange9000/Codewars,Orange9000/Codewars
Solutions/6kyu_digital_root.py
Solutions/6kyu_digital_root.py
from functools import reduce def digital_root(n): while n>10: n = reduce(lambda x,y: x+y, [int(d) for d in str(n)]) return n
mit
Python
6c08f3d3441cf660de910b0f3c49c3385f4469f4
Add "Secret" channel/emoji example
rapptz/discord.py,Harmon758/discord.py,Rapptz/discord.py,Harmon758/discord.py
examples/secret.py
examples/secret.py
import typing import discord from discord.ext import commands bot = commands.Bot(command_prefix=commands.when_mentioned, description="Nothing to see here!") # the `hidden` keyword argument hides it from the help command. @bot.group(hidden=True) async def secret(ctx: commands.Context): """What is this "secret" y...
mit
Python
e0338d39f611b2ca3f202151c49fc6a4b35bd580
Add WallBuilder
zhaoshengshi/practicepython-exercise
exercise/WallBuilder.py
exercise/WallBuilder.py
#!/usr/bin/env python3 class Block(object): def __init__(self, width, height, **attr): self.__width = width self.__height = height def __eq__(self, another): return (self.__width == another.__width) and \ (self.__height == another.__height) class Brick(Bl...
apache-2.0
Python
8a30bcc511647ed0c994cb2103dd5bed8d4671a8
Create B_Temperature.py
Herpinemmanuel/Oceanography
Cas_4/Temperature/B_Temperature.py
Cas_4/Temperature/B_Temperature.py
import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors import cartopy.crs as ccrs from xmitgcm import open_mdsdataset from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER plt.ion() dir0 = '/homedata/bderembl/runmit/test_southatlgyre3' ds0 = open_mdsdataset(dir0...
mit
Python
a70490e52bde05d2afc6ea59416a50e11119d060
Add migration for Comment schema upgrade. ...
sjuxax/raggregate
raggregate/rg_migrations/versions/002_Add_metadata_to_Comment_to_allow_it_to_masquerade_as_epistle.py
raggregate/rg_migrations/versions/002_Add_metadata_to_Comment_to_allow_it_to_masquerade_as_epistle.py
from sqlalchemy import * from migrate import * from raggregate.guid_recipe import GUID def upgrade(migrate_engine): meta = MetaData(bind=migrate_engine) comments = Table('comments', meta, autoload=True) unreadc = Column('unread', Boolean, default=True) in_reply_toc = Column('in_reply_to', GUID, nullabl...
apache-2.0
Python
88d480f2c97bf7779afea34798c6c082f127f3a6
Add missing client.py (#703)
webcomponents/webcomponents.org,customelements/v2,customelements/v2,andymutton/v2,andymutton/beta,webcomponents/webcomponents.org,andymutton/beta,customelements/v2,webcomponents/webcomponents.org,andymutton/v2,andymutton/v2,andymutton/beta,customelements/v2,andymutton/beta,andymutton/v2
client/client.py
client/client.py
import webapp2 import re class RedirectResource(webapp2.RequestHandler): def get(self, path): path = re.sub(r'/$', '', path) self.redirect('/community/%s' % path, permanent=True) # pylint: disable=invalid-name app = webapp2.WSGIApplication([ webapp2.Route(r'/<:.*>', handler=RedirectResource), ], debug=T...
apache-2.0
Python
38cf2a9f0c964c69df084d80ded6cf161ba7eb16
Add elf read elf file.
somat/samber
elf.py
elf.py
import sys from elftools.elf.elffile import ELFFile from elftools.common.exceptions import ELFError from elftools.elf.segments import NoteSegment class ReadELF(object): def __init__(self, file): self.elffile = ELFFile(file) def get_build(self): for segment in self.elffile.iter_segments(): ...
mit
Python
d2f13fb17d3f9998af1a175dfd4e2bea4544fb3d
add example to just serialize matrix
geektoni/shogun,shogun-toolbox/shogun,geektoni/shogun,besser82/shogun,sorig/shogun,Saurabh7/shogun,geektoni/shogun,lisitsyn/shogun,karlnapf/shogun,karlnapf/shogun,Saurabh7/shogun,geektoni/shogun,sorig/shogun,Saurabh7/shogun,lambday/shogun,karlnapf/shogun,besser82/shogun,shogun-toolbox/shogun,karlnapf/shogun,Saurabh7/sh...
examples/undocumented/python_modular/serialization_matrix_modular.py
examples/undocumented/python_modular/serialization_matrix_modular.py
from modshogun import * from numpy import array parameter_list=[[[[1.0,2,3],[4,5,6]]]] def serialization_matrix_modular(m): feats=RealFeatures(array(m)) #feats.io.set_loglevel(0) fstream = SerializableAsciiFile("foo.asc", "w") feats.save_serializable(fstream) l=Labels(array([1.0,2,3])) fstream = SerializableAs...
bsd-3-clause
Python
e7f1439cae37facaedce9c33244b58584e219869
Initialize P01_sendingEmail
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
books/AutomateTheBoringStuffWithPython/Chapter16/P01_sendingEmail.py
books/AutomateTheBoringStuffWithPython/Chapter16/P01_sendingEmail.py
# This program uses the smtplib module to send emails # Connecting to an SMTP Server import smtplib with open('smtp_info') as config: # smtp_cfg = [email, password, smtp server, port] smtp_cfg = config.read().splitlines() smtp_obj = smtplib.SMTP_SSL(smtp_cfg[2], smtp_cfg[3]) print(type(smtp_obj))
mit
Python
e86047546693290556494bf00b493aa4ae770482
add binding.gyp for node-gyp
pconstr/rawhash,pconstr/rawhash,pconstr/rawhash,pconstr/rawhash
binding.gyp
binding.gyp
{ "targets": [ { "target_name": "rawhash", "sources": [ "src/rawhash.cpp", "src/MurmurHash3.h", "src/MurmurHash3.cpp" ], 'cflags': [ '<!@(pkg-config --cflags libsparsehash)' ], 'conditions': [ [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="so...
mit
Python
888b27db4d91ebba91eb935532f961943453b7c8
add update command to new certificate data model
hacklabr/paralapraca,hacklabr/paralapraca,hacklabr/paralapraca
paralapraca/management/commands/update_certificate_templates.py
paralapraca/management/commands/update_certificate_templates.py
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand from django.core.files import File from core.models import CertificateTemplate from timtec.settings import STATIC_ROOT from paralapraca.models import CertificateData, Contract import os class Command(BaseCommand): help = 'Create certific...
agpl-3.0
Python
a0d3ae80a2f4f9ae76aaa4d672be460ce3a657d4
add command to populate change messages
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/users/management/commands/add_location_change_message.py
corehq/apps/users/management/commands/add_location_change_message.py
from django.core.management.base import BaseCommand from django.db.models import Q from corehq.apps.users.audit.change_messages import UserChangeMessage from corehq.apps.users.models import UserHistory class Command(BaseCommand): help = "Add locations removed change messages on commcare user's User History recor...
bsd-3-clause
Python
fb133e260722fd02cb6f14ede15dbdb1fdf91af7
Add gtk dependencies tests
mpsonntag/bulk-rename,mpsonntag/bulk-rename
test/test_dependencies.py
test/test_dependencies.py
""" Copyright (c) 2017, Michael Sonntag (sonntag@bio.lmu.de) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted under the terms of the BSD License. See LICENSE file in the root of the project. """ import unittest class DependencyTest(unittest.TestCas...
bsd-3-clause
Python
c09356487360ec373c98ec50800a450a3966a60f
define prompt function
Upper-Polo/weather-app
lib.py
lib.py
# weather-app # lib.py # Classes and functions for weather-app. # Function definitions. # --------------------- # Prompt for user input. Accepts a prompt message we want to show. def prompt(msg): return input(msg)
mit
Python
e6bd5bbb3a46413b1ad164e0ef6ab66e89d9c95f
Add buildbot.py
steinwurf/stub,steinwurf/stub
buildbot.py
buildbot.py
#!/usr/bin/env python # encoding: utf-8 project_name = 'stub' def configure(options): pass def build(options): pass def run_tests(options): pass def coverage_settings(options): options['required_line_coverage'] = 80.0
bsd-3-clause
Python
97ea4f9019dcd5d4c01b4d5715297f25bc6aaf91
Create bytesize.py
stkyle/stk,stkyle/stk,stkyle/stk
bytesize.py
bytesize.py
# -*- coding: utf-8 -*- """ @author: stk """ import sys import itertools from collections import defaultdict _ver = sys.version_info #: Python 2.x? _is_py2 = (_ver[0] == 2) #: Python 3.x? _is_py3 = (_ver[0] == 3) if _is_py2: builtin_str = str bytes = str str = unicode basestring = basestring num...
mit
Python
399cd799ae993412a6ad2455b8e11f4019aa9509
Add models admin
TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio
td_biblio/admin.py
td_biblio/admin.py
# -*- coding: utf-8 -*- from django.contrib import admin from .models import Author, Editor, Journal, Publisher, Entry, Collection class AbstractHumanAdmin(admin.ModelAdmin): list_display = ('last_name', 'first_name') class AuthorAdmin(AbstractHumanAdmin): pass class EditorAdmin(AbstractHumanAdmin): ...
mit
Python
6d3f6951d846c50fcc1ff011f9129a4e1e3f7de1
Add unit tests for BMI version of storm
mdpiper/storm,csdms-contrib/storm,mdpiper/storm,csdms-contrib/storm
testing/test_storm_bmi.py
testing/test_storm_bmi.py
#! /usr/bin/env python # # Tests for the BMI version of `storm`. # # Call with: # $ nosetests -sv # # Mark Piper (mark.piper@colorado.edu) from nose.tools import * import os import shutil from subprocess import call # Global variables start_dir = os.getcwd() data_dir = os.path.join(start_dir, 'testing', 'data') inp...
mit
Python
9ef0e5e6dc50af7d5ccc27cc4d41abce72b51456
Create runcount.py
suzannerohrback/somaticCNVpipeline,suzannerohrback/somaticCNVpipeline
bin/runcount.py
bin/runcount.py
#!/usr/bin/python
mit
Python
671a5abc1f04930c749745c2ec0a59000d6e69a8
Add profile_rec script. (transplanted from ab55d87908f16cf7e2fac0a1938b280204a612bf)
alex/routes,mikepk/routes,bbangert/routes,webknjaz/routes,mikepk/pybald-routes
tests/test_functional/profile_rec.py
tests/test_functional/profile_rec.py
import profile import pstats import tempfile import os import time from routes import Mapper def bench_rec(n): m = Mapper() m.connect('', controller='articles', action='index') m.connect('admin', controller='admin/general', action='index') m.connect('admin/comments/article/:article_id/:action/:id', ...
mit
Python
5c5bf274c72ef67a3a2a2e5d6713df910026dcdb
Add hash plugin
Muzer/smartbot,thomasleese/smartbot-old,tomleese/smartbot,Cyanogenoid/smartbot
plugins/hash.py
plugins/hash.py
import hashlib import sys class Plugin: def on_command(self, bot, msg): if len(sys.argv) >= 2: algorithm = sys.argv[1] contents = " ".join(sys.argv[2:]) if not contents: contents = sys.stdin.read().strip() h = hashlib.new(algorithm) ...
mit
Python
086371f56748da9fb68acc4aaa10094b6cf24fcb
Revert "Remove pgjsonb returner unit tests"
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
tests/unit/returners/test_pgjsonb.py
tests/unit/returners/test_pgjsonb.py
# -*- coding: utf-8 -*- ''' tests.unit.returners.pgjsonb_test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unit tests for the PGJsonb returner (pgjsonb). ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import logging # Import Salt Testing libs from tests.support.mixins impo...
apache-2.0
Python
077607b1b7fe705992c9f59f7dc94f2386aef4bb
add memcached
sassoftware/testutils,sassoftware/testutils,sassoftware/testutils
testutils/servers/memcache_server.py
testutils/servers/memcache_server.py
# # Copyright (c) SAS Institute Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
apache-2.0
Python