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
atmtools/typhon
typhon/tests/files/handlers/test_netcdf4.py
1
4163
import os import tempfile import numpy as np import xarray as xr from typhon.files import NetCDF4 class TestNetCDF4: def test_dimension_mapping(self): """ If a subgroup has not defined a dimension, but its parent group has one with the same size and name, the subgroup should use that one...
mit
4,823,030,846,182,003,000
35.2
79
0.480183
false
3.707035
true
false
false
Neill3d/MoPlugs
PythonScripts/Actions/Physics_MakeJointChain.py
1
4320
# script for making a physics joints chain # use all the joints heirarchy # Steps are: # 1 - make nulls between joints # 2 - make marker capsule for joints collision # 3 - make a physics joint and setup all the connections # setup physics joints # Github repo - https://github.com/Neill3d/MoPlugs # Licensed unde...
bsd-3-clause
2,019,809,603,592,108,000
29.006944
106
0.628472
false
3.630252
false
false
false
RianFuro/vint
vint/linting/policy/abstract_policy.py
1
1390
class AbstractPolicy(object): def __init__(self): self.name = self.__class__.__name__ self.description = None self.reference = None self.level = None def listen_node_types(self): """ Listening node type. is_valid will be called when a linter visit the listening ...
mit
-6,025,738,899,854,857,000
29.217391
76
0.551079
false
4.276923
false
false
false
vandenheuvel/tribler
Tribler/Core/__init__.py
1
1615
""" Core functionality of the Tribler. Author(s): Arno Bakker """ import logging from threading import RLock logger = logging.getLogger(__name__) def warnIfDispersyThread(func): """ We'd rather not be on the Dispersy thread, but if we are lets continue and hope for the best. This was introduced after th...
lgpl-3.0
-7,592,569,947,278,983,000
28.363636
108
0.63096
false
3.845238
false
false
false
Pakoach/Sick-Beard-Animes
sickbeard/helpers.py
1
25462
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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
-1,064,816,649,566,007,200
32.769231
260
0.618922
false
3.58065
false
false
false
seasonstar/bibi
application/models/content/board.py
1
3045
# -*- coding: utf-8 -*- from datetime import datetime from application.extensions import db from application.models.inventory import Item __all__ = ['Board', 'ChangeLog'] class ChangeLog(db.EmbeddedDocument): ''' log all user actions of change for a board ''' user = db.StringField() date = db.Dat...
apache-2.0
-881,374,842,817,302,900
28
80
0.592775
false
3.768564
false
false
false
passuf/WunderHabit
wunderhabit/urls.py
1
1109
from django.conf.urls import include, url from django.contrib import admin from django.views.generic import TemplateView from . import views from wunderlist import urls as wunderlist_urls from wh_habitica import urls as habitica_urls urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', views.index, n...
mit
-6,684,033,268,098,599,000
45.208333
103
0.698828
false
3.40184
false
true
false
ros2/launch
launch_testing/launch_testing/parametrize.py
1
1632
# Copyright 2019 Apex.AI, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
2,299,577,087,508,250,000
31.64
96
0.676471
false
4.195373
false
false
false
zenn1989/scoria-interlude
L2Jscoria-Game/data/scripts/quests/316_DestroyPlaguebringers/__init__.py
1
2685
# Made by Mr. - Version 0.3 by DrLecter import sys from com.l2scoria.gameserver.model.quest import State from com.l2scoria.gameserver.model.quest import QuestState from com.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest qn = "316_DestroyPlaguebringers" WERERAT_FANG = 1042 VAROOL_FOULCLAWS_FANG = ...
gpl-3.0
-6,715,975,308,925,014,000
27.88172
112
0.66406
false
2.734216
false
false
false
imatge-upc/unsupervised-2017-cvprw
tools/ops.py
1
3558
import math import numpy as np import tensorflow as tf from tensorflow.python.framework import ops def _variable_with_weight_decay(name, shape, wd=1e-3): with tf.device("/cpu:0"): # store all weights in CPU to optimize weights sharing among GPUs var = tf.get_variable(name, shape, initializer=tf.contrib....
mit
2,077,011,453,529,124,000
40.870588
125
0.603148
false
2.786218
false
false
false
aodag/myscript
setup.py
1
1721
# -*- coding:utf-8 -*- # The MIT License (MIT) # Copyright (c) 2014 Atushi Odagiri # 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 rig...
mit
-4,490,669,233,896,191,000
31.471698
80
0.728646
false
4.011655
false
false
false
chrisjsewell/ipymd
ipymd/visualise/opengl/renderers/bond.py
1
3236
from .base import AbstractRenderer from .line import LineRenderer from .cylinder_imp import CylinderImpostorRenderer import numpy as np class BondRenderer(AbstractRenderer): ''' Render chemical bonds as cylinders or lines. **Parameters** widget: The parent QChemlabWidget ...
gpl-3.0
-4,377,023,312,838,159,400
37.070588
83
0.533993
false
4.19171
false
false
false
vhsvhs/ratflic
argParser.py
1
2467
# # ArgParser.py # # by Victor Hanson-Smith # victorhansonsmith@gmail.com # # This is a super useful class to include in your Python project that # needs many command-line options passed to the program. # # Usage in your code: # # 1. Instantiate an instance of this class: # ap = ArgParser(sys.argv) # # 2....
gpl-2.0
-32,130,444,400,291,332
23.453608
86
0.640454
false
3.126743
false
false
false
suselrd/django-social-network
social_network/utils.py
1
4281
# coding=utf-8 import random from django.core.cache import cache from django.core.exceptions import ObjectDoesNotExist from django.utils.translation import ugettext as _ from notifications.models import EventType from social_graph import EdgeType try: from hashlib import sha1 as sha_constructor, md5 as md5_constru...
bsd-3-clause
3,364,919,193,638,264,000
28.944056
87
0.617379
false
3.748687
false
false
false
UnitedThruAction/PrecinctDB
src/ElectionResult.py
1
9866
"""Load precinct-level election results from the OpenElections Project (http://www.openelections.net), the first free, comprehensive, standardized, linked set of election data for the United States, including federal and statewide offices. """ import csv import os import re import sys from datetime import date from t...
mit
-3,379,728,725,819,456,000
41.895652
117
0.545307
false
3.832945
false
false
false
vedran6/brainvault
wallet/wallet.py
1
21624
from bitcoin import * import getpass import json import random import argparse import time import os.path import binascii import readline import platform from . import diceware from .blockchain_providers import * from .aes import AES SATOSHIS = 100000000 BTCUSD_RATE = 0 BTCUSD_FETCHED = 0 PROVIDER = None NO_FIAT = Fal...
mit
6,145,035,569,072,942,000
32.840376
104
0.573622
false
3.613636
false
false
false
EmadMokhtar/Django
django/db/models/deletion.py
4
14029
from collections import Counter from operator import attrgetter from django.db import IntegrityError, connections, transaction from django.db.models import signals, sql class ProtectedError(IntegrityError): def __init__(self, msg, protected_objects): self.protected_objects = protected_objects sup...
mit
-977,903,807,396,175,500
41.771341
96
0.590206
false
4.411635
false
false
false
PaddlePaddle/Paddle
python/paddle/fluid/tests/unittests/test_Tensor_type.py
1
2014
# Copyright (c) 2020 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
-5,782,873,222,659,317,000
32.566667
74
0.649454
false
3.609319
true
false
false
flomotlik/formica
formica/s3.py
1
3636
import boto3 from contextlib import contextmanager import logging from hashlib import md5 from io import BytesIO logger = logging.getLogger(__name__) # Using MD5 for shorter string names as Sha256 is larger than allowed bucket name characters HASH = md5 # Use Hash Blocksize to determine number of bytes read BLOCKSIZE...
mit
4,925,457,567,385,385,000
38.096774
125
0.590209
false
3.835443
false
false
false
mitinarseny/flask-request-args-parser
params.py
1
3583
from flask import abort, request from werkzeug.datastructures import MultiDict def _get_locations(): params = { 'args': None, 'json': None, 'headers': None, 'cookies': None, } if request.args: params['args'] = request.args.copy() if request.get_json(): p...
mit
-2,730,590,727,277,850,600
33.12381
108
0.529445
false
4.296163
false
false
false
ZeitOnline/zeit.cms
src/zeit/cms/browser/standardmacros.py
1
1844
import zeit.cms.browser import zeit.cms.browser.interfaces import zeit.cms.browser.resources import zeit.cms.checkout.interfaces import zeit.cms.repository.interfaces import zeit.cms.section.interfaces import zope.app.basicskin.standardmacros import zope.component import zope.location.interfaces import zope.security.pr...
bsd-3-clause
-3,219,398,483,976,602,000
30.793103
79
0.653471
false
4.153153
false
false
false
ravenbyron/phtevencoin
contrib/testgen/base58.py
1
2834
''' Phtevencoin base58 encoding and decoding. Based on https://phtevencointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): ret...
mit
-8,006,178,903,971,085,000
26.25
97
0.609739
false
3.246277
false
false
false
stackforge/monasca-persister
monasca_persister/repositories/cassandra/metrics_repository.py
1
13097
# (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP # (C) Copyright 2017 SUSE 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...
apache-2.0
8,429,789,016,107,877,000
44.318339
99
0.522104
false
4.505332
false
false
false
radiocicletta/idjc-x
python/mutagentagger.py
1
25251
# mutagengui.py: GTK based file tagger. # Copyright (C) 2009 Stephen Fairchild (s-fairchild@users.sourceforge.net) # # 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...
gpl-2.0
-7,189,492,367,199,205,000
32.758021
103
0.499822
false
4.0215
false
false
false
rahulunair/nova
nova/api/openstack/compute/lock_server.py
1
2428
# Copyright 2011 OpenStack Foundation # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
4,606,992,664,672,963,600
40.152542
77
0.668863
false
3.891026
false
false
false
groboclown/whimbrel
installer/whimbrel/install/util/copy.py
1
3296
import os import shutil from zipfile import ZipFile, ZIP_DEFLATED def discover_files(src_dir, archive_path, file_found_callback): """ Finds all the files in the source directory, and how they map into the archive path (a relative directory). :param src_dir: :param archive_path: :param file_f...
apache-2.0
-7,392,527,519,219,275,000
34.06383
91
0.60892
false
3.47313
false
false
false
ActiveState/code
recipes/Python/576929_Planet_TerraHeightmap_Generator_/recipe-576929.py
1
4211
#!/usr/bin/env python # -*- coding: utf-8 -*- import Image, ImageDraw, ImageChops, ImageOps, ImageFilter import pygame.display, pygame.image import random import sys from math import ceil percentWater = .70 mapSize = 600 #in pixels maxSize = 1.40 # 1 to 5 How big should the slices be cut, smaller slices create more is...
mit
4,338,384,422,797,091,300
34.991453
119
0.667537
false
3.231773
false
false
false
rmartinjak/mensanotify
mensanotify/jsonobj.py
1
2116
# -*- coding: utf-8 -*- import os.path import json import itertools import UserDict import weakref class JsonObj(object): def __init__(self, path): self._path = path self._data = {} self._load() self._deleted = False def __eq__(self, other): return self._path == other...
mit
3,964,908,347,143,772,000
23.045455
69
0.519849
false
3.765125
false
false
false
jefftriplett/django-metadata
testapp/settings.py
2
2924
# Django settings for metadata project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'metada...
bsd-3-clause
-1,350,050,132,987,212,000
33.4
108
0.677497
false
3.58773
false
false
false
AstroDigital/modis-ingestor
modispds/earthdata.py
1
4224
""" Client library for using NASAs CMR API for searching and downloading from NASA data holdings """ import os import requests import datetime from dateutil.parser import parse as dateparser from json import dump import logging from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAd...
mit
6,268,581,062,360,208,000
32.52381
106
0.655066
false
3.473684
false
false
false
Adrianacmy/Classic-Interesting-CS-Mini-Programs
send_email/message_user.py
1
3123
import datetime from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import smtplib host = "smtp.gmail.com" port = 587 username = "hungrypy@gmail.com" password = "iamhungry2016" from_email = username to_list = ["hungrypy@gmail.com"] class MessageUser(): user_details = [] messag...
mit
747,628,904,180,628,000
27.916667
66
0.558758
false
3.63986
false
false
false
diegocortassa/TACTIC
src/bin/util/change_db_info.py
1
4571
########################################################### # # Copyright (c) 2009, 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 permi...
epl-1.0
-3,819,508,618,183,564,000
23.185185
116
0.530956
false
4.693018
true
false
false
rajashreer7/autotest-client-tests
linux-tools/readline/readline.py
3
1667
#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error, software_manager sm = software_manager.SoftwareManager() class readline(test.test): """ Autotest module for testing basic functionality of readline @author Yu-Pao Lee, yplee@...
gpl-2.0
-5,173,294,611,131,146,000
28.245614
89
0.560888
false
4.055961
true
false
false
msabramo/ianitor
src/ianitor/script.py
1
2807
# -*- coding: utf-8 -*- # Copyright (C) 2014 by Clearcode <http://clearcode.cc> # and associates (see AUTHORS.md). # This file is part of ianitor. # ianitor 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 Foundat...
lgpl-3.0
5,043,987,745,696,900,000
25.481132
77
0.64731
false
4.00428
false
false
false
BirkbeckCTP/janeway
src/core/homepage_elements/featured/views.py
1
2059
from django.urls import reverse from django.http import HttpResponse from django.shortcuts import redirect, render, get_object_or_404 from core.homepage_elements.featured import models from submission import models as submission_models from security.decorators import editor_user_required @editor_user_required def fe...
agpl-3.0
-126,889,761,654,903,630
35.122807
117
0.662943
false
4.118
false
false
false
cxcsds/ciao-contrib
ciao_contrib/_tools/obsinfo.py
1
19122
# # Copyright (C) 2013, 2014, 2015, 2016 # Smithsonian Astrophysical Observatory # # # # 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 op...
gpl-3.0
-1,198,746,769,811,507,700
36.420744
127
0.580169
false
4.128238
false
false
false
macosforge/ccs-calendarserver
contrib/performance/loadtest/profiles.py
1
44659
## # Copyright (c) 2011-2017 Apple 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 l...
apache-2.0
-1,943,272,361,565,429,800
32.502626
123
0.609284
false
4.209142
false
false
false
CoreSecurity/pysap
tests/saphdb_test.py
1
2641
# =========== # pysap - Python library for crafting SAP's network protocols packets # # SECUREAUTH LABS. Copyright (C) 2021 SecureAuth Corporation. All rights reserved. # # The library was designed and developed by Martin Gallo from # the SecureAuth's Innovation Labs team. # # This program is free software; you can red...
gpl-2.0
-2,314,453,987,884,574,700
32.43038
91
0.690269
false
4.038226
true
false
false
alirizakeles/zato
code/zato-web-admin/src/zato/admin/web/views/security/apikey.py
1
2111
# -*- coding: utf-8 -*- """ Copyright (C) 2014 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib import logging # Zato from zato.admin.web.forms import ChangePasswordFo...
gpl-3.0
-1,263,302,764,006,898,200
30.044118
132
0.679773
false
3.524207
false
false
false
expert360/cfn-params
cfnparams/params.py
1
2989
import json import os from cfnparams.exceptions import ResolutionError class CLIParams(object): def __init__(self, param_str): self.param_str = param_str @classmethod def supports_source(cls, arg): return arg.kind == 'cli' and arg.value.startswith('ParameterKey=') def parse(self, re...
mit
-9,160,763,327,574,425,000
25.927928
76
0.546671
false
4.245739
false
false
false
kitsunde/django-mailwhimp
setup.py
1
1027
#!/usr/bin/env python """ django-mailwhimp ====== Django-mailwhimp is a django application for interacting with MailChimp. """ from setuptools import setup, find_packages setup( name='django-mailwhimp', version='0.1', author='Kit Sunde', author_email='kit@mediapop.co', url='http://github.com/Celc...
mit
5,881,088,617,990,296,000
26.756757
72
0.63778
false
3.965251
false
false
false
rmcauley/rainwave
api_requests/auth/discord.py
1
7496
from api.exceptions import APIException import asyncio import uuid import secrets import bcrypt import aiohttp from api.urls import handle_url from api.web import HTMLRequest from libs import config, db, log from tornado.auth import OAuth2Mixin from .errors import OAuthNetworkError, OAuthRejectedError from .r4_mixin ...
gpl-2.0
7,047,050,615,264,900,000
39.73913
116
0.540822
false
3.987234
false
false
false
bazzile/THE_BIG_ONE
Main/Downloaders/download_ALOS_qls.py
1
2516
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import requests import time def alos_ql_downloader(): """Функция скачивает квиклуки для ALOS, используя в качестве исходных данных ссылки из 2х .txt-листов: main_links_filepath = основной файл со ссылками, auxl_links_filepath = резервный (на случай ...
mit
4,189,286,453,119,266,300
38.413793
106
0.568679
false
2.76087
false
false
false
wevote/WeVoteServer
apis_v1/documentation_source/position_retrieve_doc.py
1
6270
# apis_v1/documentation_source/position_retrieve_doc.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- def position_retrieve_doc_template_values(url_root): """ Show documentation about positionRetrieve """ required_query_parameter_list = [ { 'name': 'voter_de...
mit
6,672,742,359,885,097,000
47.604651
119
0.53126
false
3.747759
false
false
false
fp7-netide/Usecases
Usecase1/OpenDayLight/UC1_DataCenter.py
1
5063
#!/usr/bin/python ######################################################################################################### ### File: UC1_DataCenter.py ### Author: Georgios Katsikas - katsikas@imdea.org ### Date: 24/03/2014 ###########################################################################################...
epl-1.0
9,092,335,596,154,000,000
26.516304
105
0.565475
false
3.479725
true
false
false
ThermoNuclearPanda/Project_Automail
Python Files/arduino_port.py
1
1216
""" @Author: Kiran Gurajala & Alex Lee @Project: Project Automail @Version: 1.0 """ # required imports import sys # Append Path sys.path.append('../lib/') import serial import platform import struct class Arduino(): # serial object initialized to null serial = None # Returns connected Arduino serial port def ge...
mit
712,638,704,161,536,800
19.610169
67
0.664474
false
2.888361
false
false
false
chetan/cherokee
admin/plugins/exists.py
1
6189
# Cheroke Admin: File Exists rule plug-in # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2009-2010 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the Free So...
gpl-2.0
-4,588,335,431,787,780,600
41.682759
160
0.560511
false
3.49661
false
false
false
user01/love-letter
loveletter/env.py
1
7457
from operator import itemgetter import gym from gym import spaces from gym.utils import seeding from .game import Game from .card import Card from .player import PlayerAction, PlayerTools from .agents.random import AgentRandom class LoveLetterEnv(gym.Env): """Love Letter Game Environment The goal of hotter...
mit
130,975,677,750,630,940
34.509524
114
0.551428
false
4.205866
false
false
false
google/report2bq
application/classes/sa360_report_validation/campaign_target.py
1
2275
""" 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, software di...
apache-2.0
-9,191,841,978,391,402,000
25.764706
80
0.639121
false
3.956522
false
false
false
felko/sluggo
sluggo/shell.py
1
5592
#!/usr/bin/env python3.4 # coding: utf-8 __all__ = ( 'Shell', ) import os import glob import traceback import colorama import subprocess from importlib.machinery import SourceFileLoader from collections import OrderedDict from sluggo.repl import * colorama.init() class Shell(REPL): def __init__(self, base...
mit
-2,295,918,833,970,619,400
25.755981
101
0.521102
false
3.591522
false
false
false
novafloss/django-agnocomplete
demo/views_proxy.py
1
6322
import json import logging from django.core.exceptions import PermissionDenied from django.http import ( HttpResponse, Http404, HttpResponseNotFound, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseNotAllowed, HttpResponseServerError, ) from django.utils.encoding import force_tex...
mit
3,033,264,845,458,103,000
30.452736
74
0.665296
false
3.725398
false
false
false
hahnicity/pytrader
pytrader/algorithms/current_movers.py
1
4328
import argparse import os import warnings from finsymbols import get_nasdaq_symbols, get_sp500_symbols import numpy as np import pandas as pd import prettytable import quandl import scipy def pretty(rows): table = prettytable.PrettyTable() table.field_names = ['sym', 'return', 'median daily return', 'varianc...
gpl-2.0
5,102,011,764,655,440,000
30.136691
92
0.636784
false
3.098067
false
false
false
blackball/an-test6
net/migrations/0010_auto__add_field_submission_image_width__add_field_submission_image_hei.py
1
22797
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Submission.image_width' db.add_column('net_submission', 'image_width', self.gf('django.db....
gpl-2.0
230,356,554,271,535,500
75.757576
203
0.545467
false
3.643439
false
false
false
ministryofjustice/cla_backend
cla_backend/apps/call_centre/tests/test_permissions.py
1
2046
from django.conf.urls import patterns from django.http import HttpResponse from django.test import TestCase from rest_framework import status from rest_framework.authentication import OAuth2Authentication from rest_framework.views import APIView from legalaid.tests.views.test_base import CLAOperatorAuthBaseApiTestMixi...
mit
7,736,652,875,759,180,000
38.346154
110
0.689638
false
3.754128
true
false
false
BrandonY/python-docs-samples
vision/cloud-client/web/web_detect.py
1
3291
#!/usr/bin/env python # Copyright 2017 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...
apache-2.0
-1,111,505,834,110,121,200
31.584158
74
0.665755
false
4.04797
false
false
false
oscarduignan/django-jqueryautocomplete
jqueryautocomplete/widgets.py
1
2064
import datetime from django import forms from django.utils import simplejson from django.utils.safestring import mark_safe class JQueryAutoCompleteTextInput(forms.TextInput): """ A text input with jQuery auto completion, using the auto-complete plugin from Corey Hart. (http://www.codenothing.com/...
bsd-3-clause
3,191,570,503,607,956,500
30.272727
84
0.546027
false
4.186613
false
false
false
svisser/ipuz
ipuz/core.py
1
2835
import json from ipuz.exceptions import IPUZException from ipuz.puzzlekinds import IPUZ_PUZZLEKINDS from ipuz.validators import ( IPUZ_FIELD_VALIDATORS, validate_version, get_version_number, get_kind_version_number, ) # The versions of the ipuz standard that this library supports IPUZ_VERSIONS = list(...
mit
-3,601,083,290,767,979,500
35.346154
101
0.617284
false
3.99859
false
false
false
ddcatgg/dglib
dglib/cache_util.py
1
3581
# -*- coding: utf-8 -*- import os import json import pickle import codecs from collections import Sequence from functools import wraps from dglib.utils import makesure_dirpathexists FORMAT_JSON = 1 FORMAT_PICKLE = 2 FORMAT_TXT = 3 class FileCache(object): def __init__(self): self.enable...
mit
-3,120,584,241,540,575,000
34.540816
104
0.557665
false
4.037204
false
false
false
nnugumanov/yandex-tank
yandextank/plugins/Bfg/worker.py
1
9133
import logging import time import threading as th import multiprocessing as mp from queue import Empty, Full from ...stepper import StpdReader logger = logging.getLogger(__name__) class BFGBase(object): """ A BFG load generator that manages multiple workers as processes and threads in each of them and f...
lgpl-2.1
8,588,385,986,592,215,000
32.332117
105
0.526114
false
4.490167
false
false
false
openjck/kuma
kuma/demos/templatetags/jinja_helpers.py
1
9273
import datetime import functools import hashlib import random import bitly_api import jinja2 from django.conf import settings from django.template.loader import get_template from django.utils.encoding import smart_str from django.utils.translation import ugettext, ungettext from django_jinja import library from taggit...
mpl-2.0
7,921,368,707,229,923,000
29.503289
79
0.635393
false
3.730088
false
false
false
pratyush912/dokkom
compare.py
1
3621
import argparse import logging import constants import os import utils import nltk from nltk import metrics """ total steps- - token comparison - fuzzy comparison """ init_term_1 = 0 init_term_2 = 0 def fuzzy_comparison(tokens_1,tokens_2,max_dist=1): """ compares the tokens based on fuzzy match """ matched ...
mit
2,964,150,287,837,646,000
33.160377
249
0.693455
false
3.154181
false
false
false
holtzhau/captioncapture
segment.py
1
33077
import cv, cv2 import numpy as np import os import ext from random import randint import subprocess from tools import get_patch, overlaps, intersect, contour_to_rect, merge, cv2num from tools import OpencvRecorder import json import string import time import sys import tesseract_sip as tesseract tessdata_prefix = os....
mit
-8,041,965,217,716,480,000
39.387057
129
0.480817
false
3.568177
false
false
false
rinrinne/cueproc-alternative
src/ce_hmp3.py
1
2706
# -*- coding: utf-8 -*- """ Output Plugin for Helix MP3 encoder Copyright (c) 2006-2008 by Nyaochi 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 yo...
gpl-2.0
5,889,097,140,595,457,000
34.142857
79
0.621582
false
3.732414
false
false
false
phenoxim/nova
nova/network/base_api.py
1
14669
# Copyright 2014 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 requi...
apache-2.0
-9,078,694,112,329,378,000
38.432796
79
0.630377
false
4.768856
false
false
false
erkyrath/tworld
lib/tweblib/bhandlers.py
1
72557
""" The build-related URI request handlers used by Tweb. """ import datetime import random import json import ast import re import collections from bson.objectid import ObjectId import tornado.web import tornado.gen import tornado.escape import motor import tweblib.handlers import twcommon.misc import twcommon.inte...
mit
-5,276,753,249,513,065,000
42.920702
113
0.507808
false
4.40808
false
false
false
googlegenomics/cloudml-examples
trainer/variant_encoder.py
1
7251
#!/usr/bin/python # Copyright 2016 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 or agre...
apache-2.0
4,071,824,172,763,664,400
30.802632
80
0.704592
false
3.936482
false
false
false
indexofire/gork
src/gork/application/feedz/admin.py
1
1967
# -*- coding: utf-8 -*- from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from django.utils.http import urlencode from feedz.models import Feed, FeedEntry, Request from feedz.utils import html_link class FeedAdmin(admin.ModelAdmin): ...
mit
3,230,631,232,995,276,000
29.261538
78
0.616675
false
3.52509
false
false
false
bitcraze/crazyflie-firmware
tools/lighthouse/get_lh2_calib_data.py
1
3003
#!/usr/bin/env python3 # ,---------, ____ _ __ # | ,-^-, | / __ )(_) /_______________ _____ ___ # | ( O ) | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # | / ,--´ | / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # +------` /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Crazyflie control firmwar...
gpl-3.0
4,548,894,918,158,381,000
28.145631
94
0.602265
false
3.10124
false
false
false
lmazuel/azure-sdk-for-python
azure-batch/azure/batch/models/pool_resize_parameter.py
1
2464
# 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 ...
mit
-6,395,466,412,223,387,000
48.28
136
0.67086
false
4.270364
false
false
false
scikit-build/scikit-ci-addons
_tests/__init__.py
1
1715
import errno import os from contextlib import contextmanager def captured_lines(cap): """Given a ``capsys`` or ``capfd`` pytest fixture, return a tuple of the form ``(out_lines, error_lines)``. See http://doc.pytest.org/en/latest/capture.html """ out, err = cap.readouterr() return (out.rep...
apache-2.0
1,903,687,817,247,257,300
26.66129
76
0.637901
false
3.906606
false
false
false
wevote/WeVoteServer
import_export_batches/controllers_batch_process.py
1
143322
# import_export_batches/controllers_batch_process.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from .controllers import create_batch_row_actions, import_data_from_batch_row_actions from .models import ACTIVITY_NOTICE_PROCESS, API_REFRESH_REQUEST, \ AUGMENT_ANALYTICS_ACTION_WITH_ELECTION_ID, AUG...
mit
-7,671,355,043,315,763,000
48.387319
119
0.578209
false
4.004079
false
false
false
joker-b/kbImport
classes/DNGConverter.py
1
1782
#! /bin/python import os import re from AppOptions import AppOptions class DNGConverter(object): """handle optional DNG conversion""" regexDNGsrc = re.compile(r'(.*)\.RW2') @classmethod def filetype_search(cls, Filename): return cls.regexDNGsrc.search(Filename) def __init__(self, Options=AppOptions())...
gpl-2.0
-3,485,934,855,460,652,500
28.7
78
0.621773
false
3.275735
false
false
false
seakers/daphne_brain
dialogue/views.py
1
7758
import datetime import json from collections import OrderedDict import numpy as np from rest_framework.views import APIView from rest_framework.response import Response from daphne_brain.nlp_object import nlp from dialogue.nn_models import nn_models import dialogue.command_processing as command_processing from auth_A...
mit
8,962,239,931,890,022,000
44.104651
121
0.5843
false
4.523615
false
false
false
memodir/cv
setup.py
1
1179
import os import os.path from setuptools import setup, find_packages def find_packages_data(start_dir): packages = {} for package_name in os.listdir(start_dir): package_dir = os.path.join(start_dir, package_name) if os.path.exists(os.path.join(package_dir, '__init__.py')): files =...
apache-2.0
-438,789,970,108,116,500
30.864865
77
0.553859
false
3.778846
false
false
false
PsyBorgs/redditanalyser
app/tests/test_scraper.py
1
4347
import pytest import praw from app import reddit, scraper from app.models import Submission, Comment def get_and_parse_reddit_submission(submission_id): reddit_submission = reddit.get_submission(submission_id=submission_id) info, comments = scraper.parse_submission(reddit_submission, Submission) return...
mit
3,943,109,646,573,914,000
27.788079
77
0.599724
false
3.398749
false
false
false
siddartha1992/cloud-custodian
c7n/actions.py
1
26880
# Copyright 2016 Capital One Services, 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 agreed to in...
apache-2.0
-5,656,860,922,962,306,000
34.183246
99
0.545833
false
4.270734
false
false
false
Edzvu/Edzvu.github.io
M2Crypto-0.35.2/M2Crypto/DH.py
1
2946
from __future__ import absolute_import """M2Crypto wrapper for OpenSSL DH API. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" from M2Crypto import BIO, m2, util from M2Crypto.util import genparam_callback if util.py27plus: from typing import AnyStr, Callable # noqa class DHError(Exception): ...
mit
-7,517,597,864,788,091,000
25.070796
68
0.565513
false
3.033986
false
false
false
Shouqun/node-gn
tools/depot_tools/owners.py
1
18144
# Copyright (c) 2012 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. """A database of OWNERS files. OWNERS files indicate who is allowed to approve changes in a specific directory (or who is allowed to make changes withou...
mit
-6,067,931,387,876,016,000
34.857708
80
0.648975
false
3.759635
false
false
false
timestocome/Test-stock-prediction-algorithms
Curves, Markov and Bayes/PredictMarketWithBayesTheorem.py
1
6020
# http://github.com/timestocome # # Build Bayesian using daily BitCoin Closing Price # Use today and tomorrow's data to see if it can predict # next few days market movements from collections import Counter import pandas as pd import numpy as np # http://coindesk.com/price data_file = 'BitCoin_Daily_Close.csv...
mit
3,078,792,957,471,607,000
24.508475
108
0.51495
false
3.829517
false
false
false
kirberich/huegely
src/huegely/features.py
1
16373
from huegely import ( exceptions, utils ) class FeatureBase(object): """ Base interface for all features, mostly concerned with device state. """ transition_time = None _reset_brightness_to = None def __init__(self, bridge, device_id, name=None, transition_time=None): if not (hasattr(...
mit
3,532,929,648,971,568,000
41.527273
131
0.635192
false
4.274935
false
false
false
jeremiedecock/snippets
python/cvxopt_linear_program_solver/python_2.7/test_lp_with_numpy_array.py
1
2193
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org) # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including withou...
mit
-3,111,727,807,879,935,500
25.012048
79
0.628069
false
3.011158
false
false
false
isandlaTech/cohorte-devtools
qualifier/deploy/cohorte-home/repo/cohorte/forker/starters/cohorte_boot.py
1
9029
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ Starts Cohorte isolates using the boot script :author: Thomas Calmant :license: Apache Software License 2.0 :version: 1.1.0 .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file ex...
apache-2.0
2,648,220,037,437,899,000
32.943609
80
0.5654
false
4.500997
true
false
false
GNOME/orca
src/orca/scripts/toolkits/Chromium/script_utilities.py
1
20616
# Orca # # Copyright 2018-2019 Igalia, S.L. # # Author: Joanmarie Diggs <jdiggs@igalia.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.1 of the License, or (at y...
lgpl-2.1
9,159,390,333,854,405,000
35.880143
102
0.609866
false
4.016365
false
false
false
peoplepower/botengine
com.ppc.Bot/devices/device.py
1
41352
''' Created on June 28, 2016 This file is subject to the terms and conditions defined in the file 'LICENSE.txt', which is part of this source code package. @author: David Moss ''' import utilities.utilities as utilities import intelligence.index import importlib # This is the maximum number of elements we'll averag...
apache-2.0
3,055,767,109,910,021,600
42.25523
200
0.578086
false
4.504085
false
false
false
uktrade/navigator
app/markets/migrations/0049_published_market_model.py
1
13211
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-12-19 22:06 from __future__ import unicode_literals import ckeditor.fields from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('geography', '0007_new_countries_remov...
mit
6,344,819,068,667,233,000
75.364162
118
0.456514
false
5.474927
false
false
false
JeroenZegers/Nabu-MSSS
nabu/postprocessing/scorers/bss_eval.py
1
57733
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Source separation algorithms attempt to extract recordings of individual sources from a recording of a mixture of sources. Evaluation methods for source separation compare the extracted sources from reference sources and attempt to measure the perceptual quality of th...
mit
-3,140,351,178,538,931,700
41.890045
92
0.611051
false
3.703727
false
false
false
TshepangRas/tshilo-dikotla
td_maternal/tests/test_rapid_test_form.py
1
3193
from django.utils import timezone from edc_constants.constants import YES, NO, POS, NEG, IND from .factories import MaternalEligibilityFactory from .factories import MaternalConsentFactory from td_maternal.forms import RapidTestResultForm, BaseMaternalModelForm from ..models import RapidTestResult from .base_test_ca...
gpl-2.0
-3,549,507,702,655,401,500
45.275362
107
0.642969
false
3.649143
true
false
false
redshodan/cairn
src/python/cairn/Options.py
1
16437
"""CAIRN runtime options - result of commandline options and config file""" import thirdparty.myoptparse as optparse import os import os.path import platform import re import string import sys import time from gettext import gettext as _ import cairn from cairn import Logging from cairn import Version # module glo...
gpl-2.0
-3,359,431,723,274,468,000
31.166341
181
0.668127
false
3.089662
false
false
false
ilastik/ilastik-0.5
ilastik/gui/ribbons/standardRibbons.py
1
4696
# -*- coding: utf-8 -*- from PyQt4 import QtGui, QtCore from ilastik.gui.ribbons.ilastikTabBase import IlastikTabBase, TabButton from ilastik.gui.iconMgr import ilastikIcons from ilastik.gui.overlaySelectionDlg import OverlaySelectionDialog from ilastik.gui.overlayWidget import OverlayWidget from ilastik.core.overlay...
bsd-2-clause
-7,886,372,269,596,558,000
42.481481
230
0.633731
false
3.946218
false
false
false
CanonicalLtd/subiquity
subiquity/server/controllers/keyboard.py
1
2319
# Copyright 2015 Canonical, Ltd. # # 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 distribute...
agpl-3.0
1,952,559,996,971,742,500
30.337838
74
0.667098
false
4.019064
false
false
false
rk700/rbook
rbook/utils.py
1
5438
#!/usr/bin/env python #-*- coding: utf8 -*- # # Copyright (C) 2012 Ruikai Liu <lrk700@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 3 of the License, or # (at your ...
gpl-3.0
367,495,738,030,341,500
32.9875
95
0.500368
false
4.12282
true
false
false
mpalop/nekane
DietaNekane/Plato.py
1
1922
#!/usr/local/bin/python # -*- coding: utf-8 -*- import copy from Normalizador import normalizador class Propiedades(object): def __init__(self, **props): self._props = props def __repr__(self): return str(self._props) def props(self): return self._props def __add__(self, o...
gpl-2.0
-2,320,665,613,877,174,000
26.869565
88
0.586368
false
3.432143
false
false
false
azlux/pymumble
pymumble_py3/soundqueue.py
1
5147
# -*- coding: utf-8 -*- import time from threading import Lock from collections import deque import opuslib from .constants import * class SoundQueue: """ Per user storage of received audio frames Takes care of the decoding of the received audio """ def __init__(self, mumble_object): sel...
gpl-3.0
-7,797,572,195,105,581,000
35.246479
154
0.555469
false
4.239703
false
false
false
qiqi/fds
debug/timedilation.py
1
1750
import sys, os from numpy import * from scipy.integrate import odeint sys.path.append('/home/qiqi/git/fds') import fds def dudt(u): x, dxdt = u ddxdtt = (1 - x**2) * dxdt - x #ddxdtt = (1 - x**2 - dxdt**2) * dxdt - x return array([dxdt, ddxdtt]) def run(u, dt, nsteps): J = empty(nsteps) for i ...
gpl-3.0
7,106,852,345,695,809,000
28.166667
125
0.576571
false
2.232143
false
false
false
cpennington/edx-platform
openedx/tests/xblock_integration/xblock_testcase.py
1
20601
"""This file defines a testing framework for XBlocks. This framework is designed to be independent of the edx-platform, to allow: 1. The tests to move into the XBlock repositories. 2. The tests to work in xblock-sdk and other runtimes. This is a prototype. We reserve the right to change the APIs at any point, and exp...
agpl-3.0
-3,545,091,184,409,889,300
38.314885
95
0.599777
false
4.464889
true
false
false
Lektorium-LLC/edx-ora2
test/acceptance/pages.py
1
30614
""" Page objects for UI-level acceptance tests. """ import os from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise, BrokenPromise ORA_SANDBOX_URL = os.environ.get('ORA_SANDBOX_URL') class PageConfigurationError(Exception): """ A page object was not configured correctly. """ ...
agpl-3.0
3,413,280,344,907,019,000
33.90764
127
0.610407
false
4.328903
false
false
false
ortoo/schooldata
update_school_data.py
1
2072
import governorhub import logging import os import json import loggly.handlers from datetime import datetime from gcloud import pubsub from dfe_data import update_dfe_data logging.basicConfig(level=logging.INFO) # Turn off requests INFO level logging requests_log = logging.getLogger("requests") requests_log.setLevel...
mit
7,451,969,512,480,413,000
27.777778
111
0.675676
false
3.740072
false
false
false
relic7/prodimages
python/ipython_ext/ipython_notebook_config.py
1
27183
# Configuration file for ipython-notebook. c = get_config() # Kernel config c.IPKernelApp.pylab = 'inline' # if you want plotting support always # Notebook config ### nbServer Config c.NotebookApp.ip = '192.168.20.59' c.NotebookApp.port = 8888 # c.NotebookApp.file_to_run = '' ## Env Set # The IPython profile to use...
mit
1,932,875,938,127,492,000
36.339286
381
0.696869
false
3.716063
true
false
false
xingjian-f/Leetcode-solution
33. Search in Rotated Sorted Array.py
1
1117
class Solution(object): def search(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ max_pos = len(nums) - 1 posl = 0 posr = len(nums) while posl < posr: mid = (posl + posr) / 2 if nums[mid] <= n...
mit
-7,322,040,521,857,881,000
21.816327
35
0.405551
false
3.173295
false
false
false
Jumpscale/jumpscale_core8
lib/JumpScale/tools/cuisine/apps/CuisineVolumeDriver.py
1
3307
from JumpScale import j from time import sleep app = j.tools.cuisine._getBaseAppClass() class CuisineVolumeDriver(app): NAME = "volumedriver" def __init__(self, executor, cuisine): self._executor = executor self._cuisine = cuisine self.logger = j.logger.get("j.tools.cuisine.volumedr...
apache-2.0
-2,210,088,543,335,542,000
38.369048
118
0.641972
false
3.444792
false
false
false