repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/vm/manual/custom.py
1
1298
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incor...
mit
-2,428,169,802,671,132,700
40.870968
76
0.544684
false
oskopek/devassistant
test/test_actions.py
1
9352
import os import subprocess import pytest from flexmock import flexmock from devassistant import actions, exceptions from devassistant.dapi import dapicli from test.logger import LoggingHandler class TestActions(object): def setup_class(self): self.ha = actions.HelpAction def test_get_help_contain...
gpl-2.0
671,938,580,066,341,000
35.108108
97
0.590997
false
bartQu9/fallenmua
resolvers.py
1
3740
from urllib.error import URLError, HTTPError from xml.dom import minidom from dns import resolver import urllib.request import logging def parse_thunderbird_autoconfig(xml_autoconfig): mx_servers = [] dom_tree = minidom.parseString(xml_autoconfig) c_nodes = dom_tree.childNodes for i in c_nodes[0].ge...
gpl-3.0
-4,507,054,669,100,559
37.163265
111
0.634225
false
kooksee/TIOT
test/project/src/app/proto/protocol/XBeeProtocol.py
1
11235
# encoding=utf-8 import binascii import json from twisted.internet.protocol import Protocol from app.proto.controller.XbeeController import XBeeController class XBeeProtocol(Protocol): def __init__(self): self.ip = '' self.port = '' def connectionMade(self): #import soc...
gpl-2.0
519,063,358,341,324,000
58.951087
135
0.621846
false
LeandroRoberto/sapl
sapl/relatorios/templates/pdf_pauta_sessao_preparar_pysc.py
1
9023
import os request=context.REQUEST response=request.RESPONSE session= request.SESSION if context.REQUEST['data']!='': dat_inicio_sessao = context.REQUEST['data'] pauta = [] # lista contendo a pauta da ordem do dia a ser impressa data = context.pysc.data_converter_pysc(dat_inicio_sessao) # converte data...
gpl-3.0
5,210,098,194,527,518,000
54.432099
211
0.611693
false
icereval/osf.io
api/requests/serializers.py
1
3573
from django.db import IntegrityError from rest_framework import exceptions from rest_framework import serializers as ser from api.base.exceptions import Conflict from api.base.utils import absolute_reverse, get_user_auth from api.base.serializers import JSONAPISerializer, LinksField, VersionedDateTimeField, Relationsh...
apache-2.0
5,260,071,083,235,014,000
37.419355
167
0.65799
false
DayGitH/Python-Challenges
DailyProgrammer/DP20160323B.py
1
5877
""" [2016-03-23] Challenge #259 [Intermediate] Mahjong Hands https://www.reddit.com/r/dailyprogrammer/comments/4bmdwz/20160323_challenge_259_intermediate_mahjong_hands/ # Description You are the biggest, baddest mahjong player around. Your enemies tremble at your presence on the battlefield, and you can barely walk t...
mit
8,850,470,160,075,087,000
25.713636
120
0.693041
false
thepaul/uftrace
tests/t217_no_libcall_dump.py
1
1525
#!/usr/bin/env python from runtest import TestBase import subprocess as sp TDIR='xxx' class TestCase(TestBase): def __init__(self): TestBase.__init__(self, 'signal', """ uftrace file header: magic = 4674726163652100 uftrace file header: version = 4 uftrace file header: header size = 40 uf...
gpl-2.0
5,009,807,141,104,488,000
35.309524
119
0.658361
false
datakortet/django-cms
cms/plugins/teaser/models.py
1
1148
from django.core.cache import cache from django.db import models from django.utils.translation import ugettext_lazy as _ from cms.models import CMSPlugin, Page class Teaser(CMSPlugin): """ A Teaser """ title = models.CharField(_("title"), max_length=255) image = models.ImageField(_("image"), upload...
bsd-3-clause
-9,133,270,745,752,438,000
32.764706
128
0.625436
false
YufeiZhang/Principles-of-Programming-Python-3
Lectures/Lecture_6/k_means_clustering.py
1
10239
# Written by Eric Martin for COMP9021 import tkinter as tk import tkinter.messagebox class KMeansClustering(tk.Tk): def __init__(self): tk.Tk.__init__(self) self.title('k-means clustering') menubar = tk.Menu() help_menu = tk.Menu(menubar) menubar.add_cascade(label = 'k-me...
gpl-3.0
-857,309,730,770,456,000
49.940299
109
0.585604
false
aerval/blast_comparison
main.py
1
16353
#!/bin/env python ############################################## # CompareBLASTs # # A tool to compare the found hits from two # # BLAST searches with the same search query. # # # # by Philipp B. Rentzsch # # BCCDC Vancouver, ...
mit
8,680,908,391,460,306,000
41.365285
79
0.538494
false
manumathewthomas/Chat-with-Joey
chatbot/chatbot.py
1
31681
# Copyright 2015 Conchylicultor. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
-8,179,409,403,596,673,000
50.016103
402
0.631009
false
codemeow5/PyPack
pypack/protocol.py
1
2657
""" Class and function related to protocol operation """ import datetime import struct MSG_TYPE_SEND = 0x1 MSG_TYPE_ACK = 0x2 MSG_TYPE_RECEIVED = 0x3 MSG_TYPE_RELEASE = 0x4 MSG_TYPE_COMPLETED = 0x5 QOS0 = 0 QOS1 = 1 QOS2 = 2 # MAX_DATETIME = int((datetime.datetime(2500, 1, 1) - datetime.datetime(1970, 1, 1)).total...
mit
-917,027,524,274,186,600
31.802469
101
0.601807
false
ioanaantoche/muhaha
ioana/examples/feet.py
1
1624
import sys from naoqi import ALProxy import time def main(robotIP): PORT = 9559 try: motionProxy = ALProxy("ALMotion", robotIP, PORT) except Exception,e: print "Could not create proxy to ALMotion" print "Error was: ",e sys.exit(1) try: postureProxy = ALProxy("A...
gpl-2.0
-554,343,618,440,317,800
26.083333
90
0.649631
false
BreakawayConsulting/pyxmlerrors
pyxmlerrors.py
1
3091
""" Copyright (c) 2013 Breakaway Consulting Pty. Ltd. 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 without limitation the rights to use, copy, modify, merge, publ...
mit
8,063,784,138,228,915,000
34.528736
116
0.733096
false
LaurentClaessens/phystricks
manual/phystricksIllusionNHwEtp.py
1
1130
# -*- coding: utf8 -*- from phystricks import * def IllusionNHwEtp(): pspict,fig = SinglePicture("IllusionNHwEtp") pspict.dilatation(0.7) perspective=ObliqueProjection(45,sqrt(2)/2) l=2 P=(0,0) cubesP=[] cubesL=[] cubesH=[] profondeur=7 longueur=4 hauteur=4 for i in ran...
gpl-3.0
8,753,371,527,975,603,000
25.209302
73
0.582076
false
Baekalfen/Helmholtz-Coil-Simulator
main_grid_treaded.py
1
7586
# -*- coding: utf-8 -*- ##from multiprocessing import Process ##from multiprocessing import Pool from visual import * from math import * from sys import platform import time ####################################### # # # Author: Mads Ynddal # # All Rights Reserved ...
gpl-2.0
-6,585,143,545,779,053,000
24.27
165
0.513984
false
karlbright/beets
beets/mediafile.py
1
36961
# This file is part of beets. # Copyright 2011, Adrian Sampson. # # 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 # without limitation the rights to use, copy, ...
mit
5,344,825,850,735,038,000
35.850449
79
0.501177
false
anupam2221/isprime
isprime.py
1
1522
##written 9-6-2017 ##by Anupam KP (c) ##anupam2221@yahoo.in ## ## ##preprocessing time- O(n loglogn) ##Tells if a prime number in O(1) dexterprime=[0]*500 def akpprocess(n): n=int(n) global dexterprime dexterprime=[0]*(n+1) dexterprime[0]=dexterprime[1]=1 for i in range(2,n+...
mit
-8,640,602,507,160,039,000
21.382353
141
0.459921
false
ninemoreminutes/lmiapi
lmiapi/central.py
1
7685
# Python import json import logging import re import urllib import urlparse import warnings import webbrowser # Requests import requests # BeautifulSoup4 from bs4 import BeautifulSoup __all__ = ['LogMeInCentralAPI'] logger = logging.getLogger('lmiapi.central') class LogMeInCentralAPI(object): # pragma: no cover ...
bsd-3-clause
6,598,586,298,707,615,000
42.664773
103
0.571893
false
karolciba/playground
ds_algos/heap.py
1
3241
#!/usr/bin/env python def heapsort(ary, strategy = 'up'): swaps = 0 def swap(i,j): nonlocal swaps swaps += 1 ary[i], ary[j] = ary[j], ary[i] lst = len(ary) def siftup(pos): while pos: if ary[pos] < ary[pos//2]: swap(pos,pos//2) ...
unlicense
5,711,739,790,662,060,000
26.235294
118
0.453872
false
3dfxsoftware/cbss-addons
npg_bank_account_reconciliation/npg_bank_account_reconciliation.py
1
21839
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) # Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) # # This program is f...
gpl-2.0
8,555,086,121,285,220,000
66.776398
221
0.593319
false
usingnamespace/pyramid_authsanity
src/pyramid_authsanity/__init__.py
1
2689
from pyramid.settings import asbool, aslist from .interfaces import IAuthSourceService from .policy import AuthServicePolicy from .sources import ( CookieAuthSourceInitializer, HeaderAuthSourceInitializer, SessionAuthSourceInitializer, ) from .util import int_or_none, kw_from_settings default_settings = (...
isc
-1,802,695,428,920,953,300
27.305263
88
0.685757
false
Rickyfox/MLMA2
core/DataHandler.py
1
1770
''' Created on Dec 17, 2014 @author: Dominik Lang ''' import csv import os.path from random import shuffle import collections import numpy from sklearn.preprocessing import Imputer class DataHandler(object): def __init__(self): pass ''' @summary: A method to handle reading the data in from...
gpl-2.0
-6,482,267,368,660,720,000
23.929577
93
0.535028
false
Pikecillo/genna
external/4Suite-XML-1.0.2/test/Xml/XPath/Core/test_nodeset_expr.py
1
2062
#!/usr/bin/env python # # File Name: File Name # # Documentation: http://docs.fourthought.com/file/name.html # def Test(tester): tester.startGroup('Node-set Expressions') tester.startTest('Creating test environment') from Ft.Xml.XPath import ParsedExpr from Ft.Xml.XPath import ParsedPredi...
gpl-2.0
-2,225,689,376,492,209,700
32.258065
98
0.612027
false
mlmurray/TensorFlow-Experimentation
examples/3 - Neural Networks/alexnet.py
1
5087
''' AlexNet implementation example using TensorFlow library. This example is using the MNIST database of handwritten digits (http://yann.lecun.com/exdb/mnist/) AlexNet Paper (http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf) Author: Aymeric Damien Project: https://gi...
mit
1,420,682,160,482,361,900
37.24812
144
0.654806
false
kuasha/cosmos
samples/barebone/views.py
1
3616
import logging import settings from tornado.httpclient import AsyncHTTPClient import cosmos from cosmos.service.auth import BasicLoginHandler __author__ = 'Maruf Maniruzzaman' import tornado from tornado import gen import json from cosmos.service.requesthandler import RequestHandler class IndexHandler(RequestHan...
mit
-672,142,409,614,838,400
38.736264
255
0.630808
false
gurgeh/data-preppy
convert_coords.py
1
2602
import math # Code converted from JS: http://latlong.mellifica.se/ axis = 6378137.0 flattening = 1.0 / 298.257222101 central_meridian = 15.00 lat_of_origin = 0.0 scale = 0.9996 false_northing = 0.0 false_easting = 500000.0 def grid_to_geodetic(x, y): e2 = flattening * (2.0 - flattening) n = flattening / (2...
apache-2.0
-1,727,488,545,422,468,000
39.030769
90
0.529208
false
hecchi777/S3-SlaacSecuritySolution
impacket-0.9.11/examples/lookupsid.py
1
5922
#!/usr/bin/python # Copyright (c) 2012-2014 CORE Security Technologies # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # $Id: lookupsid.py 1101 2014-01-14 22:15:30Z bethus@gmail.com $ # # DCE/RPC lookup s...
apache-2.0
-3,532,217,614,760,333,300
34.461078
178
0.600135
false
emergebtc/muddery
evennia/evennia/utils/ansi.py
1
33100
""" ANSI - Gives colour to text. Use the codes defined in ANSIPARSER in your text to apply colour to text according to the ANSI standard. Examples: This is %crRed text%cn and this is normal again. This is {rRed text{n and this is normal again. Mostly you should not need to call parse_ansi() explicitly; it is run b...
bsd-3-clause
662,295,410,837,981,400
34.100742
105
0.569819
false
botify-labs/simpleflow
simpleflow/swf/process/worker/base.py
1
13859
import json import multiprocessing import os import sys import traceback import uuid from base64 import b64decode import psutil import swf.actors import swf.exceptions from simpleflow import format, logger, settings from simpleflow.dispatch import dynamic_dispatcher from simpleflow.download import download_binaries f...
mit
-7,047,618,636,634,764,000
33.389578
105
0.579696
false
stbuehler/pdns
regression-tests.dnsdist/test_Routing.py
1
12809
#!/usr/bin/env python import threading import time import dns from dnsdisttests import DNSDistTest class TestRoutingPoolRouting(DNSDistTest): _config_template = """ newServer{address="127.0.0.1:%s", pool="real"} addAction(makeRule("poolaction.routing.tests.powerdns.com"), PoolAction("real")) """ ...
gpl-2.0
-1,243,817,809,047,813,000
39.923323
171
0.621516
false
Ichag/openerp-server
openerp/addons/base/res/res_config.py
1
28694
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
6,676,832,647,317,174,000
42.674277
201
0.605736
false
autosportlabs/RaceCapture_App
autosportlabs/racecapture/views/configuration/rcp/configview.py
1
20903
# # Race Capture App # # Copyright (C) 2014-2017 Autosport Labs # # This file is part of the Race Capture App # # This 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 ...
gpl-3.0
3,618,948,812,668,773,000
38.891221
181
0.584318
false
demiangomez/Parallel.GAMIT
com/ScanArchive.py
1
66663
""" Project: Parallel.Archive Date: 02/16/2017 Author: Demian D. Gomez Main routines to load the RINEX files to the database, load station information, run PPP on the archive files and obtain the OTL coefficients usage: pyScanArchive.py [-h] [-rinex] [-otl] [-stninfo [argument [argument ...]]]...
gpl-3.0
-4,145,583,911,079,417,300
43.921833
149
0.54861
false
zibneuro/brainvispy
generators/uniformpointcloud.py
1
2947
import vtk import math import numpy as np from core.settings import Settings class UPoint: def __init__(self, p, dist_to_closest_point): self.p = p self.dist_to_closest_point = dist_to_closest_point def compute_energy(self): diff = self.dist_to_closest_point - Settings.inter_neuron_distance if...
bsd-3-clause
-439,862,372,721,183,300
27.892157
87
0.660333
false
openmicroscopy/omero-marshal
omero_marshal/decode/decoders/screen.py
1
1831
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2015 Glencoe Software, Inc. All rights reserved. # # This software is distributed under the terms described by the LICENCE file # you can find at the root of the distribution bundle. # If the file is missing please request a copy by contacting # jason@glen...
gpl-2.0
1,854,085,798,694,151,400
34.901961
76
0.665756
false
ma1co/Sony-PMCA-RE
pmca/spk/__init__.py
1
2713
"""Methods for reading and writing spk files""" import sys try: from Cryptodome.Cipher import AES from Cryptodome.PublicKey import RSA from Cryptodome.Util.number import bytes_to_long, long_to_bytes except ImportError: from Crypto.Cipher import AES from Crypto.PublicKey import RSA from Crypto.Util.number import...
mit
-9,221,149,133,173,706,000
30.183908
135
0.75341
false
TaskEvolution/Task-Coach-Evolution
taskcoach/taskcoachlib/thirdparty/timeline/timeline.py
1
16578
#! /usr/bin/env python import wx, wx.lib TimeLineSelectionEvent, EVT_TIMELINE_SELECTED = wx.lib.newevent.NewEvent() TimeLineActivationEvent, EVT_TIMELINE_ACTIVATED = wx.lib.newevent.NewEvent() class HotMap(object): ''' Keep track of which node is where. ''' def __init__(self, parent=None): self...
gpl-3.0
2,429,421,412,071,416,000
36.591837
113
0.583002
false
dbmi-pitt/DIKB-Micropublication
scripts/mp-scripts/Bio/EUtils/setup.py
1
1941
import sys from distutils.core import setup try: import EUtils except ImportError: import __init__ as EUtils def _dict(**kwargs): return kwargs d = _dict( name = "EUtils", version = EUtils.__version__, description = "Client interface to NCBI's EUtils/Entrez server", author = "Andrew Dalk...
apache-2.0
-5,385,044,160,901,089,000
30.306452
72
0.659454
false
igabriel85/dmon-adp
adpformater/adpformater.py
1
1615
import pandas as pd class DataFormatter(): def __init__(self, dataloc): self.dataloc = dataloc def aggJsonToCsv(self): return "CSV file" def expTimestamp(self): return "Expand metric timestamp" def window(self): return "Window metrics" def pivot(self): r...
apache-2.0
-417,859,616,309,990,340
24.234375
81
0.636533
false
tdyas/pants
src/python/pants/backend/jvm/register.py
1
12485
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). """Support for both Java and Scala.""" from pants.backend.jvm.artifact import Artifact from pants.backend.jvm.ossrh_publication_metadata import ( Developer, License, OSSRHPubl...
apache-2.0
7,717,258,481,257,488,000
42.961268
100
0.743132
false
simbtrix/screenmix
screenmix/reinforcement/shapeSelection.py
1
5607
''' Created on 13.05.2016 @author: mkennert ''' from kivy.properties import ObjectProperty, StringProperty from kivy.uix.gridlayout import GridLayout from kivy.uix.scrollview import ScrollView from ownComponents.design import Design from ownComponents.ownButton import OwnButton from ownComponents.ownGraph ...
gpl-3.0
2,719,185,217,942,448,000
31.981818
80
0.522918
false
suryakencana/niimanga
niimanga/ctasks/batoto.py
1
34700
""" # Copyright (c) 06 2015 | surya # 26/06/15 nanang.ask@kubuskotak.com # This program 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 2 # of the License, or (at your option) any later ve...
lgpl-3.0
526,765,185,184,004,100
40.656663
107
0.459597
false
hs634/algorithms
python/company/dropbox.py
1
1392
__author__ = 'hs634' class Crawler(Thread): def __init__(self, q, seen, index, lock, wlock, worker_pool_size): self.queue = q self.seen = seen self.index = index self.worker_pool_size = worker_pool_size self.qandslock = lock self.worker_lock = wlock def crawl(se...
mit
-4,294,431,164,889,772,000
28.617021
72
0.563218
false
anandpdoshi/erpnext
erpnext/config/projects.py
2
1504
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("Projects"), "icon": "icon-star", "items": [ { "type": "doctype", "name": "Project", "description": _("Project master."), }, { "type": "doctype", "name": "Task", "des...
agpl-3.0
527,490,406,374,590,660
18.282051
59
0.478059
false
alexbruy/QGIS
python/plugins/processing/algs/qgis/RectanglesOvalsDiamondsVariable.py
1
12223
# -*- coding: utf-8 -*- """ *************************************************************************** RectanglesOvalsDiamondsVariable.py --------------------- Date : April 2016 Copyright : (C) 2016 by Alexander Bruy Email : alexander dot bruy at gmail dot...
gpl-2.0
-3,837,063,368,069,676,000
42.810036
109
0.462161
false
drtuxwang/system-config
bin/fls.py
1
5121
#!/usr/bin/env python3 """ Show full list of files. """ import argparse import glob import os import signal import sys from typing import Iterator, List, Union import file_mod class Options: """ Options class """ def __init__(self) -> None: self._args: argparse.Namespace = None self...
gpl-2.0
926,564,172,749,786,800
25.261538
78
0.486428
false
stelfrich/openmicroscopy
components/tools/OmeroWeb/omeroweb/settings.py
1
40171
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Django settings for OMERO.web project. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Copyright (c) 2008-2014 University of ...
gpl-2.0
-3,240,865,960,607,729,000
36.648547
100
0.617435
false
maxalbert/tohu
tohu/v7/derived_generators/fstr.py
1
1341
import inspect import re from .apply import Apply class fstr(Apply): """ Helper function for easy formatting of tohu generators. Usage example: >>> g1 = Integer(100, 200) >>> g2 = Integer(300, 400) >>> g3 = g1 + g2 >>> h = fstr('{g1} + {g2} = {g3}') >>> print(nex...
mit
-570,471,785,989,569,700
30.186047
101
0.58091
false
jrwdunham/old
onlinelinguisticdatabase/model/form.py
1
8233
# Copyright 2016 Joel Dunham # # 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 writi...
apache-2.0
4,960,836,886,015,914,000
47.429412
120
0.667314
false
adamgilman/ems-costing
tests/tests_postageapp.py
1
1049
from vendors import PostageApp import unittest class TestPostageApp(unittest.TestCase): def setUp(self): self.vendor = PostageApp() def test_ZeroEmails(self): self.assertEqual(self.vendor.getPrice(0), 9) def test_Zero_10000(self): self.assertEqual(self.vendor.getPrice(1), 9) ...
mit
-13,201,100,975,259,146
30.787879
59
0.678742
false
pshahzeb/vsphere-storage-for-docker
esx_service/cli/vmdkops_admin.py
1
58143
#!/usr/bin/env python # Copyright 2016 VMware, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
5,735,922,847,194,726,000
38.232794
147
0.519839
false
jusjusjus/pyedf
pyedf/score/score.py
1
6055
#! /usr/bin/python from __future__ import with_statement import logging from .state import State import numpy as np import os import re class Score(object): logger = logging.getLogger(name='Score') commentSymbol = '#' # used for comments in state.annot lineSeparator = ',' # used as separators i...
gpl-3.0
-4,566,100,443,983,400,000
27.561321
122
0.523369
false
arongdari/sparse-graph-prior
sgp/GraphUtil.py
1
1649
import numpy as np import networkx as nx from collections import defaultdict from scipy.sparse import csr_matrix, csc_matrix, triu def sparse_to_networkx(G): nnz = G.nonzero() _G = nx.Graph() _G.add_edges_from(zip(nnz[0], nnz[1])) return _G def compute_growth_rate(G, n_repeat=10): """ Compute...
mit
3,245,779,639,639,733,000
24.765625
73
0.562159
false
bjodah/aqchem
chempy/tests/test_reactionsystem.py
1
13409
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) from itertools import chain import pytest from ..util.testing import requires from ..util.parsing import parsing_library from ..units import default_units, units_library, allclose from ..chemistry import Substance, Reaction fr...
bsd-2-clause
-8,206,071,984,707,184,000
36.867232
115
0.560686
false
ianmiell/docker-selinux
docker_selinux.py
1
6584
"""ShutIt module. See http://shutit.tk """ from shutit_module import ShutItModule class docker_selinux(ShutItModule): def build(self, shutit): # Some useful API calls for reference see shutit's docs for more info and options: # shutit.send(send) - send a command # shutit.multisend(send,send_dict) - send a co...
mit
6,903,418,176,855,116,000
47.77037
134
0.715674
false
syhpoon/xyzcmd
libxyz/ui/size.py
1
1143
#-*- coding: utf8 -* # # Max E. Kuznecov ~syhpoon <syhpoon@syhpoon.name> 2008 # # This file is part of XYZCommander. # XYZCommander is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by # the Free Software Foundation, either version 3 of the Licens...
gpl-3.0
6,654,877,288,981,513,000
32.617647
70
0.619423
false
Cloudef/mpv
waftools/checks/custom.py
1
4397
from waftools.inflectors import DependencyInflector from waftools.checks.generic import * from waflib import Utils import os __all__ = ["check_pthreads", "check_iconv", "check_lua", "check_oss_4front", "check_cocoa"] pthreads_program = load_fragment('pthreads.c') def check_pthread_flag(ctx, dependency_ide...
gpl-2.0
-9,122,512,931,985,519,000
37.911504
78
0.586764
false
GrognardsFromHell/TemplePlus
tpdatasrc/co8infra/scr/Spell741 - Ice Breath Weapon.py
1
1381
from toee import * def OnBeginSpellCast( spell ): print "Frozen Breath OnBeginSpellCast" print "spell.target_list=", spell.target_list print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level game.particles( "sp-evocation-conjure", spell.caster ) def OnSpellEffect ( spell ): print "Frozen Breat...
mit
3,719,872,777,330,492,000
25.557692
85
0.703838
false
fboers/jumeg
examples/do_MLICA.py
1
5891
""" Compute ICA object based on filtered and downsampled data. Identify ECG and EOG artifacts using MLICA and compare results to correlation & ctps analysis. Apply ICA object to filtered and unfiltered data. Ahmad Hasasneh, Nikolas Kampel, Praveen Sripad, N. Jon Shah, and Juergen Dammers "Deep Learning Approach for A...
bsd-3-clause
3,563,345,213,741,415,000
38.013245
109
0.672382
false
bfaviero/ok
nodisk.py
1
2852
import os import subprocess H_NAME = 'oauth-kerberos-server' H_FOLDER = os.path.join('/cgroup', H_NAME) CGROUP_NAME = 'thegroup' CGROUP_FOLDER = os.path.join(H_FOLDER, CGROUP_NAME) MOUNT_CMD_PATH = '/bin/mount' UMOUNT_CMD_PATH = '/bin/umount' MOUNTPOINT_CMD_PATH = '/bin/mountpoint' def prevent_swapping(): """preve...
mit
-668,880,821,226,423,700
33.780488
84
0.728612
false
explosion/thinc
thinc/tests/layers/test_combinators.py
1
7655
import pytest import numpy from numpy.testing import assert_allclose from thinc.api import clone, concatenate, noop, add, map_list from thinc.api import Linear, Dropout, Model, NumpyOps from thinc.layers import chain, tuplify @pytest.fixture(params=[1, 2, 9]) def nB(request): return request.param @pytest.fixtur...
mit
-2,695,263,527,380,039,000
25.954225
86
0.640366
false
matejv/micropython-weatherstation
weatherstation.py
1
4667
from machine import I2C, Pin, Timer import socket import utime as time import dht from bmp180 import BMP180 # https://github.com/micropython-IMU/micropython-bmp180 from esp8266_i2c_lcd import I2cLcd # https://github.com/dhylands/python_lcd/ import clock, nethelper class WeatherStation: DHTPIN = 14 # DHT data pin ...
mit
5,597,156,197,824,201,000
29.703947
238
0.552603
false
mjirik/teigen
tests/teigen_test.py
1
6709
#! /usr/bin/env python # -*- coding: utf-8 -*- import logging logger = logging.getLogger(__name__) import unittest import sys import pytest # import teigen # import io3d import os.path as op path_to_script = op.dirname(op.abspath(__file__)) class MyTestCase(unittest.TestCase): # @pytest.mark.interactive ...
apache-2.0
-2,060,897,695,279,673,300
28.555066
100
0.471158
false
euri10/pynavitia
setup.py
1
1662
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ 'Click>=6.0', # TODO: put package requirements here ] test_requirem...
mit
7,505,530,210,444,295,000
27.169492
103
0.607702
false
gangeli/NaturalLI
etc/aristo/turk_51_view-turker.py
1
2410
#!/usr/bin/env python # import argparse import sys import os import csv import time import math sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/../../lib/') from naturalli import * """ Parse the command line arguments """ def parseargs(): parser = argparse.ArgumentParser(description= 'Conve...
mit
1,502,954,960,020,800,000
32.943662
106
0.606639
false
google-research/google-research
meta_reward_learning/semantic_parsing/nsm/executor_factory.py
1
35727
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
6,099,865,762,323,094,000
28.550868
78
0.551628
false
Vladimirek/DPexamples
omronDemo/py/www2plc.py
1
1278
from dataplicity.client.task import Task, onsignal from omronTcpFins import OmronPLC class Www2plc(Task): """PLC data writer""" def pre_startup(self): """Called prior to running the project""" # self.conf contains the data- constants from the conf self.livecfg = self.conf.get('valsetco...
mit
1,519,753,353,358,444,300
41.6
99
0.647887
false
deparkes/gds2ecp
seidel.py
1
21210
# # Poly2Tri # Copyright (c) 2009, Mason Green # http://code.google.com/p/poly2tri/ # # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above co...
gpl-2.0
4,282,428,084,180,353,000
32.883387
99
0.550118
false
deepfield/ibis
ibis/sql/postgres/tests/conftest.py
1
1926
# Copyright 2015 Cloudera 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 agreed to in writing, so...
apache-2.0
4,676,097,632,613,212,000
23.379747
74
0.701973
false
nuagenetworks/vspk-python
vspk/v6/nubridgeinterface.py
1
24029
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyrigh...
bsd-3-clause
-6,466,850,096,367,090,000
28.557196
296
0.574556
false
shubhamdhama/zulip
zproject/default_settings.py
1
16423
from typing import TYPE_CHECKING, Any, Dict, List, Optional if TYPE_CHECKING: from django_auth_ldap.config import LDAPSearch from typing_extensions import TypedDict from .config import DEVELOPMENT, PRODUCTION, get_secret if PRODUCTION: from .prod_settings import EXTERNAL_HOST, ZULIP_ADMINISTRATOR else: ...
apache-2.0
-40,528,629,325,406,360
38.383693
98
0.764294
false
cctaylor/googleads-python-lib
examples/adwords/v201409/advanced_operations/add_ad_customizer.py
1
8099
#!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
3,369,931,398,673,007,600
31.266932
80
0.598963
false
ymotongpoo/restroom
0x7d8/RSSReader/mailto.py
1
2150
# -*- coding: utf-8; encoding: utf-8; -*-; """ mailto.py http://labs.unoh.net/2007/06/python_2.html Known issue: - need some change for exceptions """ __author__ = "ymotongpoo <ymotongpoo@gmail.com>" __date__ = "21 Nov. 2008" __credits__ = "0x7d8 -- programming training" __version__ = "$Revision: 0.10" import...
apache-2.0
8,488,926,124,748,680,000
24.879518
78
0.548883
false
dianarg/conlang-util
generator/map/map_gen.py
1
5467
#!/usr/bin/env python # Toy Terrain Generator import sys # import and init pygame import pygame import random pygame.init() class PixelGrid: def __init__(self, size, scale): self.points = [] self.size = size self.scale = scale for i in range(size): self.points.append([...
mit
-2,995,827,563,402,069,000
33.601266
78
0.454545
false
epidataio/epidata-community
ipython/home/tutorials/sensor_data_query.py
1
5017
############################ # Import Required Modules # ############################ import argparse import base64 from datetime import datetime, timedelta import httplib import json import numpy as np from pytz import UTC, timezone import random from decimal import Decimal import struct import time from time import ...
apache-2.0
-476,782,074,515,184,700
27.027933
79
0.623281
false
unt-libraries/coda
coda/coda_mdstore/tests/test_urls.py
1
3321
from django.contrib import sitemaps from django.urls import resolve from django.conf import settings import pytest from coda_mdstore import resourcesync from coda_mdstore import views def test_index(): assert resolve('/').func == views.index def test_all_bags(): assert resolve('/bag/').func == views.all_b...
bsd-3-clause
-167,872,011,518,873,180
25.149606
93
0.705812
false
Donkyhotay/MoonPy
zope/app/publisher/browser/tests/testi18nfileresource.py
1
5545
############################################################################## # # Copyright (c) 2001, 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # T...
gpl-3.0
9,132,939,661,171,410,000
35.480263
80
0.62092
false
irblsensitivity/irblsensitivity
scripts/analysis/MWU_Project_EMSE.py
1
9231
#-*- coding: utf-8 -*- ''' Created on 2017. 02. 12 Updated on 2017. 02. 12 ''' from __future__ import print_function import os import re import matplotlib # Force matplotlib to not use any Xwindows backend. matplotlib.use('Agg') from scipy.stats import mannwhitneyu, pearsonr from ExpBase import ExpBase ...
apache-2.0
352,350,921,425,422,600
36.949367
210
0.611851
false
epam/DLab
infrastructure-provisioning/src/general/lib/aws/meta_lib.py
1
37481
# ***************************************************************************** # # Copyright (c) 2016, EPAM SYSTEMS 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.apac...
apache-2.0
-3,682,319,288,313,856,500
43.567182
176
0.562045
false
icic13/IntroductiontoComputerScienceandProgrammingSpring2011
Problem Set 1: Paying Off Credit Card Debt/Problem Set 1.py
1
1075
#Rana principal = float( raw_input('Enter the outstanding balance on your credit card: ')) print(principal) interest_rate = float( raw_input('Enter the annual credit card interest rate as decimal: ')) print(interest_rate) min_monthly_payment_rate = float( raw_input('Enter the minimal monthly payment rate as...
gpl-3.0
-5,964,504,845,811,852,000
33.677419
73
0.698605
false
minzhang28/docker-py
tests/helpers.py
1
3669
import os import os.path import shutil import tarfile import tempfile import unittest import docker import six BUSYBOX = 'busybox:buildroot-2014.02' EXEC_DRIVER = [] def make_tree(dirs, files): base = tempfile.mkdtemp() for path in dirs: os.makedirs(os.path.join(base, path)) for path in files:...
apache-2.0
4,671,999,088,729,891,000
27.223077
79
0.597165
false
iABC2XYZ/abc
DM_RFGAP/GenPartilces.py
1
3025
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Jul 26 12:23:48 2017 @author: A """ import tensorflow as tf import numpy as np from BetaGammaC import * from RFCal import * from ConstPhysics import * def GenGammaT5Twiss(alphaT2D,betaT2D): gammaT2D=tf.div(1.+tf.square(alphaT2D),betaT2D) retur...
gpl-3.0
-7,566,889,154,862,146,000
27.537736
103
0.715372
false
cjaymes/pyscap
src/scap/model/oval_5/defs/linux/SlackwarePkgInfoObjectElement.py
1
1047
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
gpl-3.0
8,696,438,230,049,820,000
35.103448
95
0.718243
false
fmfn/UnbalancedDataset
examples/under-sampling/plot_illustration_tomek_links.py
2
3180
""" ============================================== Illustration of the definition of a Tomek link ============================================== This example illustrates what is a Tomek link. """ # Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com> # License: MIT # %% print(__doc__) import matplotlib.pyplot as pl...
mit
4,398,294,868,321,620,000
22.555556
79
0.58239
false
aaronr/Quantum-GIS
python/plugins/fTools/tools/doGeoprocessing.py
1
64763
# -*- coding: utf-8 -*- #----------------------------------------------------------- # # fTools # Copyright (C) 2008-2011 Carson Farmer # EMAIL: carson.farmer (at) gmail.com # WEB : http://www.ftools.ca/fTools.html # # A collection of data management and analysis tools for vector data # # Geoprocessing functions adap...
gpl-2.0
1,633,101,598,576,554,200
39.527534
243
0.579498
false
karies/root
bindings/pyroot_experimental/cppyy/cppyy/test/test_regression.py
3
4532
import py, os, sys from pytest import raises from .support import setup_make class TestREGRESSION: helpout = [] def setup_class(cls): import cppyy def stringpager(text, cls=cls): cls.helpout.append(text) import pydoc pydoc.pager = stringpager def test01_kdcr...
lgpl-2.1
-1,271,457,469,860,710,000
32.080292
94
0.586055
false
umayrh/sketchy-polytopes
python/evolvingdag/setup.py
1
5286
from __future__ import print_function from glob import glob from os.path import basename from os.path import splitext import os import sys import pkg_resources import platform from setuptools import setup, find_packages, Command from setuptools.command.install_egg_info import install_egg_info as _install_egg_info fr...
gpl-3.0
7,137,499,483,451,036,000
34.959184
93
0.63356
false
AdaptivePELE/AdaptivePELE
AdaptivePELE/tests/testAtomset.py
1
29178
from __future__ import absolute_import, division, print_function, unicode_literals from io import open import os import unittest import mdtraj import numpy as np import AdaptivePELE.atomset.atomset as atomset from AdaptivePELE.atomset import RMSDCalculator from AdaptivePELE.atomset import SymmetryContactMapEvaluator as...
mit
-7,984,891,120,677,705,000
45.535885
119
0.601995
false
infobloxopen/infoblox-netmri
infoblox_netmri/api/remote/models/device_disk_utilization_remote.py
1
2708
from ..remote import RemoteModel from infoblox_netmri.utils.utils import check_api_availability class DeviceDiskUtilizationRemote(RemoteModel): """ This table list out entries of Device Disk Utilization | ``HRStorageID:`` The internal NetMRI identifier of the high rate storage in the device disk utiliz...
apache-2.0
2,611,947,325,812,914,000
32.02439
128
0.623708
false
hoettges/QKan
qkan/tools/dialogs/__init__.py
1
3551
import logging import os from typing import TYPE_CHECKING, Optional from qgis.PyQt.QtWidgets import QDialog, QFileDialog, QLineEdit, QPushButton, QWidget from qkan.database.dbfunc import DBConnection logger = logging.getLogger("QKan.tools.dialogs") if TYPE_CHECKING: from qkan.plugin import QKanPlugin class QKa...
gpl-3.0
-3,884,028,816,447,008,000
28.823529
85
0.58918
false
Niektory/fifengine
engine/python/fife/extensions/pychan/widgets/widget.py
1
34152
# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public #...
lgpl-2.1
-2,859,392,708,080,170,500
31.279773
154
0.705844
false
marczellm/algorimp
weimar/_parser.py
1
3033
""" A parser for chord progressions in the Weimar Jazzomat CSV format """ import re from itertools import chain from typing import Tuple, Optional from music import ABCNote, ChordType, Chord, ChordProgression, Note _chordtype_mapping = { '': ChordType.maj, '6': ChordType.maj, 'j7': ChordType.maj, '-7'...
gpl-3.0
-8,028,558,581,031,779,000
31.265957
119
0.62974
false
borisroman/vdsm
tests/blockVolumeTests.py
1
2058
# # Copyright 2015 Red Hat, Inc. # # This program 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 2 of the License, or # (at your option) any later version. # # This program is distributed in th...
gpl-2.0
-3,700,532,348,948,171,000
37.111111
79
0.71137
false
dhesse/tree-level-improve
tli.py
1
8135
# -*- coding: utf-8 -*- r""" :mod:`tli` -- Tree level improvement. ========================================= Calculate tree level improvements for lattice QCD observables in the spirit of [1]_. Given an observable :math:`{\mathcal O}(a/L)`, one defines the improved observable .. math:: {\mathcal O}_\mathrm{I}(a/...
mit
-8,904,274,530,981,629,000
37.545024
73
0.554162
false
wickman/compactor
tests/test_protobuf_process.py
1
1546
import threading from compactor.context import Context from compactor.process import ProtobufProcess import pytest try: from google.protobuf import descriptor_pb2 HAS_PROTOBUF = True except ImportError: HAS_PROTOBUF = False import logging logging.basicConfig() # Send from one to another, swap out contexts t...
apache-2.0
-597,719,534,682,987,800
19.891892
79
0.709573
false
HiSPARC/sapphire
scripts/simulations/analyze_shower_front.py
1
5153
import numpy as np import tables from scipy.optimize import curve_fit from scipy.stats import scoreatpercentile from artist import GraphArtist from pylab import * import matplotlib.pyplot as plt import utils USE_TEX = False # For matplotlib plots if USE_TEX: rcParams['font.serif'] = 'Computer Modern' rcPar...
gpl-3.0
-7,899,647,974,331,516,000
27.949438
85
0.59674
false
spottradingllc/zoom
server/zoom/www/handlers/reload_cache_handler.py
1
1371
import logging import tornado.web from httplib import INTERNAL_SERVER_ERROR from zoom.common.decorators import TimeThis class ReloadCacheHandler(tornado.web.RequestHandler): @property def data_store(self): """ :rtype: zoom.www.cache.data_store.DataStore """ return self.applica...
gpl-2.0
8,476,822,656,589,441,000
33.275
84
0.592998
false
vathpela/pytrace
test.py
1
2157
#!/usr/bin/python3 import pdb import sys from module import * def print_it(tp, tl, time, s): print("%s %s.%d: %s" % (time, tp, tl, s)) def print_if_9(tp, tl, time, s): if tl >= 9: print("%s %s.%d: %s" % (time, tp, tl, s)) tl = trace.Logger("debug", 9, print_if_9) loggers = [ {'trace_point':...
gpl-3.0
-5,831,648,403,946,456,000
21.237113
83
0.552619
false