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 |
|---|---|---|---|---|---|---|---|---|
bf93b3b4c8965e31e5b9b8ebdbf3f1b1d258e15e | Add a new script to simplify profiling of cvs2svn.py. Document in the script how to use kcachegrind to view the results. | YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,wbond/subversion,wbond/subversion | tools/cvs2svn/profile-cvs2svn.py | tools/cvs2svn/profile-cvs2svn.py | #!/usr/bin/env python
#
# Use this script to profile cvs2svn.py using Python's hotshot profiler.
#
# The profile data is stored in cvs2svn.hotshot. To view the data using
# hotshot, run the following in python:
#
# import hotshot.stats
# stats = hotshot.stats.load('cvs2svn.hotshot')
# stats.strip_dirs(... | apache-2.0 | Python | |
61f06365254c57ced68beb83714164186164d939 | add solutin for LRU Cache | zhyu/leetcode,zhyu/leetcode | src/LRUCache.py | src/LRUCache.py | class LRUCache:
class ListNode:
def __init__(self, val):
self.val = val
self.next = None
self.prev = None
# @param capacity, an integer
def __init__(self, capacity):
self.capacity = capacity
self.size = 0
self.cache = {}
self.hea... | mit | Python | |
3a0fdcf51e1db8abab900a6cc1b4596d0dc4b054 | automate fab process | ianjuma/errand-runner,ianjuma/errand-runner,ianjuma/errand-runner,ianjuma/errand-runner | automata.py | automata.py | import pexpect
import getpass
version = raw_input('Version: ')
secret = getpass.getpass('Enter Passphrase: ')
github_username = 'ianjuma'
clean = pexpect.spawn('fab clean')
clean.expect('Passphrase for private key:')
clean.send(secret)
deploy = pexpect.spawn('fab deploy:%s' %(version,))
deploy.expect('Passphrase for... | apache-2.0 | Python | |
5ea95763c541b30a4b3f9ef5dbfa201b24ae5293 | Create get_gg_list_result.py | ericlzyu/yingxiao,ericlzyu/yingxiao,ericlzyu/yingxiao | get_gg_list_result.py | get_gg_list_result.py | import time
from splinter import Browser
def splinter(url,browser):
#login 126 email websize
browser.visit(url)
#wait web element loading
time.sleep(5)
#fill in account and password
browser.find_by_id('idInput').fill('xxxxxx')
browser.find_by_id('pwdInput').fill('xxxxx')
#click the butt... | mit | Python | |
3095142aa814e51e8fcde4d53633a93a54a7574f | Index main label reference | hasgeek/funnel,hasgeek/funnel,hasgeek/funnel,hasgeek/funnel,hasgeek/funnel | migrations/versions/e679554261b2_main_label_index.py | migrations/versions/e679554261b2_main_label_index.py | """Main label index
Revision ID: e679554261b2
Revises: e2be4ab896d3
Create Date: 2019-05-09 18:55:24.472216
"""
# revision identifiers, used by Alembic.
revision = 'e679554261b2'
down_revision = 'e2be4ab896d3'
from alembic import op
import sqlalchemy as sa # NOQA
def upgrade():
op.create_index(op.f('ix_label... | agpl-3.0 | Python | |
ff51c695b516ea7e16518779c66ebd827b4f6230 | Clean up Encode | OCForks/phantomjs,you21979/phantomjs,Andrey-Pavlov/phantomjs,r3b/phantomjs,iradul/phantomjs,ramanajee/phantomjs,iver333/phantomjs,grevutiu-gabriel/phantomjs,jguyomard/phantomjs,sxhao/phantomjs,tinfoil/phantomjs,djmaze/phantomjs,tmuelle2/phantomjs,woodpecker1/phantomjs,zhengyongbo/phantomjs,avinashkunuje/phantomjs,jefle... | python/pyphantomjs/encoding.py | python/pyphantomjs/encoding.py | '''
This file is part of the PyPhantomJS project.
Copyright (C) 2011 James Roe <roejames12@hotmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
... | '''
This file is part of the PyPhantomJS project.
Copyright (C) 2011 James Roe <roejames12@hotmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
... | bsd-3-clause | Python |
815d758f74e01bc7a460e211ffb9cb81fedb9726 | add 0002 | Yrthgze/prueba-sourcetree2,Yrthgze/prueba-sourcetree2,Show-Me-the-Code/python,Jaccorot/python,starlightme/python,Yrthgze/prueba-sourcetree2,haiyangd/python-show-me-the-code-,luoxufeiyan/python,Yrthgze/prueba-sourcetree2,JiYouMCC/python,luoxufeiyan/python,Show-Me-the-Code/python,JiYouMCC/python,renzongxian/Show-Me-the-C... | Jaccorot/0002/0002.py | Jaccorot/0002/0002.py | #!/usr/local/bin/python
#coding=utf-8
#第 0002 题:将 0001 题生成的 200 个激活码(或者优惠券)保存到 MySQL 关系型数据库中。
import uuid
import MySQLdb
def create_code(num, length):
#生成”num“个激活码,每个激活码含有”length“位
result = []
while True:
uuid_id = uuid.uuid1()
temp = str(uuid_id).replace('-', '')[:length]
if temp not... | mit | Python | |
c3e8a9a60410ca4494038ba9f3a774b960a8a29e | Create quiz3.py | jeimynoriega/uip-prog3 | Laboratorios/quiz3.py | Laboratorios/quiz3.py |
segundos = 0
while chance < 6:
mints_seg = int (("ingrese el tiempo en segundos:"))
chance +=1
if mints_seg / 60
segundos =60 time_seg%60
print (segundos)
| mit | Python | |
71a6d0a032896f4ef2e9a4cda541d142f2c48171 | Add unittests for environment handler. | atmtools/typhon,atmtools/typhon | typhon/tests/test_environment.py | typhon/tests/test_environment.py | # -*- coding: utf-8 -*-
"""Testing the environment/configuration handler.
"""
import os
from copy import copy
import pytest
from typhon import environment
class TestEnvironment:
"""Testing the environment handler."""
def setup_method(self):
"""Run all test methods with an empty environment."""
... | mit | Python | |
d84a0b0d50fb4d01b2a2354d5317afd181f1053c | Add Random Forest Regression in Python | a-holm/MachinelearningAlgorithms,a-holm/MachinelearningAlgorithms | Regression/RandomForestRegression/regularRandomForestRegression.py | Regression/RandomForestRegression/regularRandomForestRegression.py | # -*- coding: utf-8 -*-
"""Random Forest Regression for machine learning.
Random forest algorithm is a supervised classification algorithm. As the name
suggest, this algorithm creates the forest with a number of decision trees.
In general, the more trees in the forest the more robust the forest looks like.
In the sam... | mit | Python | |
8bdab0460cf280a63538e8c56650a90109cda283 | add PermMissingElem.py - working | mickeyshaughnessy/Codility-examples | PermMissinElem.py | PermMissinElem.py | def solution(A):
euler = (len(A) + 1) * (len(A) + 2) / 2
return euler - sum(A)
| mit | Python | |
8f60b540e44fd13787c11303d81f570861c74bcf | make M5_PATH a real search path | vovojh/gem5,pombredanne/http-repo.gem5.org-gem5-,vovojh/gem5,pombredanne/http-repo.gem5.org-gem5-,pombredanne/http-repo.gem5.org-gem5-,vovojh/gem5,pombredanne/http-repo.gem5.org-gem5-,vovojh/gem5,pombredanne/http-repo.gem5.org-gem5-,pombredanne/http-repo.gem5.org-gem5-,vovojh/gem5,vovojh/gem5,pombredanne/http-repo.gem5... | configs/common/SysPaths.py | configs/common/SysPaths.py | # Copyright (c) 2006 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... | # Copyright (c) 2006 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... | bsd-3-clause | Python |
32d12ae035d1c8cebd3a163f9e35c538628e5bc7 | Add test_message.py | pvital/patchew,pvital/patchew,pvital/patchew,pvital/patchew | tests/test_message.py | tests/test_message.py | #!/usr/bin/env python3
#
# Copyright 2016 Red Hat, Inc.
#
# Authors:
# Fam Zheng <famz@redhat.com>
#
# This work is licensed under the MIT License. Please see the LICENSE file or
# http://opensource.org/licenses/MIT.
import sys
import os
import time
import datetime
from patchewtest import PatchewTestCase, main
c... | mit | Python | |
a965c542e8a2ea4bb74e522eae34161d8a6c3efa | Add minimal product test | ooz/epages-rest-python,ooz/epages-rest-python | tests/test_product.py | tests/test_product.py | # -*- coding: utf-8 -*-
import unittest
import os
from context import epages
class TestProduct(unittest.TestCase):
client = None
product_service = None
product_id = None
@classmethod
def setUpClass(cls):
host = os.environ['EPAGES_HOST']
shop = os.environ['EPAGES_SHOP']
t... | mit | Python | |
cf8ff340597d29431eaed8265a67205a1b021ee7 | add host_evacuate task | unitedstack/rock,unitedstack/rock | rock/tasks/host_evacuate.py | rock/tasks/host_evacuate.py | from flow_utils import BaseTask
from actions import NovaAction
from server_evacuate import ServerEvacuateTask
import logging
class HostEvacuateTask(BaseTask,NovaAction):
def execute(self, host):
n_client = self._get_client()
evacuated_host = host
evacuable_servers = n_client.servers.list... | apache-2.0 | Python | |
ceb3c0535f2701d595d440552d60da876d7cd0b8 | Move some functions from 'model.utils' to 'core.xrf_utils' | NSLS-II-HXN/PyXRF,NSLS-II-HXN/PyXRF,NSLS-II/PyXRF | pyxrf/core/xrf_utils.py | pyxrf/core/xrf_utils.py | import xraylib
def parse_compound_formula(compound_formula):
r"""
Parses the chemical formula of a compound and returns the dictionary,
which contains element name, atomic number, number of atoms and mass fraction
in the compound.
Parameters
----------
compound_formula: str
chemi... | bsd-3-clause | Python | |
2a6ec396512c435413f6e3848d1448af839fa9a6 | Add unittests for FindQuery | winguru/graphite-api,winguru/graphite-api | tests/test_storage.py | tests/test_storage.py | import time
from graphite_api.storage import FindQuery
from . import TestCase
class StorageTestCase(TestCase):
def test_find_query(self):
end = int(time.time())
start = end - 3600
query = FindQuery('collectd', None, None)
self.assertEqual(repr(query), '<FindQuery: collectd from ... | apache-2.0 | Python | |
e4396938425bc27fc730d580a6cd4ee6e3fd09e9 | Remove v1.0 and v1.1 API from version info. | vivekanand1101/neutron,vbannai/neutron,JianyuWang/neutron,yanheven/neutron,takeshineshiro/neutron,oeeagle/quantum,aristanetworks/neutron,armando-migliaccio/neutron,mattt416/neutron,suneeth51/neutron,NeCTAR-RC/neutron,ykaneko/neutron,pnavarro/neutron,aristanetworks/arista-ovs-quantum,ykaneko/quantum,yamahata/tacker,glov... | quantum/api/versions.py | quantum/api/versions.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Citrix Systems.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Citrix Systems.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org... | apache-2.0 | Python |
5db291b8a745f8dc640e7cdc7a274535abcc63af | Create rPiEinkQR.py | bhive01/rPiEinkQR | rPiEinkQR.py | rPiEinkQR.py | import os
from PIL import Image
from epyper.displayCOGProcess import Display
from epyper.displayController import DisplayController
# code to create QR code of good size for eink screen
# qrencode -o qrcode.png -s 7 -l L -v 1 -m 1 "TestThree003"
QRname = "qrencode -o qrcode.png -s 7 -l L -v 1 -m 1 \"" + "TestThree04"... | unlicense | Python | |
dff76b6518b1de1be56def7469180d841a9e6121 | Create __init__.py | emeric254/gala-stri-website,emeric254/gala-stri-website,emeric254/gala-stri-website | Tools/__init__.py | Tools/__init__.py | # -*- coding: utf-8 -*-
| mit | Python | |
a152c7c48baa0f1c82e7d84bebbee674eb4f2761 | Add command to queue expired tiles | tilezen/tilequeue,mapzen/tilequeue | tilequeue/commands.py | tilequeue/commands.py | from tilequeue.queues import make_sqs_queue
from tilequeue.tile import explode_with_parents
from tilequeue.tile import parse_expired_coord_string
import argparse
import os
def add_aws_cred_options(arg_parser):
arg_parser.add_argument('--aws_access_key_id')
arg_parser.add_argument('--aws_secret_access_key')
... | mit | Python | |
707781ac58318af002cc1e75d8c31839d4e66e77 | add module to support search result export | cvast/arches,cvast/arches,cvast/arches,archesproject/arches,archesproject/arches,cvast/arches,archesproject/arches,archesproject/arches | arches/app/utils/geos_to_pyshp.py | arches/app/utils/geos_to_pyshp.py | from django.contrib.gis.geos import MultiPoint
from django.contrib.gis.geos import MultiLineString
from django.contrib.gis.geos import MultiPolygon
def convert_geom(geos_geom):
if geos_geom.geom_type == 'Point':
multi_geom = MultiPoint(geos_geom)
shp_geom = [[c for c in multi_geom.coords]]
if geos_geom... | agpl-3.0 | Python | |
3e0903ba2f74d5f73241d1ffc5056f2a77c709e0 | Add a simple test for SetupPrometheusEndpointOnPortRange | obytes/django-prometheus,korfuri/django-prometheus,obytes/django-prometheus,korfuri/django-prometheus | tests/test_exports.py | tests/test_exports.py | #!/usr/bin/env python
from django_prometheus.exports import SetupPrometheusEndpointOnPortRange
import unittest
class ExportTest(unittest.TestCase):
def testPortRange(self):
port_range = [8000, 8001]
SetupPrometheusEndpointOnPortRange(port_range)
SetupPrometheusEndpointOnPortRange(port_rang... | apache-2.0 | Python | |
a4ce015943da37335114aa8b384f2ee7371f6446 | Test in app-factory. | kennethreitz/flask-sslify | tests/test_factory.py | tests/test_factory.py | from flask import Flask
from flask_sslify import SSLify
from pytest import fixture
class AppFactoryContext(object):
def __init__(self):
self.sslify = SSLify()
self.app = None
self.appctx = None
def __enter__(self):
self.app = self.create_app()
self.appctx = self.app.a... | bsd-2-clause | Python | |
a866b7e2de7e76e8bfb3b1feb22d7692afa5111d | Add test exposing stale promise job store cache (connected to #817) | BD2KGenomics/slugflow,BD2KGenomics/slugflow | src/toil/test/src/promisesTest.py | src/toil/test/src/promisesTest.py | # Copyright (C) 2015 UCSC Computational Genomics Lab
#
# 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 o... | apache-2.0 | Python | |
e99807f81dea6bac82f373a210af0c4f26b61334 | test - Test for exception on syntax error | DinoTools/python-overpy,DinoTools/python-overpy | tests/test_request.py | tests/test_request.py | import pytest
import overpy
class TestQuery(object):
def test_syntax_error(self):
with pytest.raises(overpy.exception.OverpassBadRequest):
api = overpy.Overpass()
# Missing ; after way(1)
api.query((
"way(1)"
"out body;"
)) | mit | Python | |
69c5015a1a9dc3233530d691d20befa529f7c880 | Create lookupAndStoreTweets.py utility. | MichaelCurrin/twitterverse,MichaelCurrin/twitterverse | app/utils/insert/lookupAndStoreTweets.py | app/utils/insert/lookupAndStoreTweets.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Lookup and Store Tweets utility.
"""
import argparse
import os
import sys
# Allow imports to be done when executing this file directly.
appDir = os.path.abspath(os.path.join(os.path.dirname(__file__),
os.path.pardir, os.path.pardi... | mit | Python | |
bb2644fc14dd92cf54c6a22da6fe3a66f89535e6 | Create VNSautoRotator.py | Robbie1977/NRRDtools,Robbie1977/NRRDtools | VNSautoRotator.py | VNSautoRotator.py | import numpy as np
import sys, os
import nrrd
if (len(sys.argv) < 2):
print 'Error: missing arguments!'
print 'e.g. python VNSautoRotator.py imageIn.nrrd [ImageOut.nrrd]'
print 'rotate RPI to LPS orientation for CMTK (as it doesn't like RPI)'
else:
print 'Processing %s...'% (str(sys.argv[1]))
data1... | mit | Python | |
16b73476daedaf1b111e900c0db947dcdab1c9a6 | Add zits crawler | datagutten/comics,jodal/comics,klette/comics,klette/comics,klette/comics,datagutten/comics,jodal/comics,datagutten/comics,jodal/comics,jodal/comics,datagutten/comics | comics/crawler/crawlers/zits.py | comics/crawler/crawlers/zits.py | from comics.crawler.utils.lxmlparser import LxmlParser
from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Zits'
language = 'en'
url = 'http://www.arcamax.com/zits'
start_date = '1997-07-01'
history_capable_days = 14... | agpl-3.0 | Python | |
9b0d6239bf73dce4cc981f13dd16d3c5f46b40b3 | Create dominick.py | mduckles/CodeClub | dominick.py | dominick.py | mit | Python | ||
5ffdaf778157d112c26b96020408f80ec3820e02 | Create __init__.py | thegreathippo/crispy | crispy/actions/__init__.py | crispy/actions/__init__.py | from crispy.actions.core import *
| mit | Python | |
fb9915a481e3161325eb5200db2232e6e34b2acc | Add support for Jawbone | foauth/foauth.org,foauth/foauth.org,foauth/foauth.org | services/jawbone.py | services/jawbone.py | from oauthlib.common import add_params_to_uri
import foauth.providers
class Jawbone(foauth.providers.OAuth2):
# General info about the provider
provider_url = 'https://jawbone.com/'
docs_url = 'https://jawbone.com/up/developer/endpoints'
category = 'Fitness'
# URLs to interact with the API
au... | bsd-3-clause | Python | |
4f50891c1a7d918010dbcecd640bb4b83f7bd2a3 | ADD taobao login | yueyoum/social-oauth,bopo/social-oauth | socialoauth/sites/taobao.py | socialoauth/sites/taobao.py | # -*- coding: utf-8 -*-
from socialoauth.sites.base import OAuth2
class TaoBao(OAuth2):
AUTHORIZE_URL = 'https://oauth.taobao.com/authorize'
ACCESS_TOKEN_URL = 'https://oauth.taobao.com/token'
TAOBAO_API_URL = 'https://eco.taobao.com/router/rest'
def build_api_url(self, url):
return sel... | mit | Python | |
20eb83e4e8e0391c9efaca7f30a80220f9a14e9a | Add codelists management tools | markbrough/maedi-projects,markbrough/maedi-projects,markbrough/maedi-projects | maediprojects/query/codelists.py | maediprojects/query/codelists.py | from maediprojects import db, models
import datetime
def create_code(data):
codelistcode = models.CodelistCode()
for attr, val in data.items():
setattr(codelistcode, attr, val)
db.session.add(codelistcode)
db.session.commit()
return codelistcode
def update_attr(data):
codelistcode... | agpl-3.0 | Python | |
3b74b2c0c8f06cd7262cd9dd9093a82038a23d59 | Create saxparser.py | RDBinns/datactrl | saxparser.py | saxparser.py | #!/usr/bin/python
import sys
import xml.sax
import io
import MySQLdb
class MyHandler(xml.sax.ContentHandler):
def __init__(self):
xml.sax.ContentHandler.__init__(self)
self.db = MySQLdb.connect(host="localhost", user="root", passwd="trowel", db="registerdb2011")
self.cursor = self.db.curso... | apache-2.0 | Python | |
1c810e9026f2d2c7ce3722d89a0cd7d333904e0f | add ipdb.py for easier debugging | dmr/Ldtools | examples/ipdb.py | examples/ipdb.py | """
This module provides a quick n dirty way to get a debug ipython shell.
2 ways to achieve that:
1. call set_trace() will immediately stop your program at that position
2. import ipdb will overwrite sys.excepthook with ipdb.info. This will
provide the ipython shell
"""
import sys
from IPython.core.debugger impor... | bsd-2-clause | Python | |
1e3011f728dc522ba82abf3526dfb50c9d874558 | Create invertJulesRT_new.py | braghiere/Thesis | chapter4/Minimising/invertJulesRT_new.py | chapter4/Minimising/invertJulesRT_new.py | #!/usr/bin/env python
import sys
import os
from copy import copy
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize as opt
from runJulesRTStruct import runJulesRTStruct
class julesRTData():
def __init__(self):
self.lai=float()
self.leafT=float()
self.leafR=float()
self.soilR... | apache-2.0 | Python | |
da4436ec5ec3c982e42e9f85749ac8c8cf8b8a94 | add codegen submodule | ellisonbg/altair,altair-viz/altair,jakevdp/altair | altair/codegen.py | altair/codegen.py | """
Object for generating Python code calls
"""
class CodeGen(object):
def __init__(self, name, args=None, kwargs=None, methods=None):
self.name = name
self.args = (args or [])
self.kwargs = (kwargs or {})
self.methods = (methods or [])
def to_str(self, tablevel=0, tabsize=4):
... | bsd-3-clause | Python | |
9d20d1f87f509ce51fde5c51460ff0b17c051ca1 | Create pytest_setup.py | IlfirinPL/robotframework-MarcinKoperski,IlfirinPL/robotframework-MarcinKoperski,IlfirinPL/robotframework-MarcinKoperski,IlfirinPL/robotframework-MarcinKoperski | utils/pytest_setup.py | utils/pytest_setup.py | pip install -U pytest-xdist
pip install -U parameterized
pip install -U pytest-flake8
pip install -U pytest-html
| mit | Python | |
7039e4f25d8eecdf2d5d2b4a4a769e05c5075222 | Fix description of 'api_read_full_member' permission | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/members/migrations/0020_auto_20171031_1048.py | bluebottle/members/migrations/0020_auto_20171031_1048.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-10-31 09:48
from __future__ import unicode_literals
from django.db import migrations
def rename_full_member_permission(apps, schema_editor):
Permission = apps.get_model('auth', 'Permission')
perm = Permission.objects.get(codename='api_read_full_me... | bsd-3-clause | Python | |
4b4e9bc8f9605519b12d4da25dc6822baa629d2e | Add test_core | mph-/lcapy | unit_tests/test_core.py | unit_tests/test_core.py | from lcapy import *
import unittest
import sympy as sym
s = sym.var('s')
class LcapyTester(unittest.TestCase):
"""Unit tests for lcapy
"""
def test_sExpr(self):
"""Lcapy: check sExpr
"""
a = sExpr('(s+2)/(s-2)')
self.assertEqual(a.N, sExpr('s+2'), "N incorrect.")
... | lgpl-2.1 | Python | |
30be74075e761f932a10ea0806a08991b8fd9cb4 | Add script to list nodes without an external ID | ScriptRock/content,ScriptRock/content,ScriptRock/content,ScriptRock/content,ScriptRock/content,ScriptRock/content | code/python/find-nodes-without-external-id.py | code/python/find-nodes-without-external-id.py | #!/usr/bin/env python
import httplib
import urllib
import json
import ssl
import argparse
import re
parser = argparse.ArgumentParser(description='Find any node that does not have an external ID set.')
parser.add_argument('--target-url', required=True, help='URL for the UpGuard instance. This should be the hostname on... | mit | Python | |
f12af379ec31b8c14bf871768c558c81bad95301 | Add grains for the cloud metadata server | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/grains/metadata.py | salt/grains/metadata.py | # -*- coding: utf-8 -*-
'''
Grains from cloud metadata servers at 169.254.169.254
.. versionadded:: Nitrogen
:depends: requests
'''
from __future__ import absolute_import
# Import python libs
import os
import socket
# Import salt libs
import salt.utils.http as http
# metadata server information
IP = '169.254.169.... | apache-2.0 | Python | |
101189c319c2d0fadc97fd1077a87c11ab159a12 | add a new test folder. | myinxd/sim21ps | Test/new_module.py | Test/new_module.py | #!/usr/bin/env python3
#
# Copyright (c) 2016 Zhixian MA <zxma_sjtu@qq.com>
# MIT license
"""
A test script to learn the grammar and code tyle of python, and try to make interesting docstrings.
"""
import os
import sys
import argparse
import logging
import numpy as np
from astropy.io import fits
import fg21sim
from... | mit | Python | |
6183347fc0f0309bf2c700f75b5b51f7cdbda1b4 | Create Detect_Faces.py | mavlyutovrus/person_detection | src/Detect_Faces.py | src/Detect_Faces.py | __author__ = 'Guggi'
import urllib2
import urllib
import unirest
import json
from poster.encode import multipart_encode
from poster.streaminghttp import register_openers
from PIL import Image, ImageDraw, ImageFont
register_openers()
api_key = "YOUR_API_KEY" #you need to exchange the YOUR_API_KEY with your own API ke... | apache-2.0 | Python | |
0f66e2cdcf653ea772a726ef2a5be0d12eeb1372 | add converter for Nifti volumes (anything Nibabel can read) | HumanBrainProject/neuroglancer-scripts | volume_to_raw_chunks.py | volume_to_raw_chunks.py | #! /usr/bin/env python3
#
# Copyright (c) 2016, 2017, Forschungszentrum Juelich GmbH
# Author: Yann Leprince <y.leprince@fz-juelich.de>
#
# This software is made available under the MIT licence, see LICENCE.txt.
import gzip
import json
import os
import os.path
import sys
import numpy as np
import nibabel
import nibab... | mit | Python | |
3d624b5693a753ee8ecdd6f979eaa3d17736dca7 | Create Syllabifier.py | LBenzahia/cltk,LBenzahia/cltk,TylerKirby/cltk,D-K-E/cltk,TylerKirby/cltk,cltk/cltk,kylepjohnson/cltk,diyclassics/cltk | cltk/corpus/middle_english/Syllabifier.py | cltk/corpus/middle_english/Syllabifier.py | """
Sonority hierarchy for Middle English
"""
Syllabifier = {
'a': 1,
'æ': 1,
'e': 1,
'i': 1,
'o': 1,
'u': 1,
'y': 1,
'm': 2,
'n': 2,
'p': 3,
'b': 3,
'd': 3,
'g': 3,
't': 3,
'k': 3,
'ð': 3,
'c': 4,
'f': 4,
's': 4,
'h': 4,
'v': 4,
'... | mit | Python | |
bace8f65e696211db5a6ffa2cefc70d2e061b950 | Add Support for /r/greentext | Fillll/reddit2telegram,nsiregar/reddit2telegram,nsiregar/reddit2telegram,Fillll/reddit2telegram | greentext/app.py | greentext/app.py | #encoding:utf-8
from utils import get_url, weighted_random_subreddit
from utils import SupplyResult
# Subreddit that will be a source of content
subreddit = weighted_random_subreddit({
'greentext': 1.0,
# If we want get content from several subreddits
# please provide here 'subreddit': probability
# ... | mit | Python | |
b1af12dfc111c6550c166d00fdabf7fa707bfc1b | Create main.py | erocs/2017Challenges,erocs/2017Challenges,m181190/2017Challenges,m181190/2017Challenges,erocs/2017Challenges,mindm/2017Challenges,m181190/2017Challenges,DakRomo/2017Challenges,Tursup/2017Challenges,mindm/2017Challenges,mindm/2017Challenges,popcornanachronism/2017Challenges,mindm/2017Challenges,mindm/2017Challenges,eroc... | challenge_0/python/wost/main.py | challenge_0/python/wost/main.py | '''
Written in Python 3.6
'''
def main(text):
print(f"Hello world, additional text: {text}")
if __name__ == "__main__":
main(input("What would you like to say?"))
| mit | Python | |
14aba0695514866439164f48fe1f66390719431f | Add selcet_gamma.py (authored by Amnon) | EmbrietteH/American-Gut,wasade/American-Gut,JWDebelius/American-Gut,mortonjt/American-Gut,wasade/American-Gut,biocore/American-Gut,EmbrietteH/American-Gut,biocore/American-Gut,JWDebelius/American-Gut | scripts/select_gamma.py | scripts/select_gamma.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 18 10:13:48 2013
@author: amnon
### 80 char max please
Look at all the gammaproteobacteria and select candidate contamination sequence
OTUs
output: a list of sorted gammaproteobacteria (or other) otuids, according to
mean frequency
"""
import... | bsd-3-clause | Python | |
83fe6892c5b061f5fbba64c9f870f30c80b1a12a | create word bigram matrix | juditacs/dsl,juditacs/dsl | dsl/features/word_level.py | dsl/features/word_level.py | import logging
from os import path
from argparse import ArgumentParser
from featurize import Tokenizer, BigramModel
def parse_args():
p = ArgumentParser()
p.add_argument('--train', type=str)
p.add_argument('--test', type=str)
p.add_argument('--raw-matrix-dir', type=str)
p.add_argument('--workdir',... | mit | Python | |
fec8de91954230b44b717f4b3d5a3a774c108fdf | Create monitor.py | mosscylium/forestfloor,mosscylium/forestfloor | assets/monitor.py | assets/monitor.py | #!/usr/bin/env python
import sqlite3
import os
import time
import glob
# global variables
speriod=(15*60)-1
dbname='/var/www/templog.db'
# store the temperature in the database
def log_temperature(temp):
conn=sqlite3.connect(dbname)
curs=conn.cursor()
curs.execute("INSERT INTO temps values(datetime(... | apache-2.0 | Python | |
81b178677a3c217f62be85bf16964a1f0717930f | fix #1 | idf/commons-util-py | commons_util/os_utils/memory.py | commons_util/os_utils/memory.py | __author__ = 'Danyang'
| apache-2.0 | Python | |
cd1ed470e319c6aa5d2ed5206d6fb6fba63876ee | add k-fold splitter | kavinyao/SKBPR,kavinyao/SKBPR | splitter.py | splitter.py | """
Stuff which splits dataset into train and test sets.
"""
class KFoldSplitter(object):
"""Splitter that splits a table into k groups of (almost) equal size.
Before using this splitter, make sure the table to split has a `group_id` column.
Sample usage:
>>> splitter.split('query')
>>> while spli... | mit | Python | |
6119f7998d918d3b38f129b7afd720f9a35e35c1 | Add script for fetching metadata from audio file | voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts | audio-metadata.py | audio-metadata.py | #! /usr/bin/env python
import os
import sys
import re
import tempfile
def getVideoDetails(filepath):
tmpf = tempfile.NamedTemporaryFile()
os.system("ffmpe... | mit | Python | |
21df69e2b2be4d59b5c8257d7efbf27a75eeb8dd | Add priming_output example | tgarc/python-sounddevice,spatialaudio/python-sounddevice,dholl/python-sounddevice,tgarc/python-sounddevice,spatialaudio/python-sounddevice,dholl/python-sounddevice | examples/priming_output.py | examples/priming_output.py | #!/usr/bin/env python3
"""Test priming output buffer.
See http://www.portaudio.com/docs/proposals/020-AllowCallbackToPrimeStream.html
Note that this is only supported in some of the host APIs.
"""
import sounddevice as sd
def callback(indata, outdata, frames, time, status):
outdata.fill(0)
if status.primin... | mit | Python | |
98398398f590c3a98733193fc0ea45a1948edd0e | Add example to compare layers in a char-rnn task. | lmjohns3/theanets,chrinide/theanets | examples/recurrent-text.py | examples/recurrent-text.py | #!/usr/bin/env python
import climate
import matplotlib.pyplot as plt
import numpy as np
import theanets
import utils
climate.enable_default_logging()
COLORS = ['#d62728', '#1f77b4', '#2ca02c', '#9467bd', '#ff7f0e',
'#e377c2', '#8c564b', '#bcbd22', '#7f7f7f', '#17becf']
URL = 'http://www.gutenberg.org/cac... | mit | Python | |
f41dc1eb966da1505d4dedd00034debf79774807 | add tests | JiangTao11/object_model | smalltalk_like/tests.py | smalltalk_like/tests.py | from obj_model import Class, Instance, TYPE, OBJECT
def test_creation():
test_attribute()
test_subclass()
test_callmethod()
def test_attribute():
# Python Code
class A(object):
pass
obj = A()
obj.a = 1
assert obj.a == 1
obj.b = 2
assert obj.b == 2
obj.a = 3
... | mit | Python | |
6c9cf71064cf8a0c47147efeb742b2d66caa1c47 | add stub models file | dimagi/commcare-hq,qedsoftware/commcare-hq,gmimano/commcaretest,SEL-Columbia/commcare-hq,puttarajubr/commcare-hq,gmimano/commcaretest,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,gmimano/commcaretest,dimagi/commc... | corehq/apps/toggle_ui/models.py | corehq/apps/toggle_ui/models.py | # Stub models file
from couchdbkit.ext.django.schema import Document
class _(Document): pass | bsd-3-clause | Python | |
01c8d16df94ce558593b29974e30aa96679c6862 | add stylize.py for feed-forward mode | tonypeng/tensorstyle | stylize.py | stylize.py | """
Copyright 2016-present Tony Peng
Load a trained feed-forward model to stylize an image.
"""
import nets
import numpy as np
import tensorflow as tf
import utils
import time
MODEL_PATH = 'models/trained/Udnie'
CONTENT_IMAGE_PATH = 'runs/Udnie/content_small.jpg'
OUTPUT_IMAGE_PATH = 'runs/Udnie/styled4.jpg'
content... | mit | Python | |
544c9cf63f54ca9e77fa37ab5e529791f9e00c3c | Create sysinfo.py | jadams/sysinfo,scensorECHO/sysinfo | sysinfo.py | sysinfo.py | #!/usr/bin/env python3
if __name__ == '__main__':
print
| mit | Python | |
64e028ed51c8cd485586623b295391c00526f5f9 | add speed test example | jrversteegh/flexx,zoofIO/flexx,jrversteegh/flexx,zoofIO/flexx | flexx/ui/examples/speed_test.py | flexx/ui/examples/speed_test.py | """
This little app runs some speed tests by sending binary data over the
websocket (from JS to Py and back), and measuring the time it costs to
do this.
Note that the data is buffered by the websocket (and to some extend in Flexx'
event system), so when multiple messages are send in quick succession, the
last message... | bsd-2-clause | Python | |
475ea65cce34b7af03a7355e16d95104292aa7fb | Create suntimes.py | ioangogo/Suntimes | suntimes.py | suntimes.py | #! /bin/python
# -*- coding: UTF-8 -*-
import urllib2, json, datetime, time
import dateutil.parser
global latitude
global longitude
api=json.loads(urllib2.urlopen("http://freegeoip.net/json/").read().decode("UTF-8"))
latitude=str(api['latitude'])
longitude=str(api["longitude"])
def getsunrise(lat="", lng="", formatt... | bsd-3-clause | Python | |
561b1b0bf1950bac54bc9c079daf6c09b3f87158 | Create pd.py | jacksu/machine-learning | src/ml/pd.py | src/ml/pd.py | #encoding=utf8
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
s = pd.Series([1,3,5,np.nan,6,8])
print(s)
dates = pd.date_range('20130101', periods=6)
print(dates)
#创建DataFrame
df = pd.DataFrame(np.random.randn(6,4), index=dates, columns=list('ABCD'))
print(df)
#通过字典创建DataFrame
f2 = pd.DataFrame... | mit | Python | |
f9317419417ec348b6520ce6aecf852a391d4b01 | Add importers module init | qurami/po2strings | po2strings/importers/__init__.py | po2strings/importers/__init__.py | # -*- coding: utf-8 -*- | mit | Python | |
124190aae0f39885011a5f12667d2348ffa32d09 | add invoke task to remve trailing ws | jrversteegh/flexx,zoofIO/flexx,zoofIO/flexx,jrversteegh/flexx | tasks/ws.py | tasks/ws.py | import os
from invoke import task
from ._config import ROOT_DIR, NAME
def trim_py_files(directory):
for root, dirs, files in os.walk(directory):
for fname in files:
filename = os.path.join(root, fname)
if fname.endswith('.py'):
with open(filename, 'rb') as f:
... | bsd-2-clause | Python | |
9f6952e0c46795bb704c9169cd71fdf18d952ebf | Add ChEBI client | bgyori/indra,jmuhlich/indra,johnbachman/belpy,sorgerlab/indra,pvtodorov/indra,bgyori/indra,pvtodorov/indra,bgyori/indra,sorgerlab/indra,johnbachman/belpy,pvtodorov/indra,jmuhlich/indra,jmuhlich/indra,sorgerlab/belpy,johnbachman/indra,pvtodorov/indra,sorgerlab/belpy,johnbachman/indra,johnbachman/indra,sorgerlab/belpy,jo... | indra/databases/chebi_client.py | indra/databases/chebi_client.py | import os
import csv
from functools32 import lru_cache
chebi_to_pubchem_file = os.path.dirname(os.path.abspath(__file__)) + \
'/../resources/chebi_to_pubchem.tsv'
try:
fh = open(chebi_to_pubchem_file, 'rt')
rd = csv.reader(fh, delimiter='\t')
chebi_pubchem = {}
for row in rd:
... | bsd-2-clause | Python | |
29e0644f5becc9833743f35aaa07011863fa9a12 | add gas art | KingPixil/ice,KingPixil/ice | src/art/gas/__init__.py | src/art/gas/__init__.py | import math
import colorsys
import png
from ...loader import load
from ...seed import generateSeed
from ...random import random, randomNoise2D
from ...pixel import generatePixel
# Configuration
width = 1000 # Width
height = 1000 # Height
xs = 700 # Filled width
ys = 700 # Filled height
xo = int((width - xs) / 2) # X ... | mit | Python | |
3826858481c4f9bbf8d887fa390322f8190c96e2 | Add module to list ip addresses | alexoneill/py3status,valdur55/py3status,Andrwe/py3status,tobes/py3status,Andrwe/py3status,ultrabug/py3status,tobes/py3status,ultrabug/py3status,ultrabug/py3status,guiniol/py3status,guiniol/py3status,valdur55/py3status,vvoland/py3status,docwalter/py3status,valdur55/py3status | py3status/modules/net_iplist.py | py3status/modules/net_iplist.py | # -*- coding: utf-8 -*-
"""
Display the list of current IPs. This excludes loopback IPs and displays
"no connection" if there is no connection.
Configuration parameters
ignore: list of IPs to ignore. Can use shell style wildcards.
(default: ['127.*'])
no_connection: string to display if there are no no... | bsd-3-clause | Python | |
66ad00861f7143e35ab80674295fa5bf7998cfa5 | Create pytabcomplete.py | TingPing/plugins,TingPing/plugins | HexChat/pytabcomplete.py | HexChat/pytabcomplete.py | from __future__ import print_function
import hexchat
__module_name__ = "PythonTabComplete"
__module_author__ = "TingPing"
__module_version__ = "0"
__module_description__ = "Tab completes modules in Interactive Console"
lastmodule = ''
lastcomplete = 0
lasttext = ''
def keypress_cb(word, word_eol, userdata):
global... | mit | Python | |
248023106d4e881110a646e9d078ecad4f58e24d | Add a Python program which reads from a pipe and writes the data it gets to syslog. | tonnerre/pipelogger | pipelogger.py | pipelogger.py | #!/usr/bin/env python
#
import argparse
import os
import syslog
parser = argparse.ArgumentParser(
description='Syslog messages as read from a pipe')
parser.add_argument('-i', '--ident',
help='Use the given identifier for syslogging',
required=True)
parser.add_argument('pipe', help='Pipe file to read log records f... | bsd-3-clause | Python | |
85d29ef779687a3b9db5333ce9921fc20e66b985 | Create test_get.py | luoweis/python,luoweis/python | test_get.py | test_get.py | #!/usr/bin/env python
# -*- coding=utf-8 -*-
#以get明文的方式传递数据
import urllib
import urllib2
values={}
values['username'] = "1016903103@qq.com"
values['password']="XXXX"
data = urllib.urlencode(values)
url = "http://passport.csdn.net/account/login"
geturl = url + "?"+data #字符串合并
request = urllib2.Request(geturl)
respons... | apache-2.0 | Python | |
66201e6d73a909bc0ad932ad4b5de9d2ce30d4fe | add Blob class | PhloxAR/phloxar,PhloxAR/phloxar | PhloxAR/features/blob.py | PhloxAR/features/blob.py | # -*- coding:utf-8 -*-
from __future__ import division, print_function
from __future__ import absolute_import, unicode_literals
from PhloxAR.base import math
from PhloxAR.base import sss
from PhloxAR.base import *
from PhloxAR.features.feature import Feature
from PhloxAR.color import Color
from PhloxAR.image import I... | apache-2.0 | Python | |
0b06fb26fa5393e4ba80e2942ebba34d9f9fa4de | Create 1st Python script | Robinlovelace/r-vs-python-geo,Robinlovelace/r-vs-python-geo | Python/spatial-basics.py | Python/spatial-basics.py | from shapely.wkt import loads
g = loads('POINT (0.0 0.0)')
| mit | Python | |
a61d37449f8000a83942513f2ad71151ef26822d | Add unit tests for synapse.cells | vertexproject/synapse,vivisect/synapse,vertexproject/synapse,vertexproject/synapse | synapse/tests/test_cells.py | synapse/tests/test_cells.py | import synapse.axon as s_axon
import synapse.cells as s_cells
import synapse.cryotank as s_cryotank
from synapse.tests.common import *
class CellTest(SynTest):
def test_cell_cryo(self):
with self.getTestDir() as dirn:
with s_cells.cryo(dirn) as cryo:
self.isinstance(cryo, s_cr... | apache-2.0 | Python | |
7454abdfba5d37d81dc3ad4bf7fb2f63bc552f38 | Add wsgi file | BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit | toolkit.wsgi | toolkit.wsgi | import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
sys.path.append(os.path.abspath("."))
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
| agpl-3.0 | Python | |
ea5d2be685d7b144e29fa7d362f290a0569875cb | add radio.py | HSU-MilitaryLogisticsClub/pysatcatcher,HAYASAKA-Ryosuke/pysatcatcher | radio.py | radio.py | # -*- coding: utf-8 -*-
import unittest
import serial
class IC911:
def connect(self, radioport):
print "IC911"
#self._ser=serial.Serial(radioport,38400)
def chengefreq(self,freqvalue):
priansumble = "FE"*2
receiveaddress = "60"
sendeaddress = "E0"
command="05"
... | mit | Python | |
324161f37b54aee71de801b4206f925c967d11d4 | Add a couple of simple tests and fix typo | tbabej/tasklib,robgolding63/tasklib,robgolding/tasklib | tasklib/tests.py | tasklib/tests.py | import shutil
import tempfile
import unittest
import uuid
from .task import TaskWarrior
class TasklibTest(unittest.TestCase):
def setUp(self):
self.tmp = tempfile.mkdtemp()
self.tw = TaskWarrior(data_location=self.tmp)
def tearDown(self):
shutil.rmtree(self.tmp)
class TaskFilterTe... | bsd-3-clause | Python | |
94013176a1dfe7724106ec2deed5f650b71b8f65 | Create basic admin interface... | CentreForResearchInAppliedLinguistics/clic,CentreForCorpusResearch/clic,CentreForResearchInAppliedLinguistics/clic,CentreForCorpusResearch/clic,CentreForResearchInAppliedLinguistics/clic,CentreForCorpusResearch/clic | clic/web/admin.py | clic/web/admin.py | # from __future__ import absolute_import # help python find modules within clic package (see John H email 09.04.2014)
from flask import Flask, render_template
from flask.ext.security import Security, SQLAlchemyUserDatastore, \
UserMixin, RoleMixin, login_required
from flask.ext.admin.contrib import sqla
from flas... | mit | Python | |
86d51e36ca0f5772717d72d4729fb331a0066636 | Fix smoke tests to delete resources synchronously. | rakeshmi/tempest,flyingfish007/tempest,tonyli71/tempest,neerja28/Tempest,Mirantis/tempest,BeenzSyed/tempest,rzarzynski/tempest,manasi24/jiocloud-tempest-qatempest,alinbalutoiu/tempest,afaheem88/tempest,flyingfish007/tempest,Tesora/tesora-tempest,Tesora/tesora-tempest,pczerkas/tempest,akash1808/tempest,sebrandon1/tempes... | tempest/smoke.py | tempest/smoke.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack, LLC
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack, LLC
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | apache-2.0 | Python |
24f16c8e012000a86ccba564fb0be84504b60824 | Use Jacoco to create a code coverage report; update build scripts to run it. | marcinkwiatkowski/buck,vine/buck,brettwooldridge/buck,facebook/buck,1yvT0s/buck,illicitonion/buck,brettwooldridge/buck,siddhartharay007/buck,romanoid/buck,dsyang/buck,ilya-klyuchnikov/buck,daedric/buck,vschs007/buck,zhan-xiong/buck,janicduplessis/buck,dsyang/buck,1yvT0s/buck,shybovycha/buck,rowillia/buck,dsyang/buck,li... | scripts/assert_code_coverage.py | scripts/assert_code_coverage.py | #!/usr/bin/env python
import xml.etree.ElementTree as ElementTree
import sys
# This parses buck-out/gen/jacoco/code-coverage/index.html after
# `buck test --all --code-coverage --code-coverage-format xml --no-results-cache`
# has been run.
PATH_TO_CODE_COVERAGE_XML = 'buck-out/gen/jacoco/code-coverage/coverage.xml'
... | apache-2.0 | Python | |
ce8f335b8b52d682cd233a96529201a4c537e88d | Add Python 3.5 | cle1109/scot,scot-dev/scot,scot-dev/scot,mbillingr/SCoT,cle1109/scot,cbrnr/scot,mbillingr/SCoT,cbrnr/scot | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
from codecs import open
from scot import __version__ as ver
with open('README.md', encoding='utf-8') as readme:
long_description = readme.read()
setup(
name='scot',
version=ver,
description='EEG/MEG Source Connectivity Toolbox',
long_description... | #!/usr/bin/env python
from setuptools import setup
from codecs import open
from scot import __version__ as ver
with open('README.md', encoding='utf-8') as readme:
long_description = readme.read()
setup(
name='scot',
version=ver,
description='EEG/MEG Source Connectivity Toolbox',
long_description... | mit | Python |
fc70bf43639f34d92b21c66269ee2e15da9f0e5c | Fix missing dev dependency | dargueta/binobj | setup.py | setup.py | import setuptools
import sys
# Thwart installation for unsupported versions of Python. `pip` didn't start
# enforcing `python_requires` until 9.0.
if sys.version_info < (3, 4):
raise RuntimeError('Unsupported Python version: ' + sys.version)
setuptools.setup(
author='Diego Argueta',
author_email='darguet... | import setuptools
import sys
# Thwart installation for unsupported versions of Python. `pip` didn't start
# enforcing `python_requires` until 9.0.
if sys.version_info < (3, 4):
raise RuntimeError('Unsupported Python version: ' + sys.version)
setuptools.setup(
author='Diego Argueta',
author_email='darguet... | bsd-3-clause | Python |
a17efdceeeec0932ff403ebeb6f787ea8b08a3a4 | Add print lists function practice problem | HKuz/Test_Code | Problems/printLists.py | Problems/printLists.py | #!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
test_list_1 = ["puppy", "kitten", "lion cub"]
test_list_2 = ["lettuce",
"bacon",
"turkey",
"mayonnaise",
"tomato",
"white bread"]
pret... | mit | Python | |
9bbea15cd6832f9a0a75a05775fcf2a12297f8c8 | Update setup.py | refinery29/chassis,refinery29/chassis | setup.py | setup.py | """Chassis: Opinionated REST Framework."""
from distutils.core import setup
setup(
name='chassis',
version='0.0.5',
packages=['chassis'],
description="Tornado framework for self-documenting JSON RESTful APIs.",
author="Refinery 29",
author_email="chassis-project@refinery29.com",
url="https... | """Chassis: Opinionated REST Framework."""
from distutils.core import setup
setup(
name='chassis',
version='0.0.5',
packages=['chassis'],
description="Tornado framework for self-documenting JSON RESTful APIs.",
author="Refinery 29",
author_email="chassis-project@refinery29.com",
url="https... | mit | Python |
14ff724cd05f51973af9ede47d9f8cfe2a1ce908 | Add optional flag to setuptools extension (#78) | agronholm/cbor2,agronholm/cbor2,agronholm/cbor2 | setup.py | setup.py | import sys
import platform
from pkg_resources import parse_version
from setuptools import setup, Extension
cpython = platform.python_implementation() == 'CPython'
is_glibc = platform.libc_ver()[0] == 'glibc'
windows = sys.platform.startswith('win')
if is_glibc:
glibc_ver = platform.libc_ver()[1]
libc_ok = pars... | import sys
import platform
from pkg_resources import parse_version
from setuptools import setup, Extension
cpython = platform.python_implementation() == 'CPython'
is_glibc = platform.libc_ver()[0] == 'glibc'
windows = sys.platform.startswith('win')
if is_glibc:
glibc_ver = platform.libc_ver()[1]
libc_ok = pars... | mit | Python |
34643864e52f3231aa40256bc160569af234e8e7 | Add setup.py | eduardoklosowski/vdlkino-python | setup.py | setup.py | from setuptools import find_packages, setup
version = __import__('vdlkino').__version__
setup(
name='vdlkino',
version=version,
description='Library in Python for comunicate computer with Arduino running VDLKino',
author='Eduardo Klosowski',
author_email='eduardo_klosowski@yahoo.com',
licens... | mit | Python | |
8ec65137efcf1f8cf37923b916e7496e10027edc | Bump version. | prakharjain09/qds-sdk-py,adeshr/qds-sdk-py,jainavi/qds-sdk-py,tanishgupta1/qds-sdk-py-1,vrajat/qds-sdk-py,rohitpruthi95/qds-sdk-py,yogesh2021/qds-sdk-py,msumit/qds-sdk-py,qubole/qds-sdk-py | setup.py | setup.py | import os
import sys
from setuptools import setup
INSTALL_REQUIRES = ['python_cjson', 'requests >=1.0.3', 'boto >=2.1.1']
if sys.version_info < (2, 7, 0):
INSTALL_REQUIRES.append('argparse>=1.1')
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "qds_sdk",
... | import os
import sys
from setuptools import setup
INSTALL_REQUIRES = ['python_cjson', 'requests >=1.0.3', 'boto >=2.1.1']
if sys.version_info < (2, 7, 0):
INSTALL_REQUIRES.append('argparse>=1.1')
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "qds_sdk",
... | apache-2.0 | Python |
42a287d23a1153df636c193695615d99b7c75e4d | Test stopping all running file backups | uroni/urbackup-server-python-web-api-wrapper | test/stop_all.py | test/stop_all.py | import urbackup_api
server = urbackup_api.urbackup_server("http://127.0.0.1:55414/x", "admin", "foo")
for action in server.get_actions():
a = action["action"]
if a ==server.action_full_file or a==server.action_resumed_full_file:
print("Running full file backup: "+action["name"])
... | apache-2.0 | Python | |
a9cc03c02b6d8571efd563e04f2cb774f4c3e7bf | add original walk.py | a301-teaching/cpsc189 | lib/walk.py | lib/walk.py | # File: os-path-walk-example-2.py
#http://effbot.org/librarybook/os-path/os-path-walk-example-2.py
import os
def index(directory):
# like os.listdir, but traverses directory trees
stack = [directory]
files = []
while stack:
directory = stack.pop()
for file in os.listdir(directory):
... | cc0-1.0 | Python | |
5fc17b6c0f4d9d9862df63c330b257a8ec6932af | Add a test of switching back and forth between Decider() values (specifically 'MD5' and 'timestamp-match'), copied from back when this functionality was configured with the SourceSignatures() function. | azverkan/scons,azverkan/scons,azverkan/scons,azverkan/scons,azverkan/scons | test/Decider/switch-rebuild.py | test/Decider/switch-rebuild.py | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | mit | Python | |
3a9445c6b3053d492c12bbf808d251c6da55632a | Add a test for the builtin __import__ function. | pozetroninc/micropython,pfalcon/micropython,micropython/micropython-esp32,AriZuu/micropython,torwag/micropython,HenrikSolver/micropython,Timmenem/micropython,pozetroninc/micropython,ryannathans/micropython,tralamazza/micropython,blazewicz/micropython,oopy/micropython,lowRISC/micropython,alex-robbins/micropython,bvernou... | tests/import/builtin_import.py | tests/import/builtin_import.py | # test calling builtin import function
# basic test
__import__('builtins')
# first arg should be a string
try:
__import__(1)
except TypeError:
print('TypeError')
# level argument should be non-negative
try:
__import__('xyz', None, None, None, -1)
except ValueError:
print('ValueError')
| mit | Python | |
6dcd913e794edbac28d98988d0936262d4663b9f | create input function | viraintel/OWASP-Nettacker,viraintel/OWASP-Nettacker,viraintel/OWASP-Nettacker,viraintel/OWASP-Nettacker | core/get_input.py | core/get_input.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from core.compatible import version
from core.alert import __input_msg
def __input(msg, default):
if version() is 2:
try:
data = raw_input(__input_msg(msg))
if data == '':
data = default
except:
data... | apache-2.0 | Python | |
a72a0674a6db3880ed699101be3c9c46671989f0 | Add a primitive pythonic wrapper. | cfe316/atomic,ezekial4/atomic_neu,ezekial4/atomic_neu | xxdata_11.py | xxdata_11.py | import os
import _xxdata_11
parameters = {
'isdimd' : 200,
'iddimd' : 40,
'itdimd' : 50,
'ndptnl' : 4,
'ndptn' : 128,
'ndptnc' : 256,
'ndcnct' : 100
}
def read_scd(filename):
fd = open(filename, 'r')
fortran_filename = 'fort.%d' % fd.fileno()
os.symlink(filename, fortran_filen... | mit | Python | |
b6cd59f800b254d91da76083546ab7c10689df5f | Add unit test to enforce unique file names. | rdo-management/tripleo-image-elements,rdo-management/tripleo-image-elements,openstack/tripleo-image-elements,radez/tripleo-image-elements,radez/tripleo-image-elements,openstack/tripleo-image-elements | tests/test_no_dup_filenames.py | tests/test_no_dup_filenames.py | # Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 | Python | |
e81fd02cc7431ea01416126b88a22b4bba9b755e | Test - add cmake test tool | sarahmarshy/project_generator,ohagendorf/project_generator,0xc0170/project_generator,project-generator/project_generator | tests/test_tools/test_cmake.py | tests/test_tools/test_cmake.py | # Copyright 2015 0xc0170
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | apache-2.0 | Python | |
15102368281837ace7e67ad915f2ff9c4c4a1ac3 | remove package alias tool | openspending/os-conductor,openspending/os-authz-service,openspending/os-authz-service,openspending/os-authz-service,openspending/os-conductor | tools/remove_packages_alias.py | tools/remove_packages_alias.py | import os
import sys
import logging
import urllib3
from elasticsearch import Elasticsearch, NotFoundError
from os_package_registry import PackageRegistry
from sqlalchemy import MetaData, create_engine
urllib3.disable_warnings()
logging.root.setLevel(logging.INFO)
if __name__ == "__main__":
es_host = os.environ... | mit | Python | |
d53cff101248b9c90f5d2ae3f93d0e4933d03266 | add a manifest (.cvmfspublished) abstraction class | reneme/python-cvmfsutils,reneme/python-cvmfsutils | cvmfs/manifest.py | cvmfs/manifest.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created by René Meusel
This file is part of the CernVM File System auxiliary tools.
"""
import datetime
class UnknownManifestField:
def __init__(self, key_char):
self.key_char = key_char
def __str__(self):
return self.key_char
class ManifestV... | bsd-3-clause | Python | |
66fcd6ab9d8703b2588bc2605278a5e056356de5 | add top level bot class with basic outline of execution | sassoftware/mirrorball,sassoftware/mirrorball | updatebot/bot.py | updatebot/bot.py | #
# Copyright (c) 2008 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permanent/... | apache-2.0 | Python | |
8d2510fd38d946813b96798c745772641f19a5e7 | Create 10MinEmail.py | wolfdale/10MinutesEmailWrapper | 10MinEmail.py | 10MinEmail.py | from bs4 import BeautifulSoup
import threading
import urllib
web=urllib.urlopen('http://www.my10minutemail.com/')
soup=BeautifulSoup(web)
print soup.p.string
print 'Email Valid For 10 minutes'
raw_input()
#def alarm():
# print 'One Minute is Left'
#t = threading.Timer(60.0, alarm)
#t.start()
| mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.