repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
zhsso/ubunto-one
src/server/integtests/test_capabilities.py
6
6423
# -*- coding: utf-8 -*- # Copyright 2008-2015 Canonical # # 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. # # Th...
agpl-3.0
7,105,596,276,067,651,000
35.494318
79
0.641912
false
4.220105
true
false
false
MediaKraken/MediaKraken_Deployment
source/database/db_base_metadata_thesportsdb.py
1
2446
""" Copyright (C) 2015 Quinn D Granfor <spootdev@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful...
gpl-3.0
4,486,608,820,093,549,600
36.825397
91
0.562551
false
3.964344
false
false
false
cleemesser/pyo
pyolib/phasevoc.py
5
64602
""" Phase vocoder. The phase vocoder is a digital signal processing technique of potentially great musical significance. It can be used to perform very high fidelity time scaling, pitch transposition, and myriad other modifications of sounds. """ """ Copyright 2009-2015 Olivier Belanger This file is part of pyo, a ...
gpl-3.0
-1,806,312,679,241,642,000
28.757255
161
0.571855
false
3.549365
false
false
false
allison-group/indigo-bondorder
archive/src/indigox/periodictable.py
1
12545
from indigox.exception import IndigoSearchError class _Element(object): def __init__(self, name, symbol, group, period, number, mass, atomic_radii, covalent_radii, vdw_radii, chi, hyper=None): self.name = name self.symbol = symbol self.group = group self.period = pe...
mit
-6,510,224,344,621,918,000
64.680628
94
0.430052
false
2.270177
false
false
false
naorlivne/dshp
dshp.py
1
2761
#!/usr/bin/python2.7 import socket, sys, json, os, subprocess, datetime, time from thread import * # function that sets config variables with the following priority chain # envvar > config file > default value def read_config(conf_var): try: conf_value = os.environ[conf_var.upper()] if conf_var ==...
apache-2.0
-7,716,142,935,125,726,000
29.351648
161
0.638175
false
3.618611
true
false
false
glyph/horsephrase
horsephrase/_regen_words.py
1
2398
""" Run with 'python -m horsephrase._regen_words > horsephrase/words.txt' - Stop allowing words less than 3 characters; if we have the possibility of words that short, it's trivially possible to attack the password as letters rather than as selections from this list. - Add words (both sourced from https://norvig....
mit
-6,620,722,462,035,993,000
35.892308
79
0.714762
false
3.470333
false
false
false
Chiel92/hearts-AI
player.py
1
4062
"""This module containts the abstract class Player and some implementations.""" from random import shuffle from card import Suit, Rank, Card, Deck from rules import is_card_valid class Player: """ Abstract class defining the interface of a Computer Player. """ def pass_cards(self, hand...
gpl-3.0
8,617,598,506,807,111,000
32.134454
92
0.569916
false
3.955209
false
false
false
jigneshphipl/omaha
enterprise/build_group_policy_template.py
63
2024
#!/usr/bin/python2.4 # # Copyright 2009 Google 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 o...
apache-2.0
2,551,215,414,839,132,700
34.508772
80
0.699111
false
4.088889
false
false
false
johtso/django-smart-selects
test_app/migrations/0001_initial.py
4
3111
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-16 17:14 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import smart_selects.db_fields class Migration(migrations.Migration): initial = True dependencies = [ ] operatio...
bsd-3-clause
7,108,204,114,110,410,000
40.48
219
0.571842
false
4.23842
true
false
false
dderevjanik/agescx
agescx/models/resource.py
1
1740
class Resource: """Information about player resource. Include Ore, which is unused, but it can be enabled. Attributes: food (int): food wood (int): wood gold (int): gold stone (int): stone ore (int): ore """ def __init__(self, food=0...
mit
540,976,870,569,891,100
26.1875
72
0.505172
false
3.741935
false
false
false
jeremiah-c-leary/vhdl-style-guide
vsg/vhdlFile/classify/variable_assignment_statement.py
1
1263
from vsg.token import variable_assignment_statement as token from vsg.vhdlFile.classify import conditional_variable_assignment from vsg.vhdlFile.classify import selected_variable_assignment from vsg.vhdlFile.classify import simple_variable_assignment from vsg.vhdlFile import utils def detect(iToken, lObjects): ...
gpl-3.0
-7,943,438,087,998,351,000
39.741935
91
0.745051
false
3.886154
false
false
false
rahulrrixe/libcloudCLI
libcloudcli/compute/node.py
1
3000
"""Node action implementations""" import logging import six from cliff import command from cliff import lister from cliff import show class CreateNode(show.ShowOne): """Create compute Node command""" log = logging.getLogger(__name__ + ".create_node") def get_parser(self, prog_name): parser = ...
apache-2.0
-3,680,191,917,278,911,000
26.522936
62
0.538667
false
4.249292
false
false
false
ewsterrenburg/tamandua
pelicanconf.py
1
2810
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals from fontawesome_markdown import FontAwesomeExtension import os AUTHOR = u"Erwin Sterrenburg" SITENAME = u"PILOSA.EU" TAGLINE = 'Scribblings of World\'s Most Curious Anteater' TIMEZONE = 'Europe/Amsterdam' LOCALE='en_US.utf8' DEFAU...
mit
-957,077,791,029,991,000
28.893617
119
0.69395
false
2.939331
false
false
false
mworion/mountwizzard
snippets/indi_new/qt_indi_client.py
1
5229
#!/usr/bin/env python """ A PyQt5 (client) interface to an INDI server. This will only work in the context of a PyQt application. """ from xml.etree import ElementTree from PyQt5 import QtCore, QtNetwork import snippets.indi_new.indi_xml as indiXML class QtINDIClientException(Exception): pass class QtINDIClie...
apache-2.0
-6,640,325,150,747,828,000
31.08589
175
0.608912
false
4.133597
false
false
false
devendermishrajio/nova_test_latest
nova/tests/unit/virt/libvirt/volume/test_volume.py
4
30943
# Copyright 2010 OpenStack Foundation # Copyright 2012 University Of Minho # # 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....
apache-2.0
6,796,882,139,458,009,000
41.387671
79
0.579582
false
3.799951
true
false
false
beeftornado/sentry
src/sentry/mediators/external_requests/util.py
1
2743
from __future__ import absolute_import import logging from jsonschema import Draft7Validator from requests.exceptions import Timeout, ConnectionError from sentry.utils.sentryappwebhookrequests import SentryAppWebhookRequestsBuffer from sentry.http import safe_urlopen from sentry.models.sentryapp import track_respons...
bsd-3-clause
-2,112,596,934,219,979,300
29.142857
104
0.611739
false
3.857947
false
false
false
jinzekid/codehub
python/数据库/MutilToMutil/orm_m2m_api.py
1
1111
# Author: Jason Lu import orm_createTable from sqlalchemy.orm import sessionmaker, relationship #创建与数据库的会话session class ,注意,这里返回给session的是个class,不是实例 Session_class = sessionmaker(bind=orm_createTable.engine) Session = Session_class() #生成session实例 # b1 = orm_createTable.Book(name="Learn python with Alex", pub_date='20...
gpl-3.0
-4,823,171,416,976,102,000
28.914286
98
0.714422
false
2.412442
false
false
false
rodrigopitanga/django-smssync
setup.py
1
1349
import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-smssync', ve...
gpl-3.0
-7,964,609,491,214,281,000
33.589744
93
0.623425
false
3.736842
false
false
false
unitedstates/federal_spending
federal_spending/settings.py
1
5919
# Django settings for retinaburner project. import os.path DEBUG = True TEMPLATE_DEBUG = DEBUG PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__)) ADMINS = ( ('Kaitlin Devine', 'kdevine@sunlightfoundation.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', #...
cc0-1.0
200,431,119,849,129,440
34.238095
127
0.691671
false
3.653704
false
false
false
jerome-guichard/primitiveWS
old/src/textToSpeech/mime.py
1
2702
#!/usr/bin/env python # -*- coding: utf-8 -*- import time import pypot.primitive import pypot.robot import random from pypot.primitive.move import MoveRecorder, Move, MovePlayer from speak import Speak class Mime(pypot.primitive.Primitive): def __init__(self, robot): pypot.primitive.Primitive.__init__...
gpl-3.0
5,999,994,371,491,001,000
24.009259
80
0.494074
false
3.43075
false
false
false
lixar/giant
giant/plugins/servers/web_api_2/web_api_2/examples.py
1
2944
#!/usr/bin/env python import random from collections import defaultdict from giant.giant_base.giant_base import GiantError def raise_(ex): raise ex swagger_to_csharp_enum_example_map = { 'string': defaultdict(lambda: lambda enum: '"' + random.choice(enum) + '";', { 'guid': lambda enum: 'n...
mit
853,531,755,141,804,400
39.342466
133
0.581522
false
3.717172
false
false
false
pavelsof/stl
stl/cli.py
1
6854
import argparse from stl.core import Core from stl import __version__ class Cli: """ Singleton that handles the user input, inits the whole machinery, and takes care of exiting the programme. """ def __init__(self): """ Constructor. Inits the argparse parser and then all the subparsers through the _init...
mit
4,102,905,145,173,503,000
26.198413
78
0.657718
false
3.088779
false
false
false
pjuren/pyokit
src/pyokit/io/david.py
1
4704
#!/usr/bin/python """ Date of Creation: 19th Dec 2014 Description: Functions for loading DAVID gene ontology results Copyright (C) 2010-2014 Philip J. Uren, Authors: Philip J. Uren This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Li...
lgpl-2.1
-3,720,982,818,224,237,000
39.205128
79
0.51977
false
4.226415
false
false
false
semonte/intellij-community
plugins/hg4idea/testData/bin/hgext/convert/p4.py
95
6836
# Perforce source for convert extension. # # Copyright 2009, Frank Kingswood <frank@kingswood-consulting.co.uk> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from mercurial import util from mercurial.i18n import _ from common i...
apache-2.0
-7,231,335,828,341,024,000
32.674877
77
0.486688
false
3.951445
false
false
false
jonahzheng/zperfmon
server/db_cron/daily_aggregate.py
3
6481
#!/usr/bin/python # # Copyright 2013 Zynga 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 applicabl...
apache-2.0
-7,632,996,699,218,153,000
29.00463
117
0.619195
false
3.373764
true
false
false
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/SQLAlchemy-0.4.0-py2.5.egg/sqlalchemy/schema.py
1
51803
# schema.py # Copyright (C) 2005, 2006, 2007 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """The schema module provides the building blocks for database metadata. This means all the entities wit...
bsd-3-clause
1,451,388,813,756,351,500
36.757289
296
0.595043
false
4.505392
false
false
false
rbuffat/pyidf
pyidf/performance_curves.py
1
334706
""" Data objects in group "Performance Curves" """ from collections import OrderedDict import logging from pyidf.helper import DataObject logger = logging.getLogger("pyidf") logger.addHandler(logging.NullHandler()) class CurveLinear(DataObject): """ Corresponds to IDD object `Curve:Linear` Linear curv...
apache-2.0
-385,419,006,265,597,700
35.583889
110
0.438032
false
4.882726
false
false
false
jeromecc/doctoctocbot
src/ip/host.py
1
1118
import socket import logging from django.core.cache import cache from django.conf import settings logger = logging.getLogger(__name__) def hostname_ip(hostname): try: host_ip = socket.gethostbyname(hostname) logger.debug(f"Hostname : {hostname}, IP: {host_ip}") return host_ip exce...
mpl-2.0
3,690,792,907,844,767,000
31.911765
93
0.655635
false
3.25
false
false
false
trondth/quizbot
Question.py
1
3425
#import GlobalConfig as conf import glob import re import sqlite3 import string import datetime import time from random import randint # TODO kan slettes from random import choice VERBOSE = True class Question(object): def __init__(self, cfg): """ Set up a new question object. @type cfg...
gpl-3.0
4,289,356,896,538,422,300
26.4
122
0.515912
false
3.982558
false
false
false
amirajdhawan/management
hw0plot.py
2
1196
#!/usr/bin/env python """ Plot histograms of the HW0 self-assessment results. """ import yaml import numpy as np import matplotlib.pyplot as plt def gather_scores(recs, name): """Gather a set of 1-5 scores from student response records Args: recs: list of student responses name: name of sel...
mit
-6,631,796,793,994,061,000
22.45098
66
0.605351
false
3.538462
false
false
false
somia/pgcs
pgcs/html/diff.py
1
9584
import difflib import pgcs.core.data import pgcs.core.diff core = pgcs.core from . import tags database_objects = None def get_colors(values): groups = {} for value, group in values: if value is not None: assert group >= 0 count = groups.get(group, 0) groups[group] = count + 1 else: assert group =...
mit
4,085,317,844,343,348,000
25.043478
87
0.623644
false
2.882406
false
false
false
kaedroho/django
django/core/files/storage.py
18
14486
import os from datetime import datetime from urllib.parse import urljoin from django.conf import settings from django.core.exceptions import SuspiciousFileOperation from django.core.files import File, locks from django.core.files.move import file_move_safe from django.core.signals import setting_changed from django.ut...
bsd-3-clause
-3,029,959,557,593,560,000
38.47139
115
0.613627
false
4.429969
false
false
false
devsam/hello-world
src/exam1.py
1
5225
# exam1.py import sqlite3 import uuid from flask import Flask, request, jsonify DATABASE = 'exam.db' app = Flask(__name__) app.config.from_object(__name__) """ HTTP GET: list of all users @Request: Nothing @Response: Json list [ { "id": [10-digit integer], "name": "[user name]", "salary": [integer] ...
unlicense
7,909,483,822,100,553,000
22.642534
77
0.594641
false
3.306962
false
false
false
dylanleong/mysite
reference/calculate.py
1
3726
from math import sqrt, pi, sin, cos, tan, atan2 as arctan2 def grid_to_longlat(E,N): #E, N are the British national grid coordinates - eastings and northings a, b = 6377563.396, 6356256.909 #The Airy 180 semi-major and semi-minor axes used for OSGB36 (m) F0 = 0.9996012717 #scale fact...
mit
-3,620,041,475,410,725,000
40.865169
104
0.564681
false
2.41791
false
false
false
cgwire/zou
zou/app/blueprints/crud/project.py
1
3203
from flask_jwt_extended import jwt_required from flask_restful import reqparse from zou.app.models.project import Project from zou.app.models.project_status import ProjectStatus from zou.app.services import ( deletion_service, projects_service, shots_service, user_service, ) from zou.app.utils import p...
agpl-3.0
-8,433,000,899,857,017,000
32.715789
77
0.62098
false
4.111682
false
false
false
overide/Datastructure-and-Algorithm-with-Python
searching/hash_open_addressing.py
1
2591
#------------------------------------------------------------------------------------------------------------------- #Name : Fixed Size Hash Table #Purpose : Fixed size Hash Table implementation in python using open addressing method for educational purpose #Author : Atul Kumar #Created : 07/07/2016 #L...
gpl-3.0
-6,431,755,950,926,975,000
28.869048
116
0.573138
false
3.296438
false
false
false
henriquegemignani/randovania
randovania/game_description/game_patches.py
1
3309
import copy import dataclasses from dataclasses import dataclass from typing import Dict, Tuple, Iterator from randovania.game_description.area_location import AreaLocation from randovania.game_description.assignment import PickupAssignment, GateAssignment, PickupTarget from randovania.game_description.dock import Doc...
gpl-3.0
8,321,308,436,758,278,000
44.328767
120
0.74252
false
3.943981
false
false
false
smartpm/smart
smart/interfaces/qt/command.py
3
3123
# # Copyright (c) 2004 Conectiva, Inc. # # Written by Gustavo Niemeyer <niemeyer@conectiva.com> # # This file is part of Smart Package Manager. # # Smart Package Manager 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 Fou...
gpl-2.0
7,352,646,742,271,694,000
33.7
82
0.667947
false
3.894015
false
false
false
tensorflow/tpu
models/official/efficientnet/imagenet_input.py
1
19927
# Copyright 2019 The TensorFlow 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 applica...
apache-2.0
-1,967,852,731,716,983,000
38.072549
96
0.65755
false
3.896558
false
false
false
pacoqueen/cican
formularios/peticiones_sin_asignar.py
1
11733
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright (C) 2008-2010 Francisco José Rodríguez Bogado # # <frbogado@novaweb.es> # # ...
gpl-3.0
4,794,027,787,422,119,000
43.071429
80
0.544741
false
3.383261
false
false
false
voutilad/courtlistener
cl/visualizations/admin.py
2
1600
from cl.visualizations.models import SCOTUSMap, JSONVersion, Referer from django.contrib import admin class JSONVersionAdmin(admin.ModelAdmin): readonly_fields = ( 'date_created', 'date_modified', ) raw_id_fields = ( 'map', ) class JSONVersionInline(admin.StackedInline): ...
agpl-3.0
6,831,527,185,631,235,000
17.823529
68
0.54
false
3.764706
false
false
false
noba3/KoTos
addons/script.module.youtube.dl/lib/youtube_dl/extractor/chaturbate.py
13
1635
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ExtractorError class ChaturbateIE(InfoExtractor): _VALID_URL = r'https?://(?:[^/]+\.)?chaturbate\.com/(?P<id>[^/?#]+)' _TESTS = [{ 'url': 'https://www.chaturbate.com/siswet19/', 'info_dict': { ...
gpl-2.0
-8,301,800,932,186,065,000
31.7
111
0.499694
false
3.199609
false
false
false
m-ober/byceps
byceps/services/board/aggregation_service.py
1
1772
""" byceps.services.board.aggregation_service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from ...database import db from .models.category import Category as DbCategory from .models.posting import Posting as DbPosting from ...
bsd-3-clause
760,638,886,676,078,000
30.087719
82
0.65237
false
3.964206
true
false
false
gnieboer/gnuradio
grc/python/Block.py
4
7805
""" Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion 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 l...
gpl-3.0
-1,592,589,407,358,603,500
37.073171
115
0.588469
false
4.241848
false
false
false
Azure/azure-sdk-for-python
sdk/eventhub/azure-eventhub/samples/sync_samples/recv_with_checkpoint_by_time_interval.py
1
3023
#!/usr/bin/env python # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ---------------------------------------------...
mit
-7,757,369,159,773,784,000
44.80303
120
0.669864
false
4.34964
false
false
false
miketamis/CouchPotatoServer
libs/apscheduler/threadpool.py
138
3982
""" Generic thread pool class. Modeled after Java's ThreadPoolExecutor. Please note that this ThreadPool does *not* fully implement the PEP 3148 ThreadPool! """ from threading import Thread, Lock, currentThread from weakref import ref import logging import atexit try: from queue import Queue, Empty except ImportE...
gpl-3.0
7,794,484,241,993,857,000
28.93985
78
0.59342
false
4.240682
false
false
false
slongfield/simpleStack
randProgram.py
1
2134
#!/usr/bin/python3 """randProgram generates random simpleStack programs, and evaluates them. This is basically a really simple fuzzer for testing that no programs "go wrong", where "go wrong" means "throw an exception". Allows one exception to be thrown: MemoryError if the stack grows beyond 10,000 elements. Thes...
apache-2.0
-6,438,950,789,896,655,000
33.983607
86
0.59747
false
3.988785
false
false
false
JeffBain/wedding-website
wedding_site/rsvp/views.py
1
1512
import json from django.http import HttpResponse from django.shortcuts import get_object_or_404 from django.utils.decorators import method_decorator from django.views.decorators.csrf import ensure_csrf_cookie from django.views.generic import TemplateView, View from rsvp.models import Invitation, Guest, Meal, ReplyErr...
mit
3,479,314,515,065,560,600
33.363636
71
0.623677
false
4.075472
false
false
false
cloew/KaoFlaskAuth
kao_flask_auth/auth_route_decorator.py
1
1323
from .invalid_auth import InvalidAuth from .token_builder import VerifyToken, ExtractToken from flask import current_app as app, request, jsonify from functools import wraps def authenticate(error): resp = jsonify({'code':error.code, 'description':error.description}) resp.status_code = 401 return...
mit
-7,228,420,097,349,261,000
31.974359
78
0.582011
false
4.642105
false
false
false
detiber/ansible
lib/ansible/modules/cloud/ovirt/ovirt_nics.py
21
8344
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible 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 #...
gpl-3.0
-2,644,823,634,523,632,600
31.216216
134
0.604147
false
3.998083
false
false
false
wwj718/xigua
today/models.py
4
2015
#coding=utf-8 from time import time from urlparse import urlparse from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from mezzanine.core.models import Displayable, Ownable from mezzanine.generic.models import Rating from mezzanine.generic.fields import Rat...
bsd-2-clause
4,043,699,385,481,912,000
32.631579
90
0.687533
false
3.232715
false
false
false
mitchellzen/pops
satchmo/projects/skeleton/manage.py
1
1111
#!/usr/bin/env python import os.path import sys DIRNAME = os.path.dirname(__file__) # trick to get the two-levels up directory, which for the "simple" project should be the satchmo dir _parent = lambda x: os.path.normpath(os.path.join(x, '..')) SATCHMO_DIRNAME = _parent(_parent(DIRNAME)) SATCHMO_APPS = os.path.join(S...
bsd-3-clause
6,294,482,186,318,063,000
36.066667
299
0.718272
false
3.286982
false
false
false
bendudson/BOUT
tools/tokamak_grids/pyGridGen/aeqdsk.py
4
18365
#!/usr/bin/env python import re import numpy """ @brief A-Eqdsk reader class @version $Id$ Copyright &copy; 2006-2008, Tech-X Corporation, Boulder, CO See LICENSE file for conditions of use. The official document describing a-eqdsk files: http://fusion.gat.com/THEORY/efit/a_eqdsk.html """ class Aeqdsk: d...
gpl-3.0
9,152,135,535,150,446,000
37.826638
190
0.61443
false
2.622448
false
false
false
valentin8709/AES_El-Gamal
keyExpansion.py
1
1429
from aes_base import sbox from aes_base import Rcon # Get a key from user password def keyExpansion(key, key_size): Nb = 4 if(key_size == 128): Nk = 4 Nr = 10 elif(key_size == 192): Nk = 6 Nr = 12 elif(key_size == 256): ...
unlicense
9,186,544,115,072,306,000
24.517857
75
0.398181
false
3.645408
false
false
false
snowflakedb/snowflake-sqlalchemy
test/test_copy.py
1
15255
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved. # import pytest from snowflake.sqlalchemy import ( AWSBucket, AzureContainer, CopyFormatter, CopyIntoStorage, CSVFormatter, ExternalStage, JSONFormatter, PARQUETFormatte...
apache-2.0
-487,141,385,498,174,500
43.34593
154
0.623271
false
3.917565
true
false
false
aramusss/contableplus
controller/userLogin.py
1
4041
__author__ = 'adria' #!/usr/bin/python from dataBase import * import sys sys.path.insert(0, '../model') #sino no deixa importar... from owner import * class UserLogin: def __init__(self, owner): self.owner = owner self.db = DataBase() self.registered = False #si l'usuari ja ha fet loguin ...
apache-2.0
7,223,837,244,720,342,000
32.683333
98
0.528829
false
4.0249
false
false
false
Infinidat/infi.clickhouse_orm
src/infi/clickhouse_orm/fields.py
1
24194
from __future__ import unicode_literals import datetime import iso8601 import pytz from calendar import timegm from decimal import Decimal, localcontext from uuid import UUID from logging import getLogger from pytz import BaseTzInfo from .utils import escape, parse_array, comma_join, string_or_func, get_subclass_names ...
bsd-3-clause
3,360,560,357,268,833,000
34.896142
164
0.615111
false
3.985175
false
false
false
burnettk/delete-docker-registry-image
delete_docker_registry_image.py
1
16505
#!/usr/bin/env python """ Usage: Shut down your registry service to avoid race conditions and possible data loss and then run the command with an image repo like this: delete_docker_registry_image.py --image awesomeimage --dry-run """ import argparse import json import logging import os import sys import shutil import...
mit
8,046,304,554,548,775,000
38.485646
169
0.560679
false
4.136591
false
false
false
tatsuhirosatou/JMdictDB
python/lib/jelparse.py
1
39671
####################################################################### # This file is part of JMdictDB. # Copyright (c) 2008-2010 Stuart McGraw # # JMdictDB 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-2.0
3,156,281,540,188,936,700
39.031282
98
0.517582
false
3.421093
false
false
false
cloudify-cosmo/softlayer-python
SoftLayer/CLI/ticket/__init__.py
1
1445
"""Support tickets.""" from SoftLayer.CLI import formatting from SoftLayer import utils import click TEMPLATE_MSG = "***** SoftLayer Ticket Content ******" def get_ticket_results(mgr, ticket_id, update_count=1): """Get output about a ticket. :param integer id: the ticket ID :param integer update_coun...
mit
-2,703,160,309,967,666,000
32.604651
78
0.627682
false
3.873995
false
false
false
bruteforce1/cryptopals
set2/ch12/decrypt_ecb_simple.py
1
4778
#!/usr/bin/python3 """ Copy your oracle function to a new function that encrypts buffers under ECB mode using a consistent but unknown key (for instance, assign a single random key, once, to a global variable). Now take that same function and have it append to the plaintext, BEFORE ENCRYPTING, the following string...
mit
-857,997,610,606,686,100
26.94152
91
0.611762
false
3.343597
true
false
false
sgallagher/anaconda
pyanaconda/ui/gui/spokes/welcome.py
2
15444
# Welcome spoke classes # # Copyright (C) 2011-2012 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distribute...
gpl-2.0
4,544,419,149,237,900,300
41.9
111
0.655206
false
4.176312
false
false
false
apache/incubator-airflow
airflow/utils/callback_requests.py
7
3600
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
4,597,060,604,835,068,400
34.643564
106
0.693889
false
4.235294
false
false
false
hasgeek/funnel
tests/integration/views/test_project_views.py
1
2302
from werkzeug.datastructures import MultiDict from funnel.forms import LabelForm from funnel.models import Label def test_new_label_get(client, new_user, new_project): with client.session_transaction() as session: session['userid'] = new_user.userid resp = client.get(new_project.url_for('new_label'))...
agpl-3.0
3,498,146,482,524,586,000
32.676471
66
0.589956
false
3.501529
false
false
false
francesconistri/p2ptv-pi
acestream/ACEStream/Core/DecentralizedTracking/pymdht/core/routing_table.py
4
5502
#Embedded file name: ACEStream\Core\DecentralizedTracking\pymdht\core\routing_table.pyo import ptime as time import logging logger = logging.getLogger('dht') class PopError(Exception): pass class PutError(Exception): pass class SuperBucket(object): def __init__(self, index, max_nodes): self.in...
mit
-345,034,039,726,740,860
29.065574
87
0.556707
false
3.600785
false
false
false
fatiherikli/dbpatterns
web/dbpatterns/documents/parsers/django_orm.py
1
5300
import ast from _ast import Call, Attribute, Name from documents.constants import * from documents.parsers import BaseParser, ParseError MODEL_BASE_CLASS = "Model" MANY_TO_MANY_FIELD = "many-to-many" FOREIGN_KEY_FIELD = "foreign-key" FIELD_TYPE_MAP = { "PositiveIntegerField": TYPES_INTEGER, "IntegerField": ...
mit
-2,033,049,868,149,611,300
27.961749
87
0.510943
false
4.383788
false
false
false
abanaiyan/sniper
scripts/scheduler-locality.py
2
5346
import sim def getScoreMetricTime(thread_id): return long(sim.stats.get('thread', thread_id, 'nonidle_elapsed_time')) def getScoreMetricInstructions(thread_id): return long(sim.stats.get('thread', thread_id, 'instruction_count')) class Thread: def __init__(self, thread_id, getScoreMetric): self.thread_i...
mit
1,987,437,797,327,282,400
37.73913
135
0.670034
false
3.510177
false
false
false
hoburg/gpkit
gpkit/tools/autosweep.py
1
11266
"Tools for optimal fits to GP sweeps" from time import time import numpy as np from ..small_classes import Count from ..small_scripts import mag from ..solution_array import SolutionArray from ..exceptions import InvalidGPConstraint class BinarySweepTree: # pylint: disable=too-many-instance-attributes """Spans a...
mit
5,650,122,931,816,554,000
37.189831
79
0.583526
false
3.573105
false
false
false
nlangellier/gaussian-processes
solar_GP_RH.py
1
3673
import time import numpy as np import scipy.linalg as lin import scipy.stats as stat import matplotlib.pyplot as plt import kernel_qp as qp def log_likelihood(theta, t, Y): tLen = len(t.reshape(-1)) Nw = theta.shape[0] Y = np.ascontiguousarray(Y.reshape(-1)) K = qp.gamma_qp(t, t...
unlicense
8,800,759,658,656,268,000
36.684211
92
0.518377
false
2.575736
false
false
false
kurbatovaei/python_training
fixture/contact.py
1
9249
from model.contact import Contact import re class ContactHelper: def __init__(self, app): self.app = app def open_home_page(self): wd = self.app.wd if not ((wd.current_url.endswith("addressbook/") or wd.current_url.endswith("/index.php")) and ( len(wd.find_elements_by...
apache-2.0
-4,742,112,173,271,384,000
44.117073
117
0.586982
false
3.471847
false
false
false
flschiavoni/harpia
harpia/extensions/c/opencv/liveDelay.py
2
2875
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This module contains the LiveDelay class. """ from harpia.GUI.fieldtypes import * from harpia.model.plugin import Plugin class LiveDelay(Plugin): """ This class contains methods related the liveDelay class. """ # ---------------------------------------...
gpl-3.0
-3,415,179,329,173,071,000
34.493827
79
0.414957
false
3.753264
false
false
false
rajendrauppal/elasticsearch-reddit
elasticsearch_reddit.py
1
1431
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Python application to fetch, store and offline search Reddit data. Requirements: 1. Python 2.7+ 2. requests (pip install requests) 3. elasticsearch (pip install elasticsearch) 4. ElasticSearch server running (downlaod from https://www.elastic.co/downloads/elasticsearc...
mit
5,101,915,752,633,036,000
25.5
81
0.638015
false
3.297235
false
false
false
certik/sympy-oldcore
sympy/functions/elementary/tests/test_hyperbolic.py
1
6236
from sympy import * def test_sinh(): x, y = symbols('xy') k = Symbol('k', integer=True) assert sinh(nan) == nan assert sinh(oo) == oo assert sinh(-oo) == -oo assert sinh(0) == 0 assert sinh(1) == sinh(1) assert sinh(-1) == -sinh(1) assert sinh(x) == sinh(x) assert sinh(-x...
bsd-3-clause
-6,516,422,457,788,406,000
23.844622
55
0.526299
false
2.28928
true
false
false
stevecassidy/hcsvlab_robochef
hcsvlab_robochef/eopas_test/ingest.py
1
5401
from hcsvlab_robochef.annotations import * from hcsvlab_robochef.ingest_base import IngestBase from hcsvlab_robochef.rdf.map import * from hcsvlab_robochef.utils.filehandler import * from hcsvlab_robochef.utils.serialiser import * from hcsvlab_robochef.utils.statistics import * from rdf import paradisecMap from xml.etr...
gpl-3.0
-4,263,839,446,201,702,000
35.006667
110
0.61933
false
3.301345
false
false
false
jgomezdans/sampyl
examples/slice_sample.py
2
1708
import sys sys.path.append('.') import sampyl as smp from sampyl.state import State from sampyl import np from sampyl.diagnostics import diagnostics import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import seaborn as sns # correlated gaussian log likelihood def logp(x, y): icov = np.linalg....
apache-2.0
8,433,334,324,752,320,000
31.226415
68
0.68267
false
2.706815
false
false
false
rmcgibbo/nebterpolator
setup.py
1
2337
""" setup.py: Install nebterpolator. """ VERSION="1.0" __author__ = "Robert McGibbon and Lee-Ping Wang" __version__ = VERSION from distutils.sysconfig import get_config_var from distutils.core import setup,Extension import os import shutil import numpy import glob # Comment left here as an example # Copied from MSMBu...
gpl-3.0
5,680,237,756,592,672,000
37.95
114
0.593068
false
3.7392
false
false
false
nextview/medicticket
txomon/ticket/tests/batch.py
1
10825
from trac.perm import PermissionCache from trac.test import Mock, EnvironmentStub from txomon.ticket import default_workflow, web_ui from txomon.ticket.batch import BatchModifyModule from txomon.ticket.model import Ticket from trac.util.datefmt import utc import unittest class BatchModifyTestCase(unittest.TestCase):...
bsd-3-clause
1,928,104,001,783,783,000
41.285156
78
0.610531
false
3.841377
true
false
false
Art-SoftWare/ircbot
extern/quizz/Quizz.py
1
1269
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from random import randint import re import util.cfg class Quizz: MODE_ONESHOT = 1 MODE_REGULAR = 2 MODE_PARTY = 3 def __init__(self, botName, channel, defaultMode=MODE_ONESHOT): util.cfg.default = {} self.questions = util.cfg.load("ex...
gpl-3.0
1,677,504,767,373,008,600
29.95122
106
0.639086
false
4.003155
false
false
false
rstones/counting_statistics
counting_statistics/fcs_solver.py
1
11597
import numpy as np import numpy.linalg as npla import scipy.linalg as la import scipy.special as sp from counting_statistics.lindblad_system import LindbladSystem #from counting_statistics import optimized_funcs class FCSSolver(LindbladSystem): ''' Users should be able to create a FCSSolver instance with the s...
mit
2,002,734,828,700,820,700
48.144068
137
0.590756
false
3.489919
false
false
false
matthazinski/tempnet
gateway/remoted.py
1
1706
#!/usr/bin/env python import os import time import RPi.GPIO as GPIO from flask import Flask app = Flask(__name__) os.system('modprobe w1-gpio') os.system('modprobe w1-therm') tempsensor_sn = '28-000005abe684' # Varies depending on sensor sensor = '/sys/bus/w1/devices/' + tempsensor_sn + '/w1_slave' # Sets pins 19...
apache-2.0
-3,130,640,940,812,404,000
23.724638
80
0.575029
false
2.857621
false
false
false
shenfei/oj_codes
leetcode/python/n146_LRU_Cache.py
1
1711
class ListNode: def __init__(self, x): self.val = x self.pre = None self.next = None class LRUCache: def __init__(self, capacity): """ :type capacity: int """ self.capacity = capacity self.size = 0 self.head = ListNode(0) self.ta...
mit
-1,529,732,343,830,840,600
22.763889
42
0.474576
false
3.785398
false
false
false
hsiegel/postsai-commitstop
permissions/response.py
1
1942
# The MIT License (MIT) # Copyright (c) 2016-2017 HIS e. G. # # 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, modi...
mit
-522,409,232,732,326,500
31.366667
77
0.705458
false
3.907445
false
false
false
tntnatbry/tensorflow
tensorflow/contrib/bayesflow/python/ops/stochastic_tensor.py
81
1492
# Copyright 2016 The TensorFlow 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 applica...
apache-2.0
8,521,956,410,367,352,000
30.083333
80
0.714477
false
3.968085
false
false
false
georgenicolaou/nfi
AndroidMisc/LockSettingsSaltOld.py
2
3222
''' NFI -- Silensec's Nyuki Forensics Investigator Copyright (C) 2014 George Nicolaou (george[at]silensec[dot]com) Silensec Ltd. This file is part of Nyuki Forensics Investigator (NFI). NFI is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Licen...
gpl-3.0
4,246,504,954,763,836,400
35.625
84
0.555556
false
4.27321
false
false
false
franek/weboob
modules/freemobile/pages/homepage.py
3
2080
# -*- coding: utf-8 -*- # Copyright(C) 2012 Florent Fourcot # # This file is part of weboob. # # weboob 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,789,149,495,777,014,000
39.784314
111
0.642308
false
4.086444
false
false
false
googleinterns/schemaorg-generator
protogenerator/main.py
1
2484
# 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 # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, sof...
apache-2.0
7,994,906,288,935,356,000
29.666667
95
0.588969
false
4.17479
false
false
false
sekikn/incubator-airflow
airflow/providers/google/cloud/example_dags/example_postgres_to_gcs.py
7
1796
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-8,917,713,997,084,104,000
35.653061
91
0.731626
false
3.650407
false
false
false
MrSprigster/script.module.python.twitch
resources/lib/twitch/api/v5/videos.py
1
3493
# -*- encoding: utf-8 -*- """ Reference: https://dev.twitch.tv/docs/v5/reference/videos/ Copyright (C) 2016-2018 script.module.python.twitch This file is part of script.module.python.twitch SPDX-License-Identifier: GPL-3.0-only See LICENSES/GPL-3.0-only for more information. """ from ... import ...
gpl-3.0
-441,533,330,065,040,300
29.640351
103
0.696536
false
3.06942
false
false
false
tum-vision/autonavx_ardrone
ardrone_python/src/example3_trajectory.py
1
1200
#!/usr/bin/env python import rospy import roslib; roslib.load_manifest('ardrone_python') from std_msgs.msg import Empty from geometry_msgs.msg import Twist, Vector3 if __name__ == '__main__': rospy.init_node('example_node', anonymous=True) # publish commands (send to quadrotor) pub_velocity = rospy.Pu...
mit
5,187,995,165,854,732,000
27.571429
65
0.635
false
2.962963
false
true
false
abhattad4/Digi-Menu
digimenu/digimenu/settings.py
3
2718
""" Django settings for digimenu project. Generated by 'django-admin startproject' using Django 1.8.2. 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...
bsd-3-clause
-2,644,085,489,206,268,400
24.641509
71
0.677704
false
3.449239
false
false
false
caioserra/apiAdwords
examples/adspygoogle/adwords/v201309/campaign_management/validate_text_ad.py
2
2895
#!/usr/bin/python # # Copyright 2013 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
5,534,271,348,208,787,000
30.813187
77
0.617617
false
3.711538
false
false
false
janinko/pnc-cli
test/integration/test_environments_api.py
3
2609
import pytest from pnc_cli.swagger_client.apis.environments_api import EnvironmentsApi from test import testutils import pnc_cli.user_config as uc @pytest.fixture(scope='function', autouse=True) def get_envs_api(): global envs_api envs_api = EnvironmentsApi(uc.user.get_api_client()) def test_get_all_invali...
apache-2.0
-5,567,619,514,136,862,000
32.883117
136
0.701801
false
3.132053
true
false
false
alx/torrentflux
TF_BitTornado/BitTornado/BTcrypto.py
5
3202
# Written by John Hoffman # based on code by Uoti Urpala # see LICENSE.txt for license information from __future__ import generators # for python 2.2 from random import randrange,randint,seed try: from os import urandom except: seed() urandom = lambda x: ''.join([chr(randint(0,255)) for i in xr...
gpl-2.0
-6,187,985,701,630,689,000
29.087379
205
0.597751
false
3.202
false
false
false
gbenson/i8c
src/i8c/compiler/optimizer.py
1
12705
# -*- coding: utf-8 -*- # Copyright (C) 2015-16 Red Hat, Inc. # This file is part of the Infinity Note Compiler. # # The Infinity Note Compiler 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 ...
lgpl-2.1
-8,282,089,333,127,545,000
32.346457
76
0.564502
false
4.000315
false
false
false
faunalia/rt_geosisma_offline
DlgSelectRequest.py
1
5159
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : RT Geosisma Offline Description : Geosisma Offline Plugin Date : October 21, 2011 copyright : (C) 2013 by Luigi Pirelli (Faunalia) email : ...
gpl-3.0
1,876,209,328,122,207,200
34.572414
92
0.638232
false
3.511232
false
false
false
DEV3L/python-behave-sandbox
class_variable_test.py
1
1168
""" This file helped clarify for me how Python handles class and instance variables. Instances of a class refer to the class value until modified on the instance This file can simply be ran from the console: python class_variable_test.py """ class SomeClass(): a_field = None def main(): print("classfield:...
mit
4,065,829,938,781,323,000
28.2
80
0.669521
false
3.337143
false
false
false
clubadm/clubadm
clubadm/migrations/0001_initial.py
1
5914
from django.db import migrations, models from django.db.models import deletion from django.utils import timezone class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name="User", fields=[ ("id"...
mit
5,740,575,148,904,608,000
38.870504
83
0.481776
false
4.069016
false
false
false
belemizz/mimic2_tools
clinical_db/patient_statistics.py
1
5359
'''Statistics of mimic2 database''' from get_sample import Mimic2 from mutil import Graph import numpy as np from matplotlib.pyplot import waitforbuttonpress mimic2 = Mimic2() graph = Graph() def readmission_statisic(): l_id = mimic2.subject_with_chf(max_seq=1) total_admission = 0 alive_on_disch = 0 ...
mit
6,756,680,952,525,994,000
37.553957
98
0.594514
false
3.381073
false
false
false
ptitjes/quodlibet
tests/test_metadata.py
2
4043
# 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. from tests import mkstemp, TestCase, get_data_path import os from quo...
gpl-2.0
-5,440,857,690,750,559,000
34.464912
75
0.61118
false
3.411814
true
false
false
familonet/nexmo-download-link
handler.py
1
10979
#!/usr/bin/env python # coding=UTF-8 # Title: handler.py # Description: This file contains all tornado.web.RequestHandler classes used in this application # Author David Nellessen <david.nellessen@familo.net> # Date: 12.01.15 # Note: # =========================================================...
mit
-4,039,656,774,473,736,000
38.778986
121
0.566627
false
4.603354
false
false
false