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
germanovm/vdsm
vdsm/v2v.py
1
26018
# Copyright 2014 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 2 of the License, or # (at your option) any later version. # # This program is distributed in the ...
gpl-2.0
1,767,331,554,670,716,700
31.360697
79
0.547352
false
3.807698
false
false
false
omriabnd/UCCA-App
Server/uccaApp/models/Users.py
1
1828
from datetime import datetime from rest_framework.exceptions import ValidationError from uccaApp.models import Tabs, Constants, Roles from django.db import models from django.contrib.auth.models import User, Group class Users(models.Model): id = models.AutoField(primary_key=True) user_auth = models.OneToOn...
gpl-3.0
-3,633,067,282,102,347,000
41.534884
132
0.721007
false
3.619802
false
false
false
skosukhin/spack
lib/spack/spack/cmd/compiler.py
1
7883
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
1,675,584,116,106,376,700
36.899038
78
0.608905
false
3.866111
true
false
false
380wmda999/sphinx2.2.11-string-4G
api/sphinxapi.py
1
35093
# # $Id$ # # Python version of Sphinx searchd client (Python API) # # Copyright (c) 2006, Mike Osadnik # Copyright (c) 2006-2016, Andrew Aksyonoff # Copyright (c) 2008-2016, Sphinx Technologies Inc # All rights reserved # # This program is free software; you can redistribute it and/or modify # it under the terms of the...
gpl-2.0
-197,369,445,877,807,000
27.323648
228
0.632576
false
2.936898
false
false
false
nurnbeck/project-2-CMPUT-291
ret_DATA.py
1
1814
import os import time import bsddb3 as bsddb ''' Retrieve records with a given data - Assume that database is closed before calling ret_DATA(); - Writes (append) the result to the file 'answers'. For now I assume that indexfile = btree, further tests are necessary. Tested under DB_SIZE = 10 ''' DB_FILE = "/tmp/yish...
mit
2,081,410,483,051,653,400
24.914286
69
0.582139
false
3.529183
false
false
false
benjamindeleener/odoo
addons/l10n_ca/__openerp__.py
1
1831
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Canada - Accounting', 'version': '1.0', 'author': 'Savoir-faire Linux', 'website': 'https://www.savoirfairelinux.com', 'category': 'Localization/Account Charts', 'description': """ This...
gpl-3.0
8,879,892,428,055,025,000
33.54717
96
0.656472
false
4.041943
false
false
false
AnotherBobSmith/CLUZ
cluz_dialog3.py
1
15904
# -*- coding: utf-8 -*- """ /*************************************************************************** A QGIS plugin CLUZ for QGIS ------------------- begin : 2016-23-02 copyright : (C) 2016 by Bob Smith, DICE ...
gpl-2.0
-8,681,222,330,805,281,000
42.453552
131
0.624245
false
4.084232
false
false
false
yakky/django-cms
cms/models/static_placeholder.py
1
3681
import uuid from django.contrib.auth import get_permission_codename from django.contrib.sites.models import Site from django.core.exceptions import ValidationError from django.db import models from django.utils.translation import ugettext_lazy as _ from six import text_type, python_2_unicode_compatible from cms.mode...
bsd-3-clause
-8,891,000,634,964,670,000
39.01087
114
0.659332
false
4.018559
false
false
false
nickgentoo/LSTM-timepredictionPMdata
code/nick_evaluate_suffix_and_remaining_time_only_time_OHenc.py
1
15048
''' this script takes as input the LSTM or RNN weights found by train.py change the path in line 178 of this script to point to the h5 file with LSTM or RNN weights generated by train.py Author: Niek Tax ''' from __future__ import division from keras.models import load_model import csv import copy import numpy as np ...
gpl-3.0
-5,484,811,627,186,544,000
37.192893
126
0.624003
false
3.246602
false
false
false
shoyer/xarray
xarray/tests/test_variable.py
1
87655
import warnings from copy import copy, deepcopy from datetime import datetime, timedelta from textwrap import dedent import numpy as np import pandas as pd import pytest import pytz from xarray import Coordinate, Dataset, IndexVariable, Variable, set_options from xarray.core import dtypes, duck_array_ops, indexing fr...
apache-2.0
-3,690,393,615,737,424,000
36.1105
88
0.53123
false
3.330737
true
false
false
bountyful/bountyfulcoins
bountyfulcoinsapp/migrations/0001_initial.py
1
9626
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'Link' db.create_table(u'bountyfulcoinsapp_link', ( ...
mit
-6,591,234,244,855,706,000
55.623529
195
0.566487
false
3.435403
false
false
false
HengeSense/website
apps/news/widgets.py
1
2559
############################################################################ # This file is part of the Maui Web site. # # Copyright (c) 2012 Pier Luigi Fiorini # Copyright (c) 2009-2010 Krzysztof Grodzicki # # Author(s): # Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> # # $BEGIN_LICENSE:AGPL3+$ # # This program ...
agpl-3.0
3,561,484,379,450,850,000
30.207317
76
0.664322
false
3.222922
false
false
false
karimbahgat/Pure-Python-Greiner-Hormann-Polygon-Clipping
GreinerHorman_Algo/KimKim/puremidpoints_v16(k&k,tryfixcrosschange).py
1
36981
# -*- coding: UTF-8 -*- # Efficient Clipping of Arbitrary Polygons # # Copyright (c) 2011, 2012 Helder Correia <helder.mc@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 vers...
gpl-3.0
691,236,750,043,469,000
37.399792
191
0.495308
false
4.0485
true
false
false
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/PyKDE4/kdecore/KEncodingDetector.py
1
2735
# encoding: utf-8 # module PyKDE4.kdecore # from /usr/lib/python2.7/dist-packages/PyKDE4/kdecore.so # by generator 1.135 # no doc # imports import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtNetwork as __PyQt4_QtNetwork class KEncodingDetector(): # skipped bases: <type 'sip.wrapper'> # no doc def analyze(s...
gpl-2.0
1,633,415,797,107,800,600
25.553398
101
0.643876
false
3.946609
false
false
false
mph-/lcapy
lcapy/nexpr.py
1
7914
"""This module provides the DiscreteTimeDomainExpression class to represent discrete-time expressions. Copyright 2020--2021 Michael Hayes, UCECE """ from __future__ import division from .domains import DiscreteTimeDomain from .sequence import Sequence from .functions import exp from .sym import j, oo, pi, fsym, oo f...
lgpl-2.1
6,243,116,347,179,922,000
30.15748
92
0.604372
false
4.003035
false
false
false
idiap/rgbd
Processing/Processor.py
1
3672
""" Copyright (c) 2014 Idiap Research Institute, http://www.idiap.ch/ Written by Kenneth Funes <kenneth.funes@idiap.ch> This program 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 3 of the ...
lgpl-3.0
6,560,452,943,276,382,000
35
168
0.659858
false
4.107383
false
false
false
jhartnett/ipCounter
src/ipCounter.py
1
1779
#!/bin/python #/************************************************************************** #* File: ipCounter.py #* #* This is a basic program to count the total number of IPs #* in a given range. Input is a txt formatted file similar #* to the sample provided #* #* This updated version uses Python to make it more a...
apache-2.0
33,192,525,953,773,740
23.708333
77
0.588533
false
3.240437
false
false
false
dunkhong/grr
grr/test_lib/db_test_lib.py
1
2046
#!/usr/bin/env python """Test utilities for RELDB-related testing.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import functools import sys import mock from grr_response_core.lib.util import compatibility from grr_response_server import data_store ...
apache-2.0
5,616,811,757,687,994,000
29.537313
77
0.721896
false
3.972816
true
false
false
fja05680/pinkfish
examples/310.cryptocurrencies/strategy.py
1
6833
""" The SMA-ROC-portfolio stategy. This is SMA-ROC strategy applied to a portfolio. SMA-ROC is a rate of change calculation smoothed by a moving average. This module allows us to examine this strategy and try different period, stop loss percent, margin, and whether to use a regime filter or not. We split up the tota...
mit
4,744,775,123,107,647,000
36.543956
102
0.56915
false
3.825868
false
false
false
tasoc/photometry
notes/halo_shift.py
1
2629
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ .. codeauthor:: Rasmus Handberg <rasmush@phys.au.dk> """ import numpy as np import matplotlib.pyplot as plt from astropy.io import fits import sqlite3 import os.path #------------------------------------------------------------------------------ def mag2flux(mag): ...
gpl-3.0
-1,066,074,733,466,643,000
26.103093
142
0.657284
false
2.569892
false
false
false
CacaoMovil/guia-de-cacao-django
cacao_app/config/common.py
1
11423
# -*- coding: utf-8 -*- """ Django settings for cacao_app project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ # Build paths inside the project like this: os.p...
bsd-3-clause
4,947,143,118,909,856,000
31.177465
108
0.617526
false
3.762516
true
false
false
SergeyKubrak/django-rosetta
rosetta/polib.py
1
59163
# -* coding: utf-8 -*- # # License: MIT (see LICENSE file provided) # vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: """ **polib** allows you to manipulate, create, modify gettext files (pot, po and mo files). You can load existing files, iterate through it's entries, add, modify entries, comments or metada...
mit
-254,093,164,069,252,670
32.730331
79
0.520291
false
4.287174
false
false
false
VladimirShe/in100gram
in100gram/in100gram/settings.py
1
2137
""" Django settings for in100gram project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) ...
apache-2.0
-7,077,503,071,250,312,000
23.563218
71
0.709406
false
3.252664
false
false
false
mtdx/ml-algorithms
neural-networks/cnn.py
1
2621
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("/tmp/data/", one_hot=True) n_classes = 10 batch_size = 128 x = tf.placeholder('float', [None, 784]) y = tf.placeholder('float') keep_rate = 0.8 keep_prob = tf.placeholder(tf.float32) def conv2d(x,...
mit
-4,813,126,551,715,110,000
33.038961
87
0.595193
false
3.019585
false
false
false
m4sth0/sauventory
tests/test_ranktransform.py
1
4574
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2016 # Author(s): # Thomas Leppelt <thomas.leppelt@dwd.de> # This file is part of sauventory. # Spatial Autocorrelated Uncertainty of Inventories # sauventory is free software: you can redistribute it and/or modify # it under the terms of the GNU Gener...
gpl-3.0
-1,744,700,304,624,888,300
42.980769
79
0.49366
false
3.165398
true
false
false
T2DREAM/t2dream-portal
src/encoded/upgrade/file.py
1
22524
from snovault import upgrade_step from pyramid.traversal import find_root from datetime import datetime, time @upgrade_step('file', '', '2') def file_0_2(value, system): # http://redmine.encodedcc.org/issues/1295 # http://redmine.encodedcc.org/issues/1307 if 'status' in value: value['status'] = va...
mit
-7,386,508,491,949,481,000
38.93617
109
0.544752
false
3.615409
false
false
false
tensorflow/ranking
tensorflow_ranking/python/keras/canned/dnn.py
1
5354
# Copyright 2021 The TensorFlow Ranking 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 applicable law or ag...
apache-2.0
-1,788,232,522,490,547,200
38.080292
80
0.675196
false
4.150388
false
false
false
berjc/aus-senate-audit
aus_senate_audit/audits/bayesian_audit.py
1
5902
# -*- coding: utf-8 -*- """ Implements the Bayesian Audit. """ from collections import Counter from itertools import chain from random import gammavariate from random import seed as set_seed from time import time def get_new_ballot_weights(election, r): """ Returns new ballot weights for the given election. ...
apache-2.0
373,211,840,810,849,340
42.080292
120
0.619282
false
3.877792
false
false
false
zenofewords/zenofewords
tests/utils.py
1
1705
from copy import copy from django.conf import settings from django.urls import reverse def get_permissions(response_mapping, custom_mapping): """ Build permission mappings. :param response_mapping: usually a predefined permission template (FORBIDDEN, NOT_FOUND, etc.) :type response_mapping: dict ...
mit
-4,056,573,595,075,421,000
35.276596
98
0.674487
false
4.383033
false
false
false
lmazuel/azure-sdk-for-python
azure-servicefabric/azure/servicefabric/models/application_health_state_filter.py
1
6307
# 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,039,962,441,478,437,400
55.81982
168
0.721896
false
4.935055
false
false
false
guillaume-philippon/aquilon
lib/aquilon/worker/formats/chassis.py
1
1715
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2013,2014,2016 Contributor # # 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...
apache-2.0
9,082,157,566,535,196,000
38.883721
80
0.668222
false
3.979118
false
false
false
mlperf/training_results_v0.5
v0.5.0/nvidia/submission/code/rnn_translator/pytorch/seq2seq/data/sampler.py
1
5047
import logging import torch from torch.utils.data.sampler import Sampler from mlperf_compliance import mlperf_log from seq2seq.utils import gnmt_print from seq2seq.utils import get_world_size, get_rank class BucketingSampler(Sampler): """ Distributed data sampler supporting bucketing by sequence length. ...
apache-2.0
-4,972,239,737,936,623,000
32.646667
93
0.597781
false
4.011924
false
false
false
smenon8/AlgDataStruct_practice
practice_problems/MorePractice.py
1
2289
# Divide and Conquer Algorithm for finding the maximum sub array sum def maxSubArraySum(arr,h,t): if h == t: return arr[h] m = (h+t)//2 # 1. find max in left subarray leftSum = maxSubArraySum(arr,h,m) # 2. find max in right subarray rightSum = maxSubArraySum(arr,m+1,t) # 3. find max in mid-point crossin...
mit
6,559,211,954,744,387,000
23.105263
118
0.671472
false
2.640138
false
false
false
argv-minus-one/obnam
obnamlib/encryption.py
1
7876
# Copyright 2011 Lars Wirzenius # # 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 program is distributed in th...
gpl-3.0
1,874,813,231,981,704,400
27.536232
77
0.603225
false
3.841951
false
false
false
tuxar-uk/Merlyn
Merlyn.py
1
6041
""" Merlyn Speech Control for PC We load in commands (& spells) generated by lmtool.py and also language files generated by the Sphinx lmtool http://www.speech.cs.cmu.edu/tools/lmtool-new.html then open up a stream of words from the mic via LiveSpeech and try to parse it into commands and possibly some parameters...
mit
-4,345,104,676,021,986,300
30.463542
99
0.636484
false
3.061835
false
false
false
DLR-SC/DataFinder
contrib/script_examples/command_line/items.py
1
4139
# $Filename$ # $Authors$ # Last Changed: $Date$ $Committer$ $Revision-Id$ # # Copyright (c) 2003-2011, German Aerospace Center (DLR) # All rights reserved. # # #Redistribution and use in source and binary forms, with or without #modification, are permitted provided that the following conditions are #met: # ...
bsd-3-clause
7,515,495,566,930,876,000
35.627273
92
0.70476
false
4.176589
false
false
false
visionegg/visionegg
docs/conf.py
1
8232
# -*- coding: utf-8 -*- # # Vision Egg documentation build configuration file, created by # sphinx-quickstart on Fri Aug 29 21:31:07 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
lgpl-2.1
-9,219,821,388,749,676,000
30.54023
79
0.706876
false
3.706439
true
false
false
soybean217/lora-python
UServer/http_api_no_auth/api/api_gateway.py
1
5817
import json from http_api_no_auth.api import api, root from http_api_no_auth.api.decorators import gateway_belong_to_user from userver.object.gateway import Gateway, Location from utils.errors import KeyDuplicateError, PatchError from .forms.form_gateway import AddGatewayForm, PatchGateway from ..http_auth import auth...
mit
255,426,881,030,014,140
43.10687
116
0.646702
false
3.57709
false
false
false
valeriansaliou/django-gitlab-logging
gitlab_logging/handlers.py
1
2294
import logging class GitlabIssuesHandler(logging.Handler): """ Handles logs as issues with GitLab API """ def __init__(self): logging.Handler.__init__(self) def __open_issue(self, title, content, trace_raw): """ Open an issue on GitLab with given content """ ...
mit
2,486,562,706,917,107,700
30.424658
102
0.551003
false
4.103757
false
false
false
cpieloth/GPGPU-on-Hadoop
hadoop_ocl_link_test/runTime/runtime.py
1
1118
#!/usr/bin/env python # Python 3 import shlex import subprocess import re import sys import time # read command line arguments if len(sys.argv) < 3: print('Usage: <program> <outputfile> <value name>') sys.exit(1) # Variables PRG_NAME = sys.argv[1] DATA_NAME = sys.argv[2] VAL_NAME = sys.argv[3] RUNS...
apache-2.0
-4,649,629,103,920,189,000
19.5
63
0.63059
false
2.674641
false
false
false
NeurodataWithoutBorders/api-python
examples/create_scripts/general-e.py
1
2091
#!/usr/bin/python import sys from nwb import nwb_file from nwb import nwb_utils as utils """ Example using extension to add metadata to group /general Group /general contains general metadata, i.e. metadata that applies to the entire session. This example uses the extension defined in extensions/e-general.py to add ...
bsd-3-clause
7,030,291,989,708,587,000
33.278689
83
0.704926
false
3.1875
false
false
false
guildai/guild
guild/remotes/gist.py
1
20430
# Copyright 2017-2021 TensorHub, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
8,576,580,919,284,401,000
29.266667
88
0.598776
false
3.312794
false
false
false
adamcandy/Gaia
FileTodo.py
1
56922
#!/usr/bin/env python # -*- coding: utf-8 -*- ########################################################################## # # Gaia, task list organiser in with Caldav server sync. # # Copyright (C) 2013-2014 Dr Adam S. Candy. # Dr Adam S. Candy, contact@gaiaproject.org # # This file is part of the Gaia project...
gpl-3.0
-4,814,139,854,392,383,000
34.845088
271
0.593531
false
3.500523
false
false
false
Thortoise/Super-Snake
Blender/animation_nodes-master/sockets/shape_key.py
1
2668
import bpy from bpy.props import * from bpy.types import ShapeKey from .. events import propertyChanged from .. base_types.socket import AnimationNodeSocket from .. utils.id_reference import tryToFindObjectReference class ShapeKeySocket(bpy.types.NodeSocket, AnimationNodeSocket): bl_idname = "an_ShapeKeySocket" ...
gpl-3.0
-1,726,559,515,112,783,400
30.761905
107
0.652174
false
3.912023
false
false
false
almostearthling/when-wizard
share/when-wizard/plugins/cond-event-batterylow.py
1
1402
# file: share/when-wizard/templates/cond-event-batterylow.py # -*- coding: utf-8 -*- # # Condition plugin for the low battery event # Copyright (c) 2015-2018 Francesco Garosi # Released under the BSD License (see LICENSE file) import locale from plugin import EventConditionPlugin, PLUGIN_CONST, plugin_name # setup i1...
bsd-3-clause
3,910,088,821,444,205,000
28.208333
74
0.669044
false
3.718833
false
false
false
ghackebeil/PyORAM
src/pyoram/storage/block_storage.py
1
3293
__all__ = ('BlockStorageTypeFactory',) import logging log = logging.getLogger("pyoram") def BlockStorageTypeFactory(storage_type_name): if storage_type_name in BlockStorageTypeFactory._registered_devices: return BlockStorageTypeFactory.\ _registered_devices[storage_type_name] else: ...
mit
-4,740,640,862,702,392,000
38.674699
73
0.580626
false
4.864106
false
false
false
liweitianux/atoolbox
astro/radec2deg.py
1
1957
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Aaron LI # Created: 2015-04-17 # Updated: 2016-06-30 # """ Convert the coordinates data in format (??h??m??s, ??d??m??s) to format (degree, degree). """ import os import sys import re import getopt import math USAGE = """Usage: %(prog)s [ -h ] -i coords_file R...
mit
6,794,721,827,466,608,000
19.385417
64
0.502299
false
2.807747
false
false
false
jfantom/incubator-airflow
airflow/contrib/auth/backends/proxied_auth.py
1
3179
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
3,035,449,064,927,744,000
28.165138
74
0.650834
false
4.177398
false
false
false
dvklopfenstein/PrincetonAlgorithms
py/AlgsSedgewickWayne/Bag.py
1
2806
"""Bag class is a container for generic items.""" class Bag(object): # <Item> implements Iterable<Item>: """The Bag class represents a bag (or multiset) of generic items.""" class _Node(object): # private static class <Item>: """helper linked list class""" def __init__(self, Item, Next): self._item...
gpl-2.0
8,381,885,796,278,084,000
27.343434
83
0.612616
false
3.438725
false
false
false
M32Media/redash
redash/tasks/queries.py
1
24668
import json import time import logging import signal import redis import re from celery.result import AsyncResult from celery.utils.log import get_task_logger from redash import redis_connection, models, statsd_client, settings, utils from redash.utils import gen_query_hash from redash.worker import celery from redash....
bsd-2-clause
-672,060,604,044,315,900
36.603659
160
0.59186
false
3.964004
false
false
false
deepmind/deepmind-research
ogb_lsc/mag/losses.py
1
6654
# Copyright 2021 DeepMind Technologies Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
-7,726,497,317,545,474,000
32.437186
80
0.681996
false
3.294059
false
false
false
adhocish/MELEEDB
meleedb/main.py
1
1570
import logging import datetime import os from scrapy.crawler import CrawlerProcess from scrapy.settings import Settings from scrapy.utils.log import configure_logging import spiders def run(): # Logging settings configure_logging(install_root_handler=False) logging.basicConfig( datefmt='%Y-%m-%d ...
gpl-3.0
334,612,834,064,739,840
29.803922
107
0.664968
false
3.915212
false
false
false
uwescience/pulse2percept
pulse2percept/implants/bvt.py
1
4694
"""`BVT24`""" import numpy as np from .base import ProsthesisSystem from .electrodes import DiskElectrode from .electrode_arrays import ElectrodeArray class BVT24(ProsthesisSystem): """24-channel suprachoroidal retinal prosthesis This class creates a 24-channel suprachoroidal retinal prosthesis [Layton2...
bsd-3-clause
-6,385,752,689,116,946,000
37.162602
78
0.553473
false
3.026435
false
false
false
belemizz/mimic2_tools
clinical_db/classify_patients.py
1
3203
""" classify patients based on lab tests """ import get_sample.mimic2 from mutil import Graph import mutil.mycsv import time import datetime import random import numpy as np import theano import theano.tensor as T import alg.classification def main( max_id = 2000, target_codes = ['428.0'], show_flag = True): m...
mit
-5,518,623,470,133,790,000
33.074468
100
0.547924
false
3.418356
false
false
false
Stymphalian/sublime-plugins
KeyMapQuery/KeyMapQuery.py
1
8716
import sublime, sublime_plugin import re from collections import namedtuple import os.path """ KeyMapQueryCommand allows you to quickly query if a key-binding is bound. A combo-box will appear displayings a list of bound key-bindings. Type a key-combination into the inptu box to narrow the results ( i.e. ctrl+...
mit
-5,049,045,572,851,911,000
44.37234
101
0.572855
false
4.130806
false
false
false
alfredodeza/execnet
execnet/gateway_io.py
1
7538
# -*- coding: utf-8 -*- """ execnet io initialization code creates io instances used for gateway io """ import os import shlex import sys try: from execnet.gateway_base import Popen2IO, Message except ImportError: from __main__ import Popen2IO, Message from functools import partial class Popen2IOMaster(Pop...
mit
4,103,531,356,347,174,000
29.152
82
0.645795
false
3.666342
false
false
false
wpjesus/codematch
ietf/secr/proceedings/forms.py
1
6833
import os from django import forms from django.conf import settings from django.template.defaultfilters import filesizeformat from ietf.doc.models import Document from ietf.group.models import Group from ietf.name.models import DocTypeName from ietf.meeting.models import Meeting, Session # -------------------------...
bsd-3-clause
3,905,673,467,625,157,000
45.482993
492
0.647007
false
4.038416
false
false
false
alaeddine10/ggrc-core
src/ggrc/models/relationship_types.py
1
21783
class RelationshipTypes(object): @classmethod def types(cls): types = {} for k, rt in RELATIONSHIP_TYPES.items(): types[k] = rt.copy() types[k].update({ 'relationship_type': k }) return types @classmethod def get_type(cls, relationship_type_id): return cls.types().get(relationship_...
apache-2.0
-5,848,448,770,137,311,000
40.333966
102
0.66786
false
3.76999
false
false
false
bworrell/mixbox
mixbox/parser.py
1
6500
# Copyright (c) 2015, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. from abc import ABCMeta, abstractmethod from distutils.version import StrictVersion from .exceptions import ignored from .xml import get_etree_root, get_schemaloc_pairs class UnknownVersionError(Exception): "...
bsd-3-clause
6,696,311,111,732,359,000
32.333333
79
0.612154
false
4.545455
false
false
false
urska19/LVR-sat
src/graphColoring.py
1
1511
#!/usr/bin/env python from logConstructs import * def graph_coloring(graph, colors): if len(graph) < colors: return False variables=[[None for i in range(colors)] for j in range(len(graph))] #construct variables for i in range(len(graph)): for j in range(colors): variable...
bsd-3-clause
3,202,995,941,548,603,000
24.610169
104
0.578425
false
3.658596
false
false
false
dschien/PyExcelModelingHelper
excel_helper/__init__.py
1
33092
import csv import datetime import importlib import sys from abc import abstractmethod from collections import defaultdict from typing import Dict, List, Set import numpy as np import pandas as pd from dateutil import relativedelta as rdelta import logging from functools import partial from xlrd import xldate_as_tupl...
mit
-7,804,508,916,194,763,000
36.434389
177
0.579808
false
4.125156
false
false
false
mike-perdide/gitbuster
gitbuster/q_git_delegate.py
1
4118
# q_git_delegate.py # Copyright (C) 2010 Julien Miotte <miotte.julien@gmail.com> # # This module is part of gitbuster and is released under the GPLv3 # License: http://www.gnu.org/licenses/gpl-3.0.txt # from PyQt4.QtCore import QDateTime, QVariant, Qt, SIGNAL, QRect from PyQt4.QtGui import QDateTimeEdit, QItemDelegate...
gpl-3.0
-6,977,865,863,436,541,000
36.099099
80
0.602234
false
4.085317
false
false
false
luaduck/suds
soapclient.py
1
6841
### # This file is part of Soap. # # Soap 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, version 2. # # Soap is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without ev...
gpl-2.0
-6,182,395,961,143,806,000
29.095455
94
0.597427
false
3.942939
false
false
false
cloudnull/skylab
skylab/executable.py
1
9051
# ============================================================================= # Copyright [2013] [Kevin Carter] # License Information : # This software has no warranty, it is provided 'as is'. It is your # responsibility to validate the behavior of the routines and its accuracy # using the code provided. Consult the ...
gpl-3.0
-6,981,783,929,136,485,000
34.774704
79
0.481936
false
4.293643
false
false
false
kmaglione/amo-validator
validator/testcases/javascript/obsolete.py
1
3693
from __future__ import absolute_import, print_function, unicode_literals from .jstypes import Hook, Interfaces OBSOLETE_EXTENSION_MANAGER = { 'on_get': 'This interface is part of the obsolete extension manager ' 'interface, which is not available in any remotely modern ' 'version of F...
bsd-3-clause
-5,829,427,618,306,759,000
37.46875
78
0.620092
false
4.044907
false
false
false
tchellomello/home-assistant
homeassistant/components/roomba/sensor.py
1
1696
"""Sensor for checking the battery level of Roomba.""" import logging from homeassistant.components.vacuum import STATE_DOCKED from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE from homeassistant.helpers.icon import icon_for_battery_level from .const import BLID, DOMAIN, ROOMBA_SESSION from .irobot_bas...
apache-2.0
-4,041,612,516,098,413,000
28.241379
68
0.665684
false
3.743929
false
false
false
bcopeland/speccy
scanner.py
1
9599
#!/usr/bin/python from multiprocessing import Value from threading import Thread, Lock import os import time class Scanner(object): interface = None freqlist = None process = None debugfs_dir = None is_ath10k = False lock = None run = True def dev_to_phy(self, dev): f = open(...
gpl-2.0
7,727,370,529,989,816,000
32.680702
114
0.551307
false
3.484211
false
false
false
kretusmaximus/MicroFTP.py
microftp/common_view.py
1
2633
# -*- coding: utf-8 -*- import Tkinter import tkFont class Window(Tkinter.Tk): def __init__(self, parent): Tkinter.Tk.__init__(self,parent) self.parent = parent def initialize(self): pass class Listbox(Tkinter.Listbox): def autowidth(self, maxwidth): f = tkFont.Font(font...
mit
5,434,954,006,917,956,000
27.619565
105
0.582226
false
3.983359
false
false
false
distributed-system-analysis/pbench
server/bin/pbench-server-prep-shim-002.py
1
12572
#!/usr/bin/env python3 # -*- mode: python -*- # This script is used to prepare the tarballs that a version 002 client # submits for further processing. It copies the tarballs and their MD5 # sums to the archive (after checking) and sets the state links, so # that the dispatch script will pick them up and get the ball ...
gpl-3.0
-8,785,501,480,780,962,000
33.443836
88
0.595291
false
3.914072
true
false
false
Donkyhotay/MoonPy
zope/rdb/tests/test_gadflyphantom.py
1
2917
############################################################################## # # Copyright (c) 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
gpl-3.0
-2,021,767,907,325,298,700
27.881188
78
0.57182
false
4.001372
true
false
false
ArcherSys/ArcherSys
Lib/test/testcodec.py
1
3278
<<<<<<< HEAD <<<<<<< HEAD """ Test Codecs (used by test_charmapcodec) Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,e...
mit
195,848,417,422,403,780
20.853333
68
0.680293
false
3.41103
true
false
false
piyushroshan/tuxofwar2012
questiondb.py
1
1400
# Model Defining Questions Database import string from google.appengine.ext import db class questionm(db.Model): questionNumber = db.IntegerProperty(required=True) question = db.StringProperty(required=True, multiline=True) qimage = db.StringProperty() opt1 = db.StringProperty(required=True, multiline=True) opt2 =...
gpl-2.0
-2,501,730,747,631,768,600
32.333333
81
0.487857
false
2.755906
false
false
false
playpauseandstop/setman
setman/utils/importlib.py
1
1408
""" Backported from `importlib <http://pypi.python.org/pypi/importlib>` library, which itself backported from Python 3.x branch. """ # While not critical (and in no way guaranteed!), it would be nice to keep this # code compatible with Python 2.3. import sys def _resolve_name(name, package, level): """Return the a...
bsd-3-clause
-9,140,119,519,811,707,000
33.341463
79
0.617898
false
4.372671
false
false
false
authman/Python201609
Nguyen_Ken/Assignments/Flask/registration_form/server.py
1
1721
from flask import Flask, render_template, request, redirect, session, flash import re app = Flask(__name__) app.secret_key = 'secretsquirrel' EMAIL_REGEX = re.compile(r'^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$') @app.route('/') def index(): return render_template('index.html') @app.route('/process', meth...
mit
6,433,111,740,301,173,000
27.683333
80
0.632191
false
3.799117
false
false
false
altova/sec-edgar-tools
sec_filing_to_xlsx.py
1
11948
# Copyright 2015 Altova GmbH # # 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 writi...
apache-2.0
-8,564,099,729,764,443,000
42.286232
134
0.640214
false
3.601447
false
false
false
Kyly/mustaske
test/selenium_src/leave_room.py
1
3018
# -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoAlertPresentException...
mit
4,663,683,868,890,262,000
41.507042
98
0.661034
false
3.721332
true
false
false
jayvdb/flake8-copyright
setup.py
1
1860
# -=- encoding: utf-8 -=- # # Copyright (C) 2014 Savoir-faire Linux 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 3 of the License, or # (at your option) any later versio...
gpl-3.0
3,025,203,135,656,725,500
30.525424
85
0.667204
false
3.835052
false
false
false
mohitsethi/solum
solum/api/controllers/v1/extension.py
1
2846
# 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 # distributed under t...
apache-2.0
-1,911,150,574,673,588,200
34.575
76
0.682713
false
4.112717
false
false
false
zhaogaolong/oneFinger
openstack/api/opentack_ansible.py
1
1743
#!/usr/bin/env python # coding:utf8 # import pdb import ansible.runner from one_finger.cloud_logging import cloud_logging as logging log = logging.logger class CmmAndRun(): def __init__(self, module_name='shell', host=None, cmd=None, timeout=20): self.username = 'root' self.module_n...
apache-2.0
-7,011,476,624,317,718,000
24.846154
77
0.522088
false
4.062937
false
false
false
moiseshiraldo/inviMarket
inviMarket/views/register.py
1
2814
# -*- coding: utf-8 -*- from django.shortcuts import render, redirect from django.template.loader import render_to_string from django.core.mail import send_mail from django.conf import settings from django.utils.http import urlsafe_base64_encode from django.utils.encoding import force_bytes from django.utils import ti...
agpl-3.0
-5,880,959,783,419,259,000
36.533333
78
0.615849
false
4.1875
false
false
false
scealiontach/cryptotrading
src/autotrader/hashnest.py
1
4020
import urllib,urllib.parse,urllib.request,urllib.error import json import time,datetime import hashlib,hmac,base64 import logging LOG=logging.getLogger(__name__) #SELL='sale' #BUY='purchase' class hashnest(object): URL = 'https://www.hashnest.com/api/v1/' def __init__(self,username,key,secret): ...
apache-2.0
-3,889,870,154,564,766,000
29.687023
116
0.568159
false
3.880309
false
false
false
foxmask/django-th
django_th/html_entities.py
1
1275
# coding: utf-8 import html.entities as htmlentities import re class HtmlEntities: def __init__(self, my_string): self.my_string = my_string def html_entity_decode_char(self, m, defs=htmlentities.entitydefs): """ decode html entity into one of the html char """ tr...
bsd-3-clause
8,504,328,862,743,241,000
27.977273
74
0.545098
false
4.086538
false
false
false
cihai/cihai-python
tests/test_conversion.py
1
3543
# -*- coding: utf-8 -*- """Tests for cihai. test.conversion ~~~~~~~~~~~~~~~ """ from __future__ import absolute_import, print_function, unicode_literals from cihai import conversion from cihai._compat import string_types, text_type def test_text_type(): c1 = '(same as U+7A69 穩) firm; stable; secure' c2 = ...
bsd-3-clause
5,327,725,858,940,054,000
23.608392
85
0.687411
false
3.089552
true
false
false
sajeeshcs/nested_projects_keystone
keystone/credential/controllers.py
1
4503
# Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
-4,493,071,998,995,930,600
41.084112
78
0.642016
false
4.367604
false
false
false
guoxuesong/deepstacks
deepstacks/lasagne/utils.py
1
2721
#!/usr/bin/env python # coding:utf-8 # vi:tabstop=4:shiftwidth=4:expandtab:sts=4 import theano import lasagne from join import join_layer as JoinLayer from ..utils.curry import curry floatX = theano.config.floatX def ordered_errors(errors, m=None, prefix='', deterministic=False): res = [] for t in errors: ...
mit
6,609,764,372,025,347,000
30.275862
109
0.575891
false
3.524611
false
false
false
DevynCJohnson/Pybooster
pylib/convvolume.py
1
120739
#!/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
8,123,197,804,647,962,000
31.317719
150
0.65307
false
2.778228
false
false
false
slickqa/slickqaweb
slickqaweb/api/files.py
1
7168
__author__ = 'jcorbett' from slickqaweb.app import app from flask import request, Response from bson import ObjectId from slickqaweb.model.storedFile import StoredFile from slickqaweb.model.fileChunk import FileChunk from slickqaweb.model.serialize import deserialize_that from .standardResponses import JsonResponse, r...
apache-2.0
-2,193,309,757,777,340,400
43.8
183
0.667132
false
3.546759
false
false
false
r3kall/AnimeRecommenderSystem
animerecommendersystem/recommender_systems/CollaborativeFilteringRS.py
1
8293
""" This files offers a recommendation system based on collaborative filtering technique. 1) Let U be the user we want to give recommendations to, for each user U2 != U we need to compute distance(U, U2) (*) and get the top K neighbors. These neighbors should have watched a lot of animes also watched by U, giv...
gpl-3.0
-702,501,294,063,169,000
42.647368
123
0.606415
false
3.987019
false
false
false
icereval/scrapi
scrapi/harvesters/stepic.py
1
2795
""" Stepic.org harvester of MOOC-online courses for SHARE Notification Service Example API query: https://stepic.org:443/api/lessons/100 """ from __future__ import unicode_literals import json import pycountry from dateutil.parser import parse from scrapi import requests from scrapi.base import JSONHarvester from s...
apache-2.0
-3,222,189,658,091,499,500
31.126437
97
0.546333
false
3.77193
false
false
false
Onager/plaso
plaso/analysis/interface.py
1
2822
# -*- coding: utf-8 -*- """This file contains the interface for analysis plugins.""" import abc import calendar import collections import time from plaso.analysis import definitions as analysis_definitions from plaso.analysis import logger from plaso.containers import events from plaso.containers import reports from ...
apache-2.0
-2,152,688,887,689,937,000
29.673913
76
0.706591
false
4.13783
false
false
false
karras/gitlab-docsbot
setup.py
1
2639
# -*- coding: UTF-8 -*- """Setuptools package definition""" from setuptools import setup from setuptools import find_packages import codecs import os import sys version = sys.version_info[0] if version > 2: pass else: pass __version__ = None version_file = "autodocs/version.py" with codecs.open(version_fi...
gpl-3.0
5,100,969,825,408,567,000
28
76
0.560818
false
4.072531
false
false
false
KarrLab/kinetic_datanator
datanator/data_source/metabolites_meta_collection.py
1
14782
from datanator_query_python.query import query_sabiork, query_xmdb from datanator.util import chem_util from datanator.util import file_util from datanator.util import index_collection import datanator.config.core import pymongo import re from pymongo.collation import Collation, CollationStrength class MetabolitesMet...
mit
-7,996,290,644,230,414,000
48.273333
124
0.468069
false
4.283396
true
false
false
metomi/rose
metomi/rosie/graph.py
1
9686
# Copyright (C) British Crown (Met Office) & Contributors. # This file is part of Rose, a framework for meteorological suites. # # Rose 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 L...
gpl-3.0
-901,207,645,010,932,700
33.469751
79
0.596118
false
3.825434
false
false
false
herrnst/script.xbmc.lcdproc
resources/lib/lcdproc.py
1
21691
''' XBMC LCDproc addon Copyright (C) 2012-2018 Team Kodi Copyright (C) 2012-2018 Daniel 'herrnst' Scheller This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of ...
gpl-2.0
4,010,940,431,878,455,000
32.681677
360
0.647411
false
3.329905
false
false
false
deepmind/deep-verify
deep_verify/src/auto_verifier.py
1
9808
# coding=utf-8 # Copyright 2019 DeepMind Technologies Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
apache-2.0
5,044,877,332,549,764,000
38.869919
80
0.662622
false
4.105483
false
false
false
SafeW3rd/Ciphers
simpleSubHacker.py
1
7029
# Simple Substitution Cipher Hacker # http://inventwithpython.com/hacking (BSD Licensed) import os, re, copy, pprint, pyperclip, simpleSubCipher, makeWordPatterns if not os.path.exists('wordPatterns.py'): makeWordPatterns.main() # create the wordPatterns.py file import wordPatterns LETTERS = 'ABCDEFGHIJ...
mit
-4,164,585,501,999,395,000
43.070513
405
0.654289
false
3.998294
false
false
false
fle-internal/content-curation
contentcuration/contentcuration/management/commands/exportchannel.py
1
27865
import collections import itertools import json import logging as logmodule import os import re import sys import tempfile import uuid import zipfile from itertools import chain from django.conf import settings from django.core.files import File from django.core.files.storage import default_storage as storage from dja...
mit
-1,944,273,147,826,961,200
42.335925
156
0.656271
false
3.744289
false
false
false
ntt-sic/nova
nova/compute/api.py
1
161884
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Piston Cloud Computing, Inc. # Copyright 2012-2013 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache Lic...
apache-2.0
-2,824,583,000,643,304,000
42.505509
79
0.569476
false
4.530378
true
false
false
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/google/cloud/gapic/errorreporting/v1beta1/error_group_service_client.py
1
10469
# Copyright 2017, Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
mit
8,283,711,628,382,273,000
40.543651
169
0.647244
false
4.358451
true
false
false
kmoocdev2/edx-platform
openedx/features/course_experience/views/course_outline.py
1
5344
""" Views to show a course outline. """ import re import datetime from completion import waffle as completion_waffle from django.contrib.auth.models import User from django.template.context_processors import csrf from django.template.loader import render_to_string from opaque_keys.edx.keys import CourseKey from pytz i...
agpl-3.0
-8,452,376,268,452,737,000
38.007299
115
0.661302
false
4.104455
false
false
false