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
salkinium/bachelor
experiment_control/commands/base.py
1
1510
# -*- coding: utf-8 -*- # Copyright (c) 2014, Niklas Hauser # All rights reserved. # # The file is part of my bachelor thesis and is released under the 3-clause BSD # license. See the file `LICENSE` for the full license governing this code. # -----------------------------------------------------------------------------...
bsd-2-clause
-1,765,331,765,717,810,700
29.2
97
0.580795
false
4.389535
false
false
false
elitegreg/mudpy
tyderium/socket.py
1
2832
from . import lib from .timeout import Timeout import greenlet import errno import socket as stdsocket from socket import * # for convenience from socket import timeout as timeout_error class socket(stdsocket.socket): __slots__ = () def __init__(self, *args, **kwargs): super().__init__(*args, **kw...
gpl-3.0
5,062,856,902,460,464,000
29.782609
83
0.521893
false
4.02845
false
false
false
drm343/HalfDragon_Bot
v2/main.py
1
5127
#!/usr/bin/env python # -*- coding: utf-8 -*- import androidhelper import requests import json import telebot import telebot.util as util import sys import time import os bot = telebot.TeleBot(my_token) class MachineStatus: def __init__(self): self.phone = androidhelper.Android() self.phone.batter...
mit
-4,120,896,432,437,278,700
25.972222
100
0.59691
false
3.015528
false
false
false
llinmeng/PythonStudy
python_project/23/newsagent2.py
1
4783
# -*- coding: utf-8 -*- from nntplib import NNTP from time import strftime, time, localtime from email import message_from_string from urllib import urlopen import textwrap import re day = 24 * 60 * 60 # 一天的秒数 def wrap(string, max = 70): """ 将字符串调整为最大行宽 :param string: :par...
mit
-7,183,054,910,938,134,000
22.989071
83
0.525177
false
3.097389
false
false
false
MattDevo/edk2
BaseTools/Source/Python/Eot/EotMain.py
1
69215
## @file # This file is used to be the main entrance of EOT tool # # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The ...
bsd-2-clause
-5,653,460,506,086,089,000
38.241279
199
0.54166
false
3.864385
false
false
false
nilouco/dpAutoRigSystem
dpAutoRigSystem/Modules/dpWheel.py
1
35159
# Thanks to Andrew Christophersen # Maya Wheel Rig with World Vectors video tutorial # https://youtu.be/QpDc93br3dM # importing libraries: import maya.cmds as cmds from Library import dpUtils as utils import dpBaseClass as Base import dpLayoutClass as Layout # global variables to this module: CLASS_NAME = "Whe...
gpl-2.0
6,195,987,666,483,919,000
73.649682
272
0.622401
false
3.578888
false
false
false
Nikola-K/tp_smapi_pyqt
design.py
1
28157
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'design.ui' # # Created: Sat Feb 7 18:23:12 2015 # by: PyQt4 UI code generator 4.11.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attribu...
mit
4,475,475,535,524,859,400
66.358852
825
0.707949
false
3.637726
false
false
false
brunoabud/ic
gui/vertical_scroll_area.py
1
1965
# coding: utf-8 # Copyright (C) 2016 Bruno Abude Cardoso # # Imagem Cinemática is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Imag...
gpl-3.0
2,268,670,650,056,277,000
40.765957
113
0.695364
false
3.910359
false
false
false
explosion/ml-datasets
ml_datasets/loaders/dbpedia.py
1
1090
from pathlib import Path import csv import random from ..util import get_file from .._registry import register_loader # DBPedia Ontology from https://course.fast.ai/datasets DBPEDIA_ONTOLOGY_URL = "https://s3.amazonaws.com/fast-ai-nlp/dbpedia_csv.tgz" @register_loader("dbpedia") def dbpedia(loc=None, *, train_limi...
mit
-6,058,549,363,968,170,000
28.459459
83
0.62844
false
3.087819
false
false
false
asadoughi/python-neutronclient
neutronclient/neutron/v2_0/vpn/vpnservice.py
1
3371
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # (c) Copyright 2013 Hewlett-Packard Development Company, L.P. # 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...
apache-2.0
8,309,112,606,520,467,000
33.050505
78
0.627707
false
4.051683
false
false
false
Brian151/OpenShockwave
tools/imports/shockabsorber/model/cast.py
1
1698
class CastLibraryTable: #------------------------------ def __init__(self, castlibs): self.by_nr = {} self.by_assoc_id = {} for cl in castlibs: self.by_nr[cl.nr] = cl if cl.assoc_id>0: self.by_assoc_id[cl.assoc_id] = cl def iter_by_nr(self): ...
apache-2.0
846,849,474,389,359,700
36.733333
126
0.526502
false
3.675325
false
false
false
rande/python-element
element/plugins/seo/seo.py
1
3479
# # Copyright 2014 Thomas Rabaix <thomas.rabaix@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
-5,339,116,559,207,831,000
30.342342
92
0.5904
false
3.835722
false
false
false
Kongsea/tensorflow
tensorflow/contrib/model_pruning/python/pruning_test.py
1
6703
# Copyright 2017 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
-7,917,016,903,297,070,000
40.376543
80
0.687453
false
3.529753
true
false
false
praekelt/go-contacts-api
go_contacts/handlers/contacts_for_group.py
1
1590
from cyclone.web import HTTPError from go_api.cyclone.handlers import BaseHandler from go_api.collections.errors import ( CollectionUsageError, CollectionObjectNotFound) from twisted.internet.defer import maybeDeferred class ContactsForGroupHandler(BaseHandler): """ Handler for getting all contacts for ...
bsd-3-clause
5,880,230,675,900,789,000
35.976744
72
0.633962
false
4.140625
false
false
false
sdague/gatemine
gatemine/results.py
1
1881
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
apache-2.0
-6,920,318,627,922,871,000
26.26087
78
0.636364
false
3.90249
false
false
false
nealp9084/hw3
negotiator_framework.py
1
6109
from csv import DictReader import csv from sys import argv, exit # from negotiator import Negotiator # from door_in_face_negotiator import DoorInFaceNegotiator # from greedy_negotiator import GreedyNegotiator # from door_in_face_dummy import DIFDummyNegotiator # from negotiator_a import Negotiator_A from random import ...
mit
-8,557,401,489,509,834,000
50.336134
141
0.650188
false
3.825297
false
false
false
cherishing78/BSVer
Yintest/noloop.py
1
3693
import numpy as np def Initial_diag(dim): conv=np.diag(np.random.rand(dim)) return conv def Convergence(matrix): delta=(np.abs(matrix).max(axis=0)).max(axis=0) return delta def Train(trainingset,label): (imagenum,dim)=trainingset.shape #Each column vector stands for a image. dataset=np.transpose(trainingset) ...
bsd-3-clause
7,908,429,308,505,981,000
29.02439
122
0.655835
false
2.365791
false
false
false
psychopy/psychopy
psychopy/experiment/components/joyButtons/virtualJoyButtons.py
1
1281
#!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2021 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). # Support for fake joystick/gamepad during development # if no 'real' joystick/gamepad is ...
gpl-3.0
-8,302,396,992,503,322,000
39.03125
109
0.67057
false
3.519231
false
false
false
deepmind/reverb
reverb/client_test.py
1
17392
# Lint as: python3 # Copyright 2019 DeepMind Technologies Limited. # # 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 ap...
apache-2.0
5,739,390,927,420,527,000
35.308977
80
0.652196
false
3.455593
true
false
false
mauriciogtec/PropedeuticoDataScience2017
Alumnos/Leonardo_Marin/Tarea 2 {spyder}.py
1
2336
####################################################################### ### Parte 2 import numpy as np import pandas as pd import matplotlib.pyplot as plt from PIL import Image ##################################################################### ## Ejercicio 1 # Importar imagen imagen = Image.open('C:/Users...
mit
2,516,087,497,806,065,700
18.272727
150
0.606775
false
2.562637
false
false
false
nemesisdesign/openwisp2
openwisp_controller/vpn_backends.py
1
1648
from copy import deepcopy from netjsonconfig import OpenVpn as BaseOpenVpn # adapt OpenVPN schema in order to limit it to 1 item only limited_schema = deepcopy(BaseOpenVpn.schema) limited_schema['properties']['openvpn'].update( {'additionalItems': False, 'minItems': 1, 'maxItems': 1} ) # server mode only limited_...
gpl-3.0
8,774,440,878,577,652,000
35.622222
85
0.613471
false
3.695067
false
false
false
doconix/django-mako-plus
django_mako_plus/tags.py
1
2889
from django.template import engines from django.template import TemplateDoesNotExist from mako.runtime import supports_caller ### ### Mako-style tags that DMP provides ### ############################################################### ### Include Django templates ### def django_include(context, template_name, **...
apache-2.0
-1,902,192,503,060,209,200
30.747253
149
0.66009
false
4.261062
false
false
false
opticode/eve
eve/__init__.py
1
1947
# -*- coding: utf-8 -*- """ Eve ~~~ An out-of-the-box REST Web API that's as dangerous as you want it to be. :copyright: (c) 2014 by Nicola Iarocci. :license: BSD, see LICENSE for more details. .. versionchanged:: 0.5 'QUERY_WHERE' added. 'QUERY_SORT' added. 'QUERY_PAGE'...
bsd-3-clause
683,748,090,322,254,000
21.905882
77
0.618901
false
2.977064
false
false
false
anushbmx/kitsune
kitsune/questions/config.py
1
16005
from collections import OrderedDict from django.utils.translation import ugettext_lazy as _lazy # The number of answers per page. ANSWERS_PER_PAGE = 20 # The number of questions per page. QUESTIONS_PER_PAGE = 20 # Highest ranking to show for a user HIGHEST_RANKING = 100 # Special tag names: ESCALATE_TAG_NAME = 'es...
bsd-3-clause
1,854,020,737,929,702,700
34.64588
83
0.436114
false
4.278268
false
false
false
chaen/DIRAC
ResourceStatusSystem/Service/ResourceManagementHandler.py
1
6218
''' ResourceManagementHandler Module that allows users to access the ResourceManagementDB remotely. ''' from DIRAC import gConfig, S_OK, gLogger from DIRAC.Core.DISET.RequestHandler import RequestHandler from DIRAC.ResourceStatusSystem.Utilities import Synchronizer from DIRAC.ResourceStatusSystem.DB.ResourceManagem...
gpl-3.0
3,929,100,881,457,097,700
30.72449
92
0.660663
false
4.115156
false
false
false
fcopantoja/djangomx
djangomx/blog/models.py
1
3689
# coding: utf-8 import os from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.core import urlresolvers from django.db import models from django.utils.translation import ugettext as _ from core.utils import get_...
mit
760,292,171,597,744,800
28.44
80
0.602717
false
3.698492
false
false
false
marvin-ai/marvin-python-toolbox
marvin_python_toolbox/engine_base/engine_base_prediction.py
1
1656
#!/usr/bin/env python # coding=utf-8 # Copyright [2017] [B2W Digital] # # 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...
apache-2.0
1,667,712,753,690,461,200
28.571429
74
0.701087
false
3.833333
false
false
false
weiweihuanghuang/wei-glyphs-scripts
Spacing/Show Kerning Pairs Exception.py
1
3326
#MenuTitle: Show Kerning Pairs Exception # -*- coding: utf-8 -*- __doc__=""" Show Kerning Exception Pairs for this glyph in a new tab. """ import GlyphsApp thisFont = Glyphs.font Doc = Glyphs.currentDocument selectedLayers = thisFont.selectedLayers namesOfSelectedGlyphs = [ l.parent.name for l in selectedLayers if ha...
apache-2.0
-6,634,094,482,841,212,000
31.617647
93
0.634396
false
2.746491
false
false
false
ddico/odoo
addons/hr_recruitment/models/hr_job.py
1
6632
# Part of Odoo. See LICENSE file for full copyright and licensing details. import ast from odoo import api, fields, models, _ class Job(models.Model): _name = "hr.job" _inherit = ["mail.alias.mixin", "hr.job"] _order = "state desc, name asc" @api.model def _default_address_id(self): ret...
agpl-3.0
-2,389,517,044,412,755,000
44.424658
190
0.592129
false
3.561762
false
false
false
emijrp/wmcharts
wmchart0004.py
1
3064
# -*- coding: utf-8 -*- # Copyright (C) 2011-2014 emijrp <emijrp@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 option) any later vers...
gpl-3.0
4,346,915,588,700,290,000
51.827586
337
0.666123
false
3.462147
false
false
false
talkoopaiva/talkoohakemisto-api
tests/views/test_types.py
1
3151
import operator from flask import url_for import pytest from talkoohakemisto import serializers from talkoohakemisto.extensions import db from tests import factories @pytest.mark.usefixtures('request_ctx', 'database') class TestTypeIndex(object): @pytest.fixture def types(self): types = [ ...
mit
-4,321,390,514,477,213,000
27.908257
62
0.645509
false
3.928928
true
false
false
jmescuderojustel/codeyourblogin-python-django-1.7
src/blog/tools.py
1
1304
from django.conf import settings import math from django.core.exceptions import PermissionDenied from django.shortcuts import render, redirect class Pager: def __init__(self, page, count): if page is None or int(page) < 1: page = 1 else: page= int(page) self.curr...
mit
731,154,896,484,565,500
22.727273
81
0.644939
false
3.7151
false
false
false
maxalbert/colormap-selector
color_transformations_skimage.py
1
1823
import numpy as np import matplotlib.colors as mcolors from skimage.color import rgb2lab as rgb2lab_skimage from skimage.color import lab2rgb as lab2rgb_skimage class RGBRangeError(Exception): pass def rgb2lab(rgb): rgb = np.asarray(rgb).reshape(1, 1, 3) lab = rgb2lab_skimage(rgb).reshape(3) return ...
mit
1,315,041,971,995,979,500
30.982456
71
0.635217
false
3.053601
false
false
false
improve-project/platform
models/RehabilitationSetClass.py
1
1448
__author__ = 'tommipor' from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, Text, DateTime Base = declarative_base() class RehabilitationSetClass(Base): __tablename__ = 'RehabilitationSet' rehabilitationSetID = Column(String(255), primary_key=True) ...
bsd-3-clause
-780,814,773,737,549,400
41.617647
197
0.679558
false
4.01108
false
false
false
SonyCSL/CSLAIER
src/common/nvidia_devices_info.py
1
11234
#!/usr/bin/env python2 import ctypes import platform from logging import getLogger logger = getLogger(__name__) class c_cudaDeviceProp(ctypes.Structure): """ Passed to cudart.cudaGetDeviceProperties() """ _fields_ = [ ('name', ctypes.c_char * 256), ('totalGlobalMem', ctypes.c_size_t)...
mit
-8,568,659,771,402,383,000
30.205556
107
0.57504
false
3.498599
false
false
false
ekholabs/ekholabs-es
service/ElasticsearchService.py
1
1093
from ElasticsearchConnection import Resource from uuid import uuid4 class ElasticsearchIndex: @staticmethod def create(index_name, settings): es = Resource().connect() index = es.indices.create(index=index_name, ignore=400, body=settings) return index @staticmethod def delet...
mit
-8,110,233,009,886,834,000
27.025641
92
0.651418
false
4.063197
false
false
false
lexelby/apiary
historical/mysql_watcher/dblibs/dbutil.py
1
47774
#!/usr/bin/env python # # $LicenseInfo:firstyear=2007&license=mit$ # # Copyright (c) 2007-2010, Linden Research, Inc. # # 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,...
mit
-3,236,365,569,771,306,500
37.127694
126
0.570226
false
3.741405
false
false
false
neeraj-kumar/nkpylib
nkmturk.py
1
5946
#!/usr/bin/env python """Mechanical Turk-related utilities, written by Neeraj Kumar. Licensed under the 3-clause BSD License: Copyright (c) 2013, Neeraj Kumar (neerajkumar.org) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the follow...
bsd-3-clause
2,662,317,386,595,247,600
35.478528
111
0.623276
false
3.836129
false
false
false
coolkang/hsbsite
settings.py
1
12906
from __future__ import absolute_import, unicode_literals ###################### # MEZZANINE SETTINGS # ###################### # The following settings are already defined with default values in # the ``defaults.py`` module within each of Mezzanine's apps, but are # common enough to be put here, commented out, for con...
apache-2.0
5,025,741,811,072,452,000
33.600536
79
0.685573
false
3.607043
false
false
false
unicefuganda/uSurvey
survey/views/indicators.py
1
15675
import json import plotly.offline as opy import plotly.graph_objs as go from django.utils.safestring import mark_safe from django.contrib import messages from django.contrib.auth.decorators import permission_required, login_required from django.http import HttpResponseRedirect, HttpResponse, JsonResponse from django.sh...
bsd-3-clause
-3,426,124,051,870,418,000
37.703704
99
0.637321
false
4.099111
false
false
false
dpgaspar/Flask-AppBuilder
examples/quickimages/config.py
1
1704
import os basedir = os.path.abspath(os.path.dirname(__file__)) CSRF_ENABLED = True SECRET_KEY = "\2\1thisismyscretkey\1\2\e\y\y\h" OPENID_PROVIDERS = [ {"name": "Google", "url": "https://www.google.com/accounts/o8/id"}, {"name": "Yahoo", "url": "https://me.yahoo.com"}, {"name": "AOL", "url": "http://open...
bsd-3-clause
6,128,436,733,377,320,000
31.150943
72
0.572183
false
2.609495
false
false
false
ClearCorp-dev/odoo-costa-rica
l10n_cr_hr_payroll/hr_employee.py
1
2087
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
agpl-3.0
1,186,865,629,129,506,300
40.76
147
0.624341
false
4.044574
false
false
false
dahiro/shotgun-replica
shotgun_replica/python/tests/shotgun_replica_tests/sync/local_to_shotgun/test_entities_field_change.py
1
4097
''' Created on Nov 15, 2012 @author: bach ''' import unittest import tests_elefant from shotgun_replica import factories, entities from tests_elefant import commanda from shotgun_replica.sync import local_to_shotgun, shotgun_to_local from shotgun_replica.utilities import entityNaming, debug class Test( unittest.Test...
bsd-3-clause
-1,195,573,157,826,296,600
39.97
96
0.604833
false
4.344645
true
false
false
eckardm/archivematica
src/MCPClient/lib/clientScripts/archivematicaMoveSIP.py
1
2124
#!/usr/bin/env python2 # This file is part of Archivematica. # # Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica 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, ...
agpl-3.0
5,462,322,742,759,084,000
31.181818
77
0.713277
false
3.436893
false
false
false
doc-E-brown/FacialLandmarkingReview
experiments/Sec4_ModelDefinition/muctAAM.py
1
2082
#! /usr/bin/env python # -*- coding: utf-8 -*- # S.D.G """AAM test for MUCT dataset :author: Ben Johnston :license: 3-Clause BSD """ # Imports import os import menpo.io as mio from aam import AAM from menpofit.aam import HolisticAAM, PatchAAM from sklearn.model_selection import train_test_split MUCT_DATA_FOLDER = ...
gpl-3.0
-6,800,944,591,862,461,000
26.76
79
0.587896
false
3.608319
true
false
false
whiteclover/Choco
choco/runtime.py
1
28308
# choco/runtime.py # Copyright (C) 2006-2016 the Choco authors and contributors <see AUTHORS file> # # This module is part of Choco and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """provides runtime services for templates, including Context, Namespace, and various helper fu...
mit
-24,096,702,235,384,970
29.50431
79
0.593966
false
4.267109
false
false
false
glogiotatidis/mozillians-new
mozillians/users/models.py
1
18988
import os import uuid from datetime import datetime from django.conf import settings from django.contrib.auth.models import User from django.core.mail import send_mail from django.db import models from django.db.models import signals as dbsignals from django.dispatch import receiver from elasticutils.contrib.django i...
bsd-3-clause
-7,662,934,216,234,882,000
36.6
79
0.583421
false
3.972385
false
false
false
tommilligan/isoprene-pumpjack
isoprene_pumpjack/utils/neo_to_d3.py
1
2463
#!/usr/bin/env python ''' Transformation of Neo4J result object into a d3 friendly dictionary. ''' def dedupe_dict_list(duped, id_prop="id"): '''Dedupe a list of dicts by a dictionary property''' deduped = list({v[id_prop]:v for v in duped}.values()) return deduped def neo_node_to_d3_node(node): d3no...
apache-2.0
-6,120,799,362,977,779,000
25.483871
87
0.484369
false
3.687126
false
false
false
tomato42/tlsfuzzer
scripts/test-zero-length-data.py
1
6794
# Author: Hubert Kario, (c) 2015 # Released under Gnu GPL v2.0, see LICENSE file for details """Example empty appd data test""" from __future__ import print_function import traceback from random import sample import sys import re import getopt from tlsfuzzer.runner import Runner from tlsfuzzer.messages import Connect...
gpl-2.0
8,951,013,126,996,592,000
35.724324
108
0.583898
false
3.968458
true
false
false
mintchaos/django_esv
esv/__init__.py
1
1497
import urllib import httplib2 from django.conf import settings class EsvClientError(Exception): pass class PassageNotFoundError(EsvClientError): pass class EsvQuotaExceededError(EsvClientError): pass class EsvClient(object): def __init__(self, key='IP'): http_cache = getattr(settings, 'ESV_...
bsd-3-clause
5,610,947,664,951,156,000
31.565217
125
0.613894
false
3.878238
false
false
false
MJuddBooth/pandas
pandas/core/reshape/reshape.py
1
36628
# pylint: disable=E1101,E1103 # pylint: disable=W0703,W0622,W0613,W0201 from functools import partial import itertools import numpy as np from pandas._libs import algos as _algos, reshape as _reshape from pandas._libs.sparse import IntIndex from pandas.compat import PY2, range, text_type, u, zip from pandas.core.dty...
bsd-3-clause
777,959,914,915,552,400
34.017208
79
0.577209
false
3.857609
false
false
false
BetterWorks/django-anonymizer
anonymizer/management/commands/check_anonymizers.py
1
1139
from django.core.management import CommandError from django.core.management.base import AppCommand from anonymizer.utils import get_anonymizers try: unicode except NameError: unicode = str # python 3 class Command(AppCommand): def add_arguments(self, parser): parser.add_argument('args', metava...
mit
3,961,398,319,339,451,400
28.205128
82
0.579456
false
4.25
false
false
false
ZombieAlex/MFCAuto
src/main/genConstants.py
1
3164
import re from urllib.request import urlopen import json serverConfig = "https://www.myfreecams.com/_js/serverconfig.js" url = "https://www.myfreecams.com/_js/mfccore.js" # Maybe it's wrong to merge in the w. stuff? Is that all just for the UI? constantRe = re.compile(r'(\s|;?|,)(FCS|w)\.([A-Z0-9]+)_([A-Z0-9_]+)\s+?=\...
mit
4,662,721,920,012,275,000
38.061728
95
0.599874
false
3.173521
true
false
false
rdnetto/Kv-Creator
MainWindow.py
1
2302
import kivy.app import kivy.lang import traceback from threading import Thread from PySide.QtGui import * from Queue import Queue from creator_ui import Ui_MainWindow from kvparser import * def ErrorHandler(func): '''Function decorator for displaying exceptions''' def wrapper(*args, **kwargs): try...
gpl-2.0
8,181,468,927,837,841,000
24.577778
93
0.619461
false
4.132855
false
false
false
alkor/python-opcua
examples/minimal-server-with-encryption.py
1
1176
import sys sys.path.insert(0, "..") import time from opcua import ua, Server if __name__ == "__main__": # setup our server server = Server() server.set_endpoint("opc.tcp://0.0.0.0:4841/freeopcua/server/") # load server certificate and private key. This enables endpoints # with signing and encr...
lgpl-3.0
-747,732,777,772,497,200
27
70
0.644558
false
3.675
false
false
false
rphlo/django-seuranta
seuranta/app/views.py
1
2277
from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.shortcuts import render, get_object_or_404 from django.utils.timezone import now from seuranta.models import Competition @login_required def own_competitions(request): user = request.user ...
mit
-2,442,262,479,194,042,000
29.77027
69
0.646465
false
3.602848
false
false
false
prometheus/client_python
prometheus_client/values.py
1
4369
from __future__ import unicode_literals import os from threading import Lock import warnings from .mmap_dict import mmap_key, MmapedDict class MutexValue(object): """A float protected by a mutex.""" _multiprocess = False def __init__(self, typ, metric_name, name, labelnames, labelvalues, **kwargs): ...
apache-2.0
4,736,157,789,706,635,000
34.811475
165
0.590753
false
4.192898
false
false
false
ownport/local-ci
local_ci/travis.py
1
2167
# -*- coding: utf-8 -*- import os import re import utils from dispatchers import BaseDispatcher BASH_SCRIPT_TEMPLATE='''#!/bin/bash''' RE_ENV_PATTERN=re.compile(r'^.+?=.+?$') CI_STAGES = [ 'before_install', 'install', 'before_script', 'script', 'after_success', 'after_failure', 'before_deploy', 'de...
apache-2.0
3,065,606,958,559,906,000
28.283784
101
0.595293
false
3.749135
false
false
false
alfa-jor/addon
plugin.video.alfa/servers/gvideo.py
1
2665
# -*- coding: utf-8 -*- import urllib from core import httptools from core import scrapertools from platformcode import logger def test_video_exists(page_url): if 'googleusercontent' in page_url: return True, "" # desactivada verificación pq se encalla! response = httptools.downloadpage(page_url, h...
gpl-3.0
4,788,274,870,246,898,000
35.452055
122
0.606539
false
3.351385
false
false
false
ainafp/nilearn
plot_haxby_different_estimators.py
1
5881
""" Different classifiers in decoding the Haxby dataset ===================================================== Here we compare different classifiers on a visual object recognition decoding task. """ import time ### Fetch data using nilearn dataset fetcher ################################ from nilearn import datasets ...
bsd-3-clause
-6,053,872,600,998,459,000
34.215569
80
0.627444
false
3.791747
false
false
false
doirisks/dori
models/10.1001:archinte.167.10.1068/model_f.py
1
4027
""" model_f.py by Ted Morin contains a function to predict 8-year Diabtes Mellitus risks beta coefficients and logistic model from 10.1001/archinte.167.10.1068 2007 Prediction of Incident Diabetes Mellitus in Middle Aged Adults Framingham Heart Study (Table 5, Complex Model 2) function expects parameters of: "Male S...
gpl-3.0
3,382,809,701,925,434,000
34.307018
111
0.503602
false
3.411017
false
false
false
zstackorg/zstack-woodpecker
integrationtest/vm/vpc/suite_setup.py
1
4050
''' setup virtual router suite environment, including start zstack node, deploy initial database, setup vlan devices. @author: Frank ''' import os import zstacklib.utils.linux as linux import zstacklib.utils.http as http import zstacktestagent.plugins.host as host_plugin import zstacktestagent.testagent a...
apache-2.0
-1,399,914,541,662,224,000
53.479452
221
0.716543
false
3.316953
true
false
false
tidalf/plugin.audio.qobuz
resources/lib/qobuz/node/similar_artist.py
1
1695
''' qobuz.node.similar_artist ~~~~~~~~~~~~~~~~~~~~~~~~~ :part_of: kodi-qobuz :copyright: (c) 2012-2018 by Joachim Basmaison, Cyril Leclerc :license: GPLv3, see LICENSE for more details. ''' from qobuz import config from qobuz.api import api from qobuz.gui.util import lang from qobuz.node import get...
gpl-3.0
2,751,515,988,515,557,400
34.3125
78
0.60472
false
3.660907
false
false
false
repleo/bounca
api/urls.py
1
1469
"""API v1 end-points""" from django.conf.urls import include, url from rest_auth.registration.urls import urlpatterns as urlpatterns_registration from rest_auth.urls import urlpatterns as urlpatterns_rest_auth from rest_framework_swagger.views import get_swagger_view from .views import ( CertificateCRLFileView, C...
apache-2.0
38,793,706,840,446,420
42.205882
115
0.720218
false
3.618227
false
true
false
NMGRL/pychron
pychron/gis/views.py
1
2459
# =============================================================================== # Copyright 2020 ross # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
apache-2.0
-7,972,781,191,736,847,000
36.830769
96
0.583571
false
4.329225
false
false
false
linostar/timeline-clone
source/timelinelib/wxgui/component.py
1
2662
# Copyright (C) 2009, 2010, 2011 Rickard Lindberg, Roger Lindberg # # This file is part of Timeline. # # Timeline 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
7,427,410,965,997,319,000
26.163265
70
0.661533
false
3.797432
false
false
false
2gis/stf-utils
stf_utils/stf_record/protocol.py
1
2324
import time import logging from autobahn.asyncio.websocket import WebSocketClientProtocol log = logging.getLogger(__name__) class STFRecordProtocol(WebSocketClientProtocol): img_directory = None address = None resolution = None def __init__(self): super().__init__() self.first_msg_ti...
mit
4,412,727,215,913,162,000
36.483871
95
0.636403
false
3.886288
false
false
false
dls-controls/pymalcolm
tests/test_modules/test_builtin/test_basiccontroller.py
1
1213
import unittest from malcolm.core import Alarm, AlarmSeverity, Process from malcolm.modules.builtin.controllers import BasicController from malcolm.modules.builtin.infos import HealthInfo class TestBasicController(unittest.TestCase): def setUp(self): self.process = Process("proc") self.o = BasicC...
apache-2.0
2,259,333,449,535,143,000
35.757576
76
0.700742
false
3.407303
false
false
false
kontza/sigal
tests/test_encrypt.py
1
2796
import os import pickle from io import BytesIO from sigal import init_plugins from sigal.gallery import Gallery from sigal.plugins.encrypt import endec from sigal.plugins.encrypt.encrypt import cache_key CURRENT_DIR = os.path.dirname(__file__) def get_key_tag(settings): options = settings["encrypt_options"] ...
mit
7,785,521,272,187,205,000
32.285714
73
0.629471
false
3.856552
false
false
false
mohierf/bottle-webui
alignak_webui/objects/item_hostgroup.py
1
3392
#!/usr/bin/env python # -*- coding: utf-8 -*- # Many functions need to use protected members of a base class # pylint: disable=protected-access # Attributes need to be defined in constructor before initialization # pylint: disable=attribute-defined-outside-init # Copyright (c) 2015-2017: # Frederic Mohier, frederic....
agpl-3.0
-7,640,984,566,309,661,000
30.119266
98
0.637972
false
4.009456
false
false
false
mitsuhiko/sentry
src/sentry/db/models/base.py
1
3272
""" sentry.db.models ~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import logging from django.db import models from django.db.models import signals from .fields.bounded import Boun...
bsd-3-clause
4,136,426,230,593,140,000
25.387097
78
0.585269
false
3.853946
false
false
false
florian-f/sklearn
sklearn/linear_model/coordinate_descent.py
1
47058
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Gael Varoquaux <gael.varoquaux@inria.fr> # # License: BSD Style. import sys import warnings import itertools import operator from abc import AB...
bsd-3-clause
7,439,259,739,322,190,000
34.515472
97
0.585596
false
3.90102
false
false
false
keflavich/pyspeckit-obsolete
examples/n2hp_cube_example.py
1
2271
import pyspeckit import os if not os.path.exists('n2hp_cube.fit'): import astropy.utils.data as aud from astropy.io import fits f = aud.download_file('ftp://cdsarc.u-strasbg.fr/pub/cats/J/A%2BA/472/519/fits/opha_n2h.fit') with fits.open(f) as ff: ff[0].header['CUNIT3'] = 'm/s' for kw in...
mit
-5,961,305,820,016,318,000
39.553571
115
0.722589
false
3.011936
false
false
false
mrosenstihl/PulsePrograms
LED/LED_res.py
1
1841
class ParameterSet: """ From http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52308 Alex Martelli """ def __init__(self, **kwds): self.__dict__.update(kwds) def cyclops(timesignal, r_phase, accumulation_object): """ This is CYCLOPS phase cycling. Receiver phase must ...
bsd-2-clause
3,961,073,646,389,585,000
31.315789
84
0.573601
false
3.207317
false
false
false
enthought/sandia-data-archive
sdafile/tests/test_sda_file.py
1
26970
import io import os import random import shutil import unittest import numpy as np from numpy.testing import assert_array_equal, assert_equal from sdafile.exceptions import BadSDAFile from sdafile.sda_file import SDAFile from sdafile.testing import ( BAD_ATTRS, GOOD_ATTRS, MockRecordInserter, TEST_NUMERIC, TEST_C...
bsd-3-clause
-7,877,897,679,665,350,000
35.743869
79
0.559473
false
3.834234
true
false
false
sio2project/oioioi
oioioi/contestlogo/models.py
1
1997
import os.path from django.db import models from django.utils import timezone from django.utils.text import get_valid_filename from django.utils.translation import ugettext_lazy as _ from oioioi.contests.models import Contest from oioioi.filetracker.fields import FileField def make_logo_filename(instance, filename)...
gpl-3.0
-4,766,905,731,717,114,000
29.257576
86
0.667501
false
3.630909
true
false
false
wimac/home
Dropbox/skel/bin/sick-beard/sickbeard/metadata/tivo.py
1
13268
# Author: Nic Wolfe <nic@wolfeden.ca> # Author: Gordon Turner <gordonturner@gordonturner.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...
gpl-2.0
3,020,361,615,287,338,500
40.85489
176
0.562632
false
4.210727
false
false
false
jldbc/pybaseball
pybaseball/team_fielding.py
1
2821
import warnings import pandas as pd import requests from bs4 import BeautifulSoup, Comment from . import cache from .datahelpers import postprocessing from .datasources.fangraphs import fg_team_fielding_data # This is just a pass through for the new, more configurable function team_fielding = fg_team_fielding_data ...
mit
4,591,668,430,960,663,000
32.583333
115
0.609358
false
3.82768
false
false
false
agriffis/vcrpy-facebook
vcr_facebook/request.py
1
4164
from __future__ import absolute_import, unicode_literals, print_function import hashlib import logging import re import zlib from .compat import OrderedDict, parse_qsl, quote from .filters import (make_batch_relative_url_filter, make_multipart_filter, make_query_filter, make_url_filter, make_eli...
mit
-3,190,449,575,350,943,000
32.047619
95
0.60879
false
3.984689
false
false
false
HewlettPackard/oneview-ansible
test/test_hpe_icsp_server.py
1
10504
#!/usr/bin/python # -*- coding: utf-8 -*- ### # Copyright (2016-2017) Hewlett Packard Enterprise Development LP # # 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/licen...
apache-2.0
-3,992,395,171,992,851,500
34.727891
123
0.647944
false
3.581316
true
false
false
PhonologicalCorpusTools/CorpusTools
corpustools/gui/ppgui.py
1
16303
import os from collections import OrderedDict from .imports import * from corpustools.phonoprob.phonotactic_probability import (phonotactic_probability, phonotactic_probability_all_words) from corpustools.neighdens.io import load_words_neighden from corpustools.corpu...
bsd-3-clause
7,514,661,540,657,869,000
43.181572
142
0.5518
false
4.809145
false
false
false
avanwyk/cipy
cipy/algorithms/pso/functions.py
1
9569
# Copyright 2016 Andrich van Wyk # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
3,489,454,286,974,073,300
29.669872
80
0.64479
false
3.71756
false
false
false
SU-ECE-17-7/ibeis
_broken/preproc_featweight.py
1
13024
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals # Python from six.moves import zip, range, map # NOQA # UTool import utool as ut import vtool as vt #import vtool.image as vtimage import numpy as np from ibeis.algo.preproc import preproc_probchip from os.path i...
apache-2.0
8,091,099,537,909,222,000
40.74359
170
0.592061
false
3.115789
true
false
false
zielmicha/satori
satori.events/satori/events/master.py
1
7084
# vim:ts=4:sts=4:sw=4:expandtab """Master (central) event coordinator. """ import collections import select from _multiprocessing import Connection from multiprocessing.connection import Listener from satori.objects import Argument from .api import Manager from .client import Client, Scheduler from .mapper import M...
mit
-971,804,800,364,368,400
29.273504
84
0.619565
false
4.351351
false
false
false
zhlooking/LearnPython
Advaced_Features/slice.py
1
1281
L = ['Micheal', 'Hanson', 'William', 'Lucy', 'Frank'] # if you want to get the first three values in a list # 1> The simplest way def getFirstThreeValueOfList1(L): subL1 = [L[0], L[1], L[2]] return subL1 # 2> Use a loop def getSubList(L = None, n = 3): if (not isinstance(L, (list)) and not isinstance(n, (int, flo...
mit
1,213,449,190,329,562,000
24.117647
80
0.68306
false
2.821586
false
false
false
ryfeus/lambda-packs
Spacy/source2.7/plac_tk.py
1
1888
from __future__ import print_function import os import sys import Queue import plac_core from Tkinter import Tk from ScrolledText import ScrolledText from plac_ext import Monitor, TerminatedProcess class TkMonitor(Monitor): """ An interface over a dictionary {taskno: scrolledtext widget}, with methods add...
mit
2,970,059,258,354,080,000
29.95082
79
0.610169
false
3.609943
false
false
false
tomchadwin/qgis2web
qgis2web/bridgestyle/sld/fromgeostyler.py
1
20761
import os from xml.etree.ElementTree import Element, SubElement from xml.etree import ElementTree from xml.dom import minidom from .transformations import processTransformation import zipfile _warnings = [] # return a dictionary<int,list of rules>, where int is the Z value # symbolizers are marked with a Z # # a rul...
gpl-2.0
1,951,233,122,359,109,400
33.601667
111
0.630943
false
3.677768
false
false
false
TommesDee/cpachecker
scripts/benchmark/tools/wolverine.py
2
1148
import subprocess import benchmark.util as Util import benchmark.tools.template import benchmark.result as result class Tool(benchmark.tools.template.BaseTool): def getExecutable(self): return Util.findExecutable('wolverine') def getVersion(self, executable): return subprocess.Popen([execut...
apache-2.0
3,404,873,571,651,703,300
30.054054
91
0.614111
false
4.555556
false
false
false
zfrenchee/pandas
pandas/core/frame.py
1
233731
""" DataFrame --------- An efficient 2D container for potentially mixed-type time series or other labeled data series. Similar to its R counterpart, data.frame, except providing automatic data alignment and a host of useful data manipulation methods having to do with the labeling information """ from __future__ import...
bsd-3-clause
7,829,162,651,239,753,000
35.73283
85
0.523551
false
4.406942
false
false
false
martijnvermaat/rpclib
src/rpclib/test/interop/server/httprpc_csv_basic.py
1
1859
#!/usr/bin/env python # # rpclib - Copyright (C) Rpclib contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later ...
lgpl-2.1
-6,483,269,929,289,989,000
37.729167
80
0.737493
false
3.83299
false
false
false
pi2-picole/api
vendor/models.py
1
3896
from django.db import models from django.contrib.auth.models import User from rest_framework.authtoken.models import Token from django.db.models.signals import post_save from django.dispatch import receiver from django.core.validators import MinValueValidator @receiver(post_save, sender=User) def create_auth_token(sen...
mit
-7,058,885,298,412,033,000
29.677165
88
0.667608
false
3.637722
false
false
false
priestc/MultiExplorer
local_settings_default.py
1
1056
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.db.DatabaseCache', 'LOCATION': 'my_cache_table', 'TIMEOUT': 500000, } ...
mit
1,227,060,583,103,808,500
21.956522
74
0.648674
false
2.742857
false
true
false
erben22/fib
fibserver.py
1
1239
"""Implementation of a web server API that serves up Fibonacci numbers. TODO: Add some additional error handling: - Need some handling around the query parameter on the API. What if it is not supplied for example? """ import web from fibonacci import Fibonacci urls = ( '/fibonacci', 'Fibon...
mit
-1,917,998,892,817,449,200
28.5
73
0.652139
false
4.075658
false
false
false
esteluk/reinhardt
memberinfo/management/commands/populate.py
2
3209
import settings from django.core.management.base import NoArgsCommand from django.contrib.auth.models import User from compsoc.memberinfo.models import * from compsoc.events.models import * from datetime import date class Command(NoArgsCommand): option_list = NoArgsCommand.option_list help = "Populates some si...
agpl-3.0
7,771,329,610,080,966,000
31.414141
101
0.511374
false
3.55371
false
false
false
McMaNGOS/IIDXCV
IIDXCV_video.py
1
3111
from imutils.video import FileVideoStream from pykeyboard import PyKeyboard import cv2 import numpy as np import argparse import imutils import time # argument parser (for video, will use stream/live frames in future) ap = argparse.ArgumentParser() ap.add_argument("-v", "--video", required=True, help="Path to vide...
gpl-3.0
-3,277,442,641,834,810,000
26.776786
93
0.647702
false
3.414929
false
false
false
SvenVD/rpisurv
surveillance/core/worker.py
1
3534
import time import subprocess import platform import os import shlex import signal from util.setuplogging import setup_logging def worker(name,url,omxplayer_extra_options,coordinates,stopworker,aidx): """ Example substituted: ['/usr/bin/omxplayer', '--video_fifo', '1', '--video_queue', '1', '--live', '--timeou...
gpl-2.0
-9,006,318,421,546,378,000
44.307692
288
0.599887
false
3.783726
false
false
false
team-vigir/vigir_behaviors
vigir_flexbe_states/src/vigir_flexbe_states/calculate_force_torque_calibration_state_test.py
1
1925
# Test the FT Calibration state by calling the python class and doing the calculation here # Moritz Schappler, schappler@irt.uni-hannover.de, 2015-05 # Institut fuer Regelungstechnik, Universitaet Hannover # remotedebug # import pydevd # pydevd.settrace('localhost', port=5678, stdoutToServer=True, stderrToServer=Tru...
bsd-3-clause
-4,215,576,476,937,321,000
35.320755
118
0.772468
false
2.912254
false
false
false
jamesgk/ufo2ft
Lib/ufo2ft/util.py
1
14489
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals try: from inspect import getfullargspec as getargspec # PY3 except ImportError: from inspect import getargspec # PY2 from copy import deepcopy from fontTools.misc.py23 import unichr from fontTools impor...
mit
224,002,478,724,119,800
35.559494
87
0.6118
false
4.102557
false
false
false
whosonfirst/py-mapzen-whosonfirst-pip
mapzen/whosonfirst/pip/utils.py
1
4464
import mapzen.whosonfirst.pip import mapzen.whosonfirst.uri import mapzen.whosonfirst.placetypes import shapely.geometry import logging import requests import json def reverse_geocoordinates(feature): logging.warning("mapzen.whosonfirst.pip.utils.reverse_geocoordinates has been deprecated, you should use mapzen.w...
bsd-3-clause
-1,172,968,554,941,506,600
27.615385
166
0.628136
false
3.444444
false
false
false
arunkgupta/gramps
gramps/plugins/lib/maps/messagelayer.py
1
5240
# -*- python -*- # -*- coding: utf-8 -*- # # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2011-2012 Serge Noiraud # # 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; eithe...
gpl-2.0
-414,330,747,547,846,660
29.823529
109
0.489885
false
4.337748
false
false
false