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
9349adb2efa5f0242cf9250d74d714a7e6aea1e9
Make version compatible with PEP386
xguse/scikit-bio,wdwvt1/scikit-bio,johnchase/scikit-bio,xguse/scikit-bio,colinbrislawn/scikit-bio,Achuth17/scikit-bio,Achuth17/scikit-bio,jdrudolph/scikit-bio,Kleptobismol/scikit-bio,jensreeder/scikit-bio,Jorge-C/bipy,jairideout/scikit-bio,kdmurray91/scikit-bio,averagehat/scikit-bio,wdwvt1/scikit-bio,Kleptobismol/sciki...
ordination/__init__.py
ordination/__init__.py
from .base import CA, RDA, CCA __all__ = ['CA', 'RDA', 'CCA'] # #from numpy.testing import Tester #test = Tester().test # Compatible with PEP386 __version__ = '0.1.dev'
from .base import CA, RDA, CCA __all__ = ['CA', 'RDA', 'CCA'] # #from numpy.testing import Tester #test = Tester().test __version__ = '0.1-dev'
bsd-3-clause
Python
df77b24a730190342b2f6384bcaf052532c82632
Add files via upload
Croutonix/dmtcheat,Croutonix/dmtcheat,Croutonix/dmtcheat
find_min_max.py
find_min_max.py
path = "wordlist.txt" maxWordCount = 3 file = open(path, "r") words = file.read().replace("\n", "").split(",") file.close() maxlen = [] minlen = [] for i in range(maxWordCount): maxlen.append([]) minlen.append([]) for j in range(i+1): maxlen[i].append(0) minlen[i].append(100)...
mit
Python
c0d9c0aa93a5e32e04eaba3bfc8d4cf30a88395d
add configuration class
tkosciol/micronota,biocore/micronota,tkosciol/micronota,RNAer/micronota,biocore/micronota,mortonjt/micronota,mortonjt/micronota,RNAer/micronota
micronota/config.py
micronota/config.py
# ---------------------------------------------------------------------------- # Copyright (c) 2015--, micronota development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # ---------------------------------------------...
bsd-3-clause
Python
cb210e39fc6dc9bc3654dad0a70f29bc206688b4
Create feedback.py
WebShark025/TheZigZagProject,WebShark025/TheZigZagProject
plugins/feedback.py
plugins/feedback.py
@bot.message_handler(commands=['feedback', 'sendfeedback']) def send_feedbackz(message): userid = message.from_user.id banlist = redisserver.sismember('zigzag_banlist', '{}'.format(userid)) if banlist: return if userid not in messanger_list: bot.reply_to(message, MESSANGER_JOIN_MSG, parse_mode="Markdown...
mit
Python
c5e047ff0e1cfe35692838365b907db8c3746c4b
Add join_segmentations example to the gallery
Midafi/scikit-image,rjeli/scikit-image,youprofit/scikit-image,GaZ3ll3/scikit-image,keflavich/scikit-image,michaelaye/scikit-image,chintak/scikit-image,rjeli/scikit-image,youprofit/scikit-image,vighneshbirodkar/scikit-image,newville/scikit-image,almarklein/scikit-image,ClinicalGraphics/scikit-image,Britefury/scikit-imag...
doc/examples/plot_join_segmentations.py
doc/examples/plot_join_segmentations.py
""" ========================================== Find the intersection of two segmentations ========================================== When segmenting an image, you may want to combine multiple alternative segmentations. The `skimage.segmentation.join_segmentations` function computes the join of two segmentations, in wh...
bsd-3-clause
Python
c231a440cd0b79a2e64fc050849ce3bc8e9b6f98
Annotate zerver/templatetags/minified_js.py.
jrowan/zulip,showell/zulip,eeshangarg/zulip,hackerkid/zulip,showell/zulip,SmartPeople/zulip,isht3/zulip,verma-varsha/zulip,Galexrt/zulip,timabbott/zulip,sup95/zulip,umkay/zulip,reyha/zulip,aakash-cr7/zulip,KingxBanana/zulip,sonali0901/zulip,vikas-parashar/zulip,dattatreya303/zulip,TigorC/zulip,dhcrzf/zulip,krtkmj/zulip...
zerver/templatetags/minified_js.py
zerver/templatetags/minified_js.py
from __future__ import absolute_import from typing import Any from django.template import Node, Library, TemplateSyntaxError from django.conf import settings from django.contrib.staticfiles.storage import staticfiles_storage if False: # no need to add dependency from django.template.base import Parser, Token ...
from __future__ import absolute_import from django.template import Node, Library, TemplateSyntaxError from django.conf import settings from django.contrib.staticfiles.storage import staticfiles_storage register = Library() class MinifiedJSNode(Node): def __init__(self, sourcefile): self.sourcefile = sour...
apache-2.0
Python
6536a5893e44a40a776fe98c97ed0326299cc27b
Create 03.py
Pouf/CodingCompetition,Pouf/CodingCompetition
Euler/03.py
Euler/03.py
def prime_sieve(limit): is_prime = [False] * (limit + 1) for x in range(1,int(limit**.5)+1): for y in range(1,int(limit**.5)+1): n = 4*x**2 + y**2 if n<=limit and (n%12==1 or n%12==5): # print "1st if" is_prime[n] = not is_prime[n] n = ...
mit
Python
ebb3af21130c817eb41ecc0b79ec0dab2f5f64bf
Implement pull_request event
brantje/telegram-github-bot,brantje/captain_hook,brantje/captain_hook,brantje/telegram-github-bot,brantje/captain_hook,brantje/telegram-github-bot
captain_hook/services/github/events/pull_request.py
captain_hook/services/github/events/pull_request.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from ...base.events import BaseEvent class PullRequestEvent(BaseEvent): def process(self): pr_link = str(self.body['pull_request']['url']).replace('https://api.github.com/', '') params = { 'username': self.body['pull_requ...
apache-2.0
Python
b8db983c3b901ea45fabbfd87a1e92ae3722e8fe
Initialize 04.sameName
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
books/AutomateTheBoringStuffWithPython/Chapter03/04.sameName.py
books/AutomateTheBoringStuffWithPython/Chapter03/04.sameName.py
# This program uses the same variable name throughout def spam(): eggs = 'spam local' print(eggs) # prints 'spam local' def bacon(): eggs = 'bacon local' print(eggs) # prints 'bacon local' spam() print(eggs) # prints 'bacon local' eggs = 'global' bacon() print(eggs) # prints 'global'
mit
Python
2b146388d1804ca4cb069fa07ea5e614a8ee1d14
Add example of sending push notification via Firebase Cloud Messaging
sth-larp/deus-mobile,sth-larp/deus-mobile,sth-larp/deus-mobile,sth-larp/deus-mobile,sth-larp/deus-mobile
tools/send_to_fcm.py
tools/send_to_fcm.py
import requests url = 'https://fcm.googleapis.com/fcm/send' headers = {'Content-Type': 'application/json', 'Authorization': 'key=AIza...(copy code here)...'} payload = """ { "to": "/topics/all", "notification": { "title": "Hello world", "body": "You are beautiful" } } """ resp = requests.po...
apache-2.0
Python
42ee5971dfd7309e707213d18c2041128a79e901
add test for overwrite grads
diogo149/treeano,diogo149/treeano,diogo149/treeano
treeano/sandbox/tests/utils_test.py
treeano/sandbox/tests/utils_test.py
import nose.tools as nt import numpy as np import theano import theano.tensor as T import treeano import treeano.nodes as tn from treeano.sandbox import utils fX = theano.config.floatX def test_overwrite_grad_multiple_args(): class Foo(utils.OverwriteGrad): def __init__(self): def fn(a, b):...
apache-2.0
Python
6557b2fc86c340968755274bbd97262b79dd1115
Add blank __init__ to make NEURON a package
ProjectPyRhO/PyRhO,ProjectPyRhO/PyRhO
pyrho/NEURON/__init__.py
pyrho/NEURON/__init__.py
bsd-3-clause
Python
ebba34e159704332b26b9211392e7a1b0b3039ba
bump version to 1.0.3
Cue/scales,URXtech/scales
setup.py
setup.py
#!/usr/bin/env python # Copyright 2011 The greplin-twisted-utils Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
#!/usr/bin/env python # Copyright 2011 The greplin-twisted-utils Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
Python
067236f0d1afc646967acfe3a37faa6643afbecb
Create setup.py
Kevincavender/the-ends
setup.py
setup.py
# setup.py info things from distutils.core import setup setup( name = "Kevin" )
bsd-3-clause
Python
b53b228ec81a1d7e65e7056fee2711f6a2f557b0
Add setup.py
bbayles/scte_55-1_address
setup.py
setup.py
from setuptools import setup, find_packages import os import sys long_description = """This project contains library functions for converting\ between the Unit Address and MAC address representations of SCTE 55-1\ terminals, e.g. Motorola-brand set-top boxes and CableCARDs""" setup( name='scte_55-1_address', ...
mit
Python
3898db5ffff2b3515e6f41e7c17e3f5b5fce9243
Create setup.py
eduardoklosowski/deduplicated,eduardoklosowski/deduplicated
setup.py
setup.py
from setuptools import find_packages, setup version = __import__('deduplicated').__version__ setup( name='deduplicated', version=version, description='Check duplicated files', author='Eduardo Klosowski', author_email='eduardo_klosowski@yahoo.com', license='MIT', packages=find_packages(),...
mit
Python
a03130d23474efd7c4e2440618453d26e4f19f18
Create setup.py
Eternity71529/cleverbot
setup.py
setup.py
from setuptools import setup, find_packages import re, os requirements = [] with open('requirements.txt') as f: requirements = f.read().splitlines() version = '' with open('cleverbot/__init__.py') as f: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1) if not ver...
mit
Python
5ae7dcf5c1ebfdb70b1e12ed48dfa42fba348c7c
Add setup.py
k4nar/inbox
setup.py
setup.py
from setuptools import setup, find_packages import inbox requirements = [ "click", ] setup( name="inbox", version=inbox.__version__, url='TODO', description=inbox.__doc__, author=inbox.__author__, license=inbox.__license__, long_description="TODO", packages=find_packages(), in...
mit
Python
cf4c893560bede792e8f1c809d54a89f1c9b9870
Add setup.py.
jgehrcke/beautiful-readme
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2014 Jan-Philip Gehrcke (http://gehrcke.de). # See LICENSE file for details. import re from setuptools import setup long_description = \ """Beautiful-readme converts a single README file into a simple and modern `Bootstrap`_-powered static website. Resource...
mit
Python
450a186d7827b40dbb3a8ddde1f5f3e48b5143af
bump version
johndeng/django_linter,geerk/django_linter
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup setup( name='django_linter', version='0.1', packages=('django_linter', 'django_linter.checkers'), description='Linter for django projects', long_description=open('README.rst').read(), author='Timofey Trukhanov', author_email='timofey.trukh...
#!/usr/bin/env python from setuptools import setup setup( name='django_linter', version='0.0.3', packages=('django_linter', 'django_linter.checkers'), description='Linter for django projects', long_description=open('README.rst').read(), author='Timofey Trukhanov', author_email='timofey.tru...
mit
Python
49358019f146aa479b75ddb0dc75dffd1ecc351b
Create setup.py
tetherless-world/markdown-rdfa
setup.py
setup.py
#! /usr/bin/env python from setuptools import setup setup( name='rdfa_markdown', version='0.1', author='James McCusker', author_email='mccusj@cs.rpi.edu', description='Python-Markdown extension to add support for semantic data (RDFa).', url='https://github.com/tetherless-world/markdown-rdfa', ...
apache-2.0
Python
b8bab32410d866f9f547c4bd04de942e2e809816
Add a setup.py.
gustaebel/python-mpv
setup.py
setup.py
#!/usr/bin/env python3 from distutils.core import setup kwargs = { "name": "python-mpv", "author": "Lars Gustäbel", "author_email": "lars@gustaebel.de", "url": "http://github.com/gustaebel/python-mpv/", "description": "control mpv from Python using JSON IPC", "license":...
mit
Python
9fa978c6673759142a875d9b05a4f9c110f13718
add setup.py
suenkler/PostTLS,suenkler/PostTLS
setup.py
setup.py
import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-posttls', ve...
agpl-3.0
Python
6ae505c2b6d8ad65b6cc61587b28a8de81ecb488
Add setup.py file
kyleconroy/python-twilio2,kyleconroy/python-twilio2
setup.py
setup.py
from distutils.core import setup setup( name = "twilio", py_modules = ['twilio'], version = "3.0.0", description = "Twilio API client and TwiML generator", author = "Twilio", author_email = "help@twilio.com", url = "http://github.com/twilio/twilio-python/", download_url = "http://github....
mit
Python
ff48d7a242e1b8c67faa7a4b5ab43e641a1dd910
add setup.py
faycheng/tpl,faycheng/tpl
setup.py
setup.py
# -*- coding:utf-8 -*- from setuptools import find_packages, setup README = """# tpl """ setup( name='tpl', version='0.1.0', description='Command line utility for generating files or directories from template', long_description=README, author='程飞', url='https://github.com/faycheng/tpl.git', ...
mit
Python
6df13e80a4684a11ccbc53d9b30bb54067ce8196
correct app URL
sventech/YAK-server,ParableSciences/YAK-server,ParableSciences/YAK-server,yeti/YAK-server,yeti/YAK-server,sventech/YAK-server
setup.py
setup.py
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='yak-server', version='0.1', pac...
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='yak-server', version='0.1', pac...
mit
Python
7f9dee365f27bf288fae513739651462b8c78071
Create setup.py
GhostHackzDev/setbadge
setup.py
setup.py
from setuptools import setup def readme(): with open('README.rst') as f: return f.read() setup(name='setbadge', version='0.0.1', description='Set the Pythonista app\'s badge value to a custom text string!', long_description=readme(), classifiers=[ 'Development Status :: 3 - Alpha', 'License :...
mit
Python
17e66f79118f87aea452f7ca658142e6d5d71a1b
Add shell.py
clayadavis/OpenKasm,clayadavis/OpenKasm
shell.py
shell.py
import pymongo as pm client = pm.MongoClient() db = client.kasm redirects = db.redirects ## list(redirects.find())
mit
Python
1348f5c9068aa4059ed41ee03635c7da6f5b04f0
add max_path_sum
haandol/algorithm_in_python
tree/max_path_sum.py
tree/max_path_sum.py
# http://www.geeksforgeeks.org/find-maximum-path-sum-in-a-binary-tree/ class Node: def __init__(self, value): self.value = value self.left = None self.right = None def run(root, s): if not root: return 0 max_child = max(run(root.left, s), run(root.right, s)) return s...
mit
Python
71bfe8974e3274c80c2fd6d1be4c54a24345a0e7
add test_rgw
ajnelson/ceph,ajnelson/ceph,ajnelson/ceph,ajnelson/ceph,ajnelson/ceph,ajnelson/ceph
src/test/pybind/test_rgw.py
src/test/pybind/test_rgw.py
from nose.tools import eq_ as eq, assert_raises from rgw import Rgw def test_rgw(): rgw = Rgw() xml = """<AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Owner> <ID>foo</ID> <DisplayName>MrFoo</DisplayName> </Owner> <AccessControlList> <Grant> <Grantee xmlns:xsi=\"...
lgpl-2.1
Python
2c444b9ebc03aaef77b12e7d649f9f7359681420
Add : first attempt of a webservice commands for the arbiter.
kaji-project/shinken,lets-software/shinken,fpeyre/shinken,titilambert/alignak,mohierf/shinken,lets-software/shinken,KerkhoffTechnologies/shinken,claneys/shinken,geektophe/shinken,staute/shinken_package,titilambert/alignak,geektophe/shinken,geektophe/shinken,h4wkmoon/shinken,fpeyre/shinken,rledisez/shinken,dfranco/shink...
shinken/modules/ws_arbiter.py
shinken/modules/ws_arbiter.py
#!/usr/bin/python #Copyright (C) 2009 Gabes Jean, naparuba@gmail.com # #This file is part of Shinken. # #Shinken 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 yo...
agpl-3.0
Python
15c7b734bcd830b819bfbafdf94da48931dd7b7b
Create get-img.py
HaydnAnderson/image-downloader
get-img.py
get-img.py
import urllib, json, sys, os.path, argparse import hashlib import time import re # //==== EDIT THIS ====\\ log_file = open('log.txt', 'r+') username = 'dronenerds' sleep_time = 120 download_img = False console_log = True download_img1 = True path_name = 'images/' # //==== EDIT THIS ====\\ def find_new_images(imag...
mit
Python
f4504fdb70cff7089164f0cc9ae30e972d61ec30
add lux.py
zbanks/aurora,zbanks/aurora,zbanks/aurora,zbanks/aurora,zbanks/aurora,zbanks/aurora,zbanks/aurora
lux/lux.py
lux/lux.py
import logging import serial import time logger = logging.getLogger(__name__) class SingleLuxDevice(object): def __init__(self, port, baudrate=115200): self.ser = serial.Serial(port, baudrate) self.addresses = {} def close(self): self.ser.close() def raw_packet(self, data): ...
mit
Python
80b47093f6ccbe75be7e4382e0cfd948c868763d
add new log of media test (#3265)
wandb/client,wandb/client,wandb/client
functional_tests/core/05-log-media.py
functional_tests/core/05-log-media.py
#!/usr/bin/env python """Base case - logging sequence of media types multiple times --- id: 0.core.05-log-media plugin: - wandb - numpy assert: - :wandb:runs_len: 1 - :wandb:runs[0][config]: {} - :wandb:runs[0][summary][media][count]: 2 - :wandb:runs[0][summary][media][_type]: images/separated ...
mit
Python
ee6ab9fc5f580267f089108dc9c27a8a0208ebf0
Add __init__.py to make it work like a module
akazs/pySMOTE
pySMOTE/__init__.py
pySMOTE/__init__.py
from .smote import SMOTE
mit
Python
76ce99ba04151a00ee1101ebed4f883fd1112433
Create mad-lib.py
eringrace/hello-world
mad-lib.py
mad-lib.py
skill = raw_input("What's a skill you want to learn?:") adverb = raw_input("Enter an adverb:") animal = raw_input("Name an animal:") body = raw_input("Name a body part:") event = raw_input("Name a fun event:") emotion1 = raw_input("Name a positive emotion (past tense):") emotion2 = raw_input("Name another positive emot...
mit
Python
c20abf6b2ae6cb2518971ea03b7edbf7035b1661
send email to system managers about gst setup
geekroot/erpnext,gsnbng/erpnext,Aptitudetech/ERPNext,indictranstech/erpnext,indictranstech/erpnext,geekroot/erpnext,gsnbng/erpnext,indictranstech/erpnext,gsnbng/erpnext,geekroot/erpnext,geekroot/erpnext,indictranstech/erpnext,gsnbng/erpnext
erpnext/patches/v8_1/setup_gst_india.py
erpnext/patches/v8_1/setup_gst_india.py
import frappe from frappe.email import sendmail_to_system_managers def execute(): frappe.reload_doc('regional', 'doctype', 'gst_hsn_code') for report_name in ('GST Sales Register', 'GST Purchase Register', 'GST Itemised Sales Register', 'GST Itemised Purchase Register'): frappe.reload_doc('regional', 'report',...
import frappe def execute(): frappe.reload_doc('regional', 'doctype', 'gst_hsn_code') for report_name in ('GST Sales Register', 'GST Purchase Register', 'GST Itemised Sales Register', 'GST Itemised Purchase Register'): frappe.reload_doc('regional', 'report', frappe.scrub(report_name)) if frappe.db.get_single...
agpl-3.0
Python
0c1ef1267a67ce103f5ba0545bae690ce77c8180
Add a deploy script
asana/python-asana,asana/python-asana,Asana/python-asana
deploy.py
deploy.py
#!/usr/bin/env python """ Script for deploying a new version of the python-asana library. """ import argparse import re import subprocess import sys if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument( 'version', help='Version to deploy as, in format x.y.z') args = parser....
mit
Python
8255772770e20f51338da36dc7fa027b4dc0f07e
Allow photos in pages
tiramiseb/awesomeshop,tiramiseb/awesomeshop,tiramiseb/awesomeshop,tiramiseb/awesomeshop
awesomeshop/photo.py
awesomeshop/photo.py
import os.path, uuid from PIL import Image from flask.ext.babel import lazy_gettext from . import app, db thumb_size = app.config['THUMBNAIL_SIZE'] preview_size = app.config['PREVIEW_SIZE'] class Photo(db.EmbeddedDocument): filename = db.StringField(db_field='fname', max_length=50, ...
agpl-3.0
Python
6c52676493bbf4d8f64a65712034b18bbee279ba
Create syracuse.py
DavidMellul/Projets,DavidMellul/Projets,DavidMellul/Projets,DavidMellul/Projets,DavidMellul/Projets,DavidMellul/Projets,DavidMellul/Projets
python/syracuse/syracuse.py
python/syracuse/syracuse.py
n = int(input("Veuillez saisir un entier : ")) vol = 0 while(n != 1): if(n % 2 == 0): n /= 2 else: n = n*3 + 1 vol +=1 print("Le temps de vol du nombre ",n," est ",vol)
mit
Python
1064634cb9f3752e890b56bfddb49e51e70e530b
add munin alert script
cuongnb14/cookbook,cuongnb14/cookbook
python/utils/munin_alert.py
python/utils/munin_alert.py
#! /usr/bin/env python3 """ Script to send email alert for munin Munin Config: munin.conf contact.admin.command | /path/to/munin_alert.py contact.admin.max_messages 1 @author: cuongnb14@gmail.com """ import smtplib import fileinput import logging logger = logging.getLogger('munin_alert') logger.setLevel(logging.DE...
mit
Python
23ad0bf077c846e13e8b970f8928f06d02d658a3
Make initial migration
EmadMokhtar/halaqat,EmadMokhtar/halaqat,EmadMokhtar/halaqat
students/migrations/0001_initial.py
students/migrations/0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('master_data', '0001_initial'), ('back_office', '0007_teacher_nationality'), ] operations = [ migrations.CreateModel(...
mit
Python
1334b085f76db914ede6b941c23ea61329df1fbd
Create relaycontrol.py
pumanzor/security,pumanzor/security,pumanzor/security
raspberrypi/relaycontrol.py
raspberrypi/relaycontrol.py
import paho.mqtt.client as mqtt import json, time import RPi.GPIO as GPIO from time import sleep # The script as below using BCM GPIO 00..nn numbers GPIO.setmode(GPIO.BCM) # Set relay pins as output GPIO.setup(24, GPIO.OUT) # ----- CHANGE THESE FOR YOUR SETUP ----- MQTT_HOST = "190.97.168.236" MQTT_PORT = 1883 US...
mit
Python
f5ca504a390b8db3432dc7d67f934cd29daf3086
add openssl recipe
cbenhagen/kivy-ios,tonibagur/kivy-ios,tonibagur/kivy-ios,rnixx/kivy-ios,kivy/kivy-ios,rnixx/kivy-ios,cbenhagen/kivy-ios,kivy/kivy-ios,kivy/kivy-ios
recipes/openssl/__init__.py
recipes/openssl/__init__.py
from toolchain import Recipe, shprint from os.path import join, exists import sh import os arch_mapper = {'i386': 'darwin-i386-cc', 'x86_64': 'darwin64-x86_64-cc', 'armv7': 'iphoneos-cross', 'arm64': 'iphoneos-cross'} class OpensslRecipe(Recipe): version = "1.0.2a" ...
mit
Python
e4bf4091ea267cae2c584c8a442f57d3dda0cbf8
Create wksp2.py
indigohedgehog/RxWorkshopPy
wksp2.py
wksp2.py
"""Rx Workshop: Observables versus Events. Part 1 - Little Example. Usage: python wksp2.py """ from __future__ import print_function import rx class Program: """Main Class. """ S = rx.subjects.Subject() @staticmethod def main(): """Main Method. """ p = Program() ...
mit
Python
a1744d6a6f4c369403ac2ed67f167ca1ecd9cb5e
add input output outline
novastorm/Python-Playground
input-output.py
input-output.py
# input-output.py # review console I/O # CLI parameters # file I/O
mit
Python
72a6ca31ac313b89b5e4ce509c635f675484cf3e
Create solution.py
lilsweetcaligula/Algorithms,lilsweetcaligula/Algorithms,lilsweetcaligula/Algorithms
data_structures/linked_list/problems/find_length/py/solution.py
data_structures/linked_list/problems/find_length/py/solution.py
import LinkedList # Problem description: Find the length of a linked list. # Solution time complexity: O(n) # Comments: # Linked List Node inside the LinkedList module is declared as: # # class Node: # def __init__(self, val, nxt=None): # self.val = val # self.nxt = n...
mit
Python
ed6958f477c65a2973d43d669035de80b7cbd7a5
Change needs_auth ZeroConf key
bdfoster/blumate,shaftoe/home-assistant,HydrelioxGitHub/home-assistant,LinuxChristian/home-assistant,emilhetty/home-assistant,deisi/home-assistant,jabesq/home-assistant,hexxter/home-assistant,mKeRix/home-assistant,jabesq/home-assistant,miniconfig/home-assistant,ct-23/home-assistant,postlund/home-assistant,Julian/home-a...
homeassistant/components/zeroconf.py
homeassistant/components/zeroconf.py
""" This module exposes Home Assistant via Zeroconf. Zeroconf is also known as Bonjour, Avahi or Multicast DNS (mDNS). For more details about Zeroconf, please refer to the documentation at https://home-assistant.io/components/zeroconf/ """ import logging import socket from homeassistant.const import (EVENT_HOMEASSIS...
""" This module exposes Home Assistant via Zeroconf. Zeroconf is also known as Bonjour, Avahi or Multicast DNS (mDNS). For more details about Zeroconf, please refer to the documentation at https://home-assistant.io/components/zeroconf/ """ import logging import socket from homeassistant.const import (EVENT_HOMEASSIS...
mit
Python
9aa368d528448c485c940c646394b44dafd1e62f
Create iomanager.py
lyelindustries/IPM
basemod/iomanager.py
basemod/iomanager.py
mit
Python
d899fbda7c86067fc705de6fb3b04b1a7b3ed962
add a rest service to send commands to the actors via POST and retrieve information via GET
tahesse/pyCrow
pyCrow/crowlib/rest.py
pyCrow/crowlib/rest.py
#!/usr/bin/python # -*- coding: utf-8 -*- """REST Actor. """ # Python-native imports import logging.config from http.server import BaseHTTPRequestHandler, HTTPServer import json import threading # Third-party imports import pykka # App imports from pyCrow.crowlib.aux import Action # prepare logging, i.e. load con...
apache-2.0
Python
1a37c09fe0ba755dac04819aea0a6d02327330db
Add files via upload
Gregory93/project2-battleport
module3.py
module3.py
import psycopg2 try: conn = psycopg2.connect("dbname=battleport user=postgres host=localhost password=gregory123") except: print("cannot connect to the database") cur=conn.cursor() conn.set_isolation_level(0) #cur.execute("INSERT INTO score (name,gamesp,gamesw,gamesl) \ #VALUES ('Rens', 10, ...
mit
Python
f60b3f00b7a4675f1bfc4cab1b9d1b5c150d9dfc
Add simple utility class that extends a dictionary but can be used as object.
archman/phantasy,archman/phantasy
phyhlc/util.py
phyhlc/util.py
# encoding: UTF-8 """Utilities that are used throughout the package. ..moduleauthor:: Dylan Maxwell <maxwelld@frib.msu.edu> """ class ObjectDict(dict): """Makes a dictionary behave like an object, with attribute-style access. """ def __getattr__(self, name): try: return self[name] ...
bsd-3-clause
Python
c9e4c18ea54de5c168994b47f70f0bdac0a76c73
add ocr_pdf.py
luozhaoyu/deepdive,luozhaoyu/deepdive
ocr_pdf.py
ocr_pdf.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ ocr_pdf.py ~~~~~~~~~~~~~~ A brief description goes here. """ import subprocess def call(cmd, check=True, stdout=None, stderr=None): """ Args: check: check return code or not """ if check: return subprocess.check_call(cmd...
apache-2.0
Python
564f1b2287d3825266b82d9b0f2f1c289285a493
Add vectorfiled class.
ryanpepper/oommf-python,fangohr/oommf-python,fangohr/oommf-python,ryanpepper/oommf-python,ryanpepper/oommf-python,fangohr/oommf-python,ryanpepper/oommf-python
pyoommf/vectorfield.py
pyoommf/vectorfield.py
import numpy as np import matplotlib.pyplot as plt class VectorField(object): def __init__(self, filename): f = open(filename, 'r') lines = f.readlines() for line in lines: if line.startswith('# xmin'): self.xmin = float(line[7:]) if line.startswith(...
bsd-2-clause
Python
d58a021704669a8bb6b7d36d068ca596fc0f813e
add problem0010.py
Furisuke/ProjectEuler,Furisuke/ProjectEuler,Furisuke/ProjectEuler
python3/problem0010.py
python3/problem0010.py
from problem0003 import primes from itertools import takewhile print(sum(takewhile(lambda x: x < 2000000, primes())))
mit
Python
91927b441425703463f0ee1e08293ad942a26a93
Add debounce.py and implementation.
Digirolamo/pythonicqt
pythonicqt/debounce.py
pythonicqt/debounce.py
"""module contains datastructures needed to create the @debounce decorator.""" import time from functools import wraps, partial from PySide import QtCore class DebounceTimer(QtCore.QTimer): """Used with the debounce decorator, used for delaying/throttling calls.""" def __init__(self, msecs, fire_on_first=False...
mit
Python
50795568e35669916f1654d50e5f1bdd1800d41e
Create imposto.py
GestaoPublico/Inss_Issqn_IRF
imposto.py
imposto.py
numero = float(input('Digite o valor Bruto: ')) inss = numero * 11/100 if (inss >= 482.93 ): real = 482.93 else: real = inss Pissqn = numero - real issqn = Pissqn * 3/100 Pissqn = numero - real - issqn if (numero <= 1787.77 ): num = 'Não desconta inposto' vp = 0 elif (numero <= 2679.29): num = ...
mpl-2.0
Python
cebe8dffbf9819c370257b7030848ef0ea4e971c
Initialize stuff
kshvmdn/github-list,kshvmdn/github-list,kshvmdn/github-list
ghlist.py
ghlist.py
import requests api = 'https://api.github.com/users/{}/repos' repos = data = requests.get(url=api.format('kshvmdn')).json() for repo in repos: print(repo['name'])
mit
Python
62c02c185063465e51bd40e648f75d519e68c1d2
Create Euler2.py
PaulFay/DT211-3-Cloud
Euler2.py
Euler2.py
def sequence(n): if n <= 1: return n else: return(sequence(n-1) + sequence(n-2)) i = 1 j = 0 total = 0 while j < 4000000: j = sequence(i) if j%2: print(j) else: print(j) total = total + j i+=1 print("total is") print(total)
mit
Python
25b5b8fc89164dc386218ae1edd660735781241d
add simple font comparison tool in examples
adamlwgriffiths/Pyglet,adamlwgriffiths/Pyglet,adamlwgriffiths/Pyglet,adamlwgriffiths/Pyglet,niklaskorz/pyglet,niklaskorz/pyglet,niklaskorz/pyglet,niklaskorz/pyglet
examples/font_comparison.py
examples/font_comparison.py
#!/usr/bin/env python # ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are me...
bsd-3-clause
Python
778df30911226a7aac1e45406fa629f7f83e7136
Add example on robust training
google/jaxopt
examples/robust_training.py
examples/robust_training.py
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
Python
d300081826f7ebffefb4eeb8ca1077f028b40852
Add fractal shader example.
certik/scikits.gpu,stefanv/scikits.gpu
examples/shader_onscreen.py
examples/shader_onscreen.py
from scikits.gpu.api import * import pyglet.window from pyglet import gl # GLSL code based on http://nuclear.sdf-eu.org/articles/sdr_fract # by John Tsiombikas v_shader = VertexShader(""" uniform vec2 offset; uniform float zoom; uniform float width_ratio; varying vec2 pos; void main(void) { pos.x = gl_Vertex.x ...
mit
Python
522201ec9e00ed2fe135a621bde1b288c59ddd25
Add test utils
jimgoo/keras,LIBOTAO/keras,happyboy310/keras,relh/keras,keras-team/keras,jasonyaw/keras,gavinmh/keras,keskarnitish/keras,kfoss/keras,kod3r/keras,jhauswald/keras,meanmee/keras,jonberliner/keras,xiaoda99/keras,llcao/keras,ypkang/keras,why11002526/keras,daviddiazvico/keras,EderSantana/keras,OlafLee/keras,rodrigob/keras,hh...
keras/utils/test_utils.py
keras/utils/test_utils.py
import numpy as np def get_test_data(nb_train=1000, nb_test=500, input_shape=(10,), output_shape=(2,), classification=True, nb_class=2): ''' classification=True overrides output_shape (i.e. output_shape is set to (1,)) and the output consists in integers in [0, nb_class-1]. ...
mit
Python
bd02fd2d163a2f044029ddb0adef031c2dcd824a
Remove deprecated function call
ernstp/kivy,VinGarcia/kivy,adamkh/kivy,Ramalus/kivy,angryrancor/kivy,habibmasuro/kivy,iamutkarshtiwari/kivy,xiaoyanit/kivy,darkopevec/kivy,manthansharma/kivy,inclement/kivy,matham/kivy,MiyamotoAkira/kivy,denys-duchier/kivy,bionoid/kivy,MiyamotoAkira/kivy,arlowhite/kivy,manthansharma/kivy,bionoid/kivy,adamkh/kivy,bob-th...
kivy/core/clipboard/clipboard_sdl2.py
kivy/core/clipboard/clipboard_sdl2.py
''' Clipboard SDL2: an implementation of the Clipboard using sdl2. ''' __all__ = ('ClipboardSDL2', ) from kivy.utils import platform from kivy.core.clipboard import ClipboardBase if platform not in ('win', 'linux', 'macosx', 'android', 'ios'): raise SystemError('unsupported platform for pygame clipboard') try: ...
''' Clipboard SDL2: an implementation of the Clipboard using sdl2. ''' __all__ = ('ClipboardSDL2', ) from kivy.utils import platform from kivy.core.clipboard import ClipboardBase if platform() not in ('win', 'linux', 'macosx', 'android', 'ios'): raise SystemError('unsupported platform for pygame clipboard') try...
mit
Python
04b96b35d8d6e56eb1d545bafedc1af4d5914577
add Proxy pattern
JakubVojvoda/design-patterns-python
proxy/Proxy.py
proxy/Proxy.py
# # Python Design Patterns: Proxy # Author: Jakub Vojvoda [github.com/JakubVojvoda] # 2016 # # Source code is licensed under MIT License # (for more details see LICENSE) # import sys # # Subject # defines the common interface for RealSubject and Proxy # so that a Proxy can be used anywhere a RealSubject is expected ...
mit
Python
2f82c96257af5e5596c02348621572b08ff99b64
test mixed returns
thomasvs/pychecker,akaihola/PyChecker,akaihola/PyChecker,thomasvs/pychecker
pychecker2/utest/returns.py
pychecker2/utest/returns.py
from pychecker2.TestSupport import WarningTester from pychecker2 import ReturnChecks class ReturnTestCase(WarningTester): def testReturnChecks(self): w = ReturnChecks.MixedReturnCheck.mixedReturns self.silent('def f(): return\n') self.silent('def f(): return 1\n') self.silent('def f...
bsd-3-clause
Python
83580051da3ad427c815dca0ca88cc8005c014f2
add nightly script to perform test over a wide range of parameters
exafmm/exafmm,exafmm/exafmm,exafmm/exafmm,exafmm/exafmm
nightly.py
nightly.py
import itertools import os import subprocess # the range of each parameter param_range = { 'n': ['2', '10', '100', '1000', '10000', '100000', '1000000', '10000000'], 'P': ['4', '10', '20', '30', '40'], 't': ['0.5', '0.4', '0.3', '0.2'], 'd': ['c', 's', 'o', 'p'] } # the...
bsd-3-clause
Python
7b29e5a735fe495c3504d585acab2826bbd44bf9
Add tests for classes that use __eq__
tomashaber/raiden,tomashaber/raiden,hackaugusto/raiden,hackaugusto/raiden,tomashaber/raiden,tomashaber/raiden,tomashaber/raiden
raiden/tests/unit/test_operators.py
raiden/tests/unit/test_operators.py
# -*- coding: utf-8 -*- from raiden.utils import sha3 from raiden.transfer.state_change import ( ActionCancelTransfer, ActionTransferDirect, Block, ReceiveTransferDirect, ) from raiden.transfer.state import ( RouteState, RoutesState, ) from raiden.transfer.events import ( EventTransferSentSu...
mit
Python
e7bbd7f975d478846843e14e83e238294feaee86
Create mc_tools.py
oyamad/stochevolution
mc_tools.py
mc_tools.py
""" Filename: mc_tools.py Authors: John Stachurski and Thomas J. Sargent """ import numpy as np from discrete_rv import DiscreteRV def mc_compute_stationary(P): """ Computes the stationary distribution of Markov matrix P. Parameters =========== P : a square 2D NumPy array Returns: A fla...
mit
Python
a3e9097247f4abe660696e5bd19f06e7e5756249
Add start of Python solution for day 9 (parsing only)
robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions
python/day9.py
python/day9.py
#!/usr/local/bin/python3 def parse_input(text): """Parse a list of destinations and weights Returns a list of tuples (source, dest, weight). Edges in this graph and undirected. The input contains multiple rows appearing like so: A to B = W Where A and B are strings and W is the weight t...
mit
Python
1f5bd0236e3fd97287891c37bf64cadcae38c444
add python
exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib
python/exmo.py
python/exmo.py
import httplib import urllib import json import hashlib import hmac import time api_key = "your_key" api_secret = "your_secret" nonce = int(round(time.time()*1000)) params = {"nonce": nonce} params = urllib.urlencode(params) H = hmac.new(api_secret, digestmod=hashlib.sha512) H.update(params) sig...
mit
Python
5ba61a7898a8fe70bd19993f8b0f8c502f514621
add batch cp
xiilei/pytools,xiilei/pytools
batchmv.py
batchmv.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'xilei' import os import sys import hashlib import shutil def md5hex(s): m = hashlib.md5() m.update(s.encode('UTF-8')) return m.hexdigest() if __name__ == '__main__': if len(sys.argv) < 2: print("miss args, use like batchmv.py /var...
apache-2.0
Python
422baea7ea6120dae3f7ac0d412a19b66958e3ad
Add migration
dbinetti/barberscore,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore
project/apps/api/migrations/0074_catalog_song_name.py
project/apps/api/migrations/0074_catalog_song_name.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0073_auto_20151027_1111'), ] operations = [ migrations.AddField( model_name='catalog', name='...
bsd-2-clause
Python
c1a5bd8268890f359427f578204886fe5d01909e
Add a large, graphical integration test.
probcomp/cgpm,probcomp/cgpm
tests/graphical/one_view.py
tests/graphical/one_view.py
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 MIT Probabilistic Computing Project # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unles...
apache-2.0
Python
552b5d97fc9a0298ca43c316aad3d221234b894c
Add fontTools.misc.classifyTools, helpers to classify things into classes
fonttools/fonttools,googlefonts/fonttools
Lib/fontTools/misc/classifyTools.py
Lib/fontTools/misc/classifyTools.py
""" fontTools.misc.classifyTools.py -- tools for classifying things. """ from __future__ import print_function, absolute_import from fontTools.misc.py23 import * class Classifier: """ Main Classifier object, used to classify things into similar sets. """ def __init__(self, sorted=True): self._things = set() ...
mit
Python
67d44755557347a390ede3a4b5f872dc08b73805
add tests for weighting angles
RI-imaging/ODTbrain,RI-imaging/ODTbrain,paulmueller/ODTbrain
tests/test_angle_weights.py
tests/test_angle_weights.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Tests backpropagation algorithm """ from __future__ import division, print_function import numpy as np import os from os.path import abspath, basename, dirname, join, split, exists import platform import sys import warnings import zipfile # Add parent directory to beg...
bsd-3-clause
Python
594df6d33eaa66acc5d232b9ea3fcbb8917ca26e
Update user tests
fernando24164/flask_api,fernando24164/flask_api
tests/test_user_security.py
tests/test_user_security.py
from unittest import TestCase from app import create_app, db from app.api.models import User class UserModelTestCase(TestCase): def setUp(self): self.app = create_app('default') self.app_context = self.app.app_context() self.app_context.push() db.create_all() self.client =...
mit
Python
2f127de7520a0b689bfe5082360eeb53a05d6e2d
Add "repo overview" command.
folpindo/git-repo,baidurom/repo,venus-solar/git-repo,GatorQue/git-repo-flow,linuxdeepin/git-repo,martinjina/git-repo,ediTLJ/git-repo,zbunix/git-repo,GerritCodeReview/git-repo,HenningSchroeder/git-repo,hacker-camp/google_repo,FuangCao/repo,windyan/git-repo,hanchentech/git-repo,FuangCao/git-repo,jingyu/git-repo,ThangBK20...
subcmds/overview.py
subcmds/overview.py
# # Copyright (C) 2012 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
Python
9da427f7b1345ba140561a213cb24f857c3f3482
Add partial spamhandling tests
Charcoal-SE/SmokeDetector,NickVolynkin/SmokeDetector,ArtOfCode-/SmokeDetector,ArtOfCode-/SmokeDetector,Charcoal-SE/SmokeDetector,NickVolynkin/SmokeDetector
test/test_spamhanding.py
test/test_spamhanding.py
from spamhandling import * import pytest @pytest.mark.parametrize("title, body, username, site, match", [ ('18669786819 gmail customer service number 1866978-6819 gmail support number', '', '', '', True), ('Is there any http://www.hindawi.com/ template for Cloud-Oriented Data Center Networking?', '', '', '',...
apache-2.0
Python
8979c2122abc6f37b31fe9d4193ef9df350d73f0
Add bwt implementation
elvinyung/misc,elvinyung/misc
bwt/bwt.py
bwt/bwt.py
def encode(s): shifts = [] for i in range(len(s)): shifts.append(s[i:] + s[:i]) shifts.sort() encoded = ''.join(shifted[-1] for shifted in shifts) return encoded, shifts.index(s) def decode(s, indx): table = ['' for ch in s] for _ch in s: for k in range(len(table)): ...
mit
Python
b81825eb66bd5a9dac6a1e3ff4dfb99e6addd5ac
add ex0 template
zusantunfimmeri/python-exercises
ch3/ex0.py
ch3/ex0.py
#!/usr/bin/env python # # To be used as an exercise template for all the rest of the exercises. # # Style guide to be used: https://google.github.io/styleguide/pyguide.html # def main(): print "Hello world!" return if __name__ == '__main__': main()
agpl-3.0
Python
9572f256d57bb43cac63cbf0325226d36426eb8d
Add urls file for pods.
praekelt/casepro,rapidpro/casepro,rapidpro/casepro,xkmato/casepro,rapidpro/casepro,praekelt/casepro,xkmato/casepro,praekelt/casepro
casepro/pods/urls.py
casepro/pods/urls.py
from casepro.pods.registry import get_url_patterns urlpatterns = get_url_patterns()
bsd-3-clause
Python
17831f16aadece921fe2424f305c1c368e12c6e7
Add user defined operator
nerevu/riko,nerevu/riko
riko/modules/udf.py
riko/modules/udf.py
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ riko.modules.udf ~~~~~~~~~~~~~~~~ Provides functions for performing an arbitrary (user-defined) function on stream items. Examples: basic usage:: >>> from riko.modules.udf import pipe >>> >>> items = [{'x': x} for x in range(5)] ...
mit
Python
b95e5cd706a1cf81e41debae30422345cef3a1ee
Add simple parser to return some activity numbers from our git log.
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
tests/committerparser.py
tests/committerparser.py
#!/usr/bin/python import sys import getopt import re import email.utils import datetime class Usage(Exception): def __init__(self, msg): self.msg = msg def parse_date(datestr): d = email.utils.parsedate(datestr) return datetime.datetime(d[0],d[1],d[2],d[3],d[4],d[5],d[6]) def parse_gitlog(filena...
apache-2.0
Python
666582ff2edf201102e88038e8053908b8020472
add player data test
jaebradley/nba_data
tests/test_playerData.py
tests/test_playerData.py
from unittest import TestCase from nba_data.data.player_data import PlayerData class TestPlayerData(TestCase): def test_instantiation(self): player_id = '1234' name = 'jae' jersey = 0 team_seasons = list() self.assertIsNotNone(PlayerData(player_id=player_id, name=name, jer...
mit
Python
19bff8fb2141e9e389e4af057c4ea1623a07ac47
Add serializer test
Callwoola/tinydb,raquel-ucl/tinydb,cagnosolutions/tinydb,msiemens/tinydb,ivankravets/tinydb
tests/test_serializer.py
tests/test_serializer.py
from datetime import datetime from tinydb import TinyDB, where from tinydb.middlewares import SerializationMiddleware from tinydb.serialize import Serializer from tinydb.storages import MemoryStorage class DateTimeSerializer(Serializer): OBJ_CLASS = datetime FORMAT = '%Y-%m-%dT%H:%M:%S' def encode(self,...
mit
Python
3020b2084b24f1e00f0b9fc1d06186b1e697647e
Test long jid passed on CLI
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
tests/unit/utils/args.py
tests/unit/utils/args.py
# -*- coding: utf-8 -*- # Import Salt Libs from salt.utils import args # Import Salt Testing Libs from salttesting import TestCase, skipIf from salttesting.mock import NO_MOCK, NO_MOCK_REASON from salttesting.helpers import ensure_in_syspath ensure_in_syspath('../../') @skipIf(NO_MOCK, NO_MOCK_REASON) class ArgsTes...
apache-2.0
Python
8f597e766e9ef8014da4391a7109d9b77daf127e
Add tests for user utilities sum_ and prod_
tschijnmo/drudge,tschijnmo/drudge,tschijnmo/drudge
tests/user_utils_test.py
tests/user_utils_test.py
"""Tests for user utility functions.""" from drudge import Vec, sum_, prod_ from drudge.term import parse_terms def test_sum_prod_utility(): """Test the summation and product utility.""" v = Vec('v') vecs = [v[i] for i in range(3)] v0, v1, v2 = vecs # The proxy object cannot be directly compare...
mit
Python
49b3bc23edfb3016228c4f39e4af6e8909eb183f
Create the_supermarket_queue.py
Kunalpod/codewars,Kunalpod/codewars
the_supermarket_queue.py
the_supermarket_queue.py
#Kunal Gautam #Codewars : @Kunalpod #Problem name: The Supermarket Queue #Problem level: 6 kyu def queue_time(customers, n): if not customers: return 0 li=customers[:n] for customer in customers[n:]: li[li.index(min(li))]+=customer return max(li)
mit
Python
06c3a417f0270d76a7fcc9e94fdb40f9952b9d12
Add a login view that automatically starts the oauth2 flow for authenticating using the IdM server
jpajuelo/wirecloud,rockneurotiko/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud
src/wirecloud/fiware/views.py
src/wirecloud/fiware/views.py
# -*- coding: utf-8 -*- # Copyright (c) 2012-2013 CoNWeT Lab., Universidad Politécnica de Madrid # This file is part of Wirecloud. # Wirecloud 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 v...
agpl-3.0
Python
ba0ee66177f11fb1c13b00167b04e0ddd23f4e28
Update bulma
miyakogi/wdom,miyakogi/wdom,miyakogi/wdom
wdom/themes/bulma.py
wdom/themes/bulma.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from wdom.tag import NewTagClass as NewTag from wdom.tag import * css_files = [ '//cdnjs.cloudflare.com/ajax/libs/bulma/0.0.20/css/bulma.min.css', ] js_files = [] headers = [] Button = NewTag('Button', bases=Button, class_='button') DefaultButton = NewTag('Default...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from wdom.tag import NewTagClass as NewTag from wdom.tag import * css_files = [ '//cdnjs.cloudflare.com/ajax/libs/bulma/0.0.20/css/bulma.min.css', ] js_files = [] headers = [] Button = NewTag('Button', bases=Button, class_='button') DefaultButton = NewTag('Default...
mit
Python
07b01296bcbc8c8b9220c93d9014973704d88caa
add script/json/ts-pycurl.py
Zex/Starter,Zex/Starter,Zex/Starter
script/json/ts-pycurl.py
script/json/ts-pycurl.py
#!/usr/bin/env python # # ts-pycurl.py # # Author: Zex <top_zlynch@yahoo.com> # import pycurl #import json from os import path, mkdir from basic import * from StringIO import StringIO if not path.isdir(RESPONSE_DIR): mkdir(RESPONSE_DIR) def case(): headers = { #'Content-Type' : 'application/json' ...
mit
Python
c51bb87714ade403aeabc9b4b4c62b4ee3a7a8c5
Add test script for checking to see if scrobbling works on new installs
foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm
scripts/test-scrobble.py
scripts/test-scrobble.py
#!/usr/bin/env python ##### CONFIG ##### SERVER = "turtle.libre.fm" USER = "testuser" PASSWORD = "password" ################## import gobble, datetime print "Handshaking..." gs = gobble.GobbleServer(SERVER, USER, PASSWORD, 'tst') time = datetime.datetime.now() - datetime.timedelta(days=1) # Yesterday track = gobb...
agpl-3.0
Python
ff1da8b72e0b40d48e6d740bd9eee3fb8f391a58
add NYU hyperopt search script
ferasha/curfil,ferasha/curfil,ferasha/curfil
scripts/hyperopt/hyperopt_search.py
scripts/hyperopt/hyperopt_search.py
#!/usr/bin/env python from __future__ import print_function import sys import math from hyperopt import fmin, tpe, hp from hyperopt.mongoexp import MongoTrials def get_space(): space = (hp.quniform('numTrees', 1, 10, 1), hp.quniform('samplesPerImage', 10, 7500, 1), hp.quniform('featur...
mit
Python
379171e30269cfa219bddb481a9300514941f083
update header
ct-23/home-assistant,bdfoster/blumate,mikaelboman/home-assistant,pottzer/home-assistant,MartinHjelmare/home-assistant,mikaelboman/home-assistant,w1ll1am23/home-assistant,auduny/home-assistant,SEJeff/home-assistant,maddox/home-assistant,sfam/home-assistant,tchellomello/home-assistant,Zac-HD/home-assistant,mikaelboman/ho...
homeassistant/components/switch/demo.py
homeassistant/components/switch/demo.py
""" homeassistant.components.switch.demo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Demo platform that has two fake switches. """ from homeassistant.helpers.entity import ToggleEntity from homeassistant.const import STATE_ON, STATE_OFF, DEVICE_DEFAULT_NAME # pylint: disable=unused-argument def setup_platform(hass, config...
""" Demo platform that has two fake switches. """ from homeassistant.helpers.entity import ToggleEntity from homeassistant.const import STATE_ON, STATE_OFF, DEVICE_DEFAULT_NAME # pylint: disable=unused-argument def setup_platform(hass, config, add_devices_callback, discovery_info=None): """ Find and return demo s...
mit
Python
76c4f9b4acbedab7606ddca4c6456db47e68a744
Add Currency model
jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow
game/currencies/__init__.py
game/currencies/__init__.py
# -*- coding: utf-8 -*- """ Enchants - CurrencyTypes.dbc """ from .. import * class Currency(Model): def getTooltip(self): return CurrencyTooltip(self) class CurrencyTooltip(Tooltip): def tooltip(self): self.append("name", self.obj.getName()) self.append("description", self.obj.getDescription(), color=Y...
cc0-1.0
Python
f2b6d7cb70a0a5b4f1a96657ba66455cdab67b45
Add search for weird memories
SymbiFlow/prjxray-bram-patch,SymbiFlow/prjxray-bram-patch,SymbiFlow/prjxray-bram-patch
weird.py
weird.py
# # Author: Brent Nelson # Created: 18 Dec 2020 # Description: # Given a directory, will analyze all the MDD files import glob import patch_mem import parseutil.parse_mdd as mddutil from collections import namedtuple Mdd = namedtuple('Mdd', 'typ width addrbeg addrend') def main(dirs, verbose): ...
isc
Python
c0f71cd818c52bd02bdaff28a1220456bfd4ee5f
Create basecache.py
yangjiePro/cutout,MrZhengliang/cutout,jojoin/cutout
cutout/cache/basecache.py
cutout/cache/basecache.py
# -*- coding: utf-8 -*- #from itertools import izip from .posixemulation import _items class BaseCache(object): """Baseclass for the cache systems. All the cache systems implement this API or a superset of it. :param default_timeout: the default timeout that is used if no timeout is ...
mit
Python
0312a4210d07618755b6ad9caf49b144e7bec58c
add en-gb format tests
cdubz/babybuddy,cdubz/babybuddy,cdubz/babybuddy
babybuddy/tests/formats/tests_en_gb.py
babybuddy/tests/formats/tests_en_gb.py
# -*- coding: utf-8 -*- import datetime from django.core.exceptions import ValidationError from django.forms.fields import DateTimeField from django.test import TestCase, override_settings, tag from django.utils.formats import date_format, time_format from babybuddy.middleware import update_en_gb_date_formats class...
bsd-2-clause
Python
f14ca27897ade9b4a19aa29b869a845486f67829
Create audit object class
cpacia/OpenBazaar-Server,OpenBazaar/OpenBazaar-Server,OpenBazaar/OpenBazaar-Server,saltduck/OpenBazaar-Server,tyler-smith/OpenBazaar-Server,tyler-smith/OpenBazaar-Server,saltduck/OpenBazaar-Server,OpenBazaar/Network,tyler-smith/OpenBazaar-Server,cpacia/OpenBazaar-Server,OpenBazaar/Network,cpacia/OpenBazaar-Server,OpenB...
market/audit.py
market/audit.py
__author__ = 'hoffmabc' from log import Logger class Audit(object): """ A class for handling audit information """ def __init__(self, db): self.db = db self.log = Logger(system=self) self.action_ids = { "GET_PROFILE": 0, "GET_CONTRACT": 1, ...
mit
Python