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 |
|---|---|---|---|---|---|---|---|---|
f8b6d423165694733e8b3352c520c6044ffad7da | add eval_sbd_multi.py | pfnet/chainercv,yuyu2172/chainercv,yuyu2172/chainercv,chainer/chainercv,chainer/chainercv | examples/instance_segmentation/eval_sbd_multi.py | examples/instance_segmentation/eval_sbd_multi.py | import argparse
import chainer
from chainer import iterators
import chainermn
from chainercv.datasets import sbd_instance_segmentation_label_names
from chainercv.datasets import SBDInstanceSegmentationDataset
from chainercv.evaluations import eval_instance_segmentation_voc
from chainercv.experimental.links import FCI... | mit | Python | |
ba769cd641fa2a5f1199de2c2743148437998d16 | Add Audit snapshot RBAC tests | plamut/ggrc-core,AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,plamut/ggrc-core | test/integration/ggrc_basic_permissions/test_audit_snapshot_rbac.py | test/integration/ggrc_basic_permissions/test_audit_snapshot_rbac.py | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Test audit RBAC"""
from os.path import abspath
from os.path import dirname
from os.path import join
from collections import defaultdict
from integration.ggrc.converters import TestCase
from integration.g... | apache-2.0 | Python | |
fe760be64eac3290a358e4a488af9946ea6f2a1d | Add management command to run SQL on form dbs | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/form_processor/management/commands/run_sql.py | corehq/form_processor/management/commands/run_sql.py | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import sys
import traceback
import attr
import gevent
from django.core.management.base import BaseCommand
from django.db import connections
from six.moves import input
from corehq.sql_db.util import ge... | bsd-3-clause | Python | |
88d336472f6c0be58816b790ccff811db0461f62 | Add cw_steps_in_primes.py | bowen0701/algorithms_data_structures | cw_steps_in_primes.py | cw_steps_in_primes.py | """Codewars: Steps in Primes
6 kyu
URL: https://www.codewars.com/kata/5613d06cee1e7da6d5000055/
The prime numbers are not regularly spaced. For example from 2 to 3 the step
is 1. From 3 to 5 the step is 2. From 7 to 11 it is 4. Between 2 and 50 we
have the following pairs of 2-steps primes:
3, 5 - 5, 7, - 11, 13, - ... | bsd-2-clause | Python | |
98bd406461b292e2cc31f4c315d64ea1ffa638c2 | Create problem5.py | Amapolita/MITx--6.00.1x- | W2/L4/problem5.py | W2/L4/problem5.py | # L4 PROBLEM 5
def clip(lo, x, hi):
'''
Takes in three numbers and returns a value based on the value of x.
Returns:
- lo, when x < lo
- hi, when x > hi
- x, otherwise
'''
return min(max(x, lo), hi)
| unlicense | Python | |
ae17bb1407f15ef989cfec48c39821bc602edfc8 | Upgrade manage.py to the new cli handler, and throw out some old dev code. Closes #330. | frankier/mezzanine,AlexHill/mezzanine,Cicero-Zhao/mezzanine,mush42/mezzanine,wbtuomela/mezzanine,tuxinhang1989/mezzanine,wyzex/mezzanine,jerivas/mezzanine,emile2016/mezzanine,frankchin/mezzanine,nikolas/mezzanine,spookylukey/mezzanine,douglaskastle/mezzanine,frankier/mezzanine,jerivas/mezzanine,biomassives/mezzanine,da... | mezzanine/project_template/manage.py | mezzanine/project_template/manage.py | #!/usr/bin/env python
import os
import sys
# Corrects some pathing issues in various contexts, such as cron jobs.
from settings import PROJECT_ROOT
os.chdir(PROJECT_ROOT)
# Add the site ID CLI arg to the environment, which allows for the site
# used in any site related queries to be manually set for management
# co... | #!/usr/bin/env python
# When project_template is used as the actual project during Mezzanine
# development, insert the development path into sys.path so that the
# development version of Mezzanine is used rather than the installed
# version.
import os
import sys
project_path = os.path.dirname(os.path.abspath(__file__)... | bsd-2-clause | Python |
1040e17e006fef93d990a6212e8be06e0a818c2f | Update middleware syntax with "TykGateway" | mvdan/tyk,nebolsin/tyk,nebolsin/tyk,lonelycode/tyk,mvdan/tyk,mvdan/tyk,lonelycode/tyk,mvdan/tyk,nebolsin/tyk,lonelycode/tyk,mvdan/tyk,mvdan/tyk,nebolsin/tyk,mvdan/tyk,nebolsin/tyk,nebolsin/tyk,mvdan/tyk,nebolsin/tyk,nebolsin/tyk | middleware/python/test_middleware.py | middleware/python/test_middleware.py | from tyk.decorators import *
from tyk.gateway import TykGateway as tyk
@Pre
def AddSomeHeader(request, session):
request['SetHeaders']['SomeHeader'] = 'python'
tyk.store_data( "cool_key", "cool_value", 300 )
return request, session
def NotARealHandler():
pass
| from tyk.decorators import *
@Pre
def AddSomeHeader(request, session):
# request['Body'] = 'tyk=python'
request['SetHeaders']['SomeHeader'] = 'python2'
return request, session
def NotARealHandler():
pass
| mpl-2.0 | Python |
58cd65effda954c642eafadc837f64dfafe85f27 | Create higgsml-run.py | BoltzmannBrain/Kaggle_Higgs | higgsml-run.py | higgsml-run.py | #-------------------------------------------------------------------------------
# Name: higgsml-run.py
# Purpose: Run the Higgs classifier
#
# Author: Alexander Lavin
#
# Created: 15/09/2014
# Copyright: (c) Alexander Lavin 2014
# alexanderlavin.com
#---------------------------------... | mit | Python | |
a804778f39fbe7b195af790111889b62b5b8fa27 | reformat json | shnizzedy/FOuLARD,shnizzedy/FOuLARD,shnizzedy/FOuLARD,shnizzedy/FOuLARD,shnizzedy/FOuLARD | data/reformat_json.py | data/reformat_json.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 20 17:09:49 2017
@author: jon.clucas
"""
import json
with open('lpt.json', 'r') as f:
data = json.load(f)
new_json = []
for node in data["_nodes"]:
new_json.append({"name" : node, "type": "unclassified", "depends" : []})
for suc in data... | mit | Python | |
4ee6e8507008884f2dee66bc5e40b18fb20658cd | Create robot.py | iaalm/StarJeweledRobot | robot.py | robot.py | import PIL.ImageGrab
from PIL import Image
import time
import win32api
import win32con
time.sleep(3)
zero_count = 0
f = open('p.txt',"a")
while True:
time.sleep(0.4)
im = PIL.ImageGrab.grab()
#im.show()
#im.save('example.bmp')
#im = Image.open('example.bmp')
#nim = im.crop((929,72,1338,481))
def getGrid(im,x,y):... | mit | Python | |
4ea442f4c08783495b7508d56e2383b7c92a2027 | implement TransformationsFilter | googlei18n/ufo2ft,moyogo/ufo2ft,jamesgk/ufo2fdk,googlefonts/ufo2ft,jamesgk/ufo2ft | Lib/ufo2ft/filters/transformations.py | Lib/ufo2ft/filters/transformations.py | from __future__ import (
print_function, division, absolute_import, unicode_literals)
import math
from collections import namedtuple
import logging
from ufo2ft.filters import BaseFilter
from fontTools.misc.py23 import round
from fontTools.misc.transform import Identity
from fontTools.pens.recordingPen import Rec... | mit | Python | |
b8fab8199d3689800aed6a21ff1a58f04494838b | Add setup.py | jcrist/dask-searchcv,dask/dask-ml,dask/dask-ml,jcrist/dask-learn | setup.py | setup.py | from setuptools import setup
install_requires = ["dask >= 0.8.2",
"scikit-learn >= 0.17.1",
"numpy",
"multipledispatch"]
setup(name='dask-learn',
version='0.1.0',
license='BSD',
description='Machine Learning with Dask',
url='http://gi... | bsd-3-clause | Python | |
da19f79fad5d30cc75b2314dd91440de42176165 | Add setup.py and register package on pypi | vmalavolta/fabix | setup.py | setup.py | from setuptools import setup, find_packages
from fabix import __version__
setup(
name='fabix',
version=__version__,
description="Fabix is a serie of functions built on top of fabric and cuisine to easily deploy python web projects.",
long_description=open('README.md', 'rb').read(),
keywords=['fabri... | mit | Python | |
88d87f4051629c6a32e458077c543275eed0243e | Fix install of pyYAML on Travis | yuvipanda/jupyterhub-kubernetes-spawner,jupyterhub/kubespawner,ktong/kubespawner | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='jupyterhub-kubespawner',
version='0.5.1',
install_requires=[
'jupyterhub',
'pyYAML',
'kubernetes==2.*',
'escapism',
'jupyter',
],
setup_requires=['pytest-runner'],
tests_require=['pytest'],
desc... | from setuptools import setup, find_packages
setup(
name='jupyterhub-kubespawner',
version='0.5.1',
install_requires=[
'jupyterhub',
'pyyaml',
'kubernetes==2.*',
'escapism',
'jupyter',
],
setup_requires=['pytest-runner'],
tests_require=['pytest'],
desc... | bsd-3-clause | Python |
abcad086b5d332254c6f71f3f82e6e074ca889fa | Add setup file | sembug/pythontalks | setup.py | setup.py | from setuptools import setup
setup(name='PythonTalks',
version='1.0',
description='OpenShift App',
author='Roberto Nunes',
author_email='ranunes@msn.com',
url='http://www.python.org/sigs/distutils-sig/',
install_requires=['Flask==0.10.1'],
)
| mit | Python | |
5f3310632c2c51f969bd4bba31373af9a2d0c507 | add bulk archive script | praekeltfoundation/ndoh-hub,praekeltfoundation/ndoh-hub,praekeltfoundation/ndoh-hub | scripts/migrate_to_rapidpro/bulk_archive_chats.py | scripts/migrate_to_rapidpro/bulk_archive_chats.py | import csv
import json
import time
from datetime import datetime
import pytz
import requests
from six.moves import urllib_parse
from temba_client.v2 import TembaClient
RAPIDPRO_URL = "https://rapidpro.qa.momconnect.co.za/"
RAPIDPRO_TOKEN = ""
TURN_URL = "https://whatsapp.turn.io"
TURN_TOKEN = ""
filename = "turn_op... | bsd-3-clause | Python | |
b2f288fe860d9afe0cf66f7177ecb9f32afd815d | Add setup.py file to enable installation as a package | MikeVasmer/GreenGraphCoursework | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name = "Greengraph",
version = "0.1",
packages = find_packages(exclude=["*test"]),
scripts = ["scripts/greengraph"],
install_requires = ["argparse","matplotlib"]
)
| mit | Python | |
6c509839c8dadd42bf3ac84903621a673c0bd0f9 | add a xml -> sqlite database script | d1b/python-nmap-xml-output-parser | nmap_xml_to_sqlite.py | nmap_xml_to_sqlite.py | #!/usr/bin/env python
from lxml import etree
import sqlite3
import os
import datetime
__program__ = 'python_convert_nmap_xml_to_sqlite_db'
___author__ = 'dave b. <db@d1b.org>'
__license__ = 'GPL v2'
class nmap_xml_to_sqlite:
def __init__(self, filename, store_p=os.path.expanduser('~/.nmap_pdb/')):
self.filename = ... | bsd-2-clause | Python | |
f76aed1a75f38ce57f61b14c28b772107e8108ca | Update to docs. | QuentinAndre/pyprocessmacro | setup.py | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import pyprocessmacro
setup(
name='PyProcessMacro',
version=pyprocessmacro.__version__,
packages=find_packages(),
author="Quentin André",
author_email="quentin.andre@insead.edu",
description="A Python library for moderat... | mit | Python | |
1a4ec017f1be36523c0d7449979cc4041a4b2857 | Add missing class | esentino/IronMud | ironmud/gui.py | ironmud/gui.py | # -*- coding: utf-8 -*-
import curses
class Gui:
screen = None
screen_width = None
screen_height = None
def __init__(self):
self.screen = curses.initscr()
self.screen_widht = curses.LINES
self.screen_height = curses.COLS
def drawMainMenu(self):
self.screen.addstr... | mit | Python | |
6534d06c450be73044d8130cfa6a534f7bff885f | Add troposphere cloudformation domain and ssl script | MinnSoe/ifyoupayme,MinnSoe/ifyoupayme,MinnSoe/ifyoupayme | iypm_domain.py | iypm_domain.py | import sys
try:
from troposphere import Join, Sub, Output, Export
from troposphere import Parameter, Ref, Template
from troposphere.route53 import HostedZone
from troposphere.certificatemanager import Certificate
except ImportError:
sys.exit('Unable to import troposphere. '
'Try "pip i... | mpl-2.0 | Python | |
22e4ee560465a633f7dd8e84a2e7088d8dcf547f | Add OSU Micro-Benchmarks package (#822) | EmreAtes/spack,matthiasdiener/spack,mfherbst/spack,LLNL/spack,tmerrick1/spack,EmreAtes/spack,krafczyk/spack,iulian787/spack,mfherbst/spack,EmreAtes/spack,iulian787/spack,TheTimmy/spack,mfherbst/spack,EmreAtes/spack,mfherbst/spack,tmerrick1/spack,matthiasdiener/spack,krafczyk/spack,LLNL/spack,lgarren/spack,skosukhin/spa... | var/spack/repos/builtin/packages/osu-micro-benchmarks/package.py | var/spack/repos/builtin/packages/osu-micro-benchmarks/package.py | from spack import *
class OsuMicroBenchmarks(Package):
"""The Ohio MicroBenchmark suite is a collection of independent MPI
message passing performance microbenchmarks developed and written at
The Ohio State University. It includes traditional benchmarks and
performance measures such as latency, bandwid... | lgpl-2.1 | Python | |
2d1ae568076aebaa78975225eca57d02f6845ca2 | Add setup.py | j4mie/rediset,j4mie/rediset | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from distutils.core import setup
setup(
name='rediset',
version='0.0.1',
description='Redis set abstraction',
author='Jamie Matthews',
author_email='jamie.matthews@gmail.com',
url='http://github.com/j4mie/rediset',
py_modules=['rediset'],
)
| unlicense | Python | |
dca3dacc9dae002747edf809d0594c86e48d2b2a | Add setup.py | orcasgit/python-healthvault | setup.py | setup.py | from distutils.core import setup
setup(
name='python-healthvault',
version='0.0.1',
packages=['healthvaultlib', 'healthvaultlib.Crypto', 'healthvaultlib.Crypto.PublicKey',
'healthvaultlib.Crypto.Util', 'webapp'],
url='https://github.com/caktus/python-healthvault',
license='Apache 2.0'... | mit | Python | |
7b1afe134ae8c31a68e707e829139abe9d22d7d0 | add setup.py | pdebuyl/pyh5md | setup.py | setup.py | """
pyh5md is a library to read and write easily H5MD files. H5MD is a file format
specification based on HDF5 to store molecular data (http://nongnu.org/h5md/).
pyh5md is built on top of h5py, the Python HDF5 library by Andrew Colette.
"""
from setuptools import setup
setup(name="pyh5md",
version="1.0-dev",
... | bsd-3-clause | Python | |
369f937ca6cf42352167efa1e749d617c5ddf1cb | add setup.py | greysAcademicCode/batch-iv-analysis,greysAcademicCode/batch-iv-analysis | setup.py | setup.py | import sys
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["os","scipy.sparse.linalg","scipy.sparse.csgraph","scipy.special","matplotlib.backends.backend_tkagg"], "excludes": ["tkinter","sympy"]}
# GUI applications req... | mit | Python | |
f464144e3e05caeaabbfeda7033dc8903769eb7d | bump version. | michelp/xodb | setup.py | setup.py | #!/usr/bin/env python
"""
====
xodb
====
Development Version
-------------------
The hg `xodb tip`_ can be installed via ``easy_install xodb==dev``.
.. _xodb tip: http://bitbucket.org/pelletier_michel/xodb/get/tip.zip#egg=xodb-dev
"""
from setuptools import setup, find_packages
setup(
name="xodb",
version="0.6... | #!/usr/bin/env python
"""
====
xodb
====
Development Version
-------------------
The hg `xodb tip`_ can be installed via ``easy_install xodb==dev``.
.. _xodb tip: http://bitbucket.org/pelletier_michel/xodb/get/tip.zip#egg=xodb-dev
"""
from setuptools import setup, find_packages
setup(
name="xodb",
version="0.6... | mit | Python |
70df58890bb1f0392c62d54b1faef9d4c8d5b4f1 | Fix apache license reference in setup metadata | Princeton-CDH/django-pucas,Princeton-CDH/django-pucas | setup.py | setup.py | import os
from setuptools import find_packages, setup
from pucas import __version__
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
test_requi... | import os
from setuptools import find_packages, setup
from pucas import __version__
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
test_requi... | apache-2.0 | Python |
23fcadead3720a92c913bdf948956506ea657f43 | add host model | Cepave/dashboard,Cepave/dashboard,Cepave/dashboard,Cepave/dashboard | rrd/model/host.py | rrd/model/host.py | #-*- coding:utf-8 -*-
from rrd.store import portal_db_conn as db_conn
"""
* @class name: Host(object)
* @description: This class implements search method for "host" table.
* @related issues: OWL-295
* @param: object
* @return: void
* @author: Don Hsieh
* @since: 01/25/20... | apache-2.0 | Python | |
6c41f1dbbfd590f2c713bc619bed2fdacd32df2c | Reduce console spew from dev server | catapult-project/catapult-csm,scottmcmaster/catapult,sahiljain/catapult,dstockwell/catapult,zeptonaut/catapult,dstockwell/catapult,SummerLW/Perf-Insight-Report,SummerLW/Perf-Insight-Report,catapult-project/catapult,sahiljain/catapult,benschmaus/catapult,catapult-project/catapult-csm,catapult-project/catapult-csm,catapu... | run_dev_server.py | run_dev_server.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import os
import sys
import time
import SimpleHTTPServer
import BaseHTTPServer
from build import calcdeps
DEFAULT... | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import os
import sys
import time
import SimpleHTTPServer
import BaseHTTPServer
from build import calcdeps
DEFAULT... | bsd-3-clause | Python |
c0a9f6fc60ece5daae76c213a9d1997be49c4c45 | Add setup script. | helgee/plyades | setup.py | setup.py | #! /usr/bin/env python
from distutils.core import setup
setup(name="Plyades",
version="0.0.1",
description="A Python Astrodynamics Library",
author="Helge Eichhorn",
author_email="mail@helgeeichhorn.de",
url="https://github.com/helgee/plyades",
packages=["plyades", "plyades.constan... | mit | Python | |
8cb90282c5952160fcef15a12a1daed7fdd1d121 | Prepare for interview questions | noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit | decorator_examples.py | decorator_examples.py | def identity_decorator(fn):
def wrapper(*args):
return fn(*args)
return wrapper
@identity_decorator
def stringify(obj):
return str(obj)
print(stringify(78))
def uppercase(fn):
def wrapper(*args):
result = fn(*args)
return result.upper()
return wrapper
@uppercase
def s... | mit | Python | |
64adad6e235235367c3d12f5f00c2185aaf785f3 | add a package setup/install file for rap with tumluliu/pymmrouting as a reference | tumluliu/rap | setup.py | setup.py | import re
from codecs import open
from distutils.core import setup
version = ''
license = ''
title = ''
author = ''
contact = ''
with open('rap/__init__.py', 'r') as fd:
file_content = fd.read()
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
file_content, re.MULTILINE).... | mit | Python | |
9f48522c385c81200f04a027e0299ddf7c81ef84 | Add a script for combining graphs | jmiserez/sts,ucb-sts/sts,ucb-sts/sts,jmiserez/sts | runtime_stats/combine_graphs.py | runtime_stats/combine_graphs.py | #!/usr/bin/env python2.7
#
# Copyright 2011-2013 Colin Scott
#
# 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 applica... | apache-2.0 | Python | |
59989fd4e81782d8e97a262041c17a72a64c5805 | add unit test | ranjinidas/Axelrod,ranjinidas/Axelrod,marcharper/Axelrod,marcharper/Axelrod | axelrod/tests/test_appeaser.py | axelrod/tests/test_appeaser.py | """
Test for the appeaser strategy
"""
import unittest
import axelrod
class TestAppeaser(unittest.TestCase):
def test_strategy(self):
P1 = axelrod.Appeaser()
P2 = axelrod.Player()
P1.str = 'C';
self.assertEqual(P1.strategy(P2), 'C')
P1.history = ['C']
P1.history = ['C']
self.assertEqua... | mit | Python | |
e4f4fe521776c95e79ed33d95a3d1521b95f7b2e | add a toy interpreter prototype | Daetalus/Algorithms | simple_interpreter/my_interpreter.py | simple_interpreter/my_interpreter.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
# This is a toy interpreter that used to demonstrate the concept of
# interpreter. Feel free to use it.
class IntObject(object):
def __init__(self, value):
... | unlicense | Python | |
6b477714ba576b8a858b9ad222b14e7fe77e58ca | add cisco_faults under l2network package. | wenhuizhang/neutron,dhanunjaya/neutron,gkotton/neutron,zhhf/charging,sajuptpm/neutron-ipam,yuewko/neutron,cernops/neutron,bgxavier/neutron,cloudbase/neutron-virtualbox,wolverineav/neutron,bigswitch/neutron,shahbazn/neutron,Comcast/neutron,vijayendrabvs/ssl-neutron,beagles/neutron_hacking,tpaszkowski/quantum,vbannai/neu... | quantum/plugins/cisco/common/cisco_faults.py | quantum/plugins/cisco/common/cisco_faults.py | """
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 Cisco Systems, Inc. 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.ap... | apache-2.0 | Python | |
c689a03dcc84315ff5c3796615a80146f8e74d1f | Add generate Latvia bank registry script | figo-connect/schwifty | scripts/get_bank_registry_lv.py | scripts/get_bank_registry_lv.py | #!/usr/bin/env python
import json
import xlrd
import requests
URL = "https://www.bank.lv/images/stories/pielikumi/makssist/bic_saraksts_22.01.2020_eng.xls"
def process():
registry = []
book = xlrd.open_workbook(file_contents=requests.get(URL).content)
sheet = book.sheet_by_index(0)
for row in list(... | mit | Python | |
90fc1ce356ca1bc367f6a5234d2267600a0a789a | Add little helper script to create DNS records | sys4/smilla | contrib/create_smimea.py | contrib/create_smimea.py | #!/usr/bin/env python
import os
import sys
import base64 as b64
import argparse
def smimea(usage, der):
cert = []
c = 0
with open(der, "rb") as f:
while True:
l = f.read(1024)
if l == "": break
c += len(l)
cert.append(l)
data = b64.b16encode("... | agpl-3.0 | Python | |
039293fd7221fdbc58cfeaddf4f72a6b17798918 | Create Facebook User Admin | jchmura/suchary-django,jchmura/suchary-django,jchmura/suchary-django | accounts/admin.py | accounts/admin.py | from django.contrib import admin
from accounts.models import FacebookUser
class FacebookUserAdmin(admin.ModelAdmin):
list_display = ['uid', 'username', 'user']
admin.site.register(FacebookUser, FacebookUserAdmin) | mit | Python | |
77eba0dacd60ac614211a7563468c3a472079839 | add simple tool to open many articles in browser | kopp/ebookvoice,kopp/ebookvoice | perspective_daily_open_range.py | perspective_daily_open_range.py | #!/usr/bin/python
import argparse
import webbrowser
parser = argparse.ArgumentParser(description='Open a range of Perspective Daily articles in the web browser.\nUse this tool to log in to PD and then open a bunch of articles at once to later pass each one to perspective_daily_extractor.py')
parser.add_argument('begi... | mit | Python | |
1f80b634596bfaa8c4b538a5e8011399bcad6253 | Add missing widget info element | josthkko/ggrc-core,kr41/ggrc-core,NejcZupec/ggrc-core,VinnieJohns/ggrc-core,josthkko/ggrc-core,andrei-karalionak/ggrc-core,NejcZupec/ggrc-core,plamut/ggrc-core,NejcZupec/ggrc-core,VinnieJohns/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,jmakov/ggrc-core,VinnieJohns/ggrc-core,NejcZupec/ggr... | test/selenium/src/lib/element/widget_info.py | test/selenium/src/lib/element/widget_info.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: jernej@reciprocitylabs.com
# Maintained By: jernej@reciprocitylabs.com
from lib import base
from lib.constants import locator
from lib.page import ... | apache-2.0 | Python | |
1e2d771e4a7345f5928c26c8c3921da3f1cfe329 | Create Grau.py | AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb | backend/Controllers/Grau.py | backend/Controllers/Grau.py | # coding=utf-8
from Framework.Controller import Controller
from Database.Controllers.Grau import Grau as BDGrau
from Models.Grau.RespostaListar import RespostaListar
from Models.Grau.RespostaCadastrar import RespostaCadastrar
from Models.Grau.RespostaEditar import RespostaEditar
from Models.Grau.RespostaVer import Resp... | mit | Python | |
6abbd3243a36cc6d5a29e211dd1c7545cfb10220 | Update exercise 1.1 (python) | perryleo/sicp,perryleo/sicp,perryleo/sicp | chapter_01/python/sicpc1e01.py | chapter_01/python/sicpc1e01.py | ## The solution of exercise 1.1
## Give the result printed by the interpreter in response to each express-
## ion. Assume that the sequence is to be evaluated in the order in which
## it is presented.
## Define some variables used later
a = 3
b = a + 1
result = [0] * 11
result[0] = 10
result[1] = 5 + 3 + 4
result[2] ... | mit | Python | |
b6e5a4453e4d9b97f72a6945597938f9f7fa1bfb | add gen_dataset.py | vhb/SimpleOcr,vhb/SimpleOcr,vhb/SimpleOcr | data/gen_dataset.py | data/gen_dataset.py | import sys
import subprocess
import shlex
font = sys.argv[0]
pointsize = 72
char = {
'a': 'a_small'
}
for letter, file in char:
cmd = '-font {:s} -pointsize {:d} label:{:s} {:s}.jpg'.format(
font,
pointsize,
letter,
file
)
cmd = shlex.split(cmd)
subprocess.call(c... | mit | Python | |
5535bda3495828e67cc3c19ec5382fd9dcd35279 | Add new asan_archive_build.py file. | eunchong/build,eunchong/build,eunchong/build,eunchong/build | scripts/slave/chromium/asan_archive_build.py | scripts/slave/chromium/asan_archive_build.py | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Creates a zip file of a build and upload it to google storage.
This will be used by the ASAN security tests.
"""
import optpa... | bsd-3-clause | Python | |
a6a71dd266456d31a00801e725a638ce388008bb | add script to add hostgroup on all external organizations | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/maintenance/scripts/add_hostgroup_external_organization.py | dbaas/maintenance/scripts/add_hostgroup_external_organization.py | from datetime import datetime
from notification.models import TaskHistory
from socket import gethostname
from workflow.steps.util.zabbix import AddOrganizationHostGroup
class AddHostgroupExternalOrganization(object):
def __init__(self, infras):
self.infras = infras
self._task = None
@property
... | bsd-3-clause | Python | |
887fa83f5c8b637feb7445798e2359a457b05783 | Fix closure compilation GYP after file rename. | axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,ltilve/chromium,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,TheTypo... | ui/webui/resources/js/compiled_resources.gyp | ui/webui/resources/js/compiled_resources.gyp | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'assert',
'includes': ['../../../../third_party/closure_compiler/compile_js.gypi'],
},
{
'targ... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'assert',
'includes': ['../../../../third_party/closure_compiler/compile_js.gypi'],
},
{
'targ... | bsd-3-clause | Python |
dde8370345e129e0dbb5d5560826ea98795fb9dd | Fix missing_permission.html rendering | JamesMura/sentry,ifduyue/sentry,mvaled/sentry,looker/sentry,BuildingLink/sentry,BuildingLink/sentry,mvaled/sentry,fotinakis/sentry,looker/sentry,ifduyue/sentry,beeftornado/sentry,beeftornado/sentry,JackDanger/sentry,jean/sentry,ifduyue/sentry,JamesMura/sentry,fotinakis/sentry,gencer/sentry,looker/sentry,jean/sentry,Jam... | src/sentry/web/decorators.py | src/sentry/web/decorators.py | from __future__ import absolute_import
from functools import wraps
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from sentry.web.helpers import render_to_response, get_login_url
def login_required(func):
@wraps(func)
def wrapped(request, *args, **kwargs):
... | from __future__ import absolute_import
from functools import wraps
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from sentry.web.helpers import render_to_response, get_login_url
def login_required(func):
@wraps(func)
def wrapped(request, *args, **kwargs):
... | bsd-3-clause | Python |
7342bb9321aeaa5d5863c6a83ac4985ab1be3f92 | Test elasticities | thomasdouenne/openfisca-france-indirect-taxation,antoinearnoud/openfisca-france-indirect-taxation,openfisca/openfisca-france-indirect-taxation,benjello/openfisca-france-indirect-taxation | openfisca_france_indirect_taxation/tests/test_survey_scenario.py | openfisca_france_indirect_taxation/tests/test_survey_scenario.py | # -*- coding: utf-8 -*-
# Import de modules généraux
from __future__ import division
import pandas
import seaborn
# Import de modules spécifiques à Openfisca
from openfisca_france_indirect_taxation.examples.utils_example import graph_builder_bar
from openfisca_france_indirect_taxation.surveys import SurveyScenario
... | agpl-3.0 | Python | |
e809f8a76e2101f0df4702672678299fba23493a | Add vae trainer. | Swall0w/clib | examples/vae/train.py | examples/vae/train.py | #!/usr/bin/env python
import argparse
import os
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import chainer
from chainer import cuda, training
from chainer import training
from chainer.training import extensions, Trainer
import net
def save_image(x, filename):
fig, a... | mit | Python | |
57c4bcff678d65262463f94ea7996367a1c1ec35 | Add script to determine and plot tshirt size distribution | wearhacks/wearhacks_analytics | analytics/tshirt_size_distribution.py | analytics/tshirt_size_distribution.py | import csv
import plotly.plotly as py
import sys
from collections import defaultdict
from plotly.graph_objs import *
city = sys.argv[1].lower()
path_to_csv_file = sys.argv[2]
column_number = int(sys.argv[3])
with open(path_to_csv_file) as csv_file:
csv_data = csv.reader(csv_file)
next(csv_data, None)
tsh... | mit | Python | |
fc99318f7017c5d56a349d9b254a42df260ce97b | add import script for Arun | chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations | polling_stations/apps/data_collection/management/commands/import_arun.py | polling_stations/apps/data_collection/management/commands/import_arun.py | from data_collection.management.commands import BaseShpStationsShpDistrictsImporter
class Command(BaseShpStationsShpDistrictsImporter):
srid = 27700
council_id = 'E07000224'
districts_name = 'shp/AR_RE_PollingDistricts2017'
stations_name = 'shp/AR_RE_PollingStations2017.shp'
elections = ['local.wes... | bsd-3-clause | Python | |
430c58d10475a7c5e50d3f96e2287c004491e219 | monitor my phone being on the wifi or not | mralext20/alex-bot | alexBot/cogs/phoneMonitor.py | alexBot/cogs/phoneMonitor.py | import logging
from typing import TYPE_CHECKING
import asyncio
from discord.ext import tasks
from ..tools import Cog
if TYPE_CHECKING:
from bot import Bot
log = logging.getLogger(__name__)
TABLE = {
0: "Alex's Phone is At Home",
1: "Alex's Phone is Away From Home",
}
class PhoneMonitor(Cog):
de... | mit | Python | |
9b17918bc992481efb51d8df972b879499424e79 | Add doc fragment for new OpenStack modules | thaim/ansible,thaim/ansible | lib/ansible/utils/module_docs_fragments/openstack.py | lib/ansible/utils/module_docs_fragments/openstack.py | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... | mit | Python | |
dc0a1b2777acc4b9b97de6c471eb8e35dcac2254 | Add test for action_runner.BeginInteraction and action_runner.EndInteraction. | PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,ltilve/chromium,chuan9/chromium-crosswalk,M4sse/chromium.src,chuan9/chromium-crosswalk,ltilve/chromium,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,littlstar/chrom... | tools/telemetry/telemetry/page/actions/action_runner_unittest.py | tools/telemetry/telemetry/page/actions/action_runner_unittest.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.core.backends.chrome import tracing_backend
from telemetry.core.timeline import model
from telemetry.page.actions import action_runner as actio... | bsd-3-clause | Python | |
356cde64743a26ec1756a6e66ed3a6df659f6830 | add migration | OpenSourcePolicyCenter/PolicyBrain,OpenSourcePolicyCenter/webapp-public,OpenSourcePolicyCenter/PolicyBrain,OpenSourcePolicyCenter/PolicyBrain,OpenSourcePolicyCenter/webapp-public,OpenSourcePolicyCenter/PolicyBrain,OpenSourcePolicyCenter/webapp-public,OpenSourcePolicyCenter/webapp-public | webapp/apps/taxbrain/migrations/0024_taxsaveinputs_quick_calc.py | webapp/apps/taxbrain/migrations/0024_taxsaveinputs_quick_calc.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('taxbrain', '0023_taxsaveinputs_id_medical_frt_add4aged'),
]
operations = [
migrations.AddField(
model_name='taxs... | mit | Python | |
7b5fe675ea666a0e66d09be573172dd630425411 | add normalized RMS | jmontoyam/mne-python,olafhauk/mne-python,wmvanvliet/mne-python,lorenzo-desantis/mne-python,adykstra/mne-python,Teekuningas/mne-python,wronk/mne-python,kingjr/mne-python,mne-tools/mne-python,pravsripad/mne-python,bloyl/mne-python,jaeilepp/mne-python,drammock/mne-python,jniediek/mne-python,olafhauk/mne-python,kingjr/mne-... | mne/simulation/simulation_metrics.py | mne/simulation/simulation_metrics.py | # Authors: Yousra Bekhti
# Mark Wronkiewicz <wronk.mark@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
def _check_stc(stc1, stc2):
# XXX What should we check? that the data is having the same size?
if stc1.data.shape != stc2.data.shape:
raise ValueError('Data in stcs must have the... | # Authors: Yousra Bekhti
# Mark Wronkiewicz <wronk.mark@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
def _check_stc(stc1, stc2):
# XXX What should we check? that the data is having the same size?
if stc1.data.shape != stc2.data.shape:
raise ValueError('Data in stcs must have the... | bsd-3-clause | Python |
63ce20f3a6913a79dd1a5b467ee94a23f62242b1 | Create core.py | vickydasta/grammarripper | kernel/core.py | kernel/core.py | #!/usr/bin/python
#grammar ripper word processor
#NLTK? maybe later, i'm gonna use it
#just an example, this core is still on massive development
from tobe import *
from random import shuffle
from random import choice
from personalpronoment import *
from engine import *
person = personal()
#person.pronoment[0] == 'i... | cc0-1.0 | Python | |
5eddae08e75aebd4c742577b98677eb8f3393043 | add a script to fix 2 problems introduced with a broken rename_es_field script | CottageLabs/catflap | catflap/es_bulk_utils/fix_journal_title.py | catflap/es_bulk_utils/fix_journal_title.py | import sys
from catflap.models import Journal
FIX_FIELD = 'journal_title'
strange = None # log strange things to this file handle
def fix(q=None):
# TODO do this using the scroll API http://www.elasticsearch.org/guide/reference/api/search/search-type/
everything = Journal.query(q=q, size=10000000)
proce... | mit | Python | |
883c753ddd78993dedc46ddec3abc921786e69b3 | Create settings.py | LordCatatonic/Lucifer,LordCatatonic/Lucifer | settings.py | settings.py | import platform
import random
def proxies():
proxies = ['onion.city']
return random.choice(proxies)
def onions():
onions = ['BULLSHIT.onion', 'HUMANSACRIFICE.onion']
return random.choice(onions)
def ostype():
return platform.system()
def connectwait():
return 2
def knocktime():
return 180
def version():... | unlicense | Python | |
ef491798d1bb917568b416f83e616d716c2b88a0 | Create utils.py | duguhaotian/flasktest,duguhaotian/flasktest | utils.py | utils.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
def write_md(fname, data, charset='utf-8'):
tmp = fname + ".md"
try:
with open(tmp, 'wt') as f:
f.write(data.encode(charset))
print("write file: %s success" % tmp)
except IOError:
print("write file: %s error" % tmp)
de... | apache-2.0 | Python | |
2a3dc81132d4c2d03f7eb28ce301a7b04e7a9a3d | Add Docker source | calston/tensor,hobbeswalsh/tensor,calston/tensor,calston/tensor,calston/tensor,hobbeswalsh/tensor | tensor/sources/docker.py | tensor/sources/docker.py | """
.. module:: docker
:platform: Any
:synopsis: A source module for Docker container metrics
.. moduleauthor:: Colin Alston <colin.alston@gmail.com>
"""
import json
from twisted.internet import defer, reactor
from zope.interface import implements
from tensor.interfaces import ITensorSource
from tensor.objec... | mit | Python | |
2b2678f26bf3daa61ec2ae265d4d4bbe4ffbf65b | Create about.py | Akuli/the-simple-noteprogram,Akuli/the-simple-noteprogram | install-prefix/lib/the-simple-noteprogram/about.py | install-prefix/lib/the-simple-noteprogram/about.py | """An about dialog and information about this program"""
from gettext import gettext as _
# Information about authors, add your name here if you've helped with
# making this program but your name is not here yet
AUTHORS = ["Akuli"]
TRANSLATORS = {
_("Finnish"): "Akuli",
}
# General information
NAME = "The Simple ... | mit | Python | |
5cae2af3e1bf054584837e2308a06b7aeeaf4309 | Add utils.py | zhaipro/misc,zhaipro/misc | utils.py | utils.py | import zipfile
import cv2
import numpy as np
def get_pixels(mask):
return np.sum(mask)
def find_bbox(mask):
contour, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
x0, y0 = np.min(np.concatenate(contour), axis=(0, 1))
x1, y1 = np.max(np.concatenate(contour), axis=(0, 1))
r... | mit | Python | |
4eade77e2b811a5f57a3f49802703d36abb7042d | add factories for easypost models | davejmac/django-easypost | easypost/factories.py | easypost/factories.py | from django.conf import settings
import factory
import factory.fuzzy
from factory.django import DjangoModelFactory
from django.utils import timezone
import easypost
easypost.api_key = settings.EASYPOST_API_KEY
class AddressFactory(DjangoModelFactory):
class Meta:
model = 'easypost.Address'
ship = f... | mit | Python | |
0d6351596918af43523ca407717586bfbd900456 | Add prometheus_client acme client | adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp | src/pmdas/prometheus/acme.py | src/pmdas/prometheus/acme.py | from prometheus_client import start_http_server, Summary, \
Counter, Gauge, Histogram
import time
import sys
requests = Counter('requests_total', 'Total requests', ['type', 'agent'])
requests.labels(type='fetch', agent='prometheus').inc()
requests.labels(type='store', agent='json').inc()
requests.labels(type='oneline... | lgpl-2.1 | Python | |
bec07279b0e14a9a0e3f11efc7ecbc6e908aa1ef | Add utilities to work with LaTeX files | teunzwart/latex-production-tools | latex_utils.py | latex_utils.py | """
Utilities to work with LaTeX files.
"""
import argparse
import re
def read_tex_file(tex_file, encoding="utf-8"):
with open(tex_file, 'r', encoding=encoding) as data:
tex_source = data.read()
return tex_source
def write_tex_file(tex_file, tex_source):
with open(tex_file, 'w') as open_file:
... | mit | Python | |
064b12400393983a5b9486365e74a6059accfa07 | add more tests | sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana | test/gui/test_ipython.py | test/gui/test_ipython.py | from sequana.gui.ipython import QIPythonWidget
import sys
from PyQt5 import QtWidgets as QW
from PyQt5.QtTest import QTest
from PyQt5.QtCore import Qt
app = QW.QApplication(sys.argv)
def test_ipy():
ipyConsole = QIPythonWidget(
customBanner="Welcome to the embedded ipython console\n")
ipyCo... | bsd-3-clause | Python | |
c5df55e25cf9d74a48b4168f72ca05b976335b6a | Remove dead code from renderers/i3bgbar.py | xfumihiro/powerline,xxxhycl2010/powerline,blindFS/powerline,Luffin/powerline,S0lll0s/powerline,QuLogic/powerline,bezhermoso/powerline,lukw00/powerline,DoctorJellyface/powerline,EricSB/powerline,kenrachynski/powerline,lukw00/powerline,S0lll0s/powerline,Liangjianghao/powerline,xxxhycl2010/powerline,bartvm/powerline,s0und... | powerline/renderers/i3bgbar.py | powerline/renderers/i3bgbar.py | # vim:fileencoding=utf-8:noet
from powerline.renderer import Renderer
from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE
import json
class i3bgbarRenderer(Renderer):
'''i3bgbar Segment Renderer'''
@staticmethod
def hlstyle(*args, **kwargs):
# We don't need to explicitly reset attributes, s... | # vim:fileencoding=utf-8:noet
from powerline.renderer import Renderer
from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE
import json
class i3bgbarRenderer(Renderer):
'''i3bgbar Segment Renderer'''
@staticmethod
def hlstyle(*args, **kwargs):
# We don't need to explicitly reset attributes, s... | mit | Python |
396fc719e8e21c9ce6a72679dd3a5726454c4f1f | Add viz which includes plot_log function | jaredleekatzman/DeepSurv | viz.py | viz.py | import matplotlib
import matplotlib.pyplot as plt
import theano
import numpy as np
def plot_log(log):
"""
Plots the training and validation curves for a network's loss function
and calculated concordance index.
Parameters:
log: a dictionary with a list of values for any of the following keys... | mit | Python | |
652667a2df7266f377279d1127742843f4e8c9e0 | add temp code | pengsun/DeepLearningTutorials,pengsun/DeepLearningTutorials | mycode2/tmp.py | mycode2/tmp.py | import theano
a = theano.sandbox.cuda.dnn.dnn_available()
pass
| bsd-3-clause | Python | |
8cbc2ba51abe9a15c38b5fac1c1dd1c5f1924436 | add base minibot | cornell-cup/cs-minibot-platform,cornell-cup/cs-minibot-platform,cornell-cup/cs-minibot-platform,cornell-cup/cs-minibot-platform,cornell-cup/cs-minibot-platform,cornell-cup/cs-minibot-platform | python-interface/bot/base_minibot.py | python-interface/bot/base_minibot.py | class BaseMiniBot(object):
"""
Abstract class defining the base functions of the MiniBot. More customized MiniBots may
subclass this.
"""
def move_forward(power):
"""
Moves the bot forward at a percentage of its full power
:param power The percentage of the bot's pow... | apache-2.0 | Python | |
3edb29c76041f929af4c44ae9ac6cdb871bdd48e | Combine tables of recent M33 SNR catalogs | e-koch/VLA_Lband,e-koch/VLA_Lband | ancillary_data/ingest_snr_catalogue_tables.py | ancillary_data/ingest_snr_catalogue_tables.py |
'''
Combine tables of recent publications with SNR catalogues.
Paths only working for travelling drive
'''
from astropy.table import Table, Column
from astropy.table import join as join_tab
import astropy.units as u
from astropy.coordinates import SkyCoord
mmt_overview = Table.read("/Volumes/Travel_Data/M33_2/MMT_... | mit | Python | |
334695484d61693c41c8a30aea6cf753b9ed8267 | Add code for LSTM based MNIST | KT12/hands_on_machine_learning | lstm.py | lstm.py | import tensorflow as tf
import numpy as np
tf.set_random_seed(5)
n_inputs = 28
n_neurons = 150
n_layers = 3
n_steps = 28
n_outputs = 10
learning_rate = 0.001
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/")
X_test = mnist.test.images.reshape((-1, n_steps, n_... | mit | Python | |
ec2b48b18cda086d437100ea36636838007ff165 | Create update_user_settings.py | RomuloOliveira/dot-files,RomuloOliveira/unix-files,RomuloOliveira/dot-files | sublime/User/update_user_settings.py | sublime/User/update_user_settings.py | import json
import urllib2
import sublime
import sublime_plugin
GIST_URL = u'https://gist.githubusercontent.com/RomuloOliveira/f76f602eabfe8f376915a75366cbf6e1/raw/c642904331c39220caa292e1d4c12a4497944162/settings.json' # noqa
class UpdateUserSettingsCommand(sublime_plugin.TextCommand):
def run(self, edit):
... | apache-2.0 | Python | |
c639ae9ec0d627ca5345ec579ef61e063fbb5074 | Add least_squares.py | aerospaceresearch/orbitdeterminator | orbitdeterminator/kep_determination/least_squares.py | orbitdeterminator/kep_determination/least_squares.py | """Computes the least-squares optimal Keplerian elements for a sequence of
cartesian position observations.
"""
import numpy as np
import matplotlib.pyplot as plt
| mit | Python | |
c9e25252d93a965e8e82470fe923af4d163a8827 | Implement the IRCMessage class | Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot | pyheufybot/message.py | pyheufybot/message.py | class IRCMessage(object):
def __init__(self, messageType, user, channel, messageText):
self.messageType = messageType
self.user = user
self.channel = channel
self.messageText = messageText | mit | Python | |
e05b65ca63fa5ca158ad89b5db5cf07f625a8c9f | Add migration file that I accidentally forgot. | Marx86/xqueue,nttks/xqueue,knehez/xqueue,edx/xqueue,EDUlib/xqueue,EDUlib/xqueue,edx/xqueue,EDUlib/xqueue,knehez/xqueue,edx/xqueue,knehez/xqueue,nttks/xqueue,Marx86/xqueue | queue/migrations/0005_add_indexes.py | queue/migrations/0005_add_indexes.py | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding index on 'Submission', fields ['lms_callback_url']
db.create_index('queue_submission', ['lms_callba... | agpl-3.0 | Python | |
8b1ffebe002c4c997d672382f9d045a590618649 | Add new package: py-workload-automation | LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack | var/spack/repos/builtin/packages/py-workload-automation/package.py | var/spack/repos/builtin/packages/py-workload-automation/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyWorkloadAutomation(PythonPackage):
"""Workload Automation (WA) is a framework for execut... | lgpl-2.1 | Python | |
986634722c1c1fa373853ae83f87284f84ee4368 | add Bullet class | sejimhp/BulletReflector | Bullet.py | Bullet.py | class Bullet:
def __int__(self):
self.screen = pygame.display.set_mode(SCREEN_SIZE, FULLSCREEN)
self.x = 0
self.y = 0
self.r = 0
self.rad = 0
def update(self):
self.x += self.r
self.y += self.r
def draw(self):
pygame.draw.circle(self.screen, ... | mit | Python | |
0da81aee8d1d1c1badee561c594e191dbbffdc9c | Save our backtraces in a compatible manner with resque. | binarydud/pyres,guaijiao/pyres,TylerLubeck/pyres,Affectiva/pyres | pyres/failure/base.py | pyres/failure/base.py | import sys
import traceback
class BaseBackend(object):
"""Provides a base class that custom backends can subclass. Also provides basic
traceback and message parsing.
The ``__init__`` takes these keyword arguments:
``exp`` -- The exception generated by your failure.
``queue`` -- The queue... | import sys
import traceback
class BaseBackend(object):
"""Provides a base class that custom backends can subclass. Also provides basic
traceback and message parsing.
The ``__init__`` takes these keyword arguments:
``exp`` -- The exception generated by your failure.
``queu... | mit | Python |
b0be02232c30b896477acc4bbed8acd0696f44b8 | rename the only file that uses mdp | hobson/pug,hobson/pug,hobson/pug,hobson/pug | pug/nlp/dim_reduce_with_mdp.py | pug/nlp/dim_reduce_with_mdp.py | import mdp
import numpy as np
import scipy
import inaugural as data
occurrences, row_labels, col_labels = data.get_adjacency_matrix(sorted(data.DEFAULT_FILE_LIST), entropy_threshold=0.1, normalized=False, verbosity=1)
def reduce(occurrences=occurrences, dim=2):
pca = mdp.nodes.PCANode(output_dim=dim, dtype='float6... | mit | Python | |
1fa327d6b8765bfbaa945cb206d9229f6f2cb56b | Remove logging import unused | vganapath/rally,openstack/rally,openstack/rally,openstack/rally,vganapath/rally,vganapath/rally,vganapath/rally,yeming233/rally,yeming233/rally,openstack/rally | rally/plugins/openstack/scenarios/monasca/metrics.py | rally/plugins/openstack/scenarios/monasca/metrics.py | # 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | # 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 | Python |
89ee7700ad8aa7106ab6163b4171f2ed274fc93e | Add promocodes tests | Storj/accounts | tests/test_promocodes.py | tests/test_promocodes.py | # -*- coding: utf-8 -*-
import pytest
from accounts.promocodes import PromocodeDatabase
from accounts.units import MEGABYTE
# Database migrations run for each test in this module.
# See `conftest.pytest_runtest*`.
DB_MIGRATIONS = ['0001-create-promocodes', '0002-create-promocode-uses']
# Fixtures ###
@pytest.fixtur... | mit | Python | |
caa705142e5a76414ec2c01268eb4796c373e7c5 | Create quantadistribution.py | BinkyToo/quantadistribution | quantadistribution.py | quantadistribution.py | #!/usr/bin/env python2.6
import random
def draw(inputlist):
upperlimit = max(inputlist)
for threshold in reversed(range(0, upperlimit)):
for entry in range(0, len(inputlist)):
if inputlist[entry] > threshold:
print "#",
else:
print " ",
p... | unlicense | Python | |
f58f54eca8af3a66dcdd9c6815784c1b15c63418 | Create test_plotting.py (#214) | rparini/cxroots,rparini/cxroots | cxroots/tests/test_plotting.py | cxroots/tests/test_plotting.py | import os
import tempfile
import pytest
from numpy import cos, exp
from cxroots import Circle
@pytest.fixture()
def results_dir():
with tempfile.TemporaryDirectory() as tmp:
yield tmp
def test_save_plot(results_dir):
file_path = os.path.join(results_dir, "circle.pdf")
Circle(1j, 2).show(save_f... | bsd-3-clause | Python | |
24264eb00e4f4e3661ea1a28e9cbe3a97cd69580 | add slepc package | TheTimmy/spack,skosukhin/spack,krafczyk/spack,iulian787/spack,iulian787/spack,matthiasdiener/spack,tmerrick1/spack,lgarren/spack,tmerrick1/spack,skosukhin/spack,krafczyk/spack,iulian787/spack,EmreAtes/spack,lgarren/spack,mfherbst/spack,tmerrick1/spack,krafczyk/spack,lgarren/spack,mfherbst/spack,matthiasdiener/spack,kra... | var/spack/repos/builtin/packages/slepc/package.py | var/spack/repos/builtin/packages/slepc/package.py | import os
from spack import *
class Slepc(Package):
"""
Scalable Library for Eigenvalue Computations.
"""
homepage = "http://www.grycap.upv.es/slepc"
url = "http://slepc.upv.es/download/download.php?filename=slepc-3.6.2.tar.gz"
version('3.6.2', '2ab4311bed26ccf7771818665991b2ea3a9b15f97e29fd... | lgpl-2.1 | Python | |
86b0485881eec2d05ed5e5bde9656ac495de60d9 | Create axis.py | heavywatal/likeligrid,heavywatal/likeligrid | axis.py | axis.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
import os
import sys
import argparse
import numpy as np
import pandas as pd
pd.set_option('display.max_rows', 20)
pd.set_option('display.width', None)
def make_init_axes(infile, step):
genotypes = pd.read_table(infile)
v = np.linspace(1.0, 0.0, 1.0 / step,... | mit | Python | |
a4845aff79b1efb89a210b3b2cc57739cc27bebf | Create Django migrations for statement text max length | gunthercox/ChatterBot,vkosuri/ChatterBot | chatterbot/ext/django_chatterbot/migrations/0018_text_max_length.py | chatterbot/ext/django_chatterbot/migrations/0018_text_max_length.py | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_chatterbot', '0017_tags_unique'),
]
operations = [
migrations.AlterField(
model_name='statement',
name='in_response_to',
field=models.CharField(ma... | bsd-3-clause | Python | |
6f059bbb2443b55cdcbe33a6215dabb45f7076ee | add tm sequence extractor | fmaguire/volution,fmaguire/volution,fmaguire/volution | tm_sequences/get_seqs.py | tm_sequences/get_seqs.py | #!/usr/bin/env python3
import sys
import os
from Bio import SeqIO
if __name__=='__main__':
if len(sys.argv) is not 3:
print("get_seqs.py tmhmm_output_filepath input_fasta_filepath")
tmhmm_out_fh = open(sys.argv[1], 'rU')
input_seq_fh = open(sys.argv[2], 'rU')
output_name = os.basename(sys.... | apache-2.0 | Python | |
f7d539f93571244aa8f64cfff39dc9fbefc3a73b | Make sure hostname is always lowered before match | goodtune/django-tenant-schemas,goodtune/django-tenant-schemas,mcanaves/django-tenant-schemas,ArtProcessors/django-tenant-schemas,bernardopires/django-tenant-schemas,bernardopires/django-tenant-schemas,ArtProcessors/django-tenant-schemas | tenant_schemas/middleware.py | tenant_schemas/middleware.py | from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import DisallowedHost
from django.db import connection
from django.http import Http404
from tenant_schemas.utils import (get_tenant_model, remove_www,
get_public_sche... | from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import DisallowedHost
from django.db import connection
from django.http import Http404
from tenant_schemas.utils import (get_tenant_model, remove_www,
get_public_sche... | mit | Python |
dab1390fe65aeb1e734174d3d8f4a5ba870b3b60 | add bilibili from other on github | zephyrzoom/douyu,zephyrzoom/douyu,zephyrzoom/douyu,zephyrzoom/douyu | bili.py | bili.py | #python3
import socket
import time
import threading
import json
g_cid= 15111
g_ip= 'livecmt.bilibili.com'
g_port= 88
g_exit= False
g_res_00_02_msginfo= ['num0','num1','num2','num3','num4','num5','num6','num7','num8']
g_res_00_02_userinfo= ['num0','username','num2']
g_res_00_02= ['msginfo','msg','userinfo']
def send... | mit | Python | |
27fafdb14d7931228925c409df2a0e888a8b9261 | fix semver rc formatting [closes #592] | thebigmunch/gmusicapi,simon-weber/Unofficial-Google-Music-API,simon-weber/gmusicapi | gmusicapi/_version.py | gmusicapi/_version.py | # -*- coding: utf-8 -*-
__version__ = u"11.0.1-rc.1"
| # -*- coding: utf-8 -*-
__version__ = u"11.0.1rc1"
| bsd-3-clause | Python |
382cdba445dd88a2f2892f07ee3addbed5cac5b0 | Add tic_ql_fa.py | davidrobles/mlnd-capstone-code | examples/tic_ql_fa.py | examples/tic_ql_fa.py | '''
The Q-learning algorithm is used to learn a function approximator
for the state-action values of Tic-Tac-Toe positions.
'''
from capstone.game.games import TicTacToe
from capstone.game.players import RandPlayer
from capstone.rl import Environment, GameMDP, FixedGameMDP
from capstone.rl.learners import ApproximateQL... | mit | Python | |
b87d7a1dbfd3da7c8dd8fe4bed0272f0b92f9a20 | add temperature-predictions | EdisonCodeKeeper/hacker-rank,EdisonAlgorithms/HackerRank,EdisonAlgorithms/HackerRank,zeyuanxy/hacker-rank,EdisonAlgorithms/HackerRank,zeyuanxy/hacker-rank,zeyuanxy/hacker-rank,EdisonCodeKeeper/hacker-rank,zeyuanxy/hacker-rank,EdisonAlgorithms/HackerRank,EdisonCodeKeeper/hacker-rank,EdisonAlgorithms/HackerRank,EdisonAlg... | ai/machine-learning/temperature-predictions/temperature-predictions.py | ai/machine-learning/temperature-predictions/temperature-predictions.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Zeyuan Shang
# @Date: 2016-01-17 12:15:40
# @Last Modified by: Zeyuan Shang
# @Last Modified time: 2016-01-17 12:15:46
#!/usr/bin/ruby
n = gets.to_i
gets
result = [[nil] * n, [nil] * n]
missing = []
n.times{|i|
a = gets.split
if a[2].start_with?('Mis... | mit | Python | |
a143afc0a88b19026513ef8c3041caa8aae23c13 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/3fec5dad9413fc26e100fff9797e18b74b46df39. | tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,paolodedios/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,tensorf... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "3fec5dad9413fc26e100fff9797e18b74b46df39"
TFRT_SHA256 = "d8f09a6325ef7e4dfac20a92cbd2... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "c6c79c4d98f6c74bb0005d7bc750bae2a19bb117"
TFRT_SHA256 = "fb427a7c5279656e6c6626c44be7... | apache-2.0 | Python |
94e71ea2e1a3155a62b4e9d017adbb7dc827eb88 | Add Facebook CLI example. | maxcountryman/rauth,arifgursel/rauth,maxcountryman/rauth,isouzasoares/rauth,litl/rauth,arifgursel/rauth,isouzasoares/rauth,litl/rauth,arifgursel/rauth | examples/facebook-cli.py | examples/facebook-cli.py | from rauth.service import OAuth2Service
import re
import webbrowser
# Get a real consumer key & secret from:
# https://developers.facebook.com/apps
facebook = OAuth2Service(
name='facebook',
authorize_url='https:/graph.facebook.com/oauth/authorize',
access_token_url='https:/graph.facebook.com/oauth/access... | mit | Python | |
0e673cb1e15403fff92a34711caca99fd0919f98 | add offlineimap example | luksen/gkcli,luksen/gkcli | offlineimap.py | offlineimap.py | #!/usb/bin/python
from subprocess import check_output
def get_password(name):
try:
return check_output(["gkcli", "get", name])
except:
return None
| apache-2.0 | Python | |
d7ac59985b63f52a493d999dce8b9fbc02d21b6c | Add empty main | yannicl/raspi-robot,yannicl/raspi-robot,yannicl/raspi-robot | main.py | main.py | print "Hello World from Python on PI"
| mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.