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
michalliu/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python3.4/test/sample_doctest.py
203
1041
"""This is a sample module that doesn't really test anything all that interesting. It simply has a few tests, some of which succeed and some of which fail. It's important that the numbers remain constant as another test is testing the running of these tests. >>> 2+2 4 """ def foo(): """ >>> 2+2 5 ...
gpl-2.0
8,987,262,015,455,117,000
12.697368
72
0.413064
false
f0lie/refactoring_example
main_3.py
1
1401
class Point(): def __init__(self, y_pos=0, x_pos=0, y_velo=0, x_velo=0): self.x_pos = x_pos self.y_pos = y_pos self.x_velo = x_velo self.y_velo = y_velo def move(self): self.x_pos += self.x_velo self.y_pos += self.y_velo def bounce(self, grid_size): ...
mit
-7,986,185,932,460,895,000
24.944444
61
0.486795
false
kartoza/stream_feature_extractor
third_party/raven/transport/threaded.py
25
2911
""" raven.transport.threaded ~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import atexit import time import threading import os from Queue import Queue from raven.transport.base import HTTPTransport DEFAULT_TIMEOUT = ...
gpl-2.0
-5,260,510,989,457,467,000
27.262136
81
0.563724
false
youdonghai/intellij-community
platform/platform-resources/src/launcher.py
1
2968
#!/usr/bin/env python # -*- coding: utf-8 -*- import socket import struct import sys import os import time # see com.intellij.idea.SocketLock for the server side of this interface RUN_PATH = u'$RUN_PATH$' CONFIG_PATH = u'$CONFIG_PATH$' SYSTEM_PATH = u'$SYSTEM_PATH$' def print_usage(cmd): print(('Usage:\n' + ...
apache-2.0
-4,489,819,201,725,053,400
26.481481
80
0.516509
false
prasadtalasila/IRCLogParser
lib/nickTracker.py
1
6860
import re import lib.config as config import lib.util as util from datetime import date def nick_tracker(log_dict, track_users_on_channels = False): """ Tracks all nicks and the identifies nicks which point to same user Args: log_dict(dictionary): with key as dateTime.date object and value as...
gpl-3.0
2,599,685,958,955,669,500
42.417722
150
0.510204
false
okanokumus/Programming
Python/IntroductionPython/binaryTOdecimal.py
1
1842
# binary to decimal and vice versa def choice(): ch = input("press 1 : binary to decimal\n" "press 2 : decimal to binary\n" ": ") if ch == '1': print("binary to decimal converion") number = int(input("enter your number that you want to convert decimal: ")) ...
gpl-3.0
-7,880,722,685,026,575,000
24.957746
83
0.538002
false
noironetworks/neutron
neutron/tests/unit/privileged/agent/linux/test_netlink_lib.py
2
16397
# Copyright (c) 2017 Fujitsu Limited # 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 requi...
apache-2.0
7,499,773,149,813,107,000
46.944444
78
0.493932
false
kkoci/orthosie
register/models.py
1
10309
# Copyright 2013 Jack David Baucum # # This file is part of Orthosie. # # Orthosie 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-3.0
-3,347,867,905,468,694,500
31.115265
76
0.580658
false
seansu4you87/kupo
projects/molt/venv/lib/python2.7/site-packages/pip/_vendor/html5lib/sanitizer.py
180
17804
from __future__ import absolute_import, division, unicode_literals import re from xml.sax.saxutils import escape, unescape from six.moves import urllib_parse as urlparse from .tokenizer import HTMLTokenizer from .constants import tokenTypes content_type_rgx = re.compile(r''' ^ ...
mit
6,561,978,090,801,701,000
58.346667
146
0.474332
false
giruenf/GRIPy
algo/rockphysics/ElasticParameters.py
1
1768
from Algo import KusterToksoz as KT from numpy import sqrt def Misat(Vs, Dens): mis = Vs * Vs * Dens return mis def Ksat(Vp, Vs, Dens): Ks = Dens * (Vp * Vp - 4.0 * Vs * Vs / 3.0) return Ks def Dens(Densm, Densf, phi): dens = (Densm * (1 - phi) + Densf * phi) return dens def Kdry(Ksat, K...
apache-2.0
77,667,880,583,515,860
22.891892
111
0.519796
false
erbridge/NQr
src/util.py
1
16879
# Utility functions and classes import configparser import copy import datetime import logging import os.path import platform import queue import threading import traceback #import wxversion # wxversion.select([x for x in wxversion.getInstalled() # if x.find('unicode') != -1]) #import wx import erro...
bsd-3-clause
-4,134,997,060,058,946,000
29.522604
86
0.586468
false
ntt-sic/cinder
cinder/db/sqlalchemy/migrate_repo/versions/016_drop_sm_tables.py
3
3415
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
apache-2.0
-6,736,414,913,937,985,000
31.836538
78
0.610835
false
spiceqa/virt-test
qemu/tests/timedrift_with_migration.py
3
4546
import logging from autotest.client.shared import error from virttest import utils_test def run_timedrift_with_migration(test, params, env): """ Time drift test with migration: 1) Log into a guest. 2) Take a time reading from the guest and host. 3) Migrate the guest. 4) Take a second time rea...
gpl-2.0
2,859,244,033,125,574,000
40.706422
77
0.557853
false
cernops/keystone
keystone/common/router.py
5
3280
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
-6,326,092,922,791,714,000
39
77
0.606402
false
ibamacsr/painelmma_api
painel_api/settings/production.py
1
2521
# -*- coding: utf-8 -*- """Production settings and globals.""" from __future__ import absolute_import from os import environ from .base import * # Normally you should not import ANYTHING from Django directly # into your settings, but ImproperlyConfigured is an exception. from django.core.exceptions import Improperl...
mit
2,407,697,519,199,250,000
32.626667
95
0.710036
false
dankilman/claw
claw/tests/commands/test_generate.py
1
9306
######## # Copyright (c) 2015 GigaSpaces Technologies Ltd. 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...
apache-2.0
8,259,095,352,219,959,000
41.3
102
0.62637
false
mikewiebe-ansible/ansible
lib/ansible/modules/cloud/rackspace/rax_mon_check.py
77
10762
#!/usr/bin/python # Copyright: Ansible Project # 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', 'status': ['preview'], ...
gpl-3.0
-496,628,287,261,463,700
33.828479
96
0.59422
false
grandtiger/profitpy
profit/lib/widgets/callableselectwidget.py
18
10034
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2007 Troy Melhase <troy@gci.net> # Distributed under the terms of the GNU General Public License v2 ## TODO: match warning to location label ## TODO: fix enable/disable on change ## TODO: streamline ## TODO: provide valid marker on source edit emit import...
gpl-2.0
662,344,005,707,446,800
31.472492
86
0.613514
false
openfun/edx-platform
lms/djangoapps/notification_prefs/views.py
163
7387
from base64 import urlsafe_b64encode, urlsafe_b64decode from hashlib import sha256 import json from Crypto.Cipher import AES from Crypto import Random from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import PermissionDenied from django.http import Http404, HttpRe...
agpl-3.0
-4,342,683,930,429,482,000
36.308081
113
0.688913
false
Signbank/Auslan-signbank
signbank/dictionary/urls.py
1
2232
from django.conf.urls import * from django.contrib.auth.decorators import login_required, permission_required from signbank.dictionary.models import * from signbank.dictionary.forms import * from signbank.dictionary.adminviews import GlossListView, GlossDetailView urlpatterns = patterns('', # index page is jus...
bsd-3-clause
2,868,584,881,710,692,400
48.6
131
0.689964
false
yaseppochi/mailman
src/mailman/database/types.py
4
2401
# Copyright (C) 2007-2015 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
gpl-3.0
-1,007,118,387,581,552,500
25.977528
78
0.645564
false
Gateworks/platform-external-chromium_org
net/tools/testserver/asn1.py
180
3751
# Copyright (c) 2012 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 file implements very minimal ASN.1, DER serialization. import types def ToDER(obj): '''ToDER converts the given object into DER encoding''' ...
bsd-3-clause
1,553,558,652,068,082,000
21.733333
72
0.618502
false
fangxingli/hue
desktop/core/ext-py/cryptography-1.3.1/src/_cffi_src/commoncrypto/common_cryptor.py
10
2711
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function INCLUDES = """ #include <CommonCrypto/CommonCryptor.h> """ TYPES = """ e...
apache-2.0
5,020,691,427,544,184,000
26.383838
79
0.639985
false
serverdensity/sd-agent-core-plugins
riak/test_riak.py
1
14008
# (C) Datadog, Inc. 2010-2017 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib import socket # 3p from nose.plugins.attrib import attr # project from tests.checks.common import AgentCheckTest @attr(requires='riak') class RiakTestCase(AgentCheckTest): CHECK_NAME = 'riak' ...
bsd-3-clause
4,726,141,941,883,877,000
36.655914
85
0.586808
false
cloudRoutine/curveship
input_model.py
3
4432
'Represent different user inputs (commands, directives, unrecognized).' __author__ = 'Nick Montfort' __copyright__ = 'Copyright 2011 Nick Montfort' __license__ = 'ISC' __version__ = '0.5.0.0' __status__ = 'Development' class RichInput(object): 'Encapsulates a user input string and information derived from it.' ...
isc
9,055,750,837,904,935,000
34.741935
80
0.587094
false
DenL/pogom-webhook
pogom/pgoapi/protos/POGOProtos/Networking/Requests/Messages/SetContactSettingsMessage_pb2.py
16
2901
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Requests/Messages/SetContactSettingsMessage.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...
mit
-6,154,492,472,099,627,000
39.291667
331
0.785936
false
averagesecurityguy/AWSlab
aws/securitygroup.py
1
4560
# -*- coding: utf-8 -*- # # Copyright (c) 2013, LCI Technology Group # 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, thi...
bsd-3-clause
7,096,107,437,182,673,000
40.081081
78
0.629167
false
campbe13/openhatch
vendor/packages/twisted/doc/core/benchmarks/tpclient.py
22
1273
"""Throughput test.""" import time, sys from twisted.internet import reactor, protocol from twisted.python import log TIMES = 10000 S = "0123456789" * 1240 toReceive = len(S) * TIMES class Sender(protocol.Protocol): def connectionMade(self): start() self.numSent = 0 self.received = 0 ...
agpl-3.0
2,749,265,097,708,963,300
20.216667
76
0.625295
false
halostatue/ansible
lib/ansible/plugins/filter/mathstuff.py
81
4025
# (c) 2014, Brian Coca <bcoca@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 option) any later version....
gpl-3.0
-4,237,237,537,038,898,700
24.967742
90
0.56795
false
ahmadiga/min_edx
common/lib/xmodule/setup.py
72
3491
from setuptools import setup, find_packages XMODULES = [ "abtest = xmodule.abtest_module:ABTestDescriptor", "book = xmodule.backcompat_module:TranslateCustomTagDescriptor", "chapter = xmodule.seq_module:SequenceDescriptor", "combinedopenended = xmodule.combined_open_ended_module:CombinedOpenEndedDescri...
agpl-3.0
-6,598,795,732,719,916,000
44.337662
89
0.728445
false
ackalker/ocrfeeder
src/ocrfeeder/studio/dataHolder.py
1
8231
# -*- coding: utf-8 -*- ########################################################################### # OCRFeeder - The complete OCR suite # Copyright (C) 2009 Joaquim Rocha # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publ...
gpl-3.0
6,019,956,183,602,680,000
33.439331
157
0.58547
false
michael-ball/sublime-text
sublime-text-3/Packages/Python PEP8 Autoformat/libs/py26/lib2to3/refactor.py
7
24179
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Refactoring framework. Used as a main program, this can refactor any number of files and/or recursively descend down directories. Imported as a module, this provides infrastructure to write your own refactoring too...
unlicense
6,341,978,478,236,025,000
35.579425
80
0.553331
false
tuhangdi/django
tests/gis_tests/test_geoip.py
75
6731
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import socket import unittest import warnings from unittest import skipUnless from django.conf import settings from django.contrib.gis.geoip import HAS_GEOIP from django.contrib.gis.geos import HAS_GEOS, GEOSGeometry from django.test import ign...
bsd-3-clause
-3,415,868,623,300,111,400
38.582353
113
0.602021
false
pra85/calibre
src/calibre/ebooks/docx/toc.py
6
4783
#!/usr/bin/env python # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' from collections import namedtuple from lxml.etree import tostring from cal...
gpl-3.0
-4,126,955,244,019,222,000
32.683099
123
0.544428
false
mruddy/bitcoin
test/functional/feature_loadblock.py
11
3583
#!/usr/bin/env python3 # Copyright (c) 2017-2020 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 loadblock option Test the option to start a node with the option loadblock which loads a serializ...
mit
1,837,921,255,972,802,600
42.168675
116
0.632989
false
anryko/ansible
lib/ansible/modules/cloud/packet/packet_sshkey.py
21
8829
#!/usr/bin/python # Copyright 2016 Tomas Karasek <tom.to.the.k@gmail.com> # 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
1,285,886,060,093,992,200
32.067416
619
0.602786
false
AutorestCI/azure-sdk-for-python
azure-mgmt-datafactory/azure/mgmt/datafactory/models/service_now_object_dataset.py
1
1845
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
1,494,876,320,862,561,500
41.906977
208
0.675339
false
aferr/LatticeMemCtl
tests/long/se/60.bzip2/test.py
21
1751
# Copyright (c) 2006-2007 The Regents of The University of Michigan # 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 ...
bsd-3-clause
-8,600,902,637,328,058,000
52.060606
72
0.792119
false
tersmitten/ansible
lib/ansible/module_utils/facts/network/fc_wwn.py
66
3450
# Fibre Channel WWN initiator related facts collection for ansible. # # 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
-8,351,183,817,439,886,000
40.566265
87
0.564058
false
wyom/sympy
sympy/polys/agca/tests/test_homomorphisms.py
121
4182
"""Tests for homomorphisms.""" from sympy import QQ, S from sympy.abc import x, y from sympy.polys.agca import homomorphism from sympy.utilities.pytest import raises def test_printing(): R = QQ.old_poly_ring(x) assert str(homomorphism(R.free_module(1), R.free_module(1), [0])) == \ 'Matrix([[0]]) : Q...
bsd-3-clause
-374,357,407,132,227,400
36.339286
106
0.556671
false
mce35/agocontrol
devices/wifi370/agowifi370.py
2
3556
#!/usr/bin/env python import socket import agoclient client = agoclient.AgoConnection("wifi370") COMMAND_ON="\xcc\x23\x33" COMMAND_OFF="\xcc\x24\x33" # COMMAND_RGB="\x56\xRR\xGG\xBB\xaa" COMMAND_STATUS="\xef\x01\x77" try: deviceconfig = agoclient.get_config_option("wifi370", "devices", "192.168.80.44:5577") device...
gpl-3.0
-711,919,692,392,530,000
30.75
115
0.651294
false
Teamxrtc/webrtc-streaming-node
third_party/depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/oauth2client/tests/test_gce.py
17
3904
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
mit
-4,692,689,897,760,770,000
35.148148
77
0.688525
false
GaetanCambier/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/youku.py
36
3928
# coding: utf-8 from __future__ import unicode_literals import math import random import re import time from .common import InfoExtractor from ..utils import ( ExtractorError, ) class YoukuIE(InfoExtractor): _VALID_URL = r'''(?x) (?: http://(?:v|player)\.youku\.com/(?:v_show/id_|player\...
gpl-3.0
3,805,568,017,442,996,000
30.886179
132
0.519633
false
vladmm/intellij-community
plugins/hg4idea/testData/bin/mercurial/httppeer.py
93
9303
# httppeer.py - HTTP repository proxy classes for mercurial # # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from node i...
apache-2.0
-1,644,559,089,728,968,000
36.361446
79
0.543803
false
dreamsxin/kbengine
kbe/res/scripts/common/Lib/sqlite3/test/transactions.py
93
7338
#-*- coding: iso-8859-1 -*- # pysqlite2/test/transactions.py: tests transactions # # Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages #...
lgpl-3.0
4,675,767,428,572,438,000
34.970588
76
0.627419
false
Nikoli/youtube-dl
youtube_dl/extractor/mgoon.py
177
2695
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, qualities, unified_strdate, ) class MgoonIE(InfoExtractor): _VALID_URL = r'''(?x)https?://(?:www\.)? (?:(:?m\.)?mgoon\.com/(?:ch/(?:.+)/v|play/view)| ...
unlicense
-6,450,704,017,926,732,000
29.977011
76
0.484972
false
liangwang/m5
src/mem/slicc/ast/ExprStatementAST.py
33
2360
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
bsd-3-clause
157,948,333,847,879,520
46.2
72
0.736864
false
tvibliani/odoo
addons/base_action_rule/__openerp__.py
260
1896
# -*- 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
8,755,523,832,960,258,000
38.5
85
0.606013
false
mguzdial3/MineCode
python-codec/src/tests/test_message_agent.py
2
1608
# # Copyright (C) 2008, Brian Tanner # #http://rl-glue-ext.googlecode.com/ # # 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 requ...
apache-2.0
6,792,248,318,820,759,000
23.753846
113
0.723259
false
sallaire/Sick-Beard
sickbeard/traktWatchListChecker.py
30
6994
# Author: Frank Fenton # 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 License, or # (at y...
gpl-3.0
7,524,984,168,435,865,000
43.547771
223
0.610523
false
snnn/tensorflow
tensorflow/python/estimator/estimator_lib.py
20
2867
# 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,025,838,657,322,849,000
55.215686
94
0.819323
false
mx3L/enigma2
lib/python/Screens/Satconfig.py
12
36944
from enigma import eDVBDB from Screen import Screen from Components.SystemInfo import SystemInfo from Components.ActionMap import ActionMap from Components.ConfigList import ConfigListScreen from Components.MenuList import MenuList from Components.NimManager import nimmanager from Components.Button import Button from C...
gpl-2.0
7,692,497,881,825,074,000
47.867725
234
0.711482
false
bbbbanjax/CloudBot
plugins/pagecheck.py
35
1515
import urllib.parse from bs4 import BeautifulSoup import requests import requests.exceptions from cloudbot import hook @hook.command("down", "offline", "up") def down(text): """<url> - checks if <url> is online or offline :type text: str """ if "://" not in text: text = 'http://' + text ...
gpl-3.0
4,268,088,696,497,917,000
25.578947
89
0.630363
false
dharamgollapudi/jaikuengine
blob/views.py
34
1380
# Copyright 2009 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
1,631,513,481,803,996,400
31.093023
91
0.754348
false
dashmug/saleor
saleor/checkout/test_checkout.py
10
3047
from django.contrib.auth.models import AnonymousUser from django.test import TestCase from mock import MagicMock, patch from . import BillingAddressStep, ShippingStep from ..checkout import STORAGE_SESSION_KEY from ..checkout.steps import BaseAddressStep from ..userprofile.models import Address NEW_ADDRESS = { 'f...
bsd-3-clause
-8,608,106,544,346,791,000
31.073684
64
0.657368
false
orokusaki/django-jsonrpc-2-0
jsonrpc/encoders.py
1
1281
import json import decimal from datetime import datetime, date, time from django.db import models from django.db.models.query import QuerySet from django.core.serializers import serialize from django.utils.functional import Promise from django.utils.encoding import force_unicode class RobustEncoder(json.J...
bsd-2-clause
6,459,798,191,249,457,000
31.710526
74
0.626854
false
dmwu/sparrow
deploy/third_party/boto-2.1.1/boto/rds/parametergroup.py
19
7114
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
apache-2.0
-5,313,646,161,199,558,000
34.393035
86
0.578718
false
google-code-export/marinemap
lingcod/straightline_spacing/models.py
3
3107
from django.contrib.gis.db import models from django.conf import settings from django.contrib.gis.measure import A, D from lingcod.unit_converter.models import length_in_display_units, area_in_display_units class SpacingPoint(models.Model): name = models.CharField(max_length=200) geometry = models.PointField(s...
bsd-3-clause
-1,953,375,506,217,635,600
33.533333
95
0.643708
false
foursquare/commons-old
tests/python/twitter/common/config/properties_test.py
15
2563
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
-8,713,225,997,573,806,000
27.797753
100
0.531799
false
mcking49/apache-flask
Python/Lib/test/test_math.py
45
44490
# Python test set -- math module # XXXX Should not do tests around zero only from test.test_support import run_unittest, verbose import unittest import math import os import sys import random import struct eps = 1E-05 NAN = float('nan') INF = float('inf') NINF = float('-inf') # decorator for skipping tests on non-IE...
mit
-4,898,217,267,899,688,000
41.985507
99
0.563835
false
zwizwa/qemu
scripts/analyse-9p-simpletrace.py
333
9058
#!/usr/bin/env python # Pretty print 9p simpletrace log # Usage: ./analyse-9p-simpletrace <trace-events> <trace-pid> # # Author: Harsh Prateek Bora import os import simpletrace symbol_9p = { 6 : 'TLERROR', 7 : 'RLERROR', 8 : 'TSTATFS', 9 : 'RSTATFS', 12 : 'TLOPEN', 13 : 'RLOPEN', ...
gpl-2.0
-6,633,615,411,541,401,000
41.525822
141
0.493818
false
Pikecillo/genna
genna/uml/element.py
1
14453
##====================================================================== ## ## Copyright (C) 2007. Mario Rincon Nigro. ## Universidad de Los Andes. ## ## This file is part of Genna. ## ## Genna is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published b...
gpl-2.0
1,677,624,334,746,109,200
26.687739
81
0.585622
false
naparuba/kunai
data/global-configuration/packs/mongodb/collectors/bson/int64.py
69
1056
# Copyright 2014-2015 MongoDB, 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 writin...
mit
408,181,045,718,570,750
30.058824
74
0.727273
false
rainbowintheshell/gnome-dvb-daemon
client/gnomedvb/ui/timers/EditTimersDialog.py
3
11742
# -*- coding: utf-8 -*- # Copyright (C) 2008,2009 Sebastian Pölsterl # # This file is part of GNOME DVB Daemon. # # GNOME DVB Daemon 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,681,535,013,441,063,400
41.233813
102
0.62303
false
jpshort/odoo
comunity_modules/account_financial_report_webkit_xls/report/partners_balance_xls.py
25
20947
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under...
agpl-3.0
6,691,709,105,635,673,000
47.713953
79
0.488566
false
jgillis/casadi
examples/python/simple_nlp.py
1
1773
# # This file is part of CasADi. # # CasADi -- A symbolic framework for dynamic optimization. # Copyright (C) 2010 by Joel Andersson, Moritz Diehl, K.U.Leuven. All rights reserved. # # CasADi is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Pub...
lgpl-3.0
7,719,939,504,929,159,000
30.105263
90
0.694303
false
acecheese/CloudBot
plugins/youtube.py
16
5563
import re import time import isodate import requests from cloudbot import hook from cloudbot.util import timeformat from cloudbot.util.formatting import pluralize youtube_re = re.compile(r'(?:youtube.*?(?:v=|/v/)|youtu\.be/|yooouuutuuube.*?id=)([-_a-zA-Z0-9]+)', re.I) base_url = 'https://www.googleapis.com/youtube...
gpl-3.0
-1,163,523,644,678,789,000
32.113095
106
0.602553
false
laperry1/android_external_chromium_org
tools/profile_chrome/chrome_controller_unittest.py
76
1395
# 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. import os import json from profile_chrome import chrome_controller from profile_chrome import controllers_unittest class ChromeControllerTest(controllers_...
bsd-3-clause
5,075,558,531,391,990,000
29.326087
77
0.621505
false
jnvsor/apgtk
subcommand.py
1
3790
import subprocess from errorwindow import ErrorDialogue class ModeError(Exception): pass class ProcessStderr(ChildProcessError): def __init__(self, value): self.value = value class CommandExecution: def __init__(self, binder): self.input = binder def execute(self): try: ...
gpl-3.0
8,023,883,895,480,488,000
35.796117
97
0.507916
false
newville/scikit-image
doc/examples/plot_rag.py
25
2139
""" ======================= Region Adjacency Graphs ======================= This example demonstrates the use of the `merge_nodes` function of a Region Adjacency Graph (RAG). The `RAG` class represents a undirected weighted graph which inherits from `networkx.graph` class. When a new node is formed by merging two node...
bsd-3-clause
-6,619,328,462,611,725,000
25.407407
78
0.642356
false
astrofrog/ginga
ginga/gtkw/plugins/Pan.py
1
10531
# # Pan.py -- Pan plugin for fits viewer # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import math import gtk from ginga.misc import Bunch from ginga.gtkw import F...
bsd-3-clause
-364,088,004,216,228,030
35.065068
86
0.582471
false
dankilman/pysource
docs/conf.py
1
8198
# -*- coding: utf-8 -*- # # pysource documentation build configuration file, created by # sphinx-quickstart on Mon May 19 02:06:17 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
apache-2.0
-4,541,019,453,980,385,000
30.409962
79
0.706636
false
ShyamSS-95/Bolt
bolt/lib/nonlinear/tests/test_convert.py
1
2702
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ The code needs to handle uptil 5D phase space. However, ArrayFire sets a hard limit on the dimensionality of the array to be 4. To surpass this, we internally use 2 different forms in which the array can be stored: - q_expanded - shape:(Nq1, Nq2, Np1 * Np2 * Np3) - p...
gpl-3.0
-6,946,398,040,758,485,000
31.166667
81
0.526647
false
katakumpo/nicepy
nicepy/decorators/wrap.py
1
1281
# -*- coding: utf-8 *-* import inspect __all__ = ['wrap_decorator'] class wrap_decorator(object): """ Writing wrappers for instance methods can be a pain in the ass, so maybe this will grow into some helper which can deal with all kinds functions, methods, classmethods some day. For now it's the base...
mit
8,721,247,987,084,501,000
28.790698
96
0.583919
false
hoettges/QKan
qkan/config.py
1
13375
import enum import json import logging import os import site import warnings from pathlib import Path from typing import Any, Dict from qkan import enums log = logging.getLogger("QKan.config") class ConfigEncoder(json.JSONEncoder): def default(self, o: Any) -> Any: if isinstance(o, enum.Enum): ...
gpl-3.0
-6,488,354,546,412,759,000
33.251282
115
0.573888
false
hub-cap/lady-rainicorn
rainicorn/openstack/common/pastedeploy.py
1
5020
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Red Hat, 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 # #...
apache-2.0
109,356,094,651,707,520
29.609756
79
0.663745
false
lgarren/spack
var/spack/repos/builtin/packages/r-raster/package.py
3
1767
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
-1,315,891,214,273,792,300
44.307692
78
0.67459
false
pglass/locust
locust/clients.py
3
11446
import re import time from datetime import timedelta from urlparse import urlparse, urlunparse import requests from requests import Response, Request from requests.auth import HTTPBasicAuth from requests.exceptions import (RequestException, MissingSchema, InvalidSchema, InvalidURL) import events from exception im...
mit
-3,802,828,743,413,156,400
45.718367
147
0.626158
false
mugizico/scikit-learn
sklearn/decomposition/tests/test_sparse_pca.py
142
5990
# Author: Vlad Niculae # License: BSD 3 clause import sys import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import SkipTest from sklearn.utils.testing import ass...
bsd-3-clause
7,408,535,622,196,023,000
35.975309
79
0.631386
false
hoangt/tpzsimul.gem5
tests/quick/se/02.insttest/test.py
56
1707
# Copyright (c) 2007 The Regents of The University of Michigan # 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 ...
bsd-3-clause
4,241,504,247,360,598,500
55.9
75
0.771529
false
tensorflow/tfx
tfx/orchestration/launcher/base_component_launcher_test.py
1
3244
# Lint as: python2, python3 # Copyright 2019 Google LLC. 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 req...
apache-2.0
3,083,691,043,814,203,400
35.044444
90
0.725339
false
pinterest/pinball
tests/pinball_ext/executor/local_executor_test.py
6
2315
# Copyright 2015, Pinterest, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
-5,011,291,462,432,825,000
35.171875
77
0.607775
false
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/spyderlib/utils/external/rope/refactor/rename.py
32
9365
import warnings from rope.base import exceptions, pyobjects, pynames, taskhandle, evaluate, worder, codeanalyze from rope.base.change import ChangeSet, ChangeContents, MoveResource from rope.refactor import occurrences, sourceutils class Rename(object): """A class for performing rename refactoring It can re...
gpl-3.0
-7,127,471,243,206,957,000
42.356481
95
0.616444
false
deepsrijit1105/edx-platform
cms/djangoapps/contentstore/context_processors.py
25
1051
""" Django Template Context Processor for CMS Online Contextual Help """ import ConfigParser from django.conf import settings from util.help_context_processor import common_doc_url # Open and parse the configuration file when the module is initialized CONFIG_FILE = open(settings.REPO_ROOT / "docs" / "cms_config.ini"...
agpl-3.0
6,904,942,254,205,210,000
36.535714
111
0.747859
false
ybellavance/python-for-android
python3-alpha/python3-src/PCbuild/build_tkinter.py
47
2336
"""Script to compile the dependencies of _tkinter Copyright (c) 2007 by Christian Heimes <christian@cheimes.de> Licensed to PSF under a Contributor Agreement. """ import os import sys here = os.path.abspath(os.path.dirname(__file__)) par = os.path.pardir TCL = "tcl8.5.9" TK = "tk8.5.9" TIX = "tix-8.4.3.x" ROOT = ...
apache-2.0
1,626,970,215,531,631,000
27.487805
97
0.595034
false
ClearCorp/odoo-clearcorp
TODO-8.0/cash_flow_report/cash_flow_type.py
3
1791
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
agpl-3.0
2,540,954,395,163,718,000
35.55102
93
0.568398
false
acshi/osf.io
scripts/migrate_comment_root_target.py
11
3794
"""Comment.root_target should always point to a Guid. A few comments on production were missed by a migration and point to TrashedFileNodes and restored StoredFileNodes instead. This migration points the root_target to the Guids for those TrashedFileNodes. """ import logging import sys from modularodm import Q from mo...
apache-2.0
-1,431,558,810,954,031,900
38.520833
119
0.601476
false
kvar/ansible
test/units/modules/network/fortios/test_fortios_router_access_list6.py
21
7717
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
gpl-3.0
-3,624,546,421,168,643,600
34.237443
142
0.666321
false
tambetm/neon
neon/datasets/mnist.py
3
6299
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana 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.o...
apache-2.0
1,062,253,041,905,887,400
40.440789
78
0.546595
false
noamelf/Open-Knesset
video/management/commands/sub_commands/UpdateMembersRelatedVideos.py
14
3347
# encoding: utf-8 from video.management.commands.sub_commands import SubCommand from video.utils.youtube import GetYoutubeVideos from mks.models import Member from video.utils.parse_dict import validate_dict from video.utils import get_videos_queryset from video.models import Video class UpdateMembersRelatedVideos(Su...
bsd-3-clause
2,349,121,202,247,876,600
37.034091
101
0.593367
false
chaluemwut/fbserver
venv/lib/python2.7/site-packages/scipy/fftpack/benchmarks/bench_pseudo_diffs.py
18
6191
""" Benchmark functions for fftpack.pseudo_diffs module """ from __future__ import division, print_function, absolute_import import sys from numpy import arange, sin, cos, pi, exp, tanh, sign from numpy.testing import * from scipy.fftpack import diff, fft, ifft, tilbert, hilbert, shift, fftfreq def random(size): ...
apache-2.0
-1,655,156,450,243,035,400
31.244792
77
0.411727
false
cdfassnacht/CodeCDF
python/plot_grade_hist.py
1
2880
""" A python program to plot a grade histogram Usage: python plot_grade_hist.py [filename] [colname] [maxy] ([nscorecols]) Required inputs: filename - text file containing either two columns (name total) or three columns (name, score_multiple-choice, score_short-answer) colname - the name of th...
mit
-1,639,162,633,062,033,200
37.918919
81
0.65625
false
deerwalk/voltdb
tests/sqlcoverage/config/joined-matview-config.py
2
2330
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2017 VoltDB Inc. # # 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 limitati...
agpl-3.0
-3,174,515,888,972,717,600
53.186047
82
0.622318
false
irvingprog/python-pilas-experimental
pilasengine/lanas/deslizador.py
1
1568
# -*- encoding: utf-8 -*- # pilas engine: un motor para hacer videojuegos # # Copyright 2010-2014 - Hugo Ruscitti # License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html) # # Website - http://www.pilas-engine.com.ar from PyQt4 import QtGui from PyQt4 import QtCore class Deslizador(QtGui.QWidget): def __init...
lgpl-3.0
763,612,369,159,905,900
29.173077
77
0.649235
false
caseyrollins/osf.io
api_tests/comments/views/test_comment_report_list.py
17
17901
from django.utils import timezone import mock import pytest from addons.wiki.tests.factories import WikiFactory from api.base.settings.defaults import API_BASE from api_tests import utils as test_utils from osf.models import Guid from osf_tests.factories import ( ProjectFactory, AuthUserFactory, CommentFac...
apache-2.0
359,544,067,760,302,850
34.588469
100
0.592928
false
yury-s/v8-inspector
Source/chrome/tools/json_schema_compiler/util_cc_helper.py
31
1498
# Copyright (c) 2012 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. _API_UTIL_NAMESPACE = 'json_schema_compiler::util' class UtilCCHelper(object): """A util class that generates code that uses tools/json_schema_comp...
bsd-3-clause
-5,492,612,652,752,602,000
34.666667
80
0.6749
false
hajgato/easybuild-easyblocks
easybuild/easyblocks/l/libsmm.py
3
8295
## # Copyright 2009-2013 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
gpl-2.0
-25,650,484,266,898,956
37.943662
123
0.644726
false
chaiken/irq-tracing
tools/perf/scripts/python/call-graph-from-postgresql.py
758
11125
#!/usr/bin/python2 # call-graph-from-postgresql.py: create call-graph from postgresql database # Copyright (c) 2014, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free So...
gpl-2.0
-7,159,236,857,663,779,000
33.021407
189
0.640809
false
pyrocko/pyrocko
src/io/resp.py
1
17240
# http://pyrocko.org - GPLv3 # # The Pyrocko Developers, 21st Century # ---|P------/S----------~Lg---------- from __future__ import absolute_import, division, print_function import time import re import logging from pyrocko import util, guts from pyrocko.io import io_common from pyrocko.io import stationxml as sxml ...
gpl-3.0
-6,632,072,505,615,891,000
27.685524
79
0.560731
false
LittleLama/Sick-Beard-BoxCar2
lib/hachoir_metadata/register.py
90
7003
from lib.hachoir_core.i18n import _ from lib.hachoir_core.tools import ( humanDuration, humanBitRate, humanFrequency, humanBitSize, humanFilesize, humanDatetime) from lib.hachoir_core.language import Language from lib.hachoir_metadata.filter import Filter, NumberFilter, DATETIME_FILTER from datetime import ...
gpl-3.0
-8,764,197,816,810,504,000
61.526786
172
0.680708
false