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
d95f24d43f3925a91176429cca1aaac30a0c55aa
Create java module main
hatchery/Genepool2,hatchery/genepool
genes/java/main.py
genes/java/main.py
from genes import apt, debconf import platform class Config: OS = platform.system() (DIST, _, CODE) = platform.linux_distribution() REPO = DIST.lower() + '-' + CODE def main(): if Config.OS == 'Linux': if Config.DIST == 'Ubuntu' or Config.DIST == 'Debian': #FIXME: debian needs ppa ...
mit
Python
6d87badb68f2e20a3907f670b9190956ebd127e8
Create AddBinaryNumbers.py
manikTharaka/al-go-rithms,Deepak345/al-go-rithms,EUNIX-TRIX/al-go-rithms,Cnidarias/al-go-rithms,Cnidarias/al-go-rithms,Deepak345/al-go-rithms,EUNIX-TRIX/al-go-rithms,Deepak345/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,EUNIX-TRIX/al-go-rithms,Deepak345/al-go-rithms,manikTharaka/al-go-rithms,De...
math/AddBinaryNumbers/Python/AddBinaryNumbers.py
math/AddBinaryNumbers/Python/AddBinaryNumbers.py
number1 = input("Enter the first number: ") number2 = input("Enter the second number: ") result = (int(number1, 2) + int(number2, 2)) result = bin(result) print(result[2:])
cc0-1.0
Python
c71a43dae259299952cec082d33f003ecaeb9eab
Add marky test.
gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com
tests/py/test_markdown.py
tests/py/test_markdown.py
from gratipay.testing import Harness from gratipay.utils import markdown from HTMLParser import HTMLParser class TestMarkdown(Harness): def test_marky_works(self): md = "**Hello World!**" actual = HTMLParser().unescape(markdown.marky(md)).strip() expected = '<p><strong>Hello World!</stron...
mit
Python
722b1d55c771e628ba82bbd5b8f8f5de047112af
Add a hex dump utility class.
gvnn3/PCS,gvnn3/PCS
tests/hexdumper.py
tests/hexdumper.py
# This hack by: Raymond Hettinger class hexdumper: """Given a byte array, turn it into a string. hex bytes to stdout.""" def __init__(self): self.FILTER=''.join([(len(repr(chr(x)))==3) and chr(x) or '.' \ for x in range(256)]) def dump(self, src, length=8): result=[] for i in xrange(0, len(src...
bsd-3-clause
Python
f7a8c0b6e361ce3e5f0980b539b843b33fea258d
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/4464fe2aad5cccfd7935b0f1767901eb08e99784.
tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,yongtang/tensorflow,paolodedios/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,y...
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "4464fe2aad5cccfd7935b0f1767901eb08e99784" TFRT_SHA256 = "cc3b5b95a2da47710ade8b2d3c00...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "191a16a25cc901e12535893b94aca169916d378c" TFRT_SHA256 = "11b5d8d41bc4a6c1c6c7f9c6958c...
apache-2.0
Python
c5b0c56f53dee5577641a668019f40f9468017ea
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/83d3045fb5476bed115ae438871a228c1c682af1.
paolodedios/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/ten...
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "83d3045fb5476bed115ae438871a228c1c682af1" TFRT_SHA256 = "bdde8691c6a17c803de04423271b...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "6ca793b5d862ef6c50f242d77a811f06cce9b60a" TFRT_SHA256 = "720b059a6b1d5757a76e56cf4a3a...
apache-2.0
Python
a3a9d4d6538b025d0c6c821a72076e084a5b597b
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/9dac1ed1ebc2350ada97b16093174a1a0bbd56d0.
karllessard/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,karllessard/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,tensorflow/tensorflow...
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "9dac1ed1ebc2350ada97b16093174a1a0bbd56d0" TFRT_SHA256 = "89eea9ff0c9dfca61037c4da051a...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "553df8c12e9ba5930b9b8065f1d012ea07c6044c" TFRT_SHA256 = "477d0374b044c60cd018fdb17e7c...
apache-2.0
Python
2e53ae34ec03485302d5d7e6e5dd05707bbd1cf6
Add camera tests
lillian-lemmer/sappho,lillian-lemmer/sappho,lily-seabreeze/sappho,lillian-gardenia-seabreeze/sappho,lillian-gardenia-seabreeze/sappho,lily-seabreeze/sappho
tests/test_camera.py
tests/test_camera.py
import os import pygame from ..sappho import Camera from .common import compare_pygame_surfaces class TestCamera(object): def test_scroll(self): # Create surface to render to output_surface = pygame.surface.Surface((1, 1)) # Create fixtures red_surface = pygame.surface.Surface((1...
mit
Python
349918610081c8c02dc75fdafd47f647814dd63c
add converter of string to format maya understands for changing setting of fps
mindbender-studio/core,getavalon/core,mindbender-studio/core,MoonShineVFX/core,MoonShineVFX/core,getavalon/core
mindbender/maya/pythonpath/mayafpsconverter.py
mindbender/maya/pythonpath/mayafpsconverter.py
def mayafpsconverter(Sfps): condition = 0 if Sfps == "": condition = 1 return Sfps if Sfps == "15": condition = 1 return "game" if Sfps == "24": condition = 1 return "film" if Sfps == "25": condition = 1 return "pal" if Sfps == "30"...
mit
Python
3eafac9d71f7f885f66a63218557194291c649f7
add config test
girder/slicer_cli_web,girder/slicer_cli_web
tests/test_config.py
tests/test_config.py
import pytest from pytest_girder.assertions import assertStatusOk, assertStatus from slicer_cli_web.config import PluginSettings @pytest.mark.plugin('slicer_cli_web') def test_default_task_folder(server, admin, folder): # Test the setting resp = server.request('/system/setting', method='PUT', params={ ...
apache-2.0
Python
cfc89a542ebb9b1745bb8a7ce30f79dad12a16b7
add mslib tool to build static C libraries.
abadger/Bento,abadger/Bento,cournape/Bento,cournape/Bento,cournape/Bento,cournape/Bento,abadger/Bento,abadger/Bento
yaku/tools/mslib.py
yaku/tools/mslib.py
import yaku.utils import yaku.task def setup(ctx): env = ctx.env ctx.env["STLINK"] = ["lib.exe"] ctx.env["STLINK_TGT_F"] = ["/OUT:"] ctx.env["STLINK_SRC_F"] = [] ctx.env["STLINKFLAGS"] = ["/nologo"] ctx.env["STATICLIB_FMT"] = "%s.lib" # XXX: hack saved = yaku.task.Task.exec_command ...
bsd-3-clause
Python
367a7cdcb02d2d8c15e9a2375c5304b2ad9c89ac
Add the basic tools as functions to facilitate basic operations
vlegoff/ytranslate
ytranslate/tools.py
ytranslate/tools.py
# Copyright (c) 2015, LE GOFF Vincent # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright notice, this # list of conditions and th...
bsd-3-clause
Python
8660c7fda8cc7290fadeed7a39f06218087d9401
Add draft test module for linter
geographika/mappyfile,geographika/mappyfile
tests/test_linter.py
tests/test_linter.py
import logging import pytest from mappyfile.validator import Validator def validate(d): v = Validator() return v.validate(d) def get_from_dict(d, keys): for k in keys: if isinstance(k, int): d = d[0] else: d = d[k] return d def run_tests(): pytest.main([...
mit
Python
f73eaa3d1ba8c6f21fe64a4793aea7ba6b6835ca
Create tensorBoard-example.py
hpssjellis/easy-tensorflow-on-cloud9,hpssjellis/easy-tensorflow-on-cloud9,hpssjellis/easy-tensorflow-on-cloud9
rocksetta-examples/tensorBoard-example.py
rocksetta-examples/tensorBoard-example.py
''' Loss Visualization with TensorFlow. This example is using the MNIST database of handwritten digits (http://yann.lecun.com/exdb/mnist/) Author: Aymeric Damien Project: https://github.com/aymericdamien/TensorFlow-Examples/ ''' import tensorflow as tf import numpy # Import MINST data import input_data mnist = input...
mit
Python
ad7f9f785f9a4a4494127a9b2196e1fc64c9f3de
Add basic first tests for new report driven by "events"
iwoca/django-deep-collector
tests/test_report.py
tests/test_report.py
from django.test import TestCase from deep_collector.core import RelatedObjectsCollector from .factories import BaseModelFactory class TestLogReportGeneration(TestCase): def test_report_with_no_debug_mode(self): obj = BaseModelFactory.create() collector = RelatedObjectsCollector() colle...
bsd-3-clause
Python
272371f28369cca514d90f355e7771c133d11dcf
Create __openerp__.py
gwsilva/project-surgery
project_surgery/__openerp__.py
project_surgery/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Author: Gideoni Silva (Omnes) # Copyright 2013-2014 Omnes Tecnologia # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licen...
agpl-3.0
Python
a08452c4ed3338cf43bf2647bcc17a7d66ba4d23
call restore config directly
dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq
corehq/apps/ota/tasks.py
corehq/apps/ota/tasks.py
from celery.task import task from couchdbkit.exceptions import ResourceNotFound from casexml.apps.case.xml import V1 from casexml.apps.phone.restore import RestoreConfig from corehq.apps.users.models import CommCareUser from soil import DownloadBase @task def prime_restore(usernames_or_ids, version=V1, cache_timeout=...
from celery.task import task from couchdbkit.exceptions import ResourceNotFound from casexml.apps.case.xml import V1 from corehq.apps.users.models import CommCareUser from soil import DownloadBase @task def prime_restore(usernames_or_ids, version=V1, cache_timeout=None, overwrite_cache=False): from corehq.apps.ot...
bsd-3-clause
Python
e1a0029488d4cbf0581c21ceb1bd5db3c19bf3eb
add readme
x522758754/XlsTools
algorithms/CommonFun.py
algorithms/CommonFun.py
#!user/bin/env python # coding:utf-8 import sys import random reload(sys) sys.setdefaultencoding('utf-8') def QuickSort(left, right, array): l = left r = right while l < r: base = array[r] while (array[l] <= base and l < r): l = l + 1 if(l < r): array[r] = array[l] while (array[l] <= array[r] and l...
mit
Python
e0a7824253ae412cf7cc27348ee98c919d382cf2
verify stderr for a failing clone into a non-empty dir
gitpython-developers/gitpython,gitpython-developers/GitPython,gitpython-developers/gitpython,gitpython-developers/GitPython
test/test_clone.py
test/test_clone.py
# -*- coding: utf-8 -*- # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php from pathlib import Path import re import git from .lib import ( TestBase, with_rw_directory, ) class TestClone(TestBase): @with_rw_directory def tes...
bsd-3-clause
Python
4683fc67d5171d8bb0391ac45f587fbc3e3c97fc
Add dependency installer for linux and mac osx
GCI-2015-GPW/DevAssist
install_dependencies.py
install_dependencies.py
import platform import subprocess """ This is a standalone script that installs the required dependencies to run. It *should* be platform independent, and should work regardless of what platform you are running it on. To install dependencies, download the DevAssist source and run this script by running "python instal...
mit
Python
0fd7cdee45b54551bcfc901cece2e5cc9dec4555
Add new test setup required for py.test/django test setup
emory-libraries/eulcommon,emory-libraries/eulcommon
test/test_setup.py
test/test_setup.py
import os import django os.environ['DJANGO_SETTINGS_MODULE'] = 'testsettings' # run django setup if we are on a version of django that has it if hasattr(django, 'setup'): # setup doesn't like being run more than once try: django.setup() except RuntimeError: pass
apache-2.0
Python
2014a7e3e785c9826575846a38b4703ef19946f4
fix path stuff
shujunqiao/cocos2d-python,shujunqiao/cocos2d-python,vyscond/cocos,shujunqiao/cocos2d-python,dangillet/cocos
test/test_tiles.py
test/test_tiles.py
# This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) import math import pyglet from pyglet.window import key import cocos from cocos import tiles class CarSprite(cocos.actions.ActionSprite): speed = 0 ...
import math import pyglet from pyglet.window import key import cocos from cocos import tiles class CarSprite(cocos.actions.ActionSprite): speed = 0 def update(self, dt): # handle input and move the car self.rotation += (keyboard[key.RIGHT] - keyboard[key.LEFT]) * 150 * dt speed = self...
bsd-3-clause
Python
dbfa14401c0b50eb1a3cac413652cb975ee9d41f
Add valid directory cleaner helper test
huikyole/climate,agoodm/climate,MJJoyce/climate,MBoustani/climate,agoodm/climate,MJJoyce/climate,kwhitehall/climate,MBoustani/climate,lewismc/climate,agoodm/climate,pwcberry/climate,MBoustani/climate,Omkar20895/climate,MJJoyce/climate,agoodm/climate,kwhitehall/climate,lewismc/climate,pwcberry/climate,huikyole/climate,r...
ocw-ui/backend/tests/test_directory_helpers.py
ocw-ui/backend/tests/test_directory_helpers.py
import os import unittest from webtest import TestApp from ..run_webservices import app from ..directory_helpers import _get_clean_directory_path test_app = TestApp(app) class TestDirectoryPathCleaner(unittest.TestCase): PATH_LEADER = '/tmp/foo' VALID_CLEAN_DIR = '/tmp/foo/bar' if not os.path.exists(PAT...
apache-2.0
Python
ce924c72795d342605bb4409d5217fe99c807ace
Add test cases for moments functions
michaelpacer/scikit-image,SamHames/scikit-image,Midafi/scikit-image,ajaybhat/scikit-image,youprofit/scikit-image,oew1v07/scikit-image,emon10005/scikit-image,ClinicalGraphics/scikit-image,Hiyorimi/scikit-image,robintw/scikit-image,ofgulban/scikit-image,keflavich/scikit-image,youprofit/scikit-image,rjeli/scikit-image,mic...
skimage/measure/tests/test_moments.py
skimage/measure/tests/test_moments.py
from numpy.testing import assert_equal, assert_almost_equal import numpy as np from skimage.measure import (moments, moments_central, moments_normalized, moments_hu) def test_moments(): image = np.zeros((20, 20), dtype=np.double) image[14, 14] = 1 image[15, 15] = 1 image[...
bsd-3-clause
Python
5ee4f6fd50da0a7115f8ca0ab29c4388eaef13a6
add probabitity function decomposition
ademinn/AdaptiveIPFilter,ademinn/AdaptiveIPFilter
src/probability.py
src/probability.py
from __future__ import division from math import log from scipy.special import binom import numpy as np def C(p, p0): p1 = 1 - p0 return -p0*log(p0, 2) + p0*p*log(p0*p, 2) - (p1+p0*p)*log(p1+p0*p, 2) def P(c, p0, eps=0.00001): left = 0 right = 1 while right - left > eps: p = (left + right...
bsd-2-clause
Python
ad5b1459bf514f7be5b39b90d0fdf627edf65f62
Add helper table module to generate common test tables [skip ci]
StuartLittlefair/astropy,lpsinger/astropy,saimn/astropy,tbabej/astropy,mhvk/astropy,stargaser/astropy,DougBurke/astropy,astropy/astropy,kelle/astropy,larrybradley/astropy,kelle/astropy,joergdietrich/astropy,joergdietrich/astropy,astropy/astropy,MSeifert04/astropy,lpsinger/astropy,bsipocz/astropy,StuartLittlefair/astrop...
astropy/table/table_helpers.py
astropy/table/table_helpers.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Helper functions for table development, mostly creating useful tables for testing. """ from __future__ import (absolute_import, division, print_function, unicode_literals) from itertools import cycle import string import nump...
bsd-3-clause
Python
8e8a1a33d8bedcb597020f9723c03d0f6af57522
Add python script
danihuge/WhatsPy
send.py
send.py
import sys import os try: sys.path.append(os.path.join(os.environ['ANDROID_VIEW_CLIENT_HOME'], 'src')) except: pass from com.dtmilano.android.viewclient import ViewClient number = sys.argv[2] text = sys.argv[3] print("Sending WhatsApp...") print("Number: " + number) print("Text: " + text) package = 'com.an...
mit
Python
cec1ec8367c83e540b9a9cfbfeac2a576cdf357b
add send.py
lexruee/pi-switch-python,lexruee/pi-switch-python
send.py
send.py
""" Example: switch type A: sudo python send.py -c off -t A -s 11111,11111 -p 0 switch type B: sudo python send.py -c off -t B -s 1,3 -p 0 switch type C: sudo python send.py -c off -t C -s a,1,1 -p 0 switch type D: sudo python send.py -c off -t D -s A,1 -p 0 """ import argparse imp...
lgpl-2.1
Python
61f806ffc68c41dfbb926ea6825292eabed46966
Add sorting code
accre/lstore,PerilousApricot/lstore,tacketar/lstore,accre/lstore,PerilousApricot/lstore,tacketar/lstore,accre/lstore,tacketar/lstore,tacketar/lstore,accre/lstore,PerilousApricot/lstore,PerilousApricot/lstore
sort.py
sort.py
#!/usr/bin/env python import re import sys sort = {} regex = re.compile(r'TBX_API \w* \*?(\w*)\(.*') for line in sys.stdin.readlines(): result = regex.match(line) if not result: sort[line] = line else: sort[result.group(1)] = line for k in sorted(sort.keys()): sys.stdout.write(sort[k]...
apache-2.0
Python
3e885137d23e7618b78f207ecd6b2f6118a4a0dc
add a test file
natcap/google-code-postcommit-webhook
test.py
test.py
#!/usr/bin/python import cgi cgi.test()
bsd-3-clause
Python
b6a55999cd0f6ff6a7d69b7eb59e859d415b275f
Add test.py with old-formatting test
authmillenon/python_version_test
test.py
test.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2014 Martine Lenders <mail@martine-lenders.eu> # # Distributed under terms of the MIT license. "%s" % "test" "%d" % 2 "%.4f" % 2.0
mit
Python
f4d26567afc9185e0f9370eda43d30084437ade5
Solve Code Fights make array consecutive 2 problem
HKuz/Test_Code
CodeFights/makeArrayConsecutive2.py
CodeFights/makeArrayConsecutive2.py
#!/usr/local/bin/python # Code Fights Make Array Consecutive 2 Problem def makeArrayConsecutive2(statues): return (len(range(min(statues), max(statues) + 1)) - len(statues)) def main(): tests = [ [[6, 2, 3, 8], 3], [[0, 3], 2], [[5, 4, 6], 0], [[6, 3], 2], [[1], 0] ...
mit
Python
06d8f4290cf433a538cef4851acefd6e42c8341d
Add simple example
accepton/accepton-python
examples/client.py
examples/client.py
#!/usr/bin/env python import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) from accepton import Client API_KEY = 'skey_be064297e7b2db4b6ce5928e8dcad582' accepton = Client(api_key=API_KEY, environment='development') token = accepton.create_token(amount=1099, application_fee=99, cur...
mit
Python
96dd9b2968039be3fa87a30e8a16ed1c77be10bb
solve 94
brettchien/LeetCode
94_BinaryTreeInorderTraversal.py
94_BinaryTreeInorderTraversal.py
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: # @param {TreeNode} root # @return {integer[]} def inorderTraversal(self, root): if not root: return [] ...
mit
Python
e8c0b17bb28f1212b302959144086d72c205bf4c
store toc list in optional file to make merging easier
springcoil/euroscipy_proceedings,Stewori/euroscipy_proceedings,euroscipy/euroscipy_proceedings,mwcraig/scipy_proceedings,chendaniely/scipy_proceedings,katyhuff/scipy_proceedings,chendaniely/scipy_proceedings,mikaem/euroscipy_proceedings,dotsdl/scipy_proceedings,katyhuff/scipy_proceedings,euroscipy/euroscipy_proceedings...
publisher/conf.py
publisher/conf.py
import glob import os work_dir = os.path.dirname(__file__) papers_dir = os.path.join(work_dir,'../papers') output_dir = os.path.join(work_dir,'../output') template_dir = os.path.join(work_dir,'_templates') static_dir = os.path.join(work_dir,'_static') css_file = os.path.join(static_dir,'scipy-proc....
import glob import os work_dir = os.path.dirname(__file__) papers_dir = os.path.join(work_dir,'../papers') output_dir = os.path.join(work_dir,'../output') template_dir = os.path.join(work_dir,'_templates') static_dir = os.path.join(work_dir,'_static') css_file = os.path.join(static_dir,'scipy-proc....
bsd-2-clause
Python
f046bd8982f08a31448bb5e4e10ded2a14ea95b0
Create __init__.py
telefonicaid/iot-qa-tools,telefonicaid/iotqatools,telefonicaid/iot-qa-tools,telefonicaid/iotqatools,telefonicaid/iot-qa-tools,telefonicaid/iotqatools
iotqatools/__init__.py
iotqatools/__init__.py
agpl-3.0
Python
e4a33badd98c4c927c4128e22fd839f54711cfd6
Create PedidoCadastrar.py
AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb
backend/Models/Predio/PedidoCadastrar.py
backend/Models/Predio/PedidoCadastrar.py
from Framework.Pedido import Pedido from Framework.ErroNoHTTP import ErroNoHTTP class PedidoCadastrar(Pedido): def __init__(self,variaveis_do_ambiente): super(PedidoCadastrar, self).__init__(variaveis_do_ambiente) try: self.id = self.corpo['id'] self.nome = self.corpo['nome'] except: raise ErroNoHTTP(...
mit
Python
82152af00c54ea94a4e8cd90d3cd5f45ef28ee86
add missing unit test file
chenjiandongx/pyecharts,chenjiandongx/pyecharts,chenjiandongx/pyecharts
test/test_utils.py
test/test_utils.py
# coding=utf-8 from __future__ import unicode_literals import os import codecs from nose.tools import eq_ from pyecharts.utils import ( freeze_js, write_utf8_html_file, get_resource_dir ) def test_get_resource_dir(): path = get_resource_dir('templates') expected = os.path.join(os.getcwd(), '..'...
mit
Python
9c52dae7f5de64865fff51a24680c43e041376ea
Add random_subtree script
kdmurray91/kwip-experiments,kdmurray91/kwip-experiments,kdmurray91/kwip-experiments
random_subtree.py
random_subtree.py
#!/usr/bin/env python2 # Use either ete2 or ete3 try: import ete3 as ete except ImportError: import ete2 as ete import numpy as np CLI = """ USAGE: random_subtree <tree> <n> Subsamples <n> taxa from the Newick tree in <tree>, preserving the branch lengths of subsampled taxa. """ def main(treefile, n): ...
mit
Python
3c1e61b4b47ec244e4cadd4bf34e0a21cf1ff7e1
Create w3_1.py
s40523222/2016fallcp_hw,s40523222/2016fallcp_hw,s40523222/2016fallcp_hw
w3_1.py
w3_1.py
print("第三週")
agpl-3.0
Python
8bb9d6cbe161654126bb3aa3adecdb99ee0d9987
Create sct4.py
PythonProgramming/MPI4Py-Parallel-Computing-tutorial
sct4.py
sct4.py
from mpi4py import MPI comm = MPI.COMM_WORLD rank=comm.rank size=comm.size print 'Rank:',rank print 'Node Count:',size print 9**(rank+3)
mit
Python
aafd823069176075b4810496ee98cea3203b5652
Make a command to make subsets. Subsets are useful for testing during development.
googlei18n/TachyFont,moyogo/tachyfont,googlefonts/TachyFont,moyogo/tachyfont,googlei18n/TachyFont,moyogo/tachyfont,bstell/TachyFont,moyogo/tachyfont,googlefonts/TachyFont,moyogo/tachyfont,googlei18n/TachyFont,bstell/TachyFont,googlei18n/TachyFont,googlei18n/TachyFont,bstell/TachyFont,googlefonts/TachyFont,bstell/TachyF...
build_time/src/make_subset.py
build_time/src/make_subset.py
""" 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 applicable law or ...
apache-2.0
Python
01f4aedac1df6f2e55c76d60c52d1e0c5ccfd9f2
Revert "Delete test file"
adamtheturtle/vws-python,adamtheturtle/vws-python
tests/mock_vws/test_query.py
tests/mock_vws/test_query.py
""" Tests for the mock of the query endpoint. https://library.vuforia.com/articles/Solution/How-To-Perform-an-Image-Recognition-Query. """ import io from typing import Any, Dict from urllib.parse import urljoin import pytest import requests from requests import codes from requests_mock import POST from tests.utils ...
mit
Python
793344ae359f028db950a364d48578ae97cb7028
Add tests for jenkins_job_linter.test_jjb_subcommand
OddBloke/jenkins-job-linter
tests/test_jjb_subcommand.py
tests/test_jjb_subcommand.py
from jenkins_job_linter.jjb_subcommand import LintSubCommand class TestParseArgs(object): def test_parser_named_lint(self, mocker): subcommand = LintSubCommand() subparser_mock = mocker.Mock() subcommand.parse_args(subparser_mock) assert 1 == subparser_mock.add_parser.call_count ...
apache-2.0
Python
2e330d5cd2ad033c675d5888a2f43e0f846a4df1
Add CodeDeploy
craigbruce/troposphere,7digital/troposphere,ikben/troposphere,WeAreCloudar/troposphere,horacio3/troposphere,cloudtools/troposphere,ikben/troposphere,horacio3/troposphere,johnctitus/troposphere,alonsodomin/troposphere,7digital/troposphere,amosshapira/troposphere,pas256/troposphere,johnctitus/troposphere,Yipit/tropospher...
troposphere/codedeploy.py
troposphere/codedeploy.py
# Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty from .validators import positive_integer KEY_ONLY = "KEY_ONLY" VALUE_ONLY = "VALUE_ONLY" KEY_AND_VALUE = "KEY_AND_VALUE" class GitHubLocation(AWSProperty): props = ...
bsd-2-clause
Python
0091af78bd191e34ecb621b20e79d6dd3d32ebb6
Add unit tests for VocabularySet
clemente-lab/metasane
tests/test_core.py
tests/test_core.py
#!/usr/bin/env python from __future__ import division from unittest import TestCase, main from metasane.core import VocabularySet class VocabularySetTests(TestCase): def setUp(self): """Initialize data used in the tests.""" self.single_vocab = {'vocab_1': VOCAB_1.split('\n')} self.multi_vo...
bsd-3-clause
Python
1f9240f0b954afa9f587f468872c3e1e215f2eaa
Implement channel mode +s (or what's left of it)
Heufneutje/txircd,DesertBus/txircd,ElementalAlchemist/txircd
txircd/modules/cmode_s.py
txircd/modules/cmode_s.py
from txircd.modbase import Mode class SecretMode(Mode): def listOutput(self, command, data): if command != "LIST": return data cdata = data["cdata"] if "s" in cdata["modes"] and cdata["name"] not in data["user"].channels: data["cdata"] = {} # other +s stuff is hiding in other modules. class Spawner(obje...
bsd-3-clause
Python
2a26fc7f0ac6223ebcb20eb1de550e899e5728db
add beginnings of script for ball identification
Edeleon4/PoolShark,Edeleon4/PoolShark,Edeleon4/PoolShark,Edeleon4/PoolShark,Edeleon4/PoolShark,Edeleon4/PoolShark
scripts/hist.py
scripts/hist.py
import cv2 import numpy as np frame = cv2.imread('/mnt/c/Users/T-HUNTEL/Desktop/hackathon/table3.jpg') h,w,c = frame.shape print frame.shape # Convert BGR to HSV hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) BORDER_COLOR = 0 def flood_fill(image, x, y, value): count = 1 points = [(x, y)] "Flood fill on a...
mit
Python
6a686a800a3579970a15fa9552b2eb4e1b6b3ed9
add some tools for ml scoring
log0ymxm/corgi
corgi/ml.py
corgi/ml.py
import numpy as np import pandas as pd from scipy.stats import kendalltau, spearmanr from sklearn.metrics import (accuracy_score, f1_score, log_loss, mean_squared_error, precision_score, recall_score) from sklearn.model_selection import StratifiedKFold from tqdm import tqdm classifier_sc...
mit
Python
2d7d4987eb06372496ce4a5b7b961a12deba9574
add windows-specific tests for shell_{quote,split}
googlefonts/nanoemoji,googlefonts/nanoemoji
tests/util_test.py
tests/util_test.py
# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
Python
a6ff8a5838f82be3d5b0b4196c03fbf7c15aff7a
Test dat.info
karissa/datpy,akubera/datpy
test.py
test.py
import unittest import requests port = 'http://localhost:6461' def info(): call = port + '/api' req = requests.get(call, stream=True) print(req.content) return req.status_code class DatTest(unittest.TestCase): def test_info(self): self.assertEqual(info(), 200) if __name__ == '__mai...
bsd-2-clause
Python
26c49015b0c3be8045423306abb74eb7ea080f0b
Create test.py
Semen52/GIBDD
test.py
test.py
# -*- coding: utf-8 -*- import sys import time import feedparser import nltk import coding import numpy as np import nltk import string from nltk.corpus import stopwords #coding.setup_console("utf8") if __name__ == "__main__": start_time = time.time() if len(sys.argv) >= 1: print "Старт " + str(sta...
apache-2.0
Python
18df3284fd6dc176b71c41599d02a24dc021f8db
add file that is useful for testing; but will be much more useful when I figure out how to turn of debugging output in Flask.
DrXyzzy/smc,DrXyzzy/smc,sagemathinc/smc,tscholl2/smc,tscholl2/smc,tscholl2/smc,sagemathinc/smc,tscholl2/smc,tscholl2/smc,DrXyzzy/smc,sagemathinc/smc,sagemathinc/smc,DrXyzzy/smc
test.py
test.py
#!/usr/bin/env python import os from doctest import testmod, NORMALIZE_WHITESPACE, ELLIPSIS import backend, client, frontend, misc, model, session def tm(module): testmod(module, optionflags=NORMALIZE_WHITESPACE | ELLIPSIS) def run_doctests(): tm(backend) tm(client) tm(frontend) tm(misc) tm(...
agpl-3.0
Python
ae6184a023f9a14c54663270d4a4294b8c3832f4
Create test.py
gakrakow/rastcats
test.py
test.py
import os print("hello there")
mit
Python
9309f7190314abdd8b56368147862453d17d97b5
Create test.py
sliwhu/UWHousingTeam,sliwhu/UWHousingTeam
test.py
test.py
mit
Python
d527bc83d44b91bb827c02907faf8cd7e7d49544
Add dateutil gist
chenjianlong/my-gist,chenjianlong/my-gist
dateutil.py
dateutil.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8:et """Date and Time util """ __author__ = ["Jianlong Chen <jianlong99@gmail.com>"] __date__ = "2013-07-17" import datetime def year(): return datetime.datetime.strftime(datetime.datetime.now(), '%Y') def date_time(): return datetime.datetime.str...
unlicense
Python
75a61dfe788102d04e1cc3b151e839fa9add724f
Fix review requests
YarivCol/mbed-os,mikaleppanen/mbed-os,YarivCol/mbed-os,netzimme/mbed-os,kl-cruz/mbed-os,radhika-raghavendran/mbed-os5.1-onsemi,infinnovation/mbed-os,arostm/mbed-os,nRFMesh/mbed-os,YarivCol/mbed-os,screamerbg/mbed,cvtsi2sd/mbed-os,svogl/mbed-os,ryankurte/mbed-os,screamerbg/mbed,RonEld/mbed,cvtsi2sd/mbed-os,pradeep-gr/mb...
tools/export/cdt/__init__.py
tools/export/cdt/__init__.py
import re from os.path import join, exists, realpath, relpath, basename from os import makedirs from tools.export.makefile import Makefile, GccArm, Armc5, IAR class Eclipse(Makefile): """Generic Eclipse project. Intended to be subclassed by classes that specify a type of Makefile. """ def generate(se...
import re from os.path import join, exists, realpath, relpath, basename from os import makedirs from tools.export.makefile import Makefile, GccArm, Armc5, IAR class Eclipse(Makefile): """Generic Eclipse project. Intended to be subclassed by classes that specify a type of Makefile. """ def generate(se...
apache-2.0
Python
5186f3e4bfcaf033c4012e72c8cb766a0b903296
Add file for updating strains
AndersenLab/concordance-nf,AndersenLab/concordance-nf
set_isotypes.py
set_isotypes.py
from gcloud import datastore import requests import time ds = datastore.Client(project='andersen-lab') url = "https://docs.google.com/spreadsheets/d/1V6YHzblaDph01sFDI8YK_fP0H7sVebHQTXypGdiQIjI/pub?gid=0&single=true&output=tsv" gs = requests.get(url).text.encode("utf-8").splitlines() gs = [str(x, 'utf-8').strip().sp...
mit
Python
39fa13cf9b12f3828d4776d10532405c0ea43603
Add an example
messente/verigator-python
examples/example.py
examples/example.py
""" Flow as follows: Create Service -> Create User -> Initiate Authentication -> Verify Pin """ from messente.verigator.api import Api api = Api("username", "password") service = api.services.create("http://example.com", "service_name") user = api.users.create(service.id, "+xxxxxxxxxxx", "username") auth_id = api.a...
apache-2.0
Python
265f8c48f4b257287dd004ba783a8aa6f94bb870
Add Latin params file
diyclassics/cltk,TylerKirby/cltk,TylerKirby/cltk,kylepjohnson/cltk,cltk/cltk,D-K-E/cltk
cltk/tokenize/latin/params.py
cltk/tokenize/latin/params.py
""" Params: Latin """ __author__ = ['Patrick J. Burns <patrick@diyclassics.org>'] __license__ = 'MIT License.' PRAENOMINA = ['a', 'agr', 'ap', 'c', 'cn', 'd', 'f', 'k', 'l', "m'", 'm', 'mam', 'n', 'oct', 'opet', 'p', 'post', 'pro', 'q', 's', 'ser', 'sert', 'sex', 'st', 't', 'ti', 'v', 'vol', 'vop', 'a', 'ap', 'c', 'c...
mit
Python
8f6e10a6fe5d76a27369801ae998e3d7e30b667e
Implement Zhai_Luo support.
colour-science/colour
colour/adaptation/zhai2018.py
colour/adaptation/zhai2018.py
import numpy as np def chromatic_adaptation_forward_Zhai2018(XYZb, XYZwb, Db, XYZws, Ds, XYZwo, ...
bsd-3-clause
Python
0a9efede94c64d114cf536533b94a47210a90604
Add viper.common.constants.py
MeteorAdminz/viper,MeteorAdminz/viper,postfix/viper-1,S2R2/viper,Beercow/viper,postfix/viper-1,cwtaylor/viper,jack51706/viper,Beercow/viper,jack51706/viper,kevthehermit/viper,Beercow/viper,jahrome/viper,S2R2/viper,cwtaylor/viper,jahrome/viper,kevthehermit/viper
viper/common/constants.py
viper/common/constants.py
# This file is part of Viper - https://github.com/botherder/viper # See the file 'LICENSE' for copying permission. import os _current_dir = os.path.abspath(os.path.dirname(__file__)) VIPER_ROOT = os.path.normpath(os.path.join(_current_dir, "..", ".."))
bsd-3-clause
Python
2d7ea21c2d9171a79298866bf02abf64b849be0e
add a simple info cog
slice/dogbot,slice/dogbot,sliceofcode/dogbot,slice/dogbot,sliceofcode/dogbot
dog/ext/info.py
dog/ext/info.py
from textwrap import dedent import discord from discord.ext.commands import guild_only from lifesaver.bot import Cog, group, Context from lifesaver.utils import human_delta class Info(Cog): """A cog that provides information about various entities like guilds or members.""" @group(aliases=['guild', 'guild_i...
mit
Python
eff85f039674ca9fe69294ca2e81644dc4ff4cb6
add celery for all notification mail
gnowledge/gstudio,AvadootNachankar/gstudio,gnowledge/gstudio,olympian94/gstudio,makfire/gstudio,makfire/gstudio,olympian94/gstudio,gnowledge/gstudio,gnowledge/gstudio,Dhiru/gstudio,makfire/gstudio,Dhiru/gstudio,Dhiru/gstudio,olympian94/gstudio,AvadootNachankar/gstudio,AvadootNachankar/gstudio,makfire/gstudio,gnowledge/...
gnowsys-ndf/gnowsys_ndf/ndf/views/tasks.py
gnowsys-ndf/gnowsys_ndf/ndf/views/tasks.py
from celery import task from django.contrib.auth.models import User from django.template.loader import render_to_string from django.contrib.sites.models import Site from gnowsys_ndf.notification import models as notification from gnowsys_ndf.ndf.models import Node from gnowsys_ndf.ndf.models import node_collection, tr...
agpl-3.0
Python
f956af85b27d104e84754b4d93a761b82ae39831
add external_iterate.py
uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco
external_iterate.py
external_iterate.py
#!/usr/bin/env python """Compile a Myrial program into logical relational algebra.""" import raco.myrial.interpreter as interpreter import raco.myrial.parser as parser import raco.scheme from raco import algebra from raco import myrialang from raco.compile import optimize from raco.language import MyriaAlgebra impor...
bsd-3-clause
Python
40146a54f9857aaaf252f3e1e5de7dc73c6cd181
add pl.proportions
theislab/scvelo
scvelo/plotting/proportions.py
scvelo/plotting/proportions.py
from ..preprocessing.utils import sum_var import matplotlib.pyplot as pl import numpy as np def proportions(adata, groupby='clusters', layers=['spliced', 'unspliced', 'ambigious'], highlight='unspliced', add_labels_pie=True, add_labels_bar=True, fontsize=8, figsize=(10, 2), dpi=100, show=True): "...
bsd-3-clause
Python
7f78d4ea286d9827aaa47022077de286195c2cd9
Add a Fast(er) DS1820 reader
scudderfish/SFL525R,scudderfish/SFL525R
wipy/flash/lib/FDS1820.py
wipy/flash/lib/FDS1820.py
from onewire import * import machine import time class FDS1820(object): def __init__(self, onewire): self.ow = onewire self.roms = [rom for rom in self.ow.scan() if rom[0] == 0x10 or rom[0] == 0x28] def read_temp(self, rom=None): """ Read and return the temperature of one DS18x...
mit
Python
9184d4cebf95ee31836970bedffaddc3bfaa2c2d
Prepare v2.20.8.dev
crawln45/Flexget,ianstalk/Flexget,gazpachoking/Flexget,ianstalk/Flexget,malkavi/Flexget,tobinjt/Flexget,tobinjt/Flexget,crawln45/Flexget,JorisDeRieck/Flexget,Flexget/Flexget,malkavi/Flexget,JorisDeRieck/Flexget,Flexget/Flexget,malkavi/Flexget,tobinjt/Flexget,crawln45/Flexget,Danfocus/Flexget,Flexget/Flexget,JorisDeRiec...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
1bf65c4b18b1d803b9515f80056c4be5790e3bde
Prepare v1.2.276.dev
poulpito/Flexget,jacobmetrick/Flexget,oxc/Flexget,cvium/Flexget,Pretagonist/Flexget,crawln45/Flexget,JorisDeRieck/Flexget,LynxyssCZ/Flexget,OmgOhnoes/Flexget,ZefQ/Flexget,offbyone/Flexget,ZefQ/Flexget,antivirtel/Flexget,poulpito/Flexget,v17al/Flexget,ianstalk/Flexget,ibrahimkarahan/Flexget,qvazzler/Flexget,LynxyssCZ/Fl...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
f4a4b733445abba45a0a168dde9b7c10248688a6
Prepare v1.2.318.dev
patsissons/Flexget,tobinjt/Flexget,gazpachoking/Flexget,oxc/Flexget,ratoaq2/Flexget,cvium/Flexget,ibrahimkarahan/Flexget,oxc/Flexget,grrr2/Flexget,sean797/Flexget,drwyrm/Flexget,JorisDeRieck/Flexget,jawilson/Flexget,tarzasai/Flexget,qk4l/Flexget,JorisDeRieck/Flexget,Pretagonist/Flexget,tsnoam/Flexget,Danfocus/Flexget,c...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
860cf7b9743744c9d21796b227cf21d684fb5519
Add test_modulepickling_change_cache_dir
tjwei/jedi,flurischt/jedi,dwillmer/jedi,WoLpH/jedi,flurischt/jedi,mfussenegger/jedi,mfussenegger/jedi,WoLpH/jedi,dwillmer/jedi,jonashaag/jedi,jonashaag/jedi,tjwei/jedi
test/test_cache.py
test/test_cache.py
from jedi import settings from jedi.cache import ParserCacheItem, _ModulePickling ModulePickling = _ModulePickling() def test_modulepickling_change_cache_dir(monkeypatch, tmpdir): """ ModulePickling should not save old cache when cache_directory is changed. See: `#168 <https://github.com/davidhalter/je...
mit
Python
d082eb41c2ccef7178d228896a7658fe52bcbdec
Create directory for useless symbols remove
PatrikValkovic/grammpy
tests/UselessSymbolsRemove/__init__.py
tests/UselessSymbolsRemove/__init__.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 17.08.2017 14:38 :Licence GNUv3 Part of grammpy-transforms """
mit
Python
3c82f0228095b2616b35a2881f51c93999fdd79b
Test models/FieldMapper
WSULib/combine,WSULib/combine,WSULib/combine,WSULib/combine
tests/test_models/test_field_mapper.py
tests/test_models/test_field_mapper.py
import json import jsonschema from django.test import TestCase from core.models import FieldMapper from tests.utils import json_string class FieldMapperTestCase(TestCase): @classmethod def setUpTestData(cls): cls.attributes = { 'name': 'Test Field Mapper', 'config_json': json_st...
mit
Python
ebe10d39064410fc49ac90e38339a54d0ed47c80
update hooks for sqlalchemy
ODM2/ODM2StreamingDataLoader,ODM2/ODM2StreamingDataLoader
setup/hooks/hook-sqlalchemy.py
setup/hooks/hook-sqlalchemy.py
__author__ = 'stephanie' # Copyright (C) 2009, Giovanni Bajo # Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; ...
bsd-3-clause
Python
7f8f5e14f88304b272423ab12728d5329a2ba808
use raw strings for urls
khchine5/django-shop,chriscauley/django-shop,rfleschenberg/django-shop,febsn/django-shop,rfleschenberg/django-shop,pjdelport/django-shop,atheiste/django-shop,febsn/django-shop,jrief/django-shop,febsn/django-shop,awesto/django-shop,schacki/django-shop,katomaso/django-shop,jrutila/django-shop,rfleschenberg/django-shop,dw...
shop/urls/cart.py
shop/urls/cart.py
from django.conf.urls.defaults import url, patterns from shop.views.cart import CartDetails, CartItemDetail urlpatterns = patterns('', url(r'^delete/$', CartDetails.as_view(action='delete'), # DELETE name='cart_delete'), url(r'^item/$', CartDetails.as_view(action='post'), # POST name='cart_...
from django.conf.urls.defaults import url, patterns from shop.views.cart import CartDetails, CartItemDetail urlpatterns = patterns('', url(r'^delete/$', CartDetails.as_view(action='delete'), # DELETE name='cart_delete'), url('^item/$', CartDetails.as_view(action='post'), # POST name='cart_i...
bsd-3-clause
Python
45869cdf6087cd625db385ef52475d98c9842efa
add migen_local_install script
litex-hub/fpga_101,litex-hub/fpga_101
migen_local_install.py
migen_local_install.py
import os os.system("git clone http://github.com/m-labs/migen") os.system("mv migen migen_tmp") os.system("mv migen_tmp/migen migen") os.system("rm -rf migen_tmp")
bsd-2-clause
Python
5f31e729ce6752c2f0a6b7f19f76c2a7e95636b9
Create friends-of-appropriate-ages.py
kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,kamyu104/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015
Python/friends-of-appropriate-ages.py
Python/friends-of-appropriate-ages.py
# Time: O(a^2 + n), a is the number of ages, # n is the number of people # Space: O(a) # Some people will make friend requests. # The list of their ages is given and ages[i] is the age of the ith person. # # Person A will NOT friend request person B (B != A) # if any of the following conditions are...
mit
Python
9caf9d3bfaaff9d7721f611d9c351dd14f67daa6
add log progress
imminfo/hex
log_progress.py
log_progress.py
def log_progress(sequence, every=None, size=None): from ipywidgets import IntProgress, HTML, VBox from IPython.display import display is_iterator = False if size is None: try: size = len(sequence) except TypeError: is_iterator = True if size is not None: ...
apache-2.0
Python
d9c7ce7f2b47bee3b2e657157fe4df8f9a00973a
Create smiles_preview.py
yklsorok/SmilesPreview
smiles_preview.py
smiles_preview.py
import sublime import sublime_plugin import base64 import os import re class SmilesPreview(sublime_plugin.EventListener): def on_hover(self, view, point, hover_zone): if (hover_zone == sublime.HOVER_TEXT): # locate smiles in the string. smiles string should be at the beginning and followed by t...
mit
Python
fbeb3d04b16afa0b2daf49597a07c32b0d72630c
Add missing mica.report __init__ to project
sot/mica,sot/mica
mica/report/__init__.py
mica/report/__init__.py
from .report import main, update
bsd-3-clause
Python
dca9931e894c1e5cae9f5229b04cc72c31eef5f5
Create a.py
francolinofrancolino123/example,francolinofrancolino123/example,francolinofrancolino123/example
a.py
a.py
# this code is wrote on python a = 3 print a
mit
Python
2c0a06a8e460de06dd9a929baa02e2d369fbe0a6
Prepare v2.17.4.dev
Flexget/Flexget,Flexget/Flexget,tobinjt/Flexget,crawln45/Flexget,ianstalk/Flexget,ianstalk/Flexget,Danfocus/Flexget,JorisDeRieck/Flexget,Danfocus/Flexget,JorisDeRieck/Flexget,malkavi/Flexget,Danfocus/Flexget,malkavi/Flexget,Flexget/Flexget,tobinjt/Flexget,JorisDeRieck/Flexget,ianstalk/Flexget,crawln45/Flexget,malkavi/F...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
b815b2e94814e86ba2e4713d15aa2143594344bc
Prepare v2.13.13.dev
malkavi/Flexget,gazpachoking/Flexget,ianstalk/Flexget,malkavi/Flexget,Flexget/Flexget,crawln45/Flexget,Flexget/Flexget,crawln45/Flexget,JorisDeRieck/Flexget,tobinjt/Flexget,Flexget/Flexget,tobinjt/Flexget,malkavi/Flexget,tobinjt/Flexget,jawilson/Flexget,JorisDeRieck/Flexget,gazpachoking/Flexget,jawilson/Flexget,malkavi...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
a30a6104554fb39d068fd8aadbb128dff1d482fb
Create dl.py
donkeybot5000/chanrip
dl.py
dl.py
#!/usr/bin/env python import requests, urllib2, os, shutil, sys, futures from time import sleep download_board = sys.argv[1] def download(**kwargs): with open('./'+download_board+'/'+kwargs['filename'], 'wb') as handle: request = requests.get(kwargs['url'], stream=True) for block in request.iter_...
mit
Python
0b90446471805276ed141800337e6044ce130b93
Test for the bugfix of Project.last_update
akvo/akvo-rsr,akvo/akvo-rsr,akvo/akvo-rsr,akvo/akvo-rsr
akvo/rsr/tests/models/test_project.py
akvo/rsr/tests/models/test_project.py
# -*- coding: utf-8 -*- # Akvo Reporting is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. from unittest import TestCase ...
agpl-3.0
Python
30381ced0d7535428398b3df5f1caffd684b20d5
Implement K means network.
prasanna08/MachineLearning
KMeansnet.py
KMeansnet.py
import numpy as np class Kmeansnet(object): def __init__(self, data, clusters, eta): self.data = data self.n_dim = data.shape[1] self.num_clusters = clusters self.weights = np.random.rand(self.num_clusters, self.n_dim) self.eta = eta def calc_dist(self, inp, weights): return np.sum((weights * inp), axis...
mit
Python
b876332debd21edb3e3b84f01bb8aec5196bd8d8
add enumerating partition
dragonwolverines/DataStructures,dragonwolverines/DataStructures,dragonwolverines/DataStructures
resource-4/combinatorics/integer-partitions/enumerating/partition.py
resource-4/combinatorics/integer-partitions/enumerating/partition.py
#zero if n == 0: yield [] return #modify for ig in partitions(n-1): yield [1] + ig if ig and (len(ig) < 2 or ig[1] > ig[0]): yield [ig[0] + 1] + ig[1:]
bsd-2-clause
Python
39714efdbfb9620acb1bb43fa8a3dbf59bfbef85
add shortnaturaltime template filter
arturtamborski/wypok,arturtamborski/wypok,arturtamborski/wypok,arturtamborski/wypok
wypok/templatetags/shortnaturaltime.py
wypok/templatetags/shortnaturaltime.py
# from: https://github.com/ollieglass/django-shortnaturaltime from django import template from django.utils.timezone import utc import time from datetime import datetime, timedelta, date register = template.Library() def _now(): return datetime.utcnow().replace(tzinfo=utc) # return datetime.now() def abs_timede...
mit
Python
d9c95fcf89f0e72c3504a4988e6d4fb6ef2ae6cd
Add the timeseries neural network
malkoto1/tribe,malkoto1/tribe,malkoto1/tribe,malkoto1/tribe
src/backend/timeseries_nnet.py
src/backend/timeseries_nnet.py
# Modified code from https://github.com/hawk31/nnet-ts import logging import numpy as np from keras.optimizers import SGD from keras.models import Sequential from keras.layers.core import Dense, Activation from sklearn.preprocessing import StandardScaler logging.basicConfig(format='%(levelname)s:%(message)s', level=lo...
mit
Python
fefb9a9fa5a7c6080bc52896e2d1517828b01a3d
Add all PLs to db
Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2
migrations/versions/299e1d15a55f_populate_provincial_legislatures.py
migrations/versions/299e1d15a55f_populate_provincial_legislatures.py
"""populate-provincial-legislatures Revision ID: 299e1d15a55f Revises: 1f97f799a477 Create Date: 2018-08-20 16:17:28.919476 """ # revision identifiers, used by Alembic. revision = '299e1d15a55f' down_revision = '1f97f799a477' from alembic import op import sqlalchemy as sa def upgrade(): """ Ensure all pro...
apache-2.0
Python
253ff8bc8f848effea6ad7602b6424cf997c926c
rename celeba_multitask_acc to celeba_multilabel_acc
last-one/tools,last-one/tools
caffe/result/celeba_multilabel_acc.py
caffe/result/celeba_multilabel_acc.py
import os import numpy as np import sys label_file = open('/home/hypan/data/celebA/test.txt', 'r') lines = label_file.readlines() label_file.close() acc = np.zeros(40) cou = 0 for line in lines: info = line.strip('\r\n').split() name = info[0].split('.')[0] gt_labels = info[1: ] feat_path = '/home/hy...
bsd-2-clause
Python
d2e165ace4fc26b51e18494c4878f95ebcefa20a
add api
gobuild-old/gobuild3,gobuild-old/gobuild3,gobuild/gobuild3,gobuild-old/gobuild3,gobuild/gobuild3,gobuild-old/gobuild3,gobuild/gobuild3,gobuild-old/gobuild3,gobuild/gobuild3,gobuild/gobuild3
web/routers/api.py
web/routers/api.py
# coding: utf-8 import os import json import time import datetime import humanize import flask from flask import request, flash, redirect, url_for, render_template import models import gcfg bp = flask.Blueprint('api', __name__) @bp.route('/') def home(): return flask.render_template('api.html') @bp.route('/v1/...
mit
Python
edbdf0d955eb387d74a73997cd11a2d05550e05a
add new action plugin junos_config
thaim/ansible,thaim/ansible
lib/ansible/plugins/action/junos_config.py
lib/ansible/plugins/action/junos_config.py
# # Copyright 2015 Peter Sprygada <psprygada@ansible.com> # # This file is part of Ansible # # Ansible 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 option) any...
mit
Python
6c9760b328716d6b2e099698293c93cba9361932
Add script for testing error reporting.
Cue/greplin-nagios-utils,Cue/greplin-nagios-utils
checkserver/testchecks/check_error.py
checkserver/testchecks/check_error.py
#!/usr/bin/env python # Copyright 2012 The greplin-nagios-utils 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...
apache-2.0
Python
bc651b5ca15cf41eece321b77142c2973bd41ede
Add a sqlite config
1844144/django-blog-zinnia,ghachey/django-blog-zinnia,extertioner/django-blog-zinnia,Fantomas42/django-blog-zinnia,ZuluPro/django-blog-zinnia,petecummings/django-blog-zinnia,dapeng0802/django-blog-zinnia,Maplecroft/django-blog-zinnia,Fantomas42/django-blog-zinnia,ZuluPro/django-blog-zinnia,dapeng0802/django-blog-zinnia...
zinnia/tests/implementations/sqlite.py
zinnia/tests/implementations/sqlite.py
"""Settings for testing zinnia on SQLite""" from zinnia.tests.implementations.settings import * # noqa DATABASES = { 'default': { 'NAME': 'zinnia.db', 'ENGINE': 'django.db.backends.sqlite3' } }
bsd-3-clause
Python
b546ac87cd3e3821619a5ac7ed7806c1f569a3cd
Create PySMS.py
CodyTXR0KR/PySMS
PySMS.py
PySMS.py
# -*- coding: utf-8 -*- import smtplib from time import strftime # User account credentials -- (gmail username and password) USERNAME = '' PASSWORD = '' # Routing -- (FROMADDR can be null iirc) FROMADDR = '' TOADDRS = '' # Message Body MESSAGE = '' def SendMessage(MESSAGE): server = smtplib.SMTP('smtp.gmail....
mit
Python
36a8a2f52f1b85d70cda0bf399a371a4c04d0ccd
add utility script to easily launch the bottle development server
ianthetechie/dmon,ianthetechie/dmon
util/dev_runner.py
util/dev_runner.py
import os, dmon, bottle os.chdir(os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..'))) bottle.run(host='localhost', port=8001)
mit
Python
2fdace2e358ede8da1a6f569b063548f8969d825
Add supervisor config generator
rzeka/QLDS-Manager
util/supervisor.py
util/supervisor.py
from util.config import Configuration from configparser import ConfigParser import platform import os class Supervisor: __config = Configuration() def __init__(self): self.__config_file = self.__config.get_config_dir() + '/supervisor.conf' def generate_config(self, servers): parser = Con...
mit
Python
9c731cd17ccc853207b715b778622274b28e9efd
Create clientsocket.py
vanbelle/CMPUT404-Lab2
clientsocket.py
clientsocket.py
#!/usr/bin/env python import socket clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) clientSocket.connect(("www.google.com", 80)) request = "GET / HTTP/1.0\n\n" clientSocket.sendall(request) response = bytearray() while True: part = clientSocket.recv(1024) if (part): response.extend(part) e...
apache-2.0
Python
885ff9c8886abd30518d2cd149f37f0ba507bb71
add 6
ericdahl/project-euler,ericdahl/project-euler,ericdahl/project-euler,ericdahl/project-euler,ericdahl/project-euler,ericdahl/project-euler
006.py
006.py
def sum_squares(l): return reduce(lambda x, y: x + y**2, l) def square_sums(l): return reduce(lambda x, y: x + y, l) ** 2 r = range(1, 101) ssum = sum_squares(r) ssquare = square_sums(r) delta = ssquare - ssum print ssum, ssquare, delta
bsd-3-clause
Python