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 |
|---|---|---|---|---|---|---|---|---|
5e13e3bc045d496232e5ced6b7dc314f14183257 | Create a copy of the Netgen reader example and add some statistics calculation. | jonancm/viennagrid-python,jonancm/viennagrid-python,jonancm/viennagrid-python | doc/examples/viennagrid_wrapper/io_stats.py | doc/examples/viennagrid_wrapper/io_stats.py | #!/usr/bin/env python
#
# This example shows is like the readers and writers example ('io.py'),
# but this one also calculates some statistics on the elapsed time, the
# number of vertices an cells read, etc.
from __future__ import print_function
# In this example, we will set up a domain of triangles in the cartesi... | mit | Python | |
a40f0115892719d1a41e658fcdd20ec1473356f1 | Add stub study ix | hecanjog/pattern.studies | study.ix.py | study.ix.py | from pippi import dsp, tune
from hcj import fx
out = ''
dsp.write(out, 'study.ix')
| cc0-1.0 | Python | |
e64e6327a156cfd72cf629fc05d480e45b2a6e57 | Add __init__.py to page_sets | aosp-mirror/platform_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,rubenvb/skia,HalCanary/skia-hc,HalCanary/skia-hc,rubenvb/skia,HalCanary/skia-hc,rubenvb/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/pl... | tools/skp/page_sets/__init__.py | tools/skp/page_sets/__init__.py | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
| bsd-3-clause | Python | |
c0a408759b887006cd09f0ea9f366336b2322fe8 | add new email API file | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | api/email.py | api/email.py | """
Atmosphere api email
"""
from django.utils.timezone import datetime
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from libcloud.common.types import InvalidCredsError
from threepio import logger
from authentication.decorators import api_au... | apache-2.0 | Python | |
2805967f5bf36ee24362e20587eb394c7398753d | add impression call for python | intuit/wasabi,intuit/wasabi,intuit/wasabi,intuit/wasabi,intuit/wasabi,intuit/wasabi | modules/ui/app/resources/samplecode/python/impression.py | modules/ui/app/resources/samplecode/python/impression.py | import requests
import json
def get_impression(application, experiment, user):
"""
Records an impression for the given user and experiment.
Args:
application: the application the experiment runs in
experiment: the running experiment for which the impression should be recorded
user... | apache-2.0 | Python | |
355aabf2e975b50f552ff2599bb7909d8f63c614 | Create machine.py | trevorwitter/Stats | machine.py | machine.py | def split_data(data, prob):
"""split data into fractions[prob, 1 - prob]"""
results = [], []
for row in data:
results[0 if random.random() < prob else 1]. append(row)
return results
| mit | Python | |
04312795ddc93b5e005d6c1615ff801534ba7457 | Add test capturing failure. Ref #1697. | cherrypy/cherrypy,Safihre/cherrypy,Safihre/cherrypy,cherrypy/cherrypy | cherrypy/test/test_plugins.py | cherrypy/test/test_plugins.py | from cherrypy.process import plugins
__metaclass__ = type
class TestAutoreloader:
def test_file_for_file_module_when_None(self):
"""No error when module.__file__ is None.
"""
class test_module:
__file__ = None
assert plugins.Autoreloader._file_for_file_module(test_mo... | bsd-3-clause | Python | |
e1bef44be34efd637bc2acdaf71f01b5d77deaec | Add demo case storage integration | openego/eDisGo,openego/eDisGo | edisgo/flex_opt/storage_integration.py | edisgo/flex_opt/storage_integration.py | from edisgo.grid.components import Storage, Line
from edisgo.grid.tools import select_cable
import logging
def integrate_storage(network, position, operation):
"""
Integrate storage units in the grid and specify its operational mode
Parameters
----------
network: :class:`~.grid.network.Network`
... | agpl-3.0 | Python | |
e81e2f1f0a4fef0b767368981aceddbc03036be7 | create template filters which return the download/view count for a LR ID | MiltosD/CEF-ELRC,JuliBakagianni/META-SHARE,JuliBakagianni/META-SHARE,JuliBakagianni/META-SHARE,JuliBakagianni/META-SHARE,JuliBakagianni/CEF-ELRC,MiltosD/CEF-ELRC,MiltosD/CEFELRC,MiltosD/CEF-ELRC,MiltosD/CEFELRC,JuliBakagianni/CEF-ELRC,MiltosD/CEFELRC,zeehio/META-SHARE,JuliBakagianni/CEF-ELRC,MiltosD/CEFELRC,MiltosD/CEF... | metashare/repository/templatetags/resource_access_stats.py | metashare/repository/templatetags/resource_access_stats.py | """
Project: META-SHARE
Author: Christian Spurk <cspurk@dfki.de>
"""
from django import template
from metashare.repository import model_utils
from metashare.stats.model_utils import DOWNLOAD_STAT, VIEW_STAT
# module level "register" variable as required by Django
register = template.Library()
def get_download_cou... | bsd-3-clause | Python | |
ca702a03c4470931e974cf36ffd8a7a03efdcef4 | move plot_results up | alito/deep_q_rl,alito/deep_q_rl | plot_results.py | plot_results.py | """Plots data corresponding to Figure 2 in
Playing Atari with Deep Reinforcement Learning
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis
Antonoglou, Daan Wierstra, Martin Riedmiller
"""
import sys, os
import logging
import numpy as np
import matplotlib.pyplot as plt
DefaultTrainedEpoch = 10... | bsd-3-clause | Python | |
ff9cbbac188f78ed33cb2f650a32777713911384 | Add small demo for a monochrome GST pipeline | TheImagingSource/tiscamera,TheImagingSource/tiscamera,TheImagingSource/tiscamera,TheImagingSource/tiscamera | examples/python/monochrome_pipeline.py | examples/python/monochrome_pipeline.py | import gst
import gobject
import os
VIDEODEVICE = "/dev/video1"
WIDTH = 1280
HEIGHT = 960
FRAMERATE = "15/1"
try:
import psutil
except ImportError:
psutil = None
def show_resources_cb (*args):
process = psutil.Process(os.getpid())
if getattr(process, "memory_info"):
print ("Resource usage: %d... | apache-2.0 | Python | |
d488afb6416072f9d6557ab19a02487f3666c38c | Tidy up some python | TheTedHogan/shakitz-fantasy-football,TheTedHogan/shakitz-fantasy-football,TheTedHogan/shakitz-fantasy-football,ishakir/shakitz-fantasy-football,ishakir/shakitz-fantasy-football,ishakir/shakitz-fantasy-football,TheTedHogan/shakitz-fantasy-football,ishakir/shakitz-fantasy-football | python/footbawwlapi/__init__.py | python/footbawwlapi/__init__.py | import json
import nflgame
from footbawwlapi.game import Game
def create_all_players(host, port, year, kind, game_weeks):
games = []
for week in game_weeks:
for game in nflgame.games(year, week = week, kind = kind):
games.append(Game(game, week))
if not games:
raise RuntimeError("Couldn't find an... | import json
import nflgame
from footbawwlapi.game import Game
def create_all_players(host, port, year, kind, game_weeks):
games = []
for week in game_weeks:
print year
print week
print kind
for game in nflgame.games(year, week = week, kind = kind):
games.append(Game(game, week))
if not ga... | epl-1.0 | Python |
bab230c0d6debd6b1ab2c521f21d133841c1a7f5 | add a test for simple rnn | nebw/keras,keras-team/keras,kuza55/keras,kemaswill/keras,DeepGnosis/keras,relh/keras,keras-team/keras,dolaameng/keras,daviddiazvico/keras | tests/keras/layers/test_simplernn.py | tests/keras/layers/test_simplernn.py | import theano
import unittest
from numpy.testing import assert_allclose
import numpy as np
from keras.layers.recurrent import SimpleRNN
from mock import Mock
floatX = theano.config.floatX
__author__ = "Jeff Ye"
class TestSimpleRNN(unittest.TestCase):
left_padding_data = np.array(
[
[ # batc... | apache-2.0 | Python | |
62b77547179fb7b480f433efed874731efa81ae7 | Add to_video.py | zhaipro/misc,zhaipro/misc | to_video.py | to_video.py | import os
import sys
import cv2
def to_video(ipath, ofn):
writer = None
ifns = os.listdir(ipath)
ifns.sort()
for ifn in ifns:
ifn = os.path.join(ipath, ifn)
frame = cv2.imread(ifn)
if not writer:
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
h, w, _ = frame.... | mit | Python | |
eaef37130b4978f9aaf741cfa0f4926d72a29744 | add ID3 | luanjunyi/simple-ml | tree/id3.py | tree/id3.py | from collections import defaultdict
import numpy as np
import pandas as pd
class ID3(object):
def __init__(self):
pass
def fit(self, X, y):
self.root_ = self.build_node(X, y, set(range(X.shape[1])), range(X.shape[0]))
def predict_prob(self, X):
return [self.predict_one_prob(self.root_, x) for x in ... | mit | Python | |
d287286cd14752fd3f3feddfc8a4fb64f3b21872 | Add migration | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | readthedocs/builds/migrations/0007_add-automation-rules.py | readthedocs/builds/migrations/0007_add-automation-rules.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-02-28 16:10
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
('projects', '0040_increa... | mit | Python | |
5972c05015c96b1b4b9195a687cf09dab036363a | Add resources tests. | m110/grafcli,m110/grafcli | tests/test_resources.py | tests/test_resources.py | #!/usr/bin/python3
import os
import sys
import unittest
LIB_PATH = os.path.dirname(os.path.realpath(__file__)) + '/../'
CONFIG_PATH = os.path.join(LIB_PATH, 'grafcli.example.conf')
sys.path.append(LIB_PATH)
from grafcli.config import load_config
load_config(CONFIG_PATH)
from grafcli.resources import Resources
from ... | mit | Python | |
57d657344fcfe0c4df477fc1d7caad75d6f0b125 | test the shipment properties and shipment functions from the order object | mollie/mollie-api-python | tests/test_shipments.py | tests/test_shipments.py | from mollie.api.objects.order import Order
from mollie.api.objects.order_line import OrderLine
from mollie.api.objects.shipment import Shipment
from .utils import assert_list_object
ORDER_ID = 'ord_kEn1PlbGa'
SHIPMENT_ID = 'shp_3wmsgCJN4U'
def test_get_shipment(client, response):
"""Retrieve a single shipment b... | bsd-2-clause | Python | |
870ed1b76209b8850f300842a67416c4a69523e3 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/9e718d5cacc5ec4964120a626a851af2798c2322. | tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,paolodedios/tensorf... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "9e718d5cacc5ec4964120a626a851af2798c2322"
TFRT_SHA256 = "aa53d5bec70c1d029b803b279995... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "38f4f5c359ecb321cfd3a085f930dd71a7f620ab"
TFRT_SHA256 = "0cf2a09389a0271a8433a6642b5a... | apache-2.0 | Python |
dbf1c4d098ffa180c8fa6564f5ad909e198a03c3 | Add servo lib | DreamN/Smart-Tollbooth,DreamN/Smart-Tollbooth,DreamN/Smart-Tollbooth,DreamN/Smart-Tollbooth | servo.py | servo.py | #################################################################
## SERVO LIB for SMART TOLLBOOTH PROJECT ##
#################################################################
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
SERVO = 17
GPIO.setup(SERVO, GPIO.OUT)
def moveDeg(i):
va... | mit | Python | |
251590eda4c373a4be2f6690633873392ce5c86c | implement a customized CLA model that can enable/disable TP/SP learning | ywcui1990/nupic.research,mrcslws/htmresearch,ywcui1990/htmresearch,chanceraine/nupic.research,ywcui1990/htmresearch,ywcui1990/htmresearch,ywcui1990/htmresearch,cogmission/nupic.research,numenta/htmresearch,neuroidss/nupic.research,ThomasMiconi/htmresearch,numenta/htmresearch,BoltzmannBrain/nupic.research,BoltzmannBrain... | sequence_prediction/continuous_sequence/clamodel_custom.py | sequence_prediction/continuous_sequence/clamodel_custom.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 | Python | |
b5a210fac3941298fdf9160948c2cc73c27bfccd | add missing module electrum_plugins | fyookball/electrum,FairCoinTeam/electrum-fair,procrasti/electrum,dabura667/electrum,asfin/electrum,dashpay/electrum-dash,argentumproject/electrum-arg,protonn/Electrum-Cash,spesmilo/electrum,vertcoin/electrum-vtc,fyookball/electrum,FairCoinTeam/electrum-fair,fujicoin/electrum-fjc,aasiutin/electrum,kyuupichan/electrum,da... | setup.py | setup.py | #!/usr/bin/env python2
# python setup.py sdist --format=zip,gztar
from setuptools import setup
import os
import sys
import platform
import imp
version = imp.load_source('version', 'lib/version.py')
if sys.version_info[:3] < (2, 7, 0):
sys.exit("Error: Electrum requires Python version >= 2.7.0...")
data_files =... | #!/usr/bin/env python2
# python setup.py sdist --format=zip,gztar
from setuptools import setup
import os
import sys
import platform
import imp
version = imp.load_source('version', 'lib/version.py')
if sys.version_info[:3] < (2, 7, 0):
sys.exit("Error: Electrum requires Python version >= 2.7.0...")
data_files =... | mit | Python |
60bc275a7c45278ffe9269abf2c1191a73df9d40 | add setup.py (#6) | pinkblock/rotoscoping,pinkblock/rotoscoping | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name='rotoscoping',
version='1.0',
description="Take in pics swap faces and make'm pretty",
author='Seith Miller',
author_email='seithmiller@gmail.com',
url='https://www.seithmiller.com/',
packages=['rotoscoping'],
)... | mit | Python | |
01d21e43cedd191c57e3d505d9f308185012bdef | Remove power metric from jsgamebench benchmark | bright-sparks/chromium-spacewalk,ltilve/chromium,Chilledheart/chromium,bright-sparks/chromium-spacewalk,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,dednal/chromium.src,hgl8... | tools/perf/benchmarks/jsgamebench.py | tools/perf/benchmarks/jsgamebench.py | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs Facebook's JSGameBench benchmark."""
import os
from telemetry import test
from telemetry.page import page_measurement
from telemetry.page impor... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs Facebook's JSGameBench benchmark."""
import os
from metrics import power
from telemetry import test
from telemetry.page import page_measurement... | bsd-3-clause | Python |
9ee46e93aca97f69a2ad75a2b9b2db52196bfcba | Create trumpbot.py | WebBreacher/trumpdroidretweeter,WebBreacher/trumpdroidretweeter | trumpbot.py | trumpbot.py | #!/usr/bin/python
'''
Author : Micah Hoffman (@WebBreacher)
Description : Trump Retweeting Bot that retweets Android-sourced tweets.
'''
# Import Libraries
import re
import tweepy
from creds import *
# Set up temp file for most recent tweet id
tweetHistoryFile = open('/tmp/trumpbot_lasttweet', 'r+')
last_twee... | mit | Python | |
67a295d10df752b3a4d932efa9e9750d60273c09 | add script to index streams from a video | Ziggeo/ZiggeoPythonSdk,Ziggeo/ZiggeoPythonSdk | demos/stream_index.py | demos/stream_index.py | import sys
from Ziggeo import Ziggeo
import json
if(len(sys.argv) < 4):
print ("Error\n")
print ("Usage: $>python stream_index.py YOUR_API_TOKEN YOUR_PRIVATE_KEY VIDEO_TOKEN \n")
sys.exit()
api_token = sys.argv[1]
private_key = sys.argv[2]
video_token = sys.argv[3]
ziggeo = Ziggeo(api_token, private_key)
print ... | apache-2.0 | Python | |
906196a28fecab43ec6e33e3517c7159f66a0a52 | Add init | userzimmermann/robotframework-python3,Senseg/robotframework,userzimmermann/robotframework-python3,Senseg/robotframework,Senseg/robotframework,userzimmermann/robotframework-python3,userzimmermann/robotframework-python3,Senseg/robotframework,Senseg/robotframework,userzimmermann/robotframework-python3 | src/robot/result/__init__.py | src/robot/result/__init__.py | # Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 | Python | |
841c79ca1e8850eda140bc09fc889dd693ecd5f6 | Add setup.py so pylogmet can be installed | locke105/pylogmet | setup.py | setup.py | import setuptools
setuptools.setup(
name='pylogmet',
version='0.1.0',
packages=setuptools.find_packages(),
)
| apache-2.0 | Python | |
9c88998a5d40f623e1c98006492393d3b2ad718a | add initial unit test skeleton | Kraymer/beets,jackwilsdon/beets,xsteadfastx/beets,sampsyo/beets,MyTunesFreeMusic/privacy-policy,pkess/beets,artemutin/beets,sampsyo/beets,artemutin/beets,xsteadfastx/beets,madmouser1/beets,madmouser1/beets,lengtche/beets,MyTunesFreeMusic/privacy-policy,artemutin/beets,jackwilsdon/beets,shamangeorge/beets,shamangeorge/b... | test/test_discogs.py | test/test_discogs.py | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... | mit | Python | |
99a71ccd5ed1282a86bca7535a31ec949afa71bf | Create tulkinta.py | taloprojekti/SP2017,taloprojekti/SP2017 | tulkinta.py | tulkinta.py | import setup
import lampotila
def lukuohjelma():
import lukuohjelma
lukuohjelma.main()
def fav():
fav = setup.Tfav()
return fav
def Tmin():
Tmin = setup.Tmin()
return Tmin
def Tmax():
Tmax = setup.Tmax()
return Tmax
def delta():
delta = lampotila.delta()
return delta
def hintadelta((year - 2000), mon... | mit | Python | |
06bb72423587d37c86f46a9f298c9c4f36805543 | copy and pasted some sections of chatbot to a new module, trainbot | corinnelhh/chatbot,corinnelhh/chatbot | trainbot.py | trainbot.py | class Trainbot(object):
def __init__(self, training_file="tell_tale_heart.txt"):
self.training_file = training_file
self.tri_lexicon = {}
self.bi_lexicon = {}
self.stop_puncts = ['.', '!', '?']
self.puncts = [',', ';', ':', '"', "'", '-', '--', ",?", '."']
def parse_trai... | mit | Python | |
08a6dddb866ec53ff45a302d7c163d041bbefe71 | Add stub unit test for options resolving | deffi/protoplot | protoplot-test/test_options_resolving.py | protoplot-test/test_options_resolving.py | import unittest
from protoplot.engine.item import Item
from protoplot.engine.item_container import ItemContainer
class Series(Item):
pass
Series.options.register("color", True)
Series.options.register("lineWidth", False)
Series.options.register("lineStyle", False)
class TestOptionsResolving(unittest.TestCase):... | agpl-3.0 | Python | |
983bf009012e69ed703302fc02aef32bd33a6f12 | add timings | simomarsili/ndd | utils/timings.py | utils/timings.py | # -*- coding: utf-8 -*-
"""Measure execution average execution times"""
import cProfile
import time
import numpy as np
from numpy.random import dirichlet, multinomial
from scipy.stats import entropy as sp_entropy
import ndd
import ndd.fnsb # pylint: disable=no-name-in-module, import-error
R = 200 # number of repet... | bsd-3-clause | Python | |
60d57f24a76976d82de37fda40d3a081cc497e72 | add setup.py. | avidal/django-pyodbc,javrasya/django-pyodbc-azure,michiya/django-pyodbc-azure,avidal/django-pyodbc | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name='sql_server.pyodbc',
version='1.0',
description='Django MS SQL Server backends using pyodbc',
author='django-pyodbc team',
url='http://code.google.com/p/django-pyodbc',
packages=['sql_server', 'sql_server.pyodbc',... | bsd-3-clause | Python | |
93fea6b7553e1098707e87259f60ce08ec841d85 | add setup.py | rishubil/sqlalchemy-fulltext-search | setup.py | setup.py | """
SQLAlchemy FullText Search
"""
from setuptools import setup, Command
setup(
name='SQLAlchemy-FullText-Search',
version='0.1',
url='https://github.com/mengzhuo/sqlalchemy-fulltext-search',
license='BSD',
author='Meng Zhuo',
author_email='mengzhuo1203@gmail.com',
... | mit | Python | |
fc9a1aaa11fb45ba1acf898a351455beb13e5066 | Update django and python version in classifiers | coddingtonbear/django-mailbox,ad-m/django-mailbox | setup.py | setup.py | from setuptools import find_packages, setup
from django_mailbox import __version__ as version_string
tests_require = [
'django',
'mock',
'unittest2',
]
gmail_oauth2_require = [
'python-social-auth',
]
setup(
name='django-mailbox',
version=version_string,
url='http://github.com/coddington... | from setuptools import find_packages, setup
from django_mailbox import __version__ as version_string
tests_require = [
'django',
'mock',
'unittest2',
]
gmail_oauth2_require = [
'python-social-auth',
]
setup(
name='django-mailbox',
version=version_string,
url='http://github.com/coddington... | mit | Python |
bd4556dcd663f78aaa50d247e198e8e2d7604d52 | Add a setup.py file to ease setuptools installation, thanks Ariel Nunez | e-loue/django-oauth-plus | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='django-oauth',
version='0.1',
description='Support of OAuth in Django.',
author='David Larlet',
author_email='david@larlet.fr',
url='http://code.welldev.org/django-oauth/',
packages=find_packages(),
classifiers=[
'Develop... | bsd-3-clause | Python | |
f8a22b7f58b29031adf23a9b91748ccc0909d141 | Add 'setup.py' #3 | 7pairs/toggl2html,7pairs/toggl2html | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import find_packages, setup
from toggl2html import __version__
setup(
name='toggl2html',
version=__version__,
description='Tools for converting Toggl CSV to HTML',
author='Jun-ya HASEBA',
author_email='7pairs@gmail.com',
url='http://seven-pairs.hatenab... | apache-2.0 | Python | |
d2f6bf7a0ee1e3387d007b39832ef61b49a5c9c4 | Add config | authmillenon/wakefs | wakefs/config.py | wakefs/config.py | import ConfigParser, os.path
class Config(object):
_configfile = os.path.expanduser('~/.wakefs/config')
def __new__(type, *args):
if not '_the_instance' in type.__dict__:
type._the_instance = object.__new__(type)
return type._the_instance
def __init__(self,configfile=None):
... | mit | Python | |
21ccfab04b57e71af706648fac6d6d01fa2b8500 | add setup file | Hyperyon/p3-labyrinthe | setup.py | setup.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import labyrinth
with open('requirements.txt') as f:
requires = f.read().split('\n')
setup(
name='oc-labyrinth',
version=3.2,
packages=find_packages(),
install_requires=requires,
author='Nico Zh... | mit | Python | |
b81d7c8d54caf4e334e1cbe550223d9c112a6de5 | Add setup.py file for doing pip installs | qdot/np-telegram-bot,qdot/np-telegram-bot | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name='np-telegram-bot',
version='0.1',
description='NP Labs Telegram Bot Base Code',
author='Kyle Machulis',
author_email='kyle@machul.is',
url='https://github.com/qdot/np-telegram-bot/',
packages=["nptelegrambot"]
)... | bsd-3-clause | Python | |
cc40de21219934e50a840305bc9416b71e9eb2ed | add bominn.py | choznerol/c4lab-git-tutorial | exercise-1_from-pull-to-push/bominn.py | exercise-1_from-pull-to-push/bominn.py | print('bomin')
| mit | Python | |
585c9b6f1c8bf186fee34303ba29b7b511c1ba7e | Add a script to add mapit area IDs to new Place objects for 2013 | geoffkilpin/pombola,patricmutwiri/pombola,hzj123/56th,hzj123/56th,hzj123/56th,ken-muturi/pombola,ken-muturi/pombola,patricmutwiri/pombola,geoffkilpin/pombola,patricmutwiri/pombola,hzj123/56th,mysociety/pombola,hzj123/56th,ken-muturi/pombola,geoffkilpin/pombola,patricmutwiri/pombola,ken-muturi/pombola,patricmutwiri/pomb... | mzalendo/core/management/commands/core_match_places_to_mapit_areas_2013.py | mzalendo/core/management/commands/core_match_places_to_mapit_areas_2013.py | import sys
from optparse import make_option
from pprint import pprint
from django.core.management.base import NoArgsCommand
from django.template.defaultfilters import slugify
from django.conf import settings
# from helpers import geocode
from core import models
from mapit import models as mapit_models
class Command... | agpl-3.0 | Python | |
f107494d841ffd9adeecc49014e9334c98279385 | Make author name ASCII | s0undt3ch/powerline,firebitsbr/powerline,DoctorJellyface/powerline,cyrixhero/powerline,QuLogic/powerline,darac/powerline,xfumihiro/powerline,kenrachynski/powerline,dragon788/powerline,wfscheper/powerline,EricSB/powerline,xxxhycl2010/powerline,DoctorJellyface/powerline,IvanAli/powerline,keelerm84/powerline,DoctorJellyfa... | setup.py | setup.py | #!/usr/bin/env python
# vim:fileencoding=utf-8:noet
from __future__ import unicode_literals
import os
import sys
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.rst'), 'rb').read().decode('utf-8')
except IOError:
README = ''... | #!/usr/bin/env python
# vim:fileencoding=utf-8:noet
from __future__ import unicode_literals
import os
import sys
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.rst'), 'rb').read().decode('utf-8')
except IOError:
README = ''... | mit | Python |
1836748476be53b7a65a5a07ae900837e0283298 | Add Django 1.9 to setup.py | keimlink/django-cms,jsma/django-cms,jproffitt/django-cms,evildmp/django-cms,netzkolchose/django-cms,yakky/django-cms,mkoistinen/django-cms,bittner/django-cms,bittner/django-cms,jsma/django-cms,divio/django-cms,evildmp/django-cms,jsma/django-cms,FinalAngel/django-cms,rsalmaso/django-cms,FinalAngel/django-cms,timgraham/d... | setup.py | setup.py | from setuptools import setup, find_packages
import os
import cms
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independ... | from setuptools import setup, find_packages
import os
import cms
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independ... | bsd-3-clause | Python |
b5767a9dbc90e8252ca0885212f33df08a5a3e66 | Create setup.py | tuxerr/IA | setup.py | setup.py | import sys
from cx_Freeze import setup, Executable
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup(
name = "IA",
version = "0.1",
description = "IA",
options = {"build_exe" : {"includes" : ["atexit","re"],"include_files":["resources"]}},
executables = [Exec... | mit | Python | |
c82062bced242d0aa4675f2a66620c99149dfb63 | bump to dev version | phpdude/django-markitup,zsiciarz/django-markitup,carljm/django-markitup,dustinfarris/django-markitup,rvasilev/django-markitup-widget,senturio/django-markitup,WimpyAnalytics/django-markitup,senturio/django-markitup,zsiciarz/django-markitup,Pyha/django-markitup-py3.3,carljm/django-markitup,phpdude/django-markitup,WimpyAn... | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='django-markitup',
version='0.3.1dev',
description='Django integration with the MarkItUp universal markup editor',
long_description=open('README.txt').read(),
author='Carl Meyer',
author_email='carl@dirtcircle.com',
url='http://bitbuc... | from setuptools import setup, find_packages
setup(
name='django-markitup',
version='0.3.0',
description='Django integration with the MarkItUp universal markup editor',
long_description=open('README.txt').read(),
author='Carl Meyer',
author_email='carl@dirtcircle.com',
url='http://bitbucket... | bsd-3-clause | Python |
aa0839cb8f26d2b80e53e2dec41ddcd4a66003f4 | Update setup.py | gschizas/praw,gschizas/praw,praw-dev/praw,praw-dev/praw | setup.py | setup.py | """praw setup.py"""
import re
from codecs import open
from os import path
from setuptools import find_packages, setup
PACKAGE_NAME = "praw"
HERE = path.abspath(path.dirname(__file__))
with open(path.join(HERE, "README.rst"), encoding="utf-8") as fp:
README = fp.read()
with open(path.join(HERE, PACKAGE_NAME, "con... | """praw setup.py"""
import re
from codecs import open
from os import path
from setuptools import find_packages, setup
PACKAGE_NAME = "praw"
HERE = path.abspath(path.dirname(__file__))
with open(path.join(HERE, "README.rst"), encoding="utf-8") as fp:
README = fp.read()
with open(path.join(HERE, PACKAGE_NAME, "con... | bsd-2-clause | Python |
a84d2abc0f601df0d889ea08dee8ba88593f401d | Create setup.py | fnielsen/emocapper | setup.py | setup.py | """Installation and setup configuration."""
from setuptools import setup
setup(
name='emocapper',
description="Installation and setup configuration",
py_modules=['emocapper'],
entry_points={
'console_scripts': [
'emocapper = emocapper:main',
],
},
)
| bsd-3-clause | Python | |
fe68f04fe89e50183cd413ae8833a487bc9bd0d0 | Define random walk traversal | peplin/trinity | stats/random_walk.py | stats/random_walk.py | import neo4j
import random
from logbook import Logger
log = Logger('trinity.topics')
DEFAULT_DEPTH = 5
NUM_WALKS = 100
# Passed sorted list (desc order), return top nodes
TO_RETURN = lambda x: x[:10]
random.seed()
def random_walk(graph, node, depth=DEFAULT_DEPTH):
# Pick random neighbor
neighbors = {}
i... | mit | Python | |
24db3e122ffa68cf64738ffd6fd2f6ef1a51142b | add setup.py | googleapis/synthtool,googleapis/synthtool,googleapis/synthtool,googleapis/synthtool,googleapis/synthtool | setup.py | setup.py | # Copyright 2018 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 | |
e1a38a3085b5381b5f61a3aeb5d0fdf6fff80502 | add setup.py visual.py | what-studio/gauge | setup.py | setup.py | # -*- coding: utf-8 -*-
"""
"""
from __future__ import with_statement
import re
from setuptools import setup
from setuptools.command.test import test
# detect the current version
with open('gauge.py') as f:
version = re.search(r'__version__\s*=\s*\'(.+?)\'', f.read()).group(1)
assert version
# use pytest instea... | bsd-3-clause | Python | |
93504c41694501ef815dc0caf894e381a15140ae | Add an example REPL | asmeurer/iterm2-tools | example_repl.py | example_repl.py | #!/usr/bin/env python
from __future__ import print_function
import sys
if sys.version_info < (3,):
input = raw_input
from iterm2_tools.shell_integration import Prompt, Output
def run_command(text):
if text:
print("I got the text", text)
return 1 if ' ' in text else 0
if __name__ == '__main__':
... | mit | Python | |
be37775945e92deea028d0dbc6b7e28fe96de400 | add setup.py | mrocklin/multipolyfit | setup.py | setup.py | from os.path import exists
from setuptools import setup
setup(name='multipolyfit',
version='0.0.1',
description='Multivariate Polynomial fitting with NumPy',
url='http://github.com/mrocklin/multipolyfit',
author='Matthew Rocklin',
author_email='mrocklin@gmail.com',
license='BSD',
... | bsd-3-clause | Python | |
36f6a591333d6e9a6d216abff7db3b5353129ee4 | Add a install script. | supertask/KSUFucker,supertask/KSUFucker,supertask/KSUFucker,supertask/KSUHack,supertask/KSUHack,supertask/KSUFucker,supertask/KSUHack,supertask/KSUFucker | install_pages.py | install_pages.py | from datetime import date
import subprocess
"""
g0947064
http://www.cse.kyoto-su.ac.jp/~g0947343/webcom/
"""
#student_type_dict = {"g": "B", "i": "M"} # B=Bachelor, M=Master
def get_year(grade, date_today):
"""Estimates a year from grade using a date.
example:
today -> 2016
1,2,3,4 -> 2016,2... | mit | Python | |
2b7536f3919d77a7c7a815f895a10221f547ddc0 | Add setup.py | jhlegarreta/ITKCuberille,thewtex/ITKCuberille,thewtex/ITKCuberille,InsightSoftwareConsortium/ITKCuberille,jhlegarreta/ITKCuberille,jhlegarreta/ITKCuberille,thewtex/ITKCuberille,InsightSoftwareConsortium/ITKCuberille,InsightSoftwareConsortium/ITKCuberille | setup.py | setup.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from os import sys
try:
from skbuild import setup
except ImportError:
print('scikit-build is required to build from source.', file=sys.stderr)
print('Please run:', file=sys.stderr)
print('', file=sys.stderr)
print(' python -m pip instal... | apache-2.0 | Python | |
3930398eab788a045bdd3f960ef0b1515b6bcf3e | Add views to display list of current projects accepted in the program. | SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange | app/soc/modules/gsoc/views/projects_list.py | app/soc/modules/gsoc/views/projects_list.py | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange 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 required by applic... | apache-2.0 | Python | |
458a98b3c70d5990f8e8c5b4e412342a58ac31bf | Create setup.py | alunmorgan/testing_integration | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name="integration_testing",
author = "Alun Morgan",
version = "0.1",
packages = find_packages(),
install_requires = ['numpy'],
)
#
| apache-2.0 | Python | |
e8c8fde695803320096d58a6b8103210d566f2b0 | Add whitelist for the threading module (#150) | jendrikseipp/vulture,jendrikseipp/vulture | vulture/whitelists/threading_whitelist.py | vulture/whitelists/threading_whitelist.py | import threading
threading.Thread.daemon
threading.Thread.name
threading.Thread.run
| mit | Python | |
4f95d4d73fc9823aa59737fbebc81373ff3694dc | Create setup.py | mthbernardes/tempMail | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='tempMail',
version='1.0',
url='https://github.com/mthbernardes/tempMail',
license='MIT License',
author='Matheus Bernardes',
author_email='mthbernardes@gmail.com',
keywords='email temporary',
description=u'Module to gener... | mit | Python | |
34ff26caef5c67eb603179a631db69ab527b494b | Complete bencoding encode/decode methods | dionyziz/downpour | bencoding.py | bencoding.py | def decode( data ):
def decode_one( data ):
if data[ 0 ] == 'i':
# data is an integer
pos = data.index( 'e' )
return ( int( data[ 1:pos ] ), data[ ( pos + 1 ): ] )
if data[ 0 ] == 'l':
# data is a list
data = data[ 1: ]
l = []
... | mit | Python | |
6fc950932e4af5428b323cacb82eb5c6b89b1a68 | Add a gallery example showing individual basic geometric symbols (#1211) | GenericMappingTools/gmt-python,GenericMappingTools/gmt-python | examples/gallery/symbols/basic_symbols.py | examples/gallery/symbols/basic_symbols.py | """
Basic geometric symbols
-----------------------
The :meth:`pygmt.Figure.plot` method can plot individual geometric symbols
by passing the corresponding shortcuts to the ``style`` parameter. The 14 basic
geometric symbols are shown underneath their corresponding shortcut codes.
Four symbols (**-**, **+**, **x** and... | bsd-3-clause | Python | |
4989c443b9a247c784ad7b0e9a76df59358825a2 | Add iaas manager and also some logic to choose the provider | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/integrations/iaas/manager.py | dbaas/integrations/iaas/manager.py | from cloudstack.cloudstack_client import CloudStackProvider
from cloudstack.models import PlanAttr
from pre_provisioned.pre_provisioned_client import PreProvisionedProvider
import logging
LOG = logging.getLogger(__name__)
class IaaSManager():
def __init__(self, plan, environment):
LOG.info("IaaS man... | bsd-3-clause | Python | |
596535209e4d48e18ed9e471b22c97d74d24155f | Create base_script.py | diesendruck/utils,diesendruck/utils | base_script.py | base_script.py | import argparse
import os
from datetime import datetime
from pathlib import Path
def argparse():
parser = argparse.ArgumentParser()
parser.add_argument('--input', type=str, default='')
parser.add_argument('--output_dir', type=str, default='output')
args = parser.parse_args()
return args
def main(args):
pa... | mit | Python | |
5fba93a26b6f09c20391ec18b281def2bd851650 | Add test for semantics of for-loop that optimisation can break. | SungEun-Steve-Kim/test-mp,Vogtinator/micropython,turbinenreiter/micropython,HenrikSolver/micropython,drrk/micropython,alex-march/micropython,pozetroninc/micropython,blmorris/micropython,dmazzella/micropython,kerneltask/micropython,Timmenem/micropython,adamkh/micropython,adamkh/micropython,heisewangluo/micropython,infin... | tests/basics/for3.py | tests/basics/for3.py | # test assigning to iterator within the loop
for i in range(2):
print(i)
i = 2
# test assigning to range parameter within the loop
# (since we optimise for loops, this needs checking, currently it fails)
#n = 2
#for i in range(n):
# print(i)
# n = 0
| mit | Python | |
10bc476eee20270d0cda93cded5c808d38c90b16 | Add ConfigData class module | corerd/PyDomo,corerd/PyDomo,corerd/PyDomo,corerd/PyDomo | utils/configdataload.py | utils/configdataload.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2015 Corrado Ubezio
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including w... | mit | Python | |
86312f5f7ee0f26e5b94c37b7d12ff9826c92de6 | Create intNotLikeOthers.py | NendoTaka/CodeForReference,NendoTaka/CodeForReference,NendoTaka/CodeForReference | Codingame/Python/Clash/intNotLikeOthers.py | Codingame/Python/Clash/intNotLikeOthers.py | import sys
import math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
numbers = [int(x) for x in input().split()]
u = 0
d = 0
for x in numbers:
if x >= 0:
u += 1
else:
d += 1
if u == 1:
for x in numbers:
if x >= 0:
... | mit | Python | |
7888ec20f67a8c708608b16e2c86b23993e3648a | add bulls-and-cows | zeyuanxy/leet-code,zeyuanxy/leet-code,EdisonAlgorithms/LeetCode,EdisonAlgorithms/LeetCode,zeyuanxy/leet-code,EdisonAlgorithms/LeetCode | vol6/bulls-and-cows/bulls-and-cows.py | vol6/bulls-and-cows/bulls-and-cows.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Zeyuan Shang
# @Date: 2015-10-30 20:10:42
# @Last Modified by: Zeyuan Shang
# @Last Modified time: 2015-10-30 20:10:47
class Solution(object):
def getHint(self, secret, guess):
"""
:type secret: str
:type guess: str
:rtype:... | mit | Python | |
08a3317d577e0ee5dfa07f8a81b7a4a018297b4a | Create a script to parse .mat and write .csv file | ToniRV/Learning-to-navigate-without-a-map,ToniRV/Learning-to-navigate-without-a-map | dstar-lite/scripts/python_pipe.py | dstar-lite/scripts/python_pipe.py |
import csv
import numpy as np
import scipy.io as sio
def process_gridworld_data(input, imsize):
# run training from input matlab data file, and save test data prediction in output file
# load data from Matlab file, including
# im_data: flattened images
# state_data: concatenated one-hot vectors for each stat... | mit | Python | |
83e036f3d89c4b3956bde006085becb496a1fb6e | Add python / sklearn comparison script | jlas/ml.q | dbscan/test.py | dbscan/test.py | '''
Generate dummy data, and compare output from scikit-learn's DBSCAN.
Example code based on:
http://scikit-learn.org/stable/auto_examples/cluster/plot_dbscan.html#sphx-glr-auto-examples-cluster-plot-dbscan-py
Run with pytest, e.g.:
py.test test.py
'''
import os
import shutil
import subprocess
from sklearn.... | mit | Python | |
bc39c5fe7537bebcee478903e6890f4b9bab8b77 | delete unit tests | miguelgrinberg/slam | tests/test_delete.py | tests/test_delete.py | import mock
import unittest
import botocore
from slam import cli
from .test_deploy import config, describe_stacks_response
class DeleteTests(unittest.TestCase):
@mock.patch('slam.cli.boto3.client')
@mock.patch('slam.cli._load_config', return_value=config)
def test_delete(self, _load_config, client):
... | mit | Python | |
311f1e73768015419564991a773137f9e3555467 | Create disorderly_escape.py | hirenvasani/foobar | disorderly_escape.py | disorderly_escape.py | '''
Challenge 5.1
Disorderly Escape
=================
Oh no! You've managed to free the bunny prisoners and escape Commander Lambdas exploding space station, but her team of elite starfighters has flanked your ship. If you dont jump to hyperspace, and fast, youll be shot out of the sky!
Problem is, to avoid detection... | mit | Python | |
31e5950b35545b293247d2979678b2b6c7c7864c | Create the test file | jwg4/fringe_search,jwg4/fringe_search,jwg4/fringe_search | tests/test_fringe.py | tests/test_fringe.py | import unittest
import ctypes
class TestBranch(unittest.TestCase):
def setUpClass(cls):
cls.obj = ctypes.CDLL("obj/fringe13.o")
def test_object(self):
self.assertIsNotNone(self.obj)
| mit | Python | |
fe6d4383a942eb85e3062f35f5b6d073d92b1cc2 | Add unit test for tuning estimations | SUSE/smdba,SUSE/smdba | tests/test_pgtune.py | tests/test_pgtune.py | # coding: utf-8
"""
Test suite for PgTune.
"""
from unittest.mock import MagicMock, patch
import pytest
import smdba.postgresqlgate
class TestPgTune:
"""
Test PgTune class.
"""
def test_estimate(self):
"""
Test estimation.
:return:
"""
popen = MagicMock()
... | mit | Python | |
ec9b55a830c2d09d5836d5fb5c6c0c9b0bb67574 | Add test for polycs | Effective-Quadratures/Effective-Quadratures,psesh/Effective-Quadratures | tests/test_polycs.py | tests/test_polycs.py | from unittest import TestCase
import unittest
from equadratures import *
import numpy as np
class TestPolycs(TestCase):
def test_simple2D(self):
d = 5
param = Parameter(distribution='Uniform', lower=-1, upper=1., order=1)
myParameters = [param for _ in range(d)]
def f(x):
... | lgpl-2.1 | Python | |
d8d2ef931c5883dd1a04e563ebb67b381af6f541 | Add teuthology.config, the start of a better system | tchaikov/teuthology,ivotron/teuthology,ceph/teuthology,robbat2/teuthology,yghannam/teuthology,ktdreyer/teuthology,ivotron/teuthology,t-miyamae/teuthology,caibo2014/teuthology,dmick/teuthology,robbat2/teuthology,caibo2014/teuthology,dmick/teuthology,dreamhost/teuthology,yghannam/teuthology,t-miyamae/teuthology,tchaikov/... | teuthology/config.py | teuthology/config.py | #!/usr/bin/env python
import os
import yaml
import logging
CONF_FILE = os.path.join(os.environ['HOME'], '.teuthology.yaml')
log = logging.getLogger(__name__)
class _Config(object):
def __init__(self):
self.__conf = {}
if not os.path.exists(CONF_FILE):
log.debug("%s not found", CONF_F... | mit | Python | |
89b1790a5b12a90d03d09280f92f8d068b799a1b | add metadata client | vmx/cbagent,couchbase/cbmonitor,ronniedada/litmus,ronniedada/litmus,couchbase/cbmonitor,pavel-paulau/cbagent,couchbase/cbagent,mikewied/cbagent | priority15/metadata_client.py | priority15/metadata_client.py | import requests
def post_request(request):
def wrapper(*args, **kargs):
url, params = request(*args, **kargs)
requests.post(url, params)
return wrapper
class MetadataClient(object):
def __init__(self, host="127.0.0.1"):
self.base_url = "http://{0}:8000/cbmonitor".format(host)
... | apache-2.0 | Python | |
ed985791d20199af9cb34e445d0a96dc11e9129b | Add some basic tests for RRTM scheme. | brian-rose/climlab,cjcardinale/climlab,brian-rose/climlab,cjcardinale/climlab,cjcardinale/climlab | climlab/tests/test_rrtm.py | climlab/tests/test_rrtm.py | from __future__ import division
import numpy as np
import climlab
import pytest
from climlab.radiation import RRTMG, RRTMG_LW, RRTMG_SW, CAM3Radiation_LW
def test_rrtm_creation():
# initial state (temperatures)
state = climlab.column_state(num_lev=num_lev, num_lat=1, water_depth=5.)
# Create a RRTM radiat... | mit | Python | |
0d0cbb961a5d19ce98dd7e9805a04ac9c8887687 | Add main file | DeviantTofu/hotcrp2acm | hotcrp2acm.py | hotcrp2acm.py | #! /usr/bin/python
__author__ = "Xiaofan (Fred) Jiang"
__copyright__ = "Copyright 2016, Columbia ICSL"
__license__ = "GPL"
__version__ = "1.0"
__email__ = "jiang@ee.columbia.edu"
__status__ = "Production"
"""
Example:
hotcrp2acm.py input.json output.csv
"""
import json
import csv
import string
import sys
ofile ... | mit | Python | |
9d94dcff276418edd5d1464761a976ec65df8519 | add install.py stub | dimitardimitrov/sublime.settings | install.py | install.py | # invoke python
# locate sublime
# ask the user if they want to:
# add only the missing records to the user's files
# or replace the files completely
| mit | Python | |
f35baed0d59c508110b97d9d100e36afcb57a6c0 | update alembic | vanesa/kid-o,vanesa/kid-o,vanesa/kid-o,vanesa/kid-o | alembic/versions/7665dea01c37_add_project_to_child.py | alembic/versions/7665dea01c37_add_project_to_child.py | """add project to child
Revision ID: 7665dea01c37
Revises:
Create Date: 2017-10-07 16:37:54.126634
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7665dea01c37'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands au... | bsd-3-clause | Python | |
cde510b5f13e1a2624d7d458415d206ad6c6019c | Add py-httptools (#19186) | LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack | var/spack/repos/builtin/packages/py-httptools/package.py | var/spack/repos/builtin/packages/py-httptools/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyHttptools(PythonPackage):
"""httptools is a Python binding for the nodejs HTTP parser.""... | lgpl-2.1 | Python | |
d3789d601de439201c914c531ede9b2f6ae3154d | Copy geneagraph.py to geneagraph-cgi.py file. The new file will contain the cgi version of the geneagrapher interface, and the new command-line interface will be built in the geneagraph.py file. | davidalber/Geneagrapher,davidalber/Geneagrapher | src/geneagraph-cgi.py | src/geneagraph-cgi.py | #!/usr/bin/python
import cgi
import random
import os
import time
from grab import *
from GGraph import *
#import cgitb; cgitb.enable() # for debugging, comment out for production
form = cgi.FieldStorage()
name = form.getfirst("name", "")
extra = form.getfirst("extra", "")
nodes = form.getlist("node")
output = form.ge... | mit | Python | |
00077dcbd9f2394d62fced7490e6797a57dc90c6 | Add new script computing relations precision-recall, given the assignment | NUAAXXY/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,amonszpart/globOpt,amonszpart/globOpt | evaluation/compareMappedGraphs.py | evaluation/compareMappedGraphs.py | import packages.project as project
import packages.primitive as primitive
import packages.processing
import packages.relationGraph as relgraph
import packages.io
import argparse
import matplotlib.pyplot as plt
import networkx as nx
from networkx.algorithms import isomorphism
import numpy as np
#######################... | apache-2.0 | Python | |
f84a804cb0e69bc3758958cd6c9f5b195aecd5d8 | Add AWS Batch Support (#796) | cloudtools/troposphere,johnctitus/troposphere,ikben/troposphere,johnctitus/troposphere,pas256/troposphere,ikben/troposphere,cloudtools/troposphere,pas256/troposphere | troposphere/batch.py | troposphere/batch.py | from . import AWSObject, AWSProperty
from .validators import positive_integer
class ComputeResources(AWSProperty):
props = {
"SpotIamFleetRole": (basestring, False),
"MaxvCpus": (positive_integer, True),
"SecurityGroupIds": ([basestring], True),
"BidPercentage": (positive_integer,... | bsd-2-clause | Python | |
7fbdd5dbadc8bc8186173545257763471bd69665 | test the use_twisted etc commands | meejah/txaio,oberstet/txaio,oberstet/txaio,crossbario/txaio,tavendo/txaio,crossbario/txaio | test/test_imports.py | test/test_imports.py | import pytest
def test_use_twisted():
pytest.importorskip('twisted')
import txaio
txaio.use_twisted()
assert txaio.using_twisted
assert not txaio.using_asyncio
def test_use_twisted_no_twisted():
# make sure we DO NOT have Twisted installed
try:
import twisted # noqa
ret... | mit | Python | |
7b773cc61e152c6bf6996d09ab9adb08153b6415 | add Z3-based solver | mtrberzi/sudoku2smt | z3sudoku.py | z3sudoku.py | #!/usr/bin/python
## This program uses the Z3 SMT solver to find solutions to Soduko puzzles.
## Input is from stdin and consists of 9 lines, each of which has 9 entries.
## Each line of input corresponds to a single row of the Sudoku board.
## Each entry on a given line represents the value in the corresponding
## co... | mit | Python | |
a84d8005193328b63eaf98f0852dc72c3e58aed9 | Add example script for evaluating setiment | dankolbman/MarketCents | twitter_feed.py | twitter_feed.py | # authenticates with twitter, searches for microsoft, evaluates overall
# sentiment for microsoft
import numpy as np
import twitter
from textblob import TextBlob
f = open('me.auth')
keys = f.readlines()
# Read in keys
keys = [x.strip('\n') for x in keys]
# Connect
api = twitter.Api(consumer_key = keys[0],
... | mit | Python | |
4463ee56c210b5dd2c7e117b2b4f3adb3d8a4b67 | Create icreacream.py | Cantal0p3/nyu-devops-homework-1,ilanasufrin/nyu-devops-homework-1,Cantal0p3/nyu-devops-homework-1,ilanasufrin/nyu-devops-homework-1,ilanasufrin/nyu-devops-homework-1,Cantal0p3/nyu-devops-homework-1 | icreacream.py | icreacream.py | # Copyright 2016 John J. Rofrano. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 | Python | |
3c1971d1175f0257e5297c273a780b337b72b319 | Add tests from AutoParadigmMixin | thiderman/network-kitten | test/test_util.py | test/test_util.py | from kitten.util import AutoParadigmMixin
class TestAutoParadigmMixin(object):
def setup_method(self, method):
self.apm = AutoParadigmMixin()
def test_first_load(self):
ret = self.apm.paradigms
assert 'node' in ret
assert 'node' in self.apm._paradigms
def test_second_loa... | mit | Python | |
0c6be9c453f7393bfeb621cc9e2f6142fdb11cc8 | Add example about using custom density distributions. | MCGallaspy/pymc3,kyleam/pymc3,jameshensman/pymc3,jameshensman/pymc3,arunlodhi/pymc3,superbobry/pymc3,MCGallaspy/pymc3,Anjum48/pymc3,LoLab-VU/pymc,hothHowler/pymc3,CVML/pymc3,JesseLivezey/pymc3,JesseLivezey/pymc3,kmather73/pymc3,CVML/pymc3,MichielCottaar/pymc3,tyarkoni/pymc3,wanderer2/pymc3,dhiapet/PyMC3,superbobry/pymc... | pymc/examples/custom_dists.py | pymc/examples/custom_dists.py | # This model was presented by Jake Vanderplas in his blog post about
# comparing different MCMC packages
# http://jakevdp.github.io/blog/2014/06/14/frequentism-and-bayesianism-4-bayesian-in-python/
#
# While at the core it's just a linear regression, it's a nice
# illustration of using Jeffrey priors and custom density... | apache-2.0 | Python | |
0d7b9e23889b2908e874bda58a119af6b763f04e | Test Case for adding groups | labizon/Python_training | test_add_group.py | test_add_group.py | # -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class test_add_group(unitt... | apache-2.0 | Python | |
cda831f6fc95922ac81e51fd93dc4705f1bdb688 | add keyhac config | sakatam/dotfiles,sakatam/dotfiles,sakatam/dotfiles,sakatam/dotfiles | keyhac/config.py | keyhac/config.py | from keyhac import *
def configure(keymap):
keymap_global = keymap.defineWindowKeymap()
keymap_global[ "Ctrl-H" ] = "Left"
keymap_global[ "Ctrl-J" ] = "Down"
keymap_global[ "Ctrl-K" ] = "Up"
keymap_global[ "Ctrl-L" ] = "Right"
keymap_global[ "Ctrl-Shift-H" ] = "Shift-Left"
keymap_global[ "Ctrl-Shift-J... | mit | Python | |
c68ae63ac4856a6417afb10f53a7609c3958ae32 | Solve Knowit 01 | matslindh/codingchallenges,matslindh/codingchallenges | knowit2017/01.py | knowit2017/01.py | from collections import Counter
def lookify(w):
c = Counter(w)
return ''.join(sorted(c.keys()))
def ngram(n, w):
tokens = ''
i = 0
lw = len(w)
while True:
print(w[i:i+n])
tokens += w[i:i+n]
i += 1
if i+n > lw:
break
return tokens
dictionar... | mit | Python | |
98a5c93881c6bafa3f5d67af157c56c187d4b3bd | Add a legacy app runner application based on Xephyr | samdroid-apps/sugar-toolkit-gtk3,gusDuarte/sugar-toolkit-gtk3,sugarlabs/sugar-toolkit,gusDuarte/sugar-toolkit-gtk3,tchx84/sugar-toolkit-gtk3,sugarlabs/sugar-toolkit,gusDuarte/sugar-toolkit-gtk3,puneetgkaur/backup_sugar_sugartoolkit,i5o/sugar-toolkit-gtk3,puneetgkaur/sugar-toolkit-gtk3,sugarlabs/sugar-toolkit,puneetgkau... | legacy/legacy.py | legacy/legacy.py | #!/usr/bin/python -t
# -*- tab-width: 4; indent-tabs-mode: t -*-
import dbus
import dbus.service
import dbus.glib
import pygtk
pygtk.require('2.0')
import gtk, gobject
import sys
import os
import pwd
import gc
import socket
import types
import select
sys.path.append(os.getcwd())
sys.path.append('../shell/example-a... | lgpl-2.1 | Python | |
55908f44cb683063cba4a57ee262c3d0074b68e2 | Create GiftWrapping.py | MaximeKjaer/dailyprogrammer-challenges | Challenge-174/03-Hard/GiftWrapping.py | Challenge-174/03-Hard/GiftWrapping.py | from PIL import Image, ImageDraw, ImageOps
from random import randint
n = 26
#Create image
img = Image.new( 'RGB', (101, 101), 'white')
draw = ImageDraw.Draw(img)
points = [(randint(0, 100), randint(0, 100)) for _ in range(n)]
def left(point, line):
"""Determines if a point is to the left of a line"""
x, y ... | mit | Python | |
71d0a5a283a3320926fb017e355aa812301997e5 | Create Malta holidays tests | dr-prodigy/python-holidays | test/countries/test_malta.py | test/countries/test_malta.py | # -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <maurizio.... | mit | Python | |
469c2932575daaf42d8cec5578c087f4e5c340af | Add Django REST Framework authentication helpers for JWT | City-of-Helsinki/django-helusers,City-of-Helsinki/django-helusers | helusers/jwt.py | helusers/jwt.py | from django.utils.translation import ugettext as _
from django.contrib.auth import get_user_model
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework import exceptions
import random
User = get_user_model()
class JWTAuthentication(JSONWebTokenAuthentication):
def populate... | bsd-2-clause | Python | |
2132d8eb661f7f3ede5f0e436160d59f0a22c413 | Create xlsqlite.py | 6234456/xlsqlite | usr/xlsqlite.py | usr/xlsqlite.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# #####
# @param db: name of the sqlite database
# @param tbl: name of the table in the given db
# @param wb: name of the workbook from which to fetch the data, default to be ".xls" format. no extension needed
# #####
def xl2sql(wb = None, sht = None, db = ... | mit | Python | |
672d76c4c904c3e9cf572310a218be533288e01e | Add API_class.py | franckbrignoli/twitter-bot-detection | API_class.py | API_class.py | class API_config():
def __init__(self, app_config,tweepy):
self.app_config = app_config
self.tweepy = app_config
def API_launch(self):
# Twitter API configuration
consumer_key = app_config.twitter["consumer_key"]
consumer_secret = app_config.twitter["consumer_secre... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.