repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
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
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
anjos/popster
popster/qnap.py
1
8677
#!/usr/bin/env python # -*- coding: utf-8 -*- """Utilities to use the QNAP Container Station API See documentation here: http://qnap-dev.github.io/container-station-api/index.html """ import os import sys import pickle import requests import getpass import warnings import contextlib import logging logger = loggin...
gpl-3.0
-3,796,160,623,227,330,000
22.837912
83
0.659329
false
4.143744
false
false
false
ionelmc/virtualenv
virtualenv/_compat.py
1
1342
from __future__ import absolute_import, division, print_function try: FileNotFoundError = FileNotFoundError except NameError: # pragma: no cover FileNotFoundError = OSError # Python 2.6 does not have check_output, so we'll backport this just for # Python 2.6 import subprocess try: from subprocess import...
mit
4,296,613,407,612,718,600
29.5
72
0.5693
false
4.89781
false
false
false
henryscala/plain_sequence_chart
src/canvas.py
1
5513
import array class Canvas: BLANK=' ' HLINE='-' VLINE='|' HLARROW='<' HRARROW='>' VUARROW='^' VDARROW='v' INTERSECT='+' XINTERSECT='*' WAVEVLLINE='(' WAVEVRLINE=')' WAVEHLINE='~' def __init__(self,col,row): self.row=row self.column=col self...
gpl-3.0
2,124,022,629,261,501,000
29.627778
92
0.498821
false
3.591531
false
false
false
fragaria/BorIS
boris/services/migrations/0019_workforclient.py
1
1264
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('services', '0018_delete_pregnancytest'), ] operations = [ migrations.CreateModel( name='WorkForClient', ...
mit
-2,708,543,291,182,270,000
42.586207
169
0.612342
false
3.653179
false
false
false
morgenfree/column-store-tbat-exp-python
prepare/updateData.py
1
5865
''' updateBun bun to update bat_file update_file ''' __author__ = 'fyu' from config import * BUFFERING_SIZE=1048576 #BUFFERING_SIZE=10 def updateBATFast(bat_file_name,update_file_name): bat_file=open(bat_file_name,'r+') update_file=open(update_file_name,'r') for updateLine in update_file: (updateL...
gpl-2.0
-2,389,603,193,760,424,000
35.434783
84
0.637852
false
3.300506
false
false
false
Samsung/ADBI
idk/cachebuilder/sections.py
1
1516
from collections import namedtuple import logging from elftools.elf.constants import SH_FLAGS Section = namedtuple('Section', 'id name type addr offset size flags') class Sections(object): def __init__(self, debuginfo): self.debuginfo = debuginfo def iter_sections(): # omit first sec...
apache-2.0
7,481,293,933,677,235,000
41.138889
121
0.591689
false
4.075269
false
false
false
yinwenpeng/rescale
wenpeng.py
1
1057
#!/usr/bin/env python import time import threading import sys def Traverse(rootDir): fileNo=0 for lists in os.listdir(rootDir): path = os.path.join(rootDir, lists) #print path if os.path.isdir(path): Traverse(path) elif os.path.isfile(path): file =...
gpl-3.0
-4,074,478,246,556,086,300
17.875
66
0.512772
false
3.387821
false
false
false
OpenMOOC/moocng
moocng/media_contents/__init__.py
1
2157
import json from django.conf import settings from . import handlers def media_content_get_iframe_code(handler, content_id, **kwargs): handler = handlers.get_handler(handler) return handler.get_iframe_code(content_id, **kwargs) def media_content_get_thumbnail_url(handler, content_id, **kwargs): handler...
apache-2.0
-2,980,033,750,012,387,300
32.703125
137
0.685211
false
3.637437
false
false
false
SimonBiggs/electronfactors
test/test_poi.py
1
1335
# Copyright (C) 2015 Simon Biggs # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public # License as published by the Free Software Foundation, either # version 3 of the License, or (at your option) any later version. # This program is distributed in...
agpl-3.0
-1,580,463,007,600,693,000
31.560976
66
0.677903
false
3.19378
false
false
false
bletham/fstimer
fstimer/gui/preregister.py
1
5850
#fsTimer - free, open source software for race timing. #Copyright 2012-15 Ben Letham #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 3 of the License, or #(at your option) any later...
gpl-3.0
8,722,225,096,570,457,000
49.008547
197
0.665128
false
3.683879
false
false
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_operations.py
1
4744
# coding=utf-8 # -------------------------------------------------------------------------- # 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 ...
mit
4,323,221,576,189,648,400
42.522936
133
0.640388
false
4.610301
false
false
false
azurer100/monitor
monitor/collector.py
1
7231
#!/usr/bin/env python # encoding: utf-8 ''' monitor.collector -- shortdesc monitor.collector is a description It defines classes_and_methods @author: Yi @copyright: 2016 MY. All rights reserved. ''' import ConfigParser import socket, time, string, logging import MySQLdb from encode import Encode logging.basi...
mit
-5,116,564,051,706,430,000
36.466321
252
0.493016
false
3.488181
true
false
false
tensorflow/probability
tensorflow_probability/python/bijectors/square.py
1
2677
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
9,180,104,289,838,083,000
27.784946
78
0.653343
false
3.7493
false
false
false
recursionbane/tensorflow-prebuilt-classifier
predict.py
1
1260
import sys # Check and fail early! if (len(sys.argv) != 2): print('\nERROR: Must supply the image you want to run prediction on!\n') exit(-1) import tensorflow as tf image_path = sys.argv[1] # Read in the image_data image_data = tf.gfile.FastGFile(image_path, 'rb').read() # Loads label file, strips...
gpl-3.0
7,123,609,686,781,757,000
30.358974
73
0.629365
false
3.36
false
false
false
poeticcapybara/pythalesians
pythalesians-examples/bokeh_examples.py
1
4452
__author__ = 'saeedamen' # # Copyright 2015 Thalesians Ltd. - http//www.thalesians.com / @thalesians # # 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
-1,957,251,320,556,141,600
41.009434
121
0.612534
false
3.795396
false
false
false
johnnykv/heralding
heralding/capabilities/ftp.py
1
3906
# Copyright (C) 2017 Johnny Vestergaard <jkv@unixcluster.dk> # # Rewritten by Aniket Panse <contact@aniketpanse.in> # # 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 3 of the Lice...
gpl-3.0
5,418,834,045,856,934,000
30.248
86
0.658474
false
3.674506
false
false
false
hayalasalah/adhan.py
adhan/adhan.py
1
3946
""" adhan.py - The main interface for using the API. Copyright (C) 2015 Zuhair Parvez This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any...
lgpl-3.0
-2,185,333,171,867,021,300
33.920354
79
0.688039
false
3.733207
false
false
false
kubeflow/kfp-tekton
sdk/python/tests/compiler/testdata/recursion_while.py
1
1971
# Copyright 2020 kubeflow.org # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
2,473,245,731,787,266,600
28.41791
94
0.663115
false
3.47007
false
false
false
omnbmh/pi6x
webapps/weibo/demo.py
1
2953
# -*- coding:utf-8 -*- # #! /usr/bin/env python import time #sys.path.insert(0, 'tweibo.zip') from tweibo import * # 换成你的 APPKEY APP_KEY = "100628862" APP_SECRET = "021e18ea097817f15a819a45c0e5c592" CALLBACK_URL = "http://127.0.0.1:8000" # 请先按照 https://github.com/upbit/tweibo-pysdk/wiki/OAuth2Handler 的鉴权说明填写 ACCESS_...
mit
7,072,474,937,092,337,000
39.042857
206
0.674634
false
2.428943
false
false
false
MicrosoftGenomics/FaST-LMM
fastlmm/util/runner/LocalMultiThread.py
1
2490
''' Runs a distributable job on multiple processors. Returns the value of the job. See SamplePi.py for examples. ''' from fastlmm.util.runner import * import os import logging try: import dill as pickle except: logging.warning("Can't import dill, so won't be able to clusterize lambda expressions. If you try,...
apache-2.0
-3,851,306,007,927,130,000
37.90625
205
0.64739
false
4.081967
false
false
false
riddlezyc/geolab
src/energyforce/metad/calc.py
1
7123
#coding=utf-8 import numpy as np # 通过PBC边界条件计算两个原子之间的最小镜像距离 def dis_pbc(a, b, c, alpha, beta, gamma, t1, t2): cosalpha = np.cos(alpha * np.pi / 180) sinalpha = np.sin(alpha * np.pi / 180) cosbeta = np.cos(beta * np.pi / 180) cosgamma = np.cos(gamma * np.pi / 180) singamma = np.sin(...
gpl-3.0
4,224,248,938,134,856,700
30.00495
99
0.503944
false
1.88704
false
false
false
StochasticNumerics/mimclib
tests/matern/echo_test_cmd.py
1
1481
#!/usr/bin/python import numpy as np import argparse parser = argparse.ArgumentParser(add_help=True) parser.register('type', 'bool', lambda v: v.lower() in ("yes", "true", "t", "1")) parser.add_argument("-db", type="bool", action="store", default=False) parser.add_argument("-qoi_dim", type=int, action=...
gpl-2.0
-6,952,863,911,539,885,000
36.974359
108
0.6158
false
2.381029
false
true
false
UAVCAN/pyuavcan
pyuavcan/transport/_data_specifier.py
1
1424
# Copyright (c) 2019 UAVCAN Consortium # This software is distributed under the terms of the MIT License. # Author: Pavel Kirienko <pavel@uavcan.org> from __future__ import annotations import enum import dataclasses @dataclasses.dataclass(frozen=True) class DataSpecifier: """ The data specifier defines what ...
mit
-7,368,559,777,367,193,000
26.921569
100
0.649579
false
3.797333
false
false
false
adbuerger/PECas
test/test_systems.py
1
3895
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-2015 Adrian Bürger # # This file is part of PECas. # # PECas is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
lgpl-3.0
-6,181,232,457,055,610,000
37.186275
79
0.621983
false
3.125201
true
false
false
EdDev/vdsm
lib/vdsm/storage/mailbox.py
1
33976
# # Copyright 2009-2016 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 ...
gpl-2.0
5,307,111,074,492,991,000
40.688344
79
0.515629
false
4.490022
false
false
false
butala/pyrsss
pyrsss/mag/fgm2iaga.py
1
5144
import sys import logging import os from datetime import datetime from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter import numpy as NP import pandas as PD logger = logging.getLogger('pyrsss.mag.fm2iaga') HEADER_TEMPLATE = """\ Format IAGA-2002 | ...
mit
-107,705,631,235,652,930
35.48227
98
0.437597
false
3.969136
false
false
false
yoneken/train_tf
compressImg2TrainData.py
1
4562
#!/usr/bin/env python # -*- coding:utf-8 -*- ''' Directory structure TRAIN_DIR: label0: img0001.png img0002.png img0003.png label1: img0001.png img0002.png . . . label9: img0001.png ''' import cv2, os, gzip, random import numpy as np from itertools import chain class MakeMn...
apache-2.0
1,497,630,365,127,481,300
31.126761
113
0.629329
false
2.979752
true
false
false
Thylossus/tud-movie-character-insights
Server/Tools/Parser/show_stats.py
1
1183
#!/usr/bin/python3 stats_version="0.11" # Include custom libs import sys sys.path.append( '../../include/python' ) import serverutils.config as config import serverutils.mongohelper as mongohelper import re from pymongo import MongoClient print("Word stats v.", stats_version) print("================================...
apache-2.0
7,304,283,256,309,693,000
26.511628
105
0.668639
false
3.295265
false
false
false
little-dude/pyroute2
pyroute2/ipdb/route.py
1
15960
import logging import threading from socket import AF_UNSPEC from pyroute2.common import basestring from pyroute2.netlink import nlmsg from pyroute2.netlink.rtnl.rtmsg import rtmsg from pyroute2.netlink.rtnl.req import IPRouteRequest from pyroute2.ipdb.transactional import Transactional from pyroute2.ipdb.linkedset imp...
apache-2.0
165,606,072,297,621,380
30.417323
79
0.497368
false
4.125097
false
false
false
mcublocks/embeddecy
Embeddecy-project/docs/embcdocumentation/conf.py
1
10287
# -*- coding: utf-8 -*- # # Язык Embeddecy documentation build configuration file, created by # sphinx-quickstart on Fri Sep 29 10:45:50 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogener...
apache-2.0
-8,252,560,133,260,538,000
28.141593
80
0.669211
false
3.387931
true
false
false
choeminjun/rasberryPI
MailSender/SendMail_ras.py
1
6156
import smtplib, logging, datetime, imaplib import email AUTH_EMAIL_SENDER = 'choeminjun@naver.com' class MailSenderAPP(object): def __init__(self, my_email, my_password): self.myEmail = my_email self.myPassword = my_password self.mailSever = smtplib.SMTP("smtp.gmail.com", 587) # Em...
apache-2.0
941,600,670,764,131,200
39.728477
109
0.559024
false
4.003906
false
false
false
Julian24816/lHelper
__main__.py
1
1440
# coding=utf-8 # # Copyright (C) 2016 Julian Mueller # # 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 3 of the License, or # (at your option) any later version. # # This program ...
gpl-3.0
7,290,843,507,566,273,000
31
95
0.717361
false
3.664122
false
false
false
frank-u/elibrarian
migrations/versions/27c24cd72c1_user_personal_bookshelf.py
1
1307
"""user personal bookshelf Revision ID: 27c24cd72c1 Revises: 4a8674c1b8a Create Date: 2015-04-20 20:46:20.702185 """ # revision identifiers, used by Alembic. revision = '27c24cd72c1' down_revision = '4a8674c1b8a' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alem...
gpl-3.0
5,012,969,641,236,505,000
32.512821
75
0.674063
false
3.334184
false
false
false
nansencenter/DAPPER
dapper/mods/KS/demo.py
1
2208
"""Demonstrate the Kuramoto-Sivashinsky (KS) system.""" # The Kuramoto-Sivashinsky (KS) system: # u_t = -u*u_x - u_xx - u_xxxx, # where x ∈ [0, L], periodic BCs, # is the simplest (?) PDE that admits chaos (requires L>=12?): # # Its numerical solution is best undertaken # with Fourier decomposition for the spat...
mit
7,997,371,697,744,379,000
28.413333
85
0.707616
false
2.850129
false
false
false
projectcuracao/projectcuracao
actions/useCamera.py
1
2300
# Takes a single picture on System # filename: takeSinglePicture.py # Version 1.0 10/31/13 # # takes a picture using the camera # # import sys import time import RPi.GPIO as GPIO import serial #import picamera import subprocess import MySQLdb as mdb sys.path.append('/home/pi/ProjectCuracao/main/hardware') sys.path...
gpl-3.0
-7,709,868,329,935,272,000
22.232323
290
0.706957
false
3.129252
false
false
false
hman523/QuickStocks
QuickStocks.py
1
5274
#Quick Stocks v.2 #Author: Hunter Barbella (aka hman523) #Use: to have a command line interface for checking stocks #This code uses the GPL licence while the API uses the MIT licience #This code is provided AS IS and provides no warrenty #Imports the libraries requests for making the GET request and #JSON fo...
gpl-3.0
71,577,834,545,399,464
31.392405
84
0.502465
false
2.957936
false
false
false
sa2ajj/DistroTracker
pts/mail/tests/tests_mail_news.py
1
5377
# -*- coding: utf-8 -*- # Copyright 2013 The Distro Tracker Developers # See the COPYRIGHT file at the top-level directory of this distribution and # at http://deb.li/DTAuthors # # This file is part of Distro Tracker. It is subject to the license terms # in the LICENSE file found in the top-level directory of this # d...
gpl-2.0
-2,727,537,387,692,635,000
34.609272
92
0.660963
false
3.933431
true
false
false
royharoush/rtools
dnmaps.py
1
25943
#! /usr/bin/env python # # DNmap Server - Edited by Justin Warner (@sixdub). Originally written by Sebastian Garcia # Orginal Copyright and license (included below) applies. # # This is the server code to be used in conjunction with Minions, a collaborative distributed # scanning solution. # # # DNmap Version Modi...
gpl-2.0
8,240,667,989,885,825,000
29.995221
363
0.653394
false
3.108435
false
false
false
versusvoid/ugly-nlp-magic
learning.py
1
1270
#!/usr/bin/env python parts = {} partition_types = {} max_len = 4 import sys filename = 'partitions' if len(sys.argv) > 1: filename = sys.argv[1] α = 1.0 partitions_count = α f = open(filename) for l in f: partition_parts = l.strip().split() for i, part in enumerate(partition_parts): if '_' not...
apache-2.0
-7,207,247,101,435,700,000
24.14
86
0.603023
false
3.273438
false
false
false
projectshift/shift-schema
shiftschema/validators/multichoice.py
1
1718
from shiftschema.validators.abstract_validator import AbstractValidator from shiftschema.result import Error from shiftschema.exceptions import InvalidOption class MultiChoice(AbstractValidator): """ MultiChoice validator Accepts a list of values and checks if every item is a valid choice. """ in...
mit
-8,644,545,313,967,999,000
30.236364
72
0.592549
false
5.038123
false
false
false
hackers-terabit/portage
pym/portage/tests/resolver/ResolverPlayground.py
1
27366
# Copyright 2010-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from itertools import permutations import fnmatch import sys import tempfile import portage from portage import os from portage import shutil from portage.const import (GLOBAL_CONFIG_PATH, PORTAGE_BASE_PATH, USE...
gpl-2.0
1,110,860,997,439,947,800
32.090689
182
0.670906
false
3.034597
true
false
false
awamper/draobpilc
draobpilc/processors/merger.py
1
8353
#!/usr/bin/env python3 # Copyright 2015 Ivan awamper@gmail.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 version. # # Th...
gpl-3.0
-8,984,910,460,628,982,000
33.804167
81
0.611517
false
3.888734
false
false
false
L0st1nC0d3/TextAdventure
room.py
1
2058
import json import sqlite3 from tkinter import * def get_room(i2d, dbname): ret = None con = sqlite3.connect(dbname) for row in con.execute("select description from rooms where id=?", (i2d,)): jsontext = row[0] d = json.loads(jsontext) d['id'] = i2d ret = Room(**d) ...
epl-1.0
-5,393,833,993,856,727,000
20.4375
115
0.535471
false
3.482234
false
false
false
jsfan/requests-oauthlib
requests_oauthlib/oauth2_session.py
1
17215
from __future__ import unicode_literals import logging from oauthlib.common import generate_token, urldecode from oauthlib.oauth2 import WebApplicationClient, InsecureTransportError from oauthlib.oauth2 import TokenExpiredError, is_secure_transport import requests log = logging.getLogger(__name__) class TokenUpdat...
isc
8,882,957,335,126,040,000
44.784574
117
0.60668
false
4.565102
false
false
false
Azure/azure-sdk-for-python
sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/algorithms/rsa_signing.py
1
2339
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import padding, utils from ..algorithm import SignatureAlgorithm from ....
mit
355,841,851,340,012,100
30.186667
114
0.719111
false
3.637636
false
false
false
Esri/ops-server-config
Publish/Portal/UpdatePortalGUIDs.py
1
8962
#!/usr/bin/env python #------------------------------------------------------------------------------ # Copyright 2015 Esri # 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
-1,482,835,201,219,073,800
36.814346
159
0.535706
false
4.312801
false
false
false
ooici/coi-services
ion/processes/bootstrap/plugins/bootstrap_ingestion.py
1
1318
#!/usr/bin/env python from ion.core.bootstrap_process import BootstrapPlugin from pyon.public import Container from interface.objects import IngestionQueue from interface.services.dm.iingestion_management_service import IngestionManagementServiceProcessClient class BootstrapIngestion(BootstrapPlugin): """ Bo...
bsd-2-clause
-4,062,449,384,635,165,700
37.764706
115
0.69044
false
4.030581
false
false
false
ngr/fe_sm_00
fe_sm_00/settings.py
1
2959
""" Django settings for fe_sm_00 project. Generated by 'django-admin startproject' using Django 1.8.1. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pat...
mit
-7,847,905,305,224,313,000
25.9
71
0.669483
false
3.335964
false
false
false
arximboldi/pigeoncide
src/game/pigeon.py
1
13252
# # Copyright (C) 2009 Juan Pedro Bolivar Puente, Alberto Villegas Erce # # This file is part of Pigeoncide. # # Pigeoncide 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 # Lic...
gpl-3.0
-5,173,898,428,870,489,000
29.394495
80
0.561425
false
3.388392
false
false
false
turon/openthread
tools/harness-automation/cases/router_8_2_5.py
1
1878
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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 # notic...
bsd-3-clause
-986,593,235,084,160,300
39.826087
77
0.761448
false
4.418824
false
false
false
DataDog/integrations-extras
aws_pricing/datadog_checks/aws_pricing/aws_pricing.py
1
4071
import json from collections import defaultdict import boto3 from botocore.exceptions import ClientError from six import iteritems from six.moves import filter, map from datadog_checks.base import AgentCheck from datadog_checks.base.errors import CheckException class AwsPricingCheck(AgentCheck): def check(self,...
bsd-3-clause
5,405,679,731,763,715,000
36.009091
116
0.647998
false
4.00689
false
false
false
nicfit/vexmpp
vexmpp/protocols/disco.py
1
4899
# -*- coding: utf-8 -*- from .. import stream from ..jid import Jid from ..stanzas import Iq, ElementWrapper from ..errors import XmppError from ..utils import xpathFilter """XEP 30""" from .. import getLogger log = getLogger(__name__) NS_URI_BASE = "http://jabber.org/protocol/disco" NS_URI_INFO = "{}#info".format(N...
mit
4,763,337,293,667,032,000
30.606452
80
0.551949
false
3.664174
false
false
false
wavefrontHQ/python-client
wavefront_api_client/models/response_container_monitored_service_dto.py
1
4497
# coding: utf-8 """ Wavefront REST API <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ...
apache-2.0
1,715,293,696,044,203,000
30.669014
409
0.599956
false
4.33237
false
false
false
hiryou/MLPractice
neural_net/by_numpy.py
1
3555
from builtins import classmethod import numpy as np from datetime import datetime as dt """ Inspired by https://repl.it/repls/OrganicVainDoom#main.py """ class NeuralNet(object): train_cnt = 0 epoch = 0 eta = 0.5 # TODO make constructor-only param h_layers = [3] X = None Y = None X...
mit
7,135,865,273,220,866,000
26.55814
96
0.536428
false
3.11296
false
false
false
lgarren/spack
var/spack/repos/builtin/packages/r-simpleaffy/package.py
1
2156
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
4,242,531,252,514,886,000
46.911111
96
0.668831
false
3.749565
false
false
false
fedebell/Laboratorio3
relazione6/calcoli.py
1
1559
import uncertainties from uncertainties import ufloat import math import numpy import numpy import pylab from scipy.optimize import curve_fit import math import scipy.stats import uncertainties from uncertainties import unumpy Vmeno = ufloat(-15.00, 15.00*0.005) Vpiu = ufloat(14.99, 14.99*0.005) R1 = ufloat(2.18, 2.1...
gpl-3.0
1,469,787,664,021,489,200
20.356164
55
0.630532
false
2.003856
false
true
false
emc-openstack/storops
storops_test/vnx/resource/test_mirror_view.py
1
23552
# coding=utf-8 # Copyright (c) 2015 EMC Corporation. # 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 # #...
apache-2.0
2,035,904,516,088,921,300
34.047619
79
0.619268
false
3.126925
true
false
false
crawfordsm/zSALT
zsalt/extract.py
1
5452
#!/usr/bin/env python # Copyright (c) 2009, South African Astronomical Observatory (SAAO) # # All rights reserved. See LICENSE file for more detail. # """ SPECEXTRACT extracts a 1-D spectrum from a 2-D data file. Author Version Date ----------------------------------------...
bsd-3-clause
6,011,496,125,247,817
26.26
79
0.570983
false
3.656606
false
false
false
atkvo/masters-bot
src/autobot/src/pidControl.py
1
1392
#!/usr/bin/env python import rospy from autobot.msg import drive_param from autobot.msg import pid_input from std_msgs.msg import String import math kp = 14.0 * 3 kd = 0.09 * 10 ## handling how fast servo_offset = 18.5 prev_error = 0.0 vel_input = 0.0 mode = 'wall' motorPub = rospy.Publisher('drive_parameters', dr...
mit
-3,342,215,794,730,230,300
19.776119
74
0.617816
false
3.532995
false
false
false
Telestream/telestream-cloud-python-sdk
telestream_cloud_qc_sdk/telestream_cloud_qc/models/hdr_standard_type.py
1
2817
# coding: utf-8 """ Qc API Qc API # noqa: E501 The version of the OpenAPI document: 3.0.0 Contact: cloudsupport@telestream.net Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from telestream_cloud_qc.configuration import Configuration class...
mit
5,876,936,412,095,734,000
26.617647
74
0.556621
false
4.053237
true
false
false
ppyordanov/HCI_4_Future_Cities
Server/src/virtualenv/Lib/site-packages/setuptools/command/install_egg_info.py
1
3830
from setuptools import Command from setuptools.archive_util import unpack_archive from distutils import log, dir_util import os, pkg_resources class install_egg_info(Command): """Install an .egg-info directory for the package""" description = "Install an .egg-info directory for the package" user_options...
mit
105,027,369,872,871,100
35.47619
81
0.518799
false
3.920164
false
false
false
wysiwyng/sr13
configReader.py
1
4083
# Copyright (C) 2105 wysiwyng # # 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 3 of the License, or # (at your option) any later version. # # This program is d...
gpl-3.0
-65,932,045,673,835,944
35.783784
80
0.582905
false
3.652057
true
false
false
nefarioustim/parker
test/test_crawlpage.py
1
2207
# -*- coding: utf-8 -*- """Test the CrawlPage object.""" import pytest from parker import parser, crawlpage, parsedpage from test_client import client_fixture_crawl, client_fixture from test_page import page_fixture_crawl, page_fixture import utils TEST_URI = "http://www.staples.co.uk/" TEST_CONSUME_SELECTOR = "#Page...
gpl-3.0
-7,499,028,635,234,379,000
31.940299
76
0.7227
false
3.349014
true
false
false
panjia1983/channel_backward
exp/test.py
1
2770
import argparse parser = argparse.ArgumentParser() parser.add_argument("--interactive", action="store_true") args = parser.parse_args() import openravepy import trajoptpy import json env = openravepy.Environment() env.StopSimulation() env.Load('test.xml') trajoptpy.SetInteractive(args.interactive) # pause every itera...
bsd-2-clause
5,083,429,379,926,947,000
22.87931
129
0.513718
false
2.864529
false
false
false
cdeil/naima
examples/CrabNebula_proton.py
1
2205
#!/usr/bin/env python import numpy as np import naima from astropy import units as u from astropy.io import ascii ## Read data data=ascii.read('CrabNebula_HESS_2006.dat') ## Set initial parameters p0=np.array((474,2.34,np.log10(80.),)) labels=['norm','index','log10(cutoff)'] ## Model definition ph_energy = u.Qua...
bsd-3-clause
-4,077,216,500,975,527,400
26.222222
83
0.696599
false
3.008186
false
false
false
wiredfool/fmod
fmod/controllers/moderate.py
1
2153
import logging from pylons import request, response, session, url, tmpl_context as c from pylons.controllers.util import abort, redirect from fmod.lib.base import BaseController, render from fmod import model log = logging.getLogger(__name__) class ModerateController(BaseController): requires_auth=True def __b...
gpl-2.0
-7,267,325,370,894,829,000
20.747475
69
0.645611
false
2.78886
false
false
false
schleichdi2/OpenNfr_E2_Gui-6.0
lib/python/Screens/InputBox.py
1
5801
from enigma import eRCInput, getPrevAsciiCode from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Screens.VirtualKeyBoard import VirtualKeyBoard from Components.ActionMap import NumberActionMap from Components.Label import Label from Components.Input import Input from Components.Pixmap impo...
gpl-2.0
7,238,666,065,602,169,000
27.576355
161
0.693156
false
3.085638
false
false
false
praekelt/molo
molo/core/backends.py
1
2724
from django.contrib.auth.models import Group from django_cas_ng.backends import CASBackend from django.contrib.auth import get_user_model from django.contrib.auth.backends import ModelBackend from django.core.exceptions import PermissionDenied from molo.profiles.models import UserProfile UserModel = get_user_model() ...
bsd-2-clause
-3,061,280,361,301,114,400
36.315068
78
0.585536
false
4.762238
false
false
false
lem9/weblate
weblate/gitexport/views.py
1
5514
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2017 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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, eith...
gpl-3.0
-5,599,721,127,871,912,000
29.114754
79
0.640537
false
4.112687
false
false
false
mahandra/recipes_video_conv
local_scripts/ipaddreslogfilenginx.py
1
2172
#!/usr/bin/env python #-*- coding: utf-8 -*- __author__ = 'mah' __email__ = 'andrew.makhotin@gmail.com' import os import logging.handlers import re log = logging.getLogger('Logging for check_sound') log.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') handler = loggin...
gpl-2.0
5,657,711,219,305,236,000
19.884615
104
0.546961
false
2.510983
false
false
false
ulikoehler/ODBPy
ODBPy/DrillTools.py
1
2203
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Read the structured text ODB++ drill tools file """ import gzip from collections import namedtuple, defaultdict import os.path from enum import Enum from .Utils import readFileLines from .StructuredTextParser import read_structured_text from .Structures import HolePla...
apache-2.0
-3,222,016,735,727,269,400
32.892308
97
0.660463
false
3.21137
false
false
false
bdcht/crysp
crysp/mode.py
1
7354
# -*- coding: utf-8 -*- # This code is part of crysp # Copyright (C) 2013 Axel Tillequin (bdcht3@gmail.com) # published under GPLv2 license from crysp.padding import nopadding,pkcs7 from io import BytesIO from crysp.bits import pack, unpack, Bits # -------------------------------------------------------------------...
gpl-2.0
8,923,609,616,704,921,000
29.263374
79
0.483682
false
3.580331
false
false
false
OpenMined/PySyft
packages/syft/tests/syft/core/pointer/pointer_test.py
1
6660
# stdlib from io import StringIO import sys from typing import Any from typing import List # third party import pytest import torch as th # syft absolute import syft as sy from syft.core.node.common.client import AbstractNodeClient from syft.core.pointer.pointer import Pointer def validate_output(data: Any, data_pt...
apache-2.0
7,374,268,223,427,589,000
27.583691
87
0.644745
false
3.290514
true
false
false
mikeshardmind/SinbadCogs
scheduler/converters.py
1
4607
from __future__ import annotations import argparse import dataclasses from datetime import datetime, timedelta, timezone from typing import NamedTuple, Optional, Tuple from redbot.core.commands import BadArgument, Context from .time_utils import parse_time, parse_timedelta class NonNumeric(NamedTuple): parsed:...
mit
-8,876,680,537,058,773,000
32.384058
88
0.573692
false
4.442623
false
false
false
luoxsbupt/ibus
ui/gtk/languagebar.py
1
8475
# vim:set et sts=4 sw=4: # # ibus - The Input Bus # # Copyright(c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of t...
lgpl-2.1
1,944,587,740,358,431,500
31.224335
121
0.56649
false
3.712221
false
false
false
DaveBuckingham/robosoft
record_mode.py
1
8314
""" Provides functions for 1) recording outputs to file 2) replaying outputs from files """ import global_data import mctransmitter import datetime import os import errno import time import threading import ui_display playback_file_tag = None save_filename_prefix = 'botwurst_command_record_' default_save_dir...
mit
2,830,740,662,388,459,500
28.799283
116
0.636998
false
3.540886
false
false
false
Kumapapa2012/Learning-Machine-Learning
Reversi/agent_lrelu_0_1.py
1
15736
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import copy import numpy as np np.random.seed(0) import chainer import chainer.functions as F import chainer.links as L from chainer import cuda from chainer import optimizers from rlglue.agent.Agent import...
mit
504,017,417,974,920,600
30.820388
94
0.513312
false
2.568281
false
false
false
openforis/sepal
modules/google-earth-engine/docker/src/sepalinternal/mosaic/cloud_score.py
1
1357
import ee # Based on scripts by Ian Hausman, which in turn is based on script by Matt Hancher # https://groups.google.com/d/msg/google-earth-engine-developers/i63DS-Dg8Sg/_hgCBEYeBwAJ def cloud_score(image): def rescale(image, exp, thresholds): return image.expression(exp, {'i': image}) \ .sub...
mit
2,958,949,883,621,575,000
38.911765
89
0.66986
false
2.89339
false
false
false
pyrocko/pyrocko
src/model/event.py
1
14506
# http://pyrocko.org - GPLv3 # # The Pyrocko Developers, 21st Century # ---|P------/S----------~Lg---------- from __future__ import absolute_import, division import logging import numpy as num import hashlib import base64 from pyrocko import util, moment_tensor from pyrocko.guts import Float, String, Timestamp, Unic...
gpl-3.0
7,530,054,320,324,479,000
29.033126
79
0.52268
false
3.679858
false
false
false
mikebryant/rapid-router
game/views/api.py
1
9289
# -*- coding: utf-8 -*- # Code for Life # # Copyright (C) 2015, Ocado Innovation Limited # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your o...
agpl-3.0
7,866,183,302,795,193,000
33.722846
122
0.715349
false
3.850083
false
false
false
magfest/ubersystem
uber/models/mits.py
1
11679
import os from functools import wraps from PIL import Image from residue import CoerceUTF8 as UnicodeText, UTCDateTime, UUID from sqlalchemy import and_ from sideboard.lib import on_startup from sqlalchemy.schema import ForeignKey from sqlalchemy.types import Boolean, Integer from sqlalchemy.ext.hybrid import hybrid_p...
agpl-3.0
212,782,243,609,174,400
32.950581
120
0.662557
false
3.831693
false
false
false
nuagenetworks/tempest
tempest/api/compute/servers/test_virtual_interfaces.py
1
2373
# Copyright 2013 OpenStack Foundation # 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 requ...
apache-2.0
5,632,622,960,499,097,000
37.901639
78
0.677202
false
4.155867
true
false
false
dunkhong/grr
grr/server/grr_response_server/gui/api_plugins/timeline.py
1
2641
#!/usr/bin/env python """A module with API handlers related to the timeline colllection.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from typing import Optional from typing import Text from grr_response_core.lib.rdfvalues import structs as rdf_str...
apache-2.0
8,599,119,469,534,929,000
32.858974
106
0.728891
false
3.603001
false
false
false
barct/odoo-coop
ersep_regulations/__openerp__.py
1
1907
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Fernando Hidalgo (http://www.hidalgofernando.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
gpl-3.0
8,221,518,737,955,704,000
30.75
94
0.579528
false
3.706226
false
false
false
arsenalstriker14/imagetraccloud
imagetrac_docker/taskmanager/migrations/0002_auto_20170122_1808.py
1
3274
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-01-22 18:08 from __future__ import unicode_literals import django.core.files.storage from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('taskmanager', '0001_initial'), ] operations = [ ...
mit
2,795,914,541,022,039,600
48.606061
183
0.63989
false
4.330688
false
false
false
dbrattli/python-gearshift
gearshift/visit/api.py
1
10475
import logging try: from hashlib import sha1 except ImportError: from sha import sha as sha1 import threading import time from random import random from datetime import timedelta, datetime import cherrypy from cherrypy import request from gearshift import config from gearshift.util import load_class from gearshift...
mit
-8,914,088,577,078,914,000
36.27758
82
0.599427
false
4.3107
true
false
false
elebihan/python-ptraceplus
ptraceplus/tracer.py
1
5688
# -*- coding: utf-8 -*- # # python-ptraceplus - Ptrace bindings + extra stuff # # Copyright (c) 2013 Eric Le Bihan <eric.le.bihan.dev@free.fr> # # 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, e...
gpl-3.0
987,896,519,618,176,600
30.776536
77
0.581927
false
4.109827
false
false
false
videntity/tweatwell
apps/twitbot/views.py
1
2939
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 from django.conf import settings from django.http import HttpResponse, Http404,HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from django.contrib.auth.models import User from ..acc...
gpl-2.0
316,786,970,059,591,800
41
79
0.532494
false
4.042641
false
false
false
gwax/nikola
tests/test_rst_compiler.py
1
8674
# coding: utf8 # Author: Rodrigo Bistolfi # Date: 03/2013 """ Test cases for Nikola ReST extensions. A base class ReSTExtensionTestCase provides the tests basic behaviour. Subclasses must override the "sample" class attribute with the ReST markup. The sample will be rendered as HTML using publish_parts() by setUp(). ...
mit
2,583,950,506,363,282,000
34.117409
79
0.588771
false
4.043823
true
false
false
czcorpus/kontext
lib/plugins/abstract/user_items.py
1
4225
# Copyright (c) 2015 Charles University in Prague, Faculty of Arts, # Institute of the Czech National Corpus # Copyright (c) 2015 Tomas Machalek <tomas.machalek@gmail.com> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License #...
gpl-2.0
8,109,087,419,113,496,000
29.178571
93
0.645917
false
3.982092
false
false
false
goodwillcoding/trac-subtickettypes
subtickettypes/web_ui.py
1
9663
# # Copyright 2009, Niels Sascha Reedijk <niels.reedijk@gmail.com> # All rights reserved. Distributed under the terms of the MIT License. # # debug from pprint import pprint from pkg_resources import resource_filename from genshi import HTML from genshi.builder import tag from genshi.filters.transform import Tra...
bsd-3-clause
-1,324,141,922,772,074,800
45.456731
150
0.526338
false
4.729809
false
false
false
corpnewt/CorpBot.py
Cogs/Telephone.py
1
22909
import asyncio, discord, re, os, random from discord.ext import commands from collections import OrderedDict from Cogs import Utils, DisplayName, Nullify, FuzzySearch, PickList, Message def setup(bot): # Add the bot and deps settings = bot.get_cog("Settings") bot.add_cog(Telephone(bot, settings)) class T...
mit
4,624,505,264,969,987,000
33.462848
153
0.659173
false
3.266648
false
false
false
TissueMAPS/TmLibrary
tmlib/workflow/metaextract/args.py
1
1432
# TmLibrary - TissueMAPS library for distibuted image analysis routines. # Copyright (C) 2016 Markus D. Herrmann, University of Zurich and Robin Hafen # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Softwa...
agpl-3.0
-114,338,109,586,010,220
41.117647
78
0.776536
false
4.011204
false
false
false
hammerhorn/hammerhorn-jive
hr/hr.py
1
2017
#!/usr/bin/env python """ Produces horizontal lines for use in shell scripts. usage: hr.py [-h] [-w WIDTH] [-p PATTERN] [-c] optional arguments: -h, --help show this help message and exit -w WIDTH, --width WIDTH -p PATTERN, --pattern PATTERN -c, --center * floats should give screenwidths, ints sho...
gpl-2.0
8,735,727,038,346,566,000
27.408451
79
0.625682
false
3.395623
false
false
false
rwl/puddle
puddle/python_editor/python_editor_extension.py
1
3510
#------------------------------------------------------------------------------ # Copyright (C) 2009 Richard W. Lincoln # # 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 restrictio...
mit
-6,106,553,099,906,862,000
38.438202
79
0.575783
false
5.072254
false
false
false
marcoprado17/flask-bone
src/r.py
1
4665
# !/usr/bin/env python # -*- coding: utf-8 -*- # ====================================================================================================================== # The MIT License (MIT) # ====================================================================================================================== # Copyr...
mit
4,281,181,409,038,982,000
38.760684
210
0.468186
false
4.105914
false
false
false
coala-analyzer/coala-gui
source/workspace/WorkspaceWindow.py
1
5608
from gi.repository import Gtk import os from collections import OrderedDict from coalib.settings.ConfigurationGathering import load_configuration from coalib.output.ConfWriter import ConfWriter from coalib.output.printers.LogPrinter import LogPrinter from pyprint.NullPrinter import NullPrinter from coalib.settings.Sect...
agpl-3.0
-2,998,170,187,900,760,000
42.8125
78
0.605742
false
3.974486
false
false
false
jamesaud/se1-group4
jmatcher/posts/migrations/0001_initial.py
1
1897
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-26 16:11 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
mit
-4,786,760,844,580,201,000
43.116279
129
0.605166
false
4.178414
false
false
false
hyunjunbrucelee/2017sejongAI
hash/test.py
1
1327
from PIL import Image import numpy as np # 이미지 데이터를 Averages Hash로 변환 함수 선언 def average_hash(fname, size = 16): #average_hash(파일이름, 사이즈) img = Image.open(fname) # 이미지 데이터 열기 img = img.convert('L') # 그레이스케일로 변환 #'1'지정하게 되면 이진화 그밖에 "RGB", "RGBA", "CMYAK" 모드 지정가능 i...
gpl-3.0
-888,860,325,065,370,600
27.083333
80
0.539637
false
1.628305
false
false
false
stellaf/odoofleet
fleet_task_issue/fleet_task_issue.py
1
7626
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addon by CLEARCORP S.A. <http://clearcorp.co.cr> and AURIUM TECHNOLOGIES <http://auriumtechnologies.com> # # # This program is free software: you can redistr...
gpl-3.0
-4,983,628,240,611,340,000
44.664671
152
0.590873
false
3.425876
false
false
false