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
9dbc755a17fbea3fbec52191d1e7bac60e5995e9
test links in the docs
Aoyunyun/jpush-docs,war22moon/jpush-docs,xiepiaa/jpush-docs,xiepiaa/jpush-docs,xiongtiancheng/jpush-docs,Aoyunyun/jpush-docs,raoxudong/jpush-docs,Aoyunyun/jpush-docs,raoxudong/jpush-docs,jpush/jpush-docs,Nocturnana/jpush-docs,raoxudong/jpush-docs,war22moon/jpush-docs,xiepiaa/jpush-docs,xiongtiancheng/jpush-docs,xiepiaa...
test_links.py
test_links.py
#!/usr/bin/env python import os import time import yaml import requests from urllib.parse import urljoin from bs4 import BeautifulSoup current = os.path.split(os.path.realpath(__file__))[0] yaml_file = "{0}/mkdocs.yml".format(current) mkdocs = yaml.load(open(yaml_file))['pages'] host='http://127.0.0.1:8000' page_filte...
mit
Python
d56b1623a278d61ff8b113b95534ce4dd6682e25
fix bug 1018349 - migration
AdrianGaudebert/socorro,Serg09/socorro,AdrianGaudebert/socorro,linearregression/socorro,yglazko/socorro,luser/socorro,twobraids/socorro,KaiRo-at/socorro,spthaolt/socorro,adngdb/socorro,spthaolt/socorro,mozilla/socorro,Serg09/socorro,rhelmer/socorro,mozilla/socorro,Tchanders/socorro,m8ttyB/socorro,pcabido/socorro,rhelme...
alembic/versions/1baef149e5d1_bug_1018349_add_coalesce_to_max_sort_.py
alembic/versions/1baef149e5d1_bug_1018349_add_coalesce_to_max_sort_.py
"""bug 1018349 - add COALESCE to max(sort) when adding a new product Revision ID: 1baef149e5d1 Revises: 26521f842be2 Create Date: 2014-06-25 15:04:37.934064 """ # revision identifiers, used by Alembic. revision = '1baef149e5d1' down_revision = '26521f842be2' from alembic import op from socorro.lib import citexttype...
mpl-2.0
Python
d836571a8dff59371d156dffea7290228305ca17
add tests for reading shapefiles via ogr
Uli1/mapnik,CartoDB/mapnik,yiqingj/work,cjmayo/mapnik,stefanklug/mapnik,naturalatlas/mapnik,tomhughes/mapnik,pnorman/mapnik,pnorman/mapnik,yohanboniface/python-mapnik,rouault/mapnik,manz/python-mapnik,tomhughes/python-mapnik,zerebubuth/mapnik,jwomeara/mapnik,lightmare/mapnik,CartoDB/mapnik,tomhughes/mapnik,rouault/mapn...
tests/python_tests/ogr_test.py
tests/python_tests/ogr_test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from nose.tools import * from utilities import execution_path import os, mapnik def setup(): # All of the paths used are relative, if we run the tests # from another directory we need to chdir() os.chdir(execution_path('.')) if 'ogr' in mapnik.DatasourceCach...
lgpl-2.1
Python
bf8b19d19ea2a5f39cba90ca815560a89e476c6c
Create Output.py
relisher/ferretextras
Output.py
Output.py
import os, time, sys from threading import Thread pipe_name = '/Users/stevenrelin/Documents/pipe_eye.txt' def child( ): pipeout = os.open(pipe_name, os.O_WRONLY) counter = 0 while True: time.sleep(1) os.write(pipeout, 'Number %03d\n' % counter) counter = (counter+1) % 5 if ...
mit
Python
319d2115ad1130247caa5734572b7676e5bb0a6d
add offline plot of nexrad climo
akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem
scripts/feature/nexrad/climo.py
scripts/feature/nexrad/climo.py
import matplotlib.pyplot as plt from pyiem.plot import maue import datetime import numpy as np avgs = np.zeros((24, 53), 'f') cnts = np.zeros((24, 53), 'f') def make_y(ts): if ts.hour >= 5: return ts.hour - 5 return ts.hour + 19 maxv = 0 for line in open('nexrad35.txt'): tokens = line.split(",")...
mit
Python
5f20962d300850200ed796f941bf98662736d4da
Add server.py to serve files in the user's specified share dir
sandwich-share/sandwich
sandwich/server.py
sandwich/server.py
from os import curdir, sep, path import time from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer import config class StaticServeHandler(BaseHTTPRequestHandler): def do_GET(self): if not config.shared_directory: self.send_error(404, 'User not sharing files') return ...
bsd-2-clause
Python
d774bb7caa9637e4d453e19fcc43ee7b9b17702c
add script for computing WWA % times
akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem
scripts/sbw/wfo_time_percent.py
scripts/sbw/wfo_time_percent.py
import iemdb import numpy import network nt = network.Table("WFO") POSTGIS = iemdb.connect('postgis', bypass=True) pcursor = POSTGIS.cursor() import mx.DateTime sts = mx.DateTime.DateTime(2005,10,1) ets = mx.DateTime.DateTime(2013,1,1) interval = mx.DateTime.RelativeDateTime(hours=3) bins = (ets - sts).minutes fo...
mit
Python
bcb65eb61c711b184114910c8d8c641278db5130
Add frozen/equilibrium wake model helpers
ricklupton/py-bem
bem/models.py
bem/models.py
import numpy as np class FrozenWakeAerodynamics: """Calculate induced flows once in given initial conditions""" def __init__(self, bem_model, initial_wind_speed, initial_rotor_speed, initial_pitch_angle): self.bem_model = bem_model # Find the frozen wake state self.wa...
mit
Python
e56c3be6dc3ab8bf31b7ce9a3d3db275b18207f0
Create sql-all.py
agusmakmun/Some-Examples-of-Simple-Python-Script,agusmakmun/Some-Examples-of-Simple-Python-Script
Django/sql-all.py
Django/sql-all.py
$ ./manage.py sqlall name-app ''' CommandError: App 'name-app' has migrations. Only the sqlmigrate and sqlflush commands can be used when an app has migrations. ''' So there before migrate to see it.
agpl-3.0
Python
a8ee7f46ffd4611a153538e05749bd99b4a98cbc
add checkPID
wannaphongcom/code-python3-blog
check-pid.py
check-pid.py
# โค้ดเซ็คความถูกต้องของบัตรประชาชน # เขียนโดย วรรณพงษ์ ภัททิยไพบูลย์ # wannaphong@yahoo.com # https://python3.wannaphong.com def checkPID(pid): if(len(pid) != 13): # ถ้า pid ไม่ใช่ 13 ให้คืนค่า False return False num=0 # ค่าสำหรับอ้างอิง index list ข้อมูลบัตรประชาชน num2=13 # ค่าประจำหลัก listdata=list(pid) # l...
mit
Python
43841114f4403b46e0ef077be6e0832ce690dfb2
add ipy_workdir
ipython/ipython,ipython/ipython
IPython/Extensions/ipy_workdir.py
IPython/Extensions/ipy_workdir.py
#!/usr/bin/env python import IPython.ipapi ip = IPython.ipapi.get() import os workdir = None def workdir_f(line): global workdir dummy,cmd = line.split(None,1) if os.path.isdir(cmd): workdir = cmd print "Set workdir",workdir elif workdir is None: print "Please ...
bsd-3-clause
Python
b78ba3220a64e9b01b3fc8c61ada0e85dc1157fc
Implement data dumper
openego/oeplatform,openego/oeplatform,tom-heimbrodt/oeplatform,tom-heimbrodt/oeplatform,openego/oeplatform,tom-heimbrodt/oeplatform,openego/oeplatform
oeplatform/dumper.py
oeplatform/dumper.py
import oeplatform.securitysettings as sec import sqlalchemy as sqla from subprocess import call import os excluded_schemas = [ "information_schema", "public", "topology", "reference", ] def connect(): engine = _get_engine() return sqla.inspect(engine) def _get_engine(): engine = sqla.c...
agpl-3.0
Python
8ce580d1f0890f72ab60efa4219de26b64ece897
Add example skeleton script
bigfix/tools
example/example.py
example/example.py
#!/usr/bin/env python import sys from argparse import ArgumentParser from getpass import getpass class BigFixArgParser(ArgumentParser): name = "hodor.py [options]" def __init__(self): description = "A tool for creating a smarter planet" usage = """Options: -h, --help Print this help me...
apache-2.0
Python
30a4cb3794d52d1743dc482f2c2a83ced1dcbd90
Make a clean report along with BLEU scores
vineetm/dl4mt-material,vineetm/dl4mt-material,vineetm/dl4mt-material,vineetm/dl4mt-material,vineetm/dl4mt-material
session2/report.py
session2/report.py
import argparse, codecs, logging import unicodecsv as csv from nltk.align.bleu_score import bleu import numpy as np def setup_args(): parser = argparse.ArgumentParser() parser.add_argument('src', 'Source file') parser.add_argument('target', 'Translated data') parser.add_argument('gold', 'Gold output fi...
bsd-3-clause
Python
31bb487a2f75268cb0b60ef4539935df83b68a84
Add auto solver for "W3-Radix Sorts".
hghwng/mooc-algs2,hghwng/mooc-algs2
quiz/3-radixsort.py
quiz/3-radixsort.py
#!/usr/bin/env python3 def make_arr(text): return text.strip().split(' ') def print_arr(arr): for t in arr: print(t, end=' ') print() def solve_q1(arr, time): for t in range(len(arr[0]) - 1, time - 1, -1): arr = sorted(arr, key=lambda x: x[t]) return arr def msd_radix_sort(ar...
mit
Python
85e7d3b4f69919b274e597b7e8f73377e7d28698
Add another script for testing purposes
ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod
process_datasets.py
process_datasets.py
""" For testing purposes: Process a specific page on the Solr index. """ import os import sys import datetime import json import uuid import pandas import xml.etree.ElementTree as ET import urllib from d1graphservice.people import processing from d1graphservice import settings from d1graphservice import dataone from...
apache-2.0
Python
d959587c168424ed0d8e91a4a20ea36076a646b7
add forgotten __init__.py
juxor/dhcpcanon_debian,DHCPAP/dhcpcanon,juga0/dhcpcanon,juxor/dhcpcanon_debian,DHCPAP/dhcpcanon,juga0/dhcpcanon
dhcpcanon/__init__.py
dhcpcanon/__init__.py
__version__ = "0.1" __author__ = "juga"
mit
Python
98fe743217ebd7868d11d8518f25430539eae5a0
add regrresion example
fukatani/stacked_generalization
example/simple_regression_example.py
example/simple_regression_example.py
from sklearn import datasets, metrics, preprocessing from stacked_generalization.lib.stacking import StackedRegressor from sklearn.ensemble import RandomForestRegressor from sklearn.ensemble import GradientBoostingRegressor from sklearn.ensemble import ExtraTreesRegressor from sklearn.linear_model import LogisticRegres...
apache-2.0
Python
896270bcd99b26e4128fd35dd3821a59807ae850
Add the model.py file declarative generated from mysql.
mteule/StationMeteo,mteule/StationMeteo
doc/model/model_decla.py
doc/model/model_decla.py
#autogenerated by sqlautocode from sqlalchemy import * from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relation engine = create_engine('mysql://monty:passwd@localhost/test_dia') DeclarativeBase = declarative_base() metadata = DeclarativeBase.metadata metadata.bind = engine class Me...
mit
Python
7aab44f006a6412d8f169c3f9a801f41a6ea0a95
Remove start dates for the second time from draft dos2 briefs
alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api
migrations/versions/880_remove_invalid_draft_dos2_brief_dates_again.py
migrations/versions/880_remove_invalid_draft_dos2_brief_dates_again.py
"""Remove dates from draft dos2 briefs. This is identical to the previous migration but will be run again to cover any draft briefs with invalid dates that could have appeared during the previous API rollout process (after the previous migration but before the code propogated fully to the ec2 instances). Revision ID: ...
mit
Python
77ccb8db873c31ad2bd8318118410abab3141312
add __version__.py
marshq/europilot
europilot/__version__.py
europilot/__version__.py
__title__ = 'europilot' __description__ = 'End to end driving simulation inside Euro Truck Simulator 2' __version__ = '0.0.1'
mit
Python
8c82465a08f5a601e6a43a8eb675136fc3678954
Create lc960.py
FiveEye/ProblemSet,FiveEye/ProblemSet
LeetCode/lc960.py
LeetCode/lc960.py
def createArray(dims) : if len(dims) == 1: return [0 for _ in range(dims[0])] return [createArray(dims[1:]) for _ in range(dims[0])] def f(A, x, y): m = len(A) for i in range(m): if A[i][x] > A[i][y]: return 0 return 1 class Solution(object): def minDeletionSize(self, A): ...
mit
Python
3ebae0f57ae3396213eb28b6fc7a23ff3e3c4980
Create file and add pseudocode
BranSeals/uml-to-cpp
uml-to-cpp.py
uml-to-cpp.py
# Copyright (C) 2017 Bran Seals. All rights reserved. # Created: 2017-06-05 print("== UML to CPP ==") print("Create or modify C++ header and implementation files by plaintext UML.") #print("Enter a UML filename: ") # file import currently disabled # check if file isn't too bonkers #uml = [] # pull UML into memory as s...
mit
Python
e2ed635fb3289a5b45f5f15cd1eb543d87fb93d7
Add test for posting a review through the view
CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer
wafer/talks/tests/test_review_views.py
wafer/talks/tests/test_review_views.py
"""Tests for wafer.talk review form behaviour.""" from django.test import Client, TestCase from django.urls import reverse from reversion import revisions from reversion.models import Version from wafer.talks.models import (SUBMITTED, UNDER_CONSIDERATION, ReviewAspect, Review) from wa...
isc
Python
466410249867b3eadbe5e2b59c46c95ecd288c6c
Add script for word counts
berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter...
python_scripts/solr_query_fetch_all.py
python_scripts/solr_query_fetch_all.py
#!/usr/bin/python import requests import ipdb import time import csv import sys import pysolr def fetch_all( solr, query ) : documents = [] num_matching_documents = solr.search( query ).hits start = 0 rows = num_matching_documents sys.stderr.write( ' starting fetch for ' + query ) while ( le...
agpl-3.0
Python
3f69fae4f15efff515b82f216de36dd6d57807e9
add ci_test.py file for ci
quxiaolong1504/cloudmusic
settings/ci_test.py
settings/ci_test.py
__author__ = 'quxl' from base import * DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } }
mpl-2.0
Python
50f0e040f363e52a390efc6acd1bc0bc0ddcabcc
Add test funcs in report_reader for DB reading
AnselCmy/ARPS,hbtech-ai/ARPS,hbtech-ai/ARPS,AnselCmy/ARPS,HeadCow/ARPS,HeadCow/ARPS,AnselCmy/ARPS
report_reader.py
report_reader.py
import pymongo as pm def connectDB(): conn = pm.MongoClient('localhost', 27017) db = conn.get_database('report_db') return db def getColList(db): return db.collection_names() def getDocNum(col): return col.find().count() def match(col, matchDict): return list(col.find(matchDict)) def main(): db = connectDB(...
mit
Python
1c9d398be7f99f15fb550adca31f3366870930e3
Set debug to false in prod, otherwise true
Code4Nepal/nepalmap_app,Code4Nepal/nepalmap_app,cliftonmcintosh/nepalmap_app,cliftonmcintosh/nepalmap_app,Code4Nepal/nepalmap_app,Code4Nepal/nepalmap_app,cliftonmcintosh/nepalmap_app,cliftonmcintosh/nepalmap_app
wazimap_np/settings.py
wazimap_np/settings.py
# pull in the default wazimap settings from wazimap.settings import * # noqa DEBUG = False if (os.environ.get('APP_ENV', 'dev') == 'prod') else True # install this app before Wazimap INSTALLED_APPS = ['wazimap_np'] + INSTALLED_APPS DATABASE_URL = os.environ.get('DATABASE_URL', 'postgresql://wazimap_np:wazimap_np@lo...
# pull in the default wazimap settings from wazimap.settings import * # noqa # install this app before Wazimap INSTALLED_APPS = ['wazimap_np'] + INSTALLED_APPS DATABASE_URL = os.environ.get('DATABASE_URL', 'postgresql://wazimap_np:wazimap_np@localhost/wazimap_np') DATABASES['default'] = dj_database_url.parse(DATABA...
mit
Python
22578771d9812a21361ec959d16e3eaacba998e3
Add APData Info collector
juvenal/RadioController
APData/APInfo.py
APData/APInfo.py
# # # # class APInfo: """...""" # Protected members __IPAddress = "" __MACAddress = "" __Channel = 0 __Region = 0 __Localization = "" __TxPowerList = [] __CurrentPowerIndex = -1 __UnderloadLimit = -1 __OverloadLimit = -1 __Reachable = False __Enabled = False __EMailSent = False __SupportedOS = "" # ...
lgpl-2.1
Python
bd1e135a6ffd9186451ec02fcbcaab7f9066e40f
Add breakpad fetch recipe.
svn2github/chromium-depot-tools,svn2github/chromium-depot-tools,svn2github/chromium-depot-tools
recipes/breakpad.py
recipes/breakpad.py
# Copyright (c) 2015 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 sys import recipe_util # pylint: disable=F0401 # This class doesn't need an __init__ method, so we disable the warning # pylint: disable=W0232...
bsd-3-clause
Python
4996ddddc14ad0d20759abbcf4d54e6132b7b028
Add the dj_redis_url file
dstufft/dj-redis-url
dj_redis_url.py
dj_redis_url.py
# -*- coding: utf-8 -*- import os try: import urlparse except ImportError: import urllib.parse as urlparse # Register database schemes in URLs. urlparse.uses_netloc.append("redis") DEFAULT_ENV = "REDIS_URL" def config(env=DEFAULT_ENV, default=None, **overrides): """Returns configured REDIS dictionary...
bsd-2-clause
Python
1487722c0431fce19d54b1b020c3af0ab411cc8a
Add sample config.py file
mattstibbs/twilio-snippets
rename_to_config.py
rename_to_config.py
account_sid = "ACXXXXXXXXXXXXXXXXX" auth_token = "XXXXXXXXXXXXXXXX" from_number = "+441111222333" to_number = "+447777222333"
mit
Python
0cc3aafced65d2f128a8036aad62edb5ee19f566
Add brume main script
flou/brume,geronimo-iia/brume
scripts/brume.py
scripts/brume.py
#!/usr/bin/env python import os import click import yaml from glob import glob from subprocess import check_output from brume.template import CfnTemplate from brume.stack import Stack def load_configuration(config_file='brume.yml'): """Return the YAML configuration for a project based on the `config_file` templ...
mit
Python
03bfd2059cfaa7043cbcd941465df6b790f84726
add `branch.py` script for initial email burst
mccolgst/www.gittip.com,eXcomm/gratipay.com,gratipay/gratipay.com,studio666/gratipay.com,gratipay/gratipay.com,eXcomm/gratipay.com,eXcomm/gratipay.com,studio666/gratipay.com,mccolgst/www.gittip.com,eXcomm/gratipay.com,gratipay/gratipay.com,studio666/gratipay.com,gratipay/gratipay.com,studio666/gratipay.com,mccolgst/www...
branch.py
branch.py
""" This is a one-off script to populate the new `emails` table using the addresses we have in `participants` and `elsewhere`. """ from __future__ import division, print_function, unicode_literals import uuid from aspen.utils import utcnow import gratipay.wireup env = gratipay.wireup.env() db = gratipay.wireup.db(en...
mit
Python
bf02019c8b97d8dc35e3e186b31cb57adac6a8ec
Create a measurement
shane-kerr/ripe-atlas-shrugd
shrugd-create.py
shrugd-create.py
import ripe.atlas.cousteau from atlaskeys import create_key # DNS query properties query_argument = "wide.ad.jp" query_type = "AAAA" dnssec_ok = True set_nsid_bit = True # IP addresses to start from dns_server_ips = [ "199.7.91.13", "2001:500:2d::d", # D.ROOT-SERVERS.NET "192.203.230.10", # E....
agpl-3.0
Python
323176a9749d37d05e87339fe34b50b90cc6b663
add solution for Maximum Product Subarray
zhyu/leetcode,zhyu/leetcode
src/maximumProductSubarray.py
src/maximumProductSubarray.py
class Solution: # @param A, a list of integers # @return an integer def maxProduct(self, A): if not A: return 0 if len(A) == 1: return A[0] maxV, minV = A[0], A[0] res = maxV for val in A[1:]: if val > 0: maxV, min...
mit
Python
abd23cbc80149d4f2985eb8aef5d893714cca717
add a script to reset the db
Psycojoker/dierentheater,Psycojoker/dierentheater,Psycojoker/dierentheater
scripts/reset_db.py
scripts/reset_db.py
from scraper import clean def run(): if raw_input("Are you sure? Then write 'yes'") == "yes": clean()
agpl-3.0
Python
43e5727d4091e0b6cb11e0e13ea9f7daf69628fc
Add corpusPreProcess.
wxpftd/ngram
corpusPreProcess.py
corpusPreProcess.py
#! /usr/share/env python # -*- coding=utf-8 -*- resultFile = open('corpus/BigCorpusPre.txt', 'w') with open('corpus/BigCorpus.txt', 'r') as f: for line in f: line = line[line.find(':')+1:] resultFile.write(line.strip()+'\n') resultFile.close()
apache-2.0
Python
82089ad5e5c0d597cfdd16575b4fa5a9a09415ff
introduce plumbery from the command line -- no python coding, yeah!
bernard357/plumbery,DimensionDataCBUSydney/plumbery,bernard357/plumbery,DimensionDataCBUSydney/plumbery
plumbery/__main__.py
plumbery/__main__.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 # (the "License"); you may not use ...
apache-2.0
Python
7182af317116db7eb3f7a278b3487ad91a3b3331
Add example for a clunky 3D high resolution loupe for napari
jni/useful-histories
high-res-slider.py
high-res-slider.py
import functools import numpy as np import dask.array as da from magicgui.widgets import Slider, Container import napari # stack = ... # your dask array # stack2 = stack[::2, ::2, ::2] # stack4 = stack2[::2, ::2, ::2] # 👆 quick and easy multiscale pyramid, don't do this really # see https://github.com/dask/dask-imag...
bsd-3-clause
Python
1e104af5dc1ef5cbec4bfad62a1691bd0c784caf
Add lstm with zoneout (slow to converge).
LaurentMazare/deep-models,LaurentMazare/deep-models
rhn/lstm_zoneout.py
rhn/lstm_zoneout.py
# LSTM implementation using zoneout as described in # Zoneout: Regularizing RNNs by Randomly Preserving Hidden Activations # https://arxiv.org/abs/1606.01305 from keras import backend as K from keras.layers import LSTM, time_distributed_dense from keras import initializations, activations, regularizers from keras.engin...
apache-2.0
Python
72f32099411644a3fed6103430f7dd78fb0929a5
Add new content parser class (based upon code in Konstruktuer)
fastner/konstrukteur,fastner/konstrukteur,fastner/konstrukteur
konstrukteur/ContentParser.py
konstrukteur/ContentParser.py
# # Konstrukteur - Static website generator # Copyright 2013 Sebastian Fastner # import glob, os from jasy.core import Console import konstrukteur.Language import konstrukteur.Util class ContentParser: """ Content parser class for Konstrukteur """ def __init__(self, extensions, fixJasyCommands, defaultLanguage): ...
mit
Python
1d20bec9306904a6d676c4e1e34a07a842a7a600
Add the IGMP file which got left out.
gvnn3/PCS,gvnn3/PCS
pcs/packets/igmp.py
pcs/packets/igmp.py
import pcs from socket import AF_INET, inet_ntop import struct import inspect import time import igmpv2 import igmpv3 #import dvmrp #import mtrace IGMP_HOST_MEMBERSHIP_QUERY = 0x11 IGMP_v1_HOST_MEMBERSHIP_REPORT = 0x12 IGMP_DVMRP = 0x13 IGMP_v2_HOST_MEMBERSHIP_REPORT = 0x16 IGMP_HOST_LEAVE_MESSAGE = 0x17 IGMP_v3_HOS...
bsd-3-clause
Python
2cadad76c2756852b94948088e92b9191abebbb7
make one pickle file with all metadata (for faster loading)
317070/kaggle-heart
generate_metadata_pkl.py
generate_metadata_pkl.py
import argparse from dicom.sequence import Sequence import glob import re from log import print_to_file import cPickle as pickle def read_slice(path): return pickle.load(open(path))['data'] def convert_to_number(value): value = str(value) try: if "." in value: return float(value) ...
mit
Python
8939e873f4ea61169f9384eded5b8c603cfde988
Add crypto pre-submit that will add the openssl builder to the default try-bot list.
ropik/chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,adobe/chromium,ropik/chr...
crypto/PRESUBMIT.py
crypto/PRESUBMIT.py
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Chromium presubmit script for src/net. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details on the presubmit ...
bsd-3-clause
Python
27ed31c7a21c4468bc86aaf220e30315e366c425
add message to SearxParameterException - fixes #1722
jcherqui/searx,jcherqui/searx,asciimoo/searx,asciimoo/searx,asciimoo/searx,jcherqui/searx,dalf/searx,asciimoo/searx,dalf/searx,dalf/searx,jcherqui/searx,dalf/searx
searx/exceptions.py
searx/exceptions.py
''' searx is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. searx is distributed in the hope that it will be useful, but WITHOUT ANY WA...
''' searx is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. searx is distributed in the hope that it will be useful, but WITHOUT ANY WA...
agpl-3.0
Python
a230bb1b2f1c96c7f9764ee2bf759ea9fe39e801
add populations tests
timothydmorton/isochrones,timothydmorton/isochrones
isochrones/tests/test_populations.py
isochrones/tests/test_populations.py
import unittest from pandas.testing import assert_frame_equal from scipy.stats import uniform, norm from isochrones import get_ichrone from isochrones.priors import ChabrierPrior, FehPrior, GaussianPrior, SalpeterPrior, DistancePrior, AVPrior from isochrones.populations import StarFormationHistory, StarPopulation, Bin...
mit
Python
06df583e3821470856852b10f0703fccce81e2d6
Add planex-pin command
djs55/planex,djs55/planex,djs55/planex
planex/pin.py
planex/pin.py
""" planex-pin: Generate a new override spec file for a given package """ import argparse import os import sys import re import logging from planex.util import run def describe(repo, treeish="HEAD"): dotgitdir = os.path.join(repo, ".git") if not os.path.exists(dotgitdir): raise Exception("Pin target...
lgpl-2.1
Python
f982cd78ae79f77c2ca59440de20de37002d6658
Add a pcakge: libzip. (#3656)
iulian787/spack,skosukhin/spack,matthiasdiener/spack,skosukhin/spack,skosukhin/spack,EmreAtes/spack,krafczyk/spack,LLNL/spack,krafczyk/spack,lgarren/spack,iulian787/spack,TheTimmy/spack,tmerrick1/spack,tmerrick1/spack,matthiasdiener/spack,krafczyk/spack,tmerrick1/spack,tmerrick1/spack,TheTimmy/spack,lgarren/spack,mfher...
var/spack/repos/builtin/packages/libzip/package.py
var/spack/repos/builtin/packages/libzip/package.py
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Python
9877c21c502b27460f70e6687ed3fd6a2d3fd0d5
add new package at v8.3.0 (#27446)
LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/racket/package.py
var/spack/repos/builtin/packages/racket/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Racket(Package): """The Racket programming language.""" homepage = "https://www.racke...
lgpl-2.1
Python
bd49a4c82e011d7c5025abc15324220b1496f8c8
add deepspeech.py to support DeepSpeech
peitaosu/Diplomatist
deepspeech.py
deepspeech.py
import subprocess class DeepSpeechRecognizer(): def __init__(self, model=None, alphabet=None, lm=None, trie=None): self.model = model self.alphabet = alphabet self.lm = lm self.trie = trie def recognize(self, audio_file): """recognize audio file args: ...
mit
Python
ca09dc0b9d555f10aafb17380a9a8592727d0a0f
Add dp/SPOJ-ROCK.py
ankeshanand/interview-prep,ankeshanand/interview-prep
dp/SPOJ-ROCK.py
dp/SPOJ-ROCK.py
def compute_zero_counts(rock_desc): zero_counts = [0 for i in xrange(N+1)] for i in xrange(1, N+1): zero_counts[i] = zero_counts[i-1] if rock_desc[i-1] == '0': zero_counts[i] += 1 return zero_counts def score(zero_counts, start, end): length = end - start + 1 zeroes = z...
mit
Python
50d05aabc2eb1d5bcb20d457dd05d2882b983afa
Add installation script for profiler.
tensorflow/profiler,tensorflow/profiler,tensorflow/profiler,tensorflow/profiler,tensorflow/profiler
install_and_run.py
install_and_run.py
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Python
734967196c8f0577b218802c16d9eab31c9e9054
Add problem 36, palindrome binaries
dimkarakostas/project-euler
problem_36.py
problem_36.py
from time import time def is_palindrome(s): for idx in range(len(s)/2): if s[idx] != s[-1*idx - 1]: return False return True def main(): palindrom_nums = [num for num in range(int(1e6)) if is_palindrome(str(num)) and is_palindrome(str(bin(num))[2:])] print 'Palindroms:', palindro...
mit
Python
ad9a9df8e144c41456aeded591081a3a339853f3
Create RLU_forward_backward.py
rupertsmall/machine-learning,rupertsmall/machine-learning
Neural-Networks/RLU_forward_backward.py
Neural-Networks/RLU_forward_backward.py
from numpy import * from RLU_neural_forward import * from RLU_back_propagation import * def forwardBackward(xi, x, y, MT, time_queue, good_queue, DELTA_queue): A = neural_forward(xi, x, MT) check = argmax(A[-xi[-1]:]) # send back some progress statistic if y[check]-1 == 0: good = good_queue.get() good += 1 ...
mit
Python
1ecb4a0711304af13f41ae1aae67792057783334
Create ScaperUtils.py
Soncrates/stock-study,Soncrates/stock-study
data/ScaperUtils.py
data/ScaperUtils.py
class ScraperUtil (object) : class Base : def __init__(self,data_get,data_parse, data_formatter=None) : self.get_data = data_get self.parse_data = data_parse self.data_formatter = data_formatter class Yahoo(Base) : def __init__(self,data_get,data_format,data_parse) : ...
lgpl-2.1
Python
6d33ed73adeea4808ed4b3b9bd8642ad83910dfc
add ridgeline example (#1519)
jakevdp/altair,altair-viz/altair
altair/examples/ridgeline_plot.py
altair/examples/ridgeline_plot.py
""" Ridgeline plot (Joyplot) Example -------------------------------- A `Ridgeline plot <https://serialmentor.com/blog/2017/9/15/goodbye-joyplots>`_ chart is a chart that lets you visualize distribution of a numeric value for several groups. Such a chart can be created in Altair by first transforming the data into a ...
bsd-3-clause
Python
dfe65e6839a4347c7acfc011f052db6ec4ee1d9d
test Task
xassbit/zorn,xassbit/zorn,xassbit/zorn
tests/unit/test_task.py
tests/unit/test_task.py
import sys from zorn import tasks from io import StringIO def test_task(): task = tasks.Task() assert task.verbosity == 1 def test_parse_verbosity_standard(): silent = False verbose = False verbosity = tasks.Task.parse_verbosity(verbose, silent) assert verbosity == 1 def test_parse_verbosity_...
mit
Python
02156d3e9140b7f8f61b79816891ede2fff2cc49
rename models to properties
noperative/whalehelpbot
properties.py
properties.py
import ConfigParser import os import sys subreddit = 'taigeilove' user_agent = 'Python:whalehelpbot:v1.0 (by /u/Noperative)' general_words = [] first_time_words = [] expedition_words = [] quest_words = []
mit
Python
e74c3273f840afbca25936083abdfb6577b4fdd0
Devuelve lista de etiquetas y atributos
celiagarcia/ptavi-p3
smallsmilhandler.py
smallsmilhandler.py
#!/usr/bin/python # -*- coding: utf-8 -*- #CELIA GARCIA FERNANDEz from xml.sax import make_parser from xml.sax.handler import ContentHandler class SmallSMILHandler(ContentHandler): def __init__ (self): self.lista = [] self.etiquetas = ['root-layout', 'region', 'img', 'audio', 'textstream...
mit
Python
024e7fe473a19a16b7e34203aef2841af7a3aad4
add markreads script
MischaLundberg/bamsurgeon,adamewing/bamsurgeon,adamewing/bamsurgeon,MischaLundberg/bamsurgeon
etc/markreads.py
etc/markreads.py
#!/usr/bin/env python import pysam import sys def markreads(bamfn, outfn): bam = pysam.AlignmentFile(bamfn, 'rb') out = pysam.AlignmentFile(outfn, 'wb', template=bam) for read in bam.fetch(until_eof=True): tags = read.tags tags.append(('BS',1)) read.tags = tags out.write(...
mit
Python
b86ad075f690718e528364bedce891a3a4debdaf
Add a basic example API
Gentux/imap-cli,Gentux/imap-cli
examples/api.py
examples/api.py
#! /usr/bin/env python # -*- coding: utf-8 -*- """Simple REST API for Imap-CLI.""" import copy import json import logging import re from wsgiref import simple_server from webob.dec import wsgify from webob.exc import status_map import imap_cli from imap_cli import config from imap_cli import const from imap_cli i...
mit
Python
0bd69e17d75cf1ecaa53153fd07abf2e139f57b7
add function0-input.py
chaonet/iDoulist,Frank-the-Obscure/iDoulist
input/function0-input.py
input/function0-input.py
# -*- coding: utf-8 -*- # Author Frank Hu # iDoulist Function 0 - input import urllib2 response = urllib2.urlopen("http://www.douban.com/doulist/38390646/") print response.read()
mit
Python
70d5b47a66d883187574c409ac08ece24277d292
Add the test.py example that is cited in the cytomine.org documentation
cytomine/Cytomine-python-client,cytomine/Cytomine-python-client
examples/test.py
examples/test.py
# -*- coding: utf-8 -*- # * Copyright (c) 2009-2020. Authors: see NOTICE file. # * # * 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...
apache-2.0
Python
1c2bde23ffc6188fe839b36011775663f86c8919
Create config.py
sculove/xing-plus
config.py
config.py
# -*- coding: utf-8 -*- import configparser class Config: _cp = None def load(): Config._cp = configparser.ConfigParser() Config._cp.read("config.ini") for category in Config._cp.sections(): temp = {} for op in Config._cp.options(category): temp[op] = Config._cp[category][op] setattr(Config, cat...
mit
Python
0712d78cf76c1d3f699317fcc64db3fe60dc6266
Add utility functions for generating documentation
vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks
docs/utils.py
docs/utils.py
def cleanup_docstring(docstring): doc = "" stripped = [line.strip() for line in docstring.split("\n")] doc += '\n'.join(stripped) return doc
agpl-3.0
Python
a36e013e9b1d7133ed98cb2f087f3cb3dc53de69
Add 5-2 to working dictionary.
fx2003/tensorflow-study,fx2003/tensorflow-study,fx2003/tensorflow-study,fx2003/tensorflow-study,fx2003/tensorflow-study,fx2003/tensorflow-study
models/tutorials/image/cifar10/5-2cnn_advance.py
models/tutorials/image/cifar10/5-2cnn_advance.py
import cifar10, cifar10_input import tensorflow as tf import numpy as np import time max_steps = 3000 batch_size = 128 data_dir = '/tmp/cifar10_data/cifar-10-batches-bin' def variable_with_weight_loss(shape, stddev, wl): var = tf.Variable(tf.truncated_normal(shape, stddev = stddev)) if wl is not None: ...
mit
Python
24bb92edc18ea65166873fa41cd8db3ed6d62b5d
Add tests for forms
TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio
td_biblio/tests/test_forms.py
td_biblio/tests/test_forms.py
from django.core.exceptions import ValidationError from django.test import TestCase from ..forms import text_to_list, EntryBatchImportForm def test_text_to_list(): """Test text_to_list utils""" inputs = [ 'foo,bar,lol', 'foo , bar, lol', 'foo\nbar\nlol', 'foo,\nbar,\nlol', ...
mit
Python
1bf634bd24d94a7d7ff358cea3215bba5b59d014
Create power_of_two.py in bit manipulation
ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs...
bit_manipulation/power_of_two/python/power_of_two.py
bit_manipulation/power_of_two/python/power_of_two.py
# Check if given number is power of 2 or not # Function to check if x is power of 2 def isPowerOfTwo (x): # First x in the below expression is for the case when x is 0 return (x and (not(x & (x - 1))) ) # Driver code x = int(input("Enter a no:")) if(isPowerOfTwo(x)): print('Yes') else: ...
cc0-1.0
Python
8fddde260af6ea1e6de8491dd99dca671634327c
Add test for the matrix representation function.
odlgroup/odl,odlgroup/odl,kohr-h/odl,kohr-h/odl,aringh/odl,aringh/odl
test/operator/utility_test.py
test/operator/utility_test.py
# Copyright 2014, 2015 The ODL development group # # This file is part of ODL. # # ODL 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 later version. ...
mpl-2.0
Python
8b92e55fa202723f7859cd1ea22e835e5c693807
Add some time handling functions
Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org
Instanssi/kompomaatti/misc/awesometime.py
Instanssi/kompomaatti/misc/awesometime.py
# -*- coding: utf-8 -*- from datetime import datetime, timedelta def todayhelper(): today = datetime.today() return datetime(day=today.day, year=today.year, month=today.month) def format_single_helper(t): now = datetime.now() today = todayhelper() tomorrow = today + timedelta(days=1) the_day_...
mit
Python
bca4a0a0dda95306fe126191166e733c7ccea3ee
Add staff permissions for backup models
opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor
nodeconductor/backup/perms.py
nodeconductor/backup/perms.py
from nodeconductor.core.permissions import StaffPermissionLogic PERMISSION_LOGICS = ( ('backup.BackupSchedule', StaffPermissionLogic(any_permission=True)), ('backup.Backup', StaffPermissionLogic(any_permission=True)), )
mit
Python
54b66e132137eb6abea0a5ae6571dbc52e309b59
change all libraries to have module_main of 'index', and add an index.js if it doesn't have one
mozilla/FlightDeck,mozilla/FlightDeck,mozilla/FlightDeck
migrations/011-ensure_library_main_module.py
migrations/011-ensure_library_main_module.py
from jetpack.models import PackageRevision LIB_MODULE_MAIN = 'index' libs = PackageRevision.objects.filter(package__type='l', module_main='main') .select_related('package', 'modules') libs.update(module_main=LIB_MODULE_MAIN) main_per_package = {} for revision in libs: if revision.modules.filter(filenam...
bsd-3-clause
Python
2fda10a83aa5a4d3080a0ce8751e28a18fc9a3e0
Add two-point example to serve as a regression test for gridline/plot distinguishing
joferkington/mplstereonet
examples/two_point.py
examples/two_point.py
""" Demonstrates plotting multiple linear features with a single ``ax.pole`` call. The real purpose of this example is to serve as an implicit regression test for some oddities in the way axes grid lines are handled in matplotlib and mplstereonet. A 2-vertex line can sometimes be confused for an axes grid line, and t...
mit
Python
ee85acb7f9f3af91db3bfb4bf766636883f07685
Add an extra test for the OpalSerializer
khchine5/opal,khchine5/opal,khchine5/opal
opal/tests/test_core_views.py
opal/tests/test_core_views.py
""" Unittests for opal.core.views """ from opal.core import test from opal.core import views class SerializerTestCase(test.OpalTestCase): def test_serializer_default_will_super(self): s = views.OpalSerializer() with self.assertRaises(TypeError): s.default(None)
agpl-3.0
Python
1fdffc42c7ff7ea4339a58e8a19ffa07253e4149
Add script to resolve conflicts
itkach/mwscrape
resolveconflicts.py
resolveconflicts.py
# Copyright (C) 2014 Igor Tkach # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import argparse import couchdb from urlparse import urlparse def parse_args(): a...
mpl-2.0
Python
a0a2017e05af986cd0a7207c429e7dc5e8b3fcd2
Add missing tests for Variable
amolenaar/gaphas
tests/test_solver_variable.py
tests/test_solver_variable.py
from gaphas.solver import Variable def test_equality(): v = Variable(3) w = Variable(3) o = Variable(2) assert v == 3 assert 3 == v assert v == w assert not v == o assert v != 2 assert 2 != v assert not 3 != v assert v != o def test_add_to_variable(): v = Variable(3...
lgpl-2.1
Python
865356c5b7bbec2b9412ffd3d2a39fea19e4b01a
Create getcounts.py
sunjerry019/photonLauncher,sunjerry019/photonLauncher,sunjerry019/photonLauncher,sunjerry019/photonLauncher,sunjerry019/photonLauncher
usbcounter/getcounts.py
usbcounter/getcounts.py
import serial import json import os, sys import time
apache-2.0
Python
993b1af160e6ed7886c2c95770683fae72332aed
remove __debug__
jjkoletar/panda3d,Wilee999/panda3d,tobspr/panda3d,chandler14362/panda3d,Wilee999/panda3d,hj3938/panda3d,ee08b397/panda3d,jjkoletar/panda3d,grimfang/panda3d,grimfang/panda3d,mgracer48/panda3d,brakhane/panda3d,chandler14362/panda3d,tobspr/panda3d,cc272309126/panda3d,brakhane/panda3d,brakhane/panda3d,jjkoletar/panda3d,hj3...
direct/src/task/Task.py
direct/src/task/Task.py
""" This module exists temporarily as a gatekeeper between TaskOrig.py, the original Python implementation of the task system, and TaskNew.py, the new C++ implementation. """ from pandac.libpandaexpressModules import ConfigVariableBool wantNewTasks = ConfigVariableBool('want-new-tasks', False).getValue() if wantNewTa...
""" This module exists temporarily as a gatekeeper between TaskOrig.py, the original Python implementation of the task system, and TaskNew.py, the new C++ implementation. """ wantNewTasks = False if __debug__: from pandac.PandaModules import ConfigVariableBool wantNewTasks = ConfigVariableBool('want-new-tasks'...
bsd-3-clause
Python
85cbec4f398c49a4903c7370f74deeae3d5adabf
Create ShowData.py
Larz60p/Python-Record-Structure
ShowData.py
ShowData.py
""" The MIT License (MIT) Copyright (c) <2016> <Larry McCaig (aka: Larz60+ aka: Larz60p)> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rig...
mit
Python
64130f988f2154870db540244a399a8297a103e9
move hardcoded URL from email script to model definition.
CarlFK/veyepar,CarlFK/veyepar,xfxf/veyepar,xfxf/veyepar,xfxf/veyepar,CarlFK/veyepar,CarlFK/veyepar,xfxf/veyepar,xfxf/veyepar,CarlFK/veyepar
dj/scripts/email_url.py
dj/scripts/email_url.py
#!/usr/bin/python # email_url.py # emails the video URL to the presenters import itertools from pprint import pprint from email_ab import email_ab class email_url(email_ab): ready_state = 7 subject_template = "[{{ep.show.name}}] Video up: {{ep.name}}" body_body = """ The video is posted: {% for ur...
#!/usr/bin/python # email_url.py # emails the video URL to the presenters import itertools from pprint import pprint from email_ab import email_ab class email_url(email_ab): ready_state = 7 subject_template = "[{{ep.show.name}}] Video up: {{ep.name}}" body_body = """ The video is posted: {% for ur...
mit
Python
ce47fec10ccda45550625221c64322d89622c707
Add libjpeg.gyp that wraps third_party/externals/libjpeg/libjpeg.gyp Review URL: https://codereview.appspot.com/5848046
Hikari-no-Tenshi/android_external_skia,DiamondLovesYou/skia-sys,Khaon/android_external_skia,OptiPop/external_skia,TeamBliss-LP/android_external_skia,fire855/android_external_skia,mydongistiny/android_external_skia,nfxosp/platform_external_skia,AOSP-YU/platform_external_skia,aospo/platform_external_skia,todotodoo/skia,s...
gyp/libjpeg.gyp
gyp/libjpeg.gyp
# Copyright 2012 The Android Open Source Project # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Depend on this wrapper to pick up libjpeg from third_party { 'targets': [ { 'target_name': 'libjpeg', 'type': 'none', 'dependencies': [ ...
bsd-3-clause
Python
d4ff515df7e12d26c759adfafcacf82e47da71a1
Add util
hausdorff/snapchat-fs
snapchat_fs/util.py
snapchat_fs/util.py
#!/usr/bin/env python """ util.py provides a set of nice utility functions that support the snapchat_fs pkg """ __author__ = "Alex Clemmer, Chad Brubaker" __copyright__ = "Copyright 2013, Alex Clemmer and Chad Brubaker" __credits__ = ["Alex Clemmer", "Chad Brubaker"] __license__ = "MIT" __version__ = "0.1" __maintai...
mit
Python
7d9fd2eed72a2a65744259af1bd8580253f282d3
Create a.py
y-sira/atcoder,y-sira/atcoder
abc067/a.py
abc067/a.py
a, b = map(int, input().split()) if a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0: print('Possible') else: print('Impossible')
mit
Python
c4d5d04a957fed09228995aa7f84ed19c64e3831
Add previously forgotten afterflight utilities module
foobarbecue/afterflight,foobarbecue/afterflight,foobarbecue/afterflight,foobarbecue/afterflight
af_utils.py
af_utils.py
#Copyright 2013 Aaron Curtis #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...
apache-2.0
Python
229d5b93d6e5474dfcd125536c7744f6a7ec86d0
Create blender tool
hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR
waflib/Tools/blender.py
waflib/Tools/blender.py
#!/usr/bin/env python # encoding: utf-8 # Michal Proszek, 2014 (poxip) """ Detect the version of Blender, path and install the extension: def options(opt): opt.load('blender') def configure(cnf): cnf.load('blender') def build(bld): bld(name='io_mesh_raw', feature='blender', files=['file1.py', 'file2.py...
agpl-3.0
Python
f68b0bb1e1f10b10e58057f60e17377f027690f8
add a util function for ungzip.
kilfu0701/Wedding-QRcode-Web,kilfu0701/Wedding-QRcode-Web,kilfu0701/Wedding-QRcode-Web,kilfu0701/Wedding-QRcode-Web
web/my_util/compress.py
web/my_util/compress.py
import gzip from StringIO import StringIO def ungzip(resp): if resp.info().get('Content-Encoding') == 'gzip': buf = StringIO(resp.read()) f = gzip.GzipFile(fileobj=buf) data = f.read() return data else: return resp.read()
mit
Python
eab925debf62d4ba180b1a114841b7a4f0fe8e76
add basic command line interface
BenDoan/domjudge-utils
basicInterface.py
basicInterface.py
import sys import requests import random passchars = map(chr,range(ord('a'),ord('z')+1) + range(ord('A'),ord('Z')+1) + range(ord('0'),ord('9')+1) ) class User(): def __init__(self,name,username,bracket): self.name = name self.username = username self.bracket = bracket self.password...
unlicense
Python
f66b799a22f2c74b88f867266c2e51eda1377b1c
Create find_the_mine.py
Kunalpod/codewars,Kunalpod/codewars
find_the_mine.py
find_the_mine.py
#Kunal Gautam #Codewars : @Kunalpod #Problem name: Find the Mine! #Problem level: 6 kyu def mineLocation(field): for i in range(len(field)): for j in range(len(field)): if field[i][j]==1: return [i,j]
mit
Python
febc735e79f3cc1b5f2e5fe2882bf28c458f638a
Initialize init file
tranlyvu/find-link,tranlyvu/findLink
wikilink/db/__init__.py
wikilink/db/__init__.py
""" wikilink ~~~~~~~~ wiki-link is a web-scraping application to find minimum number of links between two given wiki pages. :copyright: (c) 2016 - 2018 by Tran Ly VU. All Rights Reserved. :license: Apache License 2.0. """ __all__ = ["db", "base", "page", "link"] __author__ = "Tran Ly Vu (vutransingapore...
apache-2.0
Python
3fdb673977de57e5555eafb18e36544f3ea8c056
Solve the absurd problem with an absurd file
stefanv/selective-inference,selective-inference/selective-inference,selective-inference/selective-inference,stefanv/selective-inference,selective-inference/selective-inference,stefanv/selective-inference,stefanv/selective-inference,selective-inference/selective-inference
selection/absurd.py
selection/absurd.py
import kmeans import numpy as np kmeans = reload(kmeans) n_sample = 100 p_array = [] for i in range(n_sample): if i%10 == 0: print i, " / ", n_sample kmeans = reload(kmeans) p = kmeans.f(10) p_array.append(p) import matplotlib.pyplot as plt p_array = sorted(p_array) x = np.arange(...
bsd-3-clause
Python
c2bce27530f9997bffcb04f80a8d78db65ff98b2
Create GPS.py
mecax/pyrobotlab,MyRobotLab/pyrobotlab,sstocker46/pyrobotlab,MyRobotLab/pyrobotlab,sstocker46/pyrobotlab,sstocker46/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,mecax/pyrobotlab
home/kmcgerald/GPS.py
home/kmcgerald/GPS.py
from time import sleep # The geofence and measure distance methods should be available in MRL > 1.0.86 gps1 = Runtime.start("gps1", "GPS") gps1.connect("/dev/tty.palmOneGPS-GPSSerialOut") sleep(1) # define some points ... # Lets use Nova Labs 1.0 lat1 = 38.950829 lon1 = -77.339502 # and Nova Labs 2.0 lat2 = 38.9544...
apache-2.0
Python
ddc80392b17a3fadcbea09f82ea5f6936f0fd459
add fbcode_builder_config for mvfst build in oss
ReactiveSocket/reactivesocket-cpp,phoad/rsocket-cpp,phoad/rsocket-cpp,phoad/rsocket-cpp,rsocket/rsocket-cpp,phoad/rsocket-cpp,ReactiveSocket/reactivesocket-cpp,ReactiveSocket/reactivesocket-cpp,phoad/rsocket-cpp,rsocket/rsocket-cpp,rsocket/rsocket-cpp,rsocket/rsocket-cpp
build/fbcode_builder/specs/mvfst.py
build/fbcode_builder/specs/mvfst.py
#!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import specs.folly as folly import specs.fizz as fizz def fbcode_builder_spec(builder): ret...
unknown
Python
84098985420d56d9db375531afb5083e7c7f0d08
Add an example using pygame (pygameLiveView.py). Connects to camera and show LiveView images via X or console (fbcon/svglib/etc).
Bloodevil/sony_camera_api,mungewell/sony_camera_api,Bloodevil/sony_camera_api
src/example/pygameLiveView.py
src/example/pygameLiveView.py
from pysony import SonyAPI, common_header, payload_header import argparse import binascii import io import pygame import os # Global Variables options = None incoming_image = None frame_sequence = None frame_info = None frame_data = None done = False parser = argparse.ArgumentParser(prog="pygameLiveView") # Genera...
mit
Python
20da50a3c6cee33caf2205562d0d05be6c6721fb
Create enforce_posting_limits.py
kprdev/reddit-mod-posting-limits
enforce_posting_limits.py
enforce_posting_limits.py
#!/usr/bin/python import sys import time import logging import praw def main(): # SET THESE - reddit application configuration user_agent = '' client_id = '' client_secret = '' username = '' password = '' # SET THESE - Customize these for your subreddit. subreddit_name = '' post_li...
mit
Python
d8ff61b72c07a9f0b22e5cbaefe6277bf2697afc
Create project.py
gwsilva/project-surgery
project_surgery/project.py
project_surgery/project.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
afb62cebced6bcbbbde2576be2d9b9d4b9ad3964
add chisquare test comparing random sample with cdf (first try of commit)
scipy/scipy-svn,jasonmccampbell/scipy-refactor,scipy/scipy-svn,scipy/scipy-svn,lesserwhirls/scipy-cwt,lesserwhirls/scipy-cwt,jasonmccampbell/scipy-refactor,jasonmccampbell/scipy-refactor,scipy/scipy-svn,jasonmccampbell/scipy-refactor,lesserwhirls/scipy-cwt,lesserwhirls/scipy-cwt
scipy/stats/tests/test_discrete_chisquare.py
scipy/stats/tests/test_discrete_chisquare.py
import numpy as np from scipy import stats debug = False def check_discrete_chisquare(distname, arg, alpha = 0.01): '''perform chisquare test for random sample of a discrete distribution Parameters ---------- distname : string name of distribution function arg : sequence ...
bsd-3-clause
Python
e87982d03edeb7c16d3c183309adfff4be50d168
Add Qt4 file to start on creating a Qt-based GUI
CodingAnarchy/Amon
gui/qt.py
gui/qt.py
from lib.version import AMON_VERSION from lib.keybase import KeybaseUser from lib.gmail import GmailUser from lib.addresses import AddressBook import lib.gpg as gpg import sys import logging import json from PyQt4 import QtGui class Amon(QtGui.QMainWindow): def __init__(self): super(Amon, self).__init__(...
unlicense
Python
3972c4a16894732db418a2d04f36b5104e0fac86
add rms code in own namespace
bartscheers/tkp,transientskp/tkp,mkuiack/tkp,bartscheers/tkp,transientskp/tkp,mkuiack/tkp
tkp/quality/rms.py
tkp/quality/rms.py
from tkp.utility import nice_format def rms_invalid(rms, noise, low_bound=1, high_bound=50): """ Is the RMS value of an image too high? :param rms: RMS value of an image, can be computed with tkp.quality.statistics.rms :param noise: Theoretical noise level of instrument, can be calcul...
bsd-2-clause
Python
5009b158f0c47ea885ba5fdcbd76dd1fc2bb6986
Use a script to post metrics to an ingest endpoint.
shintasmith/blueflood,rackerlabs/blueflood,rackerlabs/blueflood,rackerlabs/blueflood,shintasmith/blueflood,shintasmith/blueflood,shintasmith/blueflood,rackerlabs/blueflood,rackerlabs/blueflood,shintasmith/blueflood,shintasmith/blueflood,rackerlabs/blueflood
bfclient.py
bfclient.py
#!/usr/bin/env python import argparse from os import environ import datetime import requests import time def get_unix_time(dt): return int(time.mktime(dt.timetuple())) if __name__ == '__main__': parser = argparse.ArgumentParser() BF_URL = environ.get('BF_URL', None) BF_TOKEN = environ.get('BF_TOK...
apache-2.0
Python