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 |
|---|---|---|---|---|---|---|---|---|
7f8cc08405639f32cc4a92ee478281f14fb365a9 | Add taobao.com authentication, oauth 2.0 | ImaginationForPeople/velruse,ImaginationForPeople/velruse,bbangert/velruse,miedzinski/velruse,bbangert/velruse,miedzinski/velruse | velruse/providers/taobao.py | velruse/providers/taobao.py | """Taobao Authentication Views"""
from hashlib import md5
from json import loads
import time
import requests
from pyramid.httpexceptions import HTTPFound
from velruse.api import AuthenticationComplete
from velruse.exceptions import AuthenticationDenied
from velruse.exceptions import ThirdPartyFailure
from velruse.utils... | mit | Python | |
8d22023a065992f2f218920229df0d8de8feb463 | improve naming/organization | BlackPole/bp-openembedded,scottellis/overo-oe,dellysunnymtech/sakoman-oe,thebohemian/openembedded,sledz/oe,BlackPole/bp-openembedded,sentient-energy/emsw-oe-mirror,sutajiokousagi/openembedded,sentient-energy/emsw-oe-mirror,JamesAng/goe,SIFTeam/openembedded,scottellis/overo-oe,nx111/openembeded_openpli2.1_nx111,openembe... | lib/oe/test_types.py | lib/oe/test_types.py | import unittest
from oe.maketype import create, factory
class TestTypes(unittest.TestCase):
def assertIsInstance(self, obj, cls):
return self.assertTrue(isinstance(obj, cls))
def assertIsNot(self, obj, other):
return self.assertFalse(obj is other)
def assertFactoryCreated(self, value, typ... | import unittest
from oe.maketype import create, factory
class TestTypes(unittest.TestCase):
def assertIsInstance(self, obj, cls):
return self.assertTrue(isinstance(obj, cls))
def assertIsNot(self, obj, other):
return self.assertFalse(obj is other)
def assertFactoryCreated(self, value, typ... | mit | Python |
d683fee61eeec1c0ea9d0fbd2519b6c9b35616c2 | rename newton_test to smooth_test, add steepest_descent test | aringh/odl,kohr-h/odl,odlgroup/odl,kohr-h/odl,odlgroup/odl,aringh/odl | odl/test/solvers/smooth/smooth_test.py | odl/test/solvers/smooth/smooth_test.py | # Copyright 2014-2016 The ODL development group
#
# This file is part of ODL.
#
# ODL is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... | mpl-2.0 | Python | |
961d8b3a27ed88f09f6bc59b71003f60efd9e601 | Create bloomberg_spider.py | laichunpongben/web_crawler | bloomberg_spider.py | bloomberg_spider.py | import scrapy
class BloombergSpider(scrapy.Spider):
name = 'bloomberg'
start_urls = [
'http://www.bloomberg.com/quote/AAPL:US',
'http://www.bloomberg.com/quote/GOOGL:US',
'http://www.bloomberg.com/quote/AMZN:US',
]
def parse(self, response):
for sel in response.css('met... | apache-2.0 | Python | |
aa050504a47f92738831153eee3d04a217ade9b7 | Add rapmap script | GastonLab/ddb-scripts,dgaston/ddb-ngsflow-scripts,dgaston/ddb-scripts | workflow-KSHV_RNA-Seq_RapMap.py | workflow-KSHV_RNA-Seq_RapMap.py | #!/usr/bin/env python
# Standard packages
import sys
import argparse
# Third-party packages
from toil.job import Job
# Package methods
from ddb import configuration
from ddb_ngsflow import gatk
from ddb_ngsflow import pipeline
from ddb_ngsflow.rna import rapmap
if __name__ == "__main__":
parser = argparse.Argu... | mit | Python | |
11a69bd2fe6e7eb9e2372dc8a21dd3c41b0ab2ef | Add iow_util.py | cybem/graphite-web-iow,cybem/graphite-web-iow,EinsamHauer/graphite-web-iow,EinsamHauer/graphite-web-iow,cybem/graphite-web-iow,cybem/graphite-web-iow,cybem/graphite-web-iow,EinsamHauer/graphite-web-iow,cybem/graphite-web-iow,EinsamHauer/graphite-web-iow,EinsamHauer/graphite-web-iow,EinsamHauer/graphite-web-iow | webapp/graphite/iow_util.py | webapp/graphite/iow_util.py | from django.conf import settings
def check_tenant(tenant):
if tenant not in settings.TENANT_LIST:
return settings.TENANT_LIST[0]
return tenant
| apache-2.0 | Python | |
29a6ac8b0744e8569928dbdf3648485f0fe78ae7 | add register handlers | SYHGroup/mau_mau_bot,pythonalliance/uno2bot,SYHGroup/mau_mau_bot,pythonalliance/uno2bot,jh0ker/mau_mau_bot,imlonghao/unocn_bot,jh0ker/mau_mau_bot | bot.py | bot.py |
from telegram import Updater, InlineQueryResultPhoto
from game_manager import GameManager
import card as c
from credentials import TOKEN
gm = GameManager()
u = Updater(TOKEN)
dp = u.dispatcher
def new_game(bot, update):
chat_id = update.message.chat_id
link = gm.generate_invite_link(u.bot.getMe().username,... |
from telegram import Updater, InlineQueryResultPhoto
from game_manager import GameManager
import card as c
from credentials import TOKEN
gm = GameManager()
u = Updater(TOKEN)
dp = u.dispatcher
def new_game(bot, update):
chat_id = update.message.chat_id
link = gm.generate_invite_link(u.bot.getMe().username,... | agpl-3.0 | Python |
a2413403a59a313397b517c90a2405a0599a0fa6 | add initial code | smmalis37/ZBot | bot.py | bot.py | #! /usr/bin/python3
import discord
import asyncio
client = discord.Client()
discord_colors = discord.Color.__dict__
colors = list(filter(lambda x: isinstance(discord_colors[x],classmethod), discord_colors))
colors.sort()
@asyncio.coroutine
def handle_color(message):
words = message.content.split(' ')
... | unlicense | Python | |
938fa9463b4cf248593ae1917bd6d7f9413a183a | add a modle to send serial data | 498143049/Uppercom,498143049/Uppercom,498143049/Uppercom,498143049/Uppercom,498143049/Uppercom | Python/servercode/simchipcomputer.py | Python/servercode/simchipcomputer.py | # coding=UTF-8
from time import sleep, ctime
import serial
import threading
port='com4';
baudrate=9600;
Myserial = serial.Serial(port,baudrate);
def Handle(Text124):
while True:
count = Myserial.inWaiting()
if count != 0:
recv = Myserial.read(count)
print(recv.decode('ascii'))
Myserial.flushInput()
s... | mit | Python | |
8f2c2e566281507dfded1bae855ba0236694aac0 | Add a few tests. | bjornedstrom/python-signify,bjornedstrom/python-signify | test/system_test.py | test/system_test.py | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Björn Edström <be@bjrn.se>
import signify
import unittest
class SignifyTest(unittest.TestCase):
KAT = [
{
'pub': """untrusted comment: bjorntest public key
RWQ100QRGZoxU+Oy1g7Ko+8LjK1AQLIEavp/NuL54An1DC0U2cfCLKEl
""",
'priv': """untrus... | mit | Python | |
37d23e16f091f462f83708959cfff73d8811eb47 | build docker image for SPM | kaczmarj/neurodocker,kaczmarj/neurodocker | neurodocker/interfaces/tests/test_spm.py | neurodocker/interfaces/tests/test_spm.py | """Tests for neurodocker.interfaces.SPM"""
# Author: Jakub Kaczmarzyk <jakubk@mit.edu>
from __future__ import absolute_import, division, print_function
from io import BytesIO
import pytest
from neurodocker.docker_api import Dockerfile, DockerImage, DockerContainer
from neurodocker.parser import SpecsParser
from neuro... | apache-2.0 | Python | |
51faed84f4d56fe3455a6568bdadbc9b16196175 | Add day 5 part 1. | SayWhat1/adventofcode2016 | day5-1.py | day5-1.py | """Module to find the passowrd on a bunny door."""
import hashlib
def main():
"""Run the main function."""
id = 'cxdnnyjw'
password = []
begin = '00000'
index = 0
while len(password) < 8:
test = id + str(index)
if begin == hashlib.md5(test).hexdigest()[0:5]:
pass... | mit | Python | |
c019af0f2d155ed2edaf600732218057cabc441e | Add test_client.py. | ibus/ibus-cros,ibus/ibus,fujiwarat/ibus,Keruspe/ibus,ibus/ibus,j717273419/ibus,ueno/ibus,ibus/ibus-cros,luoxsbupt/ibus,ibus/ibus,luoxsbupt/ibus,phuang/ibus,phuang/ibus,ibus/ibus-cros,j717273419/ibus,fujiwarat/ibus,Keruspe/ibus,luoxsbupt/ibus,phuang/ibus,j717273419/ibus,ibus/ibus,ueno/ibus,luoxsbupt/ibus,Keruspe/ibus,fu... | test/test_client.py | test/test_client.py | #! /usr/bin/python
# Test program for client APIs.
import time
import os
import sys
import select
import glib
import termios
import tty
import ibus
from ibus import keysyms
from ibus import modifier
class DemoTerm:
def __init__(self):
self.__term_old = termios.tcgetattr(0)
tty.setraw(0)
self.__bus = ibus.Bus()... | lgpl-2.1 | Python | |
d813448c1b9a16d58c8d24d27267893b39c4b908 | Add calc_coolfunc_profile.py: calculate cooling function proifle | liweitianux/chandra-acis-analysis,liweitianux/chandra-acis-analysis,liweitianux/chandra-acis-analysis | bin/calc_coolfunc_profile.py | bin/calc_coolfunc_profile.py | #!/usr/bin/env python3
#
# Copyright (c) 2017 Weitian LI <liweitianux@live.com>
# MIT license
"""
Calculate the cooling function profile with respect to the input
temperature profile by interpolating the previously calculated
cooling function table.
In this way, the cooling function profile can be calculated very
qui... | mit | Python | |
18bc9e0fb7c084e56e77b54b69fca5471d04be5f | add missing Devince migration | MPIB/Lagerregal,vIiRuS/Lagerregal,MPIB/Lagerregal,vIiRuS/Lagerregal,MPIB/Lagerregal,vIiRuS/Lagerregal | devices/migrations/0007_device_used_in_rm_default.py | devices/migrations/0007_device_used_in_rm_default.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-06-28 19:59
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('devices', '0006_device_used_in'),
]
operations = ... | bsd-3-clause | Python | |
28dda425039716b23a22f8f61889d10c96467e17 | Add site context processor | nvbn/coviolations_web,nvbn/coviolations_web | app/context_processors.py | app/context_processors.py | from django.contrib.sites.models import Site
def request_site(request):
"""Current site instalnce processor"""
return {
'SITE': Site.objects.get_current(),
}
| mit | Python | |
7ea4d3d9117f0586749dad3ce1ff3a038c40ffa8 | Add missing file | annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc,annapowellsmith/openpresc,ebmdatalab/openprescribing,ebmdatalab/openprescribing,annapowellsmith/openpresc,ebmdatalab/openprescribing | openprescribing/openprescribing/slack.py | openprescribing/openprescribing/slack.py | import os
import requests
def notify_slack(message):
"""Posts the message to #general
"""
# Set the webhook_url to the one provided by Slack when you create
# the webhook at
# https://my.slack.com/services/new/incoming-webhook/
webhook_url = os.environ['SLACK_GENERAL_POST_KEY']
slack_data... | mit | Python | |
41a83a622fda7776ddc9efdf5bed1be1cd698b51 | Test Lab for review, with support file codingbat | UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016 | students/pvosper/session06/codingbat.py | students/pvosper/session06/codingbat.py | #!/usr/bin/env python3
# Coding Bat Samples for Test Lab
'''
Pick an example from codingbat:
http://codingbat.com
Do a bit of test-driven development on it:
run something on the web site.
write a few tests using the examples from the site.
then write the function, and fix it ‘till it passes the tests.
Do at least ... | unlicense | Python | |
764a4396300fa5c50c7c129bc24ce1cfdd597c03 | add foo.py | daiz713/pxchar,daiz713/pxchar,daiz713/pxchar | foo.py | foo.py | # -*- coding: utf-8 -*-
# Project pxchar
import sys
import os.path
from PIL import Image
# 初期化
def init():
pass;
# テキストファイルを一文字ずつ読み込む
def readChar(fileName):
pass;
# 読み込んだ文字からピクセルデータを決定する
def determinePxColor(char):
pass;
# PNGファイルを出力する
def applyPxColor(color):
pass;
if __name__ == '__main__':
| mit | Python | |
82199c60097599f5273c97fee649473a8a069ec8 | Add missing migration | City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi,stephawe/kerrokantasi,vikoivun/kerrokantasi,City-of-Helsinki/kerrokantasi,stephawe/kerrokantasi,stephawe/kerrokantasi,vikoivun/kerrokantasi,vikoivun/kerrokantasi | democracy/migrations/0023_add_comment_location_and_images.py | democracy/migrations/0023_add_comment_location_and_images.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-09-15 12:32
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import djgeojson.fields
class Migration(migrations.Migration):
d... | mit | Python | |
e6b52bbb4353ef797a83ead2a8dd2037f284cbb1 | Update create_manufacturer_records.py | sagar30051991/ozsmart-erp,gangadharkadam/v6_erp,ShashaQin/erpnext,aruizramon/alec_erpnext,ShashaQin/erpnext,aruizramon/alec_erpnext,gangadharkadam/v6_erp,geekroot/erpnext,geekroot/erpnext,sagar30051991/ozsmart-erp,anandpdoshi/erpnext,indictranstech/erpnext,anandpdoshi/erpnext,indictranstech/osmosis-erpnext,ShashaQin/er... | erpnext/patches/v6_16/create_manufacturer_records.py | erpnext/patches/v6_16/create_manufacturer_records.py | # Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr
def execute():
frappe.reload_doc("stock", "doctype", "manufacturer")
frappe.reload_doctype("Item")
for... | # Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr
def execute():
frappe.reload_doctype("Manufacturer")
frappe.reload_doctype("Item")
for d in frappe.db.... | agpl-3.0 | Python |
f2bec4c2c2bd2cb55a98a4aeda52a40781734086 | Add simple binary heap implementation | nitsas/py3datastructs | binary_heap.py | binary_heap.py | """
A simple binary heap implementation (using a list).
Operations:
- __len__
- insert
- pop
- peek
TODO:
- Add operations: heapify (maybe in __init__)
Author:
Christos Nitsas
(nitsas)
(chrisnitsas)
Language:
Python 3(.4)
Date:
November, 2014
"""
import operator
__all__ = ['BinaryHeap']
cl... | mit | Python | |
a8efd5e94c206a9bbaf4a523fda7513acc2afa7f | add test-room-list.py | freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut | tests/twisted/avahi/test-room-list.py | tests/twisted/avahi/test-room-list.py | from saluttest import exec_test
from avahitest import AvahiAnnouncer, AvahiListener
from avahitest import get_host_name
import avahi
from xmppstream import setup_stream_listener, connect_to_stream
from servicetest import make_channel_proxy
from twisted.words.xish import xpath, domish
import time
import dbus
CHANNE... | lgpl-2.1 | Python | |
81f9e6b245e81d653184579ca0c78b4d5559e715 | Create config-lite.py | pyreflos/RasPi-Rattle | config-lite.py | config-lite.py | ##
## User configuration file - edit these settings to suit your own project
##
file_path = '/home/pi/RPi-RTL/images/' ## path to save images
file_prefix = 'img_' ## prefix before timestamp.jpg, if needed - e.g. a project number
use_timestamp = True ## True = timestamp in filename, False = incremental numbering
| mit | Python | |
b0f112c6ab2a8860e9032adcccc4c90a4c43d5c3 | Create __init__.py | momotarou-zamurai/kibidango | maya/python/playblast/timeUnitConvasion/__init__.py | maya/python/playblast/timeUnitConvasion/__init__.py | mit | Python | ||
76ccb3e14da170000c8071203e931eeb8bc7c642 | Add a test case for deepcopy | AltSchool/dynamic-rest-client | tests/test_deepcopy.py | tests/test_deepcopy.py | from tests.models import (
Cat,
Location,
)
import copy
from rest_framework.test import APITestCase
class DeepcopyTestCase(APITestCase):
def test_cat(self):
home = Location(name='Home', blob='ILUVU')
papa = Cat(name='Papa')
kitkat = Cat(name='KitKat', home=home, parent=papa)
... | mit | Python | |
880a15054ab5fbc49afe2aafce584fd423e511fa | Define constants module | napalm-automation/napalm-iosxr,spotify/napalm,napalm-automation/napalm,spotify/napalm | napalm_iosxr/constants.py | napalm_iosxr/constants.py | """Constants for the IOS-XR driver."""
from __future__ import unicode_literals
from napalm_base.constants import * # noqa
SR_638170159_SOLVED = False
# this flag says if the Cisco TAC SR 638170159
# has been solved
#
# "XML Agent Does not retrieve correct BGP routes data"
# is a weird bug reported on 2016-02-22 22:... | apache-2.0 | Python | |
47d770c6008116dd72c6c6b4572a0a92faa39e66 | Add test file for update.py | CristianCantoro/sbntoolkit,CristianCantoro/sbntoolkit | test/test_update.py | test/test_update.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import logging
basedir = os.path.realpath('..')
if basedir not in sys.path:
sys.path.append(basedir)
import update as up
# logging
LOGFORMAT_STDOUT = {
logging.DEBUG: '%(module)s:%(funcName)s:%(lineno)s - '
'%(levelname)-... | mit | Python | |
7101dac32926e0f1403b44a93a6f5882a0aa5d2e | Create woc32p3.py | Chuck8521/LunchtimeBoredom,Chuck8521/LunchtimeBoredom,Chuck8521/LunchtimeBoredom | woc32p3.py | woc32p3.py | #!/bin/python3
import sys
def boolProd(m1, m2):
def circularWalk(n, s, t, r_0, g, seed, p):
# Complete this function
dist = []
boolMatrix = [[] for w in range(n)]
for w in range(n):
for e in range(n):
boolMatrix[w].append(0)
for q in range(n):
if q == 0:
... | mit | Python | |
97b933815dcbc179e25bc9c1c16cfa1153036ae1 | Add performance test for epsilon convolution | timqian/neurons,johannesmik/neurons | performance_tests/epsilon_convolution.py | performance_tests/epsilon_convolution.py | #!/usr/bin/python3
'''
Convolution
'''
from __future__ import print_function
import numpy as np
import cProfile
import random
import matplotlib.pyplot as plt
def eps(s, t_membran):
return np.exp(-s / t_membran)
def small_spiketrain():
# 1000 timesteps
# With 10 random spikes
s = np.array([0]*1000)
... | bsd-2-clause | Python | |
5e27bf30286265f6ce2ba82a8a2edbae2bb421ae | add tests | wyplay/pytracemalloc,wyplay/pytracemalloc | test_tracemalloc.py | test_tracemalloc.py | import os
import sys
import time
import tracemalloc
import unittest
EMPTY_STRING_SIZE = sys.getsizeof(b'')
def get_lineno():
frame = sys._getframe(1)
return frame.f_lineno
def allocate_bytes(size):
filename = __file__
lineno = get_lineno() + 1
data = b'x' * (size - EMPTY_STRING_SIZE)
return d... | mit | Python | |
fc3ac8ca281bccc2f50c9f1fdd9a16b0c8658a01 | Add GDP test | lab11/M-ulator,lab11/M-ulator,lab11/M-ulator,lab11/M-ulator,lab11/M-ulator,lab11/M-ulator,lab11/M-ulator | platforms/m3/programming/goc_gdp_test.py | platforms/m3/programming/goc_gdp_test.py | #!/usr/bin/env python2
import code
try:
import Image
except ImportError:
from PIL import Image
import gdp
gdp.gdp_init()
gcl_name = gdp.GDP_NAME("edu.umich.eecs.m3.test01")
gcl_handle = gdp.GDP_GCL(gcl_name, gdp.GDP_MODE_RA)
#j = Image.open('/tmp/capture1060.jpeg')
#d = {"data": j.tostring()}
#gcl_handle.append(... | apache-2.0 | Python | |
b3624916b29d25d1baec7c55da4cc7184e724812 | Add tests for LocalizedFieldsAdminMixin | SectorLabs/django-localized-fields,SectorLabs/django-localized-fields,SectorLabs/django-localized-fields | tests/test_admin.py | tests/test_admin.py | from django.apps import apps
from django.contrib import admin
from django.contrib.admin.checks import check_admin_app
from django.db import models
from django.test import TestCase
from localized_fields.fields import LocalizedField
from localized_fields.admin import LocalizedFieldsAdminMixin
from tests.fake_model impo... | mit | Python | |
cf090648a8c88b7f30eaa925358ff175cbcb976c | use dtype float32 | fzalkow/scikit-learn,tosolveit/scikit-learn,russel1237/scikit-learn,nmayorov/scikit-learn,BiaDarkia/scikit-learn,untom/scikit-learn,cybernet14/scikit-learn,madjelan/scikit-learn,MartinDelzant/scikit-learn,yunfeilu/scikit-learn,quheng/scikit-learn,glouppe/scikit-learn,etkirsch/scikit-learn,kagayakidan/scikit-learn,ephes... | examples/ensemble/plot_gradient_boosting_quantile.py | examples/ensemble/plot_gradient_boosting_quantile.py | """
=====================================================
Prediction Intervals for Gradient Boosting Regression
=====================================================
This example shows how quantile regression can be used
to create prediction intervals.
"""
import numpy as np
from sklearn.ensemble import GradientBoost... | """
=====================================================
Prediction Intervals for Gradient Boosting Regression
=====================================================
This example shows how quantile regression can be used
to create prediction intervals.
"""
import numpy as np
from sklearn.ensemble import GradientBoost... | bsd-3-clause | Python |
42347f1106f91cb68fe914c9ea05e0c24f46ee08 | add missing migration for langpack model | mozilla/zamboni,ddurst/zamboni,luckylavish/zamboni,luckylavish/zamboni,luckylavish/zamboni,tsl143/zamboni,diox/zamboni,washort/zamboni,elysium001/zamboni,ingenioustechie/zamboni,tsl143/zamboni,ingenioustechie/zamboni,mozilla/zamboni,ingenioustechie/zamboni,ddurst/zamboni,mozilla/zamboni,elysium001/zamboni,shahbaz17/zam... | mkt/langpacks/migrations/0002_auto_20150824_0820.py | mkt/langpacks/migrations/0002_auto_20150824_0820.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('langpacks', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='langpack',
name='la... | bsd-3-clause | Python | |
296ab4d527558a77cb635ea0754078c66bbd5462 | bump version to 1.0.0 pre | flatfox-ag/django-admin-sso,flatfox-ag/django-admin-sso,frog32/django-admin-sso,matthiask/django-admin-sso,allink/django-admin-sso,matthiask/django-admin-sso,diegobz/django-admin-sso,frog32/django-admin-sso,diegobz/django-admin-sso,allink/django-admin-sso | admin_sso/__init__.py | admin_sso/__init__.py | VERSION = (1, 0, 0, 'pre')
__version__ = '.'.join(map(str, VERSION))
# Do not use Django settings at module level as recommended
try:
from django.utils.functional import LazyObject
except ImportError:
pass
else:
class LazySettings(LazyObject):
def _setup(self):
from admin_sso import def... | VERSION = (0, 1, 3,)
__version__ = '.'.join(map(str, VERSION))
# Do not use Django settings at module level as recommended
try:
from django.utils.functional import LazyObject
except ImportError:
pass
else:
class LazySettings(LazyObject):
def _setup(self):
from admin_sso import default_s... | bsd-3-clause | Python |
394d8b1ebd14a0ad566e67a352085968126701c4 | Add test for object source marked down | t-miyamae/teuthology,ivotron/teuthology,zhouyuan/teuthology,dmick/teuthology,robbat2/teuthology,dreamhost/teuthology,yghannam/teuthology,t-miyamae/teuthology,dreamhost/teuthology,robbat2/teuthology,michaelsevilla/teuthology,ivotron/teuthology,tchaikov/teuthology,tchaikov/teuthology,michaelsevilla/teuthology,ceph/teutho... | teuthology/task/object_source_down.py | teuthology/task/object_source_down.py | import logging
import ceph_manager
from teuthology import misc as teuthology
import time
log = logging.getLogger(__name__)
def rados(remote, cmd):
log.info("rados %s" % ' '.join(cmd))
pre = [
'LD_LIBRARY_PATH=/tmp/cephtest/binary/usr/local/lib',
'/tmp/cephtest/enable-coredump',
'/tmp... | mit | Python | |
aa02a1ff3722b4ccb644daf4f5d57a0e01f5e9e2 | add make Data | mcvidomi/poim2motif | makeData.py | makeData.py | import random
import cPickle as pickle
from numpy import concatenate, ones, array, shape, size, zeros, exp, arange
from numpy import concatenate,ones,array,shape,size,zeros,exp
import numpy as np
import copy
import math
import pdb
dna = ['A', 'C', 'G', 'T']
def simulate_sequence(length):
sequence = ''
for i in... | mit | Python | |
d32058b6a6d3db162b79628cadc9fa061672a297 | Add django sync db after migrate if using south | jocke-l/blues,andreif/blues,5monkeys/blues,5monkeys/blues,gelbander/blues,5monkeys/blues,andreif/blues,Sportamore/blues,gelbander/blues,jocke-l/blues,chrippa/blues,adisbladis/blues,gelbander/blues,adisbladis/blues,chrippa/blues,jocke-l/blues,Sportamore/blues,chrippa/blues,Sportamore/blues,andreif/blues,adisbladis/blues | blues/django.py | blues/django.py | from fabric.context_managers import cd
from fabric.decorators import task, runs_once
from fabric.operations import prompt
from refabric.api import run, info
from refabric.context_managers import shell_env
from refabric.contrib import blueprints
from . import virtualenv
from .application.project import virtualenv_path... | from fabric.context_managers import cd
from fabric.decorators import task, runs_once
from fabric.operations import prompt
from refabric.api import run, info
from refabric.context_managers import shell_env
from refabric.contrib import blueprints
from . import virtualenv
from .application.project import virtualenv_path... | mit | Python |
60fa72f1d6c21eda46124db02f1907046f8e3cb4 | Add boot_switch.py | dhylands/upy-examples,dhylands/upy-examples | boot_switch.py | boot_switch.py | import pyb
sw = pyb.Switch()
# 1 - Red
# 2 - Green
# 3 - Yellow
# 4 - Blue
pyb.LED(2).off() # Turn Greem LED off since normal boot turns it on
led = pyb.LED(1)
leds = (pyb.LED(4), pyb.LED(3), pyb.LED(2))
try:
import boot_mode
persisted_mode = boot_mode.mode
mode = boot_mode.mode
except:
persisted_mode... | mit | Python | |
2bb33986002a1e1e5152b311662a200db717aa78 | change school object | rohitdatta/pepper,rohitdatta/pepper,rohitdatta/pepper | migrations/versions/2ae4701a60b4_.py | migrations/versions/2ae4701a60b4_.py | """empty message
Revision ID: 2ae4701a60b4
Revises: 013b5c571b68
Create Date: 2016-09-11 15:43:53.495932
"""
# revision identifiers, used by Alembic.
revision = '2ae4701a60b4'
down_revision = '013b5c571b68'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | agpl-3.0 | Python | |
855057d96d0335005c172c244de5f20d27e54907 | Create check_purefa_occpy.py | PureStorage-OpenConnect/python-scripts | check_purefa_occpy.py | check_purefa_occpy.py | #!/usr/bin/env python
# Copyright (c) 2018 Pure Storage, Inc.
#
## Overview
#
# This short Nagios/Icinga plugin code shows how to build a simple plugin to monitor Pure Storage FlashArrays.
# The Pure Storage Python REST Client is used to query the FlashArray occupancy indicators.
# Plugin leverages the remarkably help... | apache-2.0 | Python | |
f2693a72f99a2d414b7ee76d0f542535aa0d9ec0 | Remove debug prints | buhe/judge,buhe/judge,buhe/judge,DMOJ/judge,DMOJ/judge,buhe/judge,buhe/judge,buhe/judge,DMOJ/judge | checkers/rstripped.py | checkers/rstripped.py | def check(process_output, judge_output, **kwargs):
from itertools import izip
process_lines = process_output.split('\n')
judge_lines = judge_output.split('\n')
if 'filter_new_line' in kwargs:
process_lines = filter(None, process_lines)
judge_lines = filter(None, judge_lines)
if len(p... | def check(process_output, judge_output, **kwargs):
from itertools import izip
process_lines = process_output.split('\n')
judge_lines = judge_output.split('\n')
if 'filter_new_line' in kwargs:
process_lines = filter(None, process_lines)
judge_lines = filter(None, judge_lines)
print pr... | agpl-3.0 | Python |
9d24ced3ea0cc010bd210643ee57895624892ee2 | Create power10.py | rdpapworth/powerof10 | power10.py | power10.py | import pandas as pd
import requests
import time
import numpy as np
import itertools
from lxml import html
from lxml import etree
def get_p10_results(events, ages, sexes, years):
"""
Return a dictionary combining results returned for a given combination of
url parameters.
"""
# xpath patterns
... | mit | Python | |
143bd8066ed53f7a1f70664f89dfd7323aba8e57 | Create 07.py | ezralalonde/cloaked-octo-sansa | 02/qu/07.py | 02/qu/07.py | # Define a procedure, is_friend, that takes
# a string as its input, and returns a
# Boolean indicating if the input string
# is the name of a friend. Assume
# I am friends with everyone whose name
# starts with either 'D' or 'N', but no one
# else. You do not need to check for
# lower case 'd' or 'n'
def is_friend(na... | bsd-2-clause | Python | |
f7d15618c661f1e7f555ce9d9a12fdbc851e76c9 | fix handling of version | Calysto/octave_kernel,Calysto/octave_kernel | octave_kernel/_version.py | octave_kernel/_version.py | __version__ = '0.33.1'
| bsd-3-clause | Python | |
b7b088fc8e46376c8cb4608738c9dffcdb7d5dec | Add a test to verify filedes.subprocess.Popen()'s close_fds | fmoo/python-filedes,fmoo/python-filedes | tests/subprocess.py | tests/subprocess.py | from __future__ import absolute_import
from filedes.test.base import BaseFDTestCase
from filedes.subprocess import Popen
from filedes import get_open_fds
from subprocess import PIPE, STDOUT
import filedes
class SubprocessTests(BaseFDTestCase):
def testPopenCloseFds(self):
r, w = filedes.pipe()
t... | isc | Python | |
c2945bc741cea8213926e935d71d0c6281eadbd6 | reduce orbits to delays and notes | adrn/GalaxySynth | synthetic/orbitreducer.py | synthetic/orbitreducer.py | # coding: utf-8
""" Turn a collection of orbits into something we can make into music. """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Third-party
import numpy as np
from scipy.signal import argrelmin
__all__ = ['cyl_orbit_to_events', 'xyz_orbit_to_events']
def ... | mit | Python | |
be9d5ffc427c7303d6c85a091d2508021cc330dd | Add utility tests | blindstore/blindstore-old-scarab | tests/test_utils.py | tests/test_utils.py | import numpy as np
import scarab
from nose.tools import *
from common.utils import *
def test_binary():
a = binary(1, size=5)
assert_true(np.all(a == [0, 0, 0, 0, 1]))
a = binary(2, size=3)
assert_true(np.all(a == [0, 1, 0]))
def test_encrypt_index():
pk, sk = scarab.generate_pair()
c = encr... | mit | Python | |
32c32d38d1305b92bcda07efaadd3b29dbf4ac31 | add piling-up | EdisonCodeKeeper/hacker-rank,zeyuanxy/hacker-rank,EdisonAlgorithms/HackerRank,EdisonCodeKeeper/hacker-rank,EdisonAlgorithms/HackerRank,zeyuanxy/hacker-rank,EdisonCodeKeeper/hacker-rank,EdisonAlgorithms/HackerRank,zeyuanxy/hacker-rank,EdisonCodeKeeper/hacker-rank,EdisonCodeKeeper/hacker-rank,EdisonAlgorithms/HackerRank,... | python/containers/piling-up/piling-up.py | python/containers/piling-up/piling-up.py | from collections import deque
if __name__ == "__main__":
T = int(raw_input())
for _ in xrange(T):
n = int(raw_input())
sl = deque(map(int, raw_input().split()))
ans = []
while len(sl) > 0:
if sl[0] >= sl[-1]:
ans.append(sl[0])
sl.pople... | mit | Python | |
5c57882c74cf8dad132b255a285566c7329a1569 | add google reader starred python example | gunderjt/libZotero,gunderjt/libZotero,gunderjt/libZotero,gunderjt/libZotero | pythonexamples/addGoogleReaderStarred.py | pythonexamples/addGoogleReaderStarred.py | #!/usr/bin/python
import sys
sys.path.append('../lib/py') # unnecessary if libZotero is installed separately
import json
import time
import argparse
from libZotero import zotero
parser = argparse.ArgumentParser(description='Add starred items from google reader to your Zotero library.')
parser.add_argument('--library... | agpl-3.0 | Python | |
2e7252fab4667047c04b540040d5ad2287a73299 | Add management command to import geolocation data | rhertzog/parrainage,rhertzog/parrainage,rhertzog/parrainage | parrainage/app/management/commands/import_geoloc.py | parrainage/app/management/commands/import_geoloc.py | # Copyright 2017 Raphaël Hertzog
#
# This file is subject to the license terms in the LICENSE file found in
# the top-level directory of this distribution.
import argparse
from datetime import datetime
import csv
import logging
import sys
from django.core.management.base import BaseCommand
from django.db import trans... | mit | Python | |
3d7640a014d110f5600dc317b16585874934b3e7 | check updates for amazon linux | site24x7/plugins,site24x7/plugins,site24x7/plugins | check_updates_amazonlinux.py | check_updates_amazonlinux.py | #!/usr/bin/python
import subprocess,sys,json
METRIC_UNITS={'Available_Updates':'count','Security_Updates':'count'}
PLUGIN_VERSION="1"
HEARTBEAT="true"
class datacollector:
def __init__(self):
self.data={}
self.data['plugin_version']=PLUGIN_VERSION
self.data['heartbeat_required']=HEARTBEAT... | bsd-2-clause | Python | |
73bb34ad6e481f5ebcc3623d7f63af87986d3cc7 | Create new package. (#5642) | LLNL/spack,LLNL/spack,tmerrick1/spack,tmerrick1/spack,tmerrick1/spack,iulian787/spack,iulian787/spack,lgarren/spack,lgarren/spack,LLNL/spack,lgarren/spack,tmerrick1/spack,EmreAtes/spack,skosukhin/spack,iulian787/spack,matthiasdiener/spack,LLNL/spack,lgarren/spack,matthiasdiener/spack,iulian787/spack,krafczyk/spack,skos... | var/spack/repos/builtin/packages/r-affycomp/package.py | var/spack/repos/builtin/packages/r-affycomp/package.py | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python | |
2ea0f3c172f80e8ca5dc55d1ab6416707d4ba485 | Add motor configuration | labs127/typhoon,hiraq/typhoon,hiraq/typhoon,labs127/typhoon | core/mongo.py | core/mongo.py | from motor.motor_tornado import MotorClient
def mongo_configurations(config):
return MotorClient(config.get('MONGO_URI'))
| bsd-3-clause | Python | |
679b94772232e20095692361a43d48834ed383f3 | Create flight.py | vkmguy/Flights-and-Hotels,VIkramx89/Flights-and-Hotels | flight.py | flight.py | '''
Created on Aug 12, 2015
@author: sadhna01
'''
'''
Created on Aug 12, 2015
@author: sahil.singla01
'''
class Flight:
def __init__(self):
self.__flight_id=None
self.__flight_name=None
self.__source=None
self.__destination=None
self.__departure_time=None
self.__ar... | epl-1.0 | Python | |
be4abd8d3b54ab66f89c88e56cb948d5bf5f5725 | Add the static info gatherer | mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge | stoneridge_info_gatherer.py | stoneridge_info_gatherer.py | #!/usr/bin/env python
try:
import configparser
except ImportError:
import ConfigParser as configparser
import json
import os
import platform
import stoneridge
class StoneRidgeInfoGatherer(object):
def run(self):
info_file = os.path.join(stoneridge.bindir, 'application.ini')
cp = configpa... | mpl-2.0 | Python | |
daf6ef7990cb56c960f5099dcee5ebc93596dba0 | Add verifier | palcu/rotopcoder,palcu/rotopcoder | coliziune/verifier.py | coliziune/verifier.py | def verify(n, m, b, first, second):
s1, s2 = 0, 0
for i in range(len(first)):
s1 += (int(first[i]) + 1) * b ** (n-i)
s2 += (int(second[i]) + 1) * b ** (n-i)
return s1 % m == s2 % m
with open('coliziune.in') as fin, open('coliziune.out') as fout:
input_lines = fin.readlines()[1:]
out... | mit | Python | |
3dfe72a6da11e8223a66e86fabf67146e1d4cb1f | Add base error type for user code | diyan/falcon_seed | app/common/errors.py | app/common/errors.py | from __future__ import unicode_literals, absolute_import, division
class BaseAppError(Exception):
pass
| mit | Python | |
f8373cefae048b8d60db06d9527c45375d49549e | Add locust test script. | IrimieBogdan/cloud-controller,IrimieBogdan/cloud-controller | testing/cloudControllerLocustTester.py | testing/cloudControllerLocustTester.py | from locust import HttpLocust, TaskSet, task
class WebsiteTasks(TaskSet):
@task
def index(self):
self.client.get("/service")
class WebsiteUser(HttpLocust):
task_set = WebsiteTasks
min_wait = 1000
max_wait = 1000
| apache-2.0 | Python | |
85c6aad62db7c7c5daa47eff871fbd1483c8dff9 | Add a gdb viewer for skbitmap. | google/skia,rubenvb/skia,HalCanary/skia-hc,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,google/skia,HalCanary/skia-hc,rubenvb/skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,google/skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,google/sk... | tools/gdb/bitmap.py | tools/gdb/bitmap.py | # Copyright 2017 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Visualize bitmaps in gdb.
(gdb) source <path to this file>
(gdb) sk_bitmap <symbol>
This should pop up a window with the bitmap displayed.
Right clicking should bring up a menu, al... | bsd-3-clause | Python | |
5a2394f8445350387adc30dd5bc818971aefc91d | Add work for Exercise 25. | jaredmanning/learning,jaredmanning/learning | lpthw/ex25.py | lpthw/ex25.py | def break_words(stuff):
"""This function will brea up words for us."""
words = stuff.split(' ')
return words
def sort_words(words):
"""Sorts the words."""
return sorted(words)
def print_first_word(words):
"""Prints the first word after popping it off."""
word = words.pop(0)
print word
... | mit | Python | |
f8e78cdf12142b214f7f6513dc858abffc133789 | add test suite for issues and bugs | colinhiggs/pyramid-jsonapi,colinhiggs/pyramid-jsonapi | test_project/test_project/test_bugs.py | test_project/test_project/test_bugs.py | import unittest
import transaction
import testing.postgresql
import webtest
import urllib
from pyramid.paster import get_app
from sqlalchemy import create_engine
from .models import (
DBSession,
Base
)
from . import test_data
class TestBugs(unittest.TestCase):
'''Tests for issues.
https://github.com... | agpl-3.0 | Python | |
98a50ad5cbcf6239d9ebcecb13d99e6078c93668 | add plot file | DaMSL/K3,DaMSL/K3 | tools/scripts/mosaic/plots/plot_all.py | tools/scripts/mosaic/plots/plot_all.py | #!/usr/bin/env python
# Plot the output of process-all-latencies.rb
import matplotlib.pyplot as plt
import argparse
import yaml
import os
queries = ['1', '3', '4', '6', '11a', '12', '17']
nodes = [1, 4, 8, 16, 31]
scale_factors = [0.1, 1, 10, 100]
tuple_sizes = {0.1: 8 * 10**5, 1: 8 * 10**6, 10: 8 * 10**7, 100: 8*10... | apache-2.0 | Python | |
650b0db8f27f90d1092ffd4295ec154c33f25cde | test commit | butyesbutno/pyappium | pid.py | pid.py | #!/usr/bin/env python
#coding: utf-8
import jpype,time,os
#开启JVM,且指定jar包位置
jarpath = os.path.join(os.path.abspath('.'), '/work/appiumframework/apps/')
print(jarpath, jpype.getDefaultJVMPath())
jpype.startJVM(jpype.getDefaultJVMPath(), "-ea", "-Djava.ext.dirs=%s" % jarpath)
print("toe he")
#引入java程序中的类.路径应该是项目中的packa... | apache-2.0 | Python | |
abab11646518f78019d44542c277cadfbb354c1a | add computation of temperature within a season | akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem | scripts/feature/temperature_in_season.py | scripts/feature/temperature_in_season.py | import psycopg2
import numpy
import datetime
COOP = psycopg2.connect(database='coop', host='iemdb', user='nobody')
cursor = COOP.cursor()
# 50 to 120
in_summer = numpy.zeros( (70,))
counts = numpy.zeros( (70,))
in_jja = numpy.zeros( (70,))
cofreq = numpy.zeros( (70,))
for year in range(1893,2013):
cursor.execute(... | mit | Python | |
6e62c6e65376c890adb4c3f56159ba8cc857d565 | Create new_file.py | kneeks/pull-request-demonstration,rmanzano-sps/pull-request-demonstration,is210-faculty/pull-request-demonstration,rmanzano-sps/pull-request-demonstration,is210-faculty/pull-request-demonstration,kneeks/pull-request-demonstration | new_file.py | new_file.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A new file"""
print 'New files rule!'
| mpl-2.0 | Python | |
9cd2eb451f14656668953db13acff7911047bf9f | Add a tool to be able to diff sln files | witwall/gyp,witwall/gyp,witwall/gyp,witwall/gyp,witwall/gyp | tools/pretty_sln.py | tools/pretty_sln.py | #!/usr/bin/python2.5
# Copyright 2009 Google Inc.
# All Rights Reserved.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependencies.
Then it outputs a possible build order.
"""
__author__ = 'nsylvain (Nicolas Sylvain)'
import re
... | bsd-3-clause | Python | |
ef56a72b73bd408bb51d235b2274eef8766e0277 | add simple watch_notify stress test | t-miyamae/teuthology,caibo2014/teuthology,dreamhost/teuthology,SUSE/teuthology,michaelsevilla/teuthology,ceph/teuthology,t-miyamae/teuthology,SUSE/teuthology,ceph/teuthology,tchaikov/teuthology,robbat2/teuthology,robbat2/teuthology,ktdreyer/teuthology,SUSE/teuthology,dmick/teuthology,zhouyuan/teuthology,michaelsevilla/... | teuthology/task/watch_notify_stress.py | teuthology/task/watch_notify_stress.py | import contextlib
import logging
from ..orchestra import run
log = logging.getLogger(__name__)
@contextlib.contextmanager
def task(ctx, config):
"""
Run test_stress_watch
The config should be as follows:
test_stress_watch:
clients: [client list]
example:
tasks:
- ceph:
- t... | mit | Python | |
1c68c6b3da5677ce0847eb563bfea0ed3d8810a0 | add language detection tween (from PATH_INFO) | silenius/amnesia,silenius/amnesia,silenius/amnesia | amnesia/translations/tweens.py | amnesia/translations/tweens.py | # -*- coding: utf-8 -*-
def path_info_lang_tween_factory(handler, registry):
def path_info_lang_tween(request):
if not hasattr(request, '_LOCALE_'):
if request.path_info_peek() in ('en', 'fr'):
lang = request.path_info_pop()
else:
lang = 'en'
... | bsd-2-clause | Python | |
38d340c2a866a445160393029fa3b0c07131818a | Create test-tport.py | arienchen/pytibrv | test/python/test-tport.py | test/python/test-tport.py | import os
import sys
from tibrv.tport import *
from tibrv.status import *
from tibrv.tport import *
import unittest
class TransportTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
status = Tibrv.open()
if status != TIBRV_OK:
raise TibrvError(status)
@classmethod
... | bsd-3-clause | Python | |
b45b425414da5fc65f171b6f81c5983aade98fb6 | Add run.py | UNH-CORE/RM2-tow-tank | run.py | run.py | # -*- coding: utf-8 -*-
"""
This script generates all the relevant figures from the experiment.
"""
from Modules.processing import *
from Modules.plotting import *
def main():
save = True
savetype = ".pdf"
plot_perf_curves(save=save, savetype=savetype)
plot_perf_re_dep(save=save, savetype=savetype, e... | mit | Python | |
103f1fe13a8a807a0bfc93df5e4b1a17281e28b4 | Create tool instance and run from command line | BakeCode/performance-testing,BakeCode/performance-testing | run.py | run.py | #!/usr/bin/env python
from performance_testing.command_line import Tool
def main():
tool = Tool(config='config.yml', output_directory='result')
tool.run()
if __name__ == '__main__':
main()
| mit | Python | |
0700ce9be37ada187105c5f38983092b6bba9762 | Test new backend methods | automl/auto-sklearn,automl/auto-sklearn,hmendozap/auto-sklearn,hmendozap/auto-sklearn | test/util/test_backend.py | test/util/test_backend.py | # -*- encoding: utf-8 -*-
from __future__ import print_function
import unittest
import mock
from autosklearn.util.backend import Backend
class BackendModelsTest(unittest.TestCase):
class BackendStub(Backend):
def __init__(self, model_directory):
self.__class__ = Backend
self.get_... | bsd-3-clause | Python | |
faffa1c83e599730105f1fe38b253aafb2b00d18 | Add headerimage tests | ZeitOnline/zeit.content.cp,ZeitOnline/zeit.content.cp | src/zeit/content/cp/browser/blocks/tests/test_headerimage.py | src/zeit/content/cp/browser/blocks/tests/test_headerimage.py | import zeit.cms.testing
import zeit.content.cp
import zeit.content.cp.centerpage
class TestHeaderImage(zeit.cms.testing.BrowserTestCase):
layer = zeit.content.cp.testing.ZCML_LAYER
def setUp(self):
super(TestHeaderImage, self).setUp()
with zeit.cms.testing.site(self.getRootFolder()):
... | bsd-3-clause | Python | |
bdd532cccf504dc9fbf21a9e72b8185dc910ec94 | Add management command for running the task for validating all data catalogs. | sunlightlabs/thezombies,sunlightlabs/thezombies,sunlightlabs/thezombies,sunlightlabs/thezombies | thezombies/management/commands/validate_all_data_catalogs.py | thezombies/management/commands/validate_all_data_catalogs.py | from django.core.management.base import NoArgsCommand
from thezombies.tasks.main import validate_data_catalogs
class Command(NoArgsCommand):
"""Validate all of the agency data catalogs"""
def handle_noargs(self):
validator_group = validate_data_catalogs.delay()
self.stdout.write(u"\nSpawned d... | bsd-3-clause | Python | |
0dbc7432bf78850dee10b8d814b1d9eb74fa5afc | add test wing defender play | RoboJackets/robocup-software,RoboJackets/robocup-software,RoboJackets/robocup-software,RoboJackets/robocup-software | soccer/gameplay/plays/testing/test_wing_defender.py | soccer/gameplay/plays/testing/test_wing_defender.py | import play
import behavior
import constants
import robocup
import tactics.positions.wing_defender
import main
class TestWingDefender(play.Play):
def __init__(self):
super().__init__(continuous=True)
self.add_transition(behavior.Behavior.State.start,
behavior.Behavior.S... | apache-2.0 | Python | |
a2086c9c5c11586b04ca934bdad838babad087ee | add a mk-wof-config utility script | whosonfirst/go-whosonfirst-pip,whosonfirst/go-whosonfirst-pip,whosonfirst/go-whosonfirst-pip | utils/mk-wof-config.py | utils/mk-wof-config.py | #!/usr/bin/env python
import sys
import os
import json
import random
import logging
import socket
import mapzen.whosonfirst.placetypes
if __name__ == '__main__':
import optparse
opt_parser = optparse.OptionParser()
opt_parser.add_option('-w', '--wof', dest='wof', action='store', default=None, help='The... | bsd-3-clause | Python | |
0fb8dec880b7a48002929fc54c6e337be63afa05 | Add missing manage.py | uw-it-aca/spacescout_web,uw-it-aca/spacescout_web,uw-it-aca/spacescout_web | travis_ci/manage.py | travis_ci/manage.py | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "travis_ci.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| apache-2.0 | Python | |
24e14b7d53e43f1574971ff5b6eee6d0185df23a | Add tests for retrieving/updating reverse fks | sehmaschine/django-rest-framework,qsorix/django-rest-framework,lubomir/django-rest-framework,nhorelik/django-rest-framework,James1345/django-rest-framework,canassa/django-rest-framework,yiyocx/django-rest-framework,thedrow/django-rest-framework-1,vstoykov/django-rest-framework,qsorix/django-rest-framework,jpulec/django... | rest_framework/tests/nested_relations.py | rest_framework/tests/nested_relations.py | from copy import deepcopy
from django.db import models
from django.test import TestCase
from rest_framework import serializers
# ForeignKey
class ForeignKeyTarget(models.Model):
name = models.CharField(max_length=100)
class ForeignKeySource(models.Model):
name = models.CharField(max_length=100)
target ... | bsd-2-clause | Python | |
78fa851ffa6a9594dbbd41a6d572674552d76c85 | Install constants file. | Renelvon/txrudp,OpenBazaar/txrudp,jorik041/txrudp | txrudp/constants.py | txrudp/constants.py | """Constants governing operation of txrudp package."""
# [bytes]
UDP_SAFE_PACKET_SIZE = 1000
# [length]
WINDOW_SIZE = 65535 // UDP_SAFE_PACKET_SIZE
# [seconds]
TIMEOUT = 0.7
# [seconds]
_MAX_PACKET_DELAY = 20
# If a packet is retransmitted more than that many times,
# the connection should be considered broken.
MA... | mit | Python | |
9d550e9403560a84a75aad55a91ca661fcef7957 | Implement a hook for Issue #41 | gratipay/aspen.py,gratipay/aspen.py | aspen/hooks/options200.py | aspen/hooks/options200.py |
from aspen import Response
def hook(request):
"""A hook to return 200 to an 'OPTIONS *' request"""
if request.line.method == "OPTIONS" and request.line.uri == "*":
raise Response(200)
return request
| mit | Python | |
632b3530f6b04d82bc66299d34137d3a76fb8f90 | add a test for only loading N items parameter | AmeliaKnows/libgreader,askedrelic/libgreader,smurfix/librssreader | tests/test_special_feeds.py | tests/test_special_feeds.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
libG(oogle)Reader
Copyright (C) 2010 Matt Behrens <askedrelic@gmail.com> http://asktherelic.com
Python library for working with the unofficial Google Reader API.
Unit tests for feeds. Requires mechanize for automated oauth authenication.
"""
try:
import unitte... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
libG(oogle)Reader
Copyright (C) 2010 Matt Behrens <askedrelic@gmail.com> http://asktherelic.com
Python library for working with the unofficial Google Reader API.
Unit tests for feeds. Requires mechanize for automated oauth authenication.
"""
try:
import unitte... | mit | Python |
8ee78c14af3b9974ad96cf85f6ea32c4e254f958 | Add calcurse-dateutil | lfos/calcurse,lfos/calcurse,lfos/calcurse | contrib/calcurse-dateutil.py | contrib/calcurse-dateutil.py | #!/usr/bin/env python3
import argparse
import datetime
def get_date(s):
return datetime.datetime.strptime(s, '%Y-%m-%d').date()
parser = argparse.ArgumentParser('calcurse-dateutil')
parser.add_argument('--date', type=get_date, action='store', dest='date')
parser.add_argument('--range', type=int, action='store'... | bsd-2-clause | Python | |
bbf1e1532ef1827c808c60fe8f7459a438789aaf | work on csv collection | SMAPPNYU/smappdragon | smappdragon/collection/csv_collection.py | smappdragon/collection/csv_collection.py | import os
import unicodecsv
from smappdragon.tools.tweet_parser import TweetParser
from smappdragon.collection.base_collection import BaseCollection
class CsvCollection(BaseCollection):
'''
method that tells us how to
create the CsvCollection object
'''
def __init__(self, filepath):
... | mit | Python | |
755f6f701c5bef733531c33da2b1a0918a9f84dc | add daemonize | turbidsoul/tsutil | tsutil/daemonize.py | tsutil/daemonize.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Turbidsoul Chen
# @Date: 2014-03-07 17:11:20
# @Last Modified by: Turbidsoul Chen
# @Last Modified time: 2014-07-16 15:52:49
import os
import sys
def daemonize(stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'):
try:
pid = os.fork()
... | mit | Python | |
aeb633ae76f2ffe0e927a3230e1ad456891c9afc | add chart networth endpoint | Mesitis/community | sample-code/Python/get_chart_networth.py | sample-code/Python/get_chart_networth.py | '''
- login and get token
- process 2FA if 2FA is setup for this account
- if the user is a regular customer then get cashflow chart data for this user
- if the user is a partner_admin then get a cashflow chart data for the first user from the list of users this partner admin has access to
'''
import requests
import j... | mit | Python | |
e8235b10c610aae51213e8f090e3bf692f99adcc | Add the cbtf-lanl spack build package. cbtf-lanl is LANLs contribution to the CBTF project. It contains psTool and memTool which are example tools, showing use case examples for CBTF. | lgarren/spack,skosukhin/spack,krafczyk/spack,matthiasdiener/spack,EmreAtes/spack,krafczyk/spack,mfherbst/spack,tmerrick1/spack,TheTimmy/spack,mfherbst/spack,lgarren/spack,matthiasdiener/spack,LLNL/spack,TheTimmy/spack,TheTimmy/spack,mfherbst/spack,lgarren/spack,EmreAtes/spack,iulian787/spack,krafczyk/spack,matthiasdien... | var/spack/packages/cbtf-lanl/package.py | var/spack/packages/cbtf-lanl/package.py | ################################################################################
# Copyright (c) 2015 Krell Institute. All Rights Reserved.
#
# 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; eith... | lgpl-2.1 | Python | |
e3842cfbdfbf5c28e70916080fe4ce1ffad7c75c | Add bleu-score calculator | m1cr0man/OneLineWonders,m1cr0man/OneLineWonders | CA4011/bleu-score.py | CA4011/bleu-score.py | print((lambda n,p,t,r:min(1,len(t)/len(r))*__import__(math).pow(p(n,t,r,1)*p(n,t,r,2)*p(n,t,r,3)*p(n,t,r,4),0.25))(lambda s,l:[s[i:i+l]for i in range(len(s)-l+1)],lambda n,t,r,s:(lambda T,R:sum([g in R and(R.remove(g)or 1)for g in T])/len(T)if len(T+R)else 1)([.join(x)for x in n(t,s)],[.join(x)for x in n(r,s)]),print(E... | mit | Python | |
adbe1d4f06028ba13e21386f7d62939d4b2eb740 | Add PatchELF package | matthiasdiener/spack,mfherbst/spack,krafczyk/spack,mfherbst/spack,tmerrick1/spack,tmerrick1/spack,tmerrick1/spack,iulian787/spack,matthiasdiener/spack,matthiasdiener/spack,LLNL/spack,matthiasdiener/spack,skosukhin/spack,skosukhin/spack,mfherbst/spack,krafczyk/spack,tmerrick1/spack,LLNL/spack,lgarren/spack,skosukhin/spa... | var/spack/packages/patchelf/package.py | var/spack/packages/patchelf/package.py | from spack import *
class Patchelf(Package):
"""PatchELF is a small utility to modify the dynamic linker and RPATH of ELF executables."""
homepage = "https://nixos.org/patchelf.html"
url = "http://nixos.org/releases/patchelf/patchelf-0.8/patchelf-0.8.tar.gz"
list_url = "http://nixos.org/releases/... | lgpl-2.1 | Python | |
b4d6fc7ed10bb7e424797aaa8bcfff8ad738cd97 | Add __init__ file to permit import as module | mcs07/ChemSpiPy | __init__.py | __init__.py | mit | Python | ||
195eba54a45e8d841e1e9574938bef1d2440eb06 | Create __init__.py | CSIRTUK/TekDefense-Automater | __init__.py | __init__.py | mit | Python | ||
2124026b3b6468789f599a2bc5382e69e3d27310 | Add __main__.py | jaronoff97/play_as_one,jaronoff97/play_as_one,jaronoff97/play_as_one | __main__.py | __main__.py | #! usr/bin/env python2
import PlayAsOne
if __name__ == '__main__':
PlayAsOne.PlayAsOne()
| mit | Python | |
b46e223340ecb4c4056eb89fa08aaff64fceaa09 | Add command | RaitoBezarius/mangaki,Mako-kun/mangaki,Elarnon/mangaki,RaitoBezarius/mangaki,Mako-kun/mangaki,Elarnon/mangaki,RaitoBezarius/mangaki,Mako-kun/mangaki,Elarnon/mangaki | mangaki/mangaki/management/commands/findneighbors.py | mangaki/mangaki/management/commands/findneighbors.py | from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from mangaki.models import Neighborship, Rating
from collections import Counter
class Command(BaseCommand):
args = ''
help = ''
def handle(self, *args, **options):
values = {'like': 2, 'dis... | agpl-3.0 | Python | |
7627d58460c3683e51f944e49dc9ab31c8beda06 | Create default_gateway_checker.py | msenin94/mk-post-deployment-checks,msenin94/salt-mk-verificator,legan4ik/mk-post-deployment-checks | mk-verificator/networking/default_gateway_checker.py | mk-verificator/networking/default_gateway_checker.py | #!/usr/bin/env python
import json
import salt.client as client
def main():
local = client.LocalClient()
netstat_info = local.cmd('*', 'cmd.run', ['ip r | sed -n 1p'])
# {node:"default via 10.xxx.xxx.xxx dev ethx", }
groups = {}
for node_name, node_gw in netstat_info.items():
group_na... | bsd-2-clause | Python | |
12c50dbac8179b92272136c512e034f6782027df | Introduce a GlobalStack class | fieldOfView/Cura,fieldOfView/Cura,Curahelper/Cura,hmflash/Cura,ynotstartups/Wanhao,hmflash/Cura,Curahelper/Cura,ynotstartups/Wanhao | cura/Settings/GlobalStack.py | cura/Settings/GlobalStack.py | # Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
from UM.Settings.ContainerStack import ContainerStack
from UM.Settings.ContainerRegistry import ContainerRegistry
class CannotSetNextStackError(Exception):
pas... | agpl-3.0 | Python | |
f5ef5c2a986d56495069c7ccad5e56fb097ea17b | Create t.py | zjs81/Chain_Coin_Master_Node_Admin_Tool,zjs81/Chain_Coin_Master_Node_Admin_Tool | t.py | t.py | from appJar import gui
import sys
keyfilename = ""
keyfileinuse = False
port = sys.argv[4]
ip = sys.argv[1]
username = sys.argv[2]
password = sys.argv[3]
#The stuff above takes args from login.py
balance = 0
#Gets balance
app = gui("HODLER ADMIN", "400x200")
app.setFont(10)
app.addLabelOptionBox("Options", ["File","... | mit | Python | |
5439a712f1f33117561ca0448d8a88ff53ec8979 | Add initial spin_fort test (#5658) | dtee/PokemonGo-Bot,goedzo/PokemonGo-Bot,halsafar/PokemonGo-Bot,halsafar/PokemonGo-Bot,heihachi/PokemonGo-Bot,dtee/PokemonGo-Bot,goedzo/PokemonGo-Bot,DBa2016/PokemonGo-Bot,heihachi/PokemonGo-Bot,DBa2016/PokemonGo-Bot,halsafar/PokemonGo-Bot,Gobberwart/PokemonGo-Bot,Gobberwart/PokemonGo-Bot,dtee/PokemonGo-Bot,DBa2016/Poke... | pokemongo_bot/test/spin_fort_test.py | pokemongo_bot/test/spin_fort_test.py | import os
import pickle
import unittest
from mock import MagicMock, patch
from pokemongo_bot.cell_workers.spin_fort import SpinFort
from pokemongo_bot.inventory import Items
config = {
"spin_wait_min": 0,
"spin_wait_max": 0,
"daily_spin_limit": 100,
}
response_dict = {'responses':
{'FORT_SEARCH': {
... | mit | Python | |
0eeff1ec1498f98d624dad90a60d24ab44cc31de | Fix cleanvcf.py when handling chromosome changes Arvados-DCO-1.1-Signed-off-by: Jiayong Li <jli@curii.com> refs #14992 | curoverse/l7g,curoverse/l7g,curoverse/l7g,curoverse/l7g,curoverse/l7g,curoverse/l7g,curoverse/l7g | cwl-version/preprocess/gvcf/filterclean/src/cleanvcf.py | cwl-version/preprocess/gvcf/filterclean/src/cleanvcf.py | #!/usr/bin/env python
from __future__ import print_function
import sys
def is_header(line):
"""Check if a line is header."""
return line.startswith('#')
# FIELD index
# CHROM 0, POS 1, REF 3
def main():
previous_CHROM = ""
previous_end_POS = 0
for line in sys.stdin:
if not is_header(li... | #!/usr/bin/env python
from __future__ import print_function
import sys
def is_header(line):
"""Check if a line is header."""
return line.startswith('#')
# FIELD index
# CHROM 0, POS 1, REF 3
def main():
previous_CHROM = ""
previous_end_POS = 0
for line in sys.stdin:
if not is_header(li... | agpl-3.0 | Python |
d2c26cdfb9077aa5e3e8f9a5e2b89c8085bdd2d9 | Create RLU_back_propagation.py | rupertsmall/machine-learning,rupertsmall/machine-learning | Neural-Networks/RLU_back_propagation.py | Neural-Networks/RLU_back_propagation.py | # back propagation algorithm
from numpy import *
def back_propagation(y, A, MEGA_THETA, xi):
# assume y, A, xi are 1-D column vectors (row-less)
# assume MEGA_THETA is 2-D array
# define useful constants
L = size(xi)
a = A[-xi[-1]:][:, newaxis]
delta = a - y[:, newaxis]
DIM = shape(MEGA_THETA)
DELTA = zero... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.