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
ric2b/Vivaldi-browser
chromium/third_party/PRESUBMIT.py
1
6695
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. ANDROID_WHITELISTED_LICENSES = [ 'A(pple )?PSL 2(\.0)?', 'Android Software Development Kit License', 'Apache( Version)? 2(\.0)?', '(New )?([23]-C...
bsd-3-clause
2,208,229,639,483,903,700
43.337748
80
0.638835
false
3.589812
false
false
false
miurahr/seahub
seahub/share/views.py
1
43542
# encoding: utf-8 import os import logging import json from dateutil.relativedelta import relativedelta from django.core.urlresolvers import reverse from django.db import IntegrityError from django.http import HttpResponse, HttpResponseRedirect, Http404, \ HttpResponseBadRequest from django.shortcuts import render...
apache-2.0
1,044,436,095,295,272,800
35.315263
149
0.59864
false
3.728549
false
false
false
EvenStrangest/tensorflow
tensorflow/contrib/learn/python/learn/preprocessing/categorical.py
1
4119
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-5,749,888,826,094,285,000
31.433071
80
0.667395
false
4.08226
false
false
false
monkeyman79/janitor
python/janitor/ansiterm.py
1
6283
class Term(object): """Collections of constants and setting for ANSI terminal sequence generation.""" # Those are real ANSI color number, used as foreground color codes COLOR_BLACK = 0 COLOR_RED = 1 COLOR_GREEN = 2 COLOR_YELLOW = 3 COLOR_BLUE = 4 COLOR_MAGENTA = 5 COLOR_CYAN = ...
mit
8,766,998,839,585,539,000
31.559585
105
0.529524
false
3.669977
false
false
false
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.1/Lib/site.py
1
18709
"""Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** This will append site-specific paths to the module sear...
mit
-8,872,944,802,195,755,000
31.708042
84
0.585226
false
4.051321
true
false
false
cournape/numscons
numscons/scons-local/scons-local-1.2.0/SCons/Node/Alias.py
1
4267
"""scons.Node.Alias Alias nodes. This creates a hash of global Aliases (dummy targets). """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation fi...
bsd-3-clause
-3,232,397,586,712,303,000
26.888889
89
0.645887
false
3.950926
false
false
false
lizardsystem/lizard-levee
lizard_levee/migrations/0036_auto__chg_field_imagemap_auto_geo_polygon.py
1
19054
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'ImageMap.auto_geo_polygon' db.alter_column('lizard_levee_imagemap', 'auto_geo_polygon', ...
gpl-3.0
256,772,023,288,193,440
82.938326
211
0.54335
false
3.416532
false
false
false
akretion/connector-magento
magentoerpconnect_catalog/product_attribute.py
1
20018
# -*- coding: utf-8 -*- ############################################################################## # # Copyright 2013 # Author: Guewen Baconnier - Camptocamp # Augustin Cisterne-Kaas - Elico-corp # David Béal - Akretion # Sébastien Beau - Akretion # Chafique Delli -...
agpl-3.0
5,949,707,606,378,499,000
33.931937
94
0.594974
false
3.745509
false
false
false
willcharlton/coap
coap/coap.py
1
13144
from __future__ import with_statement import logging class NullHandler(logging.Handler): def emit(self, record): pass log = logging.getLogger('coap') log.setLevel(logging.ERROR) log.addHandler(NullHandler()) import threading import random import traceback import coapTokenizer as t import ...
bsd-3-clause
-882,217,118,932,578,300
34.612813
97
0.448646
false
4.99962
false
false
false
xladykiller/alibb
alibb/pipelines.py
1
6926
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html from alibb import pooled import time class TestPipeline(object): def process_item(self, item, spider): return item ...
mit
9,206,555,295,041,377,000
40.299401
113
0.404727
false
4.625084
false
false
false
florianwittkamp/FD_ACOUSTIC
Python/1D/FD_1D_DX4_DT4_LW.py
1
4255
## FD_1D_DX4_DT4_LW.py 1-D acoustic Finite-Difference modelling # GNU General Public License v3.0 # # Author: Florian Wittkamp 2016 # # Finite-Difference acoustic seismic wave simulation # Discretization of the first-order acoustic wave equation # # Temporal second-order accuracy O(DT^4) # Spatial fourth-order accuracy...
gpl-3.0
1,198,309,789,642,779,600
24.945122
84
0.649354
false
2.502941
false
false
false
hbristow/django-arxiv
arxiv/migrations/0001_initial.py
1
2314
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='MailServer', fields=[ ('id', models.AutoField(ve...
bsd-3-clause
-6,799,345,285,022,927,000
42.660377
124
0.551858
false
4.407619
false
false
false
kytvi2p/tahoe-lafs
src/allmydata/test/test_introducer.py
1
52383
import os, re, itertools from base64 import b32decode import simplejson from twisted.trial import unittest from twisted.internet import defer, address from twisted.python import log from foolscap.api import Tub, Referenceable, fireEventually, flushEventualQueue from twisted.application import service from allmydata....
gpl-2.0
799,364,458,986,540,800
44.829396
125
0.596396
false
3.724351
true
false
false
EduPepperPDTesting/pepper2013-testing
lms/djangoapps/administration/migrations/0014_auto__add_field_customemail_system__add_field_customemail_school__add_.py
1
27145
# -*- 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 field 'CustomEmail.system' db.add_column('admin_custom_emails', 'system', sel...
agpl-3.0
-9,186,819,530,033,816,000
79.313609
182
0.553104
false
3.640692
false
false
false
TinyOS-Camp/DDEA-DEV
Archive/[14_10_03] Data_Collection_Sample/DB access sample code/vtt/query_server.py
1
3209
import httplib import shlex from datetime import datetime import csv import sys from time import time from multiprocessing import Process,Pipe #finland = timezone('Europe/Helsinki') server_dns = "121.78.237.160" #"keti3.oktree.com" port = 8080 #4242 def read_data(sensor, start_time, end_time, child_pipe): da...
gpl-2.0
-6,127,055,017,066,635,000
30.772277
154
0.561857
false
3.281186
false
false
false
tradr-project/WebODM
webodm/settings.py
1
7596
""" Django settings for webodm project. Generated by 'django-admin startproject' using Django 1.10. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os, s...
mpl-2.0
-7,975,831,732,148,826,000
26.225806
104
0.652054
false
3.577956
false
false
false
stepbot/resiliant-trader
run.py
1
25541
from robinhood import Robinhood import numpy as np import math import os import random import time import smtplib import datetime from pymongo import MongoClient import quandl import requests try: import config print('using local config file') rhuser = config.rhuser rhpass = config.rhpass guser = ...
mit
1,264,326,195,631,436,300
39.93109
198
0.594848
false
4.131511
true
false
false
ContentMine/pyCProject
pycproject/factnet.py
1
12692
#!/bin/env python3 # -*- coding: utf-8 -*- """ DEPRECATION WARNING Visualization / network analysis in factnet.py will is no longer supported or maintained in this package as it is not part of the core functionality, and will be removed. Provides basic network plotting functions for a CProject. """ # import networ...
mit
1,147,216,073,514,921,500
35.159544
274
0.546644
false
3.784138
false
false
false
craneworks/sshoney
src/sshoney/modules/core/fs.py
1
5254
# Copyright (c) 2013 Florian Pelgrim <florian.pelgrim@craneworks.de> # Copyright (c) 2009 Upi Tamminen <desaster@gmail.com> # See the COPYRIGHT file for more information import os import time import fnmatch import sshoney.modules.config.defaults as get A_NAME, \ A_TYPE, \ A_UID, \ A_GID, \ A_SIZE, \ ...
bsd-3-clause
-1,099,459,443,787,976,300
26.798942
79
0.475447
false
3.57172
false
false
false
ascii1011/basecat
basecat/bk_models.py
1
2194
from django.db import models from django.contrib.auth.models import User from django.template.defaultfilters import slugify LOCATION_TYPES=( ('reality', 'Alternate Reality'), ('dimension', 'Alertnate Dimension'), ('galaxy','Galaxy'), ('universe', 'Universe'), ('planet', 'Planet'), ('star', 'St...
gpl-2.0
-1,148,197,329,700,893,200
25.756098
122
0.644029
false
3.53871
false
false
false
AuthorizeNet/sample-code-python
FraudManagement/get-held-transaction-list.py
1
2139
import os, sys import imp from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * constants = imp.load_source('modulename', 'constants.py') from decimal import * def get_unsettled_transaction_list(): merchantAuth = apicontractsv1.merchantAuthenticationType() merchantAuth.name = const...
mit
-4,035,314,729,692,103,000
48.744186
221
0.746611
false
4.278
false
false
false
Azure/azure-sdk-for-python
sdk/edgegateway/azure-mgmt-edgegateway/azure/mgmt/edgegateway/models/io_trole_py3.py
1
3387
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
5,769,989,667,654,368,000
42.423077
138
0.621494
false
3.814189
false
false
false
EricSchles/veyepar
dj/main/urls.py
1
5161
# dj/main/urls.py from django.conf.urls import patterns, url # from django.views.generic import list_detail from views import * # client_list={"queryset": Client.objects.all(), } # "template_object_name": "client_list" } urlpatterns = patterns( 'main.views', url(r'^$', main, name='main'), url(r'star...
mit
-8,290,577,844,430,635,000
40.288
162
0.547762
false
2.829496
false
true
false
aidiary/keras_examples
zca_whitening/zca_whitening.py
1
1636
import numpy as np import matplotlib.pyplot as plt from scipy.misc import toimage from keras.datasets import cifar10 def draw(X): """Xは4次元テンソルの画像集合、最初の16枚の画像を描画する""" assert X.shape[0] >= 16 plt.figure() pos = 1 for i in range(16): plt.subplot(4, 4, pos) img = toimage(X[i]) ...
mit
-3,403,314,181,727,608,000
16.287671
39
0.598257
false
1.540904
false
false
false
Lucklyric/NLP-NER-CNN
scripts/data_util.py
1
4256
import numpy as np def parse_raw_data(path): input_sentences = [] target_sentences = [] with open(path) as f: in_sentence = [] target_sentence = [] for line in f: if line != "\n": in_target = line.split('\t') in_sentence.append(in_target[...
apache-2.0
1,025,949,998,498,505,200
41.56
93
0.545348
false
3.726795
false
false
false
adnbsr/hyperloglog
mmh3/hllkhmer.py
1
1384
import random,khmer,sys, mmh3, math class HyperLogLog: def __init__(self, log2m): self.log2m = log2m self.m = 1 << log2m self.data = [0]*self.m self.alphaMM = (0.7213 / (1 + 1.079 / self.m)) * self.m * self.m def add(self, o,k): x=mmh3.hash(str(0),...
mit
-8,992,238,939,058,867,000
18.492958
72
0.458815
false
3.167048
false
false
false
D6C92FE5/oucfeed.crawler
oucfeed/crawler/spiders/yuanxi_shui_chan.py
1
1441
# -*- coding: utf-8 -*- from __future__ import division, absolute_import, print_function, unicode_literals from oucfeed.crawler import util from oucfeed.crawler.newsspider import NewsSpider class Spider(NewsSpider): """水产学院 栏目数比较多,直接请求了包含所有栏目的页面,减少请求次数,但总抓取数比较多(100+) 某些栏目的置顶文章过多可能导致无法检测到新的未置顶的文章,未处理 ...
mit
2,762,528,003,812,730,000
26.266667
82
0.585167
false
2.410609
false
false
false
pacificsky/AdventOfCode
2016/day12_1.py
1
2054
# http://adventofcode.com/2016/day/12 import parse def i_copy(registers, data): if data["x"].isdigit(): registers[data["y"]] = int(data["x"]) else: registers[data["y"]] = registers[data["x"]] registers["index"] += 1 def i_inc(registers, data): registers[data["x"]] += 1 registers[...
apache-2.0
-1,122,145,330,067,779,800
20.631579
109
0.513145
false
3.505119
false
false
false
MosheBerman/brisket-mashup
source/libraries/simplejson-3.3.1/setup.py
1
3691
#!/usr/bin/env python from __future__ import with_statement import sys from distutils.core import setup, Extension, Command from distutils.command.build_ext import build_ext from distutils.errors import CCompilerError, DistutilsExecError, \ DistutilsPlatformError IS_PYPY = hasattr(sys, 'pypy_translation_info') VE...
mit
7,735,405,182,944,016,000
29.254098
78
0.638309
false
4.137892
false
false
false
travislbrundage/geonode
geonode/maps/search_indexes.py
1
5163
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gpl-3.0
4,660,779,719,509,776,000
37.529851
98
0.644005
false
3.950268
false
false
false
apporc/neutron
neutron/api/versions.py
1
1986
# Copyright 2011 Citrix Systems. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
1,224,293,532,180,266,800
30.52381
78
0.64149
false
4.1375
false
false
false
j00bar/django-widgy
widgy/contrib/urlconf_include/models.py
2
1475
from django.db import models from django.core.exceptions import ImproperlyConfigured from django.utils.translation import ugettext_lazy as _ from django.conf import settings from mezzanine.pages.models import Page from widgy.models import links URLCONF_INCLUDE_CHOICES = getattr(settings, 'URLCONF_INCLUDE_CHOICES', N...
apache-2.0
4,860,415,777,182,234,000
37.815789
82
0.707797
false
4.325513
false
false
false
bolkedebruin/airflow
tests/providers/google/cloud/hooks/test_dataproc.py
1
17248
# -*- 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
-3,652,518,569,651,255,000
36.659389
94
0.619202
false
3.62734
true
false
false
argonnexraydetector/RoachFirmPy
Roach2DevelopmentTree/pyfiles/sim928.py
1
2219
""" execfile('sim928.py') sim=sim928() sim.open() sim.write('*IDN?\n') sim.readline() sim.setOutOn(1) sim.getId() sim.setVolts(2.7) sim.getVolts() sim.connport(8) sim.disconnport() sim.close() In /etc/rc.local add these lines. it is supposed to make the two devices available to everyone #added by tim madd...
gpl-2.0
5,096,333,275,523,282,000
13.316129
94
0.473186
false
3.649671
false
false
false
rbarlow/pulp
server/pulp/server/async/manage_workers.py
1
4164
""" This module manages creation, deletion, starting, and stopping of the systemd unit files for Pulp's Celery workers. It accepts one parameter, which must be start or stop. """ from glob import glob import multiprocessing import os import subprocess import sys _ENVIRONMENT_FILE = os.path.join('/', 'etc', 'default',...
gpl-2.0
-6,260,512,703,291,799,000
32.853659
100
0.626321
false
3.717857
false
false
false
pli3/e2-openwbif
plugin/controllers/views/bouqueteditor/web/getprotectionsettings.py
1
5956
#!/usr/bin/env python ################################################## ## DEPENDENCIES import sys import os import os.path try: import builtins as builtin except ImportError: import __builtin__ as builtin from os.path import getmtime, exists import time import types from Cheetah.Version import MinCompatib...
gpl-2.0
-5,162,985,266,285,614,000
36.696203
217
0.644224
false
3.570743
false
false
false
nyalldawson/dwarf_mine
mine.py
1
9460
from typing import List import random import sys import curses from collections import defaultdict from message_box import MessageBox from materials import Lava, Dirt, Space, Water, Fire from utils import Utils from items import Treasure from creatures import Miner, Saboteur, DwarfKing from stats import Stats class M...
mit
-1,478,680,052,043,244,000
33.900369
134
0.517657
false
3.533059
false
false
false
crs4/hl7apy
hl7apy/v2_5_1/__init__.py
1
3064
# -*- coding: utf-8 -*- # # Copyright (c) 2012-2018, CRS4 # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, modify...
mit
1,398,234,607,179,063,000
31.606383
95
0.692559
false
3.538106
false
false
false
tumblr/pytumblr
pytumblr/request.py
1
4576
from future import standard_library standard_library.install_aliases() from builtins import object import urllib.parse import requests import sys PY3 = sys.version_info[0] == 3 from requests_oauthlib import OAuth1 from requests.exceptions import TooManyRedirects, HTTPError class TumblrRequest(object): """ A...
apache-2.0
3,485,260,108,823,571,000
31.920863
131
0.581075
false
4.404235
false
false
false
dc3-plaso/dfvfs
dfvfs/vfs/ntfs_file_system.py
1
5963
# -*- coding: utf-8 -*- """The NTFS file system implementation.""" import pyfsntfs # This is necessary to prevent a circular import. import dfvfs.vfs.ntfs_file_entry from dfvfs.lib import definitions from dfvfs.lib import errors from dfvfs.path import ntfs_path_spec from dfvfs.resolver import resolver from dfvfs.vfs...
apache-2.0
-1,403,082,607,535,988,000
31.05914
80
0.682878
false
3.583534
false
false
false
Eigenlabs/EigenD
tools/windows_tools.py
1
25407
# # Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com # # This file is part of EigenD. # # EigenD 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) a...
gpl-3.0
3,191,013,722,060,027,000
37.848624
173
0.60751
false
3.699869
false
false
false
igurrutxaga/tvalacarta
python/main-classic/servers/rtve.py
1
9363
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para rtve # http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from core import scra...
gpl-3.0
-1,430,525,577,560,627,200
39.318966
184
0.567672
false
3.142089
false
false
false
microsoft/task_oriented_dialogue_as_dataflow_synthesis
src/dataflow/multiwoz/trade_dst_utils.py
1
8908
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import re from typing import Any, Dict, List, Tuple, Union _Slots = List[List[str]] _Act = str BeliefState = List[Dict[str, Union[_Slots, _Act]]] # From https://github.com/jasonwu0731/trade-dst/blob/master/utils/utils_multiWOZ_DST.py. _EXPERIM...
mit
1,830,589,594,467,293,700
32.870722
124
0.523462
false
3.619667
false
false
false
alexjgriffith/alpha-score
src/python/ven.py
1
1722
import sys import pylab as plt sys.path.append("/mnt/brand01-00/mbrand_analysis/lib/matplotlib_venn/") from venn3 import venn3, venn3_circles from venn_util import venn3_unweighted, venn2_unweighted import itertools from subsetClass import subsetWraper class buildVennDiagram(): def __init__(self,data): se...
bsd-3-clause
4,533,234,433,897,609,000
34.142857
120
0.544715
false
3.015762
false
false
false
imk1/IMKTFBindingCode
getMatrixDifferencesMaxPos.py
1
2958
import sys import numpy as np MATRIXONEFILENAME = sys.argv[1] MATRIXTWOFILENAME = sys.argv[2] DETECTORLENGTHFILENAME = sys.argv[3] OUTPUTFILENAME = sys.argv[4] SEQUENCELENGTH = int(sys.argv[5]) MAXPOOLSIZE = int(sys.argv[6]) def getIntList(): # Gets a list of ints from the detector file intFile = open(D...
mit
6,338,042,720,113,457,000
52.814815
254
0.751521
false
3.153518
false
false
false
devbitstudio/portfolio
main/models.py
1
2660
from django.db import models #from django.views.generic import * #from main.views import * # Create your models here. class Portfolio(models.Model): item_name = models.CharField(max_length=50) slug = models.SlugField(max_length=255,unique=True) client = models.CharField(max_length=50) picture = models.ImageField(...
mit
-2,952,661,130,324,388,400
27
95
0.726692
false
3.093023
false
false
false
JeremyRubin/bitcoin
test/functional/rpc_psbt.py
1
28826
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the Partially Signed Transaction RPCs. """ from decimal import Decimal from test_framework.test_f...
mit
-7,183,449,336,590,559,000
58.190965
584
0.66499
false
3.087618
true
false
false
fffy2366/image-processing
bin/python/search_one.py
1
2559
# author: Adrian Rosebrock # date: 27 January 2014 # website: http://www.pyimagesearch.com # USAGE # python search_external.py --dataset ../../public/uploads/similar --index ../../public/uploads/similar.cpickle --query 1464317727202AD22DC2.jpg # import the necessary packages from pyimagesearch.rgbhistogram import RGB...
mit
9,125,469,621,039,959,000
30.592593
144
0.683079
false
3.402926
false
false
false
incuna/authentic
authentic2/attribute_aggregator/migrations/0001_initial.py
1
9703
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'AttributeSource' db.create_table('attribute_aggregator_attributesource', ( ...
agpl-3.0
2,820,234,508,287,195,600
67.330986
196
0.5926
false
3.826104
false
false
false
lach76/scancode-toolkit
src/scancode/extract_cli.py
2
6304
# # Copyright (c) 2015 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. # ScanCode is a trademark of nexB Inc. # # You may not use...
apache-2.0
-8,714,295,398,919,809,000
37.439024
139
0.676713
false
4.035851
false
false
false
nvoron23/TextBlob
textblob/translate.py
1
2924
# -*- coding: utf-8 -*- """ Translator module that uses the Google Translate API. Adapted from Terry Yin's google-translate-python. Language detection added by Steven Loria. """ from __future__ import absolute_import import json import re import codecs from textblob.compat import PY2, request, urlencode from textblob....
mit
6,171,191,617,131,426,000
34.228916
89
0.602599
false
3.476813
false
false
false
emhuff/regularizedInversion
functions2.py
1
15631
#!/usr/bin/env python import desdb import numpy as np import esutil import pyfits import sys import healpy as hp import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator, FormatStrFormatter #import seaborn as sns def CatMatch(c1, c2, band1, band2): radius = 1/3600.0...
mit
7,626,430,899,289,156,000
34.364253
195
0.544623
false
2.769981
false
false
false
dava/dava.engine
RepoTools/Scripts/dumpsce.py
1
3176
import struct, sys, os def readUInt32(f): return struct.unpack("I", f.read(4))[0] def readInt32(f): return struct.unpack("i", f.read(4))[0] def readString(f, maxSize): s = "" pos = 0 while pos < maxSize: c = f.read(1) s += c pos += 1 if c == '\0': break return s def readFloat32(f): return stru...
bsd-3-clause
8,260,454,288,350,022,000
21.055556
72
0.668766
false
2.764143
false
false
false
theanalyst/cinder
cinder/tests/test_migrations.py
1
50778
# Copyright 2010-2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
apache-2.0
5,739,202,709,161,814,000
46.323392
79
0.529422
false
4.932776
true
false
false
dhondta/tinyscript
tinyscript/preimports/venv.py
1
11447
# -*- coding: UTF-8 -*- """Module for enhancing virtualenv preimport. """ import os import re import site import sys import virtualenv from importlib import import_module from pip._internal.cli.main_parser import parse_command from pip._internal.exceptions import PipError from shutil import rmtree from six import stri...
agpl-3.0
3,520,213,127,935,307,000
33.478916
80
0.591334
false
4.002448
false
false
false
kontron/python-ipmi
pyipmi/msgs/event.py
1
2187
from __future__ import absolute_import # Copyright (c) 2014 Kontron Europe GmbH # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option)...
lgpl-2.1
-2,611,152,753,657,613,300
33.171875
79
0.670782
false
3.738462
false
false
false
roy-boy/python_scripts
logFileTimeParser.py
1
7957
import os from stat import * from datetime import date, datetime import re # @TODO Support for rotated log files - currently using the current year for 'Jan 01' dates. class LogFileTimeParser(object): """ Extracts parts of a log file based on a start and enddate Uses binary search logic to speed up searchi...
gpl-3.0
-2,262,465,140,764,309,800
42.71978
117
0.509489
false
3.823642
false
false
false
bsipocz/astropy
astropy/io/misc/asdf/tags/transform/polynomial.py
1
6485
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- import numpy as np from numpy.testing import assert_array_equal from asdf import yamlutil import astropy.units as u from astropy import modeling from .basic import TransformType from . import _parameter_to_value __all__ = ['Shif...
bsd-3-clause
-905,732,550,953,678,800
34.631868
95
0.620509
false
3.857823
false
false
false
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/images_contours_and_fields/tricontour_smooth_user.py
1
3633
""" ====================== Tricontour Smooth User ====================== Demonstrates high-resolution tricontouring on user-defined triangular grids with matplotlib.tri.UniformTriRefiner """ import matplotlib.tri as tri import matplotlib.pyplot as plt import matplotlib.cm as cm import numpy as np # nodebox section if...
mit
-3,282,194,299,031,272,000
32.027273
82
0.497385
false
3.323879
false
false
false
MattPerron/esper
esper/query/scripts/tvnews/write_video.py
1
1216
from query.scripts.script_util import * from scannerpy.stdlib import writers from collections import defaultdict with Database() as db: video = Video.objects.all()[0] faces = FaceInstance.objects.filter(frame__video=video).order_by('frame__number').values('bbox', 'frame__number') t = db.table(video.path) ...
apache-2.0
9,084,886,937,788,683,000
32.777778
117
0.600329
false
3.062972
false
false
false
KevinHCChen/wireless-aoa
simulations/Convert2Complex.py
1
2376
import numpy as np import glob def toa2Complex(toa, db, freq = 2.4e9): radian = toa*freq*2*np.pi return (10**(db/10.))*(np.cos(radian)+1j*np.sin(radian) ) def parseTOALog(fname, num_paths=1): with open(fname) as f: content = f.readlines() # Get rid of the first two lines (header) conten...
mit
-4,867,076,582,586,945,000
26.952941
76
0.591751
false
2.966292
false
false
false
strin/yaotalk
preprocessor.py
1
1563
# coding: utf-8 import argparse import os from HTMLParser import HTMLParser import lxml import jieba import jieba.analyse from lxml.html.clean import Cleaner # strip off html tags. def processDir(data_dir, output_dir): if not os.path.exists(output_dir): os.makedirs(output_dir) # process every html document. ...
gpl-3.0
6,410,692,984,181,313,000
25.965517
93
0.670505
false
2.751761
false
false
false
F5Networks/f5-ansible
ansible_collections/f5networks/f5_modules/plugins/modules/bigip_profile_fastl4.py
1
45513
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- module: bigip_profile_fastl4 sh...
gpl-3.0
4,499,759,295,103,433,700
30.716376
110
0.611957
false
4.073845
false
false
false
I2Cvb/prostate
scratch/lmfit_citrate_fitting.py
1
15922
from __future__ import division import numpy as np import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import seaborn as sns #sns.set(style='ticks', palette='Set2') current_palette = sns.color_palette() from joblib import Parallel, delayed from scipy.special import wofz from scipy.interpolate im...
mit
1,555,651,984,806,360,600
33.993407
97
0.570971
false
2.973296
false
false
false
marscher/PyEMMA
pyemma/coordinates/clustering/uniform_time.py
1
4282
# This file is part of PyEMMA. # # Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER) # # PyEMMA is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either vers...
lgpl-3.0
628,800,472,503,287,800
40.173077
123
0.630313
false
3.92844
false
false
false
Rhoana/rh_aligner
old/match_sift_features.py
1
3994
import sys import os import glob import argparse from subprocess import call from bounding_box import BoundingBox import json import itertools import utils # common functions def match_multiple_sift_features(tiles_file, features_file, index_pairs, jar, out_fname, conf_args): tiles_url = utils.path2url(os.path.a...
mit
-7,068,791,873,920,740,000
41.042105
173
0.640711
false
3.667585
false
false
false
j5shi/Thruster
pylibs/logging/__init__.py
1
62710
# Copyright 2001-2014 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this perm...
gpl-2.0
6,267,202,151,486,535,000
34.102476
93
0.566831
false
4.624972
false
false
false
raysmith619/ThursdayNightPoker
PokerDeck.py
1
5534
"""Card deck module. Library Release 1.1 Copyright 2017 Ray Smith Adapted from Paul Griffiths deck.py Email: raysmith@alum.mit.edu Distributed under the terms of the GNU General Public License. http://www.gnu.org/licenses/ """ import random from collections import Counter from PyTrace import tR from PokerCard im...
gpl-3.0
-114,489,182,964,552,450
23.27193
76
0.56433
false
4.237366
false
false
false
rebase-helper/rebase-helper
rebasehelper/tests/public_api/test_tags.py
1
1749
# -*- coding: utf-8 -*- # # This tool helps you rebase your package to the latest version # Copyright (C) 2013-2019 Red Hat, Inc. # # 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...
gpl-2.0
7,064,672,221,943,201,000
36.869565
110
0.716418
false
3.706383
true
false
false
isfon/DjangoSales
DjangoSales/apps/users/admin.py
1
3251
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.forms import UserCreationForm, UserChangeForm, ReadOnlyPasswordHashField from .models import User from django import forms class CustomUserCreationForm(UserCreationForm): """ A form for creating new...
mit
4,016,946,486,220,399,000
36.270588
118
0.617041
false
4.405149
false
false
false
BrainComputationLab/ncs
python/samples/models/test/ncs_synapse_test.py
1
2828
#!/usr/bin/python import os,sys ncs_lib_path = ('../../../../python/') sys.path.append(ncs_lib_path) import ncs def Run(argv): sim = ncs.Simulation() excitatory_parameters = sim.addNeuron("label_excitatory", "izhikevich", ...
bsd-2-clause
8,631,806,545,327,436,000
46.932203
95
0.34901
false
4.398134
false
false
false
zayfod/pyfranca
tools/fidl_dump.py
1
4080
#!/usr/bin/env python import argparse from pyfranca import Processor, LexerException, ParserException, \ ProcessorException def dump_comments(item, prefix): for key, value in item.comments.items(): print (prefix + key + ": " + value) def dump_namespace(namespace): if namespace.typedefs: ...
mit
2,402,920,606,826,833,000
31.380952
74
0.577206
false
3.934426
false
false
false
adamobeng/encabulator
server.py
1
2550
import pymongo import datetime import time from flask import Flask, render_template, g, request import json NYC_POINTS = (74.258 - 73.700) * 1000 * (40.917 - 40.477) * 1000 app = Flask(__name__) app.config.from_object(__name__) def connect_db(): db = pymongo.MongoClient().taxi return db connect_db().trips....
mit
-5,126,237,265,121,866,000
25.020408
83
0.565882
false
3.244275
false
false
false
GoogleCloudPlatform/cogbeam
cogbeam.py
1
9052
''' Copyright 2020 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software di...
apache-2.0
8,803,762,640,177,029,000
33.030075
157
0.706695
false
3.152908
false
false
false
rven/odoo
addons/website_form/controllers/main.py
1
12575
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import json import pytz from datetime import datetime from psycopg2 import IntegrityError from werkzeug.exceptions import BadRequest from odoo import http, SUPERUSER_ID, _ from odoo.http import request fr...
agpl-3.0
9,125,464,844,741,621,000
44.561594
140
0.580278
false
4.197263
false
false
false
MSFTOSSMgmt/WPSDSCLinux
Providers/nxOMSAutomationWorker/automationworker/3.x/worker/urllib2httpclient.py
2
9775
#!/usr/bin/env python3 # ==================================== # Copyright (c) Microsoft Corporation. All rights reserved. # ==================================== """Urllib2 HttpClient.""" import httplib import socket import time import traceback import urllib2 from httpclient import * from workerexception import * P...
mit
339,998,359,668,497,500
37.183594
115
0.592123
false
4.512927
false
false
false
ihavespoons/doublespeak
CiscoKeyGen.py
1
1608
#! /usr/bin/python print "\n*********************************************************************" print "Cisco IOU License Generator - Kal 2011, python port of 2006 C version" import os import socket import hashlib import struct # get the host id and host name to calculate the hostkey hostid=os.popen("hostid").read()....
gpl-2.0
2,269,667,074,905,381,400
49.28125
115
0.574627
false
3.216
false
false
false
Azure/azure-sdk-for-python
sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_operations.py
1
4794
# 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
4,445,815,105,395,548,700
42.581818
133
0.639758
false
4.658892
false
false
false
manasapte/pants
src/python/pants/engine/nodes.py
1
19690
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from abc i...
apache-2.0
8,189,230,398,252,842,000
38.458918
139
0.694058
false
4.090154
true
false
false
Spoken-tutorial/spoken-website
impersonate/middleware.py
1
1175
# -*- coding: utf-8 -*- from .helpers import ( User, check_allow_for_user, check_allow_for_uri, is_authenticated, ) try: from django.utils.deprecation import MiddlewareMixin except ImportError: MiddlewareMixin = object # fallback for Django < 1.10 class ImpersonateMiddleware(MiddlewareMixin): def pr...
gpl-3.0
-4,663,955,036,857,414,000
32.571429
70
0.605957
false
4.010239
false
false
false
openprocurement/openprocurement.auction.insider
openprocurement/auction/insider/planning.py
1
2544
import iso8601 import logging from datetime import datetime from time import mktime, time from openprocurement.auction.core import Planning from openprocurement.auction.design import startDate_view, endDate_view from openprocurement.auction.systemd_msgs_ids import \ DATA_BRIDGE_PLANNING_TENDER_ALREADY_PLANNED as A...
apache-2.0
3,526,384,998,468,084,700
41.4
90
0.514937
false
4.363636
false
false
false
theLastTrain/seaside
app/main/errors.py
1
1064
# coding:utf-8 from flask import render_template, request, jsonify from . import main @main.app_errorhandler(404) def page_not_found(e): if request.accept_mimetypes.accept_json and \ not request.accept_mimetypes.accept_html: response = jsonify({'error': 'not found'}) response.status_c...
mit
-5,215,691,852,073,337,000
30.294118
62
0.672932
false
3.897436
false
false
false
camisatx/pySecMaster
pySecMaster/utilities/database_rebuilds/verify_min_times.py
1
19507
from datetime import datetime, timedelta from dateutil import tz import time import os import pandas as pd import sqlite3 from pySecMaster import maintenance __author__ = 'Josh Schertz' __copyright__ = 'Copyright (C) 2018 Josh Schertz' __description__ = 'An automated system to store and maintain financial data.' __...
agpl-3.0
-4,128,297,295,732,378,000
41.131749
81
0.567335
false
4.017092
false
false
false
rgayon/plaso
plaso/parsers/selinux.py
1
6623
# -*- coding: utf-8 -*- """This file contains SELinux audit log (audit.log) file parser. Information updated 16 january 2013. An example: type=AVC msg=audit(1105758604.519:420): avc: denied { getattr } for pid=5962 comm="httpd" path="/home/auser/public_html" dev=sdb2 ino=921135 Where msg=audit(1105758604.519:420) c...
apache-2.0
-8,921,181,704,666,653,000
32.964103
78
0.684735
false
3.739695
false
false
false
IBM-Bluemix/gp-python-client
gpclient/gpclient.py
1
25384
# Copyright IBM Corp. 2015, 2017 # # 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 w...
apache-2.0
-2,409,739,383,626,154,500
39.141005
124
0.592854
false
4.521553
false
false
false
xflows/clowdflows-backend
streams/migrations/0001_initial.py
1
1746
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-07-26 09:15 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import picklefield.fields class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_d...
mit
-1,926,240,951,815,009,000
41.585366
144
0.623139
false
4.227603
false
false
false
SpaceGroupUCL/qgisSpaceSyntaxToolkit
esstoolkit/external/networkx/generators/random_graphs.py
1
43392
""" Generators for random graphs. """ import itertools import math import networkx as nx from networkx.utils import py_random_state from .classic import empty_graph, path_graph, complete_graph from .degree_seq import degree_sequence_tree from collections import defaultdict __all__ = [ "fast_gnp_random_graph", ...
gpl-3.0
3,069,563,778,202,875,400
32.465637
99
0.587221
false
3.688027
false
false
false
lhellebr/spacewalk
backend/cdn_tools/cdnsync.py
1
36689
# Copyright (c) 2016 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a copy of G...
gpl-2.0
2,917,838,174,061,464,000
45.324495
120
0.569926
false
4.276107
false
false
false
Ghalko/osf.io
api/nodes/serializers.py
1
16359
from rest_framework import serializers as ser from rest_framework import exceptions from rest_framework.exceptions import ValidationError from modularodm import Q from modularodm.exceptions import ValidationValueError from framework.auth.core import Auth from framework.exceptions import PermissionsError from website....
apache-2.0
617,869,455,350,423,300
35.434298
141
0.620576
false
4.135238
false
false
false
DADco/convalesense-web
config/settings/local.py
1
2242
# -*- coding: utf-8 -*- """ Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app """ import socket import os from .common import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bo...
mit
-5,121,081,801,302,892,000
29.297297
99
0.485281
false
4.167286
false
false
false
sclarke/adventofcode2016
d02.py
1
3799
import attr from attr.validators import instance_of command_string = """RLRDDRLLDLRLUDDULLDRUUULDDLRLUDDDLDRRDUDDDLLURDDDLDDDRDURUDRDRRULUUDUDDRRRLRRRRRLRULRLLRULDRUUDRLRRURDDRLRULDLDULLLRULURRUULLRLLDDDDLLDURRUDLDLURDRDRDLUUUDDRDUUDDULLUURRDRLDDULURRRUDLLULULDLLURURUDRRRRUDRLRDLRRLDDRDDLULDLLLURURDUDRRRRUULURLRDULDRL...
bsd-3-clause
2,956,411,689,336,996,400
78.145833
612
0.877599
false
2.101217
false
false
false
ianastewart/cwltc-admin
members/views/payment_views.py
1
8442
# Includes Credit notes import logging from django.views.generic import CreateView, DetailView, UpdateView from django.forms import ModelForm from django.db.models import Sum from django.shortcuts import reverse, redirect from django_tables2 import SingleTableView, LazyPaginator from braces.views import StaffuserRequ...
mit
-1,355,555,829,226,192,100
36.6875
106
0.596896
false
4.216783
false
false
false
lmazuel/azure-sdk-for-python
azure-batch/azure/batch/models/task_execution_information.py
1
5780
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
3,031,339,249,716,915,000
53.018692
198
0.68218
false
4.246877
false
false
false
TomAugspurger/pandas
pandas/core/dtypes/dtypes.py
1
39219
""" Define extension dtypes. """ import re from typing import ( TYPE_CHECKING, Any, Dict, List, MutableMapping, Optional, Tuple, Type, Union, cast, ) import numpy as np import pytz from pandas._libs.interval import Interval from pandas._libs.tslibs import NaT, Period, Timestam...
bsd-3-clause
6,206,157,390,118,722,000
30.704931
88
0.575308
false
4.475522
false
false
false
lablup/sorna-agent
src/ai/backend/agent/utils.py
1
11162
import asyncio from decimal import Decimal import hashlib import io import ipaddress import json import logging from pathlib import Path import re from typing import ( Any, Optional, Iterable, Mapping, MutableMapping, List, Sequence, Tuple, Union, Type, overload, ) from typing_extensions import Fina...
lgpl-3.0
2,030,065,677,739,292,200
37.357388
105
0.562086
false
4.108208
false
false
false
greggian/TapdIn
django/utils/_decimal.py
1
108522
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz <aahz at pobox.com> # and Tim Peters # This module is currently Py2.3 ...
apache-2.0
4,002,812,287,032,486,400
33.245859
130
0.536214
false
4.27252
false
false
false
dabillox/kcl-fire-aot
src/visualization/batch_visualise_himawari.py
1
7374
import re import os import tempfile from datetime import datetime, timedelta import glob import subprocess import numpy as np import scipy.ndimage as ndimage import src.data.readers.load_hrit as load_hrit import src.config.filepaths as fp class BatchSystem: """Container for syntax to call a batch queuing syste...
mit
8,997,821,034,374,556,000
34.623188
102
0.591673
false
3.410731
false
false
false
rcanepa/cs-fundamentals
python/interview_questions/sorted_array_to_binary_search_tree.py
1
2368
"""Implement an algorithm that transform, in place, a sorted array into a balance binary search tree. Examples: Input: [1, 2, 3] Output: A Balanced BST 2 / \ 1 3 Input: [1, 2, 3, 4, 5, 6, 7] Output: A Balanced BST 4 / \ 2 6 / \ ...
mit
6,661,837,726,195,712,000
20.935185
96
0.538851
false
3.555556
false
false
false
songjun54cm/ml_idiot
gradient_check/CheckerGradient.py
1
3830
__author__ = 'SongJun-Dell' try: xrange except NameError: xrange = range class CheckerGradient(object): def __init__(self): self.delta = 1e-5 self.rel_error_thr_warning = 1e-2 self.rel_error_thr_error = 1.0 self.status_types = ['PASS', 'ZEOR', 'SMALL', 'WARNING', '!!!---ER...
gpl-3.0
4,386,842,961,285,863,000
40.182796
151
0.481984
false
3.822355
false
false
false
kishori82/MetaPathways_Python.3.0
libs/python_scripts/MetaPathways_tRNA_scan.py
1
3783
#!/usr/bin/python """This script run the orf prediction """ try: import sys, re, csv, traceback from os import path, _exit import logging.handlers from optparse import OptionParser, OptionGroup from libs.python_modules.utils.sysutil import pathDelim from libs.python_modules.utils.metapathways_util...
mit
3,825,831,225,120,806,400
27.877863
113
0.618028
false
3.620096
false
false
false