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 |
|---|---|---|---|---|---|---|---|---|
40c6a07808be26de0534a5b6f47ef28f591a500c | bump again | radiosilence/django-suave,radiosilence/django-suave | setup.py | setup.py | from setuptools import setup, find_packages
requires = []
dep_links = []
for dep in open('requirements.txt').read().split("\n"):
if dep.startswith('git+'):
dep_links.append(dep)
else:
requires.append(dep)
setup(
name='django-suave',
version="0.5.7",
description='Rather nice pages.... | from setuptools import setup, find_packages
requires = []
dep_links = []
for dep in open('requirements.txt').read().split("\n"):
if dep.startswith('git+'):
dep_links.append(dep)
else:
requires.append(dep)
setup(
name='django-suave',
version="0.5.6",
description='Rather nice pages.... | mit | Python |
71fb2fc819c82e2db4075c6e5e32b2addc99c63a | Add platforms and classifiers | CygnusNetworks/python-gsmsapi | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(name='gsmsapi',
version='0.10',
description='SMS API for (german) SMS providers',
author='Torge Szczepanek',
author_email='debian@cygnusnetworks.de',
maintainer='Torge Szczepanek',
maintainer_email='debian@cygnusnetworks.de',
lice... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(name='gsmsapi',
version='0.10',
description='SMS API for (german) SMS providers',
author='Torge Szczepanek',
author_email='debian@cygnusnetworks.de',
maintainer='Torge Szczepanek',
maintainer_email='debian@cygnusnetworks.de',
lice... | mit | Python |
8b8383680e73496a73a3a520c3ebc85e2e01ce01 | fix version in setup.py | SquirrelMajik/flask_rest4 | setup.py | setup.py | #!/usr/bin/env python
"""
Flask-REST4
-------------
Elegant RESTful API for your Flask apps.
"""
from setuptools import setup
setup(
name='flask_rest4',
version='0.1.3',
url='https://github.com/squirrelmajik/flask_rest4',
license='See License',
author='majik',
author_email='me@yamajik.com',
... | #!/usr/bin/env python
"""
Flask-REST4
-------------
Elegant RESTful API for your Flask apps.
"""
from setuptools import setup
setup(
name='flask_rest4',
version='0.1.0',
url='https://github.com/squirrelmajik/flask_rest4',
license='See License',
author='majik',
author_email='me@yamajik.com',
... | mit | Python |
656d24c38c69891d8731ccf32852b66e32120eb7 | Bump dependency | globality-corp/microcosm-pubsub,globality-corp/microcosm-pubsub | setup.py | setup.py | #!/usr/bin/env python
from setuptools import find_packages, setup
project = "microcosm_pubsub"
version = "0.26.1"
setup(
name=project,
version=version,
description="PubSub with SNS/SQS",
author="Globality Engineering",
author_email="engineering@globality.com",
url="https://github.com/globality... | #!/usr/bin/env python
from setuptools import find_packages, setup
project = "microcosm_pubsub"
version = "0.26.1"
setup(
name=project,
version=version,
description="PubSub with SNS/SQS",
author="Globality Engineering",
author_email="engineering@globality.com",
url="https://github.com/globality... | apache-2.0 | Python |
5e9fa7a1bb8601fb5629d7e7e92a894ab335ccf1 | update readme extension | OHSUCompBio/labkey_multisite_query_tool,ohsu-computational-biology/labkey_multisite_query_tool | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.md') as readme_file:
readme = readme_file.read()
requirements = [
"wheel>=0.23.0",
"requests>=2.7.0",
"pandas>=0.16.2",
"docopt>=0.6.2"
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read().replace('.. :changelog:', ... | bsd-3-clause | Python |
c95234c130435ddd116784ad1829f7bdaa9182c5 | ADD 138 solutions with A195615(OEIS) | byung-u/ProjectEuler | 100_to_199/euler_138.py | 100_to_199/euler_138.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Problem 138
Consider the isosceles triangle with base length, b = 16, and legs, L = 17.
By using the Pythagorean theorem it can be seen that the height of the triangle, h = √(172 − 82) = 15, which is one less than the base length.
With b = 272 and L = 305, we get h ... | mit | Python | |
e7b54968a67bda76546deff546baa49f836cfbaa | Add train_fcn32s | wkentaro/fcn | examples/voc/train_fcn32s.py | examples/voc/train_fcn32s.py | #!/usr/bin/env python
import chainer
from chainer.training import extensions
import fcn
def main():
gpu = 0
resume = None # filename
# 1. dataset
dataset_train = fcn.datasets.PascalVOC2012SegmentationDataset('train')
dataset_val = fcn.datasets.PascalVOC2012SegmentationDataset('val')
iter_... | mit | Python | |
b01bd1b21f1b12c9120845ec8a85355b038d6b20 | Add a basic Storage engine to talk to the DB | codeforsanjose/inventory-control,worldcomputerxchange/inventory-control | inventory_control/storage.py | inventory_control/storage.py | """
This is the Storage engine. It's how everything should talk to the database
layer that sits on the inside of the inventory-control system.
"""
import MySQLdb
class StorageEngine(object):
"""
Instantiate a DB access object, create all the necessary hooks and
then the accessors to a SQL database.
... | mit | Python | |
5397bbe4a87dba82dc9fa57abf09a4346aa63f46 | Add 168 python solution (#38) | qiyuangong/leetcode,qiyuangong/leetcode,qiyuangong/leetcode | python/168_Excel_Sheet_Column_Title.py | python/168_Excel_Sheet_Column_Title.py | class Solution:
def convertToTitle(self, n: int) -> str:
res = ""
while n > 0:
n -= 1
res = chr(65 + n % 26) + res
n //= 26
return res
| mit | Python | |
399daa8ebec14bc4d7ee6c08135e525190e1eb6f | Add short Python script that prints as many dummy divs as needed. | scholarslab/takeback,scholarslab/takeback,scholarslab/takeback,scholarslab/takeback,scholarslab/takeback | collections/show-test/print-divs.py | collections/show-test/print-divs.py | # print-divs.py
def printDivs(num):
for i in range(num):
print('<div class="item">Item ' + str(i+1) + '</div>')
printDivs(20) | apache-2.0 | Python | |
97883fa22dd8b1207cd533b4dd9e438c83a32a90 | Update version. | suriya/mixer,mattcaldwell/mixer,mechaxl/mixer | mixer/__init__.py | mixer/__init__.py | """
Description.
"""
# Module information
# ==================
__version__ = '0.2.0'
__project__ = 'mixer'
__author__ = "horneds <horneds@gmail.com>"
__license__ = "BSD"
| """
Description.
"""
# Module information
# ==================
__version__ = '0.1.0'
__project__ = 'mixer'
__author__ = "horneds <horneds@gmail.com>"
__license__ = "BSD" | bsd-3-clause | Python |
2b80b358edd5bcf914d0c709369dbbcfd748772b | Add in a test for the marketing_link function in mitxmako | polimediaupv/edx-platform,praveen-pal/edx-platform,pdehaye/theming-edx-platform,raccoongang/edx-platform,defance/edx-platform,atsolakid/edx-platform,Softmotions/edx-platform,IONISx/edx-platform,ampax/edx-platform,LICEF/edx-platform,IndonesiaX/edx-platform,abdoosh00/edraak,chudaol/edx-platform,morpheby/levelup-by,raccoo... | common/djangoapps/mitxmako/tests.py | common/djangoapps/mitxmako/tests.py | from django.test import TestCase
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.conf import settings
from mitxmako.shortcuts import marketing_link
from mock import patch
class ShortcutsTests(TestCase):
"""
Test the mitxmako shortcuts file
"""
... | agpl-3.0 | Python | |
7236d0358064968b9cbb0ab7f4ee9876dea02aaa | add python common functions | DennyZhang/devops_public,DennyZhang/devops_public,DennyZhang/devops_public,DennyZhang/devops_public | python/tcp_port_scan/tcp_port_scan.py | python/tcp_port_scan/tcp_port_scan.py | # -*- coding: utf-8 -*-
#!/usr/bin/python
##-------------------------------------------------------------------
## @copyright 2015 DennyZhang.com
## File : tcp_port_scan.py
## Author : DennyZhang.com <denny@dennyzhang.com>
## Description :
## --
## Created : <2016-01-15>
## Updated: Time-stamp: <2016-08-11 23:14:08>
##... | mit | Python | |
a119c9f53babd87f5e5adc1886256c59a21c19a5 | Move content_type formatting support to a different module | yasoob/hug,MuhammadAlkarouri/hug,timothycrosley/hug,timothycrosley/hug,MuhammadAlkarouri/hug,timothycrosley/hug,alisaifee/hug,origingod/hug,jean/hug,alisaifee/hug,philiptzou/hug,jean/hug,giserh/hug,janusnic/hug,janusnic/hug,MuhammadAlkarouri/hug,gbn972/hug,STANAPO/hug,yasoob/hug,shaunstanislaus/hug,giserh/hug,gbn972/hu... | hug/format.py | hug/format.py | def content_type(content_type):
'''Attaches an explicit HTML content type to a Hug formatting function'''
def decorator(method):
method.content_type = content_type
return method
return decorator
| mit | Python | |
ef803b8ac95bb2440d1d312584376149573ac798 | Create bbgdailyhistory.py | tagomatech/ETL | BBG/bbgdailyhistory.py | BBG/bbgdailyhistory.py | # *- bbgdailyhistory.py -*
import os
import numpy as np
import pandas as pd
import blpapi
class BBGDailyHistory:
'''
Parameters
----------
sec : str
Ticker
fields : str or list
Field of list of fields ('PX_HIGH', 'PX_LOW', etc...)
start : str
Start date
end : stf
... | mit | Python | |
353868bc281ade826b48d2c5a79ad14986c0d35c | Create lowercaseLists.py | ReginaExMachina/royaltea-word-app,ReginaExMachina/royaltea-word-app | Bits/lowercaseLists.py | Bits/lowercaseLists.py | #!/usr/bin/env python
docs = ["The Corporation", "Valentino: The Last Emperor", "Kings of Patsry"]
movies = ["The Talented Mr. Ripley", "The Network", "Silence of the Lambs", "Wall Street", "Marie Antoinette", "My Mana Godfrey", "Rope", "Sleuth"]
films = [[docs], [movies]]
movies[5] = "My Man Godfrey"
docs[-1] = "Kin... | mit | Python | |
9afd1a8d3584e45d32858c3b8fa44efd0f1a09f1 | add unit test for ofproto automatic detection | haniehrajabi/ryu,alyosha1879/ryu,gopchandani/ryu,haniehrajabi/ryu,Zouyiran/ryu,elahejalalpour/ELRyu,takahashiminoru/ryu,ttsubo/ryu,pichuang/ryu,lsqtongxin/ryu,zangree/ryu,jalilm/ryu,zangree/ryu,evanscottgray/ryu,habibiefaried/ryu,citrix-openstack-build/ryu,yamt/ryu,gopchandani/ryu,shinpeimuraoka/ryu,habibiefaried/ryu,s... | ryu/tests/unit/ofproto/test_ofproto.py | ryu/tests/unit/ofproto/test_ofproto.py | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... | apache-2.0 | Python | |
657591afce265521078a7cb2f84347c2319b6b33 | Add tests to help with autograding | jhamrick/original-nbgrader,jhamrick/original-nbgrader | nbgrader/tests.py | nbgrader/tests.py | import nose.tools
import numpy as np
def assert_unequal(a, b, msg=""):
if a == b:
raise AssertionError(msg)
def assert_same_shape(a, b):
a_ = np.array(a, copy=False)
b_ = np.array(b, copy=False)
assert a_.shape == b_.shape, "{} != {}".format(a_.shape, b_.shape)
def assert_allclose(a, b):
... | mit | Python | |
5e7746d054f7762d93e1f70296fa3b43f882553c | Add synthtool scripts (#3765) | googleapis/google-cloud-java,googleapis/google-cloud-java,googleapis/google-cloud-java | java-bigquerydatatransfer/google-cloud-bigquerydatatransfer/synth.py | java-bigquerydatatransfer/google-cloud-bigquerydatatransfer/synth.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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | Python | |
c13ec330194612832dfb0953d3e561a0ac151d69 | add irrigation baseline file gen scripts | akrherz/dep,akrherz/dep,akrherz/dep,akrherz/dep,akrherz/dep | scripts/RT/create_irrigation_files.py | scripts/RT/create_irrigation_files.py | """Create the generalized irrigation files, for now.
https://www.ars.usda.gov/ARSUserFiles/50201000/WEPP/usersum.pdf page 60
"""
from datetime import date
LASTYEAR = date.today().year
def main():
"""Create files."""
for ofecnt in range(1, 7): # Do we have more than 6 OFEs?
fn = f"/i/0/irrigation/of... | mit | Python | |
dfdbadbd83d41ccf71be74c7add6e04513a752d2 | Add Custom Field Change Report script | closeio/closeio-api-scripts | scripts/custom_field_change_report.py | scripts/custom_field_change_report.py | import sys
import argparse
from closeio_api import Client as CloseIO_API, APIError
import csv
reload(sys)
sys.setdefaultencoding('utf-8')
parser = argparse.ArgumentParser(description='Export a list of custom field changes for a specific custom field')
parser.add_argument('--api-key', '-k', required=True, help='API Ke... | mit | Python | |
1b9aa5ccd500e17aa32c315e212068c8be96216c | Add profiler, now not import. thanks @tweekmoster! | zchee/deoplete-go,zchee/deoplete-go | rplugin/python3/deoplete/sources/deoplete_go/profiler.py | rplugin/python3/deoplete/sources/deoplete_go/profiler.py | import functools
import queue
try:
import statistics
stdev = statistics.stdev
mean = statistics.mean
except ImportError:
stdev = None
def mean(l):
return sum(l) / len(l)
try:
import time
clock = time.perf_counter
except Exception:
import timeit
clock = timeit.default_timer... | mit | Python | |
6df31f3b1049071bf5112521de8876d94e8a959a | Add support for the TinyOS 2.x serial forwarder protocol | samboiki/smap-data,samboiki/smap-data,samboiki/smap-data,samboiki/smap-data,samboiki/smap-data | python/smap/iface/tinyos.py | python/smap/iface/tinyos.py | """
Copyright (c) 2013 Regents of the University of California
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 of ... | bsd-2-clause | Python | |
e9f2e966361d8a23c83fbbbb4a4b3d4046203a16 | Test script for the heart container | cerr/CERR,cerr/CERR,cerr/CERR,aditiiyer/CERR,aditiiyer/CERR,aditiiyer/CERR,aditiiyer/CERR,cerr/CERR,cerr/CERR,cerr/CERR,aditiiyer/CERR,cerr/CERR,aditiiyer/CERR,cerr/CERR,aditiiyer/CERR,cerr/CERR,aditiiyer/CERR | CERR_core/Contouring/models/heart/test/test.py | CERR_core/Contouring/models/heart/test/test.py | #Test script for heart container testing if all the imports are successful
import sys
import os
import numpy as np
import h5py
import fnmatch
from modeling.sync_batchnorm.replicate import patch_replication_callback
from modeling.deeplab import *
from torchvision.utils import make_grid
from dataloaders.utils import dec... | lgpl-2.1 | Python | |
b223c8be2bcb11d529a07997c05a9c5ab2b183b2 | Add basic tests for run length encoding printable | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | csunplugged/tests/resources/generators/test_run_length_encoding.py | csunplugged/tests/resources/generators/test_run_length_encoding.py | from unittest import mock
from django.http import QueryDict
from django.test import tag
from resources.generators.RunLengthEncodingResourceGenerator import RunLengthEncodingResourceGenerator
from tests.resources.generators.utils import BaseGeneratorTest
@tag("resource")
class RunLengthEncodingResourceGeneratorTest(Ba... | mit | Python | |
24c3166906c8431523c641721e635fdc28fd91ce | add server that tests if a cookie was set | thiagoss/adaptive-test-server | cookiescheck-test-server.py | cookiescheck-test-server.py | import sys
from flask import Flask, request, send_from_directory, make_response, abort
app = Flask(__name__)
filepath = None
mainpath = None
@app.route('/<path:path>')
def get(path):
ret = make_response(send_from_directory(filepath, path))
if path == mainpath:
ret.set_cookie('auth', '1')
elif re... | lgpl-2.1 | Python | |
c011154135a73db2c5bba247fc33f94032553f2e | Correct package files | savex/spectra | janitor/__init__.py | janitor/__init__.py | import utils
utils = utils
logger, logger_api = utils.logger.setup_loggers(
"janitor"
)
| apache-2.0 | Python | |
1c692359231f97c3b398861fef9d5c695e8ff5f8 | Add config file module using Property List backed files. | kdart/pycopia,kdart/pycopia,kdart/pycopia,kdart/pycopia,kdart/pycopia | core/pycopia/plistconfig.py | core/pycopia/plistconfig.py | #!/usr/bin/python2
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
# Copyright (C) 2010 Keith Dart <keith@dartworks.biz>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Fre... | apache-2.0 | Python | |
b6aedc1589c754bb867381e309aba5ae19f7bb1a | Create GDAL_SaveRaster.py | leandromet/Geoprocessamento---Geoprocessing,leandromet/Geoprocessamento---Geoprocessing,leandromet/Geoprocessamento---Geoprocessing,leandromet/Geoprocessamento---Geoprocessing,leandromet/Geoprocessamento---Geoprocessing | GDAL_SaveRaster.py | GDAL_SaveRaster.py |
from osgeo import gdal
def save_raster ( output_name, raster_data, dataset, driver="GTiff" ):
"""
A function to save a 1-band raster using GDAL to the file indicated
by ``output_name``. It requires a GDAL-accesible dataset to collect
the projection and geotransform.
"""
# Open the reference... | mit | Python | |
cf066fd373f0d12a43bad24db9e645e257617306 | add consts | nakagami/pydrda | drda/consts.py | drda/consts.py | ##############################################################################
# The MIT License (MIT)
#
# Copyright (c) 2016 Hajime Nakagami
#
# 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... | mit | Python | |
542731f7fb3f5d09c4de4340f7ce18b7cbf41172 | Create Client.py | Elviond/A4TL | Client.py | Client.py | from Networking import Client
client = Client()
client.connect('10.42.42.25', 12345).send({'Ordre':'Timelapse', 'Action':["/home/pi/photo3", 24, 30, 0.25, False]})
reponse = client.recv()
client.close()
| mit | Python | |
745adf9898e6dc80d37f1a0c3c4361acf76f2feb | Create main.py | ch4rliem4rbles/slack-five | main.py | main.py | import webapp2
import logging
import json
import utils
import re
import advanced
class show_search_results(utils.BaseHandler):
def post(self):
#get info about slack post
token = self.request.get('token')
channel = self.request.get('channel')
text = self.request.g... | mit | Python | |
42753fc71b6a7cbe8697ba0eb053fdbc39c852a1 | add test_eval | Akagi201/learning-python,Akagi201/learning-python,Akagi201/learning-python,Akagi201/learning-python,Akagi201/learning-python | misc/test_eval.py | misc/test_eval.py |
# eval
def main():
dictString = "{'Define1':[[63.3,0.00,0.5,0.3,0.0],[269.3,0.034,1.0,1.0,0.5]," \
"[332.2,0.933,0.2,0.99920654296875,1],[935.0,0.990,0.2,0.1,1.0]]," \
"'Define2':[[63.3,0.00,0.5,0.2,1.0],[269.3,0.034,1.0,0.3,0.5]," \
"[332.2,0.933,0.2, 0.4,0.6],[9... | mit | Python | |
293f0dde7f329399648317b8d67322604f2e9292 | Add window_title_async.py module | tobes/py3status,valdur55/py3status,ultrabug/py3status,hburg1234/py3status,Shir0kamii/py3status,tobes/py3status,alexoneill/py3status,guiniol/py3status,Andrwe/py3status,docwalter/py3status,ultrabug/py3status,valdur55/py3status,ultrabug/py3status,guiniol/py3status,valdur55/py3status,Spirotot/py3status,Andrwe/py3status,vvo... | py3status/modules/window_title_async.py | py3status/modules/window_title_async.py | """
Display the current window title with async update.
Uses asynchronous update via i3 IPC events.
Provides instant title update only when it required.
Configuration parameters:
- format : format of the title, default: "{title}".
- empty_title : string that will be shown instead of the title
... | bsd-3-clause | Python | |
a9da84352d6ff8b26a8e25ac9d15d5737c84225f | Add problem 12 | dimkarakostas/matasano-cryptochallenges | problem_12.py | problem_12.py | from crypto_library import ecb_aes
from problem_11 import distinguish_encryption_mode
from string import printable
'''
from crypto_library import BLOCKSIZE
import random
ENCRYPTION_KEY = ''.join(random.choice(printable) for _ in range(BLOCKSIZE))
'''
def new_encryption_oracle(adversary_input):
ENCRYPTION_KEY = '... | mit | Python | |
0ecc153d3946258f7daddd48bfc2870cb497b5db | Add IPlugSession interface | usingnamespace/pyramid_pluggable_session,sontek/pyramid_pluggable_session | pyramid_pluggable_session/interfaces.py | pyramid_pluggable_session/interfaces.py | from zope.interface import Interface
class IPlugSession(Interface):
""" In interface that describes a pluggable session
"""
def loads(session, request):
""" This function given a ``session`` and ``request`` should using the
``session_id`` attribute of the ``session``
This function... | isc | Python | |
a0d8eff20cfd8b60be005e31692af74837ca16f5 | test math.ceil() function | xmementoit/practiseSamples,xmementoit/practiseSamples,xmementoit/practiseSamples,xmementoit/practiseSamples,xmementoit/practiseSamples,xmementoit/practiseSamples,xmementoit/practiseSamples,xmementoit/practiseSamples | pythonPractiseSamples/mathExcercises.py | pythonPractiseSamples/mathExcercises.py | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 Damian Ziobro <damian@xmementoit.com>
import unittest
import math
class TestMathMethods(unittest.TestCase):
def setUp(self):
self.number = 3.5
def test_ceil(self):
self.assertEqual(math.ceil(self.number), 4... | apache-2.0 | Python | |
44130357b98001790547d53b7e1080e79842a058 | add group recorded | peruana80/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 | |
4569c22d2d0245641e0c2696f798f273405c6bee | Test recorded and exported to the project | spcartman/python_qa | 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... | mit | Python | |
1ce8285228c29370ad4230f7968abdd7436ff250 | update nth stair | bkpathak/Programs-Collections,bkpathak/HackerRank-Problems,bkpathak/HackerRank-Problems,bkpathak/Programs-Collections | IK/DP/nth_stair.py | IK/DP/nth_stair.py | # http://www.geeksforgeeks.org/count-ways-reach-nth-stair/
# This problem is simpl extension of Fibonacci Number
# Case 1 when person can take 1 or 2 steps
def fibonacci_number(n):
if n <= 1:
return n
return fibonacci_number(n-1) + fibonacci_number(n-2)
def count_ways(s):
# ways(1) = fib(2) = 1
... | mit | Python | |
d5a42bd23e7227e041aa3d748765b056e3294a0d | Create infogan.py | kozistr/Awesome-GANs | InfoGAN/infogan.py | InfoGAN/infogan.py | # initial python file
| mit | Python | |
af5c39347863f2804bb1e36cb0bf6f1a049530c2 | add 15-26 | MagicForest/Python | src/training/Core2/Chapter15RegularExpressions/exercise15_26.py | src/training/Core2/Chapter15RegularExpressions/exercise15_26.py | import re
def replace_email(a_string, new_email):
return re.sub('\w+@\w+\.\w+', new_email, a_string)
if __name__ == '__main__':
assert 'wd@wd.wd xx wd@wd.wd b' == replace_email('abc@126.com xx a@133.com b', 'wd@wd.wd')
assert 'abb' == replace_email('abb', 'wd@wd.wd')
print 'all passed.'
| apache-2.0 | Python | |
f730a8cfd6700eeedf1cbcc5df8b3b97f918f0fa | Add filterset for tag page, refs #450 | stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten | grouprise/features/tags/filters.py | grouprise/features/tags/filters.py | from django.forms.widgets import CheckboxInput
from django_filters import BooleanFilter
from django_filters.widgets import BooleanWidget
from grouprise.features.associations.filters import ContentFilterSet
class TagContentFilterSet(ContentFilterSet):
tagged_only = BooleanFilter(
label='nur verschlagw... | agpl-3.0 | Python | |
42c7db3f9422d38b0d7273ad8f95db8183b69a9c | Add a python version of the lineset_test ... it demonstrates how one has to run eve from python. | sawenzel/root,nilqed/root,lgiommi/root,Duraznos/root,veprbl/root,gganis/root,evgeny-boger/root,Y--/root,mhuwiler/rootauto,beniz/root,olifre/root,Duraznos/root,Y--/root,omazapa/root,gbitzes/root,CristinaCristescu/root,arch1tect0r/root,Duraznos/root,davidlt/root,root-mirror/root,esakellari/root,cxx-hep/root-cern,karies/r... | tutorials/eve/lineset_test.py | tutorials/eve/lineset_test.py | ## Translated from 'lineset_test.C'.
## Run as: python -i lineset_test.py
import ROOT
ROOT.PyConfig.GUIThreadScheduleOnce += [ ROOT.TEveManager.Create ]
def lineset_test(nlines = 40, nmarkers = 4):
r = ROOT.TRandom(0)
s = 100
ls = ROOT.TEveStraightLineSet()
for i in range(nlines):
ls.AddLine... | lgpl-2.1 | Python | |
73f3fa2657485c4fce812f67c3430be553307413 | Include fixtures for setting up the database | mattrobenolt/warehouse,mattrobenolt/warehouse,mattrobenolt/warehouse,robhudson/warehouse,robhudson/warehouse,techtonik/warehouse,techtonik/warehouse | tests/conftest.py | tests/conftest.py | # Copyright 2013 Donald Stufft
#
# 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, so... | apache-2.0 | Python | |
f681f6ac7764b0944434c69febb2b3b778f2aad7 | add 2 | weixsong/algorithm,weixsong/algorithm,weixsong/algorithm | leetcode/2.py | leetcode/2.py | # Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def addTwoNumbers(self, l1, l2):
"""
:type l1: ListNode
:type l2: ListNode
:rtype: ListNode
"""
... | mit | Python | |
45686564547ccf1f40516d2ecbcf550bb904d59c | Create lc1032.py | FiveEye/ProblemSet,FiveEye/ProblemSet | LeetCode/lc1032.py | LeetCode/lc1032.py | import queue
class Node:
def __init__(self, s=''):
self.s = s
self.end = False
self.fail = None
self.children = None
def get(self, index):
if self.children == None:
return None
return self.children[index]
def set(self, index, node):
if se... | mit | Python | |
2c2d594b7d8d5d74732e30c46859779b88621baa | Create __init__.py | TryCatchHCF/DumpsterFire | FireModules/__init__.py | FireModules/__init__.py | mit | Python | ||
328274b6a938667326dbd435e7020c619cd80d3d | Add EmojiUtils.py | yaoms/EmojiCodec | EmojiUtils.py | EmojiUtils.py | # coding=utf-8
# 2015-11-19
# yaoms
# emoji 表情符号转义
"""
emoji 表情 编码/解码 类
encode_string_emoji(string)
decode_string_emoji(string)
"""
import re
def __is_normal_char(c):
"""
判断字符是不是普通字符, 非普通字符, 认定为 emoji 字符
:param c:
:return: 普通字符 True, Emoji 字符 False
"""
i = ord(c)
return (
i... | apache-2.0 | Python | |
54a10f78a6c71d88e1c2441bb636e6b636f74613 | add unit test | scottsilverlabs/raspberrystem,scottsilverlabs/raspberrystem,scottsilverlabs/raspberrystem,scottsilverlabs/raspberrystem | rstem/led2/test_unittest.py | rstem/led2/test_unittest.py | #!/usr/bin/python3
import unittest
import os
from rstem import led2
# TODO: single setup for all testcases????
# TODO: make hardware versions that you can optionally skip
if __name__ == '__main__':
unittest.main()
def query(question):
ret = int(input(question + " [yes=1,no=0]: "))
if ret == 1:
... | apache-2.0 | Python | |
f0587e44be1c7f85dbbf54e1d6c47458a4960d7c | Create date_time.py | cturko/Pyrus | date_time.py | date_time.py | #!/usr/bin/env python
# -*_ coding: utf-8 -*-
import datetime
import sys
def main():
now = datetime.datetime.now()
while True:
user_request = input("\nCurrent [time, day, date]: ")
if user_request == "quit":
sys.exit()
if user_request == "time":
second = str... | mit | Python | |
c15f8805d3ce5eab9f46dc24a6845ce27b117ac3 | Add TeamTest | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/account/tests/test_team.py | dbaas/account/tests/test_team.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.test import TestCase
from django.db import IntegrityError
from . import factory
from ..models import Team
from drivers import base
import logging
LOG = logging.getLogger(__name__)
class TeamTest(TestCase):
def setUp(sel... | bsd-3-clause | Python | |
264863c1a8d60dd35babec22470626d13ebf3e66 | Remove unused import.t | sidja/django-debug-toolbar,django-debug-toolbar/django-debug-toolbar,megcunningham/django-debug-toolbar,megcunningham/django-debug-toolbar,jazzband/django-debug-toolbar,stored/django-debug-toolbar,spookylukey/django-debug-toolbar,ChristosChristofidis/django-debug-toolbar,peap/django-debug-toolbar,Endika/django-debug-to... | debug_toolbar/panels/__init__.py | debug_toolbar/panels/__init__.py | from __future__ import absolute_import, unicode_literals
import warnings
from django.template.loader import render_to_string
class Panel(object):
"""
Base class for panels.
"""
# name = 'Base'
# template = 'debug_toolbar/panels/base.html'
# If content returns something, set to True in subcl... | from __future__ import absolute_import, unicode_literals
import warnings
from django.template.defaultfilters import slugify
from django.template.loader import render_to_string
class Panel(object):
"""
Base class for panels.
"""
# name = 'Base'
# template = 'debug_toolbar/panels/base.html'
#... | bsd-3-clause | Python |
4bfd69bc49b17e7844077949560bd6259ea33e9b | test the root scrubadub api | datascopeanalytics/scrubadub,deanmalmgren/scrubadub,datascopeanalytics/scrubadub,deanmalmgren/scrubadub | tests/test_api.py | tests/test_api.py | import unittest
import scrubadub
class APITestCase(unittest.TestCase):
def test_clean(self):
"""Test the top level clean api"""
self.assertEqual(
scrubadub.clean("This is a test message for example@exampe.com"),
"This is a test message for {{EMAIL}}",
)
def te... | mit | Python | |
cd906789b4ed339542722c04dd09f8aca04fd7ff | add missing revision | crowdresearch/daemo,crowdresearch/crowdsource-platform,crowdresearch/daemo,crowdresearch/daemo,crowdresearch/daemo,crowdresearch/crowdsource-platform,crowdresearch/crowdsource-platform,crowdresearch/crowdsource-platform | crowdsourcing/migrations/0170_task_price.py | crowdsourcing/migrations/0170_task_price.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-05-24 00:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crowdsourcing', '0169_auto_20170524_0002'),
]
operations = [
migrations.AddFie... | mit | Python | |
369dff642883ded68eca98754ce81369634da94d | Add box tests | willmcgugan/rich | tests/test_box.py | tests/test_box.py | import pytest
from rich.box import ASCII, DOUBLE, ROUNDED, HEAVY
def test_str():
assert str(ASCII) == "+--+\n| ||\n|-+|\n| ||\n|-+|\n|-+|\n| ||\n+--+\n"
def test_repr():
assert repr(ASCII) == "Box(...)"
def test_get_top():
top = HEAVY.get_top(widths=[1, 2])
assert top == "┏━┳━━┓"
def test_get_r... | mit | Python | |
dbaad481ab9ddbdccd4430765e3eee0d0433fbd8 | Create doc_check.py | kawaiigamer/py_parsers | doc_check.py | doc_check.py | import requests,json,ctypes,time
tasks = [
# speciality_id, clinic_id, name '' - for any name, description
(40,279,'','Невролог'),
(2122,314,'Гусаров','Дерматолог'),
]
h = { 'Host': 'gorzdrav.spb.ru',
'Connection': 'keep-alive',
'Accept': '*/*',
'X-Requested-With': 'XMLHttpRequest',
'User-Agent':... | unlicense | Python | |
8eec6e7596e8a5bd8159753be2aeaaffb53f613b | Add Python version | delight-im/ShortURL,delight-im/ShortURL,delight-im/ShortURL,delight-im/ShortURL,delight-im/ShortURL,delight-im/ShortURL,delight-im/ShortURL,delight-im/ShortURL,delight-im/ShortURL,delight-im/ShortURL,delight-im/ShortURL | Python/shorturl.py | Python/shorturl.py | class ShortURL:
"""
ShortURL: Bijective conversion between natural numbers (IDs) and short strings
ShortURL.encode() takes an ID and turns it into a short string
ShortURL.decode() takes a short string and turns it into an ID
Features:
+ large alphabet (51 chars) and thus very short resulting strings
+ proof ag... | mit | Python | |
7a5ca2f63dab36664ace637b713d7772870a800a | Create make-fingerprint.py | tfukui95/tor-experiment,tfukui95/tor-experiment | make-fingerprint.py | make-fingerprint.py | mit | Python | ||
cd7187dc916ebbd49a324f1f43b24fbb44e9c9dc | Create afstand_sensor.py | marcwagner/pi-robot,marcwagner/pi-robot,marcwagner/pi-robot,marcwagner/pi-robot,marcwagner/pi-robot | afstand_sensor.py | afstand_sensor.py | import gpiozero
from time import sleep
sensor = gpiozero.DistanceSensor(echo=18,trigger=17,max_distance=2, threshold_distance=0.5)
led = gpiozero.LED(22)
while True:
afstand = round(sensor.distance*100)
print('obstakel op', afstand, 'cm')
if sensor.in_range:
led.on()
sleep(1)
led.off()
| mit | Python | |
f1bda6deeb97c50a5606bea59d1684d6d96b10b4 | Create api_call.py | tme-dev/TME-API,tme-dev/TME-API,tme-dev/TME-API | PYTHON/api_call.py | PYTHON/api_call.py | def product_import_tme(request):
# /product/product_import_tme/
token = '<your's token(Anonymous key:)>'
app_secret = '<Application secret>'
params = {
'SymbolList[0]': '1N4007',
'Country': 'PL',
'Currency': 'PLN',
'Language': 'PL',
}
response = api_call('Produ... | mit | Python | |
1166ef7520ee26836402f028cb52ed95db7173e6 | Add CTC_new_refund_limited_all_payroll migration file | OpenSourcePolicyCenter/PolicyBrain,OpenSourcePolicyCenter/PolicyBrain,OpenSourcePolicyCenter/PolicyBrain,OpenSourcePolicyCenter/webapp-public,OpenSourcePolicyCenter/webapp-public,OpenSourcePolicyCenter/webapp-public,OpenSourcePolicyCenter/webapp-public,OpenSourcePolicyCenter/PolicyBrain | webapp/apps/taxbrain/migrations/0058_taxsaveinputs_ctc_new_refund_limited_all_payroll.py | webapp/apps/taxbrain/migrations/0058_taxsaveinputs_ctc_new_refund_limited_all_payroll.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('taxbrain', '0057_jsonreformtaxcalculator_errors_warnings_text'),
]
operations = [
migrations.AddField(
model_nam... | mit | Python | |
55d9610f519713b889ffb68daa3c72ef6c349d3d | Add ExportPPMs.py script. | adobe-type-tools/fontlab-scripts,moyogo/fontlab-scripts | TrueType/ExportPPMs.py | TrueType/ExportPPMs.py | #FLM: Export PPMs
"""
This script will write (or overwrite) a 'ppms' file in the same directory
as the opened VFB file. This 'ppms' file contains the TrueType stem values
and the ppm values at which the pixel jumps occur. These values can later
be edited as the 'ppms' file is used as part of the conversion process.... | mit | Python | |
5aff575cec6ddb10cba2e52ab841ec2197a0e172 | Add SignalTimeout context manager | MatthewCox/PyMoronBot,DesertBot/DesertBot | Utils/SignalTimeout.py | Utils/SignalTimeout.py | # Taken from https://gist.github.com/ekimekim/b01158dc36c6e2155046684511595d57
import os
import signal
import subprocess
class Timeout(Exception):
"""This is raised when a timeout occurs"""
class SignalTimeout(object):
"""Context manager that raises a Timeout if the inner block takes too long.
Will even... | mit | Python | |
e18ee4aacd42ec28b2d54437f61d592b1cfaf594 | Create national_user_data_pull.py | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | custom/icds_reports/management/commands/national_user_data_pull.py | custom/icds_reports/management/commands/national_user_data_pull.py | import csv
from django.core.management.base import BaseCommand
from corehq.apps.reports.util import get_all_users_by_domain
from custom.icds_reports.const import INDIA_TIMEZONE
from custom.icds_reports.models import ICDSAuditEntryRecord
from django.db.models import Max
class Command(BaseCommand):
help = "Custom ... | bsd-3-clause | Python | |
ed157602d965be952aadc9fe33b2e517c7f98ccf | Add urls | funkybob/dumpling,funkybob/dumpling | dumpling/urls.py | dumpling/urls.py | from django.conf.urls import include, url
from . import views
urlpatterns = [
url(r'css/(?P<name>.*)\.css$', views.styles, name='styles'),
url(r'(?P<path>.*)', views.PageView.as_view()),
]
| mit | Python | |
380178c585d4b9e2689ffdd72c9fa80be94fe3a9 | add more calculation | kanhua/pypvcell | examples/ingap_gaas_radeta_paper.py | examples/ingap_gaas_radeta_paper.py | __author__ = 'kanhua'
import numpy as np
from scipy.interpolate import interp2d
import matplotlib.pyplot as plt
from scipy.io import savemat
from iii_v_si import calc_2j_si_eta, calc_3j_si_eta
if __name__=="__main__":
algaas_top_ere=np.logspace(-7,0,num=50)
algaas_mid_ere=np.logspace(-7,0,num=50)
eta_a... | apache-2.0 | Python | |
93b38901b25f6c5db4700343050c5bb2fc6ef7e6 | add utility to make digraph out of router | BrianHicks/emit,BrianHicks/emit,BrianHicks/emit | emit/graphviz.py | emit/graphviz.py | def make_digraph(router, name='router'):
header = 'digraph %s {\n' % name
footer = '\n}'
lines = []
for origin, destinations in router.routes.items():
for destination in destinations:
lines.append('"%s" -> "%s";' % (origin, destination))
return header + '\n'.join(lines) + foote... | mit | Python | |
c16620dffd2cd6396eb6b7db76a9c29849a16500 | Add support for cheminformatics descriptors | MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio | components/lie_structures/lie_structures/cheminfo_descriptors.py | components/lie_structures/lie_structures/cheminfo_descriptors.py | # -*- coding: utf-8 -*-
"""
file: cheminfo_molhandle.py
Cinfony driven cheminformatics fingerprint functions
"""
import logging
from twisted.logger import Logger
from . import toolkits
logging = Logger()
def available_descriptors():
"""
List available molecular descriptors for all active cheminformatics... | apache-2.0 | Python | |
718b8dcb87ae2b78e5ce0aded0504a81d599daf7 | Create envToFish.py | Sv3n/FishBashEnv,Sv3n/FishBashEnv | envToFish.py | envToFish.py | #!/usr/bin/env python
import os
import subprocess
badKeys = ['HOME', 'PWD', 'USER', '_', 'OLDPWD']
with open('profile.fish', 'w') as f:
for key, val in os.environ.items():
if key in badKeys:
continue
if key == 'PATH':
f.write("set -e PATH\n")
pathUnique = set(va... | unlicense | Python | |
01328db808d3f5f1f9df55117ef70924fb615a6a | Create config reader | braveheuel/python-escpos,python-escpos/python-escpos,belono/python-escpos | escpos/config.py | escpos/config.py | from __future__ import absolute_import
import os
import appdirs
from localconfig import config
from . import printer
from .exceptions import *
class Config(object):
_app_name = 'python-escpos'
_config_file = 'config.ini'
def __init__(self):
self._has_loaded = False
self._printer = None
... | mit | Python | |
0f43f3bdc9b22e84da51e490664aeedc4295c8c9 | Add test for ELB | achiku/jungle | tests/test_elb.py | tests/test_elb.py | # -*- coding: utf-8 -*-
from jungle import cli
def test_elb_ls(runner, elb):
"""test for elb ls"""
result = runner.invoke(cli.cli, ['elb', 'ls'])
assert result.exit_code == 0
def test_elb_ls_with_l(runner, elb):
"""test for elb ls -l"""
result = runner.invoke(cli.cli, ['elb', 'ls', '-l'])
as... | mit | Python | |
c1bf53c5c278cafa3b1c070f8a232d5820dcb7a4 | add elb list test. | jonhadfield/acli,jonhadfield/acli | tests/test_elb.py | tests/test_elb.py | from __future__ import (absolute_import, print_function, unicode_literals)
from acli.output.elb import (output_elb_info, output_elbs)
from acli.services.elb import (elb_info, elb_list)
from acli.config import Config
from moto import mock_elb
import pytest
from boto3.session import Session
session = Session(region_name=... | mit | Python | |
ee3e04d32e39d6ac7ef4ac7abc2363a1ac9b8917 | Add an example for the music module | derblub/pixelpi,marian42/pixelpi,derblub/pixelpi,derblub/pixelpi,marian42/pixelpi | example_music.py | example_music.py | from screenfactory import create_screen
from modules.music import Music
import config
import time
import pygame
screen = create_screen()
music = Music(screen)
music.start()
while True:
if config.virtual_hardware:
pygame.time.wait(10)
for event in pygame.event.get():
pass
else:
time.sleep(0.01) | mit | Python | |
9be3bf6d71c54fe95db08c6bc1cd969dfbb2ebd1 | Add Dia generated .py file | mteule/StationMeteo,mteule/StationMeteo | doc/StationMeteo.Diagram.py | doc/StationMeteo.Diagram.py | class Station :
def __init__(self) :
self.ser = SerialInput() #
self.parser = InputParser() #
self.datab = DatabManager() #
self.input = None # str
self.sensor_dict = dict('id': ,'name': ) #
self.last_meterings_list = LastMeteringList() #
pass
def __get_serial_input_content (self, ser) :
# return... | mit | Python | |
54718d95c4398d816546b45ed3f6a1faf2cdace8 | add modules/flexins/nsversion.py | maxli99/SmartChecker,maxli99/SmartChecker | modules/flexins/nsversion.py | modules/flexins/nsversion.py | """Analysis and Check the FlexiNS software version.
"""
import re
from libs.checker import ResultInfo,CheckStatus
from libs.log_spliter import LogSpliter,LOG_TYPE_FLEXI_NS
from libs.tools import read_cmdblock_from_log
## Mandatory variables
##--------------------------------------------
module_id = 'fnsbase.01'
tag ... | mit | Python | |
8cb94efa41e5350fccdc606f4959f958fc309017 | Add lldb debug visualizer | ChenJian345/realm-cocoa,lumoslabs/realm-cocoa,thdtjsdn/realm-cocoa,nathankot/realm-cocoa,xmartlabs/realm-cocoa,thdtjsdn/realm-cocoa,iOS--wsl--victor/realm-cocoa,AlexanderMazaletskiy/realm-cocoa,Havi4/realm-cocoa,brasbug/realm-cocoa,yuuki1224/realm-cocoa,zilaiyedaren/realm-cocoa,brasbug/realm-cocoa,sunfei/realm-cocoa,Pa... | tools/rlm_lldb.py | tools/rlm_lldb.py | ##############################################################################
#
# Copyright 2014 Realm 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/... | apache-2.0 | Python | |
ec41564bb99c8e79bcee1baabd75d2282601415c | add refund | Shopify/shopify_python_api | shopify/resources/refund.py | shopify/resources/refund.py | from ..base import ShopifyResource
class Refund(ShopifyResource):
_prefix_source = "/admin/orders/$order_id/"
| mit | Python | |
e7247c8c70a8cfefaee057e0c731aa5dab41ca9a | Create Contours.py | li8bot/OpenCV,li8bot/OpenCV | Contours.py | Contours.py | from PIL import Image
from pylab import *
#read image into an array
im = array(Image.open('s9.jpg').convert('L'))
#create a new figure
figure()
#don't use colors
gray()
#show contours
contour(im,origin = 'image')
axis('equal')
axis('off')
figure()
hist(im.flatten(),128)
show()
| mit | Python | |
9315c59746e2be9f2f15ff2bae02e1b481e9a946 | Create mr.py | umarags/test | mr.py | mr.py | Mapper:
#!/usr/bin/python
import sys
while 1:
line = sys.stdin.readline()
if line == "":
break
fields = line.split(",")
year = fields[1]
runs = fields[8]
if year == "1956":
print runs
Reducer:
#!/usr/bin/python
import sys
total_count = 0
for line in sys.stdin:
try:
... | artistic-2.0 | Python | |
c91e231c8d71458a7c347088ad7ec6431df234d7 | add ss.py to update proxy automatically | eilinx/lpthw | ss.py | ss.py | # -*- coding:utf8 -*-
import urllib2
response = urllib2.urlopen("http://boafanx.tabboa.com/boafanx-ss/")
html = response.read()
print(html[:20000]) | mit | Python | |
4015a16ec32660d25646f62772876d53166f46f2 | Add files via upload | ma-compbio/PEP | PEP.py | PEP.py | #-*- coding: utf-8 -*-
from optparse import OptionParser
import genLabelData,genUnlabelData,mainEdit,genVecs
import os.path
def parse_args():
parser = OptionParser(usage="RNA editing prediction", add_help_option=False)
parser.add_option("-f", "--feature", default="300", help="Set the number of features of Word2Vec... | mit | Python | |
8016dbc50238d2baf5f89c191ec3355df63af1a2 | Implement basic flask app to add subscribers | sagnew/ISSNotifications,sagnew/ISSNotifications,sagnew/ISSNotifications | app.py | app.py | import iss
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/', methods=['GET'])
def index():
return render_template()
@app.route('/subscribe', methods=['POST'])
def subscribe():
number = request.form['number']
lat = request.form['latitude']
lon = request.form['... | mit | Python | |
341890bfff2d8a831e48ebb659ce7f31d4918773 | Update utils.py | rishubhjain/commons,Tendrl/commons,r0h4n/commons | tendrl/commons/central_store/utils.py | tendrl/commons/central_store/utils.py | from tendrl.commons.etcdobj import fields
def to_etcdobj(cls_etcd, obj):
for attr, value in vars(obj).iteritems():
if attr.startswith("_"):
continue
if attr in ["attrs", "enabled", "obj_list", "obj_value", "atoms", "flows"]:
continue
setattr(cls_etcd, attr, to_etcd_... | from tendrl.commons.etcdobj import fields
def to_etcdobj(cls_etcd, obj):
for attr, value in vars(obj).iteritems():
if not attr.startswith("_"):
setattr(cls_etcd, attr, to_etcd_field(attr, value))
return cls_etcd
def to_etcd_field(name, value):
type_to_etcd_fields_map = {dict: fields.... | lgpl-2.1 | Python |
9d41eba840f954595a5cebbacaf56846cd52c1f4 | add new file | julia2288-cmis/julia2288-cmis-cs2 | functions.py | functions.py | def add(a,b):
| cc0-1.0 | Python | |
3000a9c0b7213a3aeb9faa0c01e5b779b2db36d4 | add a noisy bezier example (todo: should noise be part of the animation, or stay out of it?) | shimpe/pyvectortween,shimpe/pyvectortween | examples/example_bezier_noise.py | examples/example_bezier_noise.py | if __name__ == "__main__":
import gizeh
import moviepy.editor as mpy
from vectortween.BezierCurveAnimation import BezierCurveAnimation
from vectortween.SequentialAnimation import SequentialAnimation
import noise
def random_color():
import random
return (random.uniform(0, 1) fo... | mit | Python | |
05c7d62e0e26000440e72d0700c9806d7a409744 | Add migrations for game change suggestions | lutris/website,lutris/website,lutris/website,lutris/website | games/migrations/0023_auto_20171104_2246.py | games/migrations/0023_auto_20171104_2246.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-11-04 21:46
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('games', '0022_installer_reason'),
]
operations = [... | agpl-3.0 | Python | |
ad073b043b2965fb6a1939682aeca8ac90259210 | add daily import to database | kaija/taiwan_stockloader,kaija/taiwan_stockloader | daily.py | daily.py | import datetime
import httplib
import urllib
import redis
import json
from datetime import timedelta
#now = datetime.datetime.now();
#today = now.strftime('%Y-%m-%d')
#print today
rdb = redis.Redis('localhost')
def isfloat(value):
try:
float(value)
return True
except ValueError:
return False
def convfloat(v... | mit | Python | |
09d51aef1127b55fdc6bf595ca85285d9d7d64d1 | Add wrapwrite utility method | Alir3z4/python-gignore | gignore/utils.py | gignore/utils.py | import sys
def wrapwrite(text):
"""
:type text: str
:rtype: str
"""
text = text.encode('utf-8')
try: # Python3
sys.stdout.buffer.write(text)
except AttributeError:
sys.stdout.write(text)
| bsd-3-clause | Python | |
617a44bcce3e6e19383065f7fcab5b44ceb82714 | add logger | plazmer/micro-meta,plazmer/micro-meta | log.py | log.py | import logging
import sys
logger = logging.getLogger('micro-meta')
logger.setLevel(logging.DEBUG)
fh = logging.StreamHandler(sys.stdout)
fh.setLevel(logging.DEBUG)
logger.addHandler(fh)
logger.debug('test')
logger.info('test') | mit | Python | |
a38b313799b7c0cdc25ff68161c2b2890db8e16d | Create log.py | julioscalves/v-screen | log.py | log.py | import glob
import pandas as pd
logs = [log for log in glob.glob("*.log")]
dataset = {"id": [],
"pos": [],
"affinity (kcal/mol)": [],
"rmsd l.b.": [],
"rmsd u.b.": []}
for log in logs:
with open(log) as dock:
for line in dock.readlines():
if line.st... | mit | Python | |
7263d7546aec62834fa19f20854522eba4916159 | add simple http server | nickweinberg/Yomi-Game-Range-Tool,nickweinberg/Yomi-Game-Range-Tool,nickweinberg/Yomi-Game-Range-Tool | run.py | run.py | import sys
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
HandlerClass = SimpleHTTPRequestHandler
ServerClass = BaseHTTPServer.HTTPServer
Protocol = "HTTP/1.0"
if sys.argv[1:]:
port = int(sys.argv[1])
else:
port = 8000
server_address = ('127.0.0.1', port)
HandlerClass.proto... | mit | Python | |
e6d420296b3f2234382bdcdf1122abc59af148ed | add plot function for classification | berkeley-stat222/mousestyles,changsiyao/mousestyles,togawa28/mousestyles | mousestyles/visualization/plot_classification.py | mousestyles/visualization/plot_classification.py | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def plot_performance(model):
"""
Plots the performance of classification model.It
is a side-by-side barplot. For each strain, it plots
the precision, recall and F-1 measure.
Parameters
----------
model: string
... | bsd-2-clause | Python | |
a1ec669f4c494709dc9b8f3e47ff4f84b189b2e9 | add get_workflow_name.py | googleapis/nodejs-redis,googleapis/nodejs-redis,googleapis/nodejs-redis | .circleci/get_workflow_name.py | .circleci/get_workflow_name.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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | Python | |
3abf7e60d3bd028f86cb6aa2e1e1f3d4fff95353 | Create BinaryTreeMaxPathSum_001.py | Chasego/codirit,cc13ny/Allin,cc13ny/algo,Chasego/codirit,cc13ny/Allin,cc13ny/algo,cc13ny/algo,cc13ny/Allin,Chasego/codi,Chasego/codi,Chasego/codirit,Chasego/cod,cc13ny/algo,Chasego/codirit,Chasego/codi,Chasego/cod,cc13ny/Allin,Chasego/cod,Chasego/codi,Chasego/cod,cc13ny/algo,Chasego/codirit,cc13ny/Allin,Chasego/codi,Ch... | leetcode/124-Binary-Tree-Maximum-Path-Sum/BinaryTreeMaxPathSum_001.py | leetcode/124-Binary-Tree-Maximum-Path-Sum/BinaryTreeMaxPathSum_001.py | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def maxPathSum(self, root):
"""
:type root: TreeNode
:rtype: int
"""
totMax, bran... | mit | Python | |
59fd4bf04c8c89cdc87673de94788c5d34d4e5fe | Create Goldbach.py | ManuComp/Gooldbach | Goldbach.py | Goldbach.py | import math
#Funcion para saber si un numero es 3 o no
def es_primo(a):
contador = 0
verificar= False
for i in range(1,a+1):
if (a% i)==0:
contador = contador + 1
if contador >= 3:
verificar=True
break
if contador==2 or verificar==False:
return True
return False
#Creacion ... | unlicense | Python | |
e33774beb2f2b1264f654605294f0ad837fa7e8b | Add message_link function | coala/corobo,coala/corobo | utils/backends.py | utils/backends.py | """
Handle backend specific implementations.
"""
def message_link(bot, msg):
"""
:param bot: Plugin instance.
:param msg: Message object.
:returns: Message link.
"""
backend = bot.bot_config.BACKEND.lower()
if backend == 'gitter':
return 'https://gitter.im/{uri}?at={idd}'.format(m... | mit | Python | |
f509d556cc4a20b55be52f505fcee200c5d44ef2 | add rehex util | thelazier/sentinel,ivansib/sentinel,dashpay/sentinel,dashpay/sentinel,ivansib/sentinel,thelazier/sentinel | scripts/rehex.py | scripts/rehex.py | import simplejson
import binascii
import sys
import pdb
from pprint import pprint
import sys, os
sys.path.append( os.path.join( os.path.dirname(__file__), '..' ) )
sys.path.append( os.path.join( os.path.dirname(__file__), '..', 'lib' ) )
import dashlib
# =================================================================... | mit | Python | |
cf881dd1ba8c98dd116f2269bf0cfd38f14a7b40 | add a reel OVSFtree | Vskilet/UMTS-Multiplexing,Vskilet/UMTS-Multiplexing | OVSFTree.py | OVSFTree.py | import math
numberOfMobile=512
class Node:
def __init__(self, val):
self.l = None
self.r = None
self.v = val
class Tree:
def __init__(self):
self.root = None
self.root=Node(1)
thislevel = [self.root]
for i in range(0,math.ceil(math.log(numberOfMobile,2)))... | mit | Python | |
632c4dffe8a217ca07410d0a353455a4c6142d39 | Solve problem 29 | mazayus/ProjectEuler | problem029.py | problem029.py | #!/usr/bin/env python3
print(len(set(a**b for a in range(2, 101) for b in range(2, 101))))
| mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.