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
08c1de584c76a0786b64d1f8b15a79ec5224c7b4
add query.py
e-beach/amazing-tweets,e-beach/amazing-tweets
query.py
query.py
import twitter from credentials import consumer_key, consumer_secret, access_token_key, access_token_secret api = twitter.Api(consumer_key=consumer_key, consumer_secret=consumer_secret, access_token_key=access_token_key, access_token_secret=access_token_secret)
mit
Python
fadd28744ddfbc6182c29b700419e7a8d9c0576a
Add the path utils.
rowhit/gitfs,ksmaheshkumar/gitfs,bussiere/gitfs,PressLabs/gitfs,PressLabs/gitfs
gitfs/utils/path.py
gitfs/utils/path.py
import os from collections import deque def split_path_into_components(path): """ Splits a path and returns a list of its constituents. E.g.: /totally/random/path => ['totally', 'random', 'path'] :param path: the path to be split :type path: str :returns: the list which contains the path compo...
apache-2.0
Python
d6e22345d452fd240242b2af8fe349fa45a83aae
Add setup.py script
scylladb/scylla-cluster-tests,scylladb/scylla-longevity-tests,scylladb/scylla-cluster-tests,scylladb/scylla-longevity-tests,amoskong/scylla-cluster-tests,scylladb/scylla-cluster-tests,amoskong/scylla-cluster-tests,amoskong/scylla-cluster-tests,amoskong/scylla-cluster-tests,amoskong/scylla-cluster-tests,scylladb/scylla-...
setup.py
setup.py
#!/usr/bin/env python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hop...
agpl-3.0
Python
fb68b7be217c08a24729683c06784eab5dd4dd93
Add helloworld/python
qzpm/Hello-language,qzpm/Hello-language,qzpm/Hello-language,qzpm/Hello-language,qzpm/Hello-language,qzpm/Hello-language,qzpm/Hello-language,qzpm/Hello-language,qzpm/Hello-language,qzpm/Hello-language,qzpm/Hello-language,qzpm/Hello-language,qzpm/Hello-language,qzpm/Hello-language,qzpm/Hello-language
helloworld/helloworld.py
helloworld/helloworld.py
print("helloworld")
mit
Python
c5e19d7a250b45ca46bdddf0b0a47468e18f6260
Add setup.py
Zaharid/nnets,Zaharid/nnets
setup.py
setup.py
from __future__ import print_function import sys from setuptools import setup, find_packages if sys.version_info < (3,4): print("nnets requires Python 3.4 or later", file=sys.stderr) sys.exit(1) with open("README.md") as f: longdesc = f.read() setup (name = 'nnets', version = '0.1', descrip...
bsd-2-clause
Python
01db1d6f591858b52b6a75ac72b5bdcb49aca708
Add script to extract stderr and stout from nextflow
maubarsom/biotico-tools,maubarsom/biotico-tools,maubarsom/biotico-tools,maubarsom/biotico-tools,maubarsom/biotico-tools
python/extract_logs_from_nextflow.py
python/extract_logs_from_nextflow.py
#!/usr/bin/env python import os import sys import pandas as pd from glob import glob import subprocess def main(): if len(sys.argv) != 3: print("Usage: extract_logs_from_nextflow.py <nextflow_trace_file> <task_tag>:<stderr|stdout|both>",file=sys.stderr) # Load Nextflow trace nextflow_trac...
apache-2.0
Python
6a848cfe12381bc21429555b19646b2558b266d9
Create braces.py
joshhartigan/semicircle,joshhartigan/semicircle,joshhartigan/semicircle,joshhartigan/semicircle,joshhartigan/semicircle,joshhartigan/semicircle,joshhartigan/semicircle,joshhartigan/semicircle,joshhartigan/semicircle,joshhartigan/semicircle,joshhartigan/semicircle
code/braces.py
code/braces.py
#!/usr/bin/python import sys source = open( sys.argv[1], "r" ) output = open( sys.argv[1].replace(".braces", ".py"), "w" ) for line in source.readlines(): newline = "" if line.isspace() and "\n" in line: newline = "\n" if line[ len(line) - 2 ] == ";": newline = line.replace(";", "") ...
bsd-2-clause
Python
5acce49cc54866f8fd5ef0532713c10210de9be6
Add missing module
OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz
tomviz/python/tomviz/state/_utils.py
tomviz/python/tomviz/state/_utils.py
import collections from types import SimpleNamespace def iter_paths(tree, parent_path=()): for path, node in tree.items(): current_path = parent_path + (path,) if isinstance(node, collections.Mapping): for inner_path in iter_paths(node, current_path): yield inner_path ...
bsd-3-clause
Python
dc1f2b100e5d1ec01acc97c0c6df158d8cfd5e43
add missing file
istio/istio,istio/istio,frankbu/istio,geeknoid/istio,geeknoid/istio,geeknoid/istio,mandarjog/istio,sebastienvas/istio,smawson/istio,sebastienvas/istio,geeknoid/istio,smawson/istio,geeknoid/istio,mandarjog/istio,frankbu/istio,mandarjog/istio,frankbu/istio,mandarjog/istio,frankbu/istio,geeknoid/istio,istio/istio,sebastie...
mixer/docker/mixer_docker.bzl
mixer/docker/mixer_docker.bzl
load("@bazel_tools//tools/build_defs/docker:docker.bzl", "docker_build") def mixer_docker_build(images, **kwargs): for image in images: docker_build( name = image['name'], base = image['base'], **kwargs )
apache-2.0
Python
1a306bb83e202f3d73e83110eedaa9a6f86d5983
Create get_cyclone.py
wfclark/hamlet,wfclark/hamlet
hurricane/get_cyclone.py
hurricane/get_cyclone.py
import sys import os import datetime import psycopg2 from subprocess import call, Popen conn_string = "dbname='hamlethurricane' user=postgres port='5432' host='127.0.0.1' password='password'" print "Connecting to database..." try: conn = psycopg2.connect(conn_string) except Exception as e: print str(e) sys.exit()...
bsd-3-clause
Python
6889f008e253187812915ee621a2aac8a641bdcb
Add unit test
r0k3/arctic,einarhuseby/arctic,Frankkkkk/arctic,r0k3/arctic,Frankkkkk/arctic,manahl/arctic,einarhuseby/arctic
tests/unit/store/test_bitemporal_store.py
tests/unit/store/test_bitemporal_store.py
from datetime import datetime as dt from mock import create_autospec from pandas.util.testing import assert_frame_equal from arctic.store.bitemporal_store import BitemporalStore from tests.util import read_str_as_pandas ts1 = read_str_as_pandas(""" sample_dt | near 2012-09-08 17:06...
lgpl-2.1
Python
cfcc85516f0193227a50dfd1042bea0b033d887a
Remove redundant default=None for config options
Gitweijie/first_project,openstack/networking-cisco,CiscoSystems/networking-cisco,hareeshpc/networking-cisco,cisco-openstack/networking-cisco,noironetworks/networking-cisco,Tehsmash/networking-cisco,CiscoSystems/networking-cisco,openstack/networking-cisco,nikolay-fedotov/networking-cisco,noironetworks/networking-cisco,h...
neutron/plugins/ml2/drivers/cisco/nexus/config.py
neutron/plugins/ml2/drivers/cisco/nexus/config.py
# Copyright (c) 2013 OpenStack Foundation # 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 ...
# Copyright (c) 2013 OpenStack Foundation # 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 ...
apache-2.0
Python
b40b4e20b1dc2242a7ce278984603df754a507de
add language_model.py to repo
googleinterns/text-norm-for-low-resource-languages,googleinterns/text-norm-for-low-resource-languages
language_model.py
language_model.py
# Lint as: python3 """Trains an nltk language model.""" import pickle from typing import List, Tuple from nltk.lm.preprocessing import padded_everygram_pipeline from nltk.lm import Laplace from absl import app from absl import flags FLAGS = flags.FLAGS flags.DEFINE_string('string_to_normalize', None, 'the string to ...
apache-2.0
Python
54c16554fdbc969e06133d9a271f37abf1584a9c
add setup.py
sulami/nozdormu
setup.py
setup.py
from setuptools import setup def readme(): with open('readme.md') as f: return f.read() setup(name='nozdormu', version='0.1', description='Python benchmarking for humans and dragons', lon_description=readme(), url='https://github.com/sulami/nozdormu', author='Robin Schroer', ...
mit
Python
ee188d06d6f932967afca836322f1df51a95b4e6
add split script
helldrum/pastebin_dynamic_scraping
split.py
split.py
#!/usr/bin/python # coding: utf8 import re def files(): n = 0 while True: n += 1 yield open('%03d.part' % n, 'w') fs = files() outfile = next(fs) regex="\+{25}http:\/\/pastebin\.com\/raw\/[a-zA-Z0-9]{8}\%\+{21}" with open("python.txt") as infile: for line in infile: if not re.split(regex, line): ou...
mit
Python
9be2e5927487dd1400d635d40f85192371a0d1ba
Verify a model with many parameters works
stan-dev/pystan,stan-dev/pystan
tests/test_eight_schools_large.py
tests/test_eight_schools_large.py
"""Test a "large" version of the schools model. Introduced in response to a macOS bug that only triggered when a larger number of parameters were used. """ import pytest import stan program_code = """ data { int<lower=0> J; // number of schools real y[J]; // estimated treatment effects real<low...
isc
Python
2c2ea18aed78ad1d5fac27062e354d7f19b23d21
add test using TinySegmenter
hideaki-t/sqlite-fts-python
src/tests/test_tinysegmenter.py
src/tests/test_tinysegmenter.py
# coding: utf-8 from __future__ import print_function, unicode_literals import sys import os import sqlite3 import ctypes import struct sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) import sqlitefts.sqlite_tokenizer as fts import pytest ts = pytest.importorskip('tinysegmenter') class TinySegmente...
mit
Python
f80649c105e04c8611b02ef97666829e68a6082c
fix exercise that doesn't print "SUCCESS!"
goodfeli/theano_exercises,IQ17/theano_exercises,juampatronics/theano_exercises,mathrho/theano_exercises,hamukazu/theano_exercises,OlafLee/theano_exercises,xinmei9322/theano_exercises,MarvinBertin/theano_exercises,yt752/theano_exercises,yepengxj/theano_exercises,DeercoderResearch/theano_exercises,voidException/theano_ex...
01_basics/03_advanced_expressions/03_rng.py
01_basics/03_advanced_expressions/03_rng.py
import numpy as np from theano import config from theano import shared raise NotImplementedError("TODO: Add any imports you need.") def bernoulli_samples(p): """ p: A theano tensor with elements in the interval [0, 1] Returns: v: Sampled binary values, with each element of v being 1 with the ...
import numpy as np from theano import config from theano import shared raise NotImplementedError("TODO: Add any imports you need.") def bernoulli_samples(p): """ p: A theano tensor with elements in the interval [0, 1] Returns: v: Sampled binary values, with each element of v being 1 with the ...
bsd-3-clause
Python
f5d9ce7ffef618e00252cd65775aef5c42404f8f
Add an helper to collect all tags
ivoire/DataTag,ivoire/DataTag,ivoire/DataTag
DataTag/management/commands/collecttags.py
DataTag/management/commands/collecttags.py
# -*- coding: utf-8 -*- # vim: set ts= from __future__ import unicode_literals from django.conf import settings from django.core.management.base import BaseCommand import os import yaml class Command(BaseCommand): args = None help = 'Collect the tags from the sub-directories' option_list = BaseCommand....
agpl-3.0
Python
08fd416489e76f8514b100d036d2b48781da0064
Create setup.py
willpatterson/ImageFudge,seansisson/ImageFudge,willpatterson/ImageFudge,seansisson/ImageFudge
setup.py
setup.py
from setuptools import setup, find_packages from setuptools.command.install import install setup(name="ImageFudge", version="0.0.1", description="Image glitching library", license="MIT", author="William Patterson, Konstantin Farrell, Sean Sission", packages=find_packages(), package_...
mit
Python
6c7ad5d09804f8918ccdf4da155854af80b23280
use find_packages() in setup.py
biggihs/python-pptx,AlexMooney/python-pptx,cchanrhiza/python-pptx,kevingu1003/python-pptx,scanny/python-pptx,hoopes/python-pptx
setup.py
setup.py
#!/usr/bin/env python import os import re from setuptools import find_packages, setup # Read the version from pptx.__version__ without importing the package # (and thus attempting to import packages it depends on that may not be # installed yet) thisdir = os.path.dirname(__file__) init_py = os.path.join(thisdir, 'pp...
#!/usr/bin/env python import os import re from setuptools import setup # Read the version from pptx.__version__ without importing the package # (and thus attempting to import packages it depends on that may not be # installed yet) thisdir = os.path.dirname(__file__) init_py = os.path.join(thisdir, 'pptx', '__init__....
mit
Python
eb9e0c16233d5de9aa428b3b0bd818a19393bb48
Update cpuinfo dependency
petewarden/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,aam-at/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,petewarden/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,karllessard/tensorflow,yongtang/tensorflow,annare...
third_party/cpuinfo/workspace.bzl
third_party/cpuinfo/workspace.bzl
"""Loads the cpuinfo library, used by XNNPACK.""" load("//third_party:repo.bzl", "third_party_http_archive") def repo(): third_party_http_archive( name = "cpuinfo", strip_prefix = "cpuinfo-6cecd15784fcb6c5c0aa7311c6248879ce2cb8b2", sha256 = "b1f2ee97e46d8917a66bcb47452fc510d511829556c93b83...
"""Loads the cpuinfo library, used by XNNPACK.""" load("//third_party:repo.bzl", "third_party_http_archive") def repo(): third_party_http_archive( name = "cpuinfo", strip_prefix = "cpuinfo-5cefcd6293e6881754c2c53f99e95b159d2d8aa5", sha256 = "8ea076bcc4ff73cdff520ece01b776d2a778ced60956f5eb...
apache-2.0
Python
cfd4d7a996169cc16d33a6df69472295b47fcfbc
Bump to 0.0.4
nco/pynco,jhamman/pynco
setup.py
setup.py
""" setup.py License: Python Bindings for NCO (NetCDF Operators) Copyright (C) 2015 Joe Hamman 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 2 of the License, o...
""" setup.py License: Python Bindings for NCO (NetCDF Operators) Copyright (C) 2015 Joe Hamman 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 2 of the License, o...
mit
Python
1ce7fa9f79d4aab179cf9fb8e1a91d51a8c22931
add setup.py
crito/django-ldapdb,crito/django-ldapdb,UGentPortaal/django-ldapdb-archived,UGentPortaal/django-ldapdb,chronossc/django-ldapdb
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup setup( name = "django-ldapdb", version = "0.1.0", #license = ldapdb.__license__, url = "http://opensource.bolloretelecom.eu/projects/django-ldapdb/", author = "Jeremy Laine", author_email = "jeremy.laine@bolloretelecom.eu", packages = ...
bsd-3-clause
Python
6c1022ec94926be7803a129f222e71d0e79355c8
Add missing migration
dirtycoder/pets,dirtycoder/pets,dirtycoder/pets
pets/meupet/migrations/0030_auto_20170702_2209.py
pets/meupet/migrations/0030_auto_20170702_2209.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('meupet', '0029_auto_20170624_2123'), ] operations = [ migrations.AlterField( model_name='pet', name=...
mit
Python
61d77ecf5036711ecb6b1cacc2b18735b39ceb36
add setup.py
MrKiven/REST_ARCH,MrKiven/REST_ARCH
setup.py
setup.py
# -*- coding: utf-8 -*- import os import re from setuptools import setup, find_packages def _get_version(): v_file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'rest_arch', '__init__.py') ver_info_str = re.compile(r".*version_info = \((.*?)\)", re.S). \ ...
mit
Python
2b8f6de6c27884a4fb8bf6fd2564359a816162c3
Bump version
rail/funsize,rail/funsize,mozilla/funsize,mozilla/funsize
setup.py
setup.py
from setuptools import setup setup( name="funsize", version="0.52", description="Funsize Scheduler", author="Mozilla Release Engineering", packages=["funsize"], include_package_data=True, # Not zip safe because we have data files in the package zip_safe=False, entry_points={ ...
from setuptools import setup setup( name="funsize", version="0.51", description="Funsize Scheduler", author="Mozilla Release Engineering", packages=["funsize"], include_package_data=True, # Not zip safe because we have data files in the package zip_safe=False, entry_points={ ...
mpl-2.0
Python
70f680d9d79bb2698e4511218d27259a7e3999d8
add setup.py
yandy/sea,yandy/sea,shanbay/sea
setup.py
setup.py
from setuptools import setup, find_packages setup( name='sea', version='0.0.1', description='shanbay rpc framework', url='https://github.com/shanbay/sea', author='Michael Ding', author_email='yandy.ding@gmail.com', license='MIT', classifiers=[ 'Development Status :: 3 - Alpha', ...
mit
Python
ffca491864c8d56829a7d5c8ee9231570a50ae93
Add setup.py
ricklupton/py-bem
setup.py
setup.py
from distutils.core import setup setup( name='bem', version='0.1', packages=['bem'], )
mit
Python
2c4e76d1a778a7045fc2e60b2c69fd5ddde2101a
Add setup.py
robofab-developers/fontParts,robofab-developers/fontParts
setup.py
setup.py
from setuptools import setup setup( name='fontParts', version="0.0.1", author='Just van Rossum, Tal Leming, Erik van Blokland, others', author_email='info@robofab.com', packages=[ 'fontParts', 'fontParts.objects', 'fontParts.objects.abstract', 'fontParts.objects.robo...
mit
Python
477049ee8c29e6c0da60dbdb865bebe5379ca250
Add Python setup script.
calmh/clonehub
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup from commands import getoutput version = getoutput('git describe --always') or '1.0' setup(name='clonehub', version=version, description='GitHub backup script', author='Jakob Borg', author_email='jakob@nym.se', url='https://github.c...
mit
Python
f543565741629cf4ff08e4a1545a4f65d07f75f8
Add setup.py
madchills/hubble,basepi/hubble,madchills/hubble,basepi/hubble
setup.py
setup.py
from setuptools import setup, find_packages setup( name="hubblestack", version="2.0", packages=find_packages(), entry_points={ 'console_scripts': [ 'hubble = hubble.daemon:run', ], }, install_requires=[ 'salt-ssh >= 2016.3.4', ] )
apache-2.0
Python
46bd4e6910c707d7c70c68988e07af1ad8b4f7c8
add setup.py file
danielballan/cycler,matplotlib/cycler,tacaswell/cycler,tacaswell/cycler
setup.py
setup.py
from setuptools import setup setup(name='cycler', version='0.1.0', author='Thomas A Caswell', py_modules=['cycler'], description='Composable style cycles', url='http://github.com/matplotlib/cycler', platforms='Cross platform (Linux, Mac OSX, Windows)', requires=['six'], ...
bsd-3-clause
Python
1801888fd810b3d356f67d1c2a3d0dd28e068565
add setuptools support
narayandesai/diy-lsi
setup.py
setup.py
#!/usr/bin/env python from glob import glob from setuptools import setup setup( name = "diy-lsi", version = "0.1", author = "Narayan Desai", author_email = "narayan.desai+lsi@gmail.com", description = ("Tools for managing lsi disk arrays on illumos"), license = "BSD", keywords = "LSI Illum...
bsd-3-clause
Python
b391a384ae67bcbf445766313d1b50cf24b3049e
Add setup.py for python package
Sanji-IO/sanji,imZack/sanji,lwindg/sanji
setup.py
setup.py
from setuptools import setup setup(name='sanji', version='0.1', description='Sanji SDK', url='https://github.com/Sanji-IO', author='ZackYL Shih', author_email='zackyl.shih@moxa.com', license='MOXA', packages=['sanji'], zip_safe=False)
mit
Python
6f7bd7615ec719676041cba3546bb0e997b21312
bump version
theotherjimmy/yotta,theotherjimmy/yotta,ntoll/yotta,stevenewey/yotta,eyeye/yotta,ARMmbed/yotta,stevenewey/yotta,autopulated/yotta,iriark01/yotta,autopulated/yotta,iriark01/yotta,BlackstoneEngineering/yotta,eyeye/yotta,BlackstoneEngineering/yotta,ARMmbed/yotta,ntoll/yotta
setup.py
setup.py
# Copyright 2014-2015 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. import os from setuptools import setup, find_packages # Utility function to cat in a file (used for the README) def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() ...
# Copyright 2014-2015 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. import os from setuptools import setup, find_packages # Utility function to cat in a file (used for the README) def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() ...
apache-2.0
Python
b604fcf595c12825aa043576bc3d2076f0979510
Bump version to 2.8.0.2
usudaysingh/nereid,riteshshrv/nereid,prakashpp/nereid,prakashpp/nereid,riteshshrv/nereid,fulfilio/nereid,usudaysingh/nereid,fulfilio/nereid
setup.py
setup.py
#This file is part of Tryton & Nereid. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. from setuptools import setup setup( name='Nereid', version='2.8.0.2', url='http://nereid.openlabs.co.in/docs/', license='GPLv3', author='Openlabs Te...
#This file is part of Tryton & Nereid. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. from setuptools import setup setup( name='Nereid', version='2.8.0.1', url='http://nereid.openlabs.co.in/docs/', license='GPLv3', author='Openlabs Te...
bsd-3-clause
Python
e652d658cca2af1e96d0ba90d1722e0cad3f91d3
add setup.py
liberza/python-nexpose
setup.py
setup.py
from setuptools import setup setup( name='python-nexpose', version='0.1', )
apache-2.0
Python
1ae6d7e87640a0fd7f4755ecfd4d66d1075c9797
add style check test.
uwescience/myria-web,uwescience/myria-web,uwescience/myria-web,uwescience/myria-web
appengine/test_style.py
appengine/test_style.py
import subprocess import sys import unittest class StyleTest(unittest.TestCase): "run flake8 with the right arguments and ensure all files pass" def test_style(self): try: execlude = [ 'ply', 'networkx', 'pyparsing.py', 'parse...
bsd-3-clause
Python
202594d044576876d702d9a195a3a446ee2278f5
Create setup.py
mukeshthawani/StockAPI
setup.py
setup.py
from setuptools import setup setup( name= 'StockAPI', version = '0.0.1', description = 'It is script to extract stock data from rediff money', author = 'Mukesh Thawani', author_email = 'mukesh9039@gmail.com', url = 'https://github.com/mukeshthawani/StockAPI', packages = ['StockAPI'], )
mit
Python
774a68ab111410db77d60832e913d897ae7eb4c9
Add python mandelbrot
elijahandrews/hello-mandelbrot,elijahandrews/hello-mandelbrot,elijahandrews/hello-mandelbrot
mandelbrot.py
mandelbrot.py
from PIL import Image N_MAX = 100 IMAGE_HEIGHT = 200 IMAGE_WIDTH = int(IMAGE_HEIGHT * 3.5/2.0) # Maps a pixel co-ordinates to a complex number def pixel_to_complex(x, y): real = 3.5 * x / IMAGE_WIDTH - 2.5 # -2.5 to 1 imaginary = 2.0 * y / IMAGE_HEIGHT - 1.0 # -1 to 1 return complex(real, imaginary) ...
mit
Python
4493b6d42d025ac79f6e89c40ed3b583802a2330
Test Keras DNN for 2048 value
choupi/NDHUDLWorkshop
2048/test_value_2048.py
2048/test_value_2048.py
from __future__ import print_function import numpy as np import math np.random.seed(1337) # for reproducibility from keras.datasets import mnist from keras.models import Sequential, model_from_json from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.layers.convolutional import Convolution2D, ...
mit
Python
e62a6f3db38f754e8a7cf4915ffc1641c8d70137
Add "POST /clubs/:id" tests
RBE-Avionik/skylines,shadowoneau/skylines,skylines-project/skylines,Turbo87/skylines,skylines-project/skylines,skylines-project/skylines,Harry-R/skylines,skylines-project/skylines,Harry-R/skylines,RBE-Avionik/skylines,shadowoneau/skylines,Turbo87/skylines,Turbo87/skylines,Turbo87/skylines,shadowoneau/skylines,RBE-Avion...
tests/api/views/clubs/update_test.py
tests/api/views/clubs/update_test.py
from skylines.model import Club from tests.api import basic_auth from tests.data import add_fixtures, clubs def test_update(db_session, client, test_user): sfn = clubs.sfn() test_user.club = sfn add_fixtures(db_session, sfn) headers = basic_auth(test_user.email_address, test_user.original_password) ...
agpl-3.0
Python
89728efea3983cec293be39eed30b236a94a2330
Add challenges to the admin area
mfitzp/smrtr,mfitzp/smrtr
apps/challenge/admin.py
apps/challenge/admin.py
from django.contrib import admin #Smrtr from challenge.models import * admin.site.register(Challenge)
bsd-3-clause
Python
fab1b6ea07249d7024f37a8f4bbef9d397edc3ec
add house-robber-iii
EdisonAlgorithms/LeetCode,zeyuanxy/leet-code,zeyuanxy/leet-code,EdisonAlgorithms/LeetCode,EdisonAlgorithms/LeetCode,zeyuanxy/leet-code
vol7/house-robber-iii/house-robber-iii.py
vol7/house-robber-iii/house-robber-iii.py
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def rob_recursive(self, root): if root == None: return 0, 0 rob_left, rob_without_left = self...
mit
Python
475441672d8564286f8cc512a3407923750f4e02
Create answers.py
vandorjw/django-assessment,vandorjw/django-assessment
assessment/views/local/answers.py
assessment/views/local/answers.py
# django template view goes here
mit
Python
ab21f0c022b7432ea4646a33d6b241e030f2b8ae
Change the deployed URL we use for the git training mission
mzdaniel/oh-mainline,waseem18/oh-mainline,moijes12/oh-mainline,SnappleCap/oh-mainline,SnappleCap/oh-mainline,Changaco/oh-mainline,ehashman/oh-mainline,openhatch/oh-mainline,openhatch/oh-mainline,ehashman/oh-mainline,willingc/oh-mainline,nirmeshk/oh-mainline,nirmeshk/oh-mainline,moijes12/oh-mainline,eeshangarg/oh-mainli...
mysite/deployment_settings.py
mysite/deployment_settings.py
# This settings file is loaded by ./bin/production, which is # what we use on the main OpenHatch deployment. # # The live site needs some slightly different settings. # # So we start by loading the settings module in the same directory... from settings import * # ...and then we override some values. # But use the lino...
# This settings file is loaded by ./bin/production, which is # what we use on the main OpenHatch deployment. # # The live site needs some slightly different settings. # # So we start by loading the settings module in the same directory... from settings import * # ...and then we override some values. # But use the lino...
agpl-3.0
Python
b4829737407103de558eec996784f5ed672a2ca9
Add laplace_filter tests module
danforthcenter/plantcv,danforthcenter/plantcv,danforthcenter/plantcv
tests/plantcv/test_laplace_filter.py
tests/plantcv/test_laplace_filter.py
import cv2 from plantcv.plantcv import laplace_filter def test_laplace_filter(test_data): # Read in test data img = cv2.imread(test_data.small_gray_img, -1) lp_img = laplace_filter(gray_img=img, ksize=1, scale=1) # Assert that the output image has the dimensions of the input image assert img.shape...
mit
Python
fbd49abfb5a3d32f30de0e85c70f08c873813755
Store HD version of the art images (made with waifux2 by @meiponnyan on Twitter), use it when it exists on the homepage and when using the download link
SchoolIdolTomodachi/CinderellaProducers,SchoolIdolTomodachi/CinderellaProducers
cpro/migrations/0014_auto_20170129_2236.py
cpro/migrations/0014_auto_20170129_2236.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import cpro.models class Migration(migrations.Migration): dependencies = [ ('cpro', '0013_auto_20161025_0249'), ] operations = [ migrations.AddField( model_name='card', ...
apache-2.0
Python
6b397372f42d0f5cd2eba534d48a191d4386edb5
Add merge migration
baylee-d/osf.io,adlius/osf.io,baylee-d/osf.io,icereval/osf.io,CenterForOpenScience/osf.io,Johnetordoff/osf.io,erinspace/osf.io,brianjgeiger/osf.io,felliott/osf.io,erinspace/osf.io,mfraezz/osf.io,CenterForOpenScience/osf.io,icereval/osf.io,HalcyonChimera/osf.io,HalcyonChimera/osf.io,mfraezz/osf.io,felliott/osf.io,adlius...
osf/migrations/0102_merge_20180509_0846.py
osf/migrations/0102_merge_20180509_0846.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-05-09 13:46 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('osf', '0099_add_default_storage_region'), ('osf', '0099_file_version_user_metadata'), ...
apache-2.0
Python
d1e1e682122a66e76c70052a5fec3e6d9a00ab46
Convert infomap logs to JSON
jevinw/rec_utilities,jevinw/rec_utilities
babel_util/scripts/log_to_json.py
babel_util/scripts/log_to_json.py
import json from parsers.infomap_log import InfomapLog if __name__ == "__main__": import argparse parser = argparse.ArgumentParser(description="Creates JSON file from Infomap Logs") parser.add_argument('outfile') parser.add_argument('infiles', nargs='+') args = parser.parse_args() logs = [] ...
agpl-3.0
Python
22c96540eb5cbf33d9ea868458769031dc57102a
Support library for managing log files
holzman/glideinwms-old,holzman/glideinwms-old,holzman/glideinwms-old,bbockelm/glideinWMS,bbockelm/glideinWMS,bbockelm/glideinWMS,bbockelm/glideinWMS
lib/logSupport.py
lib/logSupport.py
# # Description: log support module # # Author: # Igor Sfiligoi (Oct 25th 2006) # import time # this class can be used instead of a file for writing class DayLogFile: def __init__(self,base_fname): self.base_fname=base_fname return def close(self): return # nothing to do, just a place...
bsd-3-clause
Python
70fa6d750fbbdae405b0012b9aa53f066008ba5f
Fix decode error of README.rst during installation
ivankravets/tinydb,Callwoola/tinydb,raquel-ucl/tinydb,cagnosolutions/tinydb,msiemens/tinydb
setup.py
setup.py
# coding=utf-8 from setuptools import setup, find_packages from codecs import open setup( name="tinydb", version="2.1.0", packages=find_packages(), # development metadata zip_safe=True, # metadata for upload to PyPI author="Markus Siemens", author_email="markus@m-siemens.de", desc...
# coding=utf-8 from setuptools import setup, find_packages setup( name="tinydb", version="2.1.0", packages=find_packages(), # development metadata zip_safe=True, # metadata for upload to PyPI author="Markus Siemens", author_email="markus@m-siemens.de", description="TinyDB is a tin...
mit
Python
ca768b7af5d8a86feec864529b780be630f91ab8
Add setup.py
concordusapps/python-scim
setup.py
setup.py
#! /usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name='scim', version='0.2.0', description='A python interface to produce and consume System for Cross-domain Identity Management (SCIM) messages.', author='Concordus Applications', author_email='suppor...
mit
Python
7a62838c200f77131b188dc1ef3916c377503f8b
add setup
areski/sms-khomp-api,areski/sms-khomp-api
setup.py
setup.py
# # CDR-Stats License # http://www.cdr-stats.org # # 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/. # # Copyright (C) 2011-2012 Star2Billing S.L. # # The Initial Develo...
mpl-2.0
Python
c620c19c6ad8e22d9331931b656f8ee6a65d8016
test that SQL(..., 'db.tablename') works
maxalbert/blaze,mrocklin/blaze,LiaoPan/blaze,jcrist/blaze,nkhuyu/blaze,xlhtc007/blaze,jdmcbr/blaze,ChinaQuants/blaze,jdmcbr/blaze,xlhtc007/blaze,mrocklin/blaze,nkhuyu/blaze,jcrist/blaze,scls19fr/blaze,caseyclements/blaze,dwillmer/blaze,cpcloud/blaze,alexmojaki/blaze,caseyclements/blaze,scls19fr/blaze,ContinuumIO/blaze,...
blaze/data/tests/test_postgres.py
blaze/data/tests/test_postgres.py
from __future__ import absolute_import, division, print_function """ import pytest psycopg2 = pytest.importorskip('psycopg2') import subprocess ps = subprocess.Popen("ps aux | grep postgres",shell=True, stdout=subprocess.PIPE) output = ps.stdout.read() num_processes = len(output.splitlines()) pytestmark = pytest.mark...
from __future__ import absolute_import, division, print_function """ import pytest psycopg2 = pytest.importorskip('psycopg2') import subprocess ps = subprocess.Popen("ps aux | grep postgres",shell=True, stdout=subprocess.PIPE) output = ps.stdout.read() num_processes = len(output.splitlines()) pytestmark = pytest.mark...
bsd-3-clause
Python
f090af29fd8780cced8c4054f3745080448625dd
add setup.py for deployment tracker (#75)
IBM/watson-online-store,IBM/watson-online-store,IBM/watson-online-store
setup.py
setup.py
# Always prefer setuptools over distutils from setuptools import setup long_description = ('Code for Cognitive Developer Journey that uses Watson ' 'Conversation and Watson Discovery. This application ' 'demonstrates a simple abstraction of a chatbot ' 'inter...
apache-2.0
Python
ed3f8aaad6b4bc2990b61d8278b64d3e9ccc47f0
Add setup.py.
racker/python-dcs
setup.py
setup.py
# Copyright 2012 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
apache-2.0
Python
8c2aa6409358b4b5830e9a6242194030307f2aa6
Add a helper script for creating migrations
pinax/django-stripe-payments
makemigrations.py
makemigrations.py
#!/usr/bin/env python import decimal import os import sys import django from django.conf import settings DEFAULT_SETTINGS = dict( DEBUG=True, USE_TZ=True, TIME_ZONE='UTC', DATABASES={ "default": { "ENGINE": "django.db.backends.sqlite3", } }, MIDDLEWARE_CLASSES=[ ...
mit
Python
31252609752cf479d5e1ac8583704e967245a9d5
Create setup.py
gnazareths/synth
setup.py
setup.py
from distutils.core import setup setup( name = 'mypackage', packages = ['mypackage'], description = 'A random test lib', author = 'Guilherme Nazareth de Souza', author_email = 'guilherme@minerva.kgi.edu', url = 'https://github.com/gnazareths/synth', download_url = 'https://github.com/gnazareths/synth/tarb...
mit
Python
01505ba4ebb11050ccdbd69c4b86b973ea2b657e
Create metricsCollect.py
benhastings/SeGrid_EC2,benhastings/SeGrid_EC2,benhastings/SeGrid_EC2
metricsCollect.py
metricsCollect.py
def metricsCollect(dtitl,d,base): if (d.current_url.find('sciencedirect') > -1 OR d.current_url.find('scopus') > -1): l='' # print(dtitl+' - trying metricsCollect') try: # print('try some script execute') navS = d.execute_script("return performance.timing.navigationStart") # print('navS: '+str(navS)+' ...
bsd-3-clause
Python
46ad0524ee026ad4d28641f15b02fd31ac514cd6
add short.py
Jake0720/XChat-Scripts
short.py
short.py
__module_name__ = 'Short' __module_version__ = '1.0' __module_description__ = 'Auto link shortener with http://links.ml' __module_author__ = 'Liam Stanley' import xchat import urllib, re c = '\x0304' help = ("/short <url|enable|disable>\n" " - url: url/link that you would like to be shortened. E.g, http://lia...
mit
Python
00f5a5cfd2cb412948527d88b1d201f9f738bf41
add script for importing NI District Electoral Areas
DemocracyClub/EveryElection,DemocracyClub/EveryElection,DemocracyClub/EveryElection
every_election/apps/organisations/management/commands/ni_import_district_electoral_areas.py
every_election/apps/organisations/management/commands/ni_import_district_electoral_areas.py
import datetime from django.core.management.base import BaseCommand from django.db import transaction from django.utils.text import slugify from organisations.models import ( Organisation, OrganisationDivision, OrganisationDivisionSet ) from core.mixins import ReadFromCSVMixin class Command(ReadFromCSV...
bsd-3-clause
Python
702f5f9f04a36d04dd4206301de2384661445f5f
Create __init__.py
meerkat-code/meerkat_libs
meerkat_libs/__init__.py
meerkat_libs/__init__.py
mit
Python
bbec82828f1972e226c51344b5ae967aa484436a
Add Render wrapper
toslunar/chainerrl,toslunar/chainerrl
chainerrl/wrappers/render.py
chainerrl/wrappers/render.py
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() # NOQA import gym class Render(gym.Wrapper): """Render env by...
mit
Python
7a3a002b51fd50883c5b373212fc450189511f67
add solution for Course Schedule
zhyu/leetcode,zhyu/leetcode
algorithms/courseSchedule/courseSchedule.py
algorithms/courseSchedule/courseSchedule.py
class Solution: # @param {integer} numCourses # @param {integer[][]} prerequisites # @return {boolean} def canFinish(self, numCourses, prerequisites): g = {v: [] for v in xrange(numCourses)} deg = {v: 0 for v in xrange(numCourses)} s = set(range(numCourses)) for u, v in ...
mit
Python
dd3a05592700e7c6970d7ae9274e974a07371425
Add basic vector operations
robinjia/nectar,robinjia/nectar
nectar/base/vecops.py
nectar/base/vecops.py
"""Operations on sparse vectors represented as defaultdicts.""" import collections # Mutating a vector def add(v, other, scale=1): for k in other: v[k] += scale * other[k] def scale(v, scale): for k in v.keys(): v[k] *= scale # Returning a new vector or scalar def dot(v1, v2): if len(v1) > len(v2): ...
mit
Python
3dce48f228caec9b317f263af3c5e7a71372f0be
Test that we can get the application form
hacklab-fi/asylum,HelsinkiHacklab/asylum,rambo/asylum,jautero/asylum,hacklab-fi/asylum,HelsinkiHacklab/asylum,hacklab-fi/asylum,rambo/asylum,rambo/asylum,rambo/asylum,HelsinkiHacklab/asylum,jautero/asylum,hacklab-fi/asylum,jautero/asylum,jautero/asylum,HelsinkiHacklab/asylum
project/members/tests/test_application.py
project/members/tests/test_application.py
# -*- coding: utf-8 -*- import pytest from django.core.urlresolvers import reverse from members.tests.fixtures.memberlikes import MembershipApplicationFactory from members.tests.fixtures.types import MemberTypeFactory from members.models import Member @pytest.mark.django_db def test_application_approve(): mtypes =...
# -*- coding: utf-8 -*- import pytest from members.tests.fixtures.memberlikes import MembershipApplicationFactory from members.tests.fixtures.types import MemberTypeFactory from members.models import Member @pytest.mark.django_db def test_application_approve(): mtypes = [MemberTypeFactory(label='Normal member')] ...
mit
Python
a094b0978034869a32be1c541a4d396843819cfe
Add management command to generate a random secret key
Angoreher/xcero,Angoreher/xcero,Angoreher/xcero,magnet-cl/django-project-template-py3,magnet-cl/django-project-template-py3,Angoreher/xcero,magnet-cl/django-project-template-py3,magnet-cl/django-project-template-py3
project/management/commands/generatesecretkey.py
project/management/commands/generatesecretkey.py
from django.core.management.templates import BaseCommand from django.utils.crypto import get_random_string import fileinput from django.conf import settings class Command(BaseCommand): help = ("Replaces the SECRET_KEY VALUE in settings.py with a new one.") def handle(self, *args, **options): # Crea...
mit
Python
78aac9f937c1a89287e5414f8e0b93e42f81da8d
Add basic search tests
jakesen/pyhatchbuck
tests.py
tests.py
import os import unittest from hatchbuck import HatchbuckAPI class TestStuff(unittest.TestCase): def setUp(self): self.test_api_key = os.environ.get("HATCHBUCK_API_KEY") def test_search_by_email_with_results(self): hatchbuck = HatchbuckAPI(self.test_api_key) contacts, found = hatchbu...
mit
Python
90e35027f3ee6df058193ac799fc52741f8dbb87
create new branch for vlan trunk attack
nottinghamprisateam/pyersinia
pyersinia_lib/libs/plugins/vlan_hooping_trunk.py
pyersinia_lib/libs/plugins/vlan_hooping_trunk.py
# -*- coding: utf-8 -*- import logging logging.getLogger("scapy.runtime").setLevel(logging.WARNING) from scapy.all import * from scapy.layers.l2 import * from scapy.layers.l2 import LLC, STP, Dot3,SNAP from scapy.all import sendp,sniff,get_if_hwaddr # ----------------------------------------------------------------...
bsd-3-clause
Python
7941202bf8c7f3c553e768405b72b0b5b499dee6
Change output format to csv
otknoy/ExTAT,otknoy/ExTAT
tfidf.py
tfidf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import nlp.tokenizer import nlp.TextVectorizer import sys data = [] filenames = sys.argv[1:] for filename in filenames: t = open(filename).read().decode('utf-8') data.append(t) data = "\n".join(data) print 'word,count' v = nlp.TextVectorizer.TfVectorizer(tokeniz...
mit
Python
d58dc0ad9d77e97ac9088900544a432652f7334f
Add a snippet.
jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets
python/tkinter/python3/radiobutton_factorized.py
python/tkinter/python3/radiobutton_factorized.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2016 Jérémie DECOCK (http://www.jdhp.org) # 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 witho...
mit
Python
6d10f3a2ae564617503d2b07fb5cb1372cbf9c86
Create utils.py
nrikee/Compresion-indices
utils.py
utils.py
# coding=utf-8 # Funciones def unario(n): """ Pasa el número dado a unario, con un 0 al final :rtype : str :param n: Un número :return: El número dado en unario """ return '1' * (n - 1) + '0' def binario(n): """ Pasa el número dado a binario :rtype : str :param n: Un núm...
mit
Python
746be24a31ddc747dd7f1026a9828a1077575750
Add dev_tools/profiling/live_plot_collector.py (#1879)
quantumlib/Cirq,quantumlib/Cirq,quantumlib/Cirq,balopat/Cirq,quantumlib/Cirq,quantumlib/Cirq,balopat/Cirq,balopat/Cirq
dev_tools/profiling/live_plot_collector.py
dev_tools/profiling/live_plot_collector.py
from typing import List, Mapping, Sequence import collections import time import numpy as np import matplotlib.pyplot as plt import sympy import cirq class LivePlotCollector(cirq.Collector): """Performs concurrent collection of a parameter sweep over a circuit. Purposefully breaks down the sweep into indi...
apache-2.0
Python
067fa81cf56b7f8ab29060ec8a1409c0c07c797e
Add job sequencing greedy Python
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...
greedy/Job_sequencing_problem/python/jobsequencing.py
greedy/Job_sequencing_problem/python/jobsequencing.py
class Job: def __init__(self, name, deadline, duration, profit): self.name = name self.deadline = deadline self.duration = duration self.profit = profit def __lt__(self, other): return self.profit < other.profit def __str__(self): return self.name # Greedy ...
cc0-1.0
Python
a8c01c7309c8b364c8ca5229023552cb17a1005a
Add clothing renamer script to all.
jd28/pynwn-tools,jd28/pynwn-tools
misc/clothing_renamer.py
misc/clothing_renamer.py
#!/usr/bin/env python part_to_2da = { 'neck': 'parts_neck.2da', 'chest': 'parts_chest.2da', 'belt': 'parts_belt.2da', 'pelvis': 'parts_pelvis.2da', 'shor': 'parts_shoulder.2da', 'shol': 'parts_shoulder.2da', 'bicepr': 'parts_bicep.2da', 'bicepl': 'parts_bicep.2da', 'forer': 'parts_f...
mit
Python
e03c97c33f46342f702693e4691f943187af526a
Add simulation class.
fangohr/oommf-python,ryanpepper/oommf-python,ryanpepper/oommf-python,fangohr/oommf-python,fangohr/oommf-python,ryanpepper/oommf-python,ryanpepper/oommf-python
pyoommf/sim.py
pyoommf/sim.py
class Sim(object): def __init__(mesh, Ms): self.mesh = mesh self.Ms = Ms self.energies = [] def add_exchange(self, A): self.energies.append(('Exchange', A)) def add_demag(self): self.energies.append(('Demag', None)) def add_zeeman(self, H): self.energie...
bsd-2-clause
Python
888bba9d9ce6a2bfde484056516c5a5ee99a0cff
add a new task for taking guiding requests from human
Musi13/bwi_experimental,pato/bwi_experimental,utexas-bwi/bwi_experimental,Musi13/bwi_experimental,pato/bwi_experimental,utexas-bwi/bwi_experimental,utexas-bwi/bwi_experimental,utexas-bwi/bwi_experimental,Musi13/bwi_experimental,Musi13/bwi_experimental,utexas-bwi/bwi_experimental,Musi13/bwi_experimental,pato/bwi_experim...
bwi_tasks/src/take_human_input.py
bwi_tasks/src/take_human_input.py
#!/usr/bin/python import rospy from bwi_kr_execution.srv import * import roslib; roslib.load_manifest('bwi_kr_execution') import actionlib import bwi_kr_execution.srv import segbot_gui.srv from multiprocessing import Process, Lock human_waiting = False next_room = None mutex = Lock() # option # 1: click me if y...
bsd-3-clause
Python
5b9df437e03c550f35e6e70de9499ac8baf4a220
add sin_test program
petevieira/reactor_arm
nodes/sin_test.py
nodes/sin_test.py
#!/usr/bin/env python import roslib import rospy # for writing a ROS node import sys from dynamixel_msgs.msg import JointState from std_msgs.msg import Float64 import math # def state_callback(motor): # print motor.current_pos def commander(): pub = rospy.Publisher('/jnt_controller/command', Float64) rospy.init_...
bsd-2-clause
Python
d1744d92c0f6c7625e84210a310863d1506ba532
add rocklyrics.py to old/ (from MP3 scripts)
raehik/scripts,raehik/scripts
old/rocklyrics.py
old/rocklyrics.py
#!/usr/bin/env python # # Prepend each line in a file with a fixed string. # import fileinput import sys for lyrics in sys.argv[1:]: for line in fileinput.input([lyrics], inplace=True): sys.stdout.write('[00:00:00] {l}'.format(l=line))
mit
Python
c9ba631e1a43bb33ecfafa8a251343c7c7a2f2a4
Create mpu9150.py
micropython-IMU/micropython-mpu9150
mpu9150.py
mpu9150.py
#
mit
Python
1f28ecd27668c02ac08011a97fe319384afcaf9e
Read information about swarm node from swarm manager (#50571)
thaim/ansible,thaim/ansible
lib/ansible/modules/cloud/docker/docker_node_facts.py
lib/ansible/modules/cloud/docker/docker_node_facts.py
#!/usr/bin/python # # (c) 2019 Piotr Wojciechowski <piotr@it-playground.pl> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
mit
Python
9c1fe83fe4581fddc58ebc468a1bc11e5a621d14
support django views
waenwj/qrcode-wand-image
views.py
views.py
from django.http import HttpResponse import qrcode from imagemagick import WandImage from django.utils.http import urlunquote def generate_qrcode(request, data): if not data: data = 'http://www.epub360.com' data = urlunquote(data) qr = qrcode.QRCode( version=1, error_correction=q...
apache-2.0
Python
f4b5dafbb9a1a9af00b8981dbb442fa8f8385203
Revert "Revert "add migration for new fields""
datamade/pupa,mileswwatkins/pupa,opencivicdata/pupa,datamade/pupa,mileswwatkins/pupa,opencivicdata/pupa
pupa/migrations/0002_auto_20150906_1458.py
pupa/migrations/0002_auto_20150906_1458.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.dev20150906080247 on 2015-09-06 14:58 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('pupa', '0001_initial'), ] operation...
bsd-3-clause
Python
2edc00ac4e8657f37d94ae5a7a4d5426acba66a6
add example
ufabdyop/screenlock,ufabdyop/screenlock,ufabdyop/screenlock
source/exampleFlask.py
source/exampleFlask.py
from functools import wraps from flask import request, Response, Flask app = Flask(__name__) def check_auth(username, password): """This function is called to check if a username / password combination is valid. """ return username == 'admin' and password == 'secret' def authenticate(): """Sends a...
mit
Python
587011702ffca5d02263736dcae04f31ce8c38d4
Add tests for output type crud routes
cgwire/zou
test/models/test_output_type.py
test/models/test_output_type.py
from test.base import ApiDBTestCase from zou.app.models.output_type import OutputType from zou.app.utils import fields class OutputTypeTestCase(ApiDBTestCase): def setUp(self): super(OutputTypeTestCase, self).setUp() self.generate_data(OutputType, 3) def test_get_output_types(self): ...
agpl-3.0
Python
53ff167ecf9f85b807d7c9a75a1f4ba2295761c1
add pulse + "start a break" button
dustynine/bloodshoteyes
bse.py
bse.py
#!/usr/bin/env python import sys import getopt import time import gi gi.require_version('Gtk','3.0') from gi.repository import Gtk, GObject # input check (shitty) if len(sys.argv) == 1: print("bse.py -w <mins to work> -r <mins to rest>") sys.exit(1) try: opts, args = getopt.getopt(sys.argv[1:],"w:r:", \ ...
mit
Python
ec1bec3198990a0ea08ea010d59e7ae8a1e2e17b
add file test_dsi_metrics.py
beni55/dipy,matthieudumont/dipy,beni55/dipy,nilgoyyou/dipy,rfdougherty/dipy,matthieudumont/dipy,FrancoisRheaultUS/dipy,villalonreina/dipy,sinkpoint/dipy,demianw/dipy,mdesco/dipy,StongeEtienne/dipy,oesteban/dipy,nilgoyyou/dipy,Messaoud-Boudjada/dipy,demianw/dipy,villalonreina/dipy,FrancoisRheaultUS/dipy,oesteban/dipy,Jo...
dipy/reconst/tests/test_dsi_metrics.py
dipy/reconst/tests/test_dsi_metrics.py
import nibabel as nib import numpy as np import matplotlib.pyplot as plt from dipy.data import fetch_taiwan_ntu_dsi, read_taiwan_ntu_dsi, get_sphere from dipy.align.aniso2iso import resample from dipy.viz import fvtk from dipy.core.ndindex import ndindex from dipy.data import get_sphere import dipy.reconst.dti as dti f...
bsd-3-clause
Python
530e6917c9ec42a48d50e37fc605ee0f8dd39d81
Create w3_1.pyp
s40523229/2016fallcp_hw,s40523229/2016fallcp_hw,s40523229/2016fallcp_hw
w3_1.pyp
w3_1.pyp
print("test")
agpl-3.0
Python
d5045de6054d40c6b91b7e40971a897731286435
Create oregano.py
TheIoTLearningInitiative/CodeLabs,TheIoTLearningInitiative/CodeLabs,TheIoTLearningInitiative/CodeLabs,TheIoTLearningInitiative/CodeLabs,TheIoTLearningInitiative/CodeLabs,TheIoTLearningInitiative/CodeLabs
Food/CochinitaPibil/Device/oregano.py
Food/CochinitaPibil/Device/oregano.py
#!/usr/bin/python import paho.mqtt.client as paho import signal import sys import time from threading import Thread from upm import pyupm_grove as grove from upm import pyupm_biss0001 as grovemotion luxes = grove.GroveLight(0) motion = grovemotion.BISS0001(6) opening = grove.GroveButton(4) switch = grove.GroveRelay(...
apache-2.0
Python
4970685b1dd24286135e333ff800015e1bd5a4b3
build up functionality in couch_patent file as unittests
funginstitute/patentprocessor,yngcan/patentprocessor,nikken1/patentprocessor,funginstitute/patentprocessor,funginstitute/patentprocessor,nikken1/patentprocessor,yngcan/patentprocessor,nikken1/patentprocessor,yngcan/patentprocessor
couch_patent/couch_patent.py
couch_patent/couch_patent.py
#!/usr/bin/env python import sys import couchdb import unittest sys.path.append('../lib') from patXML import * class TestCouchPatent(unittest.TestCase): def setUp(self): self.couch = couchdb.Server() self.db = None if not 'patents' in self.couch: self.db = self.couch['patents...
bsd-2-clause
Python
4aef9a5bca4927db0ff7b661850de1c8d3c61274
Add utility for formatting fasta files for seqseek
23andMe/seqseek
seqseek/format_fasta.py
seqseek/format_fasta.py
import argparse def run(path): print "Formatting %s" % path with open(path) as fasta: header = '' first_line = fasta.readline() if not first_line.startswith('>'): header = '> ' + path.split('/')[-1].split('.')[0] + '\n' first_line.replace('\n', '') clean...
mit
Python
531d1c868b36580a8423d71c3ee324c8669ab98b
Add function to convert between number bases.
ComSciCtr/pycelle
pycelle/misc.py
pycelle/misc.py
from __future__ import division from math import ceil, log __all__ = [ 'base_expansion', ] def base_expansion(n, to_base, from_base=10, zfill=None): """ Converts the number `n` from base `from_base` to base `to_base`. Parameters ---------- n : list | int The number to convert. If an ...
bsd-3-clause
Python
a20cf36261958c2f33b9abc8faff9c89bfd4141d
create utils library
jhogsett/linkit,jhogsett/linkit,jhogsett/linkit,jhogsett/linkit,jhogsett/linkit,jhogsett/linkit
python/utils.py
python/utils.py
import os def load_file(filename, default_ext=".???"): file_lines = [] # add presumed extension if not filename.endswith(default_ext): filename = filename + default_ext # save a path to the file for use later # file_path = os.path.dirname(filename) # this would be helpful if proces...
mit
Python
2563f1afa5598c6cb4a142fb159bab815a232e3d
Create emer_response.py
codefordc/ERDA
emer_response.py
emer_response.py
# Assignment - Rank hospitals in all states rankall <- function(outcome, num = "best") { ## Read outcome data source("rankhospital.R") data <- read.csv("ProgAssignment3-data/outcome-of-care-measures.csv", colClasses = "character") results <- character() ## Check that outcome is valid possible_states <- as.vec...
bsd-3-clause
Python
23f598bda0898b3db13617cc08f20fd9d7ee82c2
Add columnize helper to assist in formatting plain-text e-mails
MasonM/hssonline-conference,MasonM/hssonline-conference,MasonM/hssonline-conference
django_conference/templatetags/columnize.py
django_conference/templatetags/columnize.py
from django.template.defaultfilters import stringfilter from django import template import textwrap register = template.Library() @register.filter @stringfilter def columnize(textblock, width): """ Simple helper to take in a plain-text definition list delimited by colons and add formats it nicely. E...
bsd-3-clause
Python
cd94d9239293aa1884d5a040156b9df468a3d41f
Add OvfProperty.py
Awingu/open-ovf,Awingu/open-ovf,Awingu/open-ovf,Awingu/open-ovf
py/ovf/OvfProperty.py
py/ovf/OvfProperty.py
# vi: ts=4 expandtab syntax=python ############################################################################## # Copyright (c) 2008 IBM Corporation # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distr...
epl-1.0
Python
c32d778b76c95c1eb637f20d0a81f7e87beb992b
add test-wait.py
sikuli/sikuli,bx5974/sikuli,sikuli/sikuli,bx5974/sikuli,sikuli/sikuli,bx5974/sikuli,bx5974/sikuli,sikuli/sikuli,sikuli/sikuli,sikuli/sikuli,bx5974/sikuli,bx5974/sikuli,bx5974/sikuli,sikuli/sikuli
sikuli-script/src/test/python/test-wait.py
sikuli-script/src/test/python/test-wait.py
from __future__ import with_statement from sikuli.Sikuli import * with Region(10, 0, 200,200) as r: p = Pattern("test-res/apple.png").targetOffset(30,5) m = r.wait(p) print "center: " + str(r.lastMatch.getCenter()) print "target(+30,+5): " + str(r.lastMatch.getTarget()) click(m) apple= Pattern("test-...
mit
Python
628c092b2fd8b53e116e04b240f04b7508ab6118
Add wx implementation of the ArrayViewEditor.
geggo/pyface,brett-patterson/pyface,geggo/pyface,pankajp/pyface
enthought/traits/ui/wx/array_view_editor.py
enthought/traits/ui/wx/array_view_editor.py
#------------------------------------------------------------------------------- # Imports: #------------------------------------------------------------------------------- from enthought.traits.ui.ui_editors.array_view_editor \ import _ArrayViewEditor as BaseArrayViewEditor from ui_editor \ import UIEditor ...
bsd-3-clause
Python