repo_name
stringlengths
5
100
path
stringlengths
4
299
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1.03M
license
stringclasses
15 values
hash
int64
-9,223,351,895,964,839,000
9,223,297,778B
line_mean
float64
3.17
100
line_max
int64
7
1k
alpha_frac
float64
0.25
0.98
autogenerated
bool
1 class
bregman-arie/ansible
lib/ansible/modules/network/f5/bigip_qkview.py
23
14031
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
-7,063,736,221,049,225,000
28.789809
91
0.588768
false
MatthewScholefield/mycroft-simple
mycroft/interfaces/interface_plugin.py
1
1957
# Copyright (c) 2017 Mycroft AI, Inc. # # This file is part of Mycroft Light # (see https://github.com/MatthewScholefield/mycroft-light). # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information ...
apache-2.0
2,854,543,257,324,915,700
32.741379
75
0.699029
false
asnorkin/sentiment_analysis
site/lib/python2.7/site-packages/scipy/sparse/linalg/eigen/lobpcg/tests/test_lobpcg.py
9
5680
""" Test functions for the sparse.linalg.eigen.lobpcg module """ from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import (run_module_suite, assert_almost_equal, assert_equal, assert_allclose, assert_array_less, assert_) from scipy import ones, rand, r_, di...
mit
-6,537,579,703,556,170,000
28.128205
79
0.625
false
sbesson/zeroc-ice
cpp/test/IceGrid/fileLock/run.py
1
2045
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
gpl-2.0
-9,127,244,385,716,035,000
32.52459
107
0.614181
false
jayzhai/wbench
parser/processtgz.py
1
1820
#!/bin/python -u __author__ = "jzhai" import tarfile def average(arr): length = len(arr) fltarr = [float(_s) for _s in arr] return "{:.2f}".format(sum(fltarr)/length) def stddev(arr): length = len(arr) fltarr = [float(_s) for _s in arr] m = sum(fltarr)/length d = .0 for i in fltarr:d...
apache-2.0
1,175,378,486,763,984,000
25
95
0.624176
false
siddhi/test_driven_python
stock_alerter/tests/test_action.py
2
2655
import smtplib import unittest from unittest import mock from ..action import PrintAction, EmailAction class MessageMatcher: def __init__(self, expected): self.expected = expected def __eq__(self, other): return self.expected["Subject"] == other["Subject"] and \ self.expected["Fr...
mit
-2,945,051,649,091,507,000
36.928571
82
0.643315
false
protocol7/python-koans
python 3/koans/about_lists.py
4
3369
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Based on AboutArrays in the Ruby Koans # from runner.koan import * class AboutLists(Koan): def test_creating_lists(self): empty_list = list() self.assertEqual(list, type(empty_list)) self.assertEqual(__, len(empty_list)) def test_list...
mit
3,791,906,141,215,156,700
29.627273
79
0.533986
false
Mlieou/leetcode_python
leetcode/python/ex_321.py
3
1401
class Solution(object): def maxNumber(self, nums1, nums2, k): """ :type nums1: List[int] :type nums2: List[int] :type k: int :rtype: List[int] """ n, m = len(nums1), len(nums2) res = [0] * k i = max(0, k - m) while i <= k and i <= n: ...
mit
8,128,583,724,178,858,000
28.208333
91
0.400428
false
Koopakiller/Edu
NLA/serie1/prime_tests.py
2
1687
# Author: Tom Lambert # Content: UnitTests for Sum-class import unittest from prime import Prime class PrimeTests(unittest.TestCase): def test_get_prime(self): self.assertEqual(Prime.get_prime(0), 2) self.assertEqual(Prime.get_prime(1), 3) self.assertEqual(Prime.get_prime(2), 5) ...
mit
9,090,304,869,444,532,000
42.25641
113
0.654416
false
tbs1980/fast-mc
tests/test_hmc.py
1
1714
import numpy as np from unittest import TestCase from fast_mc.hmc import HamiltonianMonteCarloSampler from fast_mc.model import Model from math import sqrt class NormalDist(Model): def __init__(self, num_dims): if num_dims <= 0: raise ValueError("Number of dimensions should be greater than zer...
apache-2.0
9,006,699,376,136,805,000
32.607843
114
0.613186
false
fabiand93/ebil
py/ebil.py
1
4630
#!/usr/bin/env python import elftools from pwn import * from sys import argv, exit from termcolor import colored, cprint # generator def ebil(filename, remote=None, args=[], arch='x86'): s = 'e = Ebil(%s, %s, %s, %s)\n' % (repr(filename), repr(remote), repr(args), repr(arch)) s += \ r''' r = e.r LOCAL = e.LOCAL R...
gpl-2.0
-6,272,575,172,213,733,000
22.034826
91
0.582289
false
ambikeshwar1991/gnuradio
gr-filter/python/qa_fractional_interpolator.py
14
2816
#!/usr/bin/env python # # Copyright 2007,2010,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your ...
gpl-3.0
6,045,006,755,192,712,000
30.640449
89
0.620028
false
google-code-export/exposong
lib/exposong_openlyrics/tools/opensong2openlyrics.py
3
20748
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2010 The OpenLyrics Authors. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your opt...
gpl-3.0
8,549,212,275,197,750,000
29.069565
87
0.55133
false
Intel-Corporation/tensorflow
tensorflow/contrib/opt/python/training/adamax_test.py
20
14692
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-2,787,980,384,735,180,300
40.977143
80
0.598693
false
ahmadio/edx-platform
common/lib/xmodule/xmodule/vertical_block.py
56
5689
""" VerticalBlock - an XBlock which renders its children in a column. """ import logging from copy import copy from lxml import etree from xblock.core import XBlock from xblock.fragment import Fragment from xmodule.mako_module import MakoTemplateBlockBase from xmodule.progress import Progress from xmodule.seq_module im...
agpl-3.0
-7,983,055,479,076,791,000
36.427632
120
0.635437
false
olavurmortensen/gensim
gensim/models/ldamodel.py
1
45248
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html # """ **For a faster implementation of LDA (parallelized for multicore machines), see** :mod:`gensim.models.ldamulticore`. Latent Diri...
lgpl-2.1
-154,618,495,984,142,750
41.807947
184
0.603806
false
Endika/odoo
openerp/addons/test_inherit/models.py
91
3456
# -*- coding: utf-8 -*- from openerp import models, fields, api, osv # We just create a new model class mother(models.Model): _name = 'test.inherit.mother' _columns = { # check interoperability of field inheritance with old-style fields 'name': osv.fields.char('Name'), 'state': osv.fie...
agpl-3.0
2,685,875,323,388,922,000
29.857143
84
0.653067
false
JBonsink/GSOC-2013
tools/ns-allinone-3.14.1/ns-3.14.1/.waf-1.6.11-30618c54883417962c38f5d395f83584/waflib/Tools/gcc.py
14
2892
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,sys from waflib import Configure,Options,Utils from waflib.Tools import ccroot,ar from waflib.Configure import conf def find_gcc(conf): cc=conf.find_program(['gcc',...
gpl-3.0
-8,311,602,589,817,205,000
28.520408
102
0.655602
false
YueLinHo/Subversion
build/generator/swig/__init__.py
1
2404
# # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may n...
apache-2.0
-7,307,521,036,577,765,000
30.220779
74
0.683444
false
udscbt/FlipperBot-Elaborato
include/code/split.py
1
1330
#!/usr/bin/env python # USAGE: ./split.py COMMENT START END FILE OUTDIR import sys import re import os.path (BASE, START, END, FILE, OUTDIR) = sys.argv[1:] COMMENT = BASE+BASE START = BASE+START END = BASE+END f = open(FILE, "r") content = f.read() f.close() blocks = {} block = None linen = 0 for line in content.sp...
gpl-3.0
-6,641,636,681,699,978,000
25.6
85
0.61203
false
marcellodesales/svnedge-console
ext/solaris-sparc/pkg-toolkit/pkg/vendor-packages/pkg/client/transport/exception.py
4
10931
#!/usr/bin/python # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www....
agpl-3.0
570,080,072,565,487,000
34.605863
80
0.478456
false
rbarlow/pulp
server/pulp/server/managers/auth/principal.py
7
1538
import threading from pulp.server.db import model _PRINCIPAL_STORAGE = threading.local() class PrincipalManager(object): """ Manager that tracks the current user of the model. """ # reference system attributes here for convenience system_id = model.SYSTEM_ID system_login = model.SYSTEM_LOG...
gpl-2.0
8,886,109,759,874,568,000
31.041667
86
0.648895
false
Danceiny/HackGirlfriend
Spider/WeiboSpider/page_parse/user/enterprise.py
3
2541
# -*-coding:utf-8 -*- # 认证企业资料页面 import re import json from bs4 import BeautifulSoup from page_parse.user import public from decorators.decorator import parse_decorator @parse_decorator(4) def get_detail(html): """ 这个是从认证企业的个人资料页面解析数据,一般不用这个 :param html: :return: """ details = {} cont = pu...
apache-2.0
634,685,487,775,283,500
30.802632
107
0.610261
false
Aliso4ka1313/stardict-3
tools/src/lingea-trd-decoder.py
44
28596
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Script for decoding Lingea Dictionary (.trd) file # Result is <header>\t<definition> file, convertable easily # by stardict-editor from package stardict-tools into native # Stardict dictionary (stardict.sf.net and www.stardict.org) # # Copyright (C) 2007 - Klokan Petr ...
gpl-3.0
-5,377,860,950,595,701,000
40.03741
169
0.457137
false
SGC-Tlaxcala/cmi
cerebro/core/migrations/0001_initial.py
1
3320
# Generated by Django 2.1.1 on 2018-09-11 01:01 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
mit
-8,172,965,859,190,741,000
46.927536
212
0.576958
false
tseaver/google-cloud-python
vision/google/cloud/vision_v1p3beta1/__init__.py
1
1422
# -*- coding: utf-8 -*- # # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
508,371,465,349,360,300
34.55
77
0.771449
false
cobalys/django
django/forms/models.py
6
43549
""" Helper functions for creating Form classes from Django models and database field objects. """ from __future__ import absolute_import, unicode_literals from django.core.exceptions import ValidationError, NON_FIELD_ERRORS, FieldError from django.core.validators import EMPTY_VALUES from django.forms.fields import Fi...
bsd-3-clause
7,561,824,070,563,965,000
40.954721
121
0.592367
false
igel-kun/pyload
module/web/cnl_app.py
1
4675
# -*- coding: utf-8 -*- import re from base64 import standard_b64decode from binascii import unhexlify from urllib import unquote from bottle import HTTPError, request, route from module.utils import save_join from webinterface import DL_ROOT, JS, PYLOAD try: from Crypto.Cipher import AES except: pass def ...
gpl-3.0
-539,115,037,427,020,400
28.037267
147
0.6
false
ajylee/gpaw-rtxs
gpaw/test/h2o_xas.py
2
1466
import os import numpy as np from math import pi, cos, sin from ase import Atom, Atoms from ase.parallel import rank, barrier from gpaw import GPAW from gpaw.xas import XAS from gpaw.test import equal, gen # Generate setup for oxygen with half a core-hole: gen('O', name='hch1s', corehole=(1, 0, 0.5)) a = 5.0 d = 0.95...
gpl-3.0
6,524,847,142,330,145,000
21.90625
53
0.579127
false
nke001/attention-lvcsr
libs/Theano/theano/gof/fg.py
1
32569
""" fg.py: fg stands for FunctionGraph Contains the FunctionGraph class and exception types that it can raise """ from __future__ import print_function import sys import time import traceback import theano from theano.gof import graph from theano.gof import utils from theano.gof import toolbox from theano import confi...
mit
3,620,498,122,662,310,400
40.755128
116
0.550216
false
mark47/OESandbox
liquibase/OE2.7/CILNSPMassive/scripts/sampleType.py
1
1761
#!/usr/bin/env python # -*- coding: utf-8 -*- existing_types = [] sample_types = [] sample_type_file = open("sampleType.txt") existing_types_file = open("currentSampleTypes.txt") results = open("sampleTypeOutput.txt", 'w') def write_massive_type_of_sample(): results.write("\nPaste following in MassiveSampleTyp...
mpl-2.0
5,396,697,795,167,937,000
32.245283
162
0.651902
false
schoonc/AutobahnPython
examples/asyncio/wamp/pubsub/options/backend.py
8
2629
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with...
mit
5,416,899,172,164,104,000
37.661765
127
0.64245
false
ZeBadger/minecraft-robots
minecraft/vec3.py
17
2592
class Vec3: def __init__(self, x=0, y=0, z=0): self.x = x self.y = y self.z = z def __add__(self, rhs): c = self.clone() c += rhs return c def __iadd__(self, rhs): self.x += rhs.x self.y += rhs.y self.z += rhs.z ...
gpl-2.0
873,328,035,566,656,400
20.53913
67
0.460648
false
mpetyx/palmdrop
venv/lib/python2.7/site-packages/cms/utils/django_load.py
12
2872
# -*- coding: utf-8 -*- """ This is revision from 3058ab9d9d4875589638cc45e84b59e7e1d7c9c3 of https://github.com/ojii/django-load. ANY changes to this file, be it upstream fixes or changes for the cms *must* be documentet clearly within this file with comments. For documentation on how to use the functions described ...
apache-2.0
5,643,584,513,858,763,000
31.647727
79
0.662953
false
Gjacquenot/AcousticBEM
Python/HelmholtzIntegrals3D_C.py
1
4175
# --------------------------------------------------------------------------- # Copyright (C) 2017 Frank Jargstorff # # This file is part of the AcousticBEM library. # AcousticBEM 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 So...
gpl-3.0
-8,637,019,282,075,152,000
65.269841
79
0.345868
false
Debith/py3traits
src/pytraits/support/magic.py
1
11743
#!/usr/bin/python -tt # -*- coding: utf-8 -*- ''' Copyright 2014-2015 Teppo Perä 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 Un...
apache-2.0
-3,927,218,798,766,351,400
33.333333
119
0.591637
false
mypetbirdrules/4Chan-WINRAR-Detector
dubsget.py
1
4128
#!/bin/python import basc_py4chan import sys import time #defining methods def identicalDigits(inputList): commonNumber = inputList[0] identical = True for item in inputList: if commonNumber != int(item): identical = False return identical def digitsGet(ID): numList = [int(c) ...
gpl-2.0
8,618,375,218,090,447,000
32.836066
92
0.500484
false
lamdnhan/osf.io
framework/mongo/handlers.py
10
2761
# -*- coding: utf-8 -*- import logging import pymongo from flask import g from werkzeug.local import LocalProxy from website import settings logger = logging.getLogger(__name__) def get_mongo_client(): """Create MongoDB client and authenticate database. """ client = pymongo.MongoClient(settings.DB_HO...
apache-2.0
7,173,903,600,593,491,000
24.564815
77
0.62912
false
DavidAndreev/indico
indico/modules/attachments/util.py
1
4930
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
5,296,823,824,260,508,000
33.475524
102
0.6714
false
kmiddleton/dewarp_video
camera_calibration.py
1
7846
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Calibrate camera using checkerboard pattern @author: Kevin Middleton Based on: https://github.com/ying17zi/gopro-undistort and Off-line camera calibration Author: Leow Wee Kheng Department of Computer Science, National University of Singapore ...
cc0-1.0
-1,295,679,492,912,694,300
29.889764
82
0.54104
false
popazerty/openhdf-enigma2
lib/python/Screens/ServiceInfo.py
14
11417
from Components.HTMLComponent import HTMLComponent from Components.GUIComponent import GUIComponent from Screens.Screen import Screen from Components.ActionMap import ActionMap from Components.Label import Label from ServiceReference import ServiceReference from enigma import eListboxPythonMultiContent, eListbox, gFont...
gpl-2.0
-2,697,287,264,680,264,000
38.642361
187
0.657353
false
msaelices/django-athumb
athumb/backends/s3boto_gunicorn_eventlet.py
3
1475
""" File backends with small tweaks to work with gunicorn + eventlet async workers. These should eventually becom unecessary as the supporting libraries continue to improve. """ import eventlet from django.utils.deconstruct import deconstructible from athumb.backends.s3boto import S3BotoStorage, S3BotoStorage_AllPub...
bsd-3-clause
1,444,485,795,868,134,100
34.119048
78
0.731525
false
wuhengzhi/chromium-crosswalk
third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py
3
18202
# Copyright (C) 2011, Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the...
bsd-3-clause
5,361,809,373,319,320,000
49.561111
146
0.647621
false
nuclear-wizard/moose
python/peacock/tests/input_tab/BlockTree/test_BlockTree.py
12
10469
#!/usr/bin/env python3 #* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgp...
lgpl-2.1
-3,453,937,717,316,954,000
36.256228
106
0.632057
false
kmoocdev2/edx-platform
openedx/core/djangoapps/bookmarks/tasks.py
20
5912
""" Tasks for bookmarks. """ import logging from celery.task import task # pylint: disable=import-error,no-name-in-module from django.db import transaction from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.django import modulestore from . import PathItem log = logging.getLogger('edx.celery.task')...
agpl-3.0
1,651,573,289,422,461,200
35.95
116
0.628214
false
jart/tensorflow
tensorflow/compiler/tests/binary_ops_test.py
5
51918
# Copyright 2017 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
-719,556,821,278,186,200
37.007321
80
0.492758
false
CingHu/neutron-ustack
neutron/plugins/embrane/l2base/fake/fakeplugin_support.py
8
1709
# Copyright 2013 Embrane, 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...
apache-2.0
-2,184,579,337,189,978,000
38.744186
78
0.620246
false
megancarney/elastalert
tests/base_test.py
3
37848
# -*- coding: utf-8 -*- import contextlib import copy import datetime import json import threading import elasticsearch import mock import pytest from elasticsearch.exceptions import ElasticsearchException from elastalert.enhancements import BaseEnhancement from elastalert.kibana import dashboard_temp from elastalert...
apache-2.0
5,814,178,383,755,944,000
43.318501
283
0.618395
false
bliz937/kivy
kivy/uix/gesturesurface.py
11
23113
''' Gesture Surface =============== .. versionadded:: 1.9.0 .. warning:: This is experimental and subject to change as long as this warning notice is present. See :file:`kivy/examples/demo/multistroke/main.py` for a complete application example. ''' __all__ = ('GestureSurface', 'GestureContainer') from...
mit
-5,722,145,315,893,947,000
36.279032
80
0.574525
false
tsuru/healthcheck-as-a-service
tests/test_actions.py
1
1877
# Copyright 2014 healthcheck-as-a-service authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. import unittest import mock from healthcheck.actions import Action, Pipeline class ActionTest(unittest.TestCase): def test_interface(sel...
bsd-3-clause
7,382,542,903,634,424,000
27.014925
71
0.658498
false
PythonAlan/python-leaning-day3
set操作.py
1
1807
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #antuor:Alan old_dict = { ###旧数据,类型为字典 "#1":{ 'hostname':'c1', 'cpu_count': 2, 'mem_capicity': 80 }, "#2":{ 'hostname':'c1', 'cpu_count': 2, 'mem_capicity': 80 }, "#3":{ 'hostname':'c1', 'cpu_count': 2, '...
gpl-3.0
3,886,287,722,408,572,400
43.057143
121
0.467229
false
ayepezv/GAD_ERP
addons/website_crm_partner_assign/report/crm_lead_report.py
12
4004
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models from odoo import tools from odoo.addons.crm.models import crm_stage class CrmLeadReportAssign(models.Model): """ CRM Lead Report """ _name = "crm.lead.report.assign" _au...
gpl-3.0
6,772,428,593,054,383,000
50.333333
142
0.593906
false
dburr/SchoolIdolAPI
api/migrations/0009_account_ownedcard.py
4
2107
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('api', '0008_auto_20150122_0917'), ] ...
apache-2.0
7,869,710,928,661,126,000
43.829787
187
0.56953
false
redhat-cip/numeter
web-app/numeter_webapp/core/management/commands/populate.py
2
2190
""" Fast data insertion command module. Populate all hosts, plugin and storage. """ from django.core.management.base import BaseCommand, CommandError from core.models import Storage, Host, Plugin, Data_Source as Source from optparse import make_option import logging import sys class Command(BaseCommand): optio...
agpl-3.0
4,461,933,019,739,202,600
41.115385
118
0.583105
false
Sult/daf
apps/characters/forms.py
1
1033
from django import forms from .models import CharacterJournal, RefType class FilterJournalForm(forms.Form): def __init__(self, *args, **kwargs): self.characterapi = kwargs.pop("characterapi") super(FilterJournalForm, self).__init__(*args, **kwargs) self.fields['filter'] = forms.ChoiceFie...
mit
75,125,909,159,516,420
32.322581
75
0.60697
false
gojira/tensorflow
tensorflow/contrib/kfac/python/ops/fisher_factors.py
13
66803
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
5,971,168,412,835,317,000
35.504372
106
0.661782
false
ymero/pulsar
pulsar/async/cov.py
5
1368
from multiprocessing import current_process try: import coverage except ImportError: coverage = None class Coverage(object): '''Coverage mixin for actors. ''' @property def coverage(self): return getattr(current_process(), '_coverage', None) def start_coverage(self): if s...
bsd-3-clause
8,029,880,906,979,331,000
28.73913
78
0.529971
false
joergdietrich/astropy
astropy/table/tests/test_index.py
2
16413
# Licensed under a 3-clause BSD style license - see LICENSE.rst from ...tests.helper import pytest import numpy as np from .test_table import SetupData from ..bst import BST, FastRBT from ..sorted_array import SortedArray from ..table import QTable, Row from ... import units as u from ...time import Time from ..column ...
bsd-3-clause
861,039,551,988,500,000
35.966216
80
0.506062
false
VHAINNOVATIONS/DmD
scrubber/MIST_2_0_4/src/MAT/test/mat_service_unittest.py
1
4965
# Copyright (C) 2010 The MITRE Corporation. See the toplevel # file LICENSE for license terms. from mat_unittest_resources import PluginContextTestCase, CmdlinePluginContextTestCase import MAT _rawIO = MAT.DocumentIO.getDocumentIO('raw') import os, sys, glob class RemoteTestCase(CmdlinePluginContextTestCase, ...
apache-2.0
-6,912,678,910,829,932,000
44.136364
145
0.658409
false
aweinstock314/servo
tests/wpt/harness/wptrunner/products.py
40
1755
# 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/. import os import importlib import imp from .browsers import product_list def products_enabled(config): names = con...
mpl-2.0
6,403,735,240,075,246,000
30.909091
81
0.65812
false
lucasdavid/artificial
examples/genetic/knapsack.py
1
4469
"""Knapsack Example. This example demonstrates how to approximate the Knapsack problem using genetic algorithms. Author: Lucas David -- <ld492@drexel.edu> License: MIT (c) 2016 """ import time import artificial as at import matplotlib.pyplot as plt import numpy as np from artificial import searches random_state =...
mit
-586,813,627,823,555,100
28.993289
78
0.524278
false
Zarokka/exaile
xl/migrations/database/__init__.py
2
1730
# Copyright (C) 2008-2010 Adam Olsen # # 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, or (at your option) # any later version. # # This program is distributed in the hope that...
gpl-2.0
-2,783,614,302,189,031,000
41.195122
81
0.734104
false
shagi/guifiadmin
maintainers/models.py
1
1273
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ @python_2_unicode_compatible class Maintainer(models.Model): person = models.ForeignKey('accounting.Pe...
agpl-3.0
6,164,611,831,328,606,000
33.405405
103
0.692066
false
OsirisSPS/osiris-sps
client/share/plugins/AF9A4C281070FDB0F34CF417CDB168AB38C8A388/lib/test/test_dictcomps.py
39
2029
doctests = """ >>> k = "old value" >>> { k: None for k in range(10) } {0: None, 1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None} >>> k 'old value' >>> { k: k+10 for k in range(10) } {0: 10, 1: 11, 2: 12, 3: 13, 4: 14, 5: 15, 6: 16, 7: 17, 8: 18, 9: 19} ...
gpl-3.0
3,388,435,051,636,967,400
36.574074
318
0.521439
false
highlando/krypy
krypy/recycling/generators.py
1
2654
import numpy class _RitzSubsetsGenerator(object): '''Abstract base class for the generation of subset generation.''' def generate(self, ritz, remaining_subset): '''Returns a list of subsets with indices of Ritz vectors that are considered for deflation.''' raise NotImplementedError('ab...
mit
7,227,492,041,680,172,000
37.463768
79
0.624717
false
Revanth47/addons-server
src/olympia/accounts/tests/test_utils.py
4
3951
# -*- coding: utf-8 -*- import urlparse from base64 import urlsafe_b64decode, urlsafe_b64encode from django.contrib.auth.models import AnonymousUser from django.test import RequestFactory from django.test.utils import override_settings import mock from olympia.accounts import utils from olympia.users.models import U...
bsd-3-clause
4,494,218,828,836,354,000
33.938053
72
0.640831
false
filippog/pyasn1
test/type/test_namedtype.py
1
3619
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net> # License: http://pyasn1.sf.net/license.html # from pyasn1.type import namedtype, univ from pyasn1.error import PyAsn1Error from sys import version_info if version_info[0:2] < (2, 7) or \ version_info[0:2] in ( (3, 0)...
bsd-3-clause
6,003,205,596,263,694,000
36.309278
241
0.614811
false
riking/youtube-dl
youtube_dl/extractor/ebaumsworld.py
16
1134
import re from .common import InfoExtractor from ..utils import determine_ext class EbaumsWorldIE(InfoExtractor): _VALID_URL = r'https?://www\.ebaumsworld\.com/video/watch/(?P<id>\d+)' _TEST = { u'url': u'http://www.ebaumsworld.com/video/watch/83367677/', u'file': u'83367677.mp4', u'...
unlicense
-4,416,765,149,980,159,500
31.4
78
0.553792
false
chayapan/django-sentry
src/sentry/migrations/0043_auto__chg_field_option_value__chg_field_projectoption_value.py
6
17659
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Option.value' db.alter_column('sentry_option', 'value', self.gf('picklefield.fields.Pick...
bsd-3-clause
367,449,444,452,910,600
78.188341
182
0.549975
false
kaynfiretvguru/Eldritch
plugin.video.ex0dus/resources/lib/sources/en/moviesplanet.py
8
7298
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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 l...
gpl-2.0
-8,964,734,868,502,146,000
35.308458
152
0.510551
false
orcmkit/ORCmKit
Python27/components/SemiEmp_APEN_Ziviani.py
1
26330
from __future__ import division # -*- coding: utf-8 -*- """ Supplemental code for paper: APEN-D-16-03721 "Characterizing the performance of a single-screw expander in a small-scale organic Rankine cycle for waste heat recovery" Semi-Emperical Model of single-screw expander Baseline: no flooding @author: Davide Zivia...
mit
-19,272,166,196,073,890
33.018088
251
0.484656
false
nschloe/python4gmsh
src/pygmsh/_optimize.py
2
2184
import gmsh import meshio import numpy as np from .helpers import extract_to_meshio def optimize(mesh, method="", verbose=False): mesh.remove_lower_dimensional_cells() mesh.cell_data = {} # read into meshio like # <https://gitlab.onelab.info/gmsh/gmsh/-/blob/master/demos/api/import_perf.py> gmsh...
bsd-3-clause
5,314,665,168,606,474,000
32.090909
87
0.621795
false
goodtune/django-mailchimp
mailchimp/views.py
5
6723
from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.views.decorators.csrf import csrf_exempt from django.http import Http404 from mailchimp.models import Campaign, Queue from mailchimp.settings import WEBHOOK_KEY from mailchimp.signals import get_signal fr...
bsd-3-clause
3,452,932,817,410,456,600
36.149171
121
0.598394
false
NeCTAR-RC/horizon
horizon/notifications.py
3
4462
# Copyright (C) 2015 Yahoo! 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...
apache-2.0
-4,545,135,269,827,989,500
28.946309
77
0.599955
false
chromium/chromium
third_party/android_deps/libs/com_android_support_coordinatorlayout/3pp/fetch.py
6
1371
#!/usr/bin/env python # Copyright 2021 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This is generated, do not edit. Update BuildConfigGenerator.groovy and # 3ppFetch.template instead. from __future__ import print_fun...
bsd-3-clause
6,088,326,899,053,397,000
23.482143
112
0.648432
false
woailuoli993/allSpider
baiduUrlSpider.py
1
2914
# -×- coding:utf-8-*- __author__ = 'diaoshe' from lxml import etree import re import requests import os import time keyword = '爱因斯坦' pn = 0 baidu = 'http://www.baidu.com/s?wd=%s&pn=' % keyword + str(pn) headers = { 'method': 'GET', 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, l...
gpl-2.0
8,492,611,454,600,277,000
27.77551
124
0.565094
false
v4nz666/7drl2016
entities/enemy.py
1
2658
from RoguePy.libtcod import libtcod from RoguePy.Game import Entity import entities __author__ = 'jripley' class Enemy(Entity): def __init__(self, name, ch, clr, pathFunc, opts): super(Enemy, self).__init__(name, ch, clr, opts) self.targetCoord = None self.path = None self.pathFunc = pathFunc s...
gpl-3.0
3,704,435,902,431,644,700
25.848485
95
0.591422
false
marcwebbie/youtube-dl
youtube_dl/extractor/telewebion.py
9
1842
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class TelewebionIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?telewebion\.com/#!/episode/(?P<id>\d+)' _TEST = { 'url': 'http://www.telewebion.com/#!/episode/1263668/', 'info_dict': { ...
unlicense
-7,827,585,827,347,917,000
32.072727
99
0.534909
false
fabioticconi/scikit-learn
sklearn/utils/fixes.py
9
13854
"""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. """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # ...
bsd-3-clause
-1,511,840,409,517,302,000
32.872861
84
0.576368
false
apenwarr/bup
lib/bup/metadata.py
1
36028
"""Metadata read/write support for bup.""" # Copyright (C) 2010 Rob Browning # # This code is covered under the terms of the GNU Library General # Public License as described in the bup LICENSE file. import errno, os, sys, stat, time, pwd, grp from cStringIO import StringIO from bup import vint, xstat from bup.drecurs...
lgpl-2.1
8,656,332,405,502,868,000
34.920239
80
0.536888
false
gpitel/pyjs
examples/svgtest/svgWindow.py
13
3387
# Copyright (C) 2009 Johan Wouters from pyjamas import DOM from pyjamas.ui.FocusWidget import FocusWidget from pyjamas.ui.HTML import HTML from pyjamas.ui.RootPanel import RootPanel from pyjamas.ui.Frame import Frame class svgWindow(FocusWidget): def __init__(self, className=None): element = DOM.createIFrame()...
apache-2.0
436,708,359,005,409,900
28.198276
127
0.659286
false
0111001101111010/cs595-f13
assignment9/PCI_Code_Folder/chapter5/kayak.py
4
2701
import time import urllib2 import xml.dom.minidom kayakkey='YOUR KEY HERE' def getkayaksession(): # Construct the URL to start a session url='http://www.kayak.com/k/ident/apisession?token=%s&version=1' % kayakkey # Parse the resulting XML doc=xml.dom.minidom.parseString(urllib2.urlopen(url).read...
mit
8,914,348,851,999,327,000
30.542169
83
0.68197
false
globaltoken/globaltoken
test/functional/wallet_keypool.py
2
3417
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the wallet keypool and interaction with wallet encryption/locking.""" from test_framework.test_fr...
mit
660,093,374,832,246,100
39.678571
119
0.643547
false
mistercrunch/airflow
airflow/providers/apache/hdfs/sensors/web_hdfs.py
5
1596
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
5,125,568,402,827,969,000
38.9
106
0.724937
false
rkhleics/wagtailmenus
wagtailmenus/conf/tests/test_modeladmin_disable_settings.py
2
2236
from importlib import reload from unittest.mock import call, patch from django.test import TestCase, override_settings from wagtailmenus.modeladmin import FlatMenuAdmin, MainMenuAdmin from wagtailmenus import wagtail_hooks class TestDisablingFlatMenusInWagtailCMS(TestCase): """ Tests if modeladmin is regist...
mit
2,938,773,985,445,156,400
34.492063
83
0.693649
false
dcousens/bitcoin
qa/rpc-tests/txn_clone.py
69
7549
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test proper accounting with an equivalent malleability clone # from test_framework.test_framework im...
mit
2,917,226,290,236,871,700
46.477987
111
0.592794
false
tareqalayan/ansible
lib/ansible/module_utils/network/aos/aos.py
57
5678
# # Copyright (c) 2017 Apstra Inc, <community@apstra.com> # # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the m...
gpl-3.0
-5,863,188,120,276,478,000
30.544444
107
0.669074
false
lbelella/hue-controller
hue_control.py
1
5636
#!/usr/bin/python3 from PyQt4 import QtCore, QtGui import sys from phue import Bridge class HueController(): """ Small wrapper class around the phue Bridge object. """ def __init__(self): self.bridge = Bridge('10.0.0.210') self.bridge.connect() self.lights = self.bridge.get_ligh...
mit
-2,233,435,326,408,374,300
30.841808
103
0.605749
false
google/orchestra
orchestra/google/marketing_platform/utils/schema/sdf/v4_2/Ad.py
1
2230
########################################################################### # # Copyright 2019 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 # # https://www.apache.org/...
apache-2.0
-1,821,608,665,539,999,000
24.340909
75
0.536323
false
liesbethvanherpe/NeuroM
neurom/check/tests/test_runner.py
1
8706
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
bsd-3-clause
-6,327,928,545,410,990,000
30.89011
86
0.580289
false
jbedorf/tensorflow
tensorflow/python/distribute/shared_variable_creator_test.py
24
2527
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
3,085,030,909,704,552,400
33.148649
80
0.703601
false
boada/HETDEXCluster
legacy/stats/rejectOutliers_group.py
3
5612
import glob import pandas as pd import pylab as pyl from astLib import astCoords as aco from astLib import astStats as ast from astLib import astCalc as aca c = 2.99E5 # speed of light in km/s def parseResults(files): ''' Reads all of the results files and puts them into a list with the results. Returns field...
mit
-7,425,149,273,720,521,000
30.706215
109
0.600677
false
CalvinNeo/EasyMLPlatform
py/www/www/forms.py
1
2589
#coding:utf8 from django import forms class UploadDatasetForm(forms.Form): # modify use datasetindex = forms.IntegerField(required=False) name = forms.CharField(max_length=20) path = forms.FileField(required=True) attr_delim = forms.CharField(max_length=3,required=False) record_delim = forms....
apache-2.0
-2,681,529,452,205,374,000
33.835616
71
0.658278
false
Anveling/sp17-i524
project/S17-IR-P013/code/weather_data_analysis/src/setup.py
19
3790
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.absp...
apache-2.0
-1,375,701,106,593,816,300
34.092593
94
0.668602
false
timpalpant/KaggleTSTextClassification
scripts/feature_encoders/one_hot_pairs.py
1
2951
#!/usr/bin/env python ''' Just the raw features ''' import argparse, logging, gc, objgraph from itertools import izip import numpy as np from scipy import sparse from common import load_npz, save_encoded_features from prepare_features import OneHotEncoder logging.basicConfig(level=logging.DEBUG) def pair_features(t...
gpl-3.0
-5,763,694,866,513,682,000
32.534091
69
0.600474
false
roelvv/pyrax
pyrax/fakes.py
10
30376
# -*- coding: utf-8 -*- import json import os import random import time import uuid import pyrax from pyrax.autoscale import AutoScaleClient from pyrax.autoscale import AutoScalePolicy from pyrax.autoscale import AutoScaleWebhook from pyrax.autoscale import ScalingGroup from pyrax.autoscale import ScalingGroupManager ...
apache-2.0
6,001,255,093,657,658,000
32.60177
80
0.610186
false
gzampieri/Scuba
input_output.py
1
7980
""" This file is part of Scuba. Copyright (C) 2016 by Guido Zampieri, Dinh Tran, Michele Donini. Scuba 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 ...
gpl-2.0
-7,745,950,097,930,413,000
30.792829
175
0.673308
false
DDMAL/Gamera
gamera/gui/gaoptimizer/OptimizerApp.py
3
1573
# # Copyright (C) 2012 Tobias Bolten # # 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 i...
gpl-2.0
7,372,455,302,596,120,000
39.333333
80
0.499046
false
Lunchable/eat
src/eat/models/user.py
1
1612
import datetime from argon2 import PasswordHasher from . import db from application import Application import mongoengine class User(db.Document): @property def is_authenticated(self): return True @property def is_active(self): return True @property def is_anonymous(self): ...
mit
6,124,539,001,980,594,000
25
101
0.653226
false
tomaslaz/KLMC_Analysis
thirdparty/JPype-0.5.4.2/src/python/jpype/_jarray.py
4
4400
#***************************************************************************** # Copyright 2004-2008 Steve Menard # # 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://...
gpl-3.0
5,372,116,957,614,733,000
24.047337
116
0.616364
false