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 |
|---|---|---|---|---|---|---|---|---|
3592cd622e61ee689b096c99d46b6d936109e383 | Revert "We do not support character buffer protocol on QStrings." | M4rtinK/pyside-bb10,gbaty/pyside2,qtproject/pyside-pyside,M4rtinK/pyside-android,M4rtinK/pyside-bb10,PySide/PySide,qtproject/pyside-pyside,M4rtinK/pyside-android,IronManMark20/pyside2,pankajp/pyside,pankajp/pyside,IronManMark20/pyside2,enthought/pyside,M4rtinK/pyside-bb10,enthought/pyside,qtproject/pyside-pyside,enthou... | tests/qtcore/qstring_buffer_protocol_test.py | tests/qtcore/qstring_buffer_protocol_test.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''Tests QString implementation of Python buffer protocol'''
import unittest
from os.path import isdir
from PySide.QtCore import QString
class QStringBufferProtocolTest(unittest.TestCase):
'''Tests QString implementation of Python buffer protocol'''
def testQStringB... | lgpl-2.1 | Python | |
d7a2451d48ca3b6a01afb88d775f8d0614211b88 | Add Exhaust Search (Neighbor Constrain) Estimator | webmproject/libvpx,webmproject/libvpx,ShiftMediaProject/libvpx,ShiftMediaProject/libvpx,webmproject/libvpx,ShiftMediaProject/libvpx,webmproject/libvpx,webmproject/libvpx,webmproject/libvpx,ShiftMediaProject/libvpx,ShiftMediaProject/libvpx | tools/3D-Reconstruction/MotionEST/Exhaust.py | tools/3D-Reconstruction/MotionEST/Exhaust.py | #!/usr/bin/env python
# coding: utf-8
import numpy as np
import numpy.linalg as LA
from Util import MSE
from MotionEST import MotionEST
"""Exhaust Search:"""
class Exhaust(MotionEST):
"""
Constructor:
cur_f: current frame
ref_f: reference frame
blk_sz: block size
wnd_size: search... | bsd-3-clause | Python | |
64f13a006412112830e1d7cc2ff71ea32cb4c1b6 | Add a new organisation for letter branding | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0150_another_letter_org.py | migrations/versions/0150_another_letter_org.py | """empty message
Revision ID: 0150_another_letter_org
Revises: 0149_add_crown_to_services
Create Date: 2017-06-29 12:44:16.815039
"""
# revision identifiers, used by Alembic.
revision = '0150_another_letter_org'
down_revision = '0149_add_crown_to_services'
from alembic import op
NEW_ORGANISATIONS = [
('006', ... | mit | Python | |
bb7dc365b47fca004afc53634da33d2585b75925 | add solution-283-move-zeroes. | wings27/leetcode-solution | com/github/wings27/leetcode_solution/s-283-move-zeroes.py | com/github/wings27/leetcode_solution/s-283-move-zeroes.py | class Solution(object):
def moveZeroes(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
def swap(array, index_a, index_b):
temp = array[index_a]
array[index_a] = array[index_b]
a... | apache-2.0 | Python | |
217d93f9f99611b2d1211f85425074e9295be667 | Create Commands.py | paulydboy/Quad-Vision | Commands.py | Commands.py | from Command import Command
from time import sleep
class Follow(Command):
def __init__(self, camera, distance):
super(Follow, self).__init__(camera, distance)
self._binder = 'follow'
@property
def binder(self):
return self._binder
def execute(self):
while self.runn... | apache-2.0 | Python | |
d4d95d5083926b933129bfcc373c6a67a87d340a | Create ProjectSummary.py | GitCodeAllen/PublicLibrary,GitCodeAllen/PublicLibrary | ProjectSummary.py | ProjectSummary.py | # -*- coding: utf-8 -*-
import os
#需要统计行数的文件后缀
Suffix = {".cpp",".h",".hpp",".cxx"}
#目录路径
Path = "E:\\test"
def CountFileLines(FileName):
count=0
fp=open(FileName,"r")
last_chr='\n'
while 1:
buffer=fp.read(8*1024*1024)
if not buffer:
break
count+=buffer.count('\n')
last_chr=buffer[-1]
fp.close()
if ... | apache-2.0 | Python | |
9da913aaf960c3fdfbde1cc2bb37f229e097064e | add mroe deps | Cadair/pysac,SWAT-Sheffield/pysac | pysac/plot/divergingcolourmaps.py | pysac/plot/divergingcolourmaps.py | # -*- coding: utf-8 -*-
"""
:Created on: Tue Jun 26 10:57:21 2012
:author: Stuart Mumford
Create Diverging colormaps like (Moreland 2005)
"""
from __future__ import division
import numpy as np
from colormath.color_objects import RGBColor, LabColor
__all__ = ['get_mpl_colourmap','get_mayavi_colourmap']
""" Colour C... | bsd-2-clause | Python | |
cb87c6e2c58593d5ef5710c4d7db0c18831e354c | Add a helper tool which clears zookeeper test dirs | openstack/taskflow,pombredanne/taskflow-1,junneyang/taskflow,junneyang/taskflow,jimbobhickville/taskflow,openstack/taskflow,jimbobhickville/taskflow,pombredanne/taskflow-1 | tools/clear_zk.py | tools/clear_zk.py | #!/usr/bin/env python
import contextlib
import os
import re
import sys
top_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),
os.pardir))
sys.path.insert(0, top_dir)
from taskflow.utils import kazoo_utils
@contextlib.contextmanager
def finalize_client(client):
... | apache-2.0 | Python | |
c117f1772ca9f1b93335cc444e7af99398e22fbb | add a way to filter genepreds by transcript length | jason-weirather/Au-public,jason-weirather/Au-public,jason-weirather/Au-public,jason-weirather/Au-public | iron/utilities/filter_genepred_by_length.py | iron/utilities/filter_genepred_by_length.py | #!/usr/bin/python
import argparse, sys, re
from GenePredBasics import line_to_entry
def main():
parser = argparse.ArgumentParser(description="Filter a genepred by transcript length")
parser.add_argument('-i','--input',help="Input '-' for STDOUT")
parser.add_argument('--min',type=int,help="Minimum transcript leng... | apache-2.0 | Python | |
b583252e28cb8dd4a3197f9dccc6bf2d282139a7 | Add file missing from previous checkins. | lweasel/piquant,COMBINE-lab/piquant,lweasel/piquant | assess_isoform_quantification/utils.py | assess_isoform_quantification/utils.py | def spaces_to_underscore(string):
return string.replace(' ', '_')
def get_order_string(ascending):
return "asc" if ascending else "desc"
| mit | Python | |
feae53539bcb9146b4905bac04fdcbc3b54c5c18 | add migration | opencivicdata/opencivicdata.org,opencivicdata/opencivicdata.org,opencivicdata/opencivicdata.org | upload/migrations/0007_auto_20140605_1718.py | upload/migrations/0007_auto_20140605_1718.py | # encoding: utf8
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('upload', '0006_spreadsheetuploadsource'),
]
operations = [
migrations.AlterField(
model_name='spreadshe... | bsd-3-clause | Python | |
fed263e53437886cfb443ece092a80e0f7a3793d | add some ui tests | oss/shrunk,oss/shrunk,oss/shrunk,oss/shrunk,oss/shrunk | test/test_pages_load.py | test/test_pages_load.py | from shrunk.appserver import app
from flask import session
from functools import wraps
client = app.test_client()
def login(role):
return client.get("/dev-" + role + "-login")
def logout():
return client.get("/logout")
def get(url):
return client.get(url)
def post(url):
return client.post(url)
def... | mit | Python | |
b1bf21e7331ef4c6191ac27a7621deb04b086ffc | Add tests for tileutils module | allebacco/PyTileMap | tests/test_tileutils.py | tests/test_tileutils.py | import pytest
import numpy as np
from pytilemap.tileutils import posFromLonLat, lonLatFromPos
LATITUDES = np.arange(-90, 90).astype(np.float64)
LONGITUDES = np.arange(-180, 180).astype(np.float64)
ZOOMS = np.arange(1, 20).astype(np.int64)
def referencePosFromLonLat(lon, lat, zoom, tileSize):
tx = (lon + 180.0)... | mit | Python | |
f4da6ed841ff549e895ff9daa69ecdca207b8f90 | add consts with common choices | unicef/un-partner-portal,unicef/un-partner-portal,unicef/un-partner-portal,unicef/un-partner-portal | backend/unpp_api/apps/common/consts.py | backend/unpp_api/apps/common/consts.py | from __future__ import unicode_literals
from model_utils import Choices
SATISFACTION_SCALE = Choices(
('Not', 'not', 'not satisfactory'),
('Sat', 'satisfactory', 'satisfactory'),
('Hig', 'highly', 'Highly satisfactory'),
)
PARTNER_REVIEW_TYPES = Choices(
# TODO GET ALL!!! right now not specified !!!... | apache-2.0 | Python | |
be53670a8b3ce7c9ad8b9723f43aacb6977c9f69 | Add calculate_numpy | yukihirai0505/tutorial-program,yukihirai0505/tutorial-program,yukihirai0505/tutorial-program,yukihirai0505/tutorial-program,yukihirai0505/tutorial-program,yukihirai0505/tutorial-program,yukihirai0505/tutorial-program,yukihirai0505/tutorial-program,yukihirai0505/tutorial-program | python/ch03/calculate_numpy.py | python/ch03/calculate_numpy.py | import numpy as np
A = np.array([1, 2, 3, 4])
print(A)
# 1 array -> vector
print(np.ndim(A))
print(A.shape)
print(A.shape[0])
# 2 array -> matrix
B = np.array([[1, 2], [3, 4], [5, 6]])
print(B)
print(np.ndim(B))
print(B.shape)
# calculate multiply
C = np.array([[1, 2], [3, 4]])
print(C.shape)
D = np.array([[5, 6], ... | mit | Python | |
a96088de9c9e19a9dc72a687957d112c7b5bcc2e | Add a notify result processor | ARM-software/workload-automation,freedomtan/workload-automation,muendelezaji/workload-automation,ep1cman/workload-automation,muendelezaji/workload-automation,bathepawan/workload-automation,JaviMerino/workload-automation,JaviMerino/workload-automation,ep1cman/workload-automation,jimboatarm/workload-automation,Sticklyman... | wlauto/result_processors/notify.py | wlauto/result_processors/notify.py | # Copyright 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 law or agreed to in writin... | apache-2.0 | Python | |
bdfdab03b7e054b79192da866ca0d4db0b292ba4 | Add delete vault command | carsonmcdonald/glacier-cmd | glaciercmd/command_delete_vault.py | glaciercmd/command_delete_vault.py | import boto
from boto.glacier.exceptions import UnexpectedHTTPResponseError
class CommandDeleteVault(object):
def execute(self, args, config):
glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('configuration', 'aws_secret'))
... | mit | Python | |
9dac9fe963475a32e3813c2a77abfe0368eff004 | Add alert | mpurzynski/MozDef,mozilla/MozDef,jeffbryner/MozDef,mozilla/MozDef,jeffbryner/MozDef,mpurzynski/MozDef,mozilla/MozDef,jeffbryner/MozDef,jeffbryner/MozDef,mpurzynski/MozDef,mozilla/MozDef,mpurzynski/MozDef | alerts/ldap_bruteforce.py | alerts/ldap_bruteforce.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
from lib.alerttask import AlertTask
from mozdef_util.q... | mpl-2.0 | Python | |
cfe5f9240c2ccbb41c1dd3e0ea7b22ffddf80a09 | Add marshal fields to map with models. | andela-akiura/bucketlist | app/api_v1/serializers.py | app/api_v1/serializers.py | """This module defines the format used by marshall to map the models."""
from flask_restful import fields
bucketlistitem_serializer = {
'id': fields.Integer,
'item_name': fields.String,
'priority': fields.String,
'done': fields.Boolean,
'date_created': fields.DateTime,
'date_modified': fields.D... | mit | Python | |
779f4323636d2476b3e51b6e57f2c130e9d4d466 | Add tool to make dates for second Tuesday in a month | LPUG/LPUG.github.io,LPUG/LPUG.github.io | src/tools/make_dates.py | src/tools/make_dates.py | #!/usr/bin/env python
# coding: utf-8
"""Make dates on second Tuesday of the month for full year"""
import datetime
import sys
def second_tuesday(year, month):
"""Find the second Tuesday in a month."""
date = datetime.date(year, month, 1)
seen = 0
day = datetime.timedelta(days=1)
while True:
... | mit | Python | |
af9bf2a6db96b069ef62054a4ab09f66f2dd048a | Add PluginManager class and IPlugin interface | wheeler-microfluidics/microdrop | plugin_manager.py | plugin_manager.py | """
Copyright 2011 Ryan Fobel
This file is part of dmf_control_board.
Microdrop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... | bsd-3-clause | Python | |
c3eba3d5983472da3434d4c6acb4a7ab15036ee6 | Add a new snippet 'python/generators' (Fibonacci). | 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/generators/fibonacci.py | python/generators/fibonacci.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jérémie 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 Software without restriction, including withou... | mit | Python | |
4a30c2727cb592b338d21e89035e4bfff80cd368 | Create separate session management object for StorjTorrent | Storj/storjtorrent | storjtorrent/session.py | storjtorrent/session.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2014 Josh Brandoff
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including wi... | mit | Python | |
e1ac915435fbb4fc1415fbdee805094e70466432 | Create tset.py | jchen7960/python_framework | tset.py | tset.py | _name_ = 'sam'
| mit | Python | |
a2403ee98dafaf37cf0399b91b4532f2db510890 | Add oomReaper (tool for OS X) | MozillaSecurity/funfuzz,MozillaSecurity/funfuzz,MozillaSecurity/funfuzz,nth10sd/funfuzz,nth10sd/funfuzz,nth10sd/funfuzz | util/oomReaper.py | util/oomReaper.py | #!/usr/bin/env python
# ulimit for memory does not work on OS X.
# So, I wrote this thing to kill off bloated processes before they:
# * Cause slow thrashing
# * Cause OS X to pause _other_ processes (and show the force quit window)
# * Cause OS X to kernel panic
# I decided not to use 'psutil' or 'syrupy' and i... | mpl-2.0 | Python | |
b92faf7a74119662c2a28d59d1cac1b4f8c8b7e6 | Create last2.py | dvt32/cpp-journey,dvt32/cpp-journey,dvt32/cpp-journey,dvt32/cpp-journey,dvt32/cpp-journey,dvt32/cpp-journey,dvt32/cpp-journey,dvt32/cpp-journey,dvt32/cpp-journey,dvt32/cpp-journey,dvt32/cpp-journey,dvt32/cpp-journey | Python/CodingBat/last2.py | Python/CodingBat/last2.py | # http://codingbat.com/prob/p145834
def last2(str):
if len(str) < 2:
return 0
count = 0
for i in range(len(str)-2):
if str[i:i+2] == str[len(str)-2:]:
count += 1
return count
| mit | Python | |
50dd055975732755f2bcb9424bd2d5df9e1ae87a | Add unit test of navbar context processor | guswnsxodlf/k-board,hyesun03/k-board,darjeeling/k-board,cjh5414/kboard,hyesun03/k-board,guswnsxodlf/k-board,cjh5414/kboard,cjh5414/kboard,kboard/kboard,guswnsxodlf/k-board,kboard/kboard,kboard/kboard,hyesun03/k-board | kboard/core/tests/test_context_processors.py | kboard/core/tests/test_context_processors.py | from django.test import TestCase
from django.http import HttpRequest
from core.context_processors import navbar
from board.models import Board
class TestNavbarContextProcessor(TestCase):
def test_return_board_list_correctly(self):
test_board = Board.objects.create(
slug='slug',
na... | mit | Python | |
8f3411887edcf2125876b29a6502556818a577cd | Create __init__.py | CollinRooney12/htsprophet | htsprophet/__init__.py | htsprophet/__init__.py | mit | Python | ||
2233f80f3bef7472f464b552051c8026e0a8c305 | support script mode (-m) | nikitanovosibirsk/vedro | vedro/__main__.py | vedro/__main__.py | from . import run
if __name__ == "__main__":
run()
| apache-2.0 | Python | |
c708146bb2ad31d1d713f6b3db2119226ca6e594 | add wsgi | spacewiki/spacewiki,spacewiki/spacewiki,spacewiki/spacewiki,tdfischer/spacewiki,tdfischer/spacewiki,tdfischer/spacewiki,tdfischer/spacewiki,spacewiki/spacewiki | wsgi.py | wsgi.py | from app import app as application
| agpl-3.0 | Python | |
7a3f0bd1362cc8240d82294984c583921c398921 | Create image_loader.py | Tits-McGruff/SSD-game | image_loader.py | image_loader.py | import pygame
from pygame.locals import *
import os
_image_library = {}
def get_image(path): #this makes loading pictures work, make sure that the picture you're loading is in the same directory as the file
global _image_library
image = _image_library.get(path)
if image == None:
... | unlicense | Python | |
cfb98f301081e2edbd014ac080402b41697767b4 | Work in progress. | SenorPez/project-cars-replay-enhancer-ui | replayenhancer.py | replayenhancer.py | from tkinter import *
from tkinter import ttk
def new_configuration():
ui_title_screen.grid_remove()
notebook_parameters.grid()
def edit_configuration():
ui_title_screen.grid_remove()
ui_root = Tk()
ui_root.title("Project CARS Replay Enhancer")
temp_label = StringVar()
ui_title_screen = ... | mit | Python | |
b0a4a44d7c69875dc5890a8c62a25a8ae3c7900f | Add a script to find placeholers in legislation | openfisca/openfisca-core,openfisca/openfisca-core | openfisca_core/scripts/find_placeholders.py | openfisca_core/scripts/find_placeholders.py | # -*- coding: utf-8 -*-
import os
import fnmatch
import sys
from bs4 import BeautifulSoup
def find_param_files(input_dir):
param_files = []
for root, dirnames, filenames in os.walk(input_dir):
for filename in fnmatch.filter(filenames, '*.xml'):
param_files.append(os.path.join(root, filen... | agpl-3.0 | Python | |
71abee6a9b3bdff68423fc62ee853edce3efab3f | Add module for SmartOS imgadm command | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/modules/smartos_imgadm.py | salt/modules/smartos_imgadm.py | '''
Module for running imgadm command on SmartOS
'''
# Import Python libs
import logging
# Import Salt libs
import salt.utils
log = logging.getLogger(__name__)
@salt.utils.memoize
def _check_imgadm():
'''
Looks to see if imgadm is present on the system
'''
return salt.utils.which('imgadm')
def _ex... | apache-2.0 | Python | |
31a453c2fe3a668f4c826a2b5bced7ee50f58f2e | Add a simple HTTP/2 file server for testing | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | samples/http2/simple_server.py | samples/http2/simple_server.py | """A simple HTTP/2 file server."""
import asyncio
import logging
import sys
from concurrent.futures.thread import ThreadPoolExecutor
import os.path
import urllib.parse
from http import HTTPStatus
from http2 import HttpError, Protocol
LOG = logging.getLogger(__name__)
class Handler:
def __init__(self, root_p... | mit | Python | |
9c90957b08a3e9e65c6b92802e5bd6e304ca2941 | Create Sa-sille.py | PaulEG/Various-Projects | Sa-sille.py | Sa-sille.py | MARV 2 21 0 0 0 0
MARV 5 04 0 11 110 110
MARV 6 05 0 x 110 110
MARV 6 09 + 0 11 110 110
MARV 6 16 + 0 11 110 110
MARV 6 49 + 0 11 110 110
MARV 6 82b 0 11 110 110
MARV 7 27 0 x 110 0
MARV 7 64 0 x 110 x
MARV 9 01 0 x x 110
MARV 9 06 0 0 0 0
| artistic-2.0 | Python | |
b94396cfc6b96c40acac1b6d48451bea8a2a885a | put back the job runner | voyagersearch/voyager-py,voyagersearch/voyager-py | scripts/VoyagerGpToolRunner.py | scripts/VoyagerGpToolRunner.py | """---------------------------------------------------------------------------
Name: VoyagerGpToolRunner.py
Purpose:
Author: VoyagerSearch
Created: 18/12/2013
Copyright: (c) VoyagerSearch 2013
---------------------------------------------------------------------------"""
import os
import sys
import js... | apache-2.0 | Python | |
b471a2021f4654b9d7aa9d7cd1e21d8a70c855f7 | Create __init__.py | flatpolar/geoTriMesh | __init__.py | __init__.py | apache-2.0 | Python | ||
ff32a73f925cbf00e412cd4f954372ed423bbd80 | Add directory package file | xenserver/python-libs,xenserver/python-libs | __init__.py | __init__.py | #!/usr/bin/env python
# Copyright (c) 2011 Citrix Systems, Inc. All use and distribution of this
# copyrighted material is governed by and subject to terms and conditions
# as licensed by Citrix Systems, Inc. All other rights reserved.
# Xen, XenSource and XenEnterprise are either registered trademarks or
# trademarks ... | bsd-2-clause | Python | |
62ff7851ceefa12ef9eeaa7caff9f2da0b2951c6 | add navigator example | davetcoleman/sdk-examples,RethinkRobotics/baxter_tools,umassrobotics/baxter,umassrobotics/baxter,Sannoso/baxter_examples,jaspell/baxter_examples,baxter-flowers/baxter_tools,wjchen84/baxter_examples,RethinkRobotics/baxter,davetcoleman/sdk-examples,RethinkRobotics/baxter_examples | baxter/examples/input_output/src/navigator.py | baxter/examples/input_output/src/navigator.py | #!/usr/bin/python2
# Copyright (c) 2013, Rethink Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this l... | bsd-3-clause | Python | |
bfe38efc63ead69eb57c74b882f4072dd80cd469 | Add Alert class as well as connect and check_rule methods. | bsmukasa/stock_alerter | alert.py | alert.py | class Alert:
def __init__(self, description, rule, action):
self.description = description
self.rule = rule
self.action = action
self.exchange = None
def connect(self, exchange):
self.exchange = exchange
dependent_stocks = self.rule.depends_on()
for stock... | mit | Python | |
52467da69ebab6f2884bfd791d7e18bd4e593266 | Add file for control person detection | nikolaystanishev/traffic-sign-recognition | aovek.py | aovek.py | import argparse
import json
import tensorflow as tf
from aovek.preprocess.download_dataset import download_dataset
from aovek.preprocess.data_processing import DataProcessing
from aovek.training.train import Train
from aovek.visualization.predict import Predict
from aovek.validate.eval_metrics import EvalMetrics
pars... | mit | Python | |
f7cb77cd5a36e8fe8bb76eeb40712217d88dbfc4 | add handler for application v43 with preliminary fields | funginstitute/patentprocessor,yngcan/patentprocessor,funginstitute/patentprocessor,funginstitute/patentprocessor,yngcan/patentprocessor,nikken1/patentprocessor,yngcan/patentprocessor,nikken1/patentprocessor,nikken1/patentprocessor | lib/handlers/application_handler_v43.py | lib/handlers/application_handler_v43.py | #!/usr/bin/env python
"""
Uses the extended ContentHandler from xml_driver to extract the needed fields
from patent grant documents
"""
from cStringIO import StringIO
from datetime import datetime
from unidecode import unidecode
from handler import Patobj, PatentHandler
import re
import uuid
import xml.sax
import xml... | bsd-2-clause | Python | |
e0dd396dfc31bfc86405d9694c7d1ed76940f4bd | Add ultra_align_progress by upload | mfaytak/image-pca | ultra_align_progress.py | ultra_align_progress.py | '''
Last modified 3-20-2017, Matt Faytak.
Praat script and portions of Python are from Jevon Heath, Stephen Ho, Michelle Ching.
This script is a utility for processing TextGrid files in an ultrasound directory structure via Praat;
it generates and stores in plaintext files a subject-specific list of audio files, as... | bsd-2-clause | Python | |
158250f425c8a6ffce7275ebcc55f4f4d537f070 | test buy increase clicks per generation | Victory/clicker-me-bliss,Victory/clicker-me-bliss,Victory/clicker-me-bliss,Victory/clicker-me-bliss | functional-tests/suite5.py | functional-tests/suite5.py | from clickerft.cft import Cft
class Suite5(Cft):
def test_buy_clicks_per_generation(self):
price = int(self.pincreaseMaxClicks.text)
start = int(self.clicksPerGeneration.text)
for i in xrange(price):
self.increaseClicksPerGeneration.click()
fin = int(self.clicksPerGener... | mit | Python | |
a694c8449f63cbe37ceadc98a5836cfaff8fa992 | Add more complicated test of epsilon rules restoration | PatrikValkovic/grammpy | tests/RemoveEpsilonRules/Reverse/OverTwoRuleTest.py | tests/RemoveEpsilonRules/Reverse/OverTwoRuleTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 20.08.2017 16:01
:Licence GNUv3
Part of grammpy-transforms
"""
from unittest import TestCase, main
from grammpy import *
from grammpy_transforms import ContextFree, InverseContextFree
from pyparsers import cyk
class S(Nonterminal): pass
class A(Nonterminal):... | mit | Python | |
96e2329a2fb804d1018d88fea703e56b4844d7f6 | Add missing migration | yunojuno/django-onfido | onfido/migrations/0017_auto_20210304_0241.py | onfido/migrations/0017_auto_20210304_0241.py | # Generated by Django 3.1.3 on 2021-03-04 08:41
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("onfido", "0016_update_applicant_user_field"),
]
operations = [
migrations.AlterModelOptions(
name="applicant",
options={},
... | mit | Python | |
b94b04f362632add8e3ccd1e7a490e1ac73d960d | Create nDiffElem.py | NendoTaka/CodeForReference,NendoTaka/CodeForReference,NendoTaka/CodeForReference | Codingame/Python/Clash/nDiffElem.py | Codingame/Python/Clash/nDiffElem.py | n,r=map(int,input().split())
o=[str(x*r) for x in range(n)]
print(' '.join(o))
| mit | Python | |
3097b59276596783bc507e00f508fa5fbe224e30 | Remove @cache_control(private=True) from userlang | hoosteeno/bedrock,petabyte/bedrock,andreadelrio/bedrock,glogiotatidis/bedrock,Jobava/bedrock,andreadelrio/bedrock,Sancus/bedrock,yglazko/bedrock,gerv/bedrock,davehunt/bedrock,bensternthal/bedrock,mozilla/bedrock,pascalchevrel/bedrock,marcoscaceres/bedrock,petabyte/bedrock,sylvestre/bedrock,rishiloyola/bedrock,alexgibso... | bedrock/tabzilla/views.py | bedrock/tabzilla/views.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import json
import os.path
from datetime import datetime
from django.conf import settings
from django.http import HttpR... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import json
import os.path
from datetime import datetime
from django.conf import settings
from django.http import HttpR... | mpl-2.0 | Python |
ac88966c4ccbb6e1bd593c98ab69afc1a7dce85c | Create mipush.py | legendmohe/LEHome,legendmohe/LEHome | vendor/mipush/mipush.py | vendor/mipush/mipush.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import json
import httplib
import urllib
import time
ERR_OK = 0
ERR_PARAM = -1
ERR_HTTP = -100
ERR_RETURN_DATA = -101
class MIPushHelper(object):
MIPUSH_HOST = 'api.xmpush.xiaomi.com'
MIPUSH_PORT = 443
MIPUSH_SECRET_KEY = ''
TIMEOUT = 10
HTTP_METHOD = '... | apache-2.0 | Python | |
5cf372fa0566a655e3a2c2b11dbde027d1513da3 | Create reversed_words.py | Kunalpod/codewars,Kunalpod/codewars | reversed_words.py | reversed_words.py | #Kunal Gautam
#Codewars : @Kunalpod
#Problem name: Reversed Words
#Problem level: 6 kyu
def reverseWords(str):
return ' '.join(reversed(str.split()))
| mit | Python | |
f584ec84eb16d34855cf4e10b0bd7c1cadb7dbfd | Add settings.py abstraction layer to database | dhinakg/BitSTAR,StarbotDiscord/Starbot,dhinakg/BitSTAR,StarbotDiscord/Starbot | api/settings.py | api/settings.py | # Copyright 2017 Starbot Discord Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | Python | |
a6e92e2464a50a7c4159958e1b60c0aa2dea96a9 | Add script to automate the creation of the Neon app. | alan-wu/neon | res/os_x_app_creation.py | res/os_x_app_creation.py | #! /usr/bin/env python
import os
import shutil
import subprocess
MAIN_WINDOW_UI_FILE = 'src/opencmiss/neon/ui/ui_mainwindow.py'
def remove_parent_of_menubar():
with open(MAIN_WINDOW_UI_FILE, 'r+') as f:
s = f.read()
f.seek(0)
c = s.replace('self.menubar = QtGui.QMenuBar(MainWindow)', 'sel... | apache-2.0 | Python | |
92ea3e04114a685111c7e43667c8fae6ddf26025 | Add "build" command | fkie/rosrepo,fkie/rosrepo | src/rosrepo/cmd_build.py | src/rosrepo/cmd_build.py | """
Copyright (c) 2016 Fraunhofer FKIE
"""
import os
from .workspace import get_workspace_location, get_workspace_state
from .cmd_git import clone_packages
from .resolver import find_dependees, show_fallback, show_conflicts
from .config import Config
from .cache import Cache
from .ui import msg, fatal, escape
from .ut... | apache-2.0 | Python | |
54443d2f3550ccb783fcb519e950b688073fe985 | Create _rotate.py | gabru-md/faces | resources/_py/_rotate.py | resources/_py/_rotate.py | # PYTHON
# MANISH DEVGAN
# https://github.com/gabru-md
#BEGIN
# ROTATE AN IMAGE IN PYTHON using OpenCV
# IMPORTS
import numpy as np
import cv2
# reading image using cv2.imread()
image = cv2.imread("PATH TO IMAGE")
# grab the dimensions of the image and then determine the
# center
(h, w) = image.shape[:2]
(cX, c... | bsd-3-clause | Python | |
5938499be7ffff509a031c6a103c87455ce0318a | Add new package: stinger (#16316) | LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/stinger/package.py | var/spack/repos/builtin/packages/stinger/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 Stinger(CMakePackage):
"""The STINGER in-memory graph store and dynamic graph analysis
... | lgpl-2.1 | Python | |
07f2cc252495180e035e5e687705cd49a2c414a5 | add script to remove vowels/diacritics from primary arabic words source | bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile | support/scripts/remove-vowels.py | support/scripts/remove-vowels.py | #!/usr/bin/env python
# $Id$
'''Use this script to remove vowels/diacritics from the primary arabic words
source (currently arabic-words.csv)
'''
infile_name = '../words/arabic-words.csv'
outfile_name = '../words/arabic-novowels.csv'
def main():
infile = open(infile_name)
outfile = open(outfile_name, 'w'... | mit | Python | |
7068245a8b64a9f44ec09feda47325e7302754c1 | Add crawl images | zhakui/python,renzongxian/Show-Me-the-Code,llluiop/python-1,renzongxian/Show-Me-the-Code,ionutcipriananescu/python,starlightme/python,ZSeaPeng/python,Yrthgze/prueba-sourcetree2,agogear/python-1,Jaccorot/python,DanielShangHai/python,xchaoinfo/python,Friday21/python_show_me_the_code,DanielShangHai/python,haiyangd/python-... | Lupino/0013/crawl.py | Lupino/0013/crawl.py | import requests
from bs4 import BeautifulSoup
def get_html(url):
r = requests.get("http://tieba.baidu.com/p/2166231880")
return r.text
def extract_images(text):
soup = BeautifulSoup(text)
elems = soup.find_all("img", {'class': "BDE_Image"})
return [elem.get("src")
for elem in elem... | mit | Python | |
e9df7c04e89ee0dc9a2d53aeb36118ee04380169 | Create game.py | nokmiet/lever,nokmiet/lever | www/py/coregame/game.py | www/py/coregame/game.py | a
| mpl-2.0 | Python | |
51dde93118ce9b9fd3afe19b36fb96acd2e76358 | Add python solution to 008 | whoshuu/euler | 008/008.py | 008/008.py | import os
with open(os.path.join(os.path.dirname(__file__), 'number.txt'), 'r') as f:
number = f.readline().strip('\n')
consecutive = 13
largest = 0
largest_start = 0
for start in range(len(number) - consecutive + 1):
p = reduce(lambda x, y: int(x) * int(y), number[start:start + consecutive])
if p > la... | unlicense | Python | |
2d51924e5f30c17636205a2db22125c0e5f0516b | add ocr_api.py | EscapeLife/web_crawler | 7.验证码处理/2.ocr_api.py | 7.验证码处理/2.ocr_api.py | #!/usr/bin/env python
# coding:utf-8
import re
import sys
import time
import urllib
import urllib2
from PIL import Image
from io import BytesIO
from form import register
def main(api_key, filename):
captcha = CaptchaAPI(api_key)
print register('Test Account', 'Test Account', 'example@webscraping.com', 'exam... | mit | Python | |
94ff5586b427e7c98a355ccb209d655398051ea4 | Add IndexDashboard | matus-stehlik/roots,matus-stehlik/roots,tbabej/roots,rtrembecky/roots,tbabej/roots,rtrembecky/roots,matus-stehlik/roots,tbabej/roots,rtrembecky/roots | admin_custom/dashboard.py | admin_custom/dashboard.py | from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from grappelli.dashboard import modules, Dashboard
from grappelli.dashboard.utils import get_admin_site_name
class IndexDashboard(Dashboard):
"""
Custom index dashboard for Roots.
"""
def init_with_c... | mit | Python | |
519cb3ebf56c7841240779e170fb3bc657d87830 | Add tempest unit test to verify the test list | FujitsuEnablingSoftwareTechnologyGmbH/tempest,hayderimran7/tempest,tonyli71/tempest,alinbalutoiu/tempest,xbezdick/tempest,danielmellado/tempest,openstack/tempest,eggmaster/tempest,FujitsuEnablingSoftwareTechnologyGmbH/tempest,xbezdick/tempest,bigswitch/tempest,afaheem88/tempest,eggmaster/tempest,pczerkas/tempest,redhat... | tempest/tests/test_list_tests.py | tempest/tests/test_list_tests.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 IBM Corp.
#
# 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
#
# ... | apache-2.0 | Python | |
0aee93c8730625ea0efa5a6ff1e48b29f0161dd5 | Add unit tests for logspace_int. | chebee7i/buhmm | buhmm/tests/test_misc.py | buhmm/tests/test_misc.py | from nose.tools import *
import numpy as np
import buhmm.misc as module
def test_logspace_int_smoke():
# Smoke test
x = module.logspace_int(2000, 50)
y = np.array([
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11,
13, 14, 17, 19, 22, 25, 29, 33, 38, 43, ... | mit | Python | |
22b26e3bbc0e35d5c923cef5d1982b19363e2783 | Add BaseLogger | kevinkepp/search-for-this | sft/BaseLogger.py | sft/BaseLogger.py | import os
from datetime import datetime
class BaseLogger(object):
TIMESTAMP_FORMAT = "%Y%m%d-%H%M%S"
def __init__(self):
# dictionary storing currently opened files based
self.open_files = {}
def __del__(self):
# make sure all files are closed when object is destructed
if len(self.open_files) > 0:
sel... | mit | Python | |
3c5db7ddeb7ac076f899c2651af54cd0a8797801 | Create class | CarlosPena00/Mobbi,CarlosPena00/Mobbi | Rasp/serialCommunicationArduino/RtsModule.py | Rasp/serialCommunicationArduino/RtsModule.py | import serial
class RtsModule(object):
"""docstring for RtsModule"""
def __init__(self):
self.ard = serial.Serial('/dev/ttyUSB0',9600)
self.lista_temp = []
self.lista_sound = []
self.lista_RFID = []
self.count_pass = 0
self.count_temp = 0
self.count_sound = 0
def getInformation():
st = self... | mit | Python | |
06524cdfe699b7190ae774ceda2826b48ce37724 | Add UserSerializer | comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django | app/grandchallenge/core/serializers.py | app/grandchallenge/core/serializers.py | from django.contrib.auth import get_user_model
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = get_user_model()
fields = ('id', 'username')
| apache-2.0 | Python | |
af286a6b2aedfeafdfeba0cd7db918845ae9c9d0 | Add pooling lib. | loads/loads-broker,loads/loads-broker,loads/loads-broker,loads/loads-broker | loadsbroker/pooling.py | loadsbroker/pooling.py | """Pooling utilities and globals"""
import concurrent.futures
thread_pool = concurrent.futures.ThreadPoolExecutor(max_workers=20)
| apache-2.0 | Python | |
51f154abd69250296a6186c8308caacee885c5b3 | check website status and post to slack channel | mfwarren/FreeCoding,mfwarren/FreeCoding,mfwarren/FreeCoding | 2015/05/fc_2015_05_11.py | 2015/05/fc_2015_05_11.py | #!/usr/bin/env python3
# imports go here
import requests
import json
#
# Free Coding session for 2015-05-11
# Written by Matt Warren
#
SLACK_HOOK_URL = 'https://hooks.slack.com/services/Something'
SITES = [
'http://halotis.com',
'http://mattwarren.co',
'http://columfurey.com',
'http://www.routeburn.c... | mit | Python | |
7084501c2d541d245920791016125d00fd85868c | Add unit test | polygraph-python/polygraph | polygraph/types/tests/test_lazy_type.py | polygraph/types/tests/test_lazy_type.py | from unittest import TestCase
from polygraph.types.decorators import field
from polygraph.types.lazy_type import LazyType
from polygraph.types.object_type import ObjectType
from polygraph.types.tests.helper import Person
class SelfReferentialObject(ObjectType):
"""
This is a test object
"""
@field()
... | mit | Python | |
eb7ccf3ab9ead020775a8fd9d6c79f25f747dd41 | Add tests for ogn.gateway.client.ognGateway | glidernet/ogn-python,Meisterschueler/ogn-python,Meisterschueler/ogn-python,kerel-fs/ogn-python,glidernet/ogn-python,glidernet/ogn-python,Meisterschueler/ogn-python,Meisterschueler/ogn-python,glidernet/ogn-python | tests/gateway/test_ognGateway.py | tests/gateway/test_ognGateway.py | import unittest
import unittest.mock as mock
from ogn.gateway.client import ognGateway
from ogn.gateway.settings import APRS_APP_NAME, APRS_APP_VER
class GatewayTest(unittest.TestCase):
def test_initialisation(self):
self.gw = ognGateway(aprs_user='testuser', aprs_filter='')
self.assertEqual(self... | agpl-3.0 | Python | |
9a811ffcd7bb743b4c739667187d31f32429338a | Add a very simple test | sangoma/safepy2,leonardolang/safepy2 | tests/test_exception_wrapping.py | tests/test_exception_wrapping.py | import safe
def test_simple_exception():
class MockReponse(object):
def json(self):
return {'status': False,
'method': 'synchronize',
'module': 'cluster',
'error': {'message': 'Example error'}}
exception = safe.library.raise_from... | mpl-2.0 | Python | |
60d26f05bacaa35608c0e2d88e18d04d4ff96049 | add Eco Compiler | ikeikeikeike/django-spine,ikeikeikeike/django-spine,ikeikeikeike/django-spine | spine/compiler.py | spine/compiler.py | import eco
import os
from pipeline.compilers import CompilerBase
class EcoCompiler(CompilerBase):
output_extension = 'js'
def match_file(self, filename):
return filename.endswith('.eco')
def compile_file(self, content, path):
p = path.split("/")[::-1]
return u'(function() {\n thi... | mit | Python | |
8ef0f8058854b2ef55d2d42bbe84487a9aadae12 | Add build flags for YouCompleteMe. | ShiftMediaProject/vorbis,ShiftMediaProject/vorbis,ShiftMediaProject/vorbis,ShiftMediaProject/vorbis,ShiftMediaProject/vorbis,ShiftMediaProject/vorbis | .ycm_extra_conf.py | .ycm_extra_conf.py | def FlagsForFile(filename, **kwargs):
return {
'flags': [
'-x', 'c',
'-g', '-Wall', '-Wextra',
'-D_REENTRANT', '-D__NO_MATH_INLINES', '-fsigned-char'
],
}
| bsd-3-clause | Python | |
ae7a2a3809ebe54c13a9ced4da5bbd48cc8d0e3a | Add "Circle Inversion Fractals (Apollonian Gasket)" | leovp/graphics | Apollonian/main.py | Apollonian/main.py | # Circle Inversion Fractals (Apollonian Gasket) (Escape-time Algorithm)
# FB36 - 20131031
import math
import random
from collections import deque
from PIL import Image
imgx = 512 * 2
imgy = 512 * 2
image = Image.new("RGB", (imgx, imgy))
pixels = image.load()
#n = random.randint(3, 6) # of main circles
n = 3
a = math.pi... | mit | Python | |
4bcdd68c59674ae1bfef538676cc8984fbf4361f | Create augmentation.py | abhishekkrthakur/NDSB | augmentation.py | augmentation.py | import skimage.transform as transform
import skimage
IMG_DIM = 96
AUGMENTATION_PARAMS = {
'zoom_range': (1.0, 1.1),
'rotation_range': (0, 360),
'shear_range': (0, 5),
'translation_range': (-4, 4),
}
def fast_warp(img, tf, output_shape=IMG_DIM, mode='nearest'):
... | mit | Python | |
8a75b84635d68c906466c440e0e98cf27dba8d89 | implement centroid+keypoint algo | oknuutti/visnav-py | src/algo/mixed.py | src/algo/mixed.py | import math
import numpy as np
import quaternion
import cv2
from settings import *
from algo import tools
#from algo.centroid import CentroidAlgo
#from algo.keypoint import KeypointAlgo
from algo.tools import PositioningException
class MixedAlgo():
def __init__(self, centroid, keypoint, **kwargs):
self.... | mit | Python | |
10f0318b1948dd93bbb6611f907486e9d45e39b2 | Add files via upload | Valchy94/K-median-Problem | OR_kmedians.py | OR_kmedians.py | import random
from scipy.optimize import linprog
def razdalja(x,y):
return abs(x[0]-y[0])+abs(x[1]-y[1])
def k_medians(tocke, k):
n = len(tocke)
c = [0]*n
for i in range(n):
for j in range(n):
c += [razdalja(tocke[i],tocke[j])]
A = []
A_eq = []
b = []
... | mit | Python | |
a1bd1a6bf45c505654039eca64d61af548b48530 | Create Rotate_Array.py | UmassJin/Leetcode | Array/Rotate_Array.py | Array/Rotate_Array.py | My Submissions Question Solution
Rotate an array of n elements to the right by k steps.
For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].
Note:
Try to come up as many solutions as you can, there are at least 3 different ways to solve this problem.
[show hint]
Related probl... | mit | Python | |
25bd86065291483c34ff2e4b45449c7c9a72a3ac | add __unicode__ to submitrecord | qedsoftware/commcare-hq,gmimano/commcaretest,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,SEL-Columbia/commcare-hq,gmimano/commcaretest,puttarajubr/commcare-hq,SEL-Columbia/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,SEL-Columbia/commcare-hq,dimagi/commcare-hq,di... | apps/receiver/submitrecord.py | apps/receiver/submitrecord.py |
class SubmitRecord(object):
'''A simple data class for holding some metadata about a submission'''
# these should probably be encapsulated, but it's such a simple classs....
content_type = ""
content_length = ""
guid = ""
checksum = ""
file_name = ""
def __init__(self, content... |
class SubmitRecord(object):
'''A simple data class for holding some metadata about a submission'''
# these should probably be encapsulated, but it's such a simple classs....
content_type = ""
content_length = ""
guid = ""
checksum = ""
file_name = ""
def __init__(self, content... | bsd-3-clause | Python |
59ca3b5e97e2186f439f3f2fc82259ba56a3b78f | Add module-based tests to the `pass` tests | endolith/numpy,jakirkham/numpy,anntzer/numpy,simongibbons/numpy,anntzer/numpy,numpy/numpy,numpy/numpy,seberg/numpy,mattip/numpy,charris/numpy,seberg/numpy,jakirkham/numpy,simongibbons/numpy,mhvk/numpy,mhvk/numpy,pdebuyl/numpy,pbrod/numpy,pbrod/numpy,pdebuyl/numpy,endolith/numpy,seberg/numpy,pdebuyl/numpy,charris/numpy,... | numpy/typing/tests/data/pass/modules.py | numpy/typing/tests/data/pass/modules.py | import numpy as np
np.char
np.ctypeslib
np.emath
np.fft
np.lib
np.linalg
np.ma
np.matrixlib
np.polynomial
np.random
np.rec
np.testing
np.version
np.__all__
np.__path__
np.__version__
np.__git_version__
np.__NUMPY_SETUP__
np.__deprecated_attrs__
np.__expired_functions__
| bsd-3-clause | Python | |
8ff7becc414e2969cf89468c6af95c0356abebae | Add a rudimentary trace shrinker, implemented in python | CTSRD-CHERI/axe,CTSRD-CHERI/axe,CTSRD-CHERI/axe,CTSRD-CHERI/axe | src/axe-shrink.py | src/axe-shrink.py | #!/usr/bin/env python
# Given an axe trace that fails a given consistency model, try to find
# the smallest subset of the trace that also fails the model. This
# makes it easier to determine *why* a trace does not satisfy a model.
# This simple shrinker is only really effective when each store of a
# value to an add... | apache-2.0 | Python | |
481c0383f90f1c16a1e10a998bee452c19222c5f | add class World to rapresent all the information | develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms,develersrl/rooms | trunk/editor/structData/world.py | trunk/editor/structData/world.py | #!/usr/bin/env python
from origin import OriginData
try:
from collections import OrderedDict
except ImportError:
from misc.dict import OrderedDict
class World(OriginData):
tag_name = "world"
def __init__(self):
self.informations = None
self.images = {}
self.items = OrderedDict... | mit | Python | |
fdfafa47e038a397653f5afe898b84fa7402aa2e | Remove redundant slashes in blog urlpatterns. | viaregio/mezzanine,stephenmcd/mezzanine,sjuxax/mezzanine,jerivas/mezzanine,gradel/mezzanine,wbtuomela/mezzanine,frankier/mezzanine,dsanders11/mezzanine,eino-makitalo/mezzanine,spookylukey/mezzanine,promil23/mezzanine,spookylukey/mezzanine,ryneeverett/mezzanine,sjuxax/mezzanine,stephenmcd/mezzanine,promil23/mezzanine,ry... | mezzanine/blog/urls.py | mezzanine/blog/urls.py | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from mezzanine.conf import settings
# Trailing slahes for urlpatterns based on setup.
_slash = "/" if settings.APPEND_SLASH else ""
# Blog patterns.
urlpatterns = patterns("mezzanine.blog.views",
url("^feeds/(?P<format>.*)%s$" ... | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from mezzanine.conf import settings
# Leading and trailing slahes for urlpatterns based on setup.
_slashes = (
"/" if settings.BLOG_SLUG else "",
"/" if settings.APPEND_SLASH else "",
)
# Blog patterns.
urlpatterns = pattern... | bsd-2-clause | Python |
3e0731aeedd0813e2c068db183969e1fa1badda7 | Add benchmark | nickdrozd/ecio-lisp,nickdrozd/ecio-lisp | bench.py | bench.py | from repl import ecio_eval
from stats import display_stats
def run_benchmark():
recursive_fib = '''
(begin
(def fibonacci
(λ (n)
(if (< n 2)
n
(_+ (fibonacci (_- n 1))
(fibonacci (_- n 2))))))
(fibonacci {}))
'''
iterative_fib = ... | mit | Python | |
0687ebfc3127b1d69c6d4cb79e4f9751554da9d2 | Add Board class for representing board state. | isaacarvestad/four-in-a-row | board.py | board.py | """
Board represents a four in a row game board.
Author: Isaac Arvestad
"""
class Board:
"""
Initializes the game with a certain number of rows
and columns.
"""
def __init(self, rows, columns):
self.rows = rows
self.columns = columns
| mit | Python | |
f5a681d9dd20eea43fb9d076fe033016ccab9c29 | support script | spyysalo/nxml2txt,spyysalo/nxml2txt | src/extracttex.py | src/extracttex.py | #!/usr/bin/env python
# Print unique <tex-math> elements from PMC NXML files.
# Helper for nxml2txt development.
import sys
import os
import re
import codecs
from lxml import etree as ET
# command-line options
options = None
# pre-compiled regular expressions
# key declarations in tex documents
texdecl_re = re.c... | mit | Python | |
b0fa5131973fce341540c13cb10d34324792a19f | Add default System migration | ScanOC/trunk-player,ScanOC/trunk-player,ScanOC/trunk-player,ScanOC/trunk-player | radio/migrations/0023_default_system.py | radio/migrations/0023_default_system.py | # -*- coding: utf-8 -*-
#
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('radio', '0022_system'),
]
operations = [
# Setup a default source
migrations.Run... | mit | Python | |
3a186a22ab0a7e8a18b8cd6850adc8537bb8d6e7 | add file to extract first link from webpage | enlighter/simple-crawler-in-python | baby-steps/extractLink.py | baby-steps/extractLink.py | # Write Python code that assigns to the
# variable url a string that is the value
# of the first URL that appears in a link
# tag in the string page.
# Your code should print http://udacity.com
# Make sure that if page were changed to
# page = '<a href="http://udacity.com">Hello world</a>'
# that your code still pri... | mit | Python | |
4eb2f518a216fdfe0b98e48c4511ccac94844860 | Add url_shortener.config module | piotr-rusin/url-shortener,piotr-rusin/url-shortener | url_shortener/config.py | url_shortener/config.py | # -*- coding: utf-8 -*-
''' Configuration values for the application '''
| mit | Python | |
5c8be9cfe49ff0727615caef14daf83da7fe1c0b | convert prepared text to a yaml fixture for import | bgalbraith/nincatalog,bgalbraith/nincatalog | util/legacy_txt2yaml.py | util/legacy_txt2yaml.py | """
Convert prepared legacy nincatalog text files to YAML fixtures for import
"""
import re
base = '/Users/bgalbraith/Projects/nincatalog/data/prepared/'
fixture_dir = '../catalog/fixtures/'
tables = ('artist', 'mediapackage', 'mediaformat', 'country', 'musiclabel',
'era', 'itemrarity', 'item')
with open(f... | apache-2.0 | Python | |
477dfbed97218e9250d82f66ad6aa2442c3724ba | add cleaning script | svn2github/libtorrent-trunk,svn2github/libtorrent-trunk,svn2github/libtorrent-trunk,svn2github/libtorrent-trunk | clean.py | clean.py | import os
to_delete = [
'session_stats',
'libtorrent_logs*',
'round_trip_ms.log',
'dht.log',
'upnp.log',
'natpmp.log',
'bin'
]
directories = [
'examples',
'test',
'.',
'tools'
]
for d in directories:
for f in to_delete:
path = os.path.join(d, f)
print path
os.system('rm -rf %s' % path)
| bsd-3-clause | Python | |
9f5b6052e50651d42b0321672bab72d271bb6a3c | Add Flask blueprint | JamesLaverack/website | james_laverack/__init__.py | james_laverack/__init__.py | from flask import Blueprint, render_template
james_laverack = Blueprint('james_laverack',
__name__,
template_folder = 'templates',
static_folder = './static',
static_url_path = '/%s' % __name__)
@james_laverack... | mit | Python | |
c22958dcaca4eeb72bf97b157b1747331c3e926d | Add sfp_twitter module | smicallef/spiderfoot,smicallef/spiderfoot,smicallef/spiderfoot | modules/sfp_twitter.py | modules/sfp_twitter.py | #-------------------------------------------------------------------------------
# Name: sfp_twitter
# Purpose: Query Twitter for name and location information.
#
# Author: Brendan Coles <bcoles@gmail.com>
#
# Created: 2018-10-17
# Copyright: (c) Brendan Coles 2018
# Licence: GPL
#----------... | mit | Python | |
b781ea216d2512aed5f175c73b3f4d0883c9c377 | Add base64encode.py | butfriendly/friendly-oneliners | base64encode.py | base64encode.py | #!/usr/bin/env python
"""The base64 file encoder helps you to encode binary files at the
command-line.
As defined by RFC 2397, data URIs are designed to embed small data items
as "immediate" data, as if they were referenced externally. Using inline
images saves HTTP requests over externally referenced objects.
Usa... | bsd-3-clause | Python | |
5edb1008181a5072da8fd9ec8bc65e3dfc3b0149 | Create __init__.py | galad-loth/LearnDescriptor | net_symbol/__init__.py | net_symbol/__init__.py | # -*- coding: utf-8 -*-
| apache-2.0 | Python | |
13bbb9610c368f9325c820468be1ca6d25c5d121 | Delete example. | openconnectome/open-connectome,neurodata/ndstore,openconnectome/open-connectome,neurodata/ndstore,openconnectome/open-connectome,openconnectome/open-connectome,neurodata/ndstore,openconnectome/open-connectome,neurodata/ndstore,openconnectome/open-connectome | web/examples/annodel.py | web/examples/annodel.py | import urllib2
import argparse
import numpy as np
import urllib2
import cStringIO
import sys
import tempfile
import h5py
import empaths
import h5ann
from pprint import pprint
def main():
parser = argparse.ArgumentParser(description='Fetch an annotation as an HDF5 file')
parser.add_argument('baseurl', action="s... | apache-2.0 | Python | |
11bb0d7aa106e1cafee8b4f00bf75a2aa02e97cf | Add small script to start calculating error from kmer motifs, prototyping | ARUP-NGS/BMFtools,ARUP-NGS/BMFtools,ARUP-NGS/BMFtools | SecC/ErrMer_Proto.py | SecC/ErrMer_Proto.py | from __future__ import division
import numpy as np
from utilBMF.HTSUtils import pFastqProxy, pFastqFile
consInFq1 = pFastqFile("/home/brett/Projects/BMFTools_Devel/lamda_data/lamda-50di"
"v_S4_L001_R1_001.fastq.rescued.shaded.BS.fastq")
consInFq2 = pFastqFile("/home/brett/Projects/BMFTools_Devel/la... | mit | Python | |
a851726b7a6f1810dfc9e8099bcd5854812d4b29 | fix bad line | shacknetisp/fourthevaz,shacknetisp/fourthevaz,shacknetisp/fourthevaz | modules/default/textreplies.py | modules/default/textreplies.py | # -*- coding: utf-8 -*-
from configs.module import Module
import random
def init():
m = Module(__name__)
m.set_help('Random humorous replies.')
m.add_base_hook('recv', recv)
return m
def generateface():
ears = (
"([`",
")]'",
)
eyes = "oO0*-+"
mouth = '_.,'
ea... | # -*- coding: utf-8 -*-
from configs.module import Module
import random
def init():
m = Module(__name__)
m.set_help('Random humorous replies.')
m.add_base_hook('recv', recv)
return m
def generateface():
ears = (
"([`",
")]'",
)
eyes = "oO0*-+"
mouth = '_.,'
ea... | mit | Python |
85030cf83c87bc65b0ead3bfd8a7bd002da20407 | fix merge migrations | macarthur-lab/xbrowse,macarthur-lab/seqr,macarthur-lab/xbrowse,ssadedin/seqr,macarthur-lab/seqr,macarthur-lab/seqr,macarthur-lab/xbrowse,macarthur-lab/seqr,macarthur-lab/seqr,ssadedin/seqr,ssadedin/seqr,macarthur-lab/xbrowse,ssadedin/seqr,ssadedin/seqr,macarthur-lab/xbrowse,macarthur-lab/xbrowse | seqr/migrations/0062_merge_20190723_1539.py | seqr/migrations/0062_merge_20190723_1539.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-07-23 15:39
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('seqr', '0061_family_assigned_analyst'),
('seqr', '0061_auto_20190715_1500'),
]
ope... | agpl-3.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.