repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
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
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
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
hh-italian-group/HHbbTauTau
TreeProduction/python/TriggerObjectBlock_cfi.py
1
1874
## @package TriggerObjectBlock_cfi # Configuration file that defines the producer of ROOT-tuple for trigger objects. # # \author Subir Sarkar # \author Rosamaria Venditti (INFN Bari, Bari University) # \author Konstantin Androsov (University of Siena, INFN Pisa) # \author Maria Teresa Grippo (University of Siena, ...
gpl-2.0
-7,589,809,344,042,750,000
43.619048
84
0.654216
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
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
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
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
SlashRoot/WHAT
settings/logging_settings.py
1
2154
import sys if not 'test' in sys.argv or 'test_coverage' in sys.argv: LOGGING = { 'version': 1, 'disable_existing_loggers': True, 'formatters': { 'verbose': { 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' }, 'standard': { ...
mit
-5,500,976,408,281,466,000
26.628205
95
0.423863
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
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
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
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
lhupfeldt/multiconf
test/mixed_test.py
1
2458
# Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT # All rights reserved. This work is under a BSD license, see LICENSE.TXT. from multiconf import mc_config, ConfigItem, RepeatableConfigItem, ConfigBuilder, MC_REQUIRED from multiconf.decorators import nested_repeatables, named_as, required from multiconf.envs imp...
bsd-3-clause
8,689,661,886,113,094,000
27.917647
93
0.594793
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
roatienza/Deep-Learning-Experiments
keras/regularization/mlp-mnist-l2.py
1
2077
''' MLP network for MNIST digits classification with L2 reg Test accuracy: 95.2% ''' from __future__ import absolute_import from __future__ import division from __future__ import print_function # numpy package import numpy as np from keras.models import Sequential from keras.layers import Dense, Activation from keras...
mit
8,363,157,154,739,262,000
29.544118
64
0.718825
false
drtuxwang/system-config
bin/plink.py
1
4176
#!/usr/bin/env python3 """ Create links to picture/video files. """ import argparse import glob import os import signal import sys from typing import List import config_mod import file_mod class Options: """ Options class """ def __init__(self) -> None: self._args: argparse.Namespace = None...
gpl-2.0
-4,907,487,420,833,180,000
26.655629
75
0.462644
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
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
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
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
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
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
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
anthonyalmarza/trex
tests/test_watch.py
1
4071
# from trex import redis # # from .mixins import REDIS_HOST, REDIS_PORT # # # class TestRedisConnections(unittest.TestCase): # _KEYS = ['trex:testwatch1', 'trex:testwatch2'] # # @defer.inlineCallbacks # def setUp(self): # self.connections = [] # self.db = yield self._getRedisConnection() # ...
mit
3,752,007,576,016,985,600
35.675676
77
0.590764
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
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
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
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
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
rmanoni/mi-instrument
mi/core/instrument/test/test_port_agent_client.py
1
29762
#!/usr/bin/env python """ @package ion.services.mi.test.test_port_agent_client @file ion/services/mi/test/test_port_agent_client.py @author David Everett @brief Some unit tests for R2 port agent client """ __author__ = 'David Everett' __license__ = 'Apache 2.0' # Ensure the test class is monkey patched for gevent fr...
bsd-2-clause
-7,409,158,328,854,062,000
33.931925
116
0.633627
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
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
device42/warranty_check
starter.py
1
6083
#!/usr/bin/env python import sys from Files.shared import Config, Device42rest from Files.warranty_cisco import Cisco from Files.warranty_dell import Dell from Files.warranty_hp import Hp from Files.warranty_ibm_lenovo import IbmLenovo from Files.warranty_meraki import Meraki def get_hardware_by_vendor(name): # ...
mit
7,046,890,341,926,458,000
32.240437
138
0.536577
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
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
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
langner/cclib
test/regression.py
1
144398
# This file is part of cclib (http://cclib.github.io), a library for parsing # and interpreting the results of computational chemistry packages. # # Copyright (C) 2020, the cclib development team # # The library is free software, distributed under the terms of # the GNU Lesser General Public version 2.1 or later....
bsd-3-clause
8,734,415,167,729,531,000
38.859649
128
0.660556
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
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
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
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
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
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
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
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
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
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
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
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
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
lycantropos/VKScheduler
vk_scheduler/app.py
1
10827
import logging import math import os import time from typing import List import requests import vk.exceptions from vk_app import App from vk_app.app import captchured from vk_app.models import VKPhoto, VKPhotoAlbum, VKVideo, VKPost from vk_app.utils import make_delayed from vk_scheduler.settings import (CONFIGURATION...
gpl-3.0
6,878,774,586,737,158,000
44.491597
103
0.54946
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
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
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
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
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
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
JarbasAI/jarbas-core
mycroft/jarbas-skills/skill_apod/__init__.py
1
4205
from adapt.intent import IntentBuilder from mycroft.skills.core import MycroftSkill from mycroft.util.log import getLogger from mycroft.messagebus.message import Message try: # try to load display service import sys from os.path import dirname sys.path.append(dirname(dirname(__file__))) from serv...
gpl-3.0
-1,056,637,569,881,109,000
32.110236
122
0.591677
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
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
gcarq/freqtrade
freqtrade/configuration/check_exchange.py
1
3242
import logging from typing import Any, Dict from freqtrade.exceptions import OperationalException from freqtrade.exchange import (available_exchanges, get_exchange_bad_reason, is_exchange_bad, is_exchange_known_ccxt, is_exchange_officially_supported) from freqtrade.state import RunMode ...
gpl-3.0
-733,093,713,289,418,400
42.810811
99
0.624923
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
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
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
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
dontnod/weblate
weblate/trans/tests/test_edit.py
1
24404
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2019 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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, eith...
gpl-3.0
5,844,940,577,075,464,000
30.57772
77
0.590491
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
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
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
jucimarjr/IPC_2017-1
lista1.5/lista1.5_questao15.py
1
1739
# ---------------------------------------------------------- # Introdução a Programação de Computadores - IPC # Universidade do Estado do Amazonas - UEA # Prof. Jucimar Jr # # Carlos Eduardo Tapudima de Oliveira 1715310030 # Frederico Victor Alfaia Rodrigues 1515200030 # Joelson Pereira Lima ...
apache-2.0
6,655,789,381,350,949,000
60.214286
114
0.670945
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
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
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
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
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
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
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
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
ticklemepierce/osf.io
api_tests/nodes/views/test_node_children_list.py
1
22121
# -*- coding: utf-8 -*- from nose.tools import * # flake8: noqa from framework.auth.core import Auth from website.models import Node, NodeLog from website.util import permissions from website.util.sanitize import strip_html from api.base.settings.defaults import API_BASE from tests.base import ApiTestCase, fake fr...
apache-2.0
2,755,910,195,690,702,300
43.155689
135
0.59717
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
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
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
jgoppert/pymola
test/xml_test.py
1
4050
#!/usr/bin/env python """ Test XML backend """ import os import sys import time import unittest import pymoca.parser as mo_parser from pymoca.backends.xml import analysis, generator, sim_scipy from pymoca.backends.xml import parser as xml_parser # get matplotlib from analysis, since logic for plotting # without displa...
bsd-3-clause
-4,475,261,726,014,995,000
27.321678
91
0.550617
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
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
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
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
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
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
polyaxon/polyaxon
core/polyaxon/tracking/contrib/ignite.py
1
1104
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
apache-2.0
-7,285,680,150,348,896,000
31.470588
79
0.75
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
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
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
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
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
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
widowild/messcripts
exercice/python3/solutions_exercices/exercice_6_11.py
1
1686
#! /usr/bin/env python # -*- coding:Utf8 -*- # Calculs de triangles from sys import exit # module contenant des fonctions système print(""" Veuillez entrer les longueurs des 3 côtés (en séparant ces valeurs à l'aide de virgules) :""") a, b, c = eval(input()) # Il n'est possible de construire un triangle que si ...
gpl-3.0
-136,907,640,076,369,580
30.415094
76
0.607207
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
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