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 |
|---|---|---|---|---|---|---|---|---|
d9811ddbeae16dafbf2b98e9831aca216695601b | Add some basic python specific conversions | sclorg/spec2scl,mbooth101/spec2scl | rpm2scl/transformers/python.py | rpm2scl/transformers/python.py | from rpm2scl.decorators import matches
from rpm2scl.transformers.transformer import Transformer
class PythonTransformer(Transformer):
def __init__(self, spec, options = None):
super(PythonTransformer, self).__init__(spec, options)
@matches(r'%{__python\d*} ', one_line = False)
@matches(r'nosetests... | mit | Python | |
ec8b99ac0687ba1bbcb079096f020d54274fa8fb | Manage action rule profiles (#28139) | thaim/ansible,thaim/ansible | lib/ansible/modules/network/aci/aci_action_rule_profile.py | lib/ansible/modules/network/aci/aci_action_rule_profile.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
... | mit | Python | |
063a427d0510636a18bd158bd1d45ac2273682c1 | add tests for plots | murphycj/AGFusion,murphycj/AGFusion | test/test_plots.py | test/test_plots.py | """
Tests for plotting.
"""
import unittest
from os.path import abspath, curdir, join
from pathlib import Path
import pyensembl
from agfusion import database, model
data = pyensembl.EnsemblRelease(84, "mouse")
db = database.AGFusionDB(abspath(join(curdir, "agfusion.mus_musculus.84.db")))
db.build = "mus_musculus_84"... | mit | Python | |
ac73c59048e9db4939681546130f9d54192819ad | Create crest-diaries.py | MuckRock/API-examples | crest-diaries.py | crest-diaries.py | import urllib
import csv
from datetime import datetime
import os.path
# To do:
# - Limit to X updates per day
# - Post tweets!
# - Screenshot
# - ???
csvNumber = 1
# deduplicate = True
print "Kicking off"
while csvNumber < 5:
if not os.path.isfile('crest_lite_' + str(csvNumber) + '.csv'):
urllib.urlretr... | mit | Python | |
83ef5f6b9a172d82349b6217b3d4fda6e68a00b8 | update metadata running | dgketchum/Landsat578 | landsat/update_landsat_metadata.py | landsat/update_landsat_metadata.py | # =============================================================================================
# Copyright 2018 dgketchum
#
# 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.apach... | apache-2.0 | Python | |
843536032e7b08fc9824105d0540cfa247952964 | Add a toolscript. | jdhp-sap/data-pipeline-standalone-scripts,jdhp-sap/sap-cta-data-pipeline,jdhp-sap/sap-cta-data-pipeline,jdhp-sap/data-pipeline-standalone-scripts | utils/count_delta_psi.py | utils/count_delta_psi.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Make statistics on score files (stored in JSON files).
"""
# To ignore warnings (http://stackoverflow.com/questions/9031783/hide-all-warnings-in-ipython)
import warnings
warnings.filterwarnings('ignore')
import common_functions as common
import argparse
import nump... | mit | Python | |
a82b3f1ea5cd784de4cdbc682d62560101ba15bd | Use add_user_list_args in turn_off_digests. | eeshangarg/zulip,amanharitsh123/zulip,rht/zulip,showell/zulip,zulip/zulip,brainwane/zulip,hackerkid/zulip,showell/zulip,rht/zulip,hackerkid/zulip,brainwane/zulip,mahim97/zulip,tommyip/zulip,tommyip/zulip,amanharitsh123/zulip,Galexrt/zulip,synicalsyntax/zulip,punchagan/zulip,brainwane/zulip,andersk/zulip,amanharitsh123/... | zerver/management/commands/turn_off_digests.py | zerver/management/commands/turn_off_digests.py | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from django.core.management.base import CommandParser
from zerver.lib.actions import do_change_notification_settings
from zerver.lib.management import ZulipBaseCommand
from zerver.models import UserProfile
class Comm... | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from django.core.management.base import CommandParser
from zerver.lib.actions import do_change_notification_settings
from zerver.lib.management import ZulipBaseCommand
from zerver.models import UserProfile
class Comm... | apache-2.0 | Python |
b27f52e75571ed402008fd8fd0fb24244f30dde1 | Remove Dutch foreign ministry org | akvo/akvo-rsr,akvo/akvo-rsr,akvo/akvo-rsr,akvo/akvo-rsr | akvo/rsr/management/commands/remote_netherlands_foreign_ministry.py | akvo/rsr/management/commands/remote_netherlands_foreign_ministry.py | #!/usr/bin/env python3
# Akvo Reporting is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
import warnings
from django.core.... | agpl-3.0 | Python | |
9e98f7d2ac4cec7b3699b9a43004528786b69aa3 | Create apply_bin_mask_to_image.py | milq/computer-vision-resources,milq/computer-vision-resources | code/scripts/python/apply_bin_mask_to_image.py | code/scripts/python/apply_bin_mask_to_image.py | from matplotlib import pyplot as plt
import numpy as np
import scipy.io as sio
image = plt.imread('00350a_img.jpg')
bin_mask = sio.loadmat('00350a.mat')['person_segm'].astype('bool')
mask = np.dstack((bin_mask, bin_mask, bin_mask))
image[~mask] = 0
plt.imsave('final.png', image)
| mit | Python | |
0449977b92d08726abde0cd5c38473435c8228d3 | add experimental mdns fuzzer | heftig/avahi,gloryleague/avahi,Distrotech/avahi,Kisensum/xmDNS-avahi,sunilghai/avahi-clone,Kisensum/xmDNS-avahi,heftig/avahi-1,lathiat/avahi,everbase/catta,Kisensum/xmDNS-avahi,heftig/avahi,lathiat/avahi,catta-x/catta,heftig/avahi-1,Distrotech/avahi,heftig/avahi-1,everbase/catta,sunilghai/avahi-clone,Kisensum/xmDNS-ava... | tests/fuzz-mdns.py | tests/fuzz-mdns.py | #!/usr/bin/python
from scapy import *
sendp(Ether(type=0x800, dst="ff:ff:ff:ff:ff:ff")/IP(dst="224.0.0.251")/fuzz(UDP(dport = 5353, sport = 5353)/DNS(qd = fuzz(DNSQR()))),loop=1, iface="realtek0")
| lgpl-2.1 | Python | |
58b83b98c90d7663c2f9e9d92257d0ae360b70d0 | Add test for files | wxiang7/dill,mindw/dill | tests/test_file.py | tests/test_file.py | #!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2008-2014 California Institute of Technology.
# License: 3-clause BSD. The full license text is available at:
# - http://trac.mystic.cacr.caltech.edu/project/pathos/browser/dill/LICENSE
import dill
import random
impo... | bsd-3-clause | Python | |
bf8c008742dd921865f18f10b1c925c485406343 | Add a quick way to show the current queue configuration. | prophile/django-lightweight-queue,prophile/django-lightweight-queue,thread/django-lightweight-queue,lamby/django-lightweight-queue,thread/django-lightweight-queue | django_lightweight_queue/management/commands/queue_configuration.py | django_lightweight_queue/management/commands/queue_configuration.py | from django.core.management.base import NoArgsCommand
from ... import app_settings
class Command(NoArgsCommand):
def handle_noargs(self, **options):
print "django-lightweight-queue"
print "========================"
print
print "{0:<15} {1:>5}".format("Queue name", "Concurrency")
... | bsd-3-clause | Python | |
815b66ed66a189e0470e80819e8b189a8beac11f | Create rnn_init.py | AdityaSoni19031997/Machine-Learning,AdityaSoni19031997/Machine-Learning | rnn_init.py | rnn_init.py | import numpy as np
def rnn_cell_forward(xt, a_prev, parameters):
"""
Implements a single forward step of the RNN-cell as described in Figure (2)
Arguments:
xt -- your input data at timestep "t", numpy array of shape (n_x, m).
a_prev -- Hidden state at timestep "t-1", numpy array of shape (n_a, m)
... | mit | Python | |
3ee29b7fce8275c21bfc33ace685aeb59664194d | Create dihedral_mutinf.py | msmbuilder/mdentropy,msmbuilder/mdentropy | dihedral_mutinf.py | dihedral_mutinf.py | import numpy as np
import mdtraj as md
import argparse, cPickle
from multiprocessing import Pool
from itertools import combinations_with_replacement as combinations
from sklearn.metrics import mutual_info_score
from contextlib import closing
def rbins(n=30):
return np.linspace(-np.pi, np.pi, n+3)[1:-1]
def mi(X, ... | mit | Python | |
aef549ce3cca1b05311f6fd81041023e08250dc3 | add to convert xml of lucretius to txt | jfecroft/count-fuzzy-repetitions | lucretius-de_rerum_natura-xml2txt.py | lucretius-de_rerum_natura-xml2txt.py | import xml.etree.ElementTree as ET
filen = 'lucretius-de_rerum_natura'
tree = ET.parse('{}.xml'.format(filen))
root = tree.getroot()
books = root.findall('.//*div1[@type="book"]')
for i, book in enumerate(books):
book_text = ''
for line in book.iter():
if line.tag in ['lb', 'del', 'add'] and line.attri... | mit | Python | |
42ece8ae4a67ed550f4b39a3d85d556855deaa91 | add python interface for cc | spininertia/graph-mining-rdbms,spininertia/graph-mining-rdbms | src/phase-3/src/cc/cc.py | src/phase-3/src/cc/cc.py | import psycopg2
import sys
def drop_if_exists(conn, table_name):
cur = conn.cursor()
cur.execute("drop table if exists %s" % table_name)
conn.commit()
cur.close()
def cc_init(conn, edge_table, target_table):
cur = conn.cursor()
drop_if_exists(conn, "component")
drop_if_exists(conn, "component_tmp")
drop_if_ex... | mit | Python | |
cd3e631396f0fcca7c5527c4f1fdf57acea62dd5 | Create pset2part2.py | freckleboy/6.00.1x,somabc/6.00.1x | pset2part2.py | pset2part2.py | balance = 320000
annualInterestRate = 0.2
# function that calculates the balance at year end given a monthly payment
def yearEndBalance(monthlyPayment):
'''
Calculates year end balance given a monthly payment
as an argument. monthlyPayment can be int or float '''
myBalance = balance
for m in range(... | mit | Python | |
c3498b45baefa2ab22f5f3db71cd68d252839dc4 | add alternative hack for async printing and getting input | hpk42/p4p | attic/play_async_print2.py | attic/play_async_print2.py | # based on http://stackoverflow.com/questions/2082387/reading-input-from-raw-input-without-having-the-prompt-overwritten-by-other-th
from rl import readline
from threading import Thread, Timer
from sys import stdout
from struct import unpack
from fcntl import ioctl
from termios import TIOCGWINSZ
prompt = '> '
def... | mit | Python | |
026863c9cdccb984af55b221f069d88b159a941f | Update bus.py with Bus model | power-system-simulation-toolbox/psst,kdheepak/psst | psst/case/bus.py | psst/case/bus.py | import ipywidgets as ipyw
import traitlets as t
import numpy as np
import bqplot as bq
import traittypes as tt
M = 1e10
class Bus(t.HasTraits):
'''Bus Model'''
name = t.CUnicode(default_value='GenCo0', help='Name of Generator (str)')
bus_type = t.Enum(
values=['SWING', 'PQ', 'PV'],
defa... | mit | Python | |
f54f1cea9a839e97b27103638530fb030ca81a6a | Add utility script to convert/update builds. | kernelci/kernelci-backend,kernelci/kernelci-backend | app/utils/scripts/update-defconfig.py | app/utils/scripts/update-defconfig.py | #!/usr/bin/python
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope t... | lgpl-2.1 | Python | |
6708fd75eb7272701e8e333e4940e47d5b6a05af | Add a custom client side test runner | Kitware/minerva,Kitware/minerva,Kitware/minerva | plugin_tests/web_client_test.py | plugin_tests/web_client_test.py | from tests import web_client_test
setUpModule = web_client_test.setUpModule
tearDownModule = web_client_test.tearDownModule
class WebClientTestCase(web_client_test.WebClientTestCase):
def setUp(self):
super(WebClientTestCase, self).setUp()
self.model('user').createUser(
login='mine... | apache-2.0 | Python | |
c376e7e8640c82b5cbb805c5bb64b269e2e859c5 | add Netscreen Hash | bensooter/NetscreenHash | Netscreen.py | Netscreen.py | #!/usr/bin/python
import base64
import binascii
import hashlib
b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
def makepass(user, password):
middle = "Administration Tools"
s = "%s:%s:%s" % (user, middle, password)
print(s)
m = hashlib.md5(s.encode()).digest()
narray = []... | mit | Python | |
030300c34e8736893f6479b90aa76ce2b4545826 | Move api into pipeline (#2) | yangw1234/BigDL,yangw1234/BigDL,yangw1234/BigDL,yangw1234/BigDL,intel-analytics/BigDL,intel-analytics/BigDL,intel-analytics/BigDL,intel-analytics/BigDL | python/dllib/src/test/bigdl/utils/test_utils.py | python/dllib/src/test/bigdl/utils/test_utils.py | #
# Copyright 2018 The Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 | Python | |
49c25b8d88a4b634cb1d23554de82998821e425c | Add raw git fetch. | douban/ellen | ellen/git/fetch.py | ellen/git/fetch.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ellen.utils.process import git_with_repo
def fetch(repository):
git = git_with_repo(repository)
git.fetch()
| bsd-3-clause | Python | |
0d892560a624fdb5f896631f999689fef351dc1e | Create __init__.py | 20tab/twentytab_project,20tab/twentytab_project,20tab/twentytab_project | commons/__init__.py | commons/__init__.py | mit | Python | ||
3366c30ffedc8ea393b8500219c97d01ee97d2c2 | Create LINE-Notify.py | wannaphongcom/code-python3-blog | LINE-Notify.py | LINE-Notify.py | # อ่านบทความ https://python3.wannaphong.com/blog/2016/10/02/ทำระบบแจ้งเตือนบน-line-ด้วย-py
import requests,json
import urllib.parse
LINE_ACCESS_TOKEN="ใส่ Token"
url = "https://notify-api.line.me/api/notify"
message ="ทดสอบ" # ข้อความที่ต้องการส่ง
msg = urllib.parse.urlencode({"message":message})
LINE_HEADERS = {... | mit | Python | |
ac13e5da065f0612634547bbd4c495f04f44faa7 | add bmap.py | 1dot75cm/repo-checker | example/bmap.py | example/bmap.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# @mail: sensor.wen@gmail.com
# @date: Mar 3, 2016
# @reference: http://www.oschina.net/code/snippet_90475_9224
#
import sys
import time
import json
import urllib.request
import urllib.parse
class BaiduMap:
""" get baidu map infomation.
"""
def __init__(sel... | mit | Python | |
e77957398f78f905c6b8ac881b621c67c1352d0a | Add py solution for 494. Target Sum | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/target-sum.py | py/target-sum.py | from collections import Counter
class Solution(object):
def findTargetSumWays(self, nums, S):
"""
:type nums: List[int]
:type S: int
:rtype: int
"""
c = Counter()
c[0] = 1
for n in nums:
nc = Counter()
for k, v in c.iteritems():... | apache-2.0 | Python | |
c5bf45b63cb7110354a732dcf08923a50aa6bb46 | test for bucketed queue | wchan/tensorflow,wchan/tensorflow,wchan/tensorflow,wchan/tensorflow,wchan/tensorflow,wchan/tensorflow,wchan/tensorflow,wchan/tensorflow | tensorflow/python/kernel_tests/fifo_bucketed_queue_test.py | tensorflow/python/kernel_tests/fifo_bucketed_queue_test.py | """Tests for tensorflow.ops.data_flow_ops.FIFOBucketedQueue."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
import re
import time
import numpy as np
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
... | apache-2.0 | Python | |
7707d79b8783a181b1ee672e264cf8407b685d36 | Add block operator functions. | ryanorendorff/pyop | pyop/block.py | pyop/block.py | from numpy import vsplit, vstack, sum, tile, concatenate, cumsum, add
from pyop import LinearOperator, ensure2dColumn
import six
##TODO Add short function as dimension checker.
def bmat(blocks):
''' Converts a list of lists into a new operator.
The new operator is composed of blocks described by the list.
... | bsd-3-clause | Python | |
59737c501fc41e402899a69a457e42d99cf6b924 | Add file mistakenly left out of r12986. Refs #13334. | heracek/django-nonrel,heracek/django-nonrel,heracek/django-nonrel,adieu/django-nonrel,adieu/django-nonrel,adieu/django-nonrel | tests/regressiontests/templates/templatetags/broken_tag.py | tests/regressiontests/templates/templatetags/broken_tag.py | from django import Xtemplate
| bsd-3-clause | Python | |
993359b0b945122651ac0ccc55c6c49ffcec62c7 | create test_install_uninstall | MSLNZ/msl-package-manager | tests/test_install_uninstall.py | tests/test_install_uninstall.py | from msl.package_manager import utils, install, uninstall
def test_install_then_uninstall():
# make sure that MSL-LoadLib is NOT installed
pkgs = utils.installed()
assert 'msl-loadlib' not in pkgs
# install from PyPI
install('loadlib', yes=True)
# make sure that MSL-LoadLib IS installed
... | mit | Python | |
cbf29ea21179dcf3cf9c5f0a7eacd664f025f5db | Add small utility for removing package references | SaladLab/Akka.Interfaced,SaladbowlCreative/Akka.Interfaced,SaladbowlCreative/Akka.Interfaced,SaladLab/Akka.Interfaced | tools/scripts/remove_package.py | tools/scripts/remove_package.py | import fnmatch
import os
import re
re_reference = re.compile(r'\<Reference Include=\"([\w\.]+)\,.*?\<\/Reference\>', re.DOTALL | re.MULTILINE)
def process_csproj(file, delete_package):
proj = open(file).read()
def repl(mo):
if mo.group(1) == delete_package:
return ""
else:
... | mit | Python | |
81ab7492319059a3287d60069184921729b75fe1 | Test the screen module | jalanb/dotsite | pysyte/bash/test/test_screen.py | pysyte/bash/test/test_screen.py | from unittest import TestCase
from unittest.mock import patch
from pysyte.bash import screen
starting_callbacks = screen.atexit._ncallbacks()
class TestScreen(TestCase):
def test_alt_screen(self):
"""Calling alt_screen should give a method to start such a screen
And should register a method to ... | mit | Python | |
ec343512931f0ed2a74e21c099561c75160d1106 | add RPC test for InvalidateBlock | reddcoin-project/reddcoin,reddcoin-project/reddcoin,reddcoin-project/reddcoin,reddcoin-project/reddcoin,reddcoin-project/reddcoin,reddcoin-project/reddcoin | qa/rpc-tests/invalidateblock.py | qa/rpc-tests/invalidateblock.py | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test InvalidateBlock code
#
from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy imp... | mit | Python | |
044f9ce7ce2a9bf62512493adf2209d99d0232c1 | Create paper-export.py | dropbox/DropboxBusinessScripts,dropbox/DropboxBusinessScripts | Paper/paper-export.py | Paper/paper-export.py | # File: paper-export.py
# Export Paper Docs Tool
# Version 1.0
# Author: Marcel Ribas
# Date: 3/31/2021
import dropbox
import os
# Dropbox
try:
dbx = dropbox.Dropbox('<YOUR_API_KEY_HERE>')
# check if account has PiFS
features = dbx.users_features_get_values([dropbox.users.UserFeature.paper_as_files])
pifs = featu... | apache-2.0 | Python | |
f7fd11d657f10b2cb29000a29fcf839da6dea921 | Add initial Python submission parameter test | ddebrunner/streamsx.topology,ddebrunner/streamsx.topology,IBMStreams/streamsx.topology,ddebrunner/streamsx.topology,IBMStreams/streamsx.topology,ddebrunner/streamsx.topology,IBMStreams/streamsx.topology,ddebrunner/streamsx.topology,ddebrunner/streamsx.topology,ddebrunner/streamsx.topology,IBMStreams/streamsx.topology,I... | test/python/topology/test2_submission_params.py | test/python/topology/test2_submission_params.py | # coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016
from __future__ import print_function
import unittest
import sys
import itertools
from enum import IntEnum
import datetime
import decimal
import test_vers
from streamsx.topology.schema import StreamSchema
from streamsx.topology.topology ... | apache-2.0 | Python | |
ac9e3a4a8beec9bfa849aa2c0d64788e58e9999f | Add test for #1773 | explosion/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,honnibal/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy | spacy/tests/regression/test_issue1773.py | spacy/tests/regression/test_issue1773.py | from __future__ import unicode_literals
def test_issue1773(en_tokenizer):
"""Test that spaces don't receive a POS but no TAG. This is the root cause
of the serialization issue reported in #1773."""
doc = en_tokenizer('\n')
if doc[0].pos_ == 'SPACE':
assert doc[0].tag_ != ""
| mit | Python | |
abeaca1672e993044849e263be8b523b2a302f5d | Create 3-stopwatch-game.py | wezil/interactive-programming-python | 3-stopwatch-game.py | 3-stopwatch-game.py | """
Stopwatch: The Game
Try to stop the stopwatch on a whole second
Author: Weikang Sun
Date: 6/16/15
CodeSkulptor source:
http://www.codeskulptor.org/#user40_4jcI1JhVFY_3.py
"""
import simplegui
# time in tenths of a second
the_time = 0
success_tries = 0
total_tries = 0
# define helper function format that conver... | mit | Python | |
6cf47d4800ed49aecd12593fbfc5907090d5f6e9 | Create reverseipdomain.py | SudhanshuC/Maltego-Transforms,cmlh/Maltego-Transforms | reverseipdomain.py | reverseipdomain.py | #!/usr/bin/python
#reverseipdomain.py
#Author: Sudhanshu Chauhan - @Sudhanshu_C
#This Script will perform a reverse IP domain check
#http://www.yougetsignal.com
from MaltegoTransform import *
import sys
import urllib2
import re
mt = MaltegoTransform()
mt.parseArguments(sys.argv)
url=mt.getValue()
mt = MaltegoTran... | mit | Python | |
71005cf9236894ae264853da5d7f84558acbcd93 | Move background to dials.background; philling | dials/dials,dials/dials,dials/dials,dials/dials,dials/dials | command_line/background.py | command_line/background.py | # LIBTBX_SET_DISPATCHER_NAME dials.background
from __future__ import division
import iotbx.phil
help_message = '''
Examples::
dials.background image_*.cbf
'''
phil_scope = iotbx.phil.parse("""\
bins = 300
.type = int
""", process_includes=True)
def main():
import sys
run(sys.argv[1:])
def run(args):
... | bsd-3-clause | Python | |
0fa5e9944d573d053633b1ea81497bc20598abee | Solve Code Fights longest word problem | HKuz/Test_Code | CodeFights/longestWord.py | CodeFights/longestWord.py | #!/usr/local/bin/python
# Code Fights Longest Word Problem
import re
def longestWord(text):
m = re.findall(r'\b[a-z]+?\b', text, flags=re.I)
return max(m, key=len)
def main():
tests = [
["Ready, steady, go!", "steady"],
["Ready[[[, steady, go!", "steady"],
["ABCd", "ABCd"]
]... | mit | Python | |
f733e7fbb9fee6f8a6bedb18ddaa49c2564b9613 | add example | francois-berder/PyLetMeCreate | examples/color_example.py | examples/color_example.py | #!/usr/bin/env python3
from letmecreate.core import i2c
from letmecreate.click import color
i2c.init()
color.enable()
measure = color.get_color()
color.disable()
i2c.release()
print('clear: {}'.format(measure[0]))
print('red : {}'.format(measure[1]))
print('green: {}'.format(measure[2]))
print('blue : {}'.format(me... | bsd-3-clause | Python | |
930bffa44a2cc0b1be34035d366f51dc1caa7934 | Clean solution. | pisskidney/leetcode | medium/59.py | medium/59.py | #!/usr/bin/python
from typing import List
"""
59. Spiral Matrix II
https://leetcode.com/problems/spiral-matrix-ii/
"""
class Solution:
def generateMatrix(self, n: int) -> List[List[int]]:
left = 0
right = n - 1
top = 0
bottom = n - 1
res = [[None for _ in range(n)] for _... | mit | Python | |
9929f6c92e945220334881cd51e36003cc758f95 | Remove celery settings. | mrkeng/aurora,ak3n/aurora,ak3n/aurora,ak3n/aurora,mrkeng/aurora,mrkeng/aurora | settings.py | settings.py | import os
import getpass
_basedir = os.path.abspath(os.path.dirname(__file__))
# flask settings
DEBUG = False
CSRF_ENABLED = True
SECRET_KEY = 'aurora-app'
# sqlalchemy settings
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(_basedir, 'aurora.db')
# aurora settings
AURORA_PATH = '/home/{0}/.aurora/'.format(g... | import os
import getpass
_basedir = os.path.abspath(os.path.dirname(__file__))
# flask settings
DEBUG = False
CSRF_ENABLED = True
SECRET_KEY = 'aurora-app'
# sqlalchemy settings
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(_basedir, 'aurora.db')
# aurora settings
AURORA_PATH = '/home/{0}/.aurora/'.format(g... | mit | Python |
a8422464dcc981f114fb4e5a61a8c2f26bb00199 | Allow LogDevice to build without Submodules (#71) | facebook/folly,facebook/folly,facebook/folly,facebook/folly,facebook/folly | build/fbcode_builder/specs/rocksdb.py | build/fbcode_builder/specs/rocksdb.py | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
def fbcode_builder_spec(builder):
builder.add_option("rocksdb/_build:cmake_defines", {
... | apache-2.0 | Python | |
ffd05d0ab5b1a38dfe688b7d82b345d65e122f3e | add series.py (#43) | Baumelbi/IntroPython2016,weidnem/IntroPython2016,Baumelbi/IntroPython2016,weidnem/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,UWPCE-PythonCert/IntroPython2016,UWPCE-PythonCert/IntroPython2016 | students/heb2016/session02/series.py | students/heb2016/session02/series.py |
## Session02 Exercise
# fibonacci
def fibonacci(n):
row=0
while row<=n:
if row==0:
nth1=row
nth2=0
nth=nth1+nth2
if n==0:
print(row, "number", nth)
return(nth)
row+=1
if row==1:
nth2=row
nth1=0
nth=nth1+nth2
if n==1:
print(row,"number", nth)
return(nt... | unlicense | Python | |
5d53c33272bef9d7124c3e1a71e75c592c33d71d | Add hdf_compress.py | fsteinmetz/runlib | hdf_compress.py | hdf_compress.py | #!/usr/bin/env python
# vim:fileencoding=UTF-8
'''
hdf compression tool
François Steinmetz, started sept. 2006
'''
import pyhdf.SD
from runlib.tmpfiles import TmpOutput
import multiprocessing
from optparse import OptionParser
try:
from progressbar import ProgressBar
except ImportError:
ProgressBar = lambda : ... | mit | Python | |
84c9f6ed7b4c4ff77c52870af3b0d275217a6699 | Add server main.py use get and json | hwhung0111/2017NASA_NCTUBeach,hwhung0111/2017NASA_NCTUBeach | Server/main.py | Server/main.py | import time
import BaseHTTPServer
from urlparse import urlparse
import json
HOST_NAME = '140.113.235.154' # !!!REMEMBER TO CHANGE THIS!!!
PORT_NUMBER = 9000 # Maybe set this to 9000.
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_HEAD(s):
s.send_response(200)
s.send_header("Conte... | apache-2.0 | Python | |
cbd1e331aeb11ea4fe7531cf90443ba964cb7816 | Fix 'gsutil: not found' error; use gsutil.py instead. | Chilledheart/chromium,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Chilledheart/chr... | testing/chromoting/download_test_files.py | testing/chromoting/download_test_files.py | # Copyright (c) 2015 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.
"""A script to download files required for Remoting integration tests from GCS.
The script expects 2 parameters:
input_files: a file containing t... | # Copyright (c) 2015 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.
"""A script to download files required for Remoting integration tests from GCS.
The script expects 2 parameters:
input_files: a file containing t... | bsd-3-clause | Python |
31b46f0ab99b945a97e3dd08d7e8d6a9a63ad75a | Sort Array By Parity II | MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode | array/922.py | array/922.py | class Solution:
def sortArrayByParityII(self, A):
"""
:type A: List[int]
:rtype: List[int]
"""
if not A:
return A
size = len(A)
even = 0
odd = 1
while even < size - 1 and odd < size:
while even < size -... | apache-2.0 | Python | |
62a1d789a5d802424eb8f0c7b6278cf63fb39bc5 | Add a views file, currently just contains the warmup view | chargrizzle/djangae,grzes/djangae,martinogden/djangae,stucox/djangae,trik/djangae,armirusco/djangae,armirusco/djangae,leekchan/djangae,pablorecio/djangae,SiPiggles/djangae,stucox/djangae,martinogden/djangae,kirberich/djangae,armirusco/djangae,wangjun/djangae,nealedj/djangae,asendecka/djangae,chargrizzle/djangae,potatol... | djangae/views.py | djangae/views.py |
from django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
def warmup(request):
"""
Provides default procedure for handling warmup requests on App
Engine. Just add this view to your main urls.py.
"""
for app in settings.INSTALLED_... | bsd-3-clause | Python | |
2ecfbefd18165a8d8d54d9bec682b5b47ca633a6 | Write a geojson summary of each agency in gtfs | srthurman/transitland-python-client,transitland/transitland-python-client | onestop/examples/summary.py | onestop/examples/summary.py | import sys
import os
import json
import onestop.gtfs
def summarize(filename):
d = os.path.dirname(filename)
if os.path.exists(os.path.join(d, 'status.txt')):
print "Exists, skipping."
continue
# Create OnestopIds for each agency.
g = onestop.gtfs.GTFSReader(filename)
for agency in g.agencies():
... | mit | Python | |
38fd1aba95d9aced38b4363daa39ec8f9fff7555 | Add migration | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/geo/migrations/0016_location_slug.py | bluebottle/geo/migrations/0016_location_slug.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2020-07-01 14:56
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('geo', '0015_add_permissions'),
]
operations = [
migrations.AddField(
... | bsd-3-clause | Python | |
eade3fa4f4d53574f359b9006b4d36b1bf428d49 | Add a tiny test application for testing the plugin registry | onitake/Uranium,onitake/Uranium | tests/pluginregistry.py | tests/pluginregistry.py | #!/usr/bin/env python2
import Cura.PluginRegistry
p = Cura.PluginRegistry.PluginRegistry()
p.addPluginLocation("plugins")
p._populateMetaData()
#p.loadPlugin("ExamplePlugin")
print(p.getMetaData("ExamplePlugin"))
| agpl-3.0 | Python | |
4b60e1b6e4fd33d7ac221fa2262284b10e7c3260 | Create VNFRAME.py | Juggalojohn/VN | VNFRAME.py | VNFRAME.py | #VNFRAME
#Tmp Place Holder
| bsd-2-clause | Python | |
bc87ae3984a522a0b5ece104d735d0df2348fa22 | Add __main__.py | scottfrazer/mdtoc | mdtoc/__main__.py | mdtoc/__main__.py | #!/usr/bin/env python
import sys
import mdtoc.main
if __name__ == "__main__":
sys.exit(mdtoc.main.cli())
| mit | Python | |
ef8dcf45bbc23f2a18c06179988499a0ea4571cd | Add first rudimentary test | epii/pyramid_airbrake | pyramid_airbrake/tests/test_tween.py | pyramid_airbrake/tests/test_tween.py | import unittest
from pyramid import testing
class Test_airbrake_tween_factory(unittest.TestCase):
def setUp(self):
self.config = testing.setUp(settings={'airbrake.api_key': '01234'})
self.registry = self.config.registry
def _callFUT(self):
from pyramid_airbrake import airbrake_tween_fa... | mit | Python | |
1cd42156db1ed90c8fdb7d86c3577dad659d5399 | add testing skeleton for Judge | IanDCarroll/xox | tests/test_judge_pit.py | tests/test_judge_pit.py | from source.judge_pit import *
class JudgeTestCase(unittest.TestCase):
def setUp(self):
pass
def test_check_for_winner_returns_computer_p1_win(self):
pass
def test_check_for_winner_returns_computer_p2_win(self):
pass
def test_check_for_winner_returns_human_p1_win(self):
... | mit | Python | |
a87525e6149cc3a5b9062e6657423559dcb875e0 | Create hacks/kooqueue/__init__.py | priyamanibhat/eKoomerce,priyamanibhat/eKoomerce,priyamanibhat/eKoomerce | hacks/kooqueue/__init__.py | hacks/kooqueue/__init__.py | import flask
import xml.etree.ElementTree as ET
from urllib.parse import unquote
import sqlite3
from hacks.kooqueue.helper import *
app = flask.Blueprint('kooqueue', __name__, template_folder='templates')
@app.route('/', methods = ['GET', 'POST'])
def home():
params = flask.request.args
try:
phone_no = params['ph... | mit | Python | |
c6fbba9da9d1cf2a5a0007a56d192e267d19fcff | Fix with_session decorator for python 2.5 | vfrc2/Flexget,tobinjt/Flexget,Pretagonist/Flexget,oxc/Flexget,Danfocus/Flexget,jacobmetrick/Flexget,Flexget/Flexget,spencerjanssen/Flexget,ianstalk/Flexget,xfouloux/Flexget,malkavi/Flexget,asm0dey/Flexget,v17al/Flexget,camon/Flexget,ZefQ/Flexget,cvium/Flexget,jacobmetrick/Flexget,crawln45/Flexget,camon/Flexget,OmgOhnoe... | flexget/utils/database.py | flexget/utils/database.py | from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, **kwargs):
if not kwargs.get('session'):
kwargs['session'] = Session(autoflush=True)
try:
... | from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, **kwargs):
passed_session = kwargs.get('session')
if not passed_session:
session = Session(autoflush=True)
... | mit | Python |
a541db3169493d7cbdd64ec0c47a5acba439e11d | Create tap_td_constant.py | vnpy/vnpy,bigdig/vnpy,vnpy/vnpy,bigdig/vnpy,bigdig/vnpy,bigdig/vnpy | vnpy/api/tap/generator/tap_td_constant.py | vnpy/api/tap/generator/tap_td_constant.py | APIYNFLAG_YES = "Y"
APIYNFLAG_NO = "N"
APIPASSWORD_TRADE = "T"
APIPASSWORD_PHONE = "P"
APILOGLEVEL_NONE = "N"
APILOGLEVEL_ERROR = "E"
APILOGLEVEL_WARNING = "W"
APILOGLEVEL_DEBUG = "D"
TAPI_OPTION_TYPE_AMERICAN = "A"
TAPI_OPTION_TYPE_AMERICAN2 = "B"
TAPI_OPTION_TYPE_EUROPEAN = "E"
TAPI_OPTION_TYPE_EUROPEAN2 = "F"
TAPI_C... | mit | Python | |
d6e0aeb6c6f83d75eed149a1fcf928f933619b91 | add common.http unit tests | icgood/provoke,icgood/provoke | test/test_common_http.py | test/test_common_http.py |
import unittest
from mock import patch, MagicMock
import httplib
from provoke.common.http import HttpConnection
class TestHttpConnection(unittest.TestCase):
def setUp(self):
HttpConnection._connection_params = {}
def test_reset_connection_params(self):
HttpConnection.set_connection_params... | mit | Python | |
711d9d4423005baa949f4aba74effd4308ddcb6b | add test_exec | Akagi201/learning-python,Akagi201/learning-python,Akagi201/learning-python,Akagi201/learning-python,Akagi201/learning-python | misc/test_exec.py | misc/test_exec.py | # -*- coding: utf-8 -*-
# exec_stmt ::= "exec" or_expr ["in" expression ["," expression]]
# exec的第一个表达式可以是
# 代码字符串
# 文件对象
# 代码对象
# tuple
# test1 如果忽略后面的可选表达式,exec后面代码将在当前域执行
a = 2
exec "a=1"
print(a)
# test2 如果在表达式之后使用in选项指定一个dic,它将作为global和local变量作用域
a = 10
b = 20
g = {'a': 6, 'b': 8}
exec "global a; print a,b" in... | mit | Python | |
825ef72d89c55124e500cad20c86a6ef3eeaa219 | Add simple vprof example (#33). | nvdv/vprof,nvdv/vprof,nvdv/vprof | examples/permutations.py | examples/permutations.py | """Simple examples calculating iterable permutations.
Example is taken from https://docs.python.org/3.5/library/itertools.html.
To profile this with vprof run:
vprof -c cmh -s permutations.py
"""
def permutations(iterable, r=None):
pool = tuple(iterable)
n = len(pool)
r = n if r is None else r
if... | bsd-2-clause | Python | |
fa2d2ff4829f77e5f1fb33d422f59c97429fc1d4 | make balancedconsumer test deterministic | sontek/pykafka,sontek/pykafka,thedrow/samsa,thedrow/samsa,wikimedia/operations-debs-python-pykafka,appsoma/pykafka,sammerry/pykafka,appsoma/pykafka,fortime/pykafka,jofusa/pykafka,vortec/pykafka,jofusa/pykafka,sammerry/pykafka,benauthor/pykafka,yungchin/pykafka,yungchin/pykafka,wikimedia/operations-debs-python-pykafka,a... | tests/kafka/test_balancedconsumer.py | tests/kafka/test_balancedconsumer.py | import mock
import unittest2
from uuid import uuid4
from kafka.balancedconsumer import BalancedConsumer
class TestBalancedConsumer(unittest2.TestCase):
def test_decide_partitions(self):
for i in xrange(100):
num_participants = i + 1
num_partitions = 100 - i
consumer_gr... | import mock
import unittest2
import random
from uuid import uuid4
from kafka.balancedconsumer import BalancedConsumer
class TestBalancedConsumer(unittest2.TestCase):
def test_decide_partitions(self):
for i in xrange(100):
num_participants = random.randint(1, 300)
num_partitions = ... | apache-2.0 | Python |
544857a7a3cdb40fd793fed8e33694d551cc695f | Add initial version of the commandline tool | Matt-Deacalion/Pomodoro-Calculator | pomodoro_calculator/main.py | pomodoro_calculator/main.py | """Calculate the number of Pomodori available within a time period.
Usage:
get-pomodori [--from=<time>] [--break=<minutes>] [--long-break=<minutes>] <end-time>
get-pomodori (-h | --help | --version)
Options:
--version show program's version number and exit.
-h, --help show t... | mit | Python | |
3993744a9f6771ff328c2ebbf537e65964f36d2c | test json format for is-regulation | xzhang2016/tfagent | tfta/test/test1_json.py | tfta/test/test1_json.py | from kqml import KQMLList, KQMLString
from tfta.tfta import TFTA
from tfta.tfta_module import TFTA_Module
from bioagents.tests.util import ekb_from_text, ekb_kstring_from_text, \
get_request, agent_clj_from_text
from bioagents.tests.integration import _IntegrationTest, _FailureTest
from... | bsd-2-clause | Python | |
fb238ad63e86fa0387ff0e923f86964736421ab2 | make the linter happy | mhils/mitmproxy,vhaupert/mitmproxy,laurmurclar/mitmproxy,ujjwal96/mitmproxy,Kriechi/mitmproxy,cortesi/mitmproxy,laurmurclar/mitmproxy,Kriechi/mitmproxy,MatthewShao/mitmproxy,ujjwal96/mitmproxy,zlorb/mitmproxy,mosajjal/mitmproxy,mosajjal/mitmproxy,dufferzafar/mitmproxy,vhaupert/mitmproxy,xaxa89/mitmproxy,mhils/mitmproxy... | examples/remote_debug.py | examples/remote_debug.py | """
This script enables remote debugging of the mitmproxy *UI* with PyCharm.
For general debugging purposes, it is easier to just debug mitmdump within PyCharm.
Usage:
- pip install pydevd on the mitmproxy machine
- Open the Run/Debug Configuration dialog box in PyCharm, and select the Python Remote Debug conf... | """
This script enables remote debugging of the mitmproxy *UI* with PyCharm.
For general debugging purposes, it is easier to just debug mitmdump within PyCharm.
Usage:
- pip install pydevd on the mitmproxy machine
- Open the Run/Debug Configuration dialog box in PyCharm, and select the Python Remote Debug conf... | mit | Python |
1f49623872763f367c4b14dcb772db1b3c015838 | test bluetooth using python 3 socket (doesn't work) | nebgnahz/HOBS,nebgnahz/HOBS,nebgnahz/HOBS | server/bt3.py | server/bt3.py | import socket
hostMACAddress = 'B8:F6:B1:19:5F:68' # The MAC address of a Bluetooth adapter on the server. The server might have multiple Bluetooth adapters.
port = 1 # 3 is an arbitrary choice. However, it must match the port used by the client.
backlog = 1
size = 1024
s = socket.socket(socket.AF_BLUETOOTH, soc... | bsd-2-clause | Python | |
b0af7b59910d266c3cf7a5bb3e9f7f95a7ac046f | Add a demo. | jeremiedecock/pyax12,jeremiedecock/pyax12 | examples/set_baudrate.py | examples/set_baudrate.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# PyAX-12
# The MIT License
#
# Copyright (c) 2010,2015,2017 Jeremie DECOCK (http://www.jdhp.org)
#
# 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 Sof... | mit | Python | |
8f551c3944254eff2259f575df997efa31a04e99 | Add tests for match endpoint | the-blue-alliance/the-blue-alliance,josephbisch/the-blue-alliance,bdaroz/the-blue-alliance,verycumbersome/the-blue-alliance,nwalters512/the-blue-alliance,1fish2/the-blue-alliance,verycumbersome/the-blue-alliance,1fish2/the-blue-alliance,fangeugene/the-blue-alliance,jaredhasenklein/the-blue-alliance,the-blue-alliance/th... | tests/test_apiv2_match_controller.py | tests/test_apiv2_match_controller.py | import unittest2
import webtest
import json
import webapp2
import datetime
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from controllers.api.api_match_controller import ApiMatchController
from models.event import Event
from models.match import Match
class TestMatchApiController(uni... | mit | Python | |
9b5ead2da9a334fd0d89e3101a75e6f76ad7a5c7 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/9851cf287f7ac21db2f4baeae7fb3165dec2e1b7. | tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_mode... | 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 = "9851cf287f7ac21db2f4baeae7fb3165dec2e1b7"
TFRT_SHA256 = "616204e03d967d51b1c0455ceda9... | """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 = "ce088d16c1f59e51535356c58203077e6e1f62a3"
TFRT_SHA256 = "5577403c67f3b1050ae2b715a083... | apache-2.0 | Python |
3ff9e48a165a981685bb0700ea18b2881e99b211 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/3de4262a1981efbeed30ca1eab44957075264cdd. | Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,... | 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 = "3de4262a1981efbeed30ca1eab44957075264cdd"
TFRT_SHA256 = "92a8a2d6e4a2914b286b95cef0f4... | """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 = "18a8602149411f2df71ca6653e30ecbb2194434e"
TFRT_SHA256 = "100ac1c35e5cf52b27e8f08b85a5... | apache-2.0 | Python |
ab7cacae6d52f85a6fae556e9d05d3c0be87efd8 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/496179018b5f6ec2fa02fb7eb1ccc0bcb290674c. | gautam1858/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-Corporation/tensorflow,yongtang/tensorflow,tens... | 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")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "496179018b5f6ec2fa02fb7eb1ccc0bcb290674c"
TFRT_SHA256 = "ec1f5591266a7bf426cc2cf98348288dc92d3b82636b50... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "88a996b3ee88f578927bc5135a359468cdfde94b"
TFRT_SHA256 = "5729632abe970e846e316a66e647169010c56d122bd3d5... | apache-2.0 | Python |
66073cfff70f5584b8e5825506868c531e731931 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/6743ca8ecbf9c7f5a22e6ae5865f5a8caf59248c. | tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensor... | 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 = "6743ca8ecbf9c7f5a22e6ae5865f5a8caf59248c"
TFRT_SHA256 = "9c8acba45293032b24b49a767d4d... | """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 = "eaf0cd3987bccb607e665ae25a209b16227b1d00"
TFRT_SHA256 = "0a9934c941fbaca0fe1f50afe16f... | apache-2.0 | Python |
3e546fa85cd65c90d59d6219a814efd97bc1dc36 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/f4f42f0ecf65fe0d77351fefb48ed036ac181988. | tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,frreiss/tensorflow-fred,paolodedios/tensorflow,paolodedios/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,yongtang/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-experimental_link_static_librari... | 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")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "f4f42f0ecf65fe0d77351fefb48ed036ac181988"
TFRT_SHA256 = "19e067b2467cd58183e37acce42c330b1fa6be741fc54d... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "6876ebd1aed2278b8cf9217113ab6647191a8ab1"
TFRT_SHA256 = "f053277200e21b408e2378781a1af1685e8fd9bfb851b6... | apache-2.0 | Python |
5e04d9610d4665437d97a956549d71f5c2059f80 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/8d3c2c75e02d3333df81807ff8f6c64f55353766. | tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,Intel-Corporation/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow... | 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")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "8d3c2c75e02d3333df81807ff8f6c64f55353766"
TFRT_SHA256 = "f696e2ab56f9e33bd562ebe700111bcec17c49afe47939... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "ff42670bfa8441b337a4984bd6b3ad6b357ecaad"
TFRT_SHA256 = "e7642aac687237081e9c704b827421fba4b123638b9816... | apache-2.0 | Python |
21cb15b81af8a96a9a84f021d17f80e813022a69 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/4740d49e97813258bbfc565ddbd830ed6027d9ed. | tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,paolodedios/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_onc... | 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 = "4740d49e97813258bbfc565ddbd830ed6027d9ed"
TFRT_SHA256 = "d55172dd10c9ddf9fea88b525567... | """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 = "3431caa9e8c3cccc7680b341eb6f0b35d7d350b9"
TFRT_SHA256 = "e1d03bd32f5b80d677cc9f67d2d4... | apache-2.0 | Python |
14f0f7e3550397dc9b58c73fdee7fb7f794a6075 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/749f58308d67c424f4dfac8ff5ba4f581d9a59e6. | Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,karllessard/tensorflow,Intel-tensorflow/tensorflow,karllessard/tensorflow,yongtang/tensorflow,Intel-tensorflow/tensorflow,ten... | 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 = "749f58308d67c424f4dfac8ff5ba4f581d9a59e6"
TFRT_SHA256 = "99d77a49718905b705c1992b0a5e... | """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 = "087aa15654aaf42e02bf69b4cc77d00a84bd0fd7"
TFRT_SHA256 = "b3a86f2ff179479232b59c557619... | apache-2.0 | Python |
aff3c3337770b994b2be010f9c882ded489d96a6 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/8428fae7c9397b1418bff77766b9a77c24c8ae99. | tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_sta... | 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")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "8428fae7c9397b1418bff77766b9a77c24c8ae99"
TFRT_SHA256 = "a84fed2fc137cf5a28f83db851df9542f2b94b37824e8a... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "dee1a057d4af2ce1d3b29152f0e8fed5f246a9cf"
TFRT_SHA256 = "72cebaddb8c020c08074adfb201c18e72fcc9a189393e7... | apache-2.0 | Python |
657c8c348439a3a52af9b9ebd3ac2fce319151fb | Add polybius algorithm in python | ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs... | cryptography/polybius_cipher/python/polybius.py | cryptography/polybius_cipher/python/polybius.py | # Python implementation of the Polybius algorithm
# The algorithm uses an extended encryption table that allows to use numbers
import re
from typing import OrderedDict
ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
# Function to build the Polybius checkerboard
def make_table(key):
try:
key = str(key)
... | cc0-1.0 | Python | |
e0a9dcdca5124b0a92fc4eb0cd4fd1d0d070bed5 | Create strange-printer.py | kamyu104/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,yiwen-luo/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,yiwen-luo/LeetCode,yiwen-luo/LeetCode,yiwen-luo/LeetCode,kamyu104/LeetCode,tudennis/Lee... | Python/strange-printer.py | Python/strange-printer.py | # Time: O(n^3)
# Space: O(n^2)
# There is a strange printer with the following two special requirements:
#
# The printer can only print a sequence of the same character each time.
# At each turn, the printer can print new characters starting from
# and ending at any places, and will cover the original existing charac... | mit | Python | |
5d8fdc8ab0f7738bb5ca451cf22fda088dc99bd7 | add missing migration after slug_validation change in core | terceiro/squad,terceiro/squad,terceiro/squad,terceiro/squad | squad/ci/migrations/0009_slug_pattern.py | squad/ci/migrations/0009_slug_pattern.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-06-06 18:33
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ci', '0007_auto_20170517_1736'),
]
operations = [
... | agpl-3.0 | Python | |
c3dc48f670b0b7c5b47b18572541ecd0a5ca1418 | Add application file for AWS deploy | sevazhidkov/leonard | application.py | application.py | from bot import bot
application = bot.app
| mit | Python | |
9dbbf4278b42866e88e60e76c1b0bb087321111f | Add Setup-file | BrixInMotion/RaspiRobot-Webcontrol,BrixInMotion/RaspiRobot-Webcontrol,BrixInMotion/RaspiRobot-Webcontrol,BrixInMotion/RaspiRobot-Webcontrol,BrixInMotion/RaspiRobot-Webcontrol,BrixInMotion/RaspiRobot-Webcontrol | Setup-Camera-bot.py | Setup-Camera-bot.py | import os
import sys
import time
import string
if __name__=='__main__':
## print('-------------------------------------------------------------------')
## print('Setup camera streaming...')
## print('-------------------------------------------------------------------')
## os.system('sudo apt-get install gc... | bsd-3-clause | Python | |
ff98714a91e029c7f8c39e78d2ff787af015587e | add db_create.py script | HendrikVE/riotam-backend | setup/db_create.py | setup/db_create.py | #! /usr/bin/env python
# -*- coding:utf-8 -*-
"""Create backend database and repository.
It should be run as the root account without mysql password.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import MySQLdb as db
import db_config as config
REM... | lgpl-2.1 | Python | |
558d34ae3dbc10714b252ec1824ec40a0ee37d5b | Add a test for the mathematical derivations. | probcomp/cgpm,probcomp/cgpm | tests/test_teh_murphy.py | tests/test_teh_murphy.py | # -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2014 Baxter S. Eaves Jr,
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# Lead Developer: Feras Saad <fsaad@mit.edu>
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documen... | apache-2.0 | Python | |
51d49dc5d7a78d5a1c2fb260d0b3f62e3199f369 | add similarity_test.py | vrmarcelino/Shape-4-Qiime,vrmarcelino/Shape-4-Qiime,vrmarcelino/Shape-4-Qiime | similatity_test.py | similatity_test.py | # -*- coding: utf-8 -*-
"""
Check similarity among same species/genera sequences
USAGE: similarity_test.py -t ref_alignment.fasta -t species
Warning: this script simply computes the fraction of non-variant sites.
It gives a rough idea of the threshold that you want to use to define OTUs, but ne aware that it will var... | mit | Python | |
0d48fbe45e94662dfc21c868f56ab8a8fba176f5 | add basic creation of client auth token | Ziggeo/ZiggeoPythonSdk,Ziggeo/ZiggeoPythonSdk | demos/client_auth_token.py | demos/client_auth_token.py | import sys
from Ziggeo import Ziggeo
if(len(sys.argv) < 4):
print "Error\n"
print "Usage: $>python client_auth_token.py YOUR_API_TOKEN YOUR_PRIVATE_KEY ENCRYPTION_KEY \n"
sys.exit()
api_token = sys.argv[1]
private_key = sys.argv[2]
encryption_key = sys.argv[3]
ziggeo = Ziggeo(api_token, private_key, encryption_k... | apache-2.0 | Python | |
76a623818550a177382e2fadeba5fcfb4f06df85 | Create problem-2.py | vnbrs/project-euler | problem-2.py | problem-2.py | sequence = [1,2]
sequence_only_odds = [2]
last_value = sequence[1]
last_count = 2
while last_value <= 4000000:
last_value = sequence[last_count - 1] + sequence[last_count - 2]
last_count += 1
sequence.append(last_value)
if last_value % 2 == 0:
sequence_only_odds.append(last_value)
print(sum(s... | mit | Python | |
417ace41641800f30f8665ff9fb71f92cbf38f0a | add script to download files from the GDC and upload them to GCS | isb-cgc/ISB-CGC-data-proc,isb-cgc/ISB-CGC-data-proc,isb-cgc/ISB-CGC-data-proc | gdc/util/upload_files.py | gdc/util/upload_files.py | '''
Created on Jul 27, 2016
Copyright 2016, Institute for Systems Biology.
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... | apache-2.0 | Python | |
59b5b9de0898ad09b2ff9967cb5623ca6f627351 | Merge migrations | Inter-Actief/alexia,Inter-Actief/alexia,Inter-Actief/alexia,Inter-Actief/alexia | apps/organization/migrations/0016_merge.py | apps/organization/migrations/0016_merge.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-11 15:41
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('organization', '0015_auto_20160419_1133'),
('organization', '0010_membership_is_active'),
... | bsd-3-clause | Python | |
1958dbf86e8a2cab762292b9bee2f1fa67a30953 | Bump version to 2.0.1 | cloudendpoints/endpoints-python,inklesspen/endpoints-python,cloudendpoints/endpoints-python,inklesspen/endpoints-python | endpoints/__init__.py | endpoints/__init__.py | #!/usr/bin/python
#
# Copyright 2016 Google 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | #!/usr/bin/python
#
# Copyright 2016 Google 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 | Python |
73cabaaa6dfadfd0713a93db734770944c3181bc | Create Epic_story.py | kejrp23/Python | Epic_story.py | Epic_story.py | """
Welcome to the most awesome story ever, it's awesome because the user will help to write it,
so the code might can look better but there is a beginners story so who cares,
alright lets get started shall we!!
Created by Jason R. Pittman on 2/20/2016 for Codeacademy Project
Written in Python 2.7
"""
print "Welcome... | artistic-2.0 | Python | |
eb67aa15768e2233216cb896676408e7ecb741ef | Create main.py | HaythemSahbani/Web-mining-university-project | src/main.py | src/main.py | from Preprocess import Preprocess
from Preprocess import TweetTokenizer
from twitter_crawl import TwitterCrawl
from Clustering import Clustering
from hashtag_classification import HtagClassifier, plot
from plot import present_all_data
from Polarity_classifier import Polarity_classifier
screen_name = "BarackObama"
# "S... | mit | Python | |
08573c7c6eb20c7cf168d38a6566757b08fed6d9 | Add a snippet (Python OpenCV). | jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets | python/opencv/opencv_2/videos/capture_video_from_camera.py | python/opencv/opencv_2/videos/capture_video_from_camera.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
"""
OpenCV - Read image: read an image given in arguments
Required: opencv library (Debian: aptitude install python-opencv)
See: https://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_gui/py_vid... | mit | Python | |
4352d6735d478ced62f71acbc2f1ef81175c5f78 | add training worker | NervanaSystems/coach,NervanaSystems/coach,NervanaSystems/coach | rl_coach/training_worker.py | rl_coach/training_worker.py | """
"""
import argparse
from rl_coach.base_parameters import TaskParameters
from rl_coach.coach import expand_preset
from rl_coach import core_types
from rl_coach.utils import short_dynamic_import
# Q: specify alternative distributed memory, or should this go in the preset?
# A: preset must define distributed memory ... | apache-2.0 | Python | |
c6be5a0fa1902a72e31aa89afdd8799c0b968e52 | Store db_uri in a constants file | chuo06/palindrome,chuo06/palindrome | constants.py | constants.py | PALINDROME_DB_URI = 'sqlite:///test.db'
# TODO use prod database
# PALINDROME_DB_URI = (
# 'mysql+pymysql://jzamb:3Dn}ht*AU2Uz@palindrome.c6rx6kxrdmgi.us-west-2'
# '.rds.amazonaws.com:3306/palindrome'
# )
| mit | Python | |
38db5b36d807651ddc6a2e4c0a8ee21771a2d945 | Create 4list_delet_elemet.py | avsingh999/Learn_python | list/4list_delet_elemet.py | list/4list_delet_elemet.py | List=[11,22,33,44,55,66,77,88]
#remove by element
List.remove(11)
print(List)
#delete element by index
del List[3]
print(List)
#delete last element
List.pop()
print(List)
#we can use for delete at index
List.pop(2)
print(List)
#list will be empty
List.clear()
print(List)
#del List
del List
#if we print it will s... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.