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 |
|---|---|---|---|---|---|---|---|---|
bd2be3fdf54ae4b08b75dbe104824fa941a12baa | Add tests for cli_run module. (#57) | GoogleCloudPlatform/snapshot-debugger | snapshot_dbg_cli_tests/test_cli_run.py | snapshot_dbg_cli_tests/test_cli_run.py | # Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python | |
7610646e10b4f725cb7e6a4466bbc24a2bffac1a | Add FileReader test | ndokter/dsmr_parser | test/test_filereader.py | test/test_filereader.py | import unittest
import tempfile
from dsmr_parser.clients.filereader import FileReader
from dsmr_parser.telegram_specifications import V5
from test.example_telegrams import TELEGRAM_V5
class FileReaderTest(unittest.TestCase):
def test_read_as_object(self):
with tempfile.NamedTemporaryFile() as file:
... | mit | Python | |
65786b132708ade5e05bf4636659a7b4e93f3935 | Create mcafeeatr_github_iocs.py (#414) | yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti | plugins/feeds/public/mcafeeatr_github_iocs.py | plugins/feeds/public/mcafeeatr_github_iocs.py | import logging
from dateutil import parser
from datetime import datetime, timedelta
from core.feed import Feed
from core.errors import GenericYetiError
from core.observables import Observable
from core.observables import Hash, Url, Hostname, Ip, MacAddress, Email, Certificate
from core.errors import ObservableValidatio... | apache-2.0 | Python | |
3f8512ec7123478a40b56e5217dd87958a99f505 | Add form_example.py (#22) | lmtierney/watir-snake | examples/form_example.py | examples/form_example.py | # Based on http://watir.com/guides/form-example/
from nerodia.browser import Browser
from time import sleep # needed to perform sleep
from faker import Faker # needed for fake form data
import os # needed for file path
# Setup
browser = Browser(browser='chrome')
browser.window().maximize()
# Navigate to the Page
... | mit | Python | |
8d74cf260558197b236771a87f32da3280b11d4e | Add animation template | TristanCacqueray/demo-code | animation_template.py | animation_template.py | #!/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 | Python | |
5ced35b83d1388a9cc5410270782922199f7c401 | Add script to measure BBA. | lnls-fac/apsuite | apsuite/commissioning_scripts/measure_bba.py | apsuite/commissioning_scripts/measure_bba.py | """Main module."""
from collections import namedtuple
from copy import deepcopy as _dcopy
import numpy as np
from qtpy.QtCore import QObject, QThread
from siriuspy.csdevice.orbitcorr import SOFBFactory
from siriuspy.namesys import SiriusPVName as _PVName
import pyaccel as _pyacc
def get_default_quads(model, fam_d... | mit | Python | |
217a477802cf34083786cabe0722cd1b8362efc7 | Create ClawEjectScipt.py | RAWrobotics/Orion5,RAWrobotics/Orion5 | Python/ClawEjectScipt.py | Python/ClawEjectScipt.py | import time
import orion5
from orion5.utils.general import waitForOrion5Forever
print('\nSearching for Orion5...')
comport = waitForOrion5Forever()
print('Found Orion5, serial port name:', comport)
orion = orion5.Orion5(comport)
time.sleep(3)
def gotoPositionBlocking(pos):
orion.claw.setPosition(pos)
while ... | mit | Python | |
b003c0bb75cda22afafe867153908d484f18e651 | FIX price security | dvitme/odoo-addons,ingadhoc/product,levkar/odoo-addons,ingadhoc/odoo-addons,ingadhoc/sale,dvitme/odoo-addons,ingadhoc/sale,levkar/odoo-addons,ingadhoc/sale,sysadminmatmoz/ingadhoc,ingadhoc/product,ingadhoc/sale,jorsea/odoo-addons,sysadminmatmoz/ingadhoc,maljac/odoo-addons,adhoc-dev/account-financial-tools,ingadhoc/acco... | price_security/models/product.py | price_security/models/product.py | # -*- coding: utf-8 -*-
from openerp import fields, models, api
class product_template(models.Model):
_inherit = 'product.template'
can_modify_prices = fields.Boolean(
help='If checked all users can modify the\
price of this product in a sale order or invoice.',
string='Can modify pri... | # -*- coding: utf-8 -*-
from openerp import fields, models, api
class product_template(models.Model):
_inherit = 'product.template'
can_modify_prices = fields.Boolean(
help='If checked all users can modify the\
price of this product in a sale order or invoice.',
string='Can modify pri... | agpl-3.0 | Python |
ad2db80f8aeba7fe407eccd69327cfb3bdfaacd2 | Add sol3 for project_euler problem_03 (#1553) | TheAlgorithms/Python | project_euler/problem_03/sol3.py | project_euler/problem_03/sol3.py | """
Problem:
The prime factors of 13195 are 5,7,13 and 29. What is the largest prime factor
of a given number N?
e.g. for 10, largest prime factor = 5. For 17, largest prime factor = 17.
"""
def solution(n: int) -> int:
"""Returns the largest prime factor of a given number n.
>>> solution(13195)
29
... | mit | Python | |
3299778a0c473abd747d5d5b2df1dd064b75cefe | add log.py | PolyJIT/benchbuild,PolyJIT/benchbuild,PolyJIT/benchbuild,PolyJIT/benchbuild | pprof/log.py | pprof/log.py | #!/usr/bin/env python
# encoding: utf-8
""" Analyze the PPROF database. """
from plumbum import cli
from pprof.driver import PollyProfiling
def print_runs(query):
""" Print all rows in this result query. """
if query is None:
return
for tup in query:
print("{} @ {} - {} id: {} group: {... | mit | Python | |
c2ee52ed6bcd19ecbc1b385a54a9754c75e58a5d | Create relscript.py | jcoombes/computing-year-2 | relscript.py | relscript.py | """
Tests the super_boost() method of FourVector class.
This first test ensures the boost forwards then backwards returns
the original minkowski vector.
"""
from __future__ import division
import relativity as rel
import numpy as np
fail = False
a0 = rel.FourVector(0,[0,0,0]) #This could be done with a for loop and ... | unlicense | Python | |
d31e833a89c2564fa6d1a9134f658618681fa6b8 | Improve function instance check. | ohsu-qin/qipipe | qipipe/interfaces/xnat_upload.py | qipipe/interfaces/xnat_upload.py | import os
from nipype.interfaces.base import (traits,
BaseInterfaceInputSpec, TraitedSpec, BaseInterface, File)
from ..helpers.xnat_helper import XNAT
def _xnat():
"""The XNAT connection, created on demand."""
if not hasattr(_xnat, 'connection'):
_xnat.connection = XNAT()
return _xnat.connectio... | import os
from nipype.interfaces.base import (traits,
BaseInterfaceInputSpec, TraitedSpec, BaseInterface, File)
from ..helpers.xnat_helper import XNAT
def _xnat():
"""The XNAT connection, created on demand."""
try:
return _xnat.connection
except AttributeError:
_xnat.__setattr__('connec... | bsd-2-clause | Python |
dd980cf00eaea786330d40bc388b4de486efa01e | add dadegan inforamtion extractor | sobhe/baaz,sobhe/baaz | dadegan.py | dadegan.py |
from nltk.parse import DependencyGraph
from InformationExtractor import InformationExtractor
def dadegan_text(conll_file='resources/train.conll'):
text = open(conll_file).read()
return text.replace('','').replace('\t','\t').replace('\t','\t').replace('\t ','\t').replace(' \t','\t').replace('\r', '').replace(... | mit | Python | |
86b13645660b1d32c24df55b54c9f0c3f8395cda | Test QtPositioning.QGeoPolygon | davvid/qtpy,davvid/qtpy,spyder-ide/qtpy | qtpy/tests/test_qtpositioning.py | qtpy/tests/test_qtpositioning.py | from __future__ import absolute_import
import pytest
from qtpy import PYQT5, PYSIDE2
@pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Only available in Qt5 bindings")
def test_qtpositioning():
"""Test the qtpy.QtPositioning namespace"""
from qtpy import QtPositioning
assert QtPositioning.QGeoAddress is... | from __future__ import absolute_import
import pytest
from qtpy import PYQT5, PYSIDE2
@pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Only available in Qt5 bindings")
def test_qtpositioning():
"""Test the qtpy.QtPositioning namespace"""
from qtpy import QtPositioning
assert QtPositioning.QGeoAddress is... | mit | Python |
56fdcb851bcfcac59d63831f229bcc289e892940 | Make Histogram for Blend | meyhelm/traitify_consolidator | blend_hist.py | blend_hist.py | #plot histogram for blend
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
from collections import Counter
print 'uploading data'
my_data = pd.read_csv('/Users/meyhel01/Documents/traitifypls.csv', sep=',', engine='c')
personalities = my_data['Blend']
letter_counts = Counter(personalities)
df =... | isc | Python | |
4ffa049553050ab22c5c90f544bb03fcc4259bfe | Add unit test for SMAPE | tgsmith61591/pyramid,alkaline-ml/pmdarima,alkaline-ml/pmdarima,alkaline-ml/pmdarima,tgsmith61591/pyramid,tgsmith61591/pyramid | pmdarima/tests/test_metrics.py | pmdarima/tests/test_metrics.py | # -*- coding: utf-8 -*-
from pmdarima.metrics import smape
import numpy as np
import pytest
@pytest.mark.parametrize(
'actual,forecasted,expected', [
pytest.param([0.07533, 0.07533, 0.07533, 0.07533,
0.07533, 0.07533, 0.0672, 0.0672],
[0.102, 0.107, 0.047, 0.1,
... | mit | Python | |
5c1a049c473fbf24d057dfb08cc3ff41ee1645ff | Add utility for reading analyze headers. | yarikoptic/NiPy-OLD,yarikoptic/NiPy-OLD | neuroimaging/data_io/formats/header_utils.py | neuroimaging/data_io/formats/header_utils.py | """Utilities convert SPM Analyze headers to Nifti1 headers. This is a
bit of a hack, written specifically to convert a set of Nipy's test
images. This could potentially be re-written to provide more general
functionality in the future.
Public function is get_header
"""
from neuroimaging.utils.odict import odict
fr... | bsd-3-clause | Python | |
6769b165b9e3c3345a8b7aa139131aeaafd62375 | Add file mistakenly left out of r12986. Refs #13334. | svn2github/django,svn2github/django,svn2github/django | tests/regressiontests/templates/templatetags/broken_tag.py | tests/regressiontests/templates/templatetags/broken_tag.py | from django import Xtemplate
| bsd-3-clause | Python | |
39f4afae0484ec6b4e021a59a00f711a9465e102 | add lambda function | chauduc/project,chauduc/project | lambda/updateRanking.py | lambda/updateRanking.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
import boto3
import json
import logging
import operator
from operator import itemgetter
from boto3.dynamodb.conditions import Key, Attr
from botocore.exceptions import ClientError
def scanAccounts():
dynamodb = boto3.resource("dyna... | mit | Python | |
b1a8e63be5d39a0865be53fe0fa53a524d9877af | migrate date in model finance | junqueira/balance | finance/migrations/0002_auto_20140928_1455.py | finance/migrations/0002_auto_20140928_1455.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('finance', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='extract',
name='date_... | mit | Python | |
e7126f87134a274969bf13150a2221ceff71e0db | Create scene class | josuemontano/blender_wrapper | scene.py | scene.py | import bpy
class Scene:
"""Scene object"""
def __init__(self, filepath, render_engine='CYCLES'):
self.filepath = filepath
self.render_engine = 'CYCLES'
def setup(self):
self._cleanup()
bpy.context.scene.render.filepath = self.filepath
bpy.context.scene.render.engi... | mit | Python | |
d74b49aa43a0f14650843607652f6fbf21bb3524 | Create test_fullmonty.py | fnielsen/dasem,fnielsen/dasem | tests/test_fullmonty.py | tests/test_fullmonty.py |
import pytest
from dasem.fullmonty import Word2Vec
@pytest.fixture
def w2v():
return Word2Vec()
def test_w2v(w2v):
word_and_similarities = w2v.most_similar('dreng')
assert len(word_and_similarities) == 10
| apache-2.0 | Python | |
83584afa35fcde93de98976b12909f7c19f69529 | Package for the resultsFile Python module (#15088) | LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack | var/spack/repos/builtin/packages/py-resultsfile/package.py | var/spack/repos/builtin/packages/py-resultsfile/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 PyResultsfile(PythonPackage):
"""Python module to read output files of quantum chemistry p... | lgpl-2.1 | Python | |
131d1860cf5b9cf43b82cd67b10de65ec18aed67 | Add missing retrying dependency | scrapinghub/python-hubstorage,torymur/python-hubstorage,kalessin/python-hubstorage | setup.py | setup.py | from os.path import join, dirname
from setuptools import setup, find_packages
# We can't import hubstorage.__version__ because it imports "requests" and it
# can not be available yet
__version__ = open(join(dirname(__file__), 'hubstorage/VERSION')).read().strip()
setup(name='hubstorage',
version=__version__,
... | from os.path import join, dirname
from setuptools import setup, find_packages
# We can't import hubstorage.__version__ because it imports "requests" and it
# can not be available yet
__version__ = open(join(dirname(__file__), 'hubstorage/VERSION')).read().strip()
setup(name='hubstorage',
version=__version__,
... | bsd-3-clause | Python |
8d1f452a5382ebefa773c8f6de5acd9912c4a38d | Create ReverseString.py | Chasego/codirit,cc13ny/Allin,Chasego/codirit,cc13ny/algo,cc13ny/algo,Chasego/cod,cc13ny/algo,Chasego/codi,cc13ny/Allin,Chasego/codirit,Chasego/codi,Chasego/cod,cc13ny/algo,Chasego/codi,Chasego/cod,cc13ny/algo,cc13ny/Allin,cc13ny/Allin,Chasego/codi,Chasego/codirit,Chasego/codirit,Chasego/cod,cc13ny/Allin,Chasego/codi,Ch... | leetcode/344-Reverse-String/ReverseString.py | leetcode/344-Reverse-String/ReverseString.py | class Solution(object):
def reverseString(self, s):
"""
:type s: str
:rtype: str
"""
return s[::-1]
| mit | Python | |
d41ee524c36ecc42c1e331d37ba33fc90f73356b | make borderless test exitable | google-code-export/pyglet,gdkar/pyglet,xshotD/pyglet,kmonsoor/pyglet,Austin503/pyglet,mpasternak/michaldtz-fixes-518-522,gdkar/pyglet,shaileshgoogler/pyglet,shaileshgoogler/pyglet,gdkar/pyglet,Austin503/pyglet,cledio66/pyglet,mpasternak/michaldtz-fix-552,odyaka341/pyglet,Austin503/pyglet,arifgursel/pyglet,shaileshgoogl... | tests/window/WINDOW_STYLE_BORDERLESS.py | tests/window/WINDOW_STYLE_BORDERLESS.py | #!/usr/bin/env python
'''Test that window style can be borderless.
Expected behaviour:
One borderless window will be opened.
Mouse click in the window to close it and end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $'
... | #!/usr/bin/env python
'''Test that window style can be borderless.
Expected behaviour:
One borderless window will be opened.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $'
import u... | bsd-3-clause | Python |
b039b6c842d895242276b5e52d70f6be607aff98 | Add Source Files | Hawt-Lava/Charizard | src/__init__.py | src/__init__.py | """ Source Files """
| mit | Python | |
3120daf37bd669ff0a7c661cf42b4b9170ba88ae | Add Master File | rimpybharot/CMPE273 | assignment2/master.py | assignment2/master.py | '''
################################## server.py #############################
# Assignmnet2 gRPC RocksDB Server
################################## server.py #############################
'''
import time
import grpc
import replicator_pb2
import replicator_pb2_grpc
import uuid
import rocksdb
import encodings
from Replic... | mit | Python | |
00c84f6c982a657686df6c06b175caa53d115077 | Add notebook test that just runs cells (#159) | quantumlib/OpenFermion-Cirq,quantumlib/OpenFermion-Cirq | examples/examples_test.py | examples/examples_test.py | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 | Python | |
04cddbd442a2401c36ac0c8a8199656154ee220b | add shellcode extractor | Qwaz/hack-tools,Qwaz/hack-tools | shellcode.py | shellcode.py | import argparse
import re
from distutils.util import strtobool
from subprocess import Popen, PIPE
def yes_no_prompt(question):
print('%s [y/n]' % question)
while True:
try:
return strtobool(raw_input().lower())
except ValueError:
print('Please respond with \'y\' or \'n\'.')
parser = argparse.ArgumentParse... | mit | Python | |
64f7e313d541b4635bf049403f1ff9375f51ed7d | Remove make_scraper magic from footloosecomic.py. | peterjanes/dosage,webcomics/dosage,peterjanes/dosage,blade2005/dosage,webcomics/dosage,blade2005/dosage | dosagelib/plugins/footloosecomic.py | dosagelib/plugins/footloosecomic.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from ..scraper import _ParserScraper
class Footloose(_ParserScraper):
url = 'http://footloosecomic.com/footloose.php'
imageSearch='//body/p[1]//img'
prevSearch='//body/a[2]'
class Cherry(Footloose):
url = 'http://footloosecomic.com/cherry... | # -*- coding: utf-8 -*-
from ..scraper import make_scraper, _ParserScraper
def add(name, url):
attrs = dict(
name=name,
url='http://footloosecomic.com/' + url,
imageSearch='//body/p[1]//img',
prevSearch='//body/a[2]'
)
globals()[name] = make_scraper(name, _ParserScraper, **... | mit | Python |
830a052cc557babd5168392677f237128e0d5d96 | Add MathModeling Lab1 | pugachAG/univ,pugachAG/univ,pugachAG/univ | MathModeling/Lab1/main.py | MathModeling/Lab1/main.py | import numpy
x = [2,4,6,8]
y = numpy.matrix([0.35, 0.573, 0.725, 0.947]).transpose()
n = 2
m = len(x)
A = numpy.matrix([[x[i] ** j for j in range(n)] for i in range(m)])
At = A.transpose()
I = numpy.linalg.inv(At * A)
a = (I * At) * y
#calc mean square deviation
f = lambda arg: sum([(arg ** i) * a[i][0] for i in range... | mit | Python | |
88470edf159ef662886a4af9dc782fe173e196bf | Add a really simple burn-in test helper | fragmede/fadecandy,lincomatic/fadecandy,pixelmatix/fadecandy,PimentNoir/fadecandy,fragmede/fadecandy,poe/fadecandy,scanlime/fadecandy,poe/fadecandy,lincomatic/fadecandy,hakan42/fadecandy,nomis52/fadecandy,PimentNoir/fadecandy,lincomatic/fadecandy,adam-back/fadecandy,adam-back/fadecandy,adam-back/fadecandy,nomis52/fadec... | examples/python/burnin.py | examples/python/burnin.py | #!/usr/bin/env python
# Burn-in test: Keep LEDs at full brightness most of the time, but dim periodically
# so it's clear when there's a problem.
import opc, time, math
numLEDs = 512
client = opc.Client('localhost:7890')
t = 0
while True:
t += 0.4
brightness = int(min(1, 1.25 + math.sin(t)) * 255)
fram... | mit | Python | |
319a8c1b7fec28a63ece42c8d5e781b21dec852f | Add photoz script | gbrammer/grizli | grizli/pipeline/photoz.py | grizli/pipeline/photoz.py | def eazy_photoz(root, force=False):
import os
import eazy
import numpy as np
from grizli import utils
if (os.path.exists('{0}.eazypy.self.npy'.format(root))) & (not force):
self = np.load('{0}.eazypy.self.npy'.format(root))[0]
zout = utils.read_catalog('{0}.eazypy.zout.fits... | mit | Python | |
09e75b216027e72fedc530b0206fbfc6a19ed988 | Add nonlinear BC demo | tarcisiofischer/heat_diffusion_experiment | experiments_and_demos/nonlinear_boundary_condition.py | experiments_and_demos/nonlinear_boundary_condition.py | from solver.output_handlers.animation_plotter import AnimationPlotterResultsHandler
import numpy as np
from solver.nonlinear_solver_wrappers import scipy_wrapper,\
petsc4py_wrapper
from solver.time_stepper import transient_solve
from solver.properties import GeometricProperties, PhysicalProperties,\
ConstantMap... | mit | Python | |
619223703fcc9efbeb98e5ef013a4f8575033702 | Add migration | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | fellowms/migrations/0051_event_required_blog_posts.py | fellowms/migrations/0051_event_required_blog_posts.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-08-04 12:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fellowms', '0050_auto_20160720_1533'),
]
operations = [
migrations.AddField(... | bsd-3-clause | Python | |
fe261bca8bf3e5391b4432a24a80e922f0878f4a | update classifiers | dongguangming/jsonpickle,mandx/jsonpickle,dongguangming/jsonpickle,mandx/jsonpickle,mandx/jsonpickle,dongguangming/jsonpickle,dongguangming/jsonpickle,mandx/jsonpickle | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008 John Paulett (john -at- paulett.org)
# Copyright (C) 2009-2013 David Aguilar (davvid -at- gmail.com)
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008 John Paulett (john -at- paulett.org)
# Copyright (C) 2009-2013 David Aguilar (davvid -at- gmail.com)
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
... | bsd-3-clause | Python |
a33f3d3f706279082e92633921e124a9d8d569b3 | Add missed commands file. | GrAndSE/lighty | benchmark/commands.py | benchmark/commands.py | def benchmark():
'''Run benchmark
'''
import os
import sys
sys.path.append(os.path.realpath(os.path.dirname(__file__)))
import simple
import iftag
import fortag
| bsd-3-clause | Python | |
955bcce696a9b67ae4743ef9ec65eb4805afd11b | Create __init__.py | Ronald-Tuco/Tuco | omar/__init__.py | omar/__init__.py | mit | Python | ||
3152f3e39932587da122e30ca63141f345f93cc9 | Create finalproject.py | samuelpych/Final-Project | finalproject.py | finalproject.py | mit | Python | ||
17a12bf8469f968e236de31a9da367e6e7790bcb | Create beta_simple_fun_sum_groups.py | Orange9000/Codewars,Orange9000/Codewars | Solutions/beta/beta_simple_fun_sum_groups.py | Solutions/beta/beta_simple_fun_sum_groups.py | from itertools import groupby
def sum_groups(arr):
newarr = [sum(j) for i,j in groupby(arr, key = lambda x: x % 2 == 0)]
return len(newarr) if newarr == arr else sum_groups(newarr)
| mit | Python | |
20f047aa3b2e048cf1bad1ba369e807b1ca1d354 | add unit test for stats view | bankonme/www.freedomsponsors.org,bankonme/www.freedomsponsors.org,freedomsponsors/www.freedomsponsors.org,stonestone/stonefreedomsponsors,freedomsponsors/www.freedomsponsors.org,bankonme/www.freedomsponsors.org,stonestone/stonefreedomsponsors,stonestone/stonefreedomsponsors,bankonme/www.freedomsponsors.org,freedomspons... | djangoproject/core/tests/test_stats_views.py | djangoproject/core/tests/test_stats_views.py | from django.utils import unittest
from core.tests.helpers import test_data, email_asserts
from django.test.client import Client
__author__ = 'kang'
class TestStatsViews(unittest.TestCase):
def setUp(self):
self.client = Client()
def test_stats_view(self):
response = self.client.get('/core/sta... | agpl-3.0 | Python | |
147b7c38135fe8d40600dfe113b29519e1032cb8 | Print triangular patterns | diptin/dipti-coding-samples,diptin/dipti-coding-samples | python2.7-src/print_pattern.py | python2.7-src/print_pattern.py | #!/usr/bin/python
def pascal_triangle() :
spaces = 20
row = []
row.append(1)
print (' '*spaces), row
spaces-=2
for i in range (1,5):
prev_row = row
row = []
row.append(1)
c = 1
for j in range (1,len(prev_row)) :
row.append(prev_row[c-1] + prev_row[c])
c+=1
row.append(1)
print (' '*spaces), ... | mit | Python | |
caa12d6e4e6ed0ca73dd6ec8ed7ba006b5762c2c | Add synthtool scripts (#3765) | googleapis/google-cloud-java,googleapis/google-cloud-java,googleapis/google-cloud-java | java-redis/google-cloud-redis/synth.py | java-redis/google-cloud-redis/synth.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | Python | |
585f32952564c16ade3701560645950fee5a04fd | Create actions.py | evuez/mutations | actions.py | actions.py | mit | Python | ||
c06cffd3de56e5da4cf5d19bcb7f6e1982fc7621 | Add script to generate a historic version of wna affect | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | generate_historic_wnaffect.py | generate_historic_wnaffect.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from time import sleep
import json
import codecs
from emotools.lexicon import get_spelling_variants
import pandas as pd
if __name__ == '__main__':
# read file and convert byte strings to unicode
with codecs.open('SWN-NL-voor-Janneke.txt', 'rb', 'latin1') as f:
... | apache-2.0 | Python | |
75073c57d247a1424250ae98b870347af2725d1f | Add unit tests to function parsing CTestTestfile.cmake | ARMmbed/greentea | test/mbed_gt_cmake_handlers.py | test/mbed_gt_cmake_handlers.py | #!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
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 ... | apache-2.0 | Python | |
8ff3c94bcc1c8bfced10556613cfe611a542efdd | add setup.py | alfateam123/pyaria2 | setup.py | setup.py | from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
setup(
name='PyAria2',
# Versions should comply with PEP440. For a discussion on single-sour... | mit | Python | |
f1be11f59679e5fee1c7773310d82bd674ec0db5 | add related_name to a couple of fields | numbas/editor,numbas/editor,numbas/editor | editor/migrations/0037_auto_20190320_1436.py | editor/migrations/0037_auto_20190320_1436.py | # Generated by Django 2.0.13 on 2019-03-20 14:36
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('editor', '0036_extension_runs_headless'),
]
operations = [
migrations.Alt... | apache-2.0 | Python | |
c0051a1cd5a4583b7482ca387df6dfeeec7a22e7 | Implement PixelCNN MNIST example | israelg99/eva | examples/mnist.py | examples/mnist.py | #%% Setup
from collections import namedtuple
import numpy as np
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
from keras.optimizers import Nadam
from keras.layers.advanced_activatio... | apache-2.0 | Python | |
ccbb899a0d72577ef4ca74aeca7140ea4ad7849e | Create gmailGre.py | HarshSharma12/fun-scripts,HarshSharma12/fun-scripts | gmailGre.py | gmailGre.py | #!/usr/local/bin/python2.7
"""
Created on Fri Dec 18 17:00:23 2015
@author: HarshSharma12
Sends a daily email containing thirty
words from the Barron's GRE word list.
"""
import smtplib
from email.mime.multipart import MIMEMultipart
from email.Utils import COMMASPACE
from email.MIMEText import MIMEText
import time
... | mit | Python | |
96e5ee387ca421d9c87ebe496843f9f30070c0d6 | Add user admin | sergei-maertens/discord-bot,sergei-maertens/discord-bot,sergei-maertens/discord-bot | bot/accounts/admin.py | bot/accounts/admin.py | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User
@admin.register(User)
class UserAdmin(UserAdmin):
pass
| mit | Python | |
24eba71bb16b79152c980179819d76ac25df53e4 | Add a main method so that it is possible to call this from the command-line. | stratis-storage/stratis-cli,stratis-storage/stratis-cli | src/main.py | src/main.py | from cli import gen_parser
def main():
parser = gen_parser()
args = parser.parse_args()
print(args)
if __name__ == "__main__":
main()
| apache-2.0 | Python | |
1e5e3aff3c73a2c3d53442d26635516b2075b7f0 | add test for NC voter reg. model | suriyan/ethnicolr,suriyan/ethnicolr,suriyan/ethnicolr | ethnicolr/tests/test_050_pred_nc.py | ethnicolr/tests/test_050_pred_nc.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tests for NC voter registration models
"""
import os
import shutil
import unittest
import pandas as pd
from ethnicolr.pred_nc_reg_name import pred_nc_reg_name
from . import capture
class TestPredNC(unittest.TestCase):
def setUp(self):
names = [{'last'... | mit | Python | |
8800386ca6bc48b624aeca79e419809dbca528e7 | Create sendEmail.py | llamafarmer/Pi_Weather_Station,llamafarmer/Pi_Weather_Station,llamafarmer/Pi_Weather_Station | sendEmail.py | sendEmail.py | import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders
# # comment implies that the field needs to be filled in
def sendEmail(subject, message_body):
fromaddr = "smtp-mailjet@joshsisto.com" # from email add... | mit | Python | |
301c47b053eb74eecc6b98c33caef9b058714c6d | add distutils setup.py | vsergeev/u-msgpack-python,tempbottle/u-msgpack-python | setup.py | setup.py | from distutils.core import setup
setup(name='u-msgpack-python',
version='1.4',
py_modules=['umsgpack'],
)
| mit | Python | |
bfe21986f461642fffbd72d44be543ac44cd93ea | Bump version number for deletion of track/analyze methods. | MathieuDuponchelle/pyechonest3,krishofmans/pyechonest,salah-ghanim/pyechonest,ruohoruotsi/pyechonest,shyamalschandra/pyechonest,taytorious/pyechonest,beni55/pyechonest,ruohoruotsi/pyechonest,mmiquiabas/pyechonest,alex/pyechonest,Victorgichohi/pyechonest,diegobill/pyechonest,Victorgichohi/pyechonest,alex/pyechonest,wisp... | setup.py | setup.py | #!/usr/bin/env python
# encoding: utf-8
__version__ = "6.0.0"
# $Source$
from sys import version
import os
from setuptools import setup
if version < '2.6':
requires=['urllib', 'urllib2', 'simplejson']
elif version >= '2.6':
requires=['urllib', 'urllib2', 'json']
else:
#unknown version?
requires=['url... | #!/usr/bin/env python
# encoding: utf-8
__version__ = "5.0.0"
# $Source$
from sys import version
import os
from setuptools import setup
if version < '2.6':
requires=['urllib', 'urllib2', 'simplejson']
elif version >= '2.6':
requires=['urllib', 'urllib2', 'json']
else:
#unknown version?
requires=['url... | bsd-3-clause | Python |
b03a88ca402541b4596237f356f0597daf86a70e | create basic setup file | killerbat00/opalescence | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open("README.md") as readme_file:
readme = readme_file.read()
requirements = [
"requests"
]
setup(
name="opalescence",
version="0.1.1",
description="Torrent client offering basic functionality.",
long_description... | mit | Python | |
632bd000004619d4ca086ca6468c04d5b3d127f1 | Add add_sitelink example (#59) | googleads/google-ads-python | examples/advanced_operations/add_sitelink.py | examples/advanced_operations/add_sitelink.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python | |
0f794a1dc23c733fe78ffa41a63b0fcf3e965f9a | add setup.py script | jrnold/pystache,jrnold/pystache,android-ia/platform_external_pystache,nitish116/pystache,charbeljc/pystache,charbeljc/pystache,harsh00008/pystache,rismalrv/pystache,rismalrv/pystache,rismalrv/pystache,beni55/pystache,arlenesr28/pystache,clach04/pystache_old_v0.4.1,defunkt/pystache,harsh00008/pystache,android-ia/platfor... | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name='Pystache',
version='1.0',
description='Mustache for Python',
author='Chris Wanstrath',
author_email='chris@ozmm.org',
url='http://github.com/defunkt/pystache',
packages=['pystache'],
license='MIT'
)
| mit | Python | |
af4ab489df16f120bef53ddb5ca02a6e7e042676 | Fix setup.py to install the correct package | shad7/oslo.config,JioCloud/oslo.config,citrix-openstack-build/oslo.config,tianshan/oslo.config,magic0704/oslo.config,varunarya10/oslo.config,citrix-openstack/build-oslo.config,metacloud/oslo.config | setup.py | setup.py | #!/usr/bin/python
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | #!/usr/bin/python
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 | Python |
148aaa97b4783cd9d3f7b8e813643fc74c2532bd | Create pdb_id_writer.py | jmp1985/metrix-database | pdb_id_writer.py | pdb_id_writer.py | # Writes all the pdb ids to a txt file so they can be recursively parsed into the pdb_parser
from os import listdir
from os.path import isfile, join
pdb_list = listdir('PDB_coordinates')
pdb_id_list = []
for pdb in pdb_list:
pdb_id_list.append(pdb[0:4])
for pdb in pdb_id_list:
print pdb
| bsd-2-clause | Python | |
2697859df141b2dc6c34df5c0ac3ec87741d6b84 | Add Bootstrap Google Tour example | mdmintz/SeleniumBase,mdmintz/seleniumspot,mdmintz/SeleniumBase,mdmintz/seleniumspot,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase | examples/tour_examples/bootstrap_google_tour.py | examples/tour_examples/bootstrap_google_tour.py | from seleniumbase import BaseCase
class MyTourClass(BaseCase):
def test_google_tour(self):
self.open('https://google.com')
self.wait_for_element('input[title="Search"]')
self.create_bootstrap_tour() # OR self.create_tour(theme="bootstrap")
self.add_tour_step(
"Click ... | mit | Python | |
69dd9057c1009d9c047f45908080a55ac3223e4c | Fix forgotten import in example | NunoEdgarGub1/scikit-learn,f3r/scikit-learn,mehdidc/scikit-learn,icdishb/scikit-learn,xiaoxiamii/scikit-learn,MatthieuBizien/scikit-learn,Vimos/scikit-learn,walterreade/scikit-learn,lesteve/scikit-learn,hugobowne/scikit-learn,cauchycui/scikit-learn,joshloyal/scikit-learn,shangwuhencc/scikit-learn,mattilyra/scikit-learn... | examples/svm/plot_svm_regression.py | examples/svm/plot_svm_regression.py | """Non linear regression with Support Vector Regression (SVR)
using RBF kernel
"""
###############################################################################
# Generate sample data
import numpy as np
X = np.sort(5*np.random.rand(40, 1), axis=0)
y = np.sin(X).ravel()
##############################################... | """Non linear regression with Support Vector Regression (SVR)
using RBF kernel
"""
###############################################################################
# Generate sample data
import numpy as np
X = np.sort(5*np.random.rand(40, 1), axis=0)
y = np.sin(X).ravel()
##############################################... | bsd-3-clause | Python |
4427623258ffa7274fd8f6fdbd2211967b561124 | add bte2graphml module | biothings/biothings_explorer,biothings/biothings_explorer | biothings_explorer/bte2graphml.py | biothings_explorer/bte2graphml.py | import copy
import networkx as nx
class GraphmlConverter():
def load_bte_output(self, G):
"""Load bte output in the format of networkx graph into class
params
======
G: the networkx representation of bte output
"""
self.G = copy.deepcopy(G)
def restruc... | apache-2.0 | Python | |
9f87e0f59b4737e44ef91f80ee1fd92ab213d178 | add java emitter | ingydotnet/cdent-py,ingydotnet/cdent-py,ingydotnet/cdent-py,ingydotnet/cdent-py,ingydotnet/cdent-py,ingydotnet/cdent-py,ingydotnet/cdent-py,ingydotnet/cdent-py | cdent/emitter/java.py | cdent/emitter/java.py | """\
Java code emitter for C'Dent
"""
from __future__ import absolute_import
from cdent.emitter import Emitter as Base
class Emitter(Base):
LANGUAGE_ID = 'java'
LINE_COMMENT_PREFIX = '// '
BLOCK_COMMENT_BEGIN = '/**\n'
BLOCK_COMMENT_PREFIX = ' * '
BLOCK_COMMENT_END = ' */\n'
def emit_class(s... | bsd-2-clause | Python | |
572ebcb8a4f2dfec57c491ed211e7c5013b84cdb | Add --debug-db-sessions | ibrahimkarahan/Flexget,patsissons/Flexget,v17al/Flexget,jacobmetrick/Flexget,jacobmetrick/Flexget,camon/Flexget,Flexget/Flexget,tobinjt/Flexget,vfrc2/Flexget,qvazzler/Flexget,Flexget/Flexget,ZefQ/Flexget,LynxyssCZ/Flexget,Danfocus/Flexget,malkavi/Flexget,jacobmetrick/Flexget,spencerjanssen/Flexget,OmgOhnoes/Flexget,xfo... | flexget/plugins/operate/debug_db_sessions.py | flexget/plugins/operate/debug_db_sessions.py | from __future__ import unicode_literals, division, absolute_import
import inspect
import logging
from threading import Lock
import time
import sqlalchemy
from flexget import options
from flexget.event import event
from flexget.manager import Session
log = logging.getLogger('debug_db_sess')
open_transactions_lock = ... | mit | Python | |
5b7bb30aeecc0bb295abcec64c220d644868fdcc | Update PR [skip ci] | Azure/azure-sdk-for-python,Azure/azure-sdk-for-python,Azure/azure-sdk-for-python,Azure/azure-sdk-for-python | azure-sdk-tools/packaging_tools/update_pr.py | azure-sdk-tools/packaging_tools/update_pr.py | import argparse
import logging
import os
from pathlib import Path
import tempfile
from azure_devtools.ci_tools.git_tools import (
do_commit,
)
from azure_devtools.ci_tools.github_tools import (
manage_git_folder,
configure_user
)
from git import Repo
from github import Github
from . import build_packagin... | mit | Python | |
45bb24d458593564b279afb4e056d72c44f35c55 | Add setuptools integration | tp7/Prass,Zeght/Prass | setup.py | setup.py | from setuptools import setup
setup(
name='Prass',
version='0.1',
py_modules=['prass', 'common', 'subs', 'tools'],
install_requires=['Click'],
entry_points='''
[console_scripts]
prass=prass:cli
''',
)
| mit | Python | |
a32cce0f6af3d429c17a4d38271d717e0b464881 | Add setup.py | adamtheturtle/boggle-solver | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
import os.path
description = file(os.path.join(os.path.dirname(__file__), 'README.md'), 'rb').read()
setup(
name="bogglesolver",
version="1.0.0",
description="Solve a game of Boggle.",
long_description=description,
author="Adam Da... | mit | Python | |
16688796c3e57fa7dfc5c21eb2f60553b28837d6 | support for reference this in pip | kimus/image-poi | setup.py | setup.py | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name = "image-poi",
version = "1.0",... | mit | Python | |
83a50917a67c362e489c826139bb98cca5356adb | Test for CURLOPT_POSTFIELDS lifecycle. | pycurl/pycurl,pycurl/pycurl,pycurl/pycurl | tests/setopt_lifecycle_test.py | tests/setopt_lifecycle_test.py | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
import gc
import os.path
import pycurl
import unittest
try:
import json
except ImportError:
import simplejson as json
from . import appmanager
from . import util
setup_module, teardown_module = appmanager.setup(('app', 8380))
class TestString(... | lgpl-2.1 | Python | |
bf8ee4fc03b093f77ee57c6e63cb42c18afc1df7 | Create downloader.py | labodiattila/vdrlogo | downloader.py | downloader.py | #!/usr/bin/python
import urllib2,json,time,vdrlogo,os
def lyngsat_download(country_list):
#Download logo HTML
code_list = country_list.split(",")
for num in range(0,len(code_list)):
vdrlogo.run_cmd("wget -q " + vdrlogo.lyngsat_logo_URL + code_list[num] + ".html -O out.html")
vdrlogo.run_cmd('cat out.html | gre... | mit | Python | |
3547488dce93b3f09e77bd7613b9cc48ca8afa06 | Add emacs-keys.py which resolves emacs key combinations to descriptions and is used for demonstrating keyboard macros by adding new mappings | merlincorey/emacs-class,merlincorey/emacs-class | emacs-keys.py | emacs-keys.py | '''emacs-keys.py
Syntax: emacs-keys.py desc [desc [desc [...]]]
Return description of emacs key binding given a key description on the commandline.
Descriptions should be in emacs-chord syntax (e.g. C-x M-x).
This application exists to demonstrate keyboard macros by creating the mappings from notes.
'''
import sys... | bsd-2-clause | Python | |
9c49660fccd34ceebd9da6c55cb39fb1245eb2e8 | Add test for kpoints_explicit | Z2PackDev/bands_inspect,Z2PackDev/bands_inspect | tests/test_kpoints_explicit.py | tests/test_kpoints_explicit.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Dominik Gresch <greschd@gmx.ch>
import pytest
import numpy as np
from numpy.testing import assert_equal
from bandstructure_utils.kpoints import *
VERTICES = {'a': [0, 0], 'b': [0.5, 0.5], 'c': [0.5, 0]}
INSTANCES_EXPLICIT_KPOINTS = [
(KpointsExplicit([[... | apache-2.0 | Python | |
c708fa37475141bb7a687633b02760e16c45d5fc | fix description, add url | dmerejkowsky/qibuild,dmerejkowsky/qibuild,dmerejkowsky/qibuild,aldebaran/qibuild,aldebaran/qibuild,aldebaran/qibuild,aldebaran/qibuild,dmerejkowsky/qibuild,dmerejkowsky/qibuild | setup.py | setup.py | ## Copyright (c) 2012, 2013 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.
import os
from setuptools import setup, find_packages
def get_qibuild_cmake_files():
res = list()
cmake_dest = 'share/cmake'
for (roo... | ## Copyright (c) 2012, 2013 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.
import os
from setuptools import setup, find_packages
def get_qibuild_cmake_files():
res = list()
cmake_dest = 'share/cmake'
for (roo... | bsd-3-clause | Python |
f41e642d89d2a89258f3624f7b3268c8cc79fca1 | Add setup.py file | Perkville/django-append-url-to-sql,lamby/django-append-url-to-sql,playfire/django-append-url-to-sql | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-append-url-to-sql',
description="Appends the request URL to SQL statements in Django.",
version="0.1",
url='http://code.playfire.com/django-append-url-to-sql',
author='Playfire.com',
author_email='tech@playf... | bsd-3-clause | Python | |
b37800678cf2afda3154df6852f9bac85c338639 | Clarify command-line interface docstring. | mgoddard-pivotal/grip,mgoddard-pivotal/grip,joeyespo/grip,joeyespo/grip,jbarreras/grip,ssundarraj/grip,jbarreras/grip,ssundarraj/grip | grip/command.py | grip/command.py | import sys
from .server import serve
def main():
"""The entry point of the application."""
# TODO: more advanced argument processing
# Handle port
port = None
if len(sys.argv) > 1:
port_arg = sys.argv[1]
try:
port = int(port_arg[1:] if port_arg.startswith(':') else po... | import sys
from .server import serve
def main():
"""The entry point of the command-line interface."""
# TODO: more advanced argument processing
# Handle port
port = None
if len(sys.argv) > 1:
port_arg = sys.argv[1]
try:
port = int(port_arg[1:] if port_arg.startswith('... | mit | Python |
00693c7ab53773c73176a612f5f8c77b2fd1db1c | add file to compile cython | a-ro/preimage | setup.py | setup.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from distutils.core import setup
from distutils.extension import Extension
import numpy
from Cython.Distutils import build_ext
ext_modules = [
Extension("preimage.kernels._generic_string", ["preimage/kernels/_generic_string.pyx"],
include_dirs=[numpy.ge... | bsd-2-clause | Python | |
f5f3c204fd82d83c1f4fbdff0b505644c454cfc8 | Add setup script with cli entry point. | tldr-pages/tldr-python-client,Anmol-Singh-Jaggi/tldr-python-client | setup.py | setup.py | from setuptools import setup, Extension
import distutils.core
import sys
import os
setup(
name = 'tldr',
version = "0.1.0",
author = 'Felix Yan',
author_email = 'felixonmars@gmail.com',
url = 'https://github.com/felixonmars/tldr-python-client',
description = 'command lin... | mit | Python | |
b9956ca1be62dbfddee0fdcd5a0852993aca29fe | Add setup.py | aelse/cpthook,aelse/cpthook | setup.py | setup.py | from setuptools import setup
import os.path
__dir__ = os.path.dirname(os.path.abspath(__file__))
setup(
name='cpthook',
license='BSD',
py_modules=['cpthook'],
scripts=['cpthook'],
version='0.0.1',
install_requires=[],
description='Centrally manage hooks for git repositories',
long_desc... | bsd-2-clause | Python | |
0bdd9ac49f5b6e98049e34690d1b985f56fd3a47 | Integrate LLVM at llvm/llvm-project@72b18a86e11e | paolodedios/tensorflow,annarev/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,Intel-Corporation/tensorflow,annarev/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,tensorflow/ten... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "72b18a86e11ebc970be96a8c2b11aa3a31c14c5d"
LLVM_SHA256 = "f201b3b057093a622f52c86e6dbbd9ab846538e218e4e2396c63c10b8562e401"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "cb81135f94e58ce0a0e91d764841acee90eeb59f"
LLVM_SHA256 = "0b44d25456b4f8bc8740d5fc74861c280383acc0ec979e7a387ae30b1a3f362a"
tf_http_archive(
... | apache-2.0 | Python |
3b6466f0b87a7bf93c98d3f44ae80a53957fb65f | Integrate LLVM at llvm/llvm-project@b9db70369b77 | gautam1858/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow,yongtang/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_tf_optim... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "b9db70369b7799887b817e13109801795e4d70fc"
LLVM_SHA256 = "a670a9938a1e000fed04d65e26854e7c9dbdfacd69c0354edcc84499f1005f67"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "2dfb66833fd23a0bf03c3e610e9b985a8141a4cf"
LLVM_SHA256 = "6c0c6bc20fb6db6c5de2e46914a711e48d35ffd4db99590905f29174c4ded66b"
tf_http_archive(
... | apache-2.0 | Python |
bf1817261c714f38e9c6f792b79c30ce9a97b01e | Integrate LLVM at llvm/llvm-project@6cffc35746b4 | tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,gautam1858/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_saved_model,gautam1858/tensorflow,tensorfl... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "6cffc35746b4a3a7a237bfde8bf84597fdb40328"
LLVM_SHA256 = "aa033cc542315d88a8b26351bab49d2384322cba6b5d370b1b4e44238f2c5d9d"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "90babc86c3feda7f9395b36ccfe72ca61bbc39e2"
LLVM_SHA256 = "00afe295779bfb068021f366c6cddbd1ada2a018ae0bb6adf433f51911c2cfb7"
tf_http_archive(
... | apache-2.0 | Python |
a2a9572ac401969a1e97a34ff271eb371a1cc81b | Integrate LLVM at llvm/llvm-project@49ed5bf51958 | tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,yongtang/tensorflow,karlle... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "49ed5bf51958aaeb209804da794c85d06207c3ed"
LLVM_SHA256 = "6855a19cdebeec8fef41237eb6bb0cce8bdc5f636aab60c59296b0efa049b3c2"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "6eb0f8e28598658b4f5df27b35a5ea98bad68049"
LLVM_SHA256 = "0af7ac8ca2be4d22336aef7da18e54e648fd0bbea42167a1864e8604b84d258a"
tf_http_archive(
... | apache-2.0 | Python |
421c39000a744d238388442a64d9f6bb1f76fcff | Add libjpeg.gyp that wraps third_party/externals/libjpeg/libjpeg.gyp Review URL: https://codereview.appspot.com/5848046 | csulmone/skia,csulmone/skia,csulmone/skia,csulmone/skia | gyp/libjpeg.gyp | gyp/libjpeg.gyp | # Copyright 2012 The Android Open Source Project
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Depend on this wrapper to pick up libjpeg from third_party
{
'targets': [
{
'target_name': 'libjpeg',
'type': 'none',
'dependencies': [
... | bsd-3-clause | Python | |
10ff7449e0b84f47903926f6870c90b1c1aaeb06 | Test cases for action views controllers | Itxaka/st2,nzlosh/st2,Itxaka/st2,pixelrebel/st2,pinterb/st2,nzlosh/st2,grengojbo/st2,emedvedev/st2,StackStorm/st2,punalpatel/st2,punalpatel/st2,jtopjian/st2,pixelrebel/st2,armab/st2,pinterb/st2,jtopjian/st2,nzlosh/st2,peak6/st2,tonybaloney/st2,grengojbo/st2,Plexxi/st2,lakshmi-kannan/st2,alfasin/st2,tonybaloney/st2,denn... | st2api/tests/controllers/test_action_views.py | st2api/tests/controllers/test_action_views.py | import mock
from st2api.controllers.actions import ActionsController
from tests import FunctionalTest
# ACTION_1: Good action definition.
ACTION_1 = {
'name': 'st2.dummy.action1',
'description': 'test description',
'enabled': True,
'content_pack': 'wolfpack',
'entry_point': '/tmp/test/action1.sh',... | apache-2.0 | Python | |
029c3f46731cd3a4746043833e912447ababf1a7 | Add script for appending entries to .gitignore. | jchavanton/webrtc,lukeweber/webrtc-src-override,AOSPU/external_chromium_org_third_party_webrtc,lukeweber/webrtc-src-override,MIPS/external-chromium_org-third_party-webrtc,bpsinc-native/src_third_party_webrtc,krieger-od/webrtc,AOSPU/external_chromium_org_third_party_webrtc,AOSPU/external_chromium_org_third_party_webrtc,... | build/extra_gitignore.py | build/extra_gitignore.py | #!/usr/bin/env python
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | bsd-3-clause | Python | |
1bfd57c6968465b4e87d13813366ec1933f11cc5 | Add tests to verify the execution enabled status | marvinpinto/charlesbot-rundeck | tests/test_update_execution_enabled_status.py | tests/test_update_execution_enabled_status.py | import asynctest
from asynctest.mock import patch
from charlesbot_rundeck.rundeck_job import RundeckJob
class TestUpdateExecutionEnabledStatus(asynctest.TestCase):
def setUp(self):
patcher1 = patch('charlesbot_rundeck.rundeck_lock.RundeckLock.seed_job_list') # NOQA
self.addCleanup(patcher1.stop)... | mit | Python | |
45bb10691ba7021bfb834a8941ac8492ae8509af | Copy subtree plugin. Unfinished and untested. | cwi-dis/igor,cwi-dis/igor,cwi-dis/igor | igor/plugins/copy/copy.py | igor/plugins/copy/copy.py | """Copy values or subtrees, either locally or remotely.
Currently a quick hack using either direct database access or httplib2, synchronously.
Should use callUrl, so local/remote becomes similar, and some form
of callback mechanism so it can run asynchronously.
"""
import requests
import web
import httplib2
DATABASE_... | mit | Python | |
3b7f8d2716eadf3bb6c0fbc02988d56abf22fede | add a small index management client for mozdef ES vulnerability index | ameihm0912/vmintgr,ameihm0912/vmintgr | misc/mozdef/indexmgr.py | misc/mozdef/indexmgr.py | #!/usr/bin/python2
import sys
import pyes
import getopt
es = None
index = 'vulnerability'
MODE_UNSET = 0
MODE_LIST = 1
MODE_CREATE = 2
MODE_DELETE = 3
def usage():
sys.stdout.write('usage: indexmgr.py [-cdh] [-e eshost]\n')
sys.exit(0)
def domain():
global es
opmode = MODE_UNSET
eshost = No... | mpl-2.0 | Python | |
8c8162a89bd976a851bb7074b7279007508d601f | Add intercom class | pkronstrom/intercom | intercom.py | intercom.py | import configparser
import time
from client import MumbleClient
class InterCom:
def __init__(self):
config = configparser.ConfigParser()
config.read('intercom.ini')
self.mumble_client = MumbleClient()
self.exit = False
def run(self):
while not self.exit:
s... | mit | Python | |
ce7cd7a5ab488abac41007eedb6d4d1550e9b258 | add new package: libiscsi (#15579) | LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack | var/spack/repos/builtin/packages/libiscsi/package.py | var/spack/repos/builtin/packages/libiscsi/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 Libiscsi(AutotoolsPackage):
"""Libiscsi is a client-side library to implement the iSCSI pr... | lgpl-2.1 | Python | |
b7775175768037ed9a174f6f5186bd1f715d9fd3 | add motor.py | robinsonvoly/drone-rp0 | src/motor.py | src/motor.py | import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.OUT)
dc = 5
servo = GPIO.PWM(11,50)
servo.start(10)
print('***Connect Battery & Press ENTER to start')
res = raw_input()
servo.ChangeDutyCycle(dc) #servo.ChangeDutyCycle(5)
print('***Press ENTER to start')
res = raw_input()
print ('increase > a | d... | mit | Python | |
c08df663d2f7ec8275e67c784f6efd9f29d92fde | Create px_downloader.py | 8dspaces/500px_downloader | px_downloader.py | px_downloader.py | # coding: utf-8
from Tkinter import *
from ttk import *
class PXdownloader(object):
def __init__(self):
self.create_widget()
def create_widget(self):
# top-level window
self.win = Tk()
self.win.title("500PX Pic Downloader")
self.win.g... | mit | Python | |
0f39968ee0cfd4b38a599b6fc9dc6d8369392513 | Add benchmark script for python 3 | WojciechMula/pyahocorasick,WojciechMula/pyahocorasick,pombredanne/pyahocorasick,WojciechMula/pyahocorasick,pombredanne/pyahocorasick,pombredanne/pyahocorasick,pombredanne/pyahocorasick,WojciechMula/pyahocorasick,woakesd/pyahocorasick,woakesd/pyahocorasick | benchmarks/benchmark3.py | benchmarks/benchmark3.py | from time import clock
from random import choice, randint, seed
from sys import stdout
import ahocorasick
def write(str):
stdout.write(str)
stdout.flush()
def writeln(str):
stdout.write(str)
stdout.write('\n')
class ElapsedTime:
def __init__(self, msg):
self.msg = msg
def __enter... | bsd-3-clause | Python | |
d707fd1593b47d228d33bb283bb8634075df12a7 | Add example script to print out all updates | LonamiWebs/Telethon,LonamiWebs/Telethon,LonamiWebs/Telethon,LonamiWebs/Telethon,expectocode/Telethon,andr-04/Telethon | telethon_examples/print_updates.py | telethon_examples/print_updates.py | #!/usr/bin/env python3
# A simple script to print all updates received
from telethon import TelegramClient
from getpass import getpass
from os import environ
# environ is used to get API information from environment variables
# You could also use a config file, pass them as arguments,
# or even hardcode them (not rec... | mit | Python | |
7eba3a85af038fbde1232778b641a92c51a83374 | add put function | hustlijian/upyun-python-sdk | upyun.py | upyun.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import os
import hashlib
import requests
from urllib import quote
BASE_LIST = ['http://v%d.api.upyun.com' % i for i in range(4)]
BASE_AUTO, BASE_TELECOM, BASE_CNC, BASE_CTT = BASE_LIST
str = unicode
def get_datetime():
'''
>>> print get_datetime()
... | mit | Python | |
61974b67b996aef3635806ef6acf890085775b27 | add first version of check_smtp_send.py | gtrs/check_email_delivery.py | check_smtp_send.py | check_smtp_send.py | import sys
import argparse
import ConfigParser
import smtplib
from email.mime.text import MIMEText
from email import utils
import datetime
import time
import uuid
parser = argparse.ArgumentParser(description='foo')
parser.add_argument('-H', required=True)
parser.add_argument('--port', type=int, default=587)
parser.add... | mit | Python | |
1246e79ffda3fef427bff473977f9ab29fda5f4d | Create stacked_autoencoder.py | jdvala/ProjectTF | Auto_encoder_evaluation/stacked_autoencoder.py | Auto_encoder_evaluation/stacked_autoencoder.py | """ Auto Encoder Example.
Using an Stacked auto encoder on MNIST handwritten digits, and evaluating its performance with different scores
References:
Tflearn.org/examples
Tensorflow.org
Links:
[MNIST Dataset] http://yann.lecun.com/exdb/mnist/
Method and Examples Used:
[1] An simple example from Tflean,... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.