repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
orcasgit/blender
tagging/views.py
30
2118
""" Tagging related views. """ from django.http import Http404 from django.utils.translation import ugettext as _ from django.views.generic.list_detail import object_list from tagging.models import Tag, TaggedItem from tagging.utils import get_tag, get_queryset_and_model def tagged_object_list(request, queryset_or_mo...
bsd-3-clause
7,873,885,772,614,170,000
39.730769
100
0.659112
false
4.088803
false
false
false
PicUpIt/picup-it
picupwebapp/picupwebapp/picture/management/commands/count_karma.py
2
1368
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.core.management.base import BaseCommand, CommandError import os.path class Command(BaseCommand): args = '' help = 'Count karma' def handle(self, *args, **options): from picupwebapp.picture.models import Picture from picupwebapp.pic...
bsd-3-clause
-7,734,272,397,324,856,000
33.2
106
0.577485
false
3.8
false
false
false
ignatenkobrain/dnf
tests/test_sack.py
1
3263
# Copyright (C) 2012-2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that it will...
gpl-2.0
-2,925,687,846,516,325,000
39.283951
77
0.665952
false
3.724886
true
false
false
FoglyOgly/Meowth
meowth/utils/converters.py
1
2090
from discord.ext import commands class BotCommand: """Convert string to Command object from Bot. Returns -------- :class:`discord.ext.commands.Command` """ @classmethod async def convert(cls, ctx, arg): cmd = ctx.bot.get_command(arg) if cmd is None: raise comman...
gpl-3.0
-4,303,910,932,329,106,400
25.455696
96
0.570813
false
4.138614
false
false
false
haypo/bytecode
bytecode/flags.py
1
3449
# alias to keep the 'bytecode' variable free import bytecode as _bytecode try: from enum import IntFlag except ImportError: from aenum import IntFlag class CompilerFlags(IntFlag): """Possible values of the co_flags attribute of Code object. Note: We do not rely on inspect values here as some of them ...
mit
2,976,361,441,260,728,300
37.752809
79
0.57379
false
4.130539
false
false
false
ddinsight/dd-streamworks
stream_worker/runworker.py
1
1133
# -*- coding: utf-8 -*- # # Copyright 2015 AirPlug 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 applic...
apache-2.0
4,878,062,506,427,999,000
24.177778
75
0.652251
false
3.893471
false
false
false
JeffRoy/mi-dataset
mi/dataset/parser/ctdbp_common.py
8
1155
__author__ = 'tgupta' from mi.core.common import BaseEnum import re from mi.dataset.parser.common_regexes import \ END_OF_LINE_REGEX, \ ANY_CHARS_REGEX # regex for identifying start of a header line START_HEADER = r'\*' # Time tuple corresponding to January 1st, 2000 JAN_1_2000 = (2000, 1, 1, 0, 0, 0, 0, 0,...
bsd-2-clause
-7,096,582,074,701,328,000
30.243243
77
0.69697
false
3.290598
false
false
false
haphaeu/yoshimi
EulerProject/060.py
1
2721
from math import log10 # Sieve of Eratosthenes for finding primes def primes(n): if n<2: return [] num=n//2+n%2-1 pos=[True]*(num+1) i_lim=int(n**0.5)>>1 for i in range(i_lim): if not pos[i]: continue start=(i*(i+3)<<1)+3 step=(i<<1)+3 for j in range(start, num, ste...
lgpl-3.0
4,705,258,389,411,195,000
31.783133
78
0.522969
false
2.759635
false
false
false
IamJacksHeart/supreme-succotash
ex36.py
1
21325
# TODO: # add text for possible actions in all rooms # add highscore function # add main menu from sys import exit import pickle def gold_room(): print "\n-------------------------------------------------------" print 'Hooray! You made it to the Gold Room\n' print "THE END." # all room...
gpl-3.0
-8,244,932,691,523,381,000
37.632246
157
0.327644
false
2.894273
false
false
false
richrr/scripts
python/Scripts for SFG/totalannotation_v1-1.py
2
12403
#!/usr/bin/env python import urllib import sys import os ##### totalannotation.py by DJ Barshis ##### This script takes an input fasta file of sequence names and sequences, and blast results files of blasts against ##### nr (parsed .txt with 1 hit per line) and swissprot and tremble (in -outfmt 7) uniprot databases ...
gpl-3.0
840,996,424,802,258,200
32.612466
357
0.653955
false
2.775962
false
false
false
ranisalt/moita-ufsc-crawler
moita/spiders/cagr.py
1
4398
# -*- coding: utf-8 -*- import collections import os import re import scrapy from scrapy.http import FormRequest, Request, Response from ..items import Subject CAMPI_EXCLUDE = ['EaD'] SEMESTER = '20171' TIMES = ['0730', '0820', '0910', '1010', '1100', '1330', '1420', '1510', '1620', '1710', '1830', '1920', ...
mit
-7,907,694,200,415,888,000
37.920354
80
0.528422
false
3.695798
false
false
false
USGSDenverPychron/pychron
pychron/tx/protocols/service.py
1
4766
# =============================================================================== # Copyright 2015 Jake Ross # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
apache-2.0
-3,283,776,030,715,910,000
26.549133
81
0.560428
false
4.195423
false
false
false
bolkedebruin/airflow
airflow/providers/amazon/aws/hooks/aws_hook.py
1
13053
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
apache-2.0
7,424,210,132,122,640,000
40.438095
121
0.566153
false
4.372864
true
false
false
abought/osf.io
framework/sessions/__init__.py
1
6249
# -*- coding: utf-8 -*- import furl import urllib import urlparse import bson.objectid import httplib as http from datetime import datetime import itsdangerous from flask import request from werkzeug.local import LocalProxy from weakref import WeakKeyDictionary from framework.flask import redirect from framework.mo...
apache-2.0
344,072,594,826,160,100
32.417112
137
0.653385
false
4.057792
false
false
false
vpramo/contrail-controller
src/config/svc-monitor/svc_monitor/nova_client.py
7
2807
from novaclient import client as nc from novaclient import exceptions as nc_exc class ServiceMonitorNovaClient(object): def __init__(self, args, logger): self._args = args self.logger = logger self._nova = {} def _novaclient_get(self, proj_name, reauthenticate=False): # return...
apache-2.0
-7,133,263,304,777,646,000
40.279412
82
0.539366
false
4.158519
false
false
false
morreene/tradenews
tradenews/statistics/views.py
1
1101
from flask import Blueprint, render_template from sqlalchemy import desc, func from tradenews.extensions import db from tradenews.pvdata.models import PVData blueprint = Blueprint("statistics", __name__, url_prefix='/statistics', static_folder="../static") @blueprint.route("/") def statistics()...
bsd-3-clause
-8,582,028,879,210,208,000
38.321429
85
0.599455
false
4.062731
false
false
false
johnbolia/plyer
plyer/platforms/ios/flash.py
3
1145
# coding=utf-8 """ Flash ----- """ from pyobjus import autoclass NSString = autoclass("NSString") AVCaptureDevice = autoclass("AVCaptureDevice") AVMediaTypeVideo = NSString.alloc().initWithUTF8String_("vide") AVCaptureTorchModeOff = 0 AVCaptureTorchModeOn = 1 class IosFlash(Flash): _camera = None def _on(s...
mit
-1,783,068,443,199,159,000
21.9
78
0.622707
false
3.90785
false
false
false
ddy88958620/lib
Python/scrapy/rvpartssupplier/rvpartssupplierspider.py
2
2004
import re import os from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, HtmlResponse from scrapy.utils.url import urljoin_rfc import csv from product_spiders.items import Product, ProductLoader HERE = os.path.abspath(os.path.dirname(__file__)) class ...
apache-2.0
7,769,756,806,999,572,000
34.175439
119
0.644711
false
3.597846
false
false
false
foliant-docs/foliant
foliant/preprocessors/_unescape.py
1
1507
import re from foliant.preprocessors.base import BasePreprocessor class Preprocessor(BasePreprocessor): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.pattern = re.compile( r'\<\<(?P<tag>[^\<\>\s]+)' + r'(\s(?P<options>[^\<\>]*))?\>' + ...
mit
6,983,277,374,609,165,000
29.755102
85
0.558062
false
3.924479
false
false
false
pexip/os-python-cl
examples/distributed_cache.py
1
1397
from UserDict import DictMixin from cl import Actor, Agent from cl.utils import flatten def first_reply(replies, key): try: return replies.next() except StopIteration: raise KeyError(key) class Cache(Actor, DictMixin): types = ("scatter", "round-robin") default_timeout = 1 clas...
bsd-3-clause
2,163,903,792,163,119,600
22.677966
69
0.561918
false
3.902235
false
false
false
Secretmapper/Merc-01
game/objects.py
1
17096
import pyglet import math import utils import resources as res import constants as CONSTS from pyglet.window import key from random import randint import behaviours import random class Sprite(pyglet.sprite.Sprite): uid = 0 def __init__(self, on_bounds_kill=False, cb_type=-1, *args, **kwargs): Sprite...
mit
5,909,395,452,051,021,000
31.876923
168
0.502047
false
3.551309
false
false
false
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pylint/reporters/text.py
4
7236
# Copyright (c) 2003-2016 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/COPYING """Plain text reporters: :text: the default one grouping mes...
gpl-3.0
-4,872,891,068,270,523,000
30.598253
91
0.597568
false
3.770714
false
false
false
sghai/robottelo
tests/foreman/cli/test_docker.py
1
76476
# pylint: attribute-defined-outside-init """Unit tests for the Docker feature. :Requirement: Docker :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: CLI :TestType: Functional :CaseImportance: High :Upstream: No """ from random import choice, randint from time import sleep from fauxfactory impor...
gpl-3.0
-4,023,137,635,723,081,700
34.636533
79
0.565576
false
4.091595
true
false
false
quake0day/oj
new_dp_3ncircle.py
1
1045
import collections # def maxSum(arr): # n = len(arr) # q = collections.deque(arr) # num_list = [] # for _ in xrange(n): # tmp = q.popleft() # num_list.append(list(q)) # q.append(tmp) # DP = [[0] * (n-1) for _ in xrange(n)] # for i in range(n): # DP[i][0] = num_lis...
mit
3,266,217,679,616,363,500
23.904762
67
0.47177
false
2.64557
false
false
false
mtyka/pd
examples/mc/multipep/run.py
1
2377
# PD is a free, modular C++ library for biomolecular simulation with a # flexible and scriptable Python interface. # Copyright (C) 2003-2013 Mike Tyka and Jon Rea # # 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...
gpl-3.0
-6,503,396,289,675,936,000
25.707865
90
0.716449
false
3.099087
false
false
false
thomas-schmid-ubnt/avocado
avocado/utils/iso9660.py
1
10782
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # bu...
gpl-2.0
-4,335,004,135,327,816,000
26.717224
79
0.580226
false
3.910773
false
false
false
utarsuno/urbtek
project_euler_problems/problems/problem_012.py
1
1782
# coding=utf-8 """ This module, problem_011.py, solves the twelth project euler problem. """ from project_euler_problems.problem import Problem import math ''' The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first te...
apache-2.0
4,894,224,376,065,202,000
27.285714
174
0.681257
false
2.979933
false
false
false
GoogleCloudPlatform/keras-idiomatic-programmer
zoo/autoencoder/dc_autoencoder.py
1
2128
# Copyright 2019 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, ...
apache-2.0
783,216,452,458,088,000
29.84058
129
0.671053
false
3.612903
false
false
false
MaxTyutyunnikov/lino
lino/modlib/cal/workflows/feedback.py
1
6853
# -*- coding: UTF-8 -*- ## Copyright 2013 Luc Saffre ## This file is part of the Lino project. ## Lino 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)...
gpl-3.0
-3,412,084,105,064,100,400
36.244565
107
0.670363
false
3.714363
false
false
false
flebel/djvideo
djvideo/templatetags/video.py
1
6546
# Copyright 2009 - Participatory Culture Foundation # # This file is part of djvideo. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
-3,757,474,174,955,165,000
36.83815
79
0.616865
false
3.523143
false
false
false
zedth2/mtgcollector
inventories/__init__.py
1
12623
#!/usr/bin/python3 ''' Author : Zachary Harvey ''' from hashlib import sha1 from datetime import datetime from .sqlments import * import json import logging SCRYFALL_COLORS = {'U':'Blue','B':'Black', 'G':'Green', 'W':'White', 'R':'Red'} class Collection: def __init__(self, name, path, unqkey=None, tablename...
mit
-1,816,315,429,411,828,200
31.958225
187
0.579815
false
3.529922
false
false
false
FrankNagel/qlc
src/webapp/quanthistling/scripts/annotations/annotations_for_minor1987.py
1
10960
# -*- coding: utf8 -*- import sys, os sys.path.append(os.path.abspath('.')) import re from operator import attrgetter import difflib # Pylons model init sequence import pylons.test import logging from quanthistling.config.environment import load_environment from quanthistling.model.meta import Sessi...
gpl-3.0
-3,525,369,847,378,718,000
38.876866
203
0.59244
false
3.442175
false
false
false
agadiraju/SeniorDesign
border.py
1
3406
import sys import math import numpy as np #from sklearn.cluster import KMeans import cv2 from scipy import ndimage def mse(imageA, imageB): # the 'Mean Squared Error' between the two images is the # sum of the squared difference between the two images; # NOTE: the two images must have the same dimension err = n...
mit
8,725,047,677,146,884,000
29.684685
139
0.674985
false
2.400282
false
false
false
dmlc/tvm
tests/python/unittest/test_tir_transform_rewrite_unsafe_select.py
5
1851
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
-4,725,960,046,383,045,000
39.23913
77
0.693679
false
3.085
false
false
false
JeffHoogland/qutemtgstats
Code/ui_EventList.py
1
4721
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'UIs/EventList.ui' # # Created: Wed May 6 12:22:53 2015 # by: pyside-uic 0.2.15 running on PySide 1.2.1 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_EventList(object): def setu...
bsd-3-clause
-1,043,782,290,848,916,200
68.426471
249
0.744122
false
4.094536
false
false
false
DiamondLightSource/diffcalc
startup/i07EH1h.py
1
3316
from startup._common_imports import * # @UnusedWildImport from diffcalc.settings import NUNAME if GDA: from __main__ import diff1vdelta, diff1halpha, diff1vgamma, diff1homega, dcm1energy # @UnresolvedImport from diffcalc.hkl.you.geometry import YouRemappedGeometry try: from numpy import matrix except Im...
gpl-3.0
6,383,633,301,665,036,000
32.16
107
0.627865
false
3.359676
false
false
false
mmadsen/CTPy
ctpy/data/individual_sample.py
1
3103
# Copyright (c) $today.year. Mark E. Madsen <mark@madsenlab.org> # # This work is licensed under the terms of the Creative Commons-GNU General Public Llicense 2.0, as "non-commercial/sharealike". You may use, modify, and distribute this software for non-commercial purposes, and you must distribute any modifications u...
apache-2.0
-5,299,242,560,339,283,000
29.431373
276
0.672575
false
3.802696
false
false
false
tensorflow/model-analysis
tensorflow_model_analysis/size_estimator.py
1
3043
# Lint as: python3 # 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 agr...
apache-2.0
-257,830,933,126,590,560
38.012821
80
0.722971
false
3.847029
false
false
false
crowsonkb/style_transfer
optimizers.py
1
4835
"""A module for function minimization.""" # pylint: disable=too-many-arguments, too-many-instance-attributes from average import EWMA import numpy as np from num_utils import saxpy, BILINEAR, sdot, EPS, resize, roll2 class AdamOptimizer: """Implements the Adam gradient descent optimizer [4] with iterate averag...
mit
1,740,575,003,854,315,300
34.036232
93
0.567735
false
3.260283
false
false
false
1Server/OneServer
oneserver/httpd.py
1
1961
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from SocketServer import TCPServer from threading import Thread from manager import OneServerManager ## # A simple HTTP daemon that directs as needed to different handlers. class Httpd(BaseHTTPRequestHandler): ## # Creates and sets up the server but does...
mit
-4,996,797,137,947,326,000
18.808081
68
0.703723
false
3.152733
false
false
false
SeaFalcon/Musicool_Pr
lib/sqlalchemy/testing/config.py
33
2136
# testing/config.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import collections requirements = None db = None db_url = None db_opts = None fil...
apache-2.0
-4,055,939,322,046,463,000
25.7
78
0.599719
false
3.834829
true
false
false
EoD/apitrace
specs/scripts/txt2api.py
11
7213
#!/usr/bin/env python ########################################################################## # # Copyright 2010 VMware, Inc. # All Rights Reserved. # # 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 th...
mit
4,052,495,628,628,351,000
28.561475
87
0.525717
false
4.169364
false
false
false
jayesh15111988/PythonSpamFiltering
NaiveBayesProcessor.py
1
2706
import Constants; from StringUtilities import *; import re; def setProbabilityForOccurrenceOfEachWordInStore(inputStoreWithCountOfEachWord): totalFrequencyOfAllWordsInStore=0; collectionOfAllWordsInStore=inputStoreWithCountOfEachWord.keys(); for individualKey in collectionOfAllWordsInStore: totalF...
mit
4,241,946,056,928,814,600
60.5
159
0.830746
false
4.188854
false
false
false
gotostack/iSwift
iswift/azureurls.py
1
2538
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
-8,829,610,944,111,002,000
37.454545
78
0.676517
false
3.625714
false
false
false
Azure/azure-sdk-for-python
sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_enums.py
1
1247
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ from enum import Enum class KeyCurveName(str, Enum): """Supported elliptic curves""" p_256 = "P-256" #: The NIST P-256 elliptic curve, AKA SECG curve SECP256...
mit
1,408,008,816,002,702,800
32.702703
98
0.61267
false
3.205656
false
false
false
SUNET/SATOSA
src/satosa/routing.py
3
6349
""" Holds satosa routing logic """ import logging import re from .context import SATOSABadContextError from .exception import SATOSAError from .logging_util import satosa_logging logger = logging.getLogger(__name__) STATE_KEY = "ROUTER" class SATOSANoBoundEndpointError(SATOSAError): """ Raised when a given...
apache-2.0
-3,596,771,624,513,883,000
35.912791
116
0.639156
false
4.436758
false
false
false
forensicmatt/PancakeViewer
libpv/Properties.py
1
10861
# -*- coding: utf-8 -*- import wx.propgrid from dfvfs.helpers import source_scanner from dfvfs.lib import definitions from dfvfs.volume import volume_system from dfvfs.volume import vshadow_volume_system from dfvfs.resolver import resolver from dfvfs.vfs import ntfs_file_system from dfvfs.vfs import tsk_file_entry de...
apache-2.0
-3,738,706,664,315,369,500
49.282407
111
0.56597
false
4.140679
false
false
false
haamoon/tensorpack
examples/CTC-TIMIT/timitdata.py
1
1598
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: timitdata.py # Author: Yuxin Wu <ppwwyyxxc@gmail.com> from tensorpack import ProxyDataFlow import numpy as np from six.moves import range __all__ = ['TIMITBatch'] def batch_feature(feats): # pad to the longest in the batch maxlen = max([k.shape[0] for k ...
apache-2.0
-6,834,922,738,891,577,000
26.551724
76
0.569462
false
3.371308
false
false
false
nikron/bridge
bridge/logging_service.py
1
1562
""" Wrapper around python API for a logging thread that listens on a queue; the queue we use is the multiprocessing Queue for obvious reasons. """ import logging import logging.handlers from multiprocessing import Queue import sys class LoggingService(): """ Intializes a thread that listens on a queue to log ...
mit
4,232,182,055,177,248,300
28.471698
86
0.668374
false
4.165333
false
false
false
ceph/samba
python/samba/tests/core.py
2
2767
# Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008 # # 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 opti...
gpl-3.0
-1,803,106,063,969,712,000
34.025316
77
0.651247
false
3.612272
true
false
false
rogers0/namebench
third_party/get_auth_ns/get_auth_ns.py
1
1340
import dns import dns.name import dns.query import dns.resolver def get_authoritative_nameserver(domain, log=lambda msg: None): n = dns.name.from_text(domain) depth = 2 default = dns.resolver.get_default_resolver() nameserver = default.nameservers[0] last = False while not last: s = n...
apache-2.0
9,090,256,772,600,797,000
27.510638
70
0.566418
false
3.573333
false
false
false
naz911/httpchat
HttpChatClient.py
1
17160
import httplib import base64 import json import re #HOST="myhttprestchat.appspot.com" #PORT=80 HOST="localhost" PORT=8080 IS_HTTPS="false"; class HttpChatClient(object): def __init__(self): object.__init__(self) def getConnection(self): if (IS_HTTPS == "true"): re...
apache-2.0
5,279,576,725,481,974,000
34.437367
101
0.512937
false
4.436401
false
false
false
ColumbiaCMB/kid_readout
kid_readout/analysis/timeseries/fit_pulses.py
1
7713
import numpy as np import lmfit from matplotlib import pyplot as plt from kid_readout.analysis import fitter def fred(t,tau,amp,offset,t_on,t_rise): result = np.empty_like(t) before = t < t_on result[before] = offset on = (t >= t_on) & (t < (t_on+t_rise)) t_during_rise = (t - t_on)[on] result[...
bsd-2-clause
962,751,126,508,045,300
34.712963
110
0.585375
false
2.802689
false
false
false
ElofssonLab/pcons-fold
folding/rosetta/extract.py
2
2802
#!/usr/bin/env python import sys import os from subprocess import call import evaluate_scores as ev from localconfig import * def main(seqfile, n_cores=1, n_models=10, relax_flag=True, rundir_postfix='', nametag='', chain='A'): rundir = os.path.dirname(os.path.abspath(seqfile)) + '/' ### determine IDs of ...
mit
-3,674,714,247,190,013,000
29.456522
137
0.594218
false
3.273364
false
false
false
jsmanrique/grimoirelab-personal-utils
utils.py
1
8642
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2017 J. Manrique Lopez de la Fuente # # 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 li...
mit
7,827,087,806,853,729,000
36.090129
132
0.553691
false
3.975161
false
false
false
mlperf/training_results_v0.7
NVIDIA/benchmarks/bert/implementations/pytorch/schedulers.py
1
4476
# Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved. # Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team. # 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 ...
apache-2.0
7,017,217,211,370,079,000
40.831776
131
0.651698
false
3.677896
false
false
false
ahmetcemturan/SFACT
skeinforge_application/skeinforge_plugins/craft_plugins/clip.py
1
14264
""" This page is in the table of contents. The clip plugin clips the loop ends to prevent bumps from forming, and connects loops. The clip manual page is at: http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Clip ==Operation== The default 'Activate Clip' checkbox is on. When it is on, the functions described b...
agpl-3.0
-6,665,302,779,443,948,000
40.225434
280
0.757712
false
3.34993
false
false
false
branning/euler
problems/euler041.py
1
1679
#!/usr/bin/env python from euler007 import eratosthenes import itertools from math import sqrt, ceil def millerrabin(n): return rabinmiller(n) def rabinmiller(n): limit = 341550071728321 a_s = [2,3,5,7,11] if n > 2152302898747: a_s.append(13) if n > 3474749660383: a_s.append(17) if n >= limit: ...
mit
3,110,628,897,652,643,300
23.333333
73
0.609887
false
2.998214
false
false
false
amiv-eth/amivapi
amivapi/cascade.py
1
2497
# -*- coding: utf-8 -*- # # license: AGPLv3, see LICENSE for details. In addition we strongly encourage # you to buy us beer if we meet and you like the software. """Delete cascading system. This adds an option 'cascade_delete' to data_relations in the schema. If it is set to true, then deleting the referenc...
agpl-3.0
-2,018,836,135,994,510,800
37.415385
78
0.602723
false
4.54827
false
false
false
cogniteev/docido-python-sdk
docido_sdk/toolbox/logger_ext.py
1
1383
import logging import docido_sdk.config as app_config def set_root_logger_from_verbosity(verbosity=0): """Configure root logger according to both application settings and verbosity level. """ kwargs = {} if verbosity == 1: kwargs.update(level=logging.INFO) elif verbosity > 1: ...
apache-2.0
2,363,975,286,113,980,400
28.425532
68
0.664497
false
4.216463
true
false
false
zdvresearch/fast15-paper-extras
hpss_db_dump/src/obfuscate.py
1
3173
#!/usr/bin/env python """obfuscate.py: Obfuscates ECFS access log files. Replaces all occurances of usernames and hostnames with their md5 hashes. version 1.1: also work on mars logs. """ __author__ = "Matthias Grawinkel" __status__ = "Production" import sys import os import gzip import hashlib import tim...
mit
7,107,727,581,929,507,000
25.231405
124
0.52474
false
3.561167
false
false
false
grybmadsci/openhtf
openhtf/core/phase_executor.py
1
9600
# Copyright 2014 Google Inc. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
apache-2.0
-6,445,904,859,696,247,000
36.647059
80
0.699896
false
3.995006
true
false
false
mne-tools/mne-tools.github.io
0.15/_downloads/plot_sensors_time_frequency.py
2
5164
""" .. _tut_sensors_time_frequency: ============================================= Frequency and time-frequency sensors analysis ============================================= The objective is to show you how to explore the spectral content of your data (frequency and time-frequency). Here we'll work on Epochs. We wil...
bsd-3-clause
-8,833,782,753,267,026,000
37.827068
79
0.555771
false
3.576177
false
false
false
wraithan/reciblog
blog/migrations/0006_auto__add_field_entry_author__add_field_entry_allow_comments__add_fiel.py
1
6501
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from django.contrib.auth.models import User class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Entry.author' db.add_column('blog_entry', 'aut...
bsd-2-clause
5,176,159,853,325,749,000
60.914286
191
0.576219
false
3.723368
false
false
false
homeworkprod/byceps
byceps/services/user_badge/service.py
1
5582
""" byceps.services.user_badge.service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from collections import defaultdict from typing import Dict, Optional, Set from flask import url_for from ...database import db from ...typing imp...
bsd-3-clause
-66,155,944,190,355,230
27.050251
79
0.62397
false
3.215438
false
false
false
convexopt/gpkit
gpkit/constraints/model.py
1
13449
"Implements Model" import numpy as np from .costed import CostedConstraintSet from ..nomials import Monomial from .prog_factories import _progify_fctry, _solve_fctry from .gp import GeometricProgram from .sgp import SequentialGeometricProgram from ..small_scripts import mag from ..tools.autosweep import autosweep_1d fr...
mit
2,202,078,545,071,841,800
43.979933
103
0.552086
false
4.215987
false
false
false
bhairavmehta95/flashcard-helper-alexa-skill
quizlet.py
1
2663
import keys as keys import requests import json from random import randint from config import SQLALCHEMY_DATABASE_URI from sqlalchemy import create_engine BASE_URL = 'https://api.quizlet.com/2.0/' # TODO: edit with the user from the alexa input USERNAME = 'bhairav_mehta' # gets all of the sets from the user def get...
mit
-7,720,889,309,620,324,000
21.191667
118
0.665415
false
2.765317
false
false
false
mattvonrocketstein/ymir
ymir/service/_vagrant.py
1
5570
# -*- coding: utf-8 -*- """ ymir.service._vagrant NB: this module is prefixed with an underscore to avoid confusion with the module from python-vagrant. """ import subprocess from fabric import api import vagrant as _vagrant from ymir import util from .base import AbstractService from ymir import data as...
mit
-6,442,848,419,656,792,000
31.011494
82
0.559066
false
4.10767
false
false
false
kyle-long/pyshelf
shelf/metadata/cloud_portal.py
2
1963
import copy from shelf.cloud.cloud_exceptions import ArtifactNotFoundError class CloudPortal(object): def __init__(self, container): """ Args: container(shelf.metadata.container.Container) """ self.codec = container.yaml_codec self.mapper = container.map...
mit
-265,176,074,189,403,550
31.716667
75
0.564952
false
4.994911
false
false
false
mantidproject/mantid
qt/python/mantidqt/widgets/sliceviewer/peaksviewer/representation/alpha.py
3
1454
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2020 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + # transparency range ALPHA_MIN, ALPHA_MAX = ...
gpl-3.0
-3,615,893,592,476,675,600
40.542857
98
0.701513
false
3.662469
false
false
false
PolyAlgo/PolyAlgo
Documentation/Compétion informatique CEGInfo 2016/Force brute (1)/ForceBrute-RemiPelletier.py
2
1772
#Auteur: Rémi Pelletier #Fichier: ForceBrute-RemiPelletier.py #Problème: Force brute (Compétition informatique CEGInfo-CEGL 2016) #Score: 45.45/50 (le dernier test échoue en raison d'un timeout) import re class Node: value = 0 nNodes = 1 childs = [] def __init__(self): ...
apache-2.0
-2,317,679,348,799,182,300
26.063492
97
0.570136
false
3.112676
false
false
false
Zentyal/mss
mss/www/wizard/transaction.py
2
7086
import logging from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _, ungettext from mss.lib.xmlrpc import XmlRpc xmlrpc = XmlRpc() logger = logging.getLogger(__name__) class Steps: PREINST = "preinst" DOWNLOAD = "download" MEDIAS_AUTH = "medias_auth" MEDIA...
gpl-3.0
-1,475,094,447,232,695,600
32.424528
109
0.502964
false
4.465028
true
false
false
ilastik/ilastik-0.5
ilastik/modules/interactive_segmentation/core/segmentors/segmentorWS.py
1
3961
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2010 C Sommer, C Straehle, U Koethe, FA Hamprecht. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are # permitted provided that the following conditions are met: # # 1. Redistributions of...
bsd-2-clause
-5,466,272,542,716,496,000
44.54023
128
0.632921
false
3.992944
false
false
false
gaqzi/py-gocd
gocd/api/template_config.py
2
3065
import json from gocd.api.endpoint import Endpoint __all__ = ['TemplateConfig'] class TemplateConfig(Endpoint): base_path = 'go/api/admin/templates' id = 'name' def __init__(self, server, name, api_version=2): """A wrapper for the `Go template config API`__ .. __: https://api.go.cd/curr...
mit
4,721,958,696,269,548,000
28.471154
83
0.543883
false
4.397418
true
false
false
timvandermeij/unmanned-vehicle-tomography
tests/location_line_follower.py
3
15290
import math import unittest from mock import call, patch, MagicMock from ..bench.Method_Coverage import covers from ..core.Threadable import Threadable from ..core.Thread_Manager import Thread_Manager from ..location.Line_Follower import Line_Follower, Line_Follower_State, Line_Follower_Direction from core_thread_manag...
gpl-3.0
1,016,664,108,625,647,400
44.641791
96
0.645062
false
3.806323
true
false
false
rupendrab/py_unstr_parse
dictr.py
1
1164
#!/usr/bin/env python import sys def sort_word(word): return ''.join(sorted(word)).lower() def read_dict(dictfile): worddict = {} f = open(dictfile, 'r') for line in f: line = line[:-1] key = sort_word(line) ex = worddict.get(key) # print(key, ex) if not ex: worddict[key] = [line] ...
mit
-1,458,562,346,959,569,000
23.765957
81
0.543814
false
3.278873
false
false
false
Kevin-Prichard/strummer-autosuggest
word_index.py
1
11617
#!/usr/bin/env python import re, json, sys, getopt import pprint class mList(list): pass pp = pprint.PrettyPrinter(indent=4) def ngram_lookup_gen_terminus(fn_input,fn_output_json,fn_output_recs): fh=open(fn_input,'r') wordrx = re.compile('\W+') next_word_id = 0 root={} word_id_to_word={} ...
apache-2.0
8,434,306,207,320,972,000
34.854938
197
0.529741
false
3.478144
false
false
false
MangoMangoDevelopment/neptune
lib/ros_comm-1.12.0/tools/rostest/test/test_distro_version.py
1
2204
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code...
bsd-3-clause
-3,495,613,981,122,648,600
42.215686
134
0.748185
false
4.214149
true
false
false
faneshion/MatchZoo
matchzoo/auto/tuner/callbacks/lambda_callback.py
1
2145
from matchzoo.engine.base_model import BaseModel from matchzoo.auto.tuner.callbacks.callback import Callback class LambdaCallback(Callback): """ LambdaCallback. Just a shorthand for creating a callback class. See :class:`matchzoo.tuner.callbacks.Callback` for more details. Example: >>> impo...
apache-2.0
6,327,652,515,021,143,000
32.515625
102
0.550583
false
3.310185
false
false
false
pySTEPS/pysteps
pysteps/verification/plots.py
1
6468
# -- coding: utf-8 -- """ pysteps.verification.plots ========================== Methods for plotting verification results. .. autosummary:: :toctree: ../generated/ plot_intensityscale plot_rankhist plot_reldiag plot_ROC """ from matplotlib import cm import matplotlib.pylab as plt from mpl_toolki...
bsd-3-clause
-4,454,498,900,381,124,600
28.669725
86
0.608534
false
3.225935
false
false
false
Spredzy/dci-ansible
modules/dci_team.py
1
6673
#!/usr/bin/python # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # dist...
apache-2.0
9,036,726,954,525,299,000
29.19457
165
0.616215
false
3.913783
false
false
false
Tarnasa/TreyCalebGame
src/testingmovement1.py
1
1094
import pygame import math pygame.init() screen = pygame.display.set_mode((200, 200)) run = True pos = (100, 100) clock = pygame.time.Clock() # speed of your player speed = 2 # key bindings move_map = {pygame.K_LEFT: (-1, 0), pygame.K_RIGHT: (1, 0), pygame.K_UP: (0, -1), pygame.K_...
gpl-2.0
3,859,021,996,416,015,400
23.333333
63
0.636197
false
3.038889
false
false
false
cocagne/multi-paxos-example
composable_paxos.py
3
13763
''' This module provides an implementation of the Paxos algorithm as a set of composable classes. ''' import collections # ProposalID # # In order for the Paxos algorithm to function, all proposal ids must be # unique. A simple way to ensure this is to include the proposer's unique # id in the proposal id. # # Pyth...
mit
3,994,709,185,516,324,000
36.197297
117
0.624791
false
4.002035
false
false
false
sailthru/stolos
stolos/runner.py
1
10166
""" This code fetches jobs from the queue, decides whether to run jobs, and then runs them or manipulates its own and parent/child queues """ import importlib from stolos import argparse_shared as at from stolos import log from stolos import dag_tools as dt, exceptions from stolos import queue_backend as qb from stolo...
apache-2.0
2,642,520,540,096,775,000
36.238095
79
0.597482
false
3.606243
false
false
false
mesgarpour/T-CARER
Stats/_DecisionTreeClassifier.py
1
4381
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # Copyright 2017 University of Westminster. 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.ap...
apache-2.0
-8,403,744,305,209,164,000
42.252525
98
0.622461
false
3.953971
false
false
false
chrisrink10/cjblog
cjblog/util.py
1
4327
"""cjblog :: util module Contains utility functions. Author: Christopher Rink (chrisrink10 at gmail dot com)""" import markdown import os # Make sure we handle the variable path (especially with venvs) _cfg_loc = '/app/config.py' # These are some basic defaults, just in case we fail to get any value defaults = { ...
mit
5,950,040,983,241,999,000
30.355072
76
0.589092
false
4.093661
true
false
false
gmarkall/numba
numba/tests/test_np_functions.py
1
132976
# Tests numpy methods of <class 'function'> import itertools import math import platform from functools import partial import numpy as np from numba.core.compiler import Flags from numba import jit, njit, typeof from numba.core import types from numba.typed import List, Dict from numba.np.numpy_support import numpy_...
bsd-2-clause
-7,744,164,433,142,171,000
31.284604
114
0.509357
false
3.393955
true
false
false
ging/fiware-chef_validator
chef_validator/api/middleware/fault.py
2
6456
# -*- coding: utf-8 -*- # 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
4,039,078,032,896,600,000
36.103448
76
0.628717
false
4.373984
false
false
false
mizdebsk/javapackages
python/javapackages/common/osgi.py
2
5952
# # Copyright (c) 2014, Red Hat, Inc. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions...
bsd-3-clause
-6,792,009,583,216,011,000
32.251397
87
0.607863
false
4.526236
false
false
false
gvilardo/parser
parser_v2.py
1
2112
#!/usr/bin/env python # -*- coding: utf-8 -*- """ parser.py - Copyright (C) 2015 - Giorgio Vilardo parser.py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or ...
gpl-2.0
5,031,054,356,693,498,000
28.333333
74
0.693182
false
3.065312
false
false
false
ralphm/txhue
txhue/test/test_api.py
1
5401
# Copyright (c) 2015 Ralph Meijer <ralphm@ik.nu> # See LICENSE.txt for details """ Tests for L{txhue}. """ import json from twisted.internet import defer from twisted.trial import unittest from txhue import api class TreqStub(object): """ Stub providing part of the Treq API. """ def request(self,...
mit
-7,439,574,831,142,331,000
27.882353
79
0.554712
false
3.676651
true
false
false
recipi/recipi
src/recipi/recipes/parser.py
1
5551
"""Helpers for parsing a recipe. Rules for parsing an ingredient list: <amount> <unit> [of <ingredient>] <amount>: x whole or decimal number, in digits (250, 0.75) x common fraction (3/4) - numeral in words (half, one, ten, twenty-five, three quarters) - determiner instead of a numeral ("an onion") - subjective (som...
isc
-8,549,272,075,910,376,000
26.616915
80
0.614664
false
3.294362
false
false
false
Princessgladys/googleresourcefinder
tests/selenium_test_case.py
1
12272
import code import datetime import inspect import os import re import selenium import time import unittest from google.appengine.api import memcache, users import cache import scrape from model import Account, MinimalSubject, PendingAlert, Report, Subject from model import Subscription, db from feedlib import report_...
apache-2.0
7,322,776,128,927,904,000
38.71521
80
0.610821
false
4.137559
true
false
false
noisyboiler/wampy
wampy/__init__.py
1
1134
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Set default logging handler to avoid "No handler found" warnings. import logging from logging import NullHandler from...
mpl-2.0
2,230,570,574,468,514,000
27.35
69
0.715168
false
3.910345
true
false
false
sutartmelson/girder
clients/python/setup.py
2
2110
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware 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 ...
apache-2.0
-7,522,937,999,182,048,000
30.969697
79
0.592417
false
3.843352
false
false
false
fldc/CouchPotatoServer
couchpotato/core/notifications/discord.py
1
2992
import json from couchpotato.core.logger import CPLog from couchpotato.core.notifications.base import Notification log = CPLog(__name__) autoload = 'Discord' class Discord(Notification): required_confs = ('hook_url',) def notify(self, message='', data=None, listener=None): for key in self.required_c...
gpl-3.0
-1,238,180,798,344,652,300
30.829787
81
0.412767
false
4.849271
false
false
false
Alir3z4/markwhat
markwhat/ui/main_window.py
1
2346
from Tkconstants import BOTH, W, END, NSEW from Tkinter import Frame, StringVar from ttk import Style, Label, Button from tkinterhtml import HtmlFrame from markwhat.parsers import parse_markdown from markwhat.ui.widgets.what_text import WhatText class MainWindow(Frame): def __init__(self, parent): Frame...
gpl-3.0
-2,150,889,515,444,714,800
34.014925
72
0.641091
false
3.45
false
false
false
vermouth1992/Leetcode
python/560.subarray-sum-equals-k.py
1
1272
# # @lc app=leetcode id=560 lang=python3 # # [560] Subarray Sum Equals K # # https://leetcode.com/problems/subarray-sum-equals-k/description/ # # algorithms # Medium (43.72%) # Total Accepted: 493K # Total Submissions: 1.1M # Testcase Example: '[1,1,1]\n2' # # Given an array of integers nums and an integer k, retur...
mit
511,345,479,374,326,460
22.145455
78
0.561321
false
2.971963
false
false
false
clone1612/appstore
nextcloudappstore/core/api/v1/tests/test_app_release_provider.py
1
1499
from unittest.mock import Mock, MagicMock from django.test import TestCase from nextcloudappstore.core.api.v1.release.downloader import \ AppReleaseDownloader from nextcloudappstore.core.api.v1.release.parser import \ GunZipAppMetadataExtractor from nextcloudappstore.core.api.v1.release.provider import \ A...
agpl-3.0
1,635,766,182,683,442,000
35.560976
76
0.67445
false
4.163889
true
false
false
ministryofjustice/cla_backend
cla_backend/apps/core/drf/router.py
1
11303
from collections import namedtuple, OrderedDict from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import NoReverseMatch from rest_framework import views from rest_framework.routers import BaseRouter, flatten, replace_methodname from rest_framework.urlpatterns import format_suffix_p...
mit
8,322,443,505,366,514,000
37.576792
115
0.578431
false
4.574261
false
false
false