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
cboling/onos-restconf-providers
tools/mockDevice/yangModel.py
1
5799
# # Copyright 2015-present Boling Consulting Solutions, bcsw.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
7,545,779,531,491,814,000
36.173077
108
0.59562
false
4.443678
false
false
false
google-research/google-research
tft/libs/hyperparam_opt.py
1
13875
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
apache-2.0
4,648,941,923,380,568,000
30.678082
84
0.683099
false
3.945124
false
false
false
googleads/google-ads-python
google/ads/googleads/v8/services/services/batch_job_service/pagers.py
1
3313
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
1,347,235,011,634,477,000
39.901235
99
0.674011
false
4.364954
false
false
false
mkieszek/odoo
addons/purchase/purchase.py
1
104421
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import pytz from openerp import SUPERUSER_ID, workflow from datetime import datetime from dateutil.relativedelta import relativedelta from operator import attrgetter from openerp.tools.safe_eval import safe_eval as eval ...
agpl-3.0
917,454,773,786,240,900
54.662047
302
0.586893
false
3.937295
false
false
false
orlenko/plei
pleiapp/migrations/0002_auto__add_tagline.py
1
19744
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Tagline' db.create_table(u'pleiapp_tagline', ( (u'id', self.gf('django.db.models...
bsd-2-clause
-8,362,666,055,092,364,000
80.929461
191
0.562804
false
3.557477
false
false
false
leonth/private-configs
sublime-text-3/Packages/SublimePythonIDE/server/server.py
1
13177
import os import sys import time import logging import tempfile import threading if sys.version_info[0] == 2: sys.path.insert( 0, os.path.join(os.path.dirname(__file__), "..", "lib", "python2")) from SimpleXMLRPCServer import SimpleXMLRPCServer from xmlrpclib import Binary else: sys.path.insert...
mit
5,703,854,125,502,567,000
32.191436
88
0.600364
false
4.265782
false
false
false
google-research/google-research
bigg/bigg/model/tree_model.py
1
22863
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
apache-2.0
8,929,886,291,118,226,000
42.715105
153
0.55264
false
3.206142
false
false
false
theislab/scanpy
scanpy/tests/test_ingest.py
1
3770
import pytest import numpy as np from sklearn.neighbors import KDTree from umap import UMAP import scanpy as sc from scanpy import settings from scanpy._compat import pkg_version X = np.array( [ [1.0, 2.5, 3.0, 5.0, 8.7], [4.2, 7.0, 9.0, 11.0, 7.0], [5.1, 2.0, 9.0, 4.0, 9.0], [7....
bsd-3-clause
1,639,938,025,560,681,500
23.640523
88
0.602918
false
2.571623
true
false
false
Azure/azure-sdk-for-python
sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_policy_operations.py
1
21264
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
2,958,798,404,665,335,000
49.992806
222
0.644987
false
4.087659
true
false
false
mobarski/sandbox
rsm/v10/common2.py
1
1795
from __future__ import print_function import numpy as np from random import shuffle, random,seed from time import time from heapq import nlargest from collections import deque,Counter from itertools import cycle import marshal from pprint import pprint import sys def combinations(n,k): "return k from n combination" ...
mit
-8,747,349,751,396,877,000
22.618421
62
0.687465
false
2.442177
false
false
false
CroMarmot/MyOICode
ProjectEuler/p233.py
1
5380
p = dict() def gcd(a, b): if b == 0: return a return gcd(b, a % b) def main(): # 420 / 4 = 105 p[1] = 1 m = 2 maxv = 2*10**7 while m * m < maxv: n = m - 1 while n > 0 and n*n-m*m+2*n*m > 0: if gcd(n, m) != 1: n -= 1 cont...
gpl-3.0
8,071,894,136,991,945,000
12.830334
69
0.712268
false
2.183442
false
false
false
linjinjin123/leetcode
剑指offer/平衡二叉树.py
1
1099
# 题目描述 # 输入一棵二叉树,判断该二叉树是否是平衡二叉树。 # -*- coding:utf-8 -*- # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def IsBalanced_Solution(self, pRoot): # write code here if pRoot == None: return True return a...
mit
-3,442,280,454,682,868,000
28.885714
83
0.480383
false
3.415033
false
false
false
samj1912/picard
picard/ui/tagsfromfilenames.py
1
5318
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # Copyright (C) 2006 Lukáš Lalinský # # 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...
gpl-2.0
7,357,525,650,345,461,000
40.523438
113
0.598307
false
3.862645
false
false
false
jplusplus/thenmap-v0
generators/utils/guess-nation-codes.py
1
2869
# coding=utf-8 #Try and create nation codes (class names) from nation names in a csv import csv import argparse import os.path import sys import shlex #Check if file exists def is_valid_file(parser, arg): if not os.path.exists(arg): parser.error("The file %s does not exist!" % arg) else: return...
gpl-2.0
-8,708,814,281,626,982,000
24.837838
144
0.664226
false
3.028511
false
false
false
tensorflow/lingvo
lingvo/core/task_scheduler.py
1
11531
# Lint as: python3 # Copyright 2018 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 ...
apache-2.0
-3,984,654,347,267,109,000
30.164865
80
0.652155
false
3.711297
false
false
false
tungvx/deploy
Django-0.90/tests/testapp/models/m2o_recursive.py
1
1066
""" 11. Relating an object to itself, many-to-one To define a many-to-one relationship between a model and itself, use ``ForeignKey('self')``. In this example, a ``Category`` is related to itself. That is, each ``Category`` has a parent ``Category``. Set ``related_name`` to designate what the reverse relationship is...
apache-2.0
3,638,889,243,003,648,500
23.227273
74
0.67167
false
3.405751
false
false
false
cadappl/krep
krep_subcmds/help_subcmd.py
1
2299
from topics import key_compare, SubCommand class HelpSubcmd(SubCommand): COMMAND = 'help' help_summary = 'Print the command summaries' help_usage = '''\ %prog <subcmd> ... Display the detailed usage of the sub-command or the list of all supported sub-commands. Environment variables KREP_EXTRA_PATH and ...
lgpl-3.0
-4,619,710,783,916,100,000
32.318841
77
0.570248
false
3.936644
false
false
false
kevinkahn/softconsole
screens/screen.py
1
16940
import collections import pygame import functools from guicore.switcher import SwitchScreen import config import hubs.hubs import logsupport import screens.__screens as screens import stores.paramstore as paramstore import stores.valuestore as valuestore from keyspecs import toucharea from logsupport import ConsoleErr...
apache-2.0
-8,380,265,676,621,377,000
35.119403
122
0.689906
false
3.105408
true
false
false
wdv4758h/ZipPy
edu.uci.python.benchmark/src/benchmarks/sympy/sympy/integrals/manualintegrate.py
2
39796
"""Integration method that emulates by-hand techniques. This module also provides functionality to get the steps used to evaluate a particular integral, in the ``integral_steps`` function. This will return nested namedtuples representing the integration rules used. The ``manualintegrate`` function computes the integra...
bsd-3-clause
-7,936,689,559,096,110,000
35.01448
99
0.585561
false
3.618805
false
false
false
sipdbg/sipdbg
logger.py
1
1803
import sys import logging RESET_SEQ = "\033[0m" COLOR_SEQ = "\033[1;%dm" BOLD_SEQ = "\033[1m" def formatter_message(message, use_color = True): if use_color: message = message.replace("$RESET", RESET_SEQ).replace( "$BOLD", BOLD_SEQ) else: message = message.replace("$RESET", "").rep...
gpl-2.0
-2,628,304,185,319,130,000
31.196429
96
0.621742
false
3.500971
false
false
false
forrestgtran/TeamX
handwritingRecognition/performRecognitionAlpha.py
1
2865
# Import the modules import cv2 from sklearn.externals import joblib from skimage.feature import hog import numpy as np from PIL import Image # Load the classifier clf = joblib.load("digits_cls_alpha6.pkl") # Read the input image im = cv2.imread("adrienne2b.jpg") im_pil = Image.open("adrienne2b.jpg") # Convert to g...
apache-2.0
-8,676,434,699,366,484,000
27.65
108
0.647469
false
2.739006
false
false
false
8l/luz-cpu
luz_asm_sim/lib/simlib/interactive_cli.py
1
4504
# Interactive command-line simulation functions # # Luz micro-controller simulator # Eli Bendersky (C) 2008-2010 # import sys from .luzsim import LuzSim from ..asmlib.disassembler import disassemble from ..asmlib.asm_instructions import register_alias_of from ..commonlib.utils import word2bytes from ..commonl...
unlicense
-4,718,183,565,284,314,000
26.687898
82
0.461146
false
4.162662
false
false
false
geonexus/fiware-cloto
fiware_cloto/cloto/tests/acceptance_tests/component/tenant_information/features/tenant_information.py
1
4559
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # Copyright 2014 Telefónica Investigación y Desarrollo, S.A.U # # This file is part of FI-WARE project. # # 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 th...
apache-2.0
-3,880,594,550,653,137,000
33.263158
114
0.633531
false
3.861864
false
false
false
ingolemo/cmd-utils
timepick.py
1
1388
#!/usr/bin/env python """Usage: timepick [second|minute|hour|day|week] A filter that picks a single line from stdin based on the current time. This has an advantage over random selection in that it's cyclical and thus no clustering or repetition of the selections; seems 'more random' to people. """ import os import ...
gpl-3.0
-4,550,585,445,860,526,000
23.785714
71
0.59366
false
3.344578
false
false
false
mozilla/kuma
kuma/search/tests/__init__.py
1
2536
from django.conf import settings from elasticsearch.exceptions import ConnectionError from elasticsearch_dsl.connections import connections from rest_framework.test import APIRequestFactory from kuma.core.i18n import activate_language_from_request from kuma.users.tests import UserTestCase from kuma.wiki.search impor...
mpl-2.0
-8,934,910,198,099,170,000
31.101266
74
0.6597
false
4.219634
true
false
false
xantage/code
vilya/libs/text.py
1
2278
# -*- coding: utf-8 -*- from __future__ import absolute_import import urllib import hashlib from mikoto.libs.text import * from mikoto.libs.emoji import * from vilya.config import EMAIL_SUFFIX def trunc_utf8(string, num, etc="..."): """truncate a utf-8 string, show as num chars. arg: string, a utf-8 encodin...
bsd-3-clause
6,086,639,086,148,238,000
24.595506
79
0.598332
false
3.254286
false
false
false
ThomasTheSpaceFox/Desutezeoid
dzulib1.py
1
6392
#!/usr/bin/env python import pygame.event import pygame.key import pygame.display import pygame.image import pygame.mixer import pygame import sys import time import os pygame.display.init() #this library should contain any functions and data needed by dezutezeoid #that don't need to be in the actual engine executable...
gpl-3.0
7,944,259,049,090,231,000
26.316239
122
0.728723
false
2.861235
false
false
false
timmo/gardeningPI
gists/integration.py
1
20203
import math import requests from requests.exceptions import * import json import astral import datetime import hashlib from enum import Enum, unique from kivy.clock import Clock from kivy.logger import Logger # Using I2C on RasPi for reading a light sensor import platform if 'arm' in platform.uname().machine: im...
apache-2.0
-8,395,176,535,836,273,000
37.629063
121
0.542395
false
4.127273
false
false
false
KurtHaffner/Weather_Project
test.py
1
3352
from tkinter import * from pygeocoder import Geocoder import forecastio def getForecast(latt, lngg, results): #Set up the box that will hold all the results. result = Tk() result.title("Weather Results") api_key = "d747bd6c3aa83c90ecc20dbbb019d5ea" lat = latt lng = lngg forecast = ...
apache-2.0
5,965,499,589,496,558,000
30.92381
92
0.686158
false
3.365462
false
false
false
shankari/folium
folium/map.py
1
29178
# -*- coding: utf-8 -*- """ Map ------ Classes for drawing maps. """ from __future__ import unicode_literals import json from collections import OrderedDict from jinja2 import Environment, PackageLoader, Template from branca.six import text_type, binary_type from branca.utilities import _parse_size from branca.e...
mit
-2,931,999,732,305,539,600
38.42973
114
0.561587
false
3.954194
false
false
false
Pica4x6/numina
numina/core/dataholders.py
1
3419
# # Copyright 2008-2014 Universidad Complutense de Madrid # # This file is part of Numina # # Numina 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 l...
gpl-3.0
-1,352,558,844,343,390,200
31.561905
75
0.622112
false
4.094611
false
false
false
abeing/droog
droog/message.py
1
2589
# Droog # Copyright (C) 2015 Adam Miezianko # # 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 distr...
gpl-2.0
-1,923,911,494,254,833,700
33.52
78
0.649672
false
4.169082
false
false
false
ConsumerAffairs/django-document-similarity
docsim/documents/migrations/0002_auto__add_cluster.py
1
2213
# -*- coding: utf-8 -*- # flake8: noqa import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Cluster' db.create_table('documents_cluster', ( ('id', self.gf('d...
agpl-3.0
4,228,240,815,063,617,500
41.557692
175
0.591505
false
3.944742
false
false
false
astrofrog/python-montage
montage/commands.py
1
80203
import subprocess import status import shlex from commands_extra import * def mAdd(images_table, template_header, out_image, img_dir=None, no_area=False, type=None, exact=False, debug_level=None, status_file=None, mpi=False, n_proc=8): ''' Coadd the reprojected images in an input list to fo...
mit
3,596,807,204,537,435,000
32.998728
78
0.601075
false
3.98445
false
false
false
fhdk/pacman-mirrors
pacman_mirrors/functions/httpFn.py
1
7641
#!/usr/bin/env python # # This file is part of pacman-mirrors. # # pacman-mirrors 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. # # p...
gpl-3.0
6,548,004,164,943,366,000
34.050459
95
0.621646
false
3.765895
true
false
false
frjanibo/Stream
resources/site-packages/stream/scrapers/espoiler.py
1
5606
from stream import plugin from stream.scrapers import scraper from stream.ga import tracked from stream.caching import cached_route from stream.utils import ensure_fanart from stream.library import library_context from stream.utils import url_get from bs4 import BeautifulSoup import re import requests import json BASE...
gpl-3.0
6,394,528,551,549,263,000
34.257862
173
0.588833
false
3.061715
false
false
false
vojtechtrefny/python-meh
meh/safe_string.py
1
2372
# # Copyright (C) 2013 Red Hat, Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This ...
gpl-2.0
4,265,282,975,284,031,500
32.408451
79
0.602024
false
4.082616
false
false
false
kmaiti/AWSAutoScalingWithF5andCloudFormation
aws-autoscale-ec2-instance-modify.py
1
6954
#!/usr/bin/env python """ Purpose : Extract next sequence number of auto-scaled instance and set new tag to self instance. Script will be running from new instance. will take input from command line instead of from json file Future Plan : will associate instance to a role based IAM profile Usage : python ec2-autoscale-...
gpl-3.0
-2,848,600,508,939,780,600
53.755906
252
0.623095
false
3.8
false
false
false
GeographicaGS/Elcano-iepg
www-srv/src/scripts/popgdp_newyear.py
1
1294
new_year = 2014 input_file = '../csv/popgdp2014.csv' import sys sys.path.append('../../www-srv/src') from maplex.maplexmodel import MaplexModel mm = MaplexModel() import csv with open(input_file, 'rb') as csvfile: spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|') sql = "" for row in ...
gpl-3.0
-5,986,356,302,128,184,000
28.431818
128
0.566461
false
3.42328
false
false
false
bmazin/ARCONS-pipeline
util/ObsFileSeqV2.py
1
33310
import os import math import time import warnings import numpy as np from util import FileName from util import ObsFile from util import TCS from interval import interval import pyfits import matplotlib.pyplot as plt import pickle from headers.DisplayStackHeaders import writeImageStack, readImageStack class ObsFileS...
gpl-2.0
-2,156,267,733,733,224,700
41.379135
148
0.52918
false
3.94528
false
false
false
pfjel7/housing-insights
python/housinginsights/ingestion/CSVWriter.py
1
3899
""" CSVWriter.py contains the CSVWriter class that is used to create a clean.psv file that can later be used to load to the database. """ from csv import DictWriter import os import copy import uuid logging_path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.p...
mit
3,770,622,406,761,371,600
36.133333
99
0.619646
false
4.210583
false
false
false
dani-i/bachelor-project
utils/charts/chart_entry.py
1
2892
class ChartEntry: def __init__(self): self._identifier = '' self._x = -1 self._y = -1 self._confidence_interval_95 = -1 def __str__(self): rez = '\n## Is valid : ' + str(self.is_valid()) + ' ##' rez += '\nIdentifier : ' + self.identifier rez += '...
apache-2.0
1,384,881,015,369,096,700
25.290909
78
0.412517
false
4.868687
false
false
false
Oblivion1221/Pycodes
learn_py/pig_latin.py
1
1048
from __future__ import print_function def consonant(c): v = ['a', 'e', 'i', 'o', 'u','A', 'E', 'I', 'O', 'U'] if c not in v: return True else: return False def pig_latin_1(word): if consonant(word[0]): word1 = word[1:] + word[0] + 'a' + 'y' return str(word1) ...
mit
-4,320,447,383,732,179,500
25.225
88
0.528626
false
2.879121
false
false
false
pkgpl/IPythonProcessing
pkprocess/pkapp.py
1
6022
import numpy as np from numba import jit import scipy.signal import scipy.interpolate from .pkbase import * @jit def triang(L): # generate triangle w=np.zeros(L) if L%2==0: # even L for i in range(int(L/2)): n=i+1 w[i]=(2.*n-1.)/L for i in range(int(L/2),L): n=i+1 w[i]=2.-(2.*n-1.)/L else: # odd L ...
gpl-3.0
-7,563,901,515,248,345,000
24.302521
94
0.661574
false
2.096797
false
false
false
Forage/Gramps
gramps/webapp/grampsdb/view/note.py
1
6003
# Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2009 Douglas S. Blank <doug.blank@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 2 of the L...
gpl-2.0
-3,609,075,325,010,903,600
37.480769
110
0.596202
false
3.801773
false
false
false
unicef/un-partner-portal
backend/unpp_api/apps/common/models.py
1
3927
# -*- coding: utf-8 -*- from __future__ import unicode_literals from decimal import Decimal from django.conf import settings from django.db import models from django.core.validators import MinValueValidator, MaxValueValidator, FileExtensionValidator from imagekit.models import ImageSpecField from model_utils.models im...
apache-2.0
-2,077,369,729,848,358,400
27.251799
108
0.624141
false
3.872781
false
false
false
Zanzibar82/script.module.urlresolver
lib/urlresolver/plugins/exashare.py
1
6489
""" Exashare.com urlresolver XBMC Addon Copyright (C) 2014 JUL1EN094 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This pro...
gpl-2.0
-6,906,511,386,082,544,000
48.159091
137
0.601788
false
3.674405
false
false
false
cc-it/odoo_mod
currency_rate_update/services/update_service_CA_BOC.py
1
4006
# -*- coding: utf-8 -*- # © 2009 Camptocamp # © 2014 Daniel Dico # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from .currency_getter_interface import CurrencyGetterInterface from openerp import _ from openerp.exceptions import except_orm import logging _logger = logging.getLogger(__name__) class ...
mit
-7,019,638,201,694,220,000
40.708333
79
0.539461
false
3.724651
false
false
false
MillerCMBLabUSC/lab_analysis
apps/4f_model/OldCode/IPCalc.py
1
7846
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Sep 8 10:51:21 2017 @author: jlashner """ from pylab import * import tmm import numpy as np import matplotlib.pyplot as plt import scipy.integrate as intg """ Constants and System Parameters """ #speed of light [m/s] c =2.99792458 * 10**8 GHz = 10 ...
gpl-2.0
4,520,980,213,326,978,600
23.442368
140
0.520902
false
2.562378
false
false
false
M4rtinK/modrana
modules/gui_modules/gui_qt5/gui_qt5.py
1
42517
# -*- coding: utf-8 -*- #---------------------------------------------------------------------------- # A modRana Qt 5 QtQuick 2.0 GUI module # * it inherits everything in the base GUI module # * overrides default functions and handling #---------------------------------------------------------------------------- # Cop...
gpl-3.0
6,526,115,789,858,086,000
36.592396
109
0.600936
false
4.122261
false
false
false
SIU-CS/J-JAM-production
mhapsite/mhap/forms.py
1
3810
""" Contains imports of forms from django and captha and our custom models. Has logic for form validation as well. """ from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from django.forms.extras.widgets import SelectDateWidget from captcha.fields...
gpl-3.0
-1,176,780,099,395,129,900
31.02521
125
0.667979
false
3.891726
false
false
false
curiouserrandy/Python-Utils
dataflow.py
1
11123
import operator ### Setting up a quick dataflow structure model for handling ### Originally inspired for handling transformations in importing mail ### messages for the mail database project (see Projects/MailSys) but ### useful enough that I wanted it globa. ### XXX: There probably are improvements to make in the ba...
gpl-2.0
-3,249,355,095,485,375,000
37.487889
90
0.636879
false
3.959772
false
false
false
czervenka/gapi
gapi/api/bigquery.py
1
3051
# Copyright 2013 Lukas Lukovsky <lukas.lukovsky@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...
apache-2.0
6,696,008,212,205,719,000
29.51
112
0.656178
false
3.523095
false
false
false
felipenaselva/felipe.repository
script.module.resolveurl/lib/resolveurl/plugins/watchers.py
1
1793
""" OVERALL CREDIT TO: t0mm0, Eldorado, VOINAGE, BSTRDMKR, tknorris, smokdpi, TheHighway resolveurl XBMC Addon Copyright (C) 2011 t0mm0 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 Sof...
gpl-2.0
2,952,388,391,311,143,000
36.354167
93
0.660904
false
3.923414
false
false
false
westerncapelabs/django-grs-gatewaycms
quiz/migrations/0001_initial.py
1
8276
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Quiz' db.create_table(u'quiz_quiz', ( (u'id', self.gf('django.db.models.fields.A...
mit
-552,876,124,836,205,300
60.311111
187
0.562953
false
3.553456
false
false
false
mtils/ems
ems/qt/graphics/selection_rect.py
1
3018
from ems.qt import QtWidgets, QtGui, QtCore QGraphicsItem = QtWidgets.QGraphicsItem QGraphicsObject = QtWidgets.QGraphicsObject QObject = QtCore.QObject pyqtProperty = QtCore.pyqtProperty QStyle = QtWidgets.QStyle QBrush = QtGui.QBrush QColor = QtGui.QColor QRectF = QtCore.QRectF Qt = QtCore.Qt QEvent = QtCore.QEvent...
mit
349,490,669,558,714,940
31.804348
83
0.629225
false
3.735149
false
false
false
jarifibrahim/ashoka-dashboard
dashboard/migrations/0018_auto_20170124_2054.py
1
4825
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-01-24 15:24 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dashboard', '0017_auto_20170110_0012'), ] operations = [ migrations.AlterMo...
apache-2.0
7,202,574,898,264,482,000
43.266055
188
0.594197
false
4.277482
false
false
false
atalax/AsteroidOSLinux
asteroid/__init__.py
1
7309
import argparse import collections import datetime import functools import itertools import random import struct import time import xml from asteroid import bleee from gi.repository import GLib def ensure_connected(fn): @functools.wraps(fn) def wrapper(self, *args, **kwargs): # Note that this does no...
mit
6,464,442,055,945,354,000
35.183168
80
0.586674
false
3.459063
false
false
false
openstack/manila-ui
manila_ui/dashboards/project/share_snapshots/tabs.py
1
1082
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
-1,347,417,031,697,469,000
33.903226
78
0.716266
false
3.977941
false
false
false
HPENetworking/topology_lib_sflowtool
lib/topology_lib_sflowtool/parser.py
1
9867
# -*- coding: utf-8 -*- # # Copyright (C) 2016 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/licenses/LICENSE-2.0 # # U...
apache-2.0
-8,103,275,785,004,340,000
35.275735
78
0.480085
false
4.509598
false
false
false
bbengfort/cloudscope
tests/test_utils/test_statistics.py
1
23826
# tests.test_utils.test_statistics # Testing for the statistics utility module. # # Author: Benjamin Bengfort <bengfort@cs.umd.edu> # Created: Tue Aug 23 13:40:49 2016 -0400 # # Copyright (C) 2016 University of Maryland # For license information, see LICENSE.txt # # ID: test_statistics.py [] benjamin@bengfort.com $ ...
mit
-3,628,218,771,555,699,700
42.163043
100
0.580123
false
2.720484
true
false
false
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/hplip/base/g.py
1
11695
# -*- coding: utf-8 -*- # # (c) Copyright 2003-2009 Hewlett-Packard Development Company, L.P. # # 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 opt...
gpl-3.0
3,392,872,497,385,884,000
32.991279
116
0.593175
false
3.458444
true
false
false
ctlewitt/Invisible-Keyboard
analyze_ngram_stats.py
1
3628
import re import string actual_letter_frequency = {"a":"11.602%", "b":"4.702%", "c":"3.511%", "d":"2.670%", "e":"2.007%", "f":"3.779%", "g":"1.950%", "h":"7.232%", "i":"6.286%", "j":".597%", "k":".590%", "l":"2.705%", "m":"4.374%", "n":"2.365%", "o":"6.264%", "p":"2.545%", "q":".173%", "r":"1.653%", "s":"7.755%", "t":...
mit
-3,000,366,039,412,939,000
44.3625
386
0.615766
false
3.157528
false
false
false
Affirm/cabot
cabot/cabotapp/tasks.py
1
11043
import os from datetime import timedelta import logging from celery import Celery from celery._state import set_default_app from celery.task import task from django.core.mail import EmailMessage from django.core.urlresolvers import reverse from cabot.cabotapp.models import Schedule, StatusCheckResultTag, StatusCheckR...
mit
-190,869,898,702,287,970
39.01087
118
0.700625
false
3.729483
false
false
false
lalstef/QuickDatesFormatter
quick_dates_formatter.py
1
3710
import sublime, sublime_plugin from datetime import datetime # Date to be shown as example in the formats list EXAMPLE_DATE = datetime(1970, 12, 31) class QuickdatesformatterFormatDatesCommand(sublime_plugin.WindowCommand): # Needed to find the dates in the chosen format within the text date_to_regex = { '%d/%...
gpl-2.0
-1,456,843,975,556,486,700
31.831858
100
0.675472
false
3.008921
false
false
false
pcournut/deep-learning-for-combinatorial-optimization
Google Pointer Net/decoder.py
1
5801
import tensorflow as tf distr = tf.contrib.distributions # RNN decoder with pointer net for the sequence-to-sequence model. class pointer_decoder(object): def __init__(self, encoder_output, cell, temperature, C, inference_mode, initializer): self.encoder_output = encoder_output # Ref vectors ...
mit
-3,904,509,820,302,967,000
47.177966
153
0.62472
false
3.655325
false
false
false
prefetchnta/questlab
bin/x64bin/python/37/Lib/fnmatch.py
1
4184
"""Filename matching with shell patterns. fnmatch(FILENAME, PATTERN) matches according to the local convention. fnmatchcase(FILENAME, PATTERN) always takes case in account. The functions operate by translating the pattern into a regular expression. They cache the compiled regular expressions for speed. The ...
lgpl-2.1
1,415,220,731,511,954,200
30.6875
79
0.487094
false
4.163184
false
false
false
anqxyr/pyscp
pyscp/orm.py
1
5732
#!/usr/bin/env python3 ############################################################################### # Module Imports ############################################################################### import concurrent.futures import logging import peewee import queue from itertools import islice ###################...
mit
-6,637,355,382,847,117,000
27.66
79
0.552512
false
4.030942
false
false
false
jpopelka/atomic-reactor
atomic_reactor/plugins/exit_sendmail.py
1
11470
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from email.mime.text import MIMEText import os import smtplib import socket try: from urlparse import urljoin except ImportError: fro...
bsd-3-clause
1,448,351,702,517,134,300
43.285714
99
0.599128
false
4.096429
false
false
false
DevynCJohnson/Pybooster
pylib/multimedia.py
1
14498
#!/usr/bin/env python3 # -*- coding: utf-8; Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*- # vim: set fileencoding=utf-8 filetype=python syntax=python.doxygen fileformat=unix tabstop=4 expandtab : # kate: encoding utf-8; bom off; syntax python; indent-mode python; eol unix; replace-tabs off; indent-width 4; tab-...
lgpl-3.0
-5,862,337,393,570,860,000
39.272222
429
0.618016
false
3.346722
false
false
false
gbenson/i8c
tests/test_compiler_driver.py
1
4941
# -*- coding: utf-8 -*- # Copyright (C) 2015-16 Red Hat, Inc. # This file is part of the Infinity Note Compiler. # # The Infinity Note Compiler is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License # as published by the Free Software Foundation, either version 3 ...
lgpl-2.1
-4,894,711,709,997,495,000
34.804348
71
0.632463
false
3.701124
true
false
false
sequana/sequana
sequana/genbank.py
1
5965
# -*- coding: utf-8 -*- # # This file is part of Sequana software # # Copyright (c) 2016 - Sequana Development Team # # File author(s): # Thomas Cokelaer <thomas.cokelaer@pasteur.fr> # Dimitri Desvillechabrol <dimitri.desvillechabrol@pasteur.fr>, # <d.desvillechabrol@gmail.com> # # Distributed u...
bsd-3-clause
-5,432,652,271,706,455,000
36.753165
92
0.474099
false
4.570881
false
false
false
jplu/fasttext-for-linking
fasttext_app.py
1
2105
import fasttext import gensim import numpy import flask import spacy import argparse import os import operator import collections app = flask.Flask(__name__) def file_exists(x): if not os.path.isfile(x): import argparse raise argparse.ArgumentTypeError("{0} is not a file".format(x)) return x...
apache-2.0
5,421,315,234,155,714,000
33.508197
179
0.703563
false
3.100147
false
false
false
bwesterb/pol
src/blockcipher.py
1
2756
""" Implementation of the block ciphers """ import logging import pol.serialization import Crypto.Cipher.AES import Crypto.Util.Counter l = logging.getLogger(__name__) class BlockCipherParameterError(ValueError): pass class BaseStream(object): def encrypt(self, s): raise NotImplementedError d...
gpl-3.0
7,931,594,299,527,833,000
28.956522
78
0.592163
false
4.233487
false
false
false
a-e/csvsee
csvsee/utils.py
1
15673
# utils.py """Shared utility functions for the csvsee library. """ import csv import re import sys from datetime import datetime, timedelta from csvsee import dates class NoMatch (Exception): """Exception raised when no column name matches a given expression.""" pass def float_or_0(value): """Try to c...
mit
8,186,793,736,834,113,000
33.220524
90
0.588081
false
3.945871
false
false
false
jobli/24
hour21_hangman.py
1
3040
import pygame import sys from random import choice from pygame.locals import * RED = (255, 0, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) YELLOW = (255, 255, 0) ORANGE = (255, 100, 0) PURPLE = (100, 0, 255) def get_words(): f = open("words.txt") temp = f.readlines() words = [] for word in temp: ...
gpl-3.0
4,980,498,610,657,509,000
27.679245
71
0.494737
false
3.385301
false
false
false
SpaceGroupUCL/qgisSpaceSyntaxToolkit
esstoolkit/external/networkx/generators/expanders.py
4
6194
"""Provides explicit constructions of expander graphs. """ import itertools import networkx as nx __all__ = ["margulis_gabber_galil_graph", "chordal_cycle_graph", "paley_graph"] # Other discrete torus expanders can be constructed by using the following edge # sets. For more information, see Chapter 4, "Expander Gra...
gpl-3.0
6,139,182,787,235,020,000
29.658416
81
0.585015
false
3.235632
false
false
false
nkmk/python-snippets
notebook/opencv_hconcat_vconcat_np_tile.py
1
2317
import cv2 import numpy as np im1 = cv2.imread('data/src/lena.jpg') im2 = cv2.imread('data/src/rocket.jpg') im_v = cv2.vconcat([im1, im1]) cv2.imwrite('data/dst/opencv_vconcat.jpg', im_v) # True im_v_np = np.tile(im1, (2, 1, 1)) cv2.imwrite('data/dst/opencv_vconcat_np.jpg', im_v_np) # True def vconcat_resize_min(im...
mit
5,698,015,391,255,300,000
34.646154
114
0.632283
false
2.361876
false
false
false
shootstar/novatest
nova/virt/powervm/exception.py
1
2438
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
apache-2.0
9,210,342,643,580,613,000
32.861111
79
0.73872
false
4.153322
false
false
false
joaduo/python-simplerpc
simplerpc/expose_api/javascript/TemplatesCollector.py
1
1940
# -*- coding: utf-8 -*- ''' Simple RPC Copyright (c) 2013, Joaquin G. Duo ''' from simplerpc.base.SimpleRpcLogicBase import SimpleRpcLogicBase from simplerpc.common.path import joinPath, splitPath import os from simplerpc.common.FileManager import FileManager import fnmatch class TemplatesCollector(SimpleRpcLogicBase)...
bsd-3-clause
-4,199,961,447,003,559,400
36.307692
72
0.665979
false
4.181034
false
false
false
mementum/backtrader
backtrader/indicators/mabase.py
1
2719
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015-2020 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
gpl-3.0
-6,185,863,034,770,103,000
28.879121
79
0.634792
false
4.070359
false
false
false
coin-or/oBB
obb/gcest.py
1
2698
from __future__ import division # Use the third order derivative tensor Gershgorin estimation method def gcest(LT,UT,method): # Get dimension D = LT.shape[0] # # Positivity/ Negativity tensor checks # from numpy import all # print('LT non-positive: %s') % all(LT <= 0) # print('UT n...
lgpl-3.0
7,594,793,938,175,760,000
29.659091
79
0.467754
false
3.211905
false
false
false
Nander2/pypot_herkulex
pypot/sensor/kinect/sensor.py
1
3754
""" This code has been developed by Baptiste Busch: https://github.com/buschbapti This module allows you to retrieve Skeleton information from a Kinect device. It is only the client side of a zmq client/server application. The server part can be found at: https://bitbucket.org/buschbapti/kinectserver/src It us...
gpl-3.0
4,152,207,849,554,016,000
32.759259
104
0.579382
false
3.47271
false
false
false
legacysurvey/pipeline
validationtests/quicksipManera3.py
1
51044
from math import * import numpy as np import healpy as hp import astropy.io.fits as pyfits import time import matplotlib.pyplot as plt from multiprocessing import Pool from multiprocessing.dummy import Pool as ThreadPool import numpy.random import os, errno import subprocess twopi = 2.*pi piover2 = .5*pi verbose = Fals...
gpl-2.0
-6,887,529,562,619,616,000
42.075105
223
0.562613
false
3.094701
false
false
false
chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend
tests/unit/dataactvalidator/test_b7_object_class_program_activity_2.py
1
1566
from tests.unit.dataactcore.factories.staging import ObjectClassProgramActivityFactory from tests.unit.dataactvalidator.utils import number_of_errors, query_columns _FILE = 'b7_object_class_program_activity_2' def test_column_headers(database): expected_subset = {'row_number', 'gross_outlays_delivered_or_cpe', ...
cc0-1.0
-5,720,147,414,092,024,000
46.454545
121
0.714559
false
3.189409
true
false
false
openstack/ironic
tools/benchmark/do_not_run_create_benchmark_data.py
1
4622
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
-364,045,721,960,664,100
45.686869
142
0.618347
false
3.674086
false
false
false
CCI-MOC/GUI-Backend
api/v1/views/email.py
1
4618
""" Atmosphere api email """ from rest_framework.response import Response from rest_framework import status from django.template.loader import render_to_string from django.template import Context from threepio import logger from django_cyverse_auth.protocol.ldap import lookupEmail from core.models import AtmosphereU...
apache-2.0
1,517,545,801,638,144,800
30.848276
84
0.569944
false
4.514174
false
false
false
neo1691/scorer.py
scorer/ui.py
1
1402
from curses import wrapper import curses import logging logger = logging.getLogger('scorer.ui') def printGames(stdscr, matches, selected): stdscr.clear() stdscr.addstr(0, 0, "The Following games \ are available Right now\n", curses.color_pair(1)) for index, game in enumerate(matches): if ...
gpl-2.0
5,232,536,504,837,891,000
30.155556
66
0.601284
false
3.799458
false
false
false
dymkowsk/mantid
scripts/Interface/reduction_gui/reduction/inelastic/dgs_sample_data_setup_script.py
1
12591
#pylint: disable=invalid-name """ Classes for each reduction step. Those are kept separately from the the interface class so that the DgsReduction class could be used independently of the interface implementation """ from __future__ import (absolute_import, division, print_function) import os import xml.dom...
gpl-3.0
7,636,383,482,298,824,000
57.562791
124
0.52339
false
4.368841
false
false
false
opencast/pyCA
pyca/db.py
1
6175
# -*- coding: utf-8 -*- ''' pyca.db ~~~~¨~~ Database specification for pyCA ''' import json import os.path import string from pyca.config import config from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, Text, LargeBinary, DateTime, \ create_engine from sqla...
lgpl-3.0
1,113,225,229,775,429,800
25.050633
78
0.587302
false
4.127005
false
false
false
vhb/dotfiles
vim/ycm_extra_conf.py
1
2505
import os import ycm_core from clang_helpers import PrepareClangFlags # Set this to the absolute path to the folder (NOT the file!) containing the # compile_commands.json file to use that instead of 'flags'. See here for # more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html # Most projects will NOT n...
mit
-1,765,271,193,283,489,800
28.821429
79
0.625948
false
3.951104
false
false
false
Lenchik13/Testing
test/test_edit_contact.py
1
1223
from model.contact import Contact import random def test_edit_contact(app, db, check_ui): app.open_home_page() if app.contact.count() == 0: app.contact.create(Contact(firstname="Contact", lastname="", nickname="", address="", company="", home="", ...
apache-2.0
-8,770,590,787,177,672,000
42.678571
123
0.58381
false
3.821875
false
false
false
igorcoding/forum-api
api/api_helpers/common_helper.py
1
1533
import json def required(param_list, args): for param in param_list: if type(param) != str: raise Exception("param must be a string value") if param not in args: raise Exception("%s is required." % (param,)) def semi_required(param_variations, args): atleast = False ...
mit
8,430,216,498,991,779,000
25.448276
81
0.609915
false
3.720874
false
false
false
hfalcic/PyKCS11
samples/dumpit.py
1
10079
#!/usr/bin/env python # Copyright (C) 2006-2008 Ludovic Rousseau (ludovic.rousseau@free.fr) # # This file 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 optio...
gpl-2.0
4,655,479,188,176,520,000
40.477366
108
0.509574
false
3.765035
false
false
false
cineuse/CNCGToolKit
cgtkLibs/cgtk_os/delete_folder.py
1
1091
# coding=utf8 # Copyright (c) 2016 CineUse import os import shutil import logging import cgtk_log log = cgtk_log.cgtk_log(level=logging.INFO) def delete_folder(src): """ Deletes all files from inside a folder .. warning:: This will delete all files in the folder specified Args: sr...
mit
3,809,987,850,486,803,500
22.717391
59
0.499542
false
4.148289
false
false
false
LinkCareServices/cairotft
cairotft/widgets/base.py
1
5884
# Copyright (c) 2015, Thomas Chiroux - Link Care Services # 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 must retain the above copyright notice, this # list o...
bsd-3-clause
4,971,206,907,318,229
36.240506
79
0.64344
false
4.355292
false
false
false
ouh-churchill/quod
config/settings/staging.py
1
3522
#!/usr/bin/python # coding: utf-8 from __future__ import absolute_import, unicode_literals ''' Local settings - Use djangosecure ''' from .common import * # noqa print("DEBUG: Loading settings from staging") # Because we're behind a reverse proxy, pay attention to where the request is coming from USE_X_FORWARDED...
mit
-4,037,620,605,904,640,000
33.871287
117
0.592561
false
3.71519
false
false
false
trevor/calendarserver
calendarserver/tools/push.py
1
4102
#!/usr/bin/env python ## # Copyright (c) 2012-2014 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
apache-2.0
8,099,020,124,651,099,000
38.442308
132
0.56314
false
4.552719
false
false
false
frigg/frigg-common
frigg/projects.py
1
1163
# -*- coding: utf8 -*- import logging from os import listdir from os.path import exists, isfile, join import yaml from .helpers import detect_test_runners logger = logging.getLogger(__name__) def build_tasks(directory): try: files = [f for f in listdir(directory) if isfile(join(directory, f))] exce...
mit
6,964,887,796,134,280,000
22.734694
83
0.638865
false
3.703822
false
false
false
jethrogb/episoder
pyepisoder/episoder.py
1
6798
# episoder, https://code.ott.net/episoder # # Copyright (C) 2004-2020 Stefan Ott. All rights reserved. # # 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...
gpl-3.0
-8,041,760,182,362,835,000
22.201365
71
0.682848
false
3.215705
false
false
false