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
NicovincX2/Python-3.5
Algèbre/Algèbre linéaire/Algèbre multilinéaire/slice3.py
1
7017
# -*- coding: utf-8 -*- """ slice3.py - plot 3D data on a uniform tensor-product grid as a set of three adjustable xy, yz, and xz plots Copyright (c) 2013 Greg von Winckel All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and ...
gpl-3.0
-7,992,830,840,298,506,000
32.735577
94
0.595554
false
iproduct/course-social-robotics
11-dnn-keras/venv/Lib/site-packages/pyrsistent/_transformations.py
2
3800
import re try: from inspect import Parameter, signature except ImportError: signature = None from inspect import getfullargspec _EMPTY_SENTINEL = object() def inc(x): """ Add one to the current value """ return x + 1 def dec(x): """ Subtract one from the current value """ return x - 1 ...
gpl-2.0
2,707,392,426,892,564,000
26.338129
86
0.598421
false
402231466/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testmagicmethods.py
737
12145
import unittest import inspect import sys from unittest.mock import Mock, MagicMock, _magics class TestMockingMagicMethods(unittest.TestCase): def test_deleting_magic_methods(self): mock = Mock() self.assertFalse(hasattr(mock, '__getitem__')) mock.__getitem__ = Mock() self.asser...
gpl-3.0
-6,973,739,172,848,524,000
29.136476
79
0.562948
false
kidburglar/youtube-dl
youtube_dl/extractor/trutv.py
20
2532
# coding: utf-8 from __future__ import unicode_literals import re from .turner import TurnerBaseIE from ..utils import ( int_or_none, parse_iso8601, ) class TruTVIE(TurnerBaseIE): _VALID_URL = r'https?://(?:www\.)?trutv\.com/(?:shows|full-episodes)/(?P<series_slug>[0-9A-Za-z-]+)/(?:videos/(?P<clip_slug>...
unlicense
-3,162,342,875,882,536,000
32.76
156
0.521327
false
user-none/calibre
setup/vcvars.py
11
2188
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
gpl-3.0
7,020,094,080,987,351,000
25.682927
69
0.572669
false
ahojjati/grr
gui/api_plugins/reflection.py
3
1393
#!/usr/bin/env python """API renderer for rendering descriptors of GRR data structures.""" from grr.gui import api_call_renderers from grr.gui import api_value_renderers from grr.lib import rdfvalue from grr.lib.rdfvalues import structs as rdf_structs from grr.proto import api_pb2 class ApiRDFValueReflectionRende...
apache-2.0
-5,900,816,826,125,826,000
29.282609
79
0.737976
false
duyet-website/api.duyet.net
lib/numpy/distutils/__config__.py
14
1313
# This file is generated by /io/numpy/setup.py # It contains system_info results at the time of building this package. __all__ = ["get_info","show"] lapack_opt_info={'libraries': ['openblas', 'openblas'], 'library_dirs': ['/usr/local/lib'], 'language': 'c', 'define_macros': [('HAVE_CBLAS', None)]} blas_opt_info={'libr...
mit
-7,470,184,039,037,793,000
45.928571
154
0.562833
false
coberger/DIRAC
TransformationSystem/Agent/TransformationAgent.py
4
29976
""" TransformationAgent processes transformations found in the transformation database. """ import time, Queue, os, datetime, pickle from DIRAC import S_OK, S_ERROR from DIRAC.Core.Base.AgentModule import AgentModule from DIRA...
gpl-3.0
3,185,076,755,031,902,000
42.953079
163
0.628636
false
tommo/gii
template/host/waf-tools/emxx.py
2
3207
############################################################################### # # Oak game engine # Copyright (c) 2013 Remi Papillie # # 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 S...
mit
-7,577,717,900,793,679,000
34.033708
79
0.637356
false
iansf/engine
sky/tools/webkitpy/common/checkout/scm/scm_mock.py
48
4096
# 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 f...
bsd-3-clause
-4,250,169,806,397,228,000
35.571429
121
0.69458
false
jonashaag/django-nonrel-nohistory
tests/regressiontests/test_utils/tests_25.py
48
1281
from __future__ import with_statement from django.test import TestCase from models import Person class AssertNumQueriesContextManagerTests(TestCase): def test_simple(self): with self.assertNumQueries(0): pass with self.assertNumQueries(1): Person.objects.count() ...
bsd-3-clause
-8,878,015,312,416,232,000
30.243902
80
0.62217
false
navotsil/Open-Knesset
notify/management/commands/notify.py
8
12644
from __future__ import absolute_import from django.core.management.base import NoArgsCommand from django.contrib.auth.models import User,Group from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.utils.translation import ugettext as _ from django.utils impo...
bsd-3-clause
4,930,140,662,723,144,000
51.683333
208
0.535906
false
tkaitchuck/nupic
external/linux64/lib/python2.6/site-packages/numpy/lib/arraysetops.py
6
11527
""" Set operations for 1D numeric arrays based on sorting. :Contains: ediff1d, unique, intersect1d, setxor1d, in1d, union1d, setdiff1d :Notes: For floating point arrays, inaccurate results may appear due to usual round-off and floating point comparison issues. Speed could be gained in some operations ...
gpl-3.0
-4,877,426,748,691,003,000
26.642686
79
0.571528
false
lmregus/Portfolio
python/design_patterns/env/lib/python3.7/site-packages/pip/_internal/commands/help.py
30
1090
from __future__ import absolute_import from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import SUCCESS from pip._internal.exceptions import CommandError class HelpCommand(Command): """Show help for commands""" name = 'help' usage = """ %prog <command>""" su...
mit
7,376,529,542,021,755,000
28.459459
78
0.606422
false
mavit/ansible
test/units/module_utils/urls/test_fetch_url.py
28
7987
# -*- coding: utf-8 -*- # (c) 2018 Matt Martz <matt@sivel.net> # 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 import socket from ansible.module_utils.six import StringIO from ansible.mo...
gpl-3.0
-2,327,428,080,713,699,000
36.32243
159
0.625141
false
whaleygeek/punchcard_reader
cardreader/serial/serialposix.py
141
26585
#!/usr/bin/env python # # Python Serial Port Extension for Win32, Linux, BSD, Jython # module for serial IO for POSIX compatible systems, like Linux # see __init__.py # # (C) 2001-2010 Chris Liechti <cliechti@gmx.net> # this is distributed under a free software license, see license.txt # # parts based on code from Gran...
mit
-5,991,559,422,970,542,000
36.816501
148
0.588415
false
muslih/alfanous
src/alfanous/QueryProcessing.py
2
27994
#!/usr/bin/env python2 # coding: utf-8 # # Copyright (C) 2009-2012 Assem Chelli <assem.ch [at] gmail.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 ve...
agpl-3.0
-5,454,621,167,970,110,000
31.553613
102
0.549748
false
matthijsvk/multimodalSR
code/Experiments/neon-master/neon/backends/conv_kernel_test.py
1
18713
#!/usr/bin/env python # Copyright 2016 Nervana Systems 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 r...
mit
5,261,165,859,240,119,000
47.229381
157
0.508203
false
starqiu/PythonLearn
dispdis2.py
1
1671
import csv csvfile1=file('simpl.csv','rb') fin1=csv.reader(csvfile1) label_dict={'back.':0,'buffer_overflow.':1,'ftp_write.':2,'guess_passwd.':3,'imap.':4,'ipsweep.':5,'land.':6,'loadmodule.':7, 'multihop.':8,'neptune.':9,'nmap.':10,'normal.':11,'perl.':12,'phf.':13,'pod.':14,'portsweep.':15,'rootkit.':16,...
gpl-2.0
-7,674,086,056,673,212,000
25.883333
125
0.594853
false
totalretribution/Cura
plugins/AutoSave/AutoSave.py
6
2018
# Copyright (c) 2016 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from PyQt5.QtCore import QTimer from UM.Extension import Extension from UM.Preferences import Preferences from UM.Application import Application from UM.Resources import Resources from UM.Logger import Logger class AutoSa...
agpl-3.0
-4,082,119,471,218,736,000
36.37037
151
0.703667
false
linked67/p2pool-lire
p2pool/util/fixargparse.py
283
1630
from __future__ import absolute_import import argparse import sys class FixedArgumentParser(argparse.ArgumentParser): ''' fixes argparse's handling of empty string arguments and changes @filename behaviour to accept multiple arguments on each line ''' def _read_args_from_files(self, arg_strings)...
gpl-3.0
1,534,454,188,717,398,500
36.906977
81
0.534356
false
alphafoobar/intellij-community
python/lib/Lib/email/base64MIME.py
93
5802
# Copyright (C) 2002-2006 Python Software Foundation # Author: Ben Gertzfield # Contact: email-sig@python.org """Base64 content transfer encoding per RFCs 2045-2047. This module handles the content transfer encoding method defined in RFC 2045 to encode arbitrary 8-bit data using the three 8-bit bytes in four 7-bit ch...
apache-2.0
5,681,594,276,547,683,000
29.861702
78
0.680627
false
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/wheel/cli/convert.py
10
9498
import os.path import re import shutil import sys import tempfile import zipfile from distutils import dist from glob import iglob from ..bdist_wheel import bdist_wheel from ..wheelfile import WheelFile from . import WheelError, require_pkgresources egg_info_re = re.compile(r''' (?P<name>.+?)-(?P<ver>.+?) (-(...
apache-2.0
7,022,699,431,160,301,000
34.30855
83
0.608339
false
William-An/wechat_server
Control_server/accesskey_Server.py
1
5638
import requests import sqlite3 import web import time import os import sys # 加密?-> 出租服务器 """ Using two server to provide wechat subscription service, one for acquring token, one for processing request """ PATH = os.path.abspath(os.path.dirname(sys.argv[0])) # The path of this file timer=os.times() web.config.debug = ...
apache-2.0
-5,425,620,791,363,359,000
40.791045
223
0.560714
false
tajkhan/pluto-pocc
annotations/module/loop/ast.py
4
20819
# # The classes of the abstract syntax tree # # AST # | # +-- Exp # | | # | +-- NumLitExp # | +-- StringLitExp # | +-- IdentExp # | +-- ArrayRefExp # | +-- FunCallExp # | +-- UnaryExp # | +-- BinOpExp # | +-- ParenthExp # | # +-- Stmt # | | # | +--...
gpl-3.0
-9,088,473,530,431,207,000
31.428349
96
0.477016
false
jiangzhixiao/odoo
addons/stock_landed_costs/stock_landed_costs.py
42
22915
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
3,779,979,066,127,705,000
53.044811
317
0.574296
false
askeing/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptmanifest/backends/static.py
29
6487
import operator from ..node import NodeVisitor from ..parser import parse class Compiler(NodeVisitor): """Compiler backend that evaluates conditional expressions to give static output""" def compile(self, tree, expr_data, data_cls_getter=None, **kwargs): """Compile a raw AST into a form with con...
mpl-2.0
-7,831,147,845,742,906,000
28.089686
86
0.561585
false
jm33-m0/massExpConsole
exploits/weblogic/weblogic_cve-2017-10271.py
1
3050
#!/usr/bin/python3 # pylint: disable=invalid-name, line-too-long, import-error, no-member, missing-docstring, broad-except import argparse import sys import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) def payload...
gpl-3.0
6,737,507,263,893,767,000
39.666667
103
0.438689
false
TiVoMaker/boto
tests/unit/dynamodb/test_types.py
74
6285
#!/usr/bin/env python # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
mit
-8,307,256,322,807,601,000
43.260563
108
0.593636
false
dingdang2012/tlsprober
analyze/alexa_ev_analyze.py
3
3467
# Copyright 2010-2012 Opera Software ASA # # 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
5,657,041,723,317,935,000
40.27381
206
0.723104
false
akiss77/servo
tests/wpt/web-platform-tests/tools/py/doc/conf.py
218
8482
# -*- coding: utf-8 -*- # # py documentation build configuration file, created by # sphinx-quickstart on Thu Oct 21 08:30:10 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All conf...
mpl-2.0
-1,350,099,088,395,784,400
31.250951
106
0.705258
false
tgerla/ansible
lib/ansible/inventory/script.py
27
6367
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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) an...
gpl-3.0
-1,433,350,896,204,513,800
37.355422
159
0.578923
false
jaduimstra/nilmtk
nilmtk/metrics.py
5
13373
'''Metrics to compare disaggregation performance against ground truth data. All metrics functions have the same interface. Each function takes `predictions` and `ground_truth` parameters. Both of which are nilmtk.MeterGroup objects. Each function returns one of two types: either a pd.Series or a single float. Most...
apache-2.0
2,125,890,848,428,178,000
31.224096
115
0.59837
false
taroplus/spark
python/pyspark/streaming/kafka.py
7
17318
# # 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 us...
apache-2.0
-3,441,631,544,620,904,000
37.229581
100
0.625823
false
everaldo/example-code
18-asyncio/spinner_thread.py
13
1273
# spinner_thread.py # credits: Adapted from Michele Simionato's # multiprocessing example in the python-list: # https://mail.python.org/pipermail/python-list/2009-February/538048.html # BEGIN SPINNER_THREAD import threading import itertools import time import sys class Signal: # <1> go = True def spin(msg, s...
mit
-5,101,823,379,569,582,000
21.732143
73
0.569521
false
google/grr
grr/server/grr_response_server/gui/api_plugins/yara.py
1
1489
#!/usr/bin/env python """A module with API handlers related to the YARA memory scanning.""" from grr_response_core.lib.rdfvalues import structs as rdf_structs from grr_response_proto.api import yara_pb2 from grr_response_server import data_store from grr_response_server.gui import api_call_context from grr_response_se...
apache-2.0
8,963,362,253,349,492,000
32.840909
76
0.774345
false
ChanderG/numpy
numpy/core/tests/test_nditer.py
85
103653
from __future__ import division, absolute_import, print_function import sys import warnings import numpy as np from numpy import array, arange, nditer, all from numpy.compat import asbytes, sixu from numpy.core.multiarray_tests import test_nditer_too_large from numpy.testing import ( run_module_suite, assert_, as...
bsd-3-clause
-9,181,033,831,541,872,000
38.292267
95
0.507733
false
ptrompeter/data-structures
tests/test_priority.py
1
1333
from src.priority import Priority TEST_LIST = [ (2, 1), (5, 1), (1, 1), (2, 2), (1, 2), (2, 3), (5, 2), (4, 1), (6, 1), (8, 1), (1, 3), (2, 4), ] def test_pri_push(): test_pri = Priority() test_pri.push((1, 'a')) assert test_pri.plist[0] == (1, 'a') def te...
mit
4,399,510,814,183,958,500
18.602941
40
0.52063
false
rdipietro/tensorflow
tensorflow/python/ops/math_grad_test.py
20
5921
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-7,894,033,778,420,338,000
37.953947
80
0.607499
false
berkmancenter/mediacloud
apps/extract-and-vector/src/python/extract_and_vector/dbi/stories/extractor_arguments.py
1
2882
from mediawords.util.perl import decode_object_from_bytes_if_needed # MC_REWRITE_TO_PYTHON: rename back to ExtractorArguments after rewrite class PyExtractorArguments(object): """Arguments to process_extracted_story() that define how story is to be extracted.""" # MC_REWRITE_TO_PYTHON: remake into data class...
agpl-3.0
3,848,475,984,186,578,000
42.014925
114
0.631853
false
i3visio/osrframework
osrframework/wrappers/myeloma.py
1
3879
################################################################################ # # Copyright 2015-2020 Félix Brezo and Yaiza Rubio # # This program is part of OSRFramework. You can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Softwa...
agpl-3.0
6,008,858,843,483,821,000
37.78
80
0.523724
false
tayfun/django
tests/template_tests/filter_tests/test_filesizeformat.py
306
2495
from __future__ import unicode_literals from django.template.defaultfilters import filesizeformat from django.test import SimpleTestCase from django.utils import translation class FunctionTests(SimpleTestCase): def test_formats(self): self.assertEqual(filesizeformat(1023), '1023\xa0bytes') self....
bsd-3-clause
937,081,379,315,199,400
59.853659
101
0.657315
false
williballenthin/python-idb
tests/test_idb.py
1
24692
import binascii import idb.fileformat import idb.netnode from fixtures import * def h2b(somehex): """ convert the given hex string into bytes. binascii.unhexlify is many more characters to type :-). """ return binascii.unhexlify(somehex) def b2h(somebytes): """ convert the given bytes ...
apache-2.0
-3,321,311,709,020,158,000
28.083628
121
0.599141
false
Kore-Core/kore
qa/rpc-tests/txn_clone.py
1
7951
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Kore 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 impor...
mit
-7,224,402,688,196,683,000
47.187879
115
0.592001
false
pathak22/corr_clustering
src/random_geom_model.py
1
4416
# --------------------------------------------------------------------- # Model 1 : Random Geometric Graph # Python script to generate data using model-1 and perform greedy pivot # algorithm. # # Note: All Indices, whatsoever, start from 0. # --------------------------------------------------------------------- import...
gpl-2.0
-2,330,868,673,899,754,000
31
115
0.515851
false
bastibl/gnuradio
gr-dtv/examples/atsc_ctrlport_monitor.py
7
6277
#!/usr/bin/env python # # Copyright 2015 Free Software Foundation # # 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, or (at your option) # any later version. # # This program is...
gpl-3.0
7,241,930,980,895,546,000
39.496774
94
0.607456
false
undoware/neutron-drive
google_appengine/lib/django_1_3/django/core/management/commands/startapp.py
321
1909
import os from django.core.management.base import copy_helper, CommandError, LabelCommand from django.utils.importlib import import_module class Command(LabelCommand): help = "Creates a Django app directory structure for the given app name in the current directory." args = "[appname]" label = 'application...
bsd-3-clause
6,862,580,917,141,454,000
39.617021
160
0.661603
false
newrocknj/horizon
openstack_dashboard/views.py
50
1395
# Copyright 2012 Nebula, 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 agree...
apache-2.0
-39,344,893,040,230,910
30
78
0.711111
false
lyoshenka/PyPagekite
pagekite/yamond.py
2
5903
""" This is a class implementing a flexible metric-store and an HTTP thread for browsing the numbers. """ ############################################################################## LICENSE = """\ This file is part of pagekite.py. Copyright 2010-2013, the Beanstalks Project ehf. and Bjarni Runar Einarsson This prog...
agpl-3.0
6,432,655,203,452,130,000
25.119469
78
0.611723
false
delcypher/klee-runner
nativeanalysis/analyse.py
1
17995
# vim: set sw=4 ts=4 softtabstop=4 expandtab: from collections import namedtuple import logging import pprint import re _logger = logging.getLogger(__name__) # Possibe run outcomes SuccessfulExecution = namedtuple("SuccessfulExecution", ["msg"]) ASanError = namedtuple("ASanError", ["msg", "type", "stack_trace"]) UBSa...
mit
-8,031,567,647,983,224,000
42.153477
165
0.594443
false
framon/samba
lib/testtools/testtools/helpers.py
12
4116
# Copyright (c) 2010-2012 testtools developers. See LICENSE for details. __all__ = [ 'safe_hasattr', 'try_import', 'try_imports', ] import sys def try_import(name, alternative=None, error_callback=None): """Attempt to import ``name``. If it fails, return ``alternative``. When supporting mu...
gpl-3.0
5,476,282,296,444,965,000
33.588235
81
0.640185
false
dlacombejr/deepy
deepy/dataset/bunch_seq.py
5
2479
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging as loggers logging = loggers.getLogger(__name__) from . import MiniBatches import numpy as np from deepy.utils import global_rand, FakeGenerator class BunchSequences(MiniBatches): """ Arrange sequences in bunch mode. See http://mi.eng.cam.ac.uk...
mit
-5,796,262,903,340,662,000
33.444444
102
0.592981
false
mrquim/mrquimrepo
repo/plugin.video.LiveTV/resources/lib/URLResolverMedia.py
4
22846
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2015 xsteal # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # #...
gpl-2.0
3,549,702,917,608,204,000
31.34136
220
0.617659
false
mats116/gae-boilerplate
bp_admin/users.py
11
3991
# -*- coding: utf-8 -*- import webapp2 from google.appengine.datastore.datastore_query import Cursor from google.appengine.ext import ndb from collections import OrderedDict, Counter from wtforms import fields from bp_includes import forms from bp_includes.lib.basehandler import BaseHandler class AdminUserGeoChartHan...
lgpl-3.0
5,753,250,413,954,815,000
33.111111
113
0.52894
false
hynnet/openwrt-mt7620
staging_dir/host/lib/python2.7/test/test_complex.py
93
27585
import unittest from test import test_support from random import random from math import atan2, isnan, copysign INF = float("inf") NAN = float("nan") # These tests ensure that complex math does the right thing class ComplexTest(unittest.TestCase): def assertAlmostEqual(self, a, b): if isinstance(a, comp...
gpl-2.0
-4,845,475,833,475,188,000
41.373272
100
0.556969
false
nberliner/SRVis
lib/dataHandler.py
1
3758
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is dis...
gpl-3.0
-9,220,223,827,961,739,000
35.843137
109
0.651676
false
ubear/Pyspider
pyspider/libs/bench.py
6
2974
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<roy@binux.me> # http://binux.me # Created on 2014-12-08 22:23:10 import time import logging logger = logging.getLogger('bench') from pyspider.scheduler import Scheduler from pyspider.fetcher.tornad...
apache-2.0
6,479,278,186,760,263,000
30.638298
81
0.604573
false
wesm/arrow
python/pyarrow/tests/test_schema.py
4
20872
# 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 u...
apache-2.0
-615,398,078,829,154,300
27.948682
79
0.567219
false
mensler/ansible
lib/ansible/module_utils/vca.py
77
11149
# # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope tha...
gpl-3.0
1,873,574,353,154,731,300
32.784848
89
0.605077
false
igor-rangel7l/novoigorrangel.repository
plugin.video.SportsDevil/service/oscrypto/_tls.py
7
16431
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import re from datetime import datetime from asn1crypto.util import int_from_bytes, timezone from asn1crypto.x509 import Certificate from ._cipher_suites import CIPHER_SUITE_MAP from .errors import TLSVerificationError...
gpl-2.0
-947,108,380,882,156,300
28.658845
119
0.62656
false
gjhiggins/sprox
tests/test_saormprovider.py
1
13417
from nose import SkipTest from sprox.sa.provider import SAORMProvider from sprox.test.base import setup_database, setup_records, SproxTest from sprox.test.model import * from sprox.sa.widgetselector import SAWidgetSelector import sqlalchemy from sqlalchemy.orm import mapper, lazyload from sqlalchemy import MetaData, Ta...
mit
-3,792,791,813,953,629,700
37.116477
118
0.627115
false
egabancho/invenio-upgrader
invenio_upgrader/upgrades/invenio_2015_03_03_tag_value.py
20
1475
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 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) any later...
gpl-2.0
7,757,908,716,480,854,000
27.921569
76
0.703051
false
wrouesnel/ansible
lib/ansible/modules/windows/win_say.py
47
4581
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk> # # This file is part of Ansible # # Ansible 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
-7,431,601,574,795,340,000
36.54918
148
0.699847
false
gistnetserv-uah/eTorii
eGA3/pycairo/test/pygame-test2.py
10
1075
#!/usr/bin/env python """demonstrate pycairo and pygame method1: use an intermediate Python array object """ import array import math import sys import cairo import pygame def draw(surface): x,y, radius = (250,250, 200) ctx = cairo.Context(surface) ctx.set_line_width(15) ctx.arc(x, y, radius, 0, 2.0 * math.p...
apache-2.0
29,851,236,537,646,216
20.938776
93
0.699535
false
johan/firebug
ibug/ibug.py
1
5421
from urlparse import urlparse from cgi import parse_qs from urllib import unquote import signal, thread, threading, time import BaseHTTPServer, SocketServer, mimetypes # ************************************************************************************************** # Globals global done, server, consoleCommand, p...
bsd-3-clause
-3,658,131,727,912,281,000
27.989305
100
0.528685
false
jonparrott/gcloud-python
ndb/tests/unit/test__datastore_types.py
4
2604
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
6,299,957,083,717,992,000
31.962025
74
0.650922
false
analyseuc3m/ANALYSE-v1
common/djangoapps/terrain/stubs/tests/test_edxnotes.py
23
11674
""" Unit tests for stub EdxNotes implementation. """ import urlparse import json import unittest import requests from uuid import uuid4 from ..edxnotes import StubEdxNotesService class StubEdxNotesServiceTest(unittest.TestCase): """ Test cases for the stub EdxNotes service. """ def setUp(self): ...
agpl-3.0
-4,122,736,713,362,680,000
32.739884
113
0.552596
false
jamesbowman/gd2-lib
scripts/arduino_listener.py
1
4016
import os import sys import serial import struct import array import time import binascii def crc(s): # CRC-32 of string s return binascii.crc32(s) & 0xffffffff from PIL import Image, ImageChops def fetch8(pix, x, y, ser): difference = ord(ser.read(1)) if (difference & 1) == 0: assert 0, "diffe...
bsd-3-clause
6,759,798,694,700,105,000
28.748148
114
0.448954
false
PodRepo/firefox-ios
scripts/mod_pbxproj.py
54
52734
# Copyright 2012 Calvin Rien # # 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 t...
mpl-2.0
3,609,326,871,863,563,000
32.207809
165
0.524159
false
NEricN/RobotCSimulator
Python/App/Lib/idlelib/idle_test/test_searchengine.py
23
11486
'''Test functions and SearchEngine class in SearchEngine.py.''' # With mock replacements, the module does not use any gui widgets. # The use of tk.Text is avoided (for now, until mock Text is improved) # by patching instances with an index function returning what is needed. # This works because mock Text.get does not ...
apache-2.0
7,220,321,287,922,094,000
33.911854
77
0.591938
false
gcode-mirror/audacity
lib-src/lv2/lv2/plugins/eg01-amp.lv2/waflib/Tools/d_config.py
316
1208
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file from waflib import Utils from waflib.Configure import conf @conf def d_platform_flags(self): v=self.env if not v.DEST_OS: v.DEST_OS=Utils.unversioned_sys_platform() binfm...
gpl-2.0
6,136,392,716,102,785,000
22.230769
113
0.665563
false
Collaborne/elasticsearch-lang-mvel
dev-tools/release.py
36
4636
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
apache-2.0
6,614,886,684,231,556,000
33.597015
98
0.684642
false
AndrewSmart/audacity
lib-src/lv2/lv2/plugins/eg02-midigate.lv2/waflib/Tools/suncc.py
134
1378
#! /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 from waflib import Utils from waflib.Tools import ccroot,ar from waflib.Configure import conf @conf def find_scc(conf): v=conf.env cc=None if v['CC']:cc=v['CC'] ...
gpl-2.0
9,187,299,413,726,664,000
25
102
0.630624
false
DDEFISHER/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/pastebin.py
181
3483
""" submit failure or test session information to a pastebin service. """ import pytest import sys import tempfile def pytest_addoption(parser): group = parser.getgroup("terminal reporting") group._addoption('--pastebin', metavar="mode", action='store', dest="pastebin", default=None, choices=[...
mpl-2.0
-4,044,360,465,762,021,400
36.858696
94
0.61671
false
kvar/ansible
lib/ansible/modules/cloud/vmware/vmware_dvswitch.py
23
33516
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2015, Joseph Callen <jcallen () csc.com> # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2018, Christian Kotte <christian.kotte@gmx.de> # Copyright: (c) 2018, Ansible Project # # GNU General Public License v3.0+ (see COPYING or ...
gpl-3.0
1,911,342,569,596,809,500
43.450928
147
0.607232
false
miguelparaiso/OdooAccessible
addons/resource/resource.py
174
42653
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP SA (http://www.openerp.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
663,908,722,671,961,100
50.204082
356
0.572785
false
1900/scrapy
scrapy/tests/test_spidermiddleware_httperror.py
27
1658
from unittest import TestCase from scrapy.http import Response, Request from scrapy.spider import BaseSpider from scrapy.contrib.spidermiddleware.httperror import HttpErrorMiddleware, HttpError class TestHttpErrorMiddleware(TestCase): def setUp(self): self.spider = BaseSpider('foo') self.mw = Ht...
bsd-3-clause
17,565,356,368,249,552
36.681818
84
0.633293
false
apple/llvm-project
lldb/test/API/commands/expression/static-initializers/TestStaticInitializers.py
4
1627
import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class StaticInitializers(TestBase): mydir = TestBase.compute_mydir(__file__) @expectedFailureAll(archs="aarch64", oslist=["freebsd", "linux"], bugnumber="https...
apache-2.0
6,708,324,698,669,003,000
41.815789
97
0.608482
false
3quarterstack/simple_blog
django/contrib/localflavor/fr/fr_department.py
109
3687
# -*- coding: utf-8 -*- # See the "Code officiel géographique" on the INSEE website <www.insee.fr>. from __future__ import unicode_literals DEPARTMENT_CHOICES = ( # Metropolitan departments ('01', '01 - Ain'), ('02', '02 - Aisne'), ('03', '03 - Allier'), ('04', '04 - Alpes-de-Haute-Provence'), ...
mit
3,290,664,759,149,638,000
29.974576
75
0.450342
false
benjaminrigaud/django
tests/model_package/tests.py
29
2538
from __future__ import unicode_literals from django.contrib.sites.models import Site from django.db import models from django.test import TestCase from .models.publication import Publication from .models.article import Article class Advertisement(models.Model): customer = models.CharField(max_length=100) pu...
bsd-3-clause
-1,821,689,080,465,235,000
35.782609
142
0.6513
false
barbarubra/Don-t-know-What-i-m-doing.
python/src/Lib/fnmatch.py
194
3019
"""Filename matching with shell patterns. fnmatch(FILENAME, PATTERN) matches according to the local convention. fnmatchcase(FILENAME, PATTERN) always takes case in account. The functions operate by translating the pattern into a regular expression. They cache the compiled regular expressions for speed. The function...
apache-2.0
8,081,781,147,840,733,000
27.214953
69
0.545876
false
Danfocus/Flexget
flexget/components/managed_lists/lists/pending_list/api.py
4
10945
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin import copy import logging from math import ceil from flask import jsonify, request from sqlalchemy.orm.exc import NoResultFound from flexget.api import api, APIResource from ...
mit
2,383,389,755,584,746,500
33.856688
99
0.617999
false
johscheuer/calico-docker
calico_containers/tests/unit/diags_test.py
6
8204
# Copyright 2015 Metaswitch Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
apache-2.0
-2,929,018,300,802,202,600
42.871658
94
0.601414
false
jack-pappas/PyTables
tables/tests/test_array.py
2
95560
# -*- coding: utf-8 -*- from __future__ import print_function import os import sys import tempfile import warnings import numpy from numpy import testing as npt import tables from tables import Atom, ClosedNodeError, NoSuchNodeError from tables.utils import byteorders from tables.tests import common from tables.te...
bsd-3-clause
-3,013,780,858,735,470,000
33.875912
79
0.54864
false
amousset/ansible
test/units/parsing/test_unquote.py
152
2073
# coding: utf-8 # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible 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 o...
gpl-3.0
5,151,145,714,288,270,000
34.741379
74
0.56054
false
linhvannguyen/PhDworks
codes/isotropic/regression/regressionUtils.py
2
10304
""" Created on Aug 02 2016 @author: Linh Van Nguyen (linh.van.nguyen@hotmail.com) """ import numpy as np from netCDF4 import Dataset def data_preprocess(sspacing, tspacing): """ Load coupled input-output of LR and HR from file and normalize to zero-mean and one- standard deviation Parameters ---...
mit
5,009,555,651,893,849,000
34.287671
112
0.596856
false
Palasekm/Kaira
gui/packages.py
1
1929
# # Copyright (C) 2012 Stanislav Bohm # # This file is part of Kaira. # # Kaira 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 3 of the License, or # (at your option) any later versi...
gpl-3.0
1,067,689,591,058,996,200
33.446429
81
0.662001
false
dhenrygithub/QGIS
python/ext-libs/pygments/styles/tango.py
363
7096
# -*- coding: utf-8 -*- """ pygments.styles.tango ~~~~~~~~~~~~~~~~~~~~~ The Crunchy default Style inspired from the color palette from the Tango Icon Theme Guidelines. http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines Butter: #fce94f #edd400 #c4a000 Orange: #fcaf3e ...
gpl-2.0
1,186,248,765,184,624,000
49.326241
83
0.488444
false
lisatn/workload-automation
wa/utils/revent.py
2
10678
# Copyright 2016-2018 ARM Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
apache-2.0
-6,562,240,591,078,289,000
33.224359
91
0.614816
false
CentOS-PaaS-SIG/linchpin
linchpin/provision/roles/azure/files/inventory.py
3
1647
from __future__ import absolute_import from collections import OrderedDict from linchpin.InventoryFilters.InventoryFilter import InventoryFilter class Inventory(InventoryFilter): # DEFAULT_HOSTNAMES = ['public_dns_name', 'public_ip', 'private_ip'] def get_host_data(self, res, cfgs): """ Retu...
gpl-3.0
3,086,659,757,921,486,300
39.170732
80
0.629022
false
MizzouCMMSGroup1/TFPyModeller
src/sa_v3.py
1
20979
'''current test sequence''' INPUT_SEQUENCE = '' '''fragment database''' DATABASE_NAME_NINE = 'fragment_database/17K_PDB_nine_sequences.db' DATABASE_NAME_THREE = 'fragment_database/17K_PDB_three_sequences.db' '''store working files in temp_out''' TMP_DIR = "temp_out/" #TESTING_SIGMOID = True TESTING_SIGMOID = False ...
gpl-2.0
463,570,063,217,689,100
36
563
0.596168
false
eikevons/yorik-photos
photos/upload.py
1
5164
## ## Copyright (c) 2014 Jan Eike von Seggern ## import os from os import path from shutil import copyfileobj, move, rmtree from multiprocessing.dummy import Pool from io import IOBase from hashlib import md5 from datetime import datetime from PIL import Image from . import photo_storage from .application import app...
mit
51,102,681,250,083,770
28.340909
114
0.584431
false
rbaindourov/v8-inspector
Source/chrome/tools/telemetry/telemetry/web_perf/metrics/rendering_frame.py
39
3109
# Copyright 2014 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. from collections import defaultdict from telemetry.timeline import bounds from telemetry.timeline import slice as slice_module class MissingData(Exception...
bsd-3-clause
1,928,638,905,560,208,000
35.151163
79
0.691541
false
saurabhjn76/sympy
sympy/physics/quantum/qexpr.py
75
14925
from __future__ import print_function, division from sympy import Expr, sympify, Symbol, Matrix from sympy.printing.pretty.stringpict import prettyForm from sympy.core.containers import Tuple from sympy.core.compatibility import is_sequence, string_types, u from sympy.physics.quantum.dagger import Dagger from sympy.p...
bsd-3-clause
-1,873,334,430,119,175,400
32.997722
97
0.572864
false
thraveboy/fbbs-release
SCRIPTS/crypto_volume_daemon_cloud.py
2
1247
import subprocess import string import fileinput import json import time import sys currencies = ['BTC', 'BCC', 'ETH', 'STRAT', 'XMR', 'OMG', 'LTH', 'GNT', 'WAVES','QTUM', 'PIVX', 'SC', 'NEO', 'LTC', 'DASH', 'PAY', 'GBYTE', 'FCT', 'ETC', 'XVG'] update_rate_mins = 5 if (len(sys.argv) > 1): update_rate_mins = int(flo...
gpl-3.0
-1,024,520,885,444,030,300
36.787879
160
0.635124
false
enisoc/vitess
py/vtproto/vtworkerservice_pb2.py
4
1956
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: vtworkerservice.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection a...
apache-2.0
2,236,883,933,403,722,200
32.724138
330
0.781186
false
ruohoruotsi/pyechonest
pyechonest/catalog.py
23
12786
#!/usr/bin/env python # encoding: utf-8 """ Copyright (c) 2010 The Echo Nest. All rights reserved. Created by Scotty Vercoe on 2010-08-25. The Catalog module loosely covers http://developer.echonest.com/docs/v4/catalog.html Refer to the official api documentation if you are unsure about something. """ try: import...
bsd-3-clause
5,745,844,429,381,595,000
29.661871
255
0.560926
false
cosenal/osf.io
scripts/googledrive/migrate_to_external_account.py
30
3090
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Script to migrate GoogleDrive credentials from user settings object to external account objects. Changes: - Create external account for authorized user settings - Attach external account to user settings - Attach external account to all node settings """ import sys...
apache-2.0
4,788,441,947,817,718,000
31.526316
149
0.647249
false
mavenlin/tensorflow
tensorflow/contrib/seq2seq/python/ops/loss.py
120
5411
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
3,831,496,261,871,530,500
46.052174
80
0.680466
false
Daniel-UCAS/dgCFD.jl
doc/source/conf.py
1
11646
# -*- coding: utf-8 -*- # # dgCFD.jl documentation build configuration file, created by # sphinx-quickstart on Thu Dec 01 08:43:04 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
mit
-7,313,756,819,962,294,000
30.73297
80
0.706938
false