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
OpenToAllCTF/OTA-Challenge-Bot
server/consolethread.py
1
1960
import threading from bottypes.invalid_console_command import InvalidConsoleCommand from util.loghandler import log class ConsoleThread(threading.Thread): def __init__(self, botserver): self.botserver = botserver threading.Thread.__init__(self) def update_config(self, option, value): ...
mit
-3,119,133,389,237,143,600
31.131148
88
0.512245
false
Thomasvdw/ProgProject
Data/PVdata/add_sum_capacity_perdate.py
1
4323
# -*- coding: utf-8 -*- """ Created on Wed May 27 20:06:01 2015 @author: Thomas """ # Python standard library imports import csv import os def main(): sizes = [] for file in os.listdir("reformatted/"): print file size_total = [] size_2000 = [] size_2001 = [] ...
mit
-6,894,113,067,600,910,000
31.757576
81
0.417303
false
argvk/lastfmloved-syncer
update_banshee.py
1
1928
import sqlite3 import sys import requests import xml.dom.minidom from os import path con = None artists = {} url_params = {} total_pages = -1 page_no = 0 user_name = sys.argv[1] banshee_db = path.expanduser("~/.config/banshee-1/banshee.db") con = sqlite3.connect(banshee_db) cur = con.cursor() while True: if tot...
mit
-6,483,506,008,347,363,000
25.777778
146
0.598029
false
googleads/googleads-python-lib
examples/adwords/adwords_appengine_demo/views/add_campaign_view.py
1
2373
#!/usr/bin/env 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 requir...
apache-2.0
375,887,224,737,519,740
35.507692
78
0.664981
false
xfaxca/pymlkit
pymlkit/models/regressors.py
1
4199
""" Module for custom regression model classes. """ from sklearn.base import BaseEstimator, RegressorMixin """ Rolling todo: 1. For AvgReg: Modify how parameters are used. Put them all into a dict. Also change X_train, y_train to just X,y """ class AveragingRegressor(BaseEstimator, RegressorMixin): """ S...
gpl-3.0
-5,591,416,426,703,481,000
43.680851
119
0.634675
false
AlexeyKruglov/Skeinforge-fabmetheus
skeinforge_application/skeinforge_plugins/craft_plugins/multiply.py
1
12265
""" This page is in the table of contents. The multiply plugin will take a single object and create an array of objects. It is used when you want to print single object multiple times in a single pass. You can also position any object using this plugin by setting the center X and center Y to the desired coordinates (...
agpl-3.0
3,508,609,802,829,658,000
41.884615
368
0.76967
false
QQuick/Transcrypt
transcrypt/development/automated_tests/transcrypt/module_itertools/__init__.py
1
2899
from itertools import * from math import pow def fibonacci(): a, b = 0, 1 for i in range (10): yield a a, b = b, a + b squares = [i * i for i in range (10)] chars = 'thequickbrownfoxjumpsoverthelazydog' def run (autoTester): autoTester.check ('islice count', list (i...
apache-2.0
6,306,938,173,265,230,000
40.043478
128
0.563643
false
talha81/TACTIC-DEV
src/tactic/ui/table/sobject_detail_wdg.py
1
4954
########################################################### # # Copyright (c) 2005-2008, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written ...
epl-1.0
6,152,893,046,757,104,000
26.21978
75
0.525838
false
JungeAlexander/cocoscore
setup.py
1
2522
#!/usr/bin/env python # -*- encoding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function import io import re from glob import glob from os.path import basename from os.path import dirname from os.path import join from os.path import splitext from setuptools import find_packages fro...
mit
-8,443,466,161,578,863,000
32.626667
96
0.599524
false
MikhailMS/Final_Project
music_generation_module/output_to_input.py
1
1066
# Import packages import theano, theano.tensor as T import numpy as np # Import modules from model_data import noteStateSingleToInputForm # Main class class OutputFormToInputFormOp(theano.Op): # Properties attribute __props__ = () def make_node(self, state, time): state = T.as_tensor_variable(sta...
bsd-2-clause
1,084,220,755,746,954,400
34.533333
104
0.660413
false
Ophiuchus1312/enigma2-master
lib/python/Components/RcModel.py
1
6258
from enigma import getBoxType from Tools.StbHardware import getFPVersion import os class RcModel: RCTYPE_DMM = 0 RCTYPE_DMM1 = 1 RCTYPE_DMM2 = 2 RCTYPE_E3HD = 3 RCTYPE_EBOX5000 = 4 RCTYPE_ET4X00 = 5 RCTYPE_ET6X00 = 6 RCTYPE_ET6500 = 7 RCTYPE_ET9X00 = 8 RCTYPE_ET9500 = 9 RCTYPE_GB = 10 RCTYPE_INI0 = 11 ...
gpl-2.0
3,291,528,724,807,571,000
35.383721
93
0.683605
false
jfly/libtnoodle
tools/c_to_emscripten.py
1
3643
#!/usr/bin/env python2 import json import argparse import collections import clang.cindex from clang.cindex import TypeKind from clang.cindex import CursorKind Function = collections.namedtuple('Function', ['name', 'returnType', 'argumentTypes']) Constant = collections.namedtuple('Constant', ['name', 'value']) def g...
gpl-3.0
-3,406,530,499,207,695,000
36.556701
120
0.591545
false
adw0rd/lettuce-py3
tests/unit/test_step_parsing.py
1
9558
# -*- coding: utf-8 -*- # <Lettuce - Behaviour Driven Development for python> # Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.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 Foundatio...
gpl-3.0
-52,612,899,343,069,830
31.617747
111
0.665062
false
eyeseast/django-scrivo
scrivo/tests/views.py
1
3316
import datetime import os from django.conf import settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse from scrivo.models import Post from scrivo.settings import DEFAULT_PAGINATE_BY, INDEX_POST_COUNT from scrivo.tests.base import BlogPostTest, f class PostViewTest(BlogPos...
mit
-8,118,935,701,026,106,000
32.846939
88
0.587455
false
theonlydude/RandomMetroidSolver
rando/ItemLocContainer.py
1
10007
import copy, utils.log from logic.smbool import SMBool, smboolFalse from logic.smboolmanager import SMBoolManager from collections import Counter class ItemLocation(object): __slots__ = ( 'Item', 'Location', 'Accessible' ) def __init__(self, Item=None, Location=None, accessible=True): self.Item = It...
gpl-3.0
7,744,803,922,275,245,000
39.350806
218
0.662137
false
brainwane/zulip
zerver/views/submessage.py
2
1118
import orjson from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from zerver.decorator import REQ, has_request_variables from zerver.lib.actions import do_add_submessage from zerver.lib.message import access_message from zerver.lib.response import json_error, json_succ...
apache-2.0
5,286,719,226,919,771,000
31.882353
68
0.657424
false
ox-it/moxie
moxie/places/importers/osm.py
1
8808
# -*- coding: utf-8 -*- import logging from xml.sax import handler from moxie.places.importers.helpers import prepare_document, format_uk_telephone logger = logging.getLogger(__name__) DEFAULT_SHOP = '/amenities/shop' SHOPS = {'supermarket': '/amenities/supermarket', 'department_store': '/amenities/superm...
apache-2.0
-8,723,120,305,712,997,000
40.352113
126
0.518506
false
PaddlePaddle/Paddle
python/paddle/fluid/tests/unittests/collective_concat_op.py
1
2231
# Copyright (c) 2018 PaddlePaddle Authors. 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 appli...
apache-2.0
6,634,149,092,769,652,000
31.333333
74
0.655312
false
NaohiroTamura/ironic
ironic/objects/volume_target.py
1
11250
# Copyright (c) 2016 Hitachi, Ltd. # # 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
-4,377,000,555,161,214,000
46.669492
79
0.647289
false
hhucn/netsec-uebungssystem
netsecus/student.py
1
5593
from __future__ import unicode_literals from . import helper from . import grading import collections Student = collections.namedtuple('Student', ['id']) NamedStudent = collections.namedtuple('Student', ['student', 'aliases']) FullStudent = collections.namedtuple('FullStudent', ['student', 'aliases', 'submissions', ...
mit
-2,899,860,098,836,917,000
32.291667
114
0.587878
false
tkhirianov/fox_python_2016
lesson_2/task4-11.py
1
1501
#-*- coding: utf-8 -* import robot r = robot.rmap() r.loadmap('task4-11') def task(): pass #------- пишите код здесь ----- r.right() r.down() for line in range(13): for step in range(line+1): r.paint('red') r.right() for step in range(line+1): r.le...
gpl-3.0
-297,250,836,235,349,950
23.617021
79
0.617978
false
bitmovin/bitmovin-python
bitmovin/resources/models/encodings/encoding.py
1
4786
from bitmovin.errors import InvalidTypeError from bitmovin.resources.enums import CloudRegion, EncoderVersion from bitmovin.utils import Serializable from bitmovin.resources.models import AbstractModel from bitmovin.resources import AbstractNameDescriptionResource from .infrastructure import Infrastructure class Enc...
unlicense
-330,824,083,189,929,000
36.685039
118
0.639365
false
thobbs/cassandra-dtest
upgrade_tests/cql_tests.py
1
233827
# coding: utf-8 import itertools import math import random import struct import time from collections import OrderedDict from distutils.version import LooseVersion from unittest import skipUnless from uuid import UUID, uuid4 from cassandra import ConsistencyLevel, InvalidRequest from cassandra.concurrent import execu...
apache-2.0
-267,808,268,547,125,220
43.327393
192
0.525782
false
kubeflow/kfserving
python/kfserving/test/test_v1alpha2_inference_service_status.py
1
1542
# 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
-3,261,820,674,305,163,000
27.555556
115
0.732815
false
fullphat/redsquare
rs_pcd8544.py
1
1295
# RedSqaure # pcd8544.device handler # LCD matrix used in the original Nokia 3310 phones # Copyright (c) 2017 full phat products # import threading import sos #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # init: # def init(): global lcd try: import pcd8544lib as lcd ...
mit
-4,017,047,913,291,437,600
20.327586
73
0.562934
false
leppa/home-assistant
homeassistant/components/ring/light.py
1
2991
"""This component provides HA switch support for Ring Door Bell/Chimes.""" from datetime import timedelta import logging from homeassistant.components.light import Light from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect import homeassistant.util.dt as dt_util...
apache-2.0
2,940,559,475,843,706,400
29.212121
86
0.640923
false
shaz13/oppia
core/domain/email_manager.py
1
36969
# coding: utf-8 # # Copyright 2014 The Oppia Authors. 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 requi...
apache-2.0
-7,266,375,526,076,710,000
38.245223
80
0.651221
false
bospetersen/h2o-3
h2o-py/tests/testdir_algos/rf/pyunit_NOPASS_error_checkpointRF.py
1
2494
import sys, shutil sys.path.insert(1, "../../../") import h2o, tests def cars_checkpoint(ip,port): cars = h2o.upload_file(h2o.locate("smalldata/junit/cars_20mpg.csv")) predictors = ["displacement","power","weight","acceleration","year"] response_col = "economy" # build first model model1 = h2o.ra...
apache-2.0
-1,062,366,960,171,115,100
37.369231
121
0.677626
false
cmallwitz/Sunflower
application/plugins/find_file_extensions/size.py
1
2603
from gi.repository import Gtk from plugin_base.find_extension import FindExtension class SizeFindFiles(FindExtension): """Size extension for find files tool""" def __init__(self, parent): FindExtension.__init__(self, parent) # create container table = Gtk.Table(2, 4, False) table.set_border_width(5) ta...
gpl-3.0
2,342,140,416,426,739,700
36.724638
109
0.698425
false
andrei-milea/unbiased
web/backend/urls.py
1
1264
"""backend URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-ba...
gpl-3.0
2,791,782,861,359,301,000
42.586207
79
0.689082
false
emory-libraries/eulcore-history
src/eulcore/django/existdb/tests.py
1
7136
# file django/existdb/tests.py # # Copyright 2010 Emory University General Library # # 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/LI...
apache-2.0
-6,928,753,692,045,739,000
40.987952
116
0.663817
false
gwu-libraries/launchpad
lp/ui/management/commands/make_sitemap.py
1
2292
import gzip import os from django.conf import settings from django.core.management.base import BaseCommand from django.db import connections def _newfile(counter): """Generate a new sitemap filename based on count.""" name = '%s/sitemap-%s.xml.gz' % (settings.SITEMAPS_DIR, counter) fp = gzip.open...
mit
98,821,271,441,966,880
33.208955
73
0.538394
false
sedthh/lara-hungarian-nlp
examples/example_stemmer_1.py
1
1290
# -*- coding: UTF-8 -*- import os.path, sys sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)) from lara import stemmer, nlp ''' Stemmer and n-gram example ''' if __name__ == "__main__": text = ''' A szövegbányászat a strukturálatlan vagy kis mértékben strukturált szöveges á...
mit
5,285,931,688,268,105,000
30.410256
91
0.753469
false
nurnbeck/project-2-CMPUT-291
ret_KEY.py
1
1724
import os import time import bsddb3 as bsddb ''' Retrieve records with a given key - Modified and simplified based on the old version - Has the same format and assumption as ret_DATA() Tested under DB_SIZE = 10 ''' DB_FILE = "/tmp/yishuo_db/sample_db" SDB_FILE = "/tmp/yishuo_db/IndexFile" def ret_KEY(filetype): ...
mit
-4,234,728,709,192,996,000
25.9375
61
0.567285
false
mediaProduct2017/learn_NeuralNet
neural_network_design.py
1
1568
""" In order to decide how many hidden nodes the hidden layer should have, split up the data set into training and testing data and create networks with various hidden node counts (5, 10, 15, ... 45), testing the performance for each. The best-performing node count is used in the actual system. If multiple counts perf...
mit
-321,968,127,457,154,200
35.488372
91
0.691327
false
lundjordan/build-relengapi
relengapi/lib/auth/auth_types/constant.py
1
1235
# 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 logging from flask import redirect from flask import request from flask import url_for from flask.ext.login impo...
mpl-2.0
6,418,216,420,925,535,000
29.875
69
0.677733
false
rjkunde/TempHumiditySensorProject
THSP/THSP_Functions.py
1
5164
import sys import Adafruit_DHT import datetime import sqlite3 import os import glob import ConfigParser import logging # import time # Global variable global errorState errorState = None # Specify AM203 sensor on Raspberry Pi GPIO pin #4 (physical pin 7) # Detecting Pi version / beaglebone is handled by Adafruit DH...
mit
561,578,974,637,201,000
36.955882
130
0.705347
false
biemond/biemond-orawls
files/wlst/utils.py
1
7556
def create_boot_properties_file(directory_path, file_name, username, password): server_dir = File(directory_path) server_dir.mkdirs() full_file_name = directory_path + '/' + file_name file_new = open(full_file_name, 'w') file_new.write('username=%s\n' % username) file_new.write('password=%s\n'...
apache-2.0
6,416,536,408,274,387,000
32.286344
134
0.674034
false
LukasRychtecky/django-chamber
chamber/migrations/fixtures.py
1
1343
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os from six.moves import cStringIO from django.core.management import call_command from django.core.serializers import base, python class MigrationLoadFixture(object): def __init__(self, migration_file, fixture_dir=None, fixture_filename=N...
lgpl-3.0
-2,368,341,324,001,750,500
37.371429
116
0.633656
false
golsun/GPS
src/ck/def_cheminp.py
1
2124
from def_build_mech_dict import * import os import shutil def rename_sp(sp_list): sp_list_new = [] for s in sp_list: sp_list_new.append(s.replace("(","-").replace(")","-").replace(",","-")) return sp_list_new def skeletal(detailed_folder, sk_folder, species_kept, notes=None): if not os.path.exists(sk_folder...
mit
-1,599,475,815,948,921,600
19.833333
97
0.586158
false
nash-x/hws
neutron/plugins/ryu/agent/ryu_neutron_agent.py
1
10548
#!/usr/bin/env python # Copyright 2012 Isaku Yamahata <yamahata at private email ne jp> # Based on openvswitch agent. # # Copyright 2011 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 ma...
apache-2.0
-8,270,942,207,239,643,000
32.807692
78
0.597459
false
t1g0r/ramey
src/backend/libs/telepot/async/__init__.py
1
18967
import io import json import time import asyncio import aiohttp import traceback import re from requests.utils import guess_filename from concurrent.futures._base import CancelledError import collections import telepot import telepot.async.helper from ..exception import BadFlavor, BadHTTPResponse, TelegramError def f...
gpl-3.0
9,221,394,431,815,405,000
38.597077
166
0.510782
false
ibis-project/ibis
ibis/backends/impala/tests/test_parquet_ddl.py
1
2838
from posixpath import join as pjoin import pytest import ibis from ibis.backends.impala.compat import HS2Error from ibis.tests.util import assert_equal pytestmark = pytest.mark.impala def test_cleanup_tmp_table_on_gc(con, test_data_dir): import gc hdfs_path = pjoin(test_data_dir, 'parquet/tpch_region') ...
apache-2.0
6,085,975,110,491,497,000
24.339286
78
0.610641
false
speed-of-light/pyslider
summ.py
1
9220
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> rks = [ "lib.exp.summ.storage", "lib.exp.summ"] reload_mods(rks) from lib.exp.summ import Mary mm = Mary() import warnings warnings.filterwarnings('ignore') # <codecell> #dc = mm.df_classify_perf(key="coverages_9") #saf = mm.df_rec_ans() if False...
agpl-3.0
5,366,314,327,825,016,000
28.456869
123
0.62039
false
rogerthat-platform/rogerthat-backend
src/mcfw/exceptions.py
1
2422
# -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
3,057,799,384,206,349,300
30.051282
79
0.691164
false
benschmaus/catapult
telemetry/telemetry/internal/results/page_test_results.py
1
15233
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import copy import datetime import json import logging import os import random import sys import tempfile import time import traceback fr...
bsd-3-clause
-8,185,234,777,242,549,000
33.002232
80
0.683582
false
ingadhoc/odoo-infrastructure
infrastructure/models/mailserver.py
1
1038
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import models, fields class mailser...
agpl-3.0
4,729,004,514,452,739,000
31.4375
79
0.526012
false
noskill/virt-manager
tests/storage.py
1
8815
# Copyright (C) 2013 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 ...
gpl-2.0
-4,441,029,140,978,103,300
33.980159
78
0.59705
false
jilljenn/tryalgo
tryalgo/subsetsum_divide.py
1
2217
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """\ Subsetsum by splitting christoph dürr et jill-jênn vie - 2014-2019 """ # snip{ def part_sum(x_table, i=0): """All subsetsums from x_table[i:] :param x_table: table of values :param int i: index_table defining suffix_table of x_table to be considered ...
mit
-4,340,037,461,299,297,300
27.766234
79
0.575169
false
plum-umd/java-sketch
jskparser/ast/body/variabledeclarator.py
1
1508
#!/usr/bin/env python from . import _import from ..node import Node class VariableDeclarator(Node): def __init__(self, kwargs={}): if kwargs.get(u'id', ''): super(VariableDeclarator, self).__init__(kwargs) locs = _import() # VariableDeclaratorId self._id =...
mit
4,094,312,163,630,533,000
25.928571
77
0.56565
false
dims/cinder
cinder/wsgi/wsgi.py
1
1253
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # di...
apache-2.0
-1,775,838,742,110,290,000
26.844444
77
0.73344
false
lithiumoxide/scical
astronomy.py
1
1465
# astronomy.py 12.10.3 from math import * G = 6.673e-11 c = 2.998e8 H = 80 # km/s/Mpc v = 0 relg = 1/(sqrt(1-((v/c)**2))) def gforce(m1, m2, r): ''' (int, int, int) -> int Calculates gravitational force between masses m1 and m2 (kg) at a separation of r (m). ''' global G return str((G*m1*m2)/(r**2)) + ' N' ...
gpl-3.0
8,261,305,374,650,977,000
20.246377
87
0.632765
false
bcicen/multicrane
multicrane/crane.py
1
1817
#!/usr/bin/env python import os, yaml, urllib2, logging, termcolor from sh import crane from util import randomcolor log = logging.getLogger() class CraneConfig(object): def __init__(self, cranefile): """ CraneConfig object """ self.txtcolor = randomcolor() self.cranefile...
mit
-8,861,030,407,317,800,000
30.877193
82
0.5377
false
alexbrasetvik/Piped
contrib/zookeeper/piped_zookeeper/providers.py
1
20750
# Copyright (c) 2011, Found IT A/S and Piped Project Contributors. # See LICENSE for details. import base64 import logging import hashlib import itertools import operator import zookeeper from zope import interface from twisted.application import service from twisted.python import failure from twisted.internet import ...
mit
-1,015,271,551,627,500,200
40.009881
183
0.588337
false
metno/EVA
eva/rest/resources.py
1
6034
import eva import eva.globe import eva.job import eva.rest.resources import productstatus.exceptions import datetime import falcon class BaseResource(eva.globe.GlobalMixin): def set_eventloop_instance(self, eventloop): self.eventloop = eventloop def set_response_message(self, req, message): ...
gpl-2.0
-3,894,519,288,155,339,000
34.916667
172
0.642029
false
leshchevds/ganeti
test/py/testutils_ssh.py
1
28653
#!/usr/bin/python # # Copyright (C) 2010, 2013, 2015 Google Inc. # 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, # ...
bsd-2-clause
3,561,939,545,193,350,700
36.55308
80
0.679789
false
sharad/calibre
src/calibre/gui2/preferences/columns.py
1
7594
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import copy, sys from PyQt5.Qt import Qt, QListWidgetItem, QIcon from calibre.gui2.preferences import ConfigWidgetBase, t...
gpl-3.0
-8,445,431,245,419,286,000
41.188889
85
0.59231
false
michaupl/materialsapp
forms/migrations/0003_set_type_on_subcategory.py
1
5162
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # Note: Don't use "from appname.models imp...
apache-2.0
-372,990,805,550,099,100
65.179487
194
0.560248
false
USGSDenverPychron/pychron
pychron/experiment/image_browser.py
1
9889
# =============================================================================== # Copyright 2012 Jake Ross # # 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/licens...
apache-2.0
-8,116,230,646,335,603,000
34.067376
94
0.494388
false
bioinformatics-IBCH/logloss-beraf
logloss_beraf/model_ops/trainer.py
1
12714
# coding=utf-8 import copy import logging import os # https://github.com/matplotlib/matplotlib/issues/3466/#issuecomment-195899517 import itertools import matplotlib matplotlib.use('agg') import numpy as np import pandas from sklearn import ( preprocessing, model_selection, ) from sklearn.cross_validation imp...
gpl-3.0
-4,018,092,607,383,729,000
40.279221
125
0.632059
false
arximboldi/pigeoncide
src/phys/geom.py
1
1351
# # 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
-6,525,842,370,010,480,000
34.552632
72
0.720207
false
BevoLJ/KRPC
Lagadha/Lunar_XFer_Manager.py
1
6215
import numpy as np import time # from numba import jit from Orbit_Manager import OrbitManager class LunarXFerManager(OrbitManager): def __init__(self): super().__init__() self.mode = "LEO" self.earth = self.KSC.bodies['Earth'] self.moon = self.KSC.bodies['Moon'].orbit # ...
mit
5,158,009,346,149,246,000
40.165563
111
0.595977
false
michaelsmit/openparliament
parliament/hansards/models.py
1
21145
#coding: utf-8 import gzip, os, re from collections import defaultdict import datetime from django.db import models from django.conf import settings from django.core import urlresolvers from django.core.files.base import ContentFile from django.template.defaultfilters import slugify from django.utils.datastructures i...
agpl-3.0
-9,099,643,264,234,737,000
38.2282
126
0.572172
false
softelnet/sponge
sponge-midi/examples/midi/midi_generate_sound.py
1
1294
""" Sponge Knowledge Base MIDI generate sound """ from javax.sound.midi import ShortMessage from org.openksavi.sponge.midi import MidiUtils class SameSound(Trigger): def onConfigure(self): self.withEvent("midiShort") def onRun(self, event): midi.sound(event.message) class Log(Trigger): de...
apache-2.0
622,128,467,475,287,600
35.971429
148
0.687017
false
quattor/aquilon
tests/broker/test_add_required_service.py
1
16213
#!/usr/bin/env python # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance...
apache-2.0
-5,464,155,785,499,907,000
44.414566
110
0.571085
false
vpelletier/neoppod
neo/scripts/simple.py
1
2244
#!/usr/bin/env python # # Copyright (C) 2011-2016 Nexedi SA # # 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 ...
gpl-2.0
-6,943,767,685,848,343,000
37.033898
78
0.655526
false
dwong/Tag-Music-Organizer
TagMusicOrganizer.py
1
6734
# TagMusicOrganizer.py # # Parse id3 tags for mp3 # Put into target directory with the format # # Artist/ # Album/ # NN. Artist - Title import sys import os import eyed3 import glob import argparse import re import configparser config = configparser.ConfigParser() config.readfp(open(os.path.dirname(os.path.real...
gpl-3.0
4,940,710,828,399,783,000
35.597826
114
0.539353
false
google/timesketch
api_client/python/timesketch_api_client/searchtemplate.py
1
8044
# Copyright 2021 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
374,413,808,863,143,740
34.59292
78
0.587892
false
CuonDeveloper/cuon
cuon_server/src/cuon/Finances.py
1
14964
import random import xmlrpclib from twisted.web import xmlrpc from basics import basics import Database class Finances(xmlrpc.XMLRPC, basics): def __init__(self): basics.__init__(self) self.oDatabase = Database.Database() self.debugFinances = 1 def getCashAccountBook(se...
gpl-3.0
4,789,738,053,648,609,000
41.754286
145
0.559276
false
MapsPy/MapsPy
maps_monitor.py
1
10537
''' Created on Jun 6, 2013 @author: Mirna Lerotic, 2nd Look Consulting http://www.2ndlookconsulting.com/ Copyright (c) 2013, Stefan Vogt, Argonne National Laboratory All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the ...
bsd-2-clause
696,451,433,837,313,400
35.102113
105
0.61564
false
mhielscher/simplebot
irclib.py
1
48749
# Copyright (C) 1999--2002 Joel Rosdahl # # 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.1 of the License, or (at your option) any later version. # # This library is ...
lgpl-2.1
875,220,853,920,328,000
30.22934
105
0.564401
false
googleapis/googleapis-gen
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/mobile_device_constant_service/client.py
1
18151
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
3,857,676,658,100,900,000
44.039702
156
0.635337
false
agateau/qyok
queries.py
1
5142
# -*- coding: UTF-8 -*- from datetime import datetime from operator import attrgetter from PyQt4.QtCore import QCoreApplication from sqlobject import AND, OR, LIKE, IN from sqlobject.sqlbuilder import Select import yaml from yokadi.db import Task, Project def formatDate(date): """ strftime may return a str...
gpl-3.0
-5,127,149,142,014,772,000
28.210227
116
0.576347
false
Djabx/mgd
mgdpck/mgd_main.py
1
8718
#! /usr/bin/python # -*- coding: utf-8 -*- import os import sys import argparse import logging import operator import itertools import webbrowser from mgdpck import logging_util # init logger first logging_util.init_logger() logging_util.add_except_name('run_script') logger = logging.getLogger(__name__) logger.addHan...
apache-2.0
-7,672,336,189,648,278,000
28.958763
126
0.652099
false
textbook/atmdb
atmdb/utils.py
1
4517
"""Utilities for working with TMDb models.""" async def overlapping_movies(people, client=None): """Find movies that the same people have been in. Arguments: people (:py:class:`collections.abc.Sequence`): The :py:class:`~.Person` objects to find overlapping movies for. client (:py:class:`...
isc
4,149,155,471,548,165,600
34.566929
80
0.654195
false
thomasgibson/tabula-rasa
verification/LDGH/LDGH.py
1
14704
""" This module runs a convergence history for a hybridized-DG discretization of a model elliptic problem (detailed in the main function). The method used is the LDG-H method. """ from firedrake import * from firedrake.petsc import PETSc from firedrake import COMM_WORLD import numpy as np import pandas as pd def run...
mit
-8,417,494,125,532,612,000
35.486352
85
0.582087
false
birkelbach/python-canfix
tests/utils.py
1
2198
# Copyright (c) 2018 Phil Birkelbach # # 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 distrib...
gpl-2.0
7,644,066,902,139,672,000
37.561404
77
0.660146
false
landscapeio/prospector
prospector2/formatters/text.py
1
3108
from prospector2.formatters.base import Formatter __all__ = ( 'TextFormatter', ) # pylint: disable=unnecessary-lambda class TextFormatter(Formatter): summary_labels = ( ('started', 'Started'), ('completed', 'Finished'), ('time_taken', 'Time Taken', lambda x: '%s seconds' % x), ...
gpl-2.0
6,796,904,696,348,735,000
27.254545
96
0.47973
false
google-research/episodic-curiosity
third_party/baselines/common/misc_util.py
1
7608
# coding=utf-8 import gym import numpy as np import os import pickle import random import tempfile import zipfile def zipsame(*seqs): L = len(seqs[0]) assert all(len(seq) == L for seq in seqs[1:]) return zip(*seqs) def unpack(seq, sizes): """ Unpack 'seq' into a sequence of lists, with lengths s...
apache-2.0
-6,773,599,826,624,659,000
28.374517
110
0.59674
false
molly24Huang/Cents_trip
Recommendation/attr_food_distance.py
1
2978
import pandas as pd from math import sin, cos, sqrt, asin, radians #import ibm_db def cal_dist(lon1, lat1, lon2, lat2): lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2]) dlon = lon2 - lon1 dlat = lat2 - lat1 a = sin(dlat / 2) ** 2 + cos(lat1) * cos(lat2) * sin(dlon / 2) ** 2 c = 2 * a...
apache-2.0
2,555,478,355,868,660,000
33.627907
140
0.611148
false
mjhennig/dyn-python
dyn/tm/services/httpredirect.py
1
5031
# -*- coding: utf-8 -*- """This module contains API Wrapper implementations of the HTTP Redirect service """ import logging from ..session import DynectSession from ...compat import force_unicode __author__ = 'xorg' __all__ = ['HTTPRedirect'] class HTTPRedirect(object): """HTTPRedirect is a service which sets u...
bsd-3-clause
8,570,874,800,027,544,000
33.909722
112
0.560971
false
emvarun/followup-and-location
Sky_Patch.py
1
4646
#!/usr/bin/python import os, re import numpy as np import healpy as hp import astropy.units as u from astropy.coordinates import SkyCoord, EarthLocation, AltAz, get_sun from astropy.time import Time from astropy.io import fits import ephem from ephem import * from params import Observatory_Locations def Patch(fitsfile...
gpl-3.0
6,250,973,748,818,928,000
38.372881
141
0.71201
false
mozilla/socorro
webapp-django/crashstats/crashstats/tests/test_bugassociations.py
1
4928
# 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 io import requests_mock import pytest from django.core.management import call_command from crashstats.crashsta...
mpl-2.0
2,033,320,415,098,187,800
32.986207
97
0.576096
false
all-out/lightswitch
lightswitch/main/migrations/0002_auto__del_members__del_ships__add_ship__add_member.py
1
3070
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'Members' db.delete_table(u'main_members') # De...
mit
-8,889,125,126,581,968,000
38.371795
88
0.558306
false
dparks1134/STAMP
stamp/plugins/samples/plots/configGUI/multCompCorrectionUI.py
1
12647
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'multCompCorrection.ui' # # Created: Sat Apr 16 13:41:52 2011 # by: PyQt4 UI code generator 4.6.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_MultCompCorrectionDialog(object): d...
gpl-3.0
-3,321,368,441,627,692,500
63.19797
172
0.740887
false
rh-s/heat
heat/engine/resources/openstack/manila/security_service.py
1
3666
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
-3,208,775,644,978,497,000
32.027027
79
0.589198
false
CalthorpeAnalytics/urbanfootprint
footprint/main/publishing/behavior_publishing.py
1
5246
# UrbanFootprint v1.5 # Copyright (C) 2017 Calthorpe Analytics # # This file is part of UrbanFootprint version 1.5 # # UrbanFootprint is distributed under the terms of the GNU General # Public License version 3, as published by the Free Software Foundation. This # code is distributed WITHOUT ANY WARRANTY, without impl...
gpl-3.0
878,548,601,841,246,200
41.650407
150
0.685475
false
benletchford/stratego.io
gae/tests/FIXTURES.py
1
2396
import json import copy SETUP = [ [ {'rank': '1', 'side': 3}, {'rank': '2', 'side': 3}, {'rank': '3', 'side': 3}, {'rank': '3', 'side': 3}, {'rank': '4', 'side': 3}, {'rank': '4', 'side': 3}, {'rank': '4', 'side': 3}, {'rank': '5', 'side': 3}, ...
mit
1,294,217,295,813,873,200
17.151515
39
0.344741
false
42cs/book
modules/luther/sphinx/assess/assessbase.py
1
2756
# Copyright (C) 2011 Bradley N. Miller # # 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 distribute...
mit
-2,434,039,718,979,837,000
28.010526
87
0.590711
false
dfalk/mezzanine-wiki
mezzanine_wiki/fields.py
1
1385
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import models from django.utils.translation import ugettext_lazy as _ from mezzanine.utils.importing import import_dotted_path class WikiTextField(models.TextField): """ TextField that stores markup text. ...
bsd-2-clause
4,441,378,388,650,258,400
34.512821
78
0.638267
false
gdw2/zim
zim/formats/plain.py
1
4786
# -*- coding: utf-8 -*- # Copyright 2008 Jaap Karssenberg <jaap.karssenberg@gmail.com> '''This module handles parsing and dumping input in plain text''' import re import zim.parser from zim.parser import prepare_text, Rule from zim.formats import * from zim.parsing import url_re info = { 'name': 'plain', 'desc...
gpl-2.0
-5,482,015,731,721,429,000
24.322751
102
0.649812
false
mswart/pyopenmensa
setup.py
1
2029
from setuptools import setup # Always prefer setuptools over distutils from codecs import open # To use a consistent encoding from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_de...
lgpl-3.0
7,562,236,628,138,542,000
31.725806
83
0.644653
false
richard-shepherd/monopyly
AIs/Stephen Chan/big_brick.py
1
20396
from monopyly import * import random class BigBrickAI(PlayerAIBase): mClassDebug = True def __init__(self): self.p("__init__") self.turn_count = 0 self.chance_cards_count=0 self.community_chest_cards_count=0 self.property_mortgage_cards_count=0 self.auction_spr...
mit
-4,966,430,030,353,533,000
33.268908
114
0.605836
false
proyan/sot-torque-control
python/dynamic_graph/sot/torque_control/identification/identify_motor_acc.py
1
2771
# -*- coding: utf-8 -*- """ Created on Tue Sep 12 18:47:50 2017 @author: adelpret """ from scipy import signal import numpy as np from scipy import ndimage import matplotlib.pyplot as plt from identification_utils import solve1stOrderLeastSquare def identify_motor_acc(dt, dq, ddq, current, tau, Kt_p, Kv_p, ZERO_VELO...
gpl-3.0
-7,318,730,382,067,557,000
39.173913
102
0.591483
false
hhursev/recipe-scraper
tests/test_cookpad.py
1
2502
from recipe_scrapers.cookpad import CookPad from tests import ScraperTest class TestCookPadScraper(ScraperTest): scraper_class = CookPad def test_host(self): self.assertEqual("cookpad.com", self.harvester_class.host()) def test_canonical_url(self): self.assertEqual( "https:/...
mit
6,020,997,628,664,400,000
33.188679
299
0.577815
false
wildamerica/outdoors
docs/conf.py
1
7761
# -*- coding: utf-8 -*- # # outdoors documentation build configuration file, created by # sphinx-quickstart. # # 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 # autogenerated file. # # All configuration values have ...
bsd-3-clause
-6,389,051,760,853,029,000
30.677551
80
0.695787
false
voutilad/courtlistener
cl/simple_pages/tests.py
1
7663
# coding=utf-8 import datetime import os from django.conf import settings from django.core import mail from django.core.urlresolvers import reverse from django.http import HttpRequest from django.test import TestCase, RequestFactory from django.test.utils import override_settings from lxml.html import fromstring from...
agpl-3.0
-8,376,602,982,255,714,000
36.534314
90
0.588612
false
hydroshare/hydroshare_temp
hs_party/forms/person.py
1
3624
__author__ = 'valentin' #from mezzanine.forms.models import Form from django.forms import ModelForm, Textarea from django import forms from django.forms.models import inlineformset_factory,modelformset_factory,BaseModelFormSet from ..models.organization import Organization from ..models.person import Person,PersonLoca...
bsd-3-clause
-8,476,676,534,957,222,000
31.079646
97
0.648179
false
ivanfilippov/PowerDNS-Admin
create_db.py
1
2745
#!/usr/bin/env python from migrate.versioning import api from config import SQLALCHEMY_DATABASE_URI from config import SQLALCHEMY_MIGRATE_REPO from app import db from app.models import Role, Setting import os.path import time import sys def start(): wait_time = get_waittime_from_env() if not connect_db(wait_...
mit
6,372,247,686,023,421,000
27.894737
115
0.647359
false
HenriWahl/Nagstamon
Nagstamon/thirdparty/Xlib/keysymdef/__init__.py
1
1130
# Xlib.keysymdef -- X keysym defs # # Copyright (C) 2001 Peter Liljenberg <petli@ctrl-c.liu.se> # # 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 ...
gpl-2.0
-8,388,814,028,989,734,000
27.974359
84
0.648673
false