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
alok1974/nbCodeLines
modules/codeLines.py
1
7366
########################################################################################### ########################################################################################### ## ## ## Nb Code Lines v 1.0 (c) 2015 Alok Gandhi...
gpl-3.0
5,580,130,533,473,561,000
37.570681
113
0.435379
false
4.900865
false
false
false
jleclanche/fireplace
fireplace/cards/classic/neutral_common.py
1
5375
from ..utils import * ## # Free basic minions class CS2_122: """Raid Leader""" update = Refresh(FRIENDLY_MINIONS - SELF, buff="CS2_122e") CS2_122e = buff(atk=1) class CS2_222: """Stormwind Champion""" update = Refresh(FRIENDLY_MINIONS - SELF, buff="CS2_222o") CS2_222o = buff(+1, +1) class CS2_226: """Fr...
agpl-3.0
2,019,998,216,743,704,000
16.33871
83
0.673116
false
2.258403
false
false
false
matteoredaelli/scrapy_web
scrapy_web/spiders/nomi_maschili_femminili_nomix_it.py
1
1908
# -*- coding: utf-8 -*- # scrapy_web # Copyright (C) 2016-2017 Matteo.Redaelli@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # ...
gpl-3.0
1,822,298,830,182,337,500
37.16
95
0.604822
false
3.613636
false
false
false
stephanehenry27/Sickbeard-anime
sickbeard/providers/newznab.py
1
7885
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
gpl-3.0
2,714,241,382,934,127,000
26.378472
127
0.674445
false
3.202681
false
false
false
vericred/vericred-python
vericred_client/models/plan_deleted.py
1
11507
# coding: utf-8 """ Vericred API Vericred's API allows you to search for Health Plans that a specific doctor accepts. ## Getting Started Visit our [Developer Portal](https://developers.vericred.com) to create an account. Once you have created an account, you can create one Application for Production and an...
apache-2.0
2,301,925,499,552,926,000
37.744108
228
0.62223
false
3.612873
false
false
false
flaxatives/leetcode
minimum_window_substring.py
1
1883
#!/usr/bin/env python """ Given strings S and T, finds the minimum substring of S which contains all the characters in T. Done in O(n) time. """ def min_window(S, T): freq = {} for letter in T: freq[letter] = 0 # search S until we find a substring with all chars start = 0 ...
mit
4,124,336,163,982,471,700
27.104478
78
0.446097
false
4.111354
false
false
false
swisscom/cleanerversion
versions/descriptors.py
1
25432
from collections import namedtuple from django import VERSION from django.core.exceptions import SuspiciousOperation, FieldDoesNotExist from django.db import router, transaction from django.db.models.base import Model from django.db.models.fields.related import (ForwardManyToOneDescriptor, ...
apache-2.0
2,862,264,786,888,047,600
44.741007
79
0.557093
false
4.863645
false
false
false
jrbl/invenio
modules/bibauthorid/lib/bibauthorid_cluster_set.py
1
8369
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011 CERN. ## ## Invenio 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) a...
gpl-2.0
-7,200,099,607,998,172,000
33.870833
128
0.6168
false
3.608883
false
false
false
chundongwang/Guess2014
minimizeJs.py
1
3325
import os import time from httplib import HTTPConnection from urllib import urlencode files = [ "js/main.js", "js/service/guesser.js", "js/service/miner.js", "js/directive/navbar.js", "js/directive/notice.js", "js/directive/footer.js", "js/directive/matchdiv.js", "js/directive/betmodal...
apache-2.0
-6,989,141,133,847,485,000
31.920792
97
0.640602
false
3.078704
false
false
false
bulax41/Commands
scripts/cme_decode_pcap.py
1
1258
#!/usr/bin/env python import dpkt import argparse import struct import sys import datetime def main(): parser = argparse.ArgumentParser(description='Read PCAP file, decode CME data and output message sequence gaps') parser.add_argument('-f','--file',help="PCAP File to read") args = parser.parse_args() ...
gpl-3.0
7,447,482,395,164,316,000
29.682927
120
0.573132
false
3.475138
false
false
false
ging/horizon
openstack_dashboard/dashboards/idm/utils.py
1
4929
# Copyright (C) 2014 Universidad Politecnica de Madrid # # 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 la...
apache-2.0
8,689,818,560,495,523,000
32.530612
86
0.673159
false
3.694903
false
false
false
FLYKingdom/MyCode
PycharmProjects/PythonTest/FunctionalProgramming.py
1
3606
# 函数式编程 # 高阶函数 # map函数 def square(x): return x * x * x r = map(square, [1, 2, 3]) print(list(r)) # reduce 函数 from functools import reduce def fn(x, y): return x * 10 + y print(reduce(fn, [1, 2, 3])) is_str = isinstance(reduce(fn, [1, 2, 3]), int) print(is_str) DIGITS = {'0': 0, '1': 1, '2': 2, '3': ...
mit
1,903,475,979,759,218,700
14.594595
117
0.519931
false
2.536264
false
false
false
sunqm/pyscf
pyscf/tools/dump_mat.py
1
8525
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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 # # U...
apache-2.0
-8,020,765,779,473,733,000
41.20297
96
0.482111
false
2.876181
false
false
false
bayesimpact/bob-emploi
frontend/server/asynchronous/test/update_email_sent_status_test.py
1
9477
"""Tests for the update_email_sent_status module.""" import datetime import typing import unittest from unittest import mock import mailjet_rest import mongomock from bob_emploi.frontend.server.asynchronous import update_email_sent_status from bob_emploi.frontend.server.test import mailjetmock @mailjetmock.patch()...
gpl-3.0
1,764,484,004,379,997,400
38.65272
96
0.574549
false
3.717929
true
false
false
WhatWorksWhenForWhom/nlppln
nlppln/commands/save_ner_data.py
1
1125
#!/usr/bin/env python import click import os import codecs import json import pandas as pd from nlppln.utils import create_dirs, get_files @click.command() @click.argument('in_dir', type=click.Path(exists=True)) @click.option('--out_dir', '-o', default=os.getcwd(), type=click.Path()) @click.option('--name', '-n', de...
apache-2.0
-5,148,481,464,431,719,000
27.846154
77
0.580444
false
3
false
false
false
nictuku/nwu
nwu/common/scheduler.py
1
3753
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008 Stephan Peijnik (sp@gnu.org) # # This file is part of NWU. # # NWU 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
219,441,531,832,932,300
28.320313
76
0.563016
false
4.022508
false
false
false
Shu-Ji/multi-supervisord-web-admin
src/models.py
1
2943
# coding: u8 from tornado.util import ObjectDict from sqlalchemy import create_engine from sqlalchemy import (Column, Integer, Text, String, Boolean) from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy.orm.attributes import InstrumentedAttribute import sett...
unlicense
-1,953,575,648,705,451,000
23.525
78
0.622834
false
3.503571
false
false
false
huiyiqun/check_mk
cmk/log.py
1
7362
#!/usr/bin/env python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| ...
gpl-2.0
-2,892,559,792,175,105,500
31.72
91
0.609617
false
3.90557
false
false
false
mgracer48/panda3d
direct/src/gui/DirectWaitBar.py
1
4632
"""Undocumented Module""" __all__ = ['DirectWaitBar'] from panda3d.core import * import DirectGuiGlobals as DGG from DirectFrame import * import types """ import DirectWaitBar d = DirectWaitBar(borderWidth=(0, 0)) """ class DirectWaitBar(DirectFrame): """ DirectWaitBar - A DirectWidget that shows progress compl...
bsd-3-clause
8,693,055,676,541,782,000
36.354839
92
0.564551
false
4.15426
false
false
false
ptitdoc/Archive-qubes-core
dom0/qvm-core/qubesutils.py
1
79072
#!/usr/bin/python # # The Qubes OS Project, http://www.qubes-os.org # # Copyright (C) 2011 Marek Marczykowski <marmarek@invisiblethingslab.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;...
gpl-2.0
-220,990,330,861,483,870
38.955533
217
0.577195
false
3.644711
false
false
false
hehongliang/tensorflow
tensorflow/python/kernel_tests/unstack_op_test.py
1
6055
# Copyright 2015 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
-1,743,473,666,163,420,000
35.920732
80
0.608423
false
3.46
true
false
false
jenfly/atmos-read
scripts/merra-replace-data.py
1
5275
""" Replace corrupted data files with daily data re-downloaded with wget """ import sys sys.path.append('/home/jwalker/dynamics/python/atmos-tools') sys.path.append('/home/jwalker/dynamics/python/atmos-read') import os import shutil import xarray as xray import numpy as np import collections import time import matplo...
mit
-9,150,407,698,078,713,000
31.975
80
0.609289
false
2.836022
false
false
false
ivanyu/rosalind
algorithmic_heights/sc/sc.py
1
1421
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def main(argv): from sc_logic import check_semi_connectedness graphs = [] if len(argv) < 2: print('k = 2') k = 2 print('Graph 1:') print('n = 3') n = 3 print('m = 2') m = 2 g = [[0 for i in ran...
mit
-6,796,745,880,054,113,000
23.084746
73
0.398311
false
3.367299
false
false
false
openstack/tacker
tacker/objects/grant.py
1
11110
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
-1,107,050,491,365,563,900
35.546053
78
0.59883
false
3.827075
false
false
false
ezietsman/msc-thesis
images/makeunflat2.py
1
1059
from pylab import * import astronomy as ast # to format the labels better from matplotlib.ticker import FormatStrFormatter fmt = FormatStrFormatter('%1.2g') # or whatever X1 = load('ec2117ans_1_c.dat') x1 = X1[:,0] y1 = 10**(X1[:,2]/(-2.5)) y1 /= average(y1) T0 = 2453964.3307097 P = 0.1545255 figure(figsize=(6,4)...
mit
3,372,714,419,916,034,000
18.981132
64
0.70255
false
2.317287
false
true
false
WilJoey/tn_ckan
ckan/new_tests/lib/navl/test_validators.py
1
9126
# -*- coding: utf-8 -*- '''Unit tests for ckan/lib/navl/validators.py. ''' import copy import nose.tools import ckan.new_tests.factories as factories def returns_None(function): '''A decorator that asserts that the decorated function returns None. :param function: the function to decorate :type functi...
mit
8,180,306,314,881,718,000
33.308271
79
0.595003
false
4.321023
true
false
false
Parallel-in-Time/pySDC
pySDC/playgrounds/Allen_Cahn/AllenCahn_contracting_circle_standard_integrators.py
1
5930
import time import matplotlib.pyplot as plt import matplotlib.ticker as ticker import numpy as np from pySDC.implementations.datatype_classes.mesh import mesh, imex_mesh from pySDC.implementations.problem_classes.AllenCahn_2D_FD import allencahn_fullyimplicit, allencahn_semiimplicit # http://www.personal.psu.edu/qu...
bsd-2-clause
7,824,124,446,833,600,000
25.008772
113
0.594266
false
2.901174
false
false
false
mollie/mollie-api-python
mollie/api/objects/payment.py
1
6068
from .base import Base class Payment(Base): @classmethod def get_resource_class(cls, client): from ..resources.payments import Payments return Payments(client) STATUS_OPEN = "open" STATUS_PENDING = "pending" STATUS_CANCELED = "canceled" STATUS_EXPIRED = "expired" STATUS_F...
bsd-2-clause
-5,234,986,768,338,279,000
24.603376
108
0.6353
false
4.007926
false
false
false
andrecunha/idd3
idd3/rules/universal/atomic_emitting_rulesets.py
1
1614
# -*- coding: utf-8 -*- # IDD3 - Propositional Idea Density from Dependency Trees # Copyright (C) 2014-2015 Andre Luiz Verucci da Cunha # # 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 ...
gpl-3.0
-1,017,622,284,109,164,500
31.28
78
0.716853
false
3.898551
false
false
false
sfl-drupal/drupalizer
drush.py
1
6916
# coding: utf-8 # # Copyright (C) 2016 Savoir-faire Linux Inc. (<www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # Licens...
gpl-3.0
-5,361,245,927,559,476,000
37
123
0.596877
false
3.698396
false
false
false
floyd-fuh/afl-crash-analyzer
utilities/Logger.py
1
2025
#!/usr/bin/env python2.7 ''' AFL crash analyzer, crash triage for the American Fuzzy Lop fuzzer Copyright (C) 2015 floyd 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 ve...
gpl-3.0
-3,715,117,632,580,918,000
35.178571
90
0.628642
false
3.785047
false
false
false
Bitergia/allura
Allura/allura/ext/admin/admin_main.py
1
36370
import logging from collections import defaultdict from datetime import datetime import pkg_resources from pylons import c, g, request from paste.deploy.converters import asbool from tg import expose, redirect, flash, validate, config from tg.decorators import with_trailing_slash, without_trailing_slash from webob imp...
apache-2.0
-1,951,223,242,091,528,700
42.143535
137
0.581743
false
3.840144
false
false
false
bat-serjo/vivisect
vqt/application.py
1
6519
import os import logging from PyQt5 import QtCore from PyQt5.QtWidgets import * import vqt.cli as vq_cli import vqt.main as vq_main import vqt.saveable as vq_save import vqt.hotkeys as vq_hotkeys import vqt.menubuilder as vq_menu from vqt.saveable import compat_isNone logger = logging.getLogger(__name__) class VQDo...
apache-2.0
-1,507,048,536,738,605,300
31.272277
92
0.609296
false
3.650056
false
false
false
ioam/param
tests/API1/testparamdepends.py
1
2200
""" Unit test for param.depends. """ import param from . import API1TestCase class TestParamDepends(API1TestCase): def setUp(self): class P(param.Parameterized): a = param.Parameter() b = param.Parameter() @param.depends('a') def single_parameter(self): ...
bsd-3-clause
8,995,908,249,948,755,000
29.555556
68
0.572727
false
3.481013
true
false
false
google/eclipse2017
scripts/get_user_ids.py
1
1785
# # Copyright 2017 Google 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 writing...
apache-2.0
7,845,751,704,223,151,000
34.7
93
0.693557
false
3.993289
false
false
false
sebinthomas/pyvarnam
pyvarnam/varnam_defs.py
1
3346
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Varnam library functions list """ # Varnam library functions list from .utils import * import ctypes as C #REMINDER: Change this for every major release of varnam LIBVARNAM_MAJOR_VERSION = 3 VARNAM_PATHS = ['','..','/usr/local/lib', '/usr/local/lib/i386-linux-gnu'...
mit
1,290,528,990,029,869,300
37.906977
177
0.59205
false
3.036298
false
false
false
rgayon/plaso
plaso/output/shared_dsv.py
1
4484
# -*- coding: utf-8 -*- """Shared functionality for delimiter separated values output modules.""" from __future__ import unicode_literals from plaso.output import formatting_helper from plaso.output import interface class DSVEventFormattingHelper(formatting_helper.EventFormattingHelper): """Delimiter separated va...
apache-2.0
-6,534,213,863,833,684,000
31.492754
79
0.690455
false
4.171163
false
false
false
ysasaki6023/NeuralNetworkStudy
cifar04/net.py
1
3132
#!/usr/bin/env python import numpy as np import chainer import chainer.links as L import chainer.functions as F from chainer.utils import conv class ImageProcessNetwork(chainer.Chain): def __init__(self, I_colors, I_Xunit, I_Yunit, F_unit, N_PLayers = 4, P0C_...
mit
2,948,105,231,894,065,000
42.5
128
0.529055
false
2.960302
false
false
false
caltech-chimera/pychimera
scripts/multiphot.py
1
9783
#!/usr/bin/env python """ -------------------------------------------------------------------------- Routine to perform aperture photometry on CHIMERA science frames. Usage: python fastphot.py [options] image coords Authors: Navtej Saini, Lee Rosenthal Organization: Caltech, Pas...
mit
-4,409,292,525,545,918,500
32.618557
202
0.552898
false
3.705682
false
false
false
sunqm/pyscf
pyscf/scf/uhf_symm.py
1
22155
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U...
apache-2.0
201,078,578,244,645,060
38.491979
113
0.534642
false
2.890034
false
false
false
daichi-yoshikawa/dnn
examples/mnist/nn_mnist.py
1
3211
# Authors: Daichi Yoshikawa <daichi.yoshikawa@gmail.com> # License: BSD 3 clause import sys sys.path.append('../..') import json import numpy as np """Configure logger before importing dnnet.""" import logging.config with open('../common/logging.json') as f: data = json.load(f) logging.config.dictConfig(data...
bsd-3-clause
-1,805,999,635,159,180,500
35.078652
93
0.737776
false
3.093449
true
false
false
yingcuhk/LeetCode
Algorithms/#321 Create Maximum Number/PythonCode.py
1
4004
""" Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum number of length k <= m + n from digits of the two. The relative order of the digits from the same array must be preserved. Return an array of the k digits. You should try to optimize your time and space complexity. Ex...
mit
-3,520,379,620,287,191,600
28.021739
311
0.488511
false
3.135474
false
false
false
repotvsupertuga/tvsupertuga.repository
script.module.streamtvsupertuga/lib/resources/lib/sources/it/wmz.py
1
4252
import requests,re,time,xbmcaddon import resolveurl as urlresolver from ..common import clean_title, clean_search,send_log,error_log from ..scraper import Scraper dev_log = xbmcaddon.Addon('script.module.universalscrapers').getSetting("dev_log") User_Agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTM...
gpl-2.0
652,577,545,154,177,800
46.775281
144
0.46731
false
4.128155
false
false
false
jokuf/hack-blog
users/migrations/0002_auto_20170322_2028.py
1
2798
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-22 20:28 from __future__ import unicode_literals from django.db import migrations, models import users.managers class Migration(migrations.Migration): dependencies = [ ('auth', '0008_alter_user_username_max_length'), ('users', '0001...
mit
-6,814,778,244,652,638,000
37.861111
256
0.585061
false
4.448331
false
false
false
asteca/ASteCA
packages/best_fit/DEPRECATED/abcpmc_algor_DEPRECATED.py
1
9822
import numpy as np from scipy.optimize import differential_evolution as DE import time as t from .abcpmc import sampler, threshold from ..synth_clust import synth_cluster from . import likelihood from .emcee_algor import varPars, closeSol, discreteParams, convergenceVals def main( lkl_method, e_max, err_lst, com...
gpl-3.0
-8,437,757,124,377,861,000
35.786517
79
0.563225
false
3.073217
false
false
false
konker/switchd
util/pidfile.py
1
1188
import fcntl import os # FROM: http://code.activestate.com/recipes/577911-context-manager-for-a-daemon-pid-file/ class PidFile(object): """Context manager that locks a pid file. Implemented as class not generator because daemon.py is calling .__exit__() with no parameters instead of the None, None, None s...
mit
6,279,858,035,278,760,000
32
89
0.601852
false
3.869707
false
false
false
BK-TN/Islander
systems.py
1
4654
import components, actions import pygame import math from collections import defaultdict from point import Point class DrawingSystem: def __init__(self, screen, camera_target): self.screen = screen self.camera_pos = Point(0,0,0) self.camera_target = camera_target self.tileset = pyga...
mit
6,984,329,801,355,357,000
38.777778
111
0.561023
false
3.708367
false
false
false
sadimanna/computer_vision
clustering/kmeansppclustering_with_gap_statistic.py
1
2599
#K-Means++ Clustering with Gap Statistic to determine the optimal number of clusters import sys import numpy as np import scipy.io as sio #import matplotlib.pyplot as plt from sklearn.cluster import KMeans from sklearn.svm import SVC filename = sys.argv[1] datafile = sio.loadmat(filename) data = datafile['bow'] sizeda...
gpl-3.0
3,089,997,945,052,346,400
28.202247
106
0.696037
false
2.591226
false
false
false
dannykopping/mysql-utilities
mysql/utilities/common/tools.py
1
12360
# # Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in th...
gpl-2.0
-1,920,105,852,500,991,700
34.014164
80
0.589401
false
4.029997
false
false
false
pearu/sympycore
sympycore/heads/base_exp_dict.py
1
11228
__all__ = ['BASE_EXP_DICT'] from .base import heads, heads_precedence, ArithmeticHead from ..core import init_module, Expr init_module.import_heads() init_module.import_numbers() init_module.import_lowlevel_operations() class BaseExpDictHead(ArithmeticHead): """ BASE_EXP_DICT expression data is a dictionary of ...
bsd-3-clause
5,856,890,903,405,124,000
35.813115
109
0.512647
false
3.48263
false
false
false
hugovk/terroroftinytown
terroroftinytown/tracker/base.py
1
1068
# encoding=utf-8 import tornado.web from terroroftinytown.tracker.model import User ACCOUNT_COOKIE_NAME = 'tottu' ACCOUNT_TOKEN_COOKIE_NAME = 'tottt' class BaseHandler(tornado.web.RequestHandler): def get_current_user(self): username_raw = self.get_secure_cookie(ACCOUNT_COOKIE_NAME) token = sel...
mit
-4,946,636,474,839,554,000
28.666667
72
0.640449
false
3.800712
false
false
false
yuwen41200/biodiversity-analysis
src/controller/main_action.py
1
10383
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from dateutil.parser import parse from pprint import pformat from traceback import format_exc from model.dataset import Dataset from model.species import Species from model.leaflet_map import LeafletMap from model.scatter_plot import ScatterPlot from view.spatial_analysi...
gpl-3.0
-5,330,190,177,571,852,000
36.756364
97
0.571896
false
4.442875
false
false
false
brain-research/mirage-rl-bpttv
baselines/acktr/run_atari.py
1
1510
#!/usr/bin/env python import os, logging, gym from baselines import logger from baselines.common import set_global_seeds from baselines import bench from baselines.acktr.acktr_disc import learn from baselines.common.vec_env.subproc_vec_env import SubprocVecEnv from baselines.common.atari_wrappers import make_atari, wra...
mit
1,472,891,303,127,896,000
38.736842
100
0.691391
false
3.275488
false
false
false
dwavesystems/dimod
dimod/core/sampler.py
1
9510
# Copyright 2018 D-Wave Systems 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...
apache-2.0
-2,800,460,866,468,964,000
34.485075
103
0.625973
false
4.307065
false
false
false
daanwierstra/pybrain
pybrain/rl/tasks/pomdp/pomdp.py
1
1502
__author__ = 'Tom Schaul, tom@idsia.ch' from scipy import ndarray from pybrain.rl.tasks import EpisodicTask from pybrain.utilities import Named, drawIndex class POMDPTask(EpisodicTask, Named): """ Partially observable episodic MDP (with discrete actions) Has actions that can be performed, and observations i...
bsd-3-clause
-4,077,918,592,508,438,500
27.358491
97
0.629161
false
4.137741
false
false
false
starcroce/PyAlgoDataStructure
linked_list/linked_list_to_queue.py
1
1314
import MyDoubleLinkedList class DoubleLinkedListStack: def __init__(self): self.front = None self.rear = None self.content = None def push(self, val): # push to empty queue if self.content is None: self.content = MyDoubleLinkedList.LinkedList(val) ...
gpl-2.0
7,239,916,938,824,079,000
22.464286
62
0.541857
false
3.808696
false
false
false
aditigupta96/DealBazaar
welcome.py
1
26070
import os import couchdb import uuid import requests from datetime import datetime from flask import Flask, jsonify, session, render_template, request, redirect, g, url_for, flash # from .models import User from datetime import datetime from couchdb.mapping import Document, TextField, DateTimeField, ListField, FloatF...
apache-2.0
-2,056,090,969,468,917,500
30.909425
125
0.535405
false
3.8457
false
false
false
jtpereyda/boofuzz
boofuzz/pgraph/graph.py
1
18926
# # pGRAPH # Copyright (C) 2006 Pedram Amini <pedram.amini@gmail.com> # # This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later # version. # ...
gpl-2.0
-7,393,530,051,731,024,000
29.427653
119
0.57524
false
4.155907
false
false
false
mortbauer/openfoam-extend-Breeder-other-scripting-PyFoam
PyFoam/Basics/DataStructures.py
1
16332
"""Data structures in Foam-Files that can't be directly represented by Python-Structures""" from __future__ import division from copy import deepcopy from collections import OrderedDict import math import re # import FoamFileGenerator in the end to avoid circular dependencies from PyFoam.ThirdParty.six import integ...
gpl-2.0
-4,579,020,472,537,835,500
25.995041
102
0.515246
false
3.879335
false
false
false
jtraver/dev
python3/selenium/apihelper.py
1
1826
#!/usr/bin/env python3 #!/usr/bin/python """Cheap and simple API helper This program is part of "Dive Into Python", a free Python book for experienced programmers. Visit http://diveintopython.org/ for the latest version. """ __author__ = "Mark Pilgrim (mark@diveintopython.org)" __version__ = "$Revision: 1.3 $" __da...
mit
5,549,527,252,694,956,000
34.803922
79
0.664294
false
3.445283
false
false
false
googleapis/googleapis-gen
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/resources/types/domain_category.py
1
3952
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
2,978,796,001,538,029,000
30.870968
104
0.620445
false
4.435466
false
false
false
spawnedc/MeCanBlog
dbindexer/lookups.py
1
8808
from django.db import models from djangotoolbox.fields import ListField from copy import deepcopy import re regex = type(re.compile('')) class LookupDoesNotExist(Exception): pass class LookupBase(type): def __new__(cls, name, bases, attrs): new_cls = type.__new__(cls, name, bases, attrs) if ...
bsd-3-clause
6,995,313,191,681,633,000
32.618321
83
0.592643
false
3.878468
false
false
false
googleads/google-ads-python
google/ads/googleads/v8/services/types/geo_target_constant_service.py
1
5566
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-4,300,285,635,369,971,000
35.854305
142
0.679245
false
4.231939
false
false
false
novirael/os-simulation
memory/simulation.py
1
1520
from copy import copy from random import randint from memory import ( FirstInFirstOutAlgorithm, TheOptimalAlgorithm, LastRecentlyUsedAlgorithm, ApproximalLastRecentlyUsedAlgorithm, RandomAlgorithm ) PAGE_SIZE = 100 FRAMES = 10 NUM_REQUESTS = 1000 def test(page_size, frames_size, num_requests, d...
mit
-3,993,133,811,072,129,000
24.333333
72
0.617105
false
3.828715
false
false
false
mattsep/TDSE
src/animate.py
1
1444
import scipy as sp import matplotlib.pyplot as plt import matplotlib.animation as animation # animation of the probability density of the wavefunction over the course # of time def probabilityDensity(x, t, V, psi): # convert to the probability density Nt = len(t) rho = sp.real(sp.conjugate(psi)*psi) ...
gpl-3.0
1,779,452,634,299,674,600
31.088889
74
0.607341
false
3.266968
false
false
false
liumengjun/django-static-precompiler
static_precompiler/templatetags/base.py
1
1478
import inspect try: # Django>=1.9 from django.template import library except ImportError: # Django<1.9 from django.template import base as library def container_tag(register, name=None): def dec(func): params, varargs, varkw, defaults = inspect.getargspec(func) params = params[1:...
mit
4,570,853,144,020,041,700
32.590909
85
0.567659
false
4.492401
false
false
false
JustinSGray/Kona
src/kona/linalg/matrices/preconds/nested.py
1
1272
from kona.linalg.matrices.common import IdentityMatrix from kona.linalg.matrices.hessian import ReducedKKTMatrix class NestedKKTPreconditioner(ReducedKKTMatrix): """ This object preconditions the KKT system by doing approximate solutions of the 2nd order adjoints using the PDE preconditioner. The appr...
lgpl-3.0
340,065,703,489,517,200
36.411765
77
0.683962
false
3.553073
false
false
false
DeepSOIC/Lattice
latticeBaseFeature.py
1
11471
#*************************************************************************** #* * #* Copyright (c) 2015 - Victor Titov (DeepSOIC) * #* <vv.titov@gmail.com> * #* ...
lgpl-2.1
-9,035,229,541,461,682,000
42.954023
191
0.575277
false
4.4513
false
false
false
intel-ctrlsys/actsys
actsys/control/diagnostics/mock_diagnostics/mock_diagnostics.py
1
6050
# #Copyright (c) 2017 Intel Corp. # """ Interface for all diagnostic tests plugins. """ from control.console_log.mock_console_log.ipmi_mock import MockConsoleLog from control.diagnostics.diagnostics import Diagnostics from control.plugin import DeclarePlugin @DeclarePlugin('mock', 100) class MockDiagnostics(Diagnos...
apache-2.0
1,918,063,083,031,206,000
42.52518
120
0.600496
false
4.115646
true
false
false
PyCon/pycon
symposion/proposals/migrations/0012_auto_20180921_1053.py
1
1034
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('proposals', '0011_proposal_created_updated'), ] operations = [ migrations.AlterField( model_name='proposalbase',...
bsd-3-clause
-448,724,437,121,979,970
53.421053
658
0.713733
false
4.15261
false
false
false
5StevenWu/Coursepy
L05/表达式的yield的用途.py
1
1842
#!/usr/bin/env python # -*- coding:utf-8 -*- #此为最终结果 已经可以查找到有关键字的文件 ''' grep -rl 'python' /root ''' import os def init(func): def wrapper(*args,**kwargs): res = func(*args,**kwargs) next(res) return res return wrapper @init #生成器调用装饰器 def search(target): '''取出所有文件路径''' #更改为生成器...
apache-2.0
4,955,264,629,553,978,000
21.689189
64
0.567938
false
2.482249
false
false
false
asi1024/Othbot
main.py
1
3481
#!/usr/local/bin/python import Image import autopy import os import time startX, spanX, startY, spanY = 30, 150, 130, 40 pX, pY = 180, 225 size, span = 30, 56 boxs = size ** 2 starts = spanX * spanY # draw def draw_start(im): for i in range(spanY): for j in range(spanX): im.putpixel ((startX...
mit
5,038,916,443,684,973,000
24.043165
65
0.460213
false
3.058875
false
false
false
kdyq007/cmdb-api
lib/ci.py
1
27854
# -*- coding:utf-8 -*- import uuid import time import datetime import json from flask import current_app from flask import abort from sqlalchemy import or_ from extensions import db from extensions import rd from models.ci import CI from models.ci_relation import CIRelation from models.ci_type import CITypeAttribu...
gpl-2.0
297,984,128,190,413,200
38.565341
79
0.539348
false
3.522256
false
false
false
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated
python-packages/mne-python-0.10/mne/fixes.py
1
29568
"""Compatibility fixes for older version of python, numpy and scipy If you add content to this file, please give the version of the package at which the fixe is no longer needed. # XXX : copied from scikit-learn """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael...
bsd-3-clause
-7,662,654,578,994,901,000
32.297297
79
0.616883
false
3.627085
false
false
false
sysopfb/Malware_Scripts
wannacry/decode_dll.py
1
1118
#For decoded t.wnry file from sample: ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa from Crypto.Cipher import PKCS1_v1_5 from Crypto.PublicKey import RSA from Crypto.Cipher import AES from Crypto import Random from Crypto.Hash import SHA import sys import struct import binascii import hashlib def d...
mit
-1,457,900,662,308,675,000
25.619048
102
0.69678
false
2.674641
false
false
false
BenjaminEHowe/library-api
library_api/implementations/enterprise.py
1
15276
import re import requests from ..library import NotAuthenticatedError class library: def __init__(self, url): """ Initialises the library. """ self.session = requests.Session() self.authenticated = False; return def login(self, userid, password): """ Authe...
mit
-5,243,826,327,986,438,000
53.752688
224
0.515449
false
3.889002
false
false
false
kyoshino/bedrock
bedrock/releasenotes/tests/test_models.py
1
6304
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from itertools import chain from django.core.cache import caches from django.test.utils import override_settings from ...
mpl-2.0
-4,550,439,496,601,802,000
39.670968
108
0.663071
false
3.770335
true
false
false
adam900710/btrfs-progs
libbtrfsutil/python/setup.py
1
2883
#!/usr/bin/env python3 # Copyright (C) 2018 Facebook # # This file is part of libbtrfsutil. # # libbtrfsutil 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 License, or # (at yo...
gpl-2.0
-551,273,148,070,264,200
26.198113
90
0.6188
false
3.60375
false
false
false
dragondjf/PFramer
objbrowser/app.py
1
7811
""" Module for IPython event loop integration. Two things are handled by this module . 1) Creating the QApplication instance (or getting the singleton if it already exists). Also no difference between IPython and the regular Python. 2) Starting the event loop. If IPython is not running, qApp.exec_() is ca...
gpl-3.0
3,190,367,816,464,771,600
40.547872
100
0.669953
false
4.104572
false
false
false
singularityhub/sregistry
shub/apps/logs/mixins.py
1
4621
""" Adopted from drf-tracking https://github.com/aschn/drf-tracking """ from django.utils.timezone import now from shub.apps.logs.models import APIRequestLog from shub.apps.logs.utils import clean_data from rest_framework.authtoken.models import Token import traceback class BaseLoggingMixin(object): logging_me...
mpl-2.0
-5,573,458,890,350,275,000
30.222973
98
0.58667
false
4.347131
false
false
false
sbillaudelle/labbook
labbook/cli.py
1
2486
#!/usr/bin/python2 # -*- coding: utf-8 -*- __all__ = ['Interface', 'main'] import os import datetime from .exceptions import * from .labbook import LabBook class Interface(object): def __init__(self): pass def create(self, args): path = os.path.abspath(args.path) try: la...
gpl-2.0
271,354,617,792,468,030
28.247059
120
0.54827
false
4.042276
false
false
false
frhumanes/consulting
web/deploy/wtdeploy/wtdeploy/modules/fab_mysql.py
1
2073
#!/usr/bin/python # -*- encoding: utf-8 -*- # # author: javi santana from fabric.api import * def install_mysql(): """ ripped from http://www.muhuk.com/2010/05/how-to-install-mysql-with-fabric/ """ with settings(hide('warnings', 'stderr'), warn_only=True): result = sudo('dpkg-query --show mysql-se...
apache-2.0
-271,757,417,475,889,120
34.741379
105
0.641582
false
3.249216
false
false
false
jimmy201602/webterminal
permission/forms.py
1
4283
from django import forms from django.contrib.auth.models import User from django.contrib.auth.models import Permission as AuthPermission from permission.models import Permission from django.contrib.contenttypes.models import ContentType from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, ...
gpl-3.0
4,408,388,683,405,748,700
37.585586
108
0.573663
false
4.452183
false
false
false
haeihaiehaei/Python-Projects
vmware/op5_vcsa_plugin/check_vcsa.py
1
4239
#!/usr/bin/python """ Op5 check to get the health of the VCenter Appliance via REST API. Copyright 2017 Martin Persson 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, includi...
gpl-3.0
-1,029,411,036,243,976,400
38.25
460
0.689314
false
3.836199
false
false
false
QinerTech/QinerApps
openerp/addons/website_blog/models/website_blog.py
2
12097
# -*- coding: utf-8 -*- from datetime import datetime import lxml import random from openerp import tools from openerp import SUPERUSER_ID from openerp.addons.website.models.website import slug from openerp.osv import osv, fields from openerp.tools.translate import _ from openerp.tools.translate import html_translate...
gpl-3.0
4,718,703,543,692,162,000
39.868243
137
0.55427
false
3.824534
false
false
false
nhuntwalker/rational_whimsy
rational_whimsy/blog/models.py
1
2123
"""The Blog Post model.""" from django.db import models from django.dispatch import receiver from django.db.models.signals import post_save from redactor.fields import RedactorField from taggit.managers import TaggableManager # Create your models here. PUBLICATION_STATUS = ( ("published", "Published"), ("draf...
mit
-6,685,609,270,705,033,000
30.220588
97
0.666039
false
4.06705
false
false
false
nihilus/epanos
pyc_fmtstr_parser/printf_parse.py
1
12979
# ported from gnulib rev be7d73709d2b3bceb987f1be00a049bb7021bf87 # # Copyright (C) 2014, Mark Laws. # Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2014 Free Software # Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public Lice...
mit
-4,507,147,994,739,678,700
28.974596
80
0.47677
false
3.930648
false
false
false
ktarrant/options_csv
journal/trades/migrations/0001_initial.py
1
1392
# Generated by Django 2.1 on 2018-08-28 05:10 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Leg', fields=[ ('id', models.AutoField(auto_c...
mit
1,929,704,377,205,315,600
43.903226
163
0.558908
false
4.256881
false
false
false
rschnapka/partner-contact
base_partner_merge/validate_email.py
1
4573
# -*- coding: utf-8 -*- # RFC 2822 - style email validation for Python # (c) 2012 Syrus Akbary <me@syrusakbary.com> # Extended from (c) 2011 Noel Bush <noel@aitools.org> # for support of mx and user check # This code is made available to you under the GNU LGPL v3. # # This module provides a single method, valid_email_a...
agpl-3.0
1,122,090,450,398,727,800
40.572727
77
0.605292
false
3.345282
false
false
false
eblume/tf-idf
tfidf/preprocess.py
1
9539
#!/usr/bin/env python3 """Pre processing step for text. Example: pp = Preprocesses() """ from __future__ import absolute_import, with_statement import re from collections import namedtuple from cachetools import LRUCache, cached # python2 support from nltk.stem import SnowballStemmer from six.moves.html_parser...
mit
2,284,034,132,267,696,400
35.94186
89
0.58934
false
3.893382
false
false
false
industrydive/fileflow
fileflow/operators/dive_python_operator.py
1
1096
""" .. module:: operators.dive_operator :synopsis: DivePythonOperator for use with TaskRunner .. moduleauthor:: Laura Lorenz <llorenz@industrydive.com> .. moduleauthor:: Miriam Sexton <miriam@industrydive.com> """ from airflow.operators import PythonOperator from .dive_operator import DiveOperator class DivePy...
apache-2.0
-2,527,563,072,624,418,000
34.354839
84
0.711679
false
3.985455
false
false
false
awni/tensorflow
tensorflow/contrib/skflow/python/skflow/tests/test_multioutput.py
1
1502
# Copyright 2015-present The Scikit Flow 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 require...
apache-2.0
-3,187,376,389,461,075,500
33.930233
78
0.709055
false
3.645631
false
false
false
magcius/sweettooth
sweettooth/extensions/migrations/0008_new_icon_default.py
1
6118
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." new_default = orm.Extension._meta.get_field_by_name('icon')[0].default for ...
agpl-3.0
-7,303,733,742,660,065,000
67.741573
182
0.556064
false
3.809465
false
false
false
mattboyer/sqbrite
src/record.py
1
5656
# MIT License # # Copyright (c) 2017 Matt Boyer # # 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, merge, p...
mit
4,934,288,116,914,393,000
33.487805
79
0.554455
false
4.220896
false
false
false
flgiordano/netcash
+/google-cloud-sdk/lib/googlecloudsdk/third_party/appengine/tools/appengine_rpc_test_util.py
1
6895
# Copyright 2016 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 ag...
bsd-3-clause
-7,914,726,820,681,663,000
30.921296
86
0.663234
false
4.166163
true
false
false
soulweaver91/batchpatch
batchpatch.py
1
27396
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Soulweaver' import argparse import os import re import time import shutil import colorama import subprocess import unicodedata import gettext import zipfile import zlib from datetime import datetime from dateutil import tz from logger import LogLevel, Logger ...
mit
-1,857,567,898,504,627,200
42.974318
120
0.501643
false
4.09997
false
false
false
dionisos2/CI
src/centres_of_interest_manager.py
1
14888
""" See CentresOfInterestManager class """ import re import mylib.checking as checking from mylib.string_op import replace_special_char from mylib.notifier import Notifier from xml.dom import minidom from lxml import etree from centre_of_interest import CentreOfInterest def identity(x): return x class CentresOfI...
gpl-2.0
-8,393,297,476,626,185,000
37.921466
107
0.52159
false
4.135744
false
false
false
sanja7s/SR_Twitter
src_general/explain_FORMATION_DELETION_REL.py
1
6415
#!/usr/bin/env python # a bar plot with errorbars import matplotlib import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Ellipse, Polygon from pylab import * width = 0.28 # the width of the bars font = {'family' : 'sans-serif', 'variant' : 'normal', 'weight' : 'light', ...
mit
-5,203,250,858,654,813,000
33.304813
120
0.677631
false
2.70219
false
false
false
LittleRichard/luxalert
luxweb/luxweb/spiders/KensingtonSpider.py
1
4229
import datetime import re import scrapy from nest.storage.luxalert.entity.Apartment import Apartment from nest.storage.luxalert.entity.ApartmentSnapshot import ApartmentSnapshot from luxweb.luxweb import HMTL_SPIDER_DATA_TUPLE_KEY from luxweb.luxweb.ScrapeErrorHandler import ScrapeErrorHandler from luxweb.luxweb.spid...
gpl-3.0
332,383,384,053,203,200
36.424779
114
0.572476
false
3.719437
false
false
false
clovertrail/cloudinit-bis
cloudinit/config/cc_scripts_per_boot.py
1
1760
# vi: ts=4 expandtab # # Copyright (C) 2011 Canonical Ltd. # Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # # Author: Scott Moser <scott.moser@canonical.com> # Author: Juerg Haefliger <juerg.haefliger@hp.com> # # This program is free software: you can redistribute it and/or modify # it...
gpl-3.0
9,048,880,670,074,391,000
29.877193
79
0.696591
false
3.527054
false
false
false