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
vrenaville/OCB
addons/gamification/models/res_users.py
386
4010
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
agpl-3.0
6,870,430,076,866,066,000
47.313253
148
0.604988
false
ampax/edx-platform-backup
lms/djangoapps/courseware/tests/test_courses.py
12
9342
# -*- coding: utf-8 -*- """ Tests for course access """ from django.conf import settings from django.test.utils import override_settings import mock from opaque_keys.edx.locations import SlashSeparatedCourseKey from courseware.courses import ( get_course_by_id, get_cms_course_link, course_image_url, get_course...
agpl-3.0
-4,553,840,785,112,280,000
41.853211
112
0.676622
false
hickerson/bbn
fable/fable_sources/libtbx/utils.py
1
43577
from __future__ import division from libtbx.queuing_system_utils import sge_utils, pbs_utils from libtbx.str_utils import show_string try: import gzip except ImportError: gzip = None try: import bz2 except ImportError: bz2 = None try: import hashlib hashlib_md5 = hashlib.md5 except ImportError: import md5 hashl...
mit
215,904,346,378,941,440
29.949574
82
0.625055
false
ptphp/PyLib
src/tornado/demos/Vulpix-master/handlers.py
2
1560
# -*- coding: utf-8 -*- # AUTHOR: Zeray Rice <fanzeyi1994@gmail.com> # FILE: handlers.py # CREATED: 01:41:06 08/03/2012 # MODIFIED: 20:28:26 18/04/2012 # DESCRIPTION: URL Route from api import * from home import * from lang import * from forum import * from member import * from problem import * from contest import * ...
apache-2.0
5,842,432,996,212,796,000
30.387755
54
0.623537
false
nhomar/odoo-mirror
addons/auth_ldap/__openerp__.py
50
1567
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
3,194,602,147,659,977,700
37.219512
78
0.590938
false
mitsuhiko/sqlalchemy
lib/sqlalchemy/ext/declarative/clsregistry.py
6
9816
# ext/declarative/clsregistry.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Routines to handle the string class registry used by declarative. Th...
mit
-4,564,434,234,913,575,000
32.848276
84
0.561532
false
CeltonMcGrath/TACTIC
3rd_party/CherryPy/cherrypy/test/test_mime.py
6
3459
"""Tests for various MIME issues, including the safe_multipart Tool.""" from cherrypy.test import test test.prefer_parent_path() import cherrypy def setup_server(): class Root: def multipart(self, parts): return repr(parts) multipart.exposed = True def ...
epl-1.0
4,094,526,645,165,832,000
31.942857
87
0.52096
false
asurve/incubator-systemml
src/main/python/systemml/random/sampling.py
13
5293
#------------------------------------------------------------- # # 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...
apache-2.0
-8,600,682,359,173,167,000
32.5
140
0.598526
false
zigitax/pupy
pupy/modules/screenshot.py
27
3951
# -*- coding: UTF8 -*- # -------------------------------------------------------------- # Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # ...
bsd-3-clause
-7,028,888,693,545,197,000
49.012658
756
0.727158
false
PaddlePaddle/Paddle
python/paddle/fluid/tests/unittests/mkldnn/test_quantize_mkldnn_op.py
2
6353
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
-7,742,969,942,922,523,000
26.149573
75
0.629309
false
seler/gipsy
gipsy/dashboard/presets/google_analytics.py
4
1666
from gipsy.dashboard.dashboard import Dashboard from gipsy.dashboard.widgets import widgets, widgets_google_analytics class DashboardDefault(Dashboard): """ Defaut and exemple class for dashboards using google analytics specific widgets. This class simply uses a render method where widgets are added. The ...
bsd-3-clause
-17,095,780,913,899,328
38.666667
100
0.654862
false
girishramnani/hacking-tools
pyhashcat/sre_yield/tests/test_cachingseq.py
3
2039
#!/usr/bin/env python2 # # Copyright 2011-2014 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 applicabl...
mit
-6,653,969,502,603,725,000
32.42623
74
0.642962
false
earshel/PokeyPySnipe
POGOProtos/Networking/Requests/Messages/EncounterMessage_pb2.py
16
3623
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Requests/Messages/EncounterMessage.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...
mit
-4,732,532,667,061,366,000
39.255556
360
0.742479
false
google-code/android-scripting
python/src/Demo/sockets/telnet.py
47
3010
#! /usr/bin/env python # Minimal interface to the Internet telnet protocol. # # It refuses all telnet options and does not recognize any of the other # telnet commands, but can still be used to connect in line-by-line mode. # It's also useful to play with a number of other services, # like time, finger, smtp and even ...
apache-2.0
3,464,976,746,490,562,600
26.614679
73
0.470432
false
viralpandey/kivy
kivy/geometry.py
47
3795
''' Geometry utilities ================== This module contains some helper functions for geometric calculations. ''' __all__ = ('circumcircle', 'minimum_bounding_circle') from kivy.vector import Vector def circumcircle(a, b, c): ''' Computes the circumcircle of a triangle defined by a, b, c. See: http:...
mit
-7,776,645,507,134,660,000
30.363636
76
0.548353
false
teodoc/home-assistant
homeassistant/components/device_tracker/luci.py
10
5820
""" homeassistant.components.device_tracker.luci ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Device tracker platform that supports scanning a OpenWRT router for device presence. It's required that the luci RPC package is installed on the OpenWRT router: # opkg install luci-mod-rpc Configuration: To use the Luci t...
mit
-6,545,202,801,521,779,000
30.630435
79
0.600859
false
zmlabe/IceVarFigs
Scripts/SeaSurfaceTemperatures/plot_ersst5.py
1
5197
""" Plot selected years of monthly ERSSTv5 global data Website : https://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v5/netcdf/ Author : Zachary M. Labe Date : 22 July 2017 """ from netCDF4 import Dataset import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap, addcyclic, shiftgrid import numpy a...
mit
-3,789,496,145,167,507,000
31.4875
89
0.550317
false
Chiru/NVE_Simulation
NS3/waf-tools/misc.py
69
11666
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) """ This tool is totally deprecated Try using: .pc.in files for .pc files the feature intltool_in - see demos/intltool make-like rules """ import shutil, re, os from waflib import TaskGen, Node, Task, Utils, Build, Errors from waflib.TaskGen i...
bsd-3-clause
1,843,422,790,667,014,000
27.246973
116
0.686611
false
CompassionCH/compassion-modules
gift_compassion/wizards/collect_gifts_wizard.py
4
1439
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __manifest__.p...
agpl-3.0
3,357,152,643,305,090,600
31.659091
78
0.517745
false
CydarLtd/ansible
lib/ansible/modules/system/modprobe.py
69
3813
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, David Stygstra <david.stygstra@gmail.com> # # This file is part of Ansible # # This module 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 ...
gpl-3.0
7,061,765,552,863,909,000
27.036765
104
0.578809
false
CyrilPeponnet/Archipel
ArchipelAgent/archipel-agent-action-scheduler/archipelagentactionscheduler/__init__.py
5
2236
# -*- coding: utf-8 -*- # # __init__.py # # Copyright (C) 2010 Antoine Mercadal <antoine.mercadal@inframonde.eu> # Copyright, 2011 - Franck Villaume <franck.villaume@trivialdev.com> # This file is part of ArchipelProject # http://archipelproject.org # # This program is free software: you can redistribute it and/or modi...
agpl-3.0
8,855,939,689,701,253,000
42.862745
147
0.738819
false
yglazko/bedrock
bedrock/facebookapps/utils.py
21
3549
# 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 json import urllib from base64 import urlsafe_b64decode from django.conf import settings from django.utils.trans...
mpl-2.0
-8,010,045,056,058,590,000
33.794118
79
0.673429
false
kaneod/physics
python/castep_special_atom.py
2
11802
#!/usr/bin/env python ################################################################################ # # castep_special_atom.py # # Version 2.0 # # Usage castep_special_atom.py SEED Z n # # Takes a .cell file SEED.cell, reads it in, changes the "nth" atom of type Z # to Zspec, writes the file to SEED_special.cell wit...
gpl-3.0
-1,891,183,241,990,443,000
34.023739
157
0.577529
false
ThirdProject/android_external_chromium_org
chrome/test/functional/ap_lab/dlink_ap_configurator.py
76
12111
# 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. import logging import os import ap_configurator import selenium.common.exceptions class DLinkAPConfigurator(ap_configurator.APConfigurator): """Deri...
bsd-3-clause
-776,347,489,381,774,500
40.618557
80
0.63785
false
RachitKansal/scikit-learn
examples/feature_selection/plot_rfe_with_cross_validation.py
226
1384
""" =================================================== Recursive feature elimination with cross-validation =================================================== A recursive feature elimination example with automatic tuning of the number of features selected with cross-validation. """ print(__doc__) import matplotlib.p...
bsd-3-clause
6,433,790,137,123,866,000
36.405405
74
0.679191
false
ambujone/breath-hackathon
gae/lib/PIL/ImageChops.py
40
7411
# # The Python Imaging Library. # $Id$ # # standard channel operations # # History: # 1996-03-24 fl Created # 1996-08-13 fl Added logical operations (for "1" images) # 2000-10-12 fl Added offset method (from Image.py) # # Copyright (c) 1997-2000 by Secret Labs AB # Copyright (c) 1996-2000 by Fredrik Lundh # # See...
mit
7,220,353,483,006,293,000
23.539735
73
0.695588
false
rcbau/hacks
gerrit/utility.py
1
1291
#!/usr/bin/python import decimal import types import unicodedata import urllib def DisplayFriendlySize(bytes): """DisplayFriendlySize -- turn a number of bytes into a nice string""" t = type(bytes) if t != types.LongType and t != types.IntType and t != decimal.Decimal: return 'NotANumber(%s=%s)' %(t, byte...
apache-2.0
-2,032,916,939,893,834,500
20.881356
73
0.578621
false
digitalLumberjack/recalbox-configgen
runtest/case.py
2
2950
''' Created on Mar 6, 2016 @author: Laurent Marchelli ''' import os import sys import shutil import unittest from . import dir_res, dir_tmp class TestCase(unittest.TestCase): args_dict = {} @classmethod def setUpClass(cls, system, emulator): # Define test system configuration path cls.pa...
mit
4,547,261,743,869,433,000
31.428571
82
0.58678
false
lombritz/odoo
addons/product_margin/__init__.py
444
1092
# -*- 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...
agpl-3.0
-3,188,084,370,870,802,400
41
79
0.613553
false
gitromand/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/crashlogs.py
117
5490
# 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
-6,988,606,583,348,061,000
47.584071
129
0.622951
false
tawsifkhan/scikit-learn
sklearn/linear_model/omp.py
127
30417
"""Orthogonal matching pursuit algorithms """ # Author: Vlad Niculae # # License: BSD 3 clause import warnings from distutils.version import LooseVersion import numpy as np from scipy import linalg from scipy.linalg.lapack import get_lapack_funcs from .base import LinearModel, _pre_fit from ..base import RegressorM...
bsd-3-clause
2,974,351,446,800,531,500
34.784706
79
0.602328
false
davidobrien1985/ansible-modules-core
cloud/amazon/ec2_vpc.py
6
29668
#!/usr/bin/python # 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...
gpl-3.0
5,779,987,011,829,108,000
38.716198
922
0.566334
false
vicky2135/lucious
lib/python2.7/encodings/euc_kr.py
816
1027
# # euc_kr.py: Python Unicode Codec for EUC_KR # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_kr, codecs import _multibytecodec as mbc codec = _codecs_kr.getcodec('euc_kr') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrem...
bsd-3-clause
-839,817,443,611,323,800
25.333333
74
0.696203
false
whitepacket/Stinger-Tor
stinger.py
1
6382
#!/usr/bin/env python #Stinger-Tor #Function names are written in the order metasploit launches attacks: RECON - EXPLOIT - PAYLOAD - LOOT for entertainment purposes. #Requires Socksipy (socks.py) in the current directory. Download it from here: https://raw.githubusercontent.com/mikedougherty/SocksiPy/master/socks.py #I...
mpl-2.0
8,237,489,491,691,621,000
43.943662
451
0.639611
false
DrDub/pilas
pilas/actores/temporizador.py
5
2558
# -*- encoding: utf-8 -*- # For Pilas engine - A video game framework. # # Copyright 2010 - Pablo Garrido # License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html) # # Website - http://www.pilas-engine.com.ar # import pilas from pilas.actores import Texto from pilas import colores class Temporizador(Texto): "...
lgpl-3.0
-2,760,788,048,209,795,600
29.380952
85
0.613245
false
dandycheung/androguard
androguard/decompiler/dad/graph.py
34
17082
# This file is part of Androguard. # # Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com> # 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://...
apache-2.0
-671,589,271,791,483,100
34.220619
79
0.517562
false
sambitgaan/nupic
tests/swarming/nupic/swarming/experiments/oneField/description.py
32
14387
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
-5,583,674,659,747,028,000
36.860526
110
0.607701
false
ABaldwinHunter/django-clone-classic
tests/template_tests/test_custom.py
116
19622
from __future__ import unicode_literals import os from unittest import skipUnless from django.template import Context, Engine, TemplateSyntaxError from django.template.base import Node from django.template.library import InvalidTemplateLibrary from django.test import SimpleTestCase from django.test.utils import exten...
bsd-3-clause
-6,156,823,158,680,823
51.605898
118
0.608552
false
lokirius/python-for-android
python3-alpha/python3-src/Lib/ctypes/test/test_find.py
65
2470
import unittest import sys from ctypes import * from ctypes.util import find_library from ctypes.test import is_resource_enabled if sys.platform == "win32": lib_gl = find_library("OpenGL32") lib_glu = find_library("Glu32") lib_gle = None elif sys.platform == "darwin": lib_gl = lib_glu = find_library("O...
apache-2.0
962,078,443,507,699,300
29.121951
77
0.562753
false
yannrouillard/weboob
modules/prixcarburants/test.py
5
1088
# -*- coding: utf-8 -*- # Copyright(C) 2012 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opti...
agpl-3.0
-7,769,473,672,478,221,000
33
77
0.729779
false
CyanogenMod/android_external_chromium_org
tools/perf/benchmarks/session_restore.py
8
2414
# Copyright 2013 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 tempfile from measurements import session_restore from measurements import session_restore_with_url import page_sets from profile_creators ...
bsd-3-clause
-5,938,513,011,298,622,000
34.5
80
0.726181
false
daenamkim/ansible
lib/ansible/modules/network/aruba/aruba_command.py
17
6873
#!/usr/bin/python # # Copyright: Ansible Team # 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
-5,229,550,708,341,911,000
30.099548
92
0.645715
false
fujicoin/electrum-fjc
electrum/plugins/coldcard/coldcard.py
2
26391
# # Coldcard Electrum plugin main code. # # from struct import pack, unpack import os, sys, time, io import traceback from electrum.bip32 import BIP32Node, InvalidMasterKeyVersionBytes from electrum.i18n import _ from electrum.plugin import Device from electrum.keystore import Hardware_KeyStore, xpubkey_to_pubkey, Xpu...
mit
-8,262,395,673,221,224,000
36.066011
133
0.58088
false
ah744/ScaffCC_RKQC
clang/bindings/python/tests/cindex/test_type.py
5
7493
from clang.cindex import CursorKind from clang.cindex import TypeKind from nose.tools import raises from .util import get_cursor from .util import get_tu kInput = """\ typedef int I; struct teststruct { int a; I b; long c; unsigned long d; signed long e; const int f; int *g; int ***h; }; """ def te...
bsd-2-clause
-3,257,201,517,061,547,000
26.148551
88
0.637528
false
a-doumoulakis/tensorflow
tensorflow/python/ops/sparse_grad.py
61
10799
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-5,210,230,369,046,255,000
36.758741
91
0.687841
false
chipsecintel/chipsec
source/tool/chipsec/hal/ec.py
3
6172
#!/usr/local/bin/python #CHIPSEC: Platform Security Assessment Framework #Copyright (c) 2010-2016, Intel Corporation # #This program is free software; you can redistribute it and/or #modify it under the terms of the GNU General Public License #as published by the Free Software Foundation; Version 2. # #This program is...
gpl-2.0
2,814,664,325,244,914,700
33.674157
102
0.606124
false
pwhelan/djshouts
django/contrib/auth/tests/forms.py
97
9436
from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm, AuthenticationForm, PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm from django.db import connection from django.test import TestCase from django.utils import unittest class UserCreationFormTest...
bsd-3-clause
-7,808,169,824,084,575,000
33.564103
147
0.577999
false
ConeyLiu/spark
python/pyspark/storagelevel.py
32
2640
# # 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
-6,569,527,250,402,767,000
44.517241
97
0.714773
false
angelapper/edx-platform
lms/djangoapps/shoppingcart/pdf.py
22
18645
""" Template for PDF Receipt/Invoice Generation """ import logging from django.conf import settings from django.utils.translation import ugettext as _ from PIL import Image from reportlab.lib import colors from reportlab.lib.pagesizes import letter from reportlab.lib.styles import getSampleStyleSheet from reportlab.li...
agpl-3.0
-7,822,837,237,229,962,000
37.522727
119
0.555162
false
PongPi/isl-odoo
addons/product_margin/wizard/__init__.py
444
1078
# -*- 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...
agpl-3.0
7,053,722,849,262,236,000
42.12
79
0.61039
false
EPDCenter/android_kernel_rockchip_ylp
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
593,490,336,828,014,000
26.596899
70
0.673034
false
LChristakis/chalice-hunter
lib/python3.4/site-packages/pip/basecommand.py
79
9310
"""Base Command class, and related routines""" from __future__ import absolute_import import logging import os import sys import traceback import optparse import warnings from pip._vendor.six import StringIO from pip import cmdoptions from pip.locations import running_under_virtualenv from pip.download import PipSes...
mit
446,102,189,319,639,400
33.481481
79
0.537594
false
jackyyf/ucore_os_lab
related_info/ostep/ostep9-mlfq.py
54
12243
#! /usr/bin/env python import sys from optparse import OptionParser import random # finds the highest nonempty queue # -1 if they are all empty def FindQueue(): q = hiQueue while q > 0: if len(queue[q]) > 0: return q q -= 1 if len(queue[0]) > 0: return 0 return -1 ...
gpl-2.0
-7,157,397,164,516,865,000
36.555215
214
0.58319
false
TrevorLowing/PyGames
pysollib/pysolgtk/tkwidget.py
2
10366
#!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- ##---------------------------------------------------------------------------## ## ## Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer ## Copyright (C) 2003 Mt. Hood Playing Card Co. ## Copyright (C) 2005-2009 Skomoroh ## ## This program is free ...
gpl-2.0
8,268,712,616,668,244,000
30.035928
81
0.504438
false
geophysics/mtpy
mtpy/utils/convert_coordinates_in_edis.py
1
2530
#!/usr/bin/env python """ mtpy/mtpy/uofa/convert_coordinates_in_edis.py This is a convenience script for converting coordinates in EDI files. Files are parsed and if a 'lat' or 'lon' is detected, the argument on the other side of an '=' is converted into decimal degrees. The rest of the file remains unchanged. arg...
gpl-3.0
1,244,499,688,286,023,000
24.816327
81
0.580632
false
Jgarcia-IAS/SAT
openerp/addons/base_setup/base_setup.py
382
5430
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
-1,916,442,078,377,144,600
53.848485
185
0.592081
false
beckynaylor/PiSwarmSim
PiSwarmSimulator/arena.py
1
5901
# Pi-Swarm Simulator is a simple graphical simulation environment for the Pi-Swarm robots # Copyright (C) 2014 Becky Naylor, Jon Timmis, University of York # 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 ...
gpl-3.0
-4,093,277,932,417,575,400
39.979167
146
0.601423
false
hickerson/bbn
fable/fable_sources/libtbx/command_line/run_tests_parallel.py
1
3187
from __future__ import division import libtbx.test_utils.parallel from libtbx.utils import Sorry, Usage import libtbx.phil import random import os import sys master_phil = libtbx.phil.parse(""" directory = None .type = path .multiple = True module = None .type = str .multiple = True nproc = 1 .type= int sh...
mit
-7,499,863,496,812,789,000
29.352381
84
0.618764
false
Petraea/jsonbot
jsb/utils/pdod.py
1
1417
# gozerbot/pdod.py # # """ pickled dicts of dicts """ ## jsb imports from jsb.utils.lazydict import LazyDict from jsb.lib.persist import Persist ## Pdod class class Pdod(Persist): """ pickled dicts of dicts """ def __getitem__(self, name): """ return item with name """ if self.data.has_ke...
mit
5,943,566,296,325,826,000
24.763636
75
0.57163
false
Nikoli/youtube-dl
youtube_dl/extractor/ultimedia.py
2
3512
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, qualities, unified_strdate, clean_html, ) class UltimediaIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?ultimedia\.com/default/index/video[^/]+/id/(?P<i...
unlicense
6,590,264,584,309,799,000
33.067961
105
0.509832
false
jor-/scipy
scipy/optimize/tests/test_linprog.py
2
69667
""" Unit test for Linear Programming """ from __future__ import division, print_function, absolute_import import sys import numpy as np from numpy.testing import (assert_, assert_allclose, assert_equal, assert_array_less) from pytest import raises as assert_raises from scipy.optimize import ...
bsd-3-clause
3,454,162,632,432,896,000
38.471388
98
0.517706
false
Syrcon/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/skipping.py
168
12742
""" support for skip/xfail functions and markers. """ import os import sys import traceback import py import pytest from _pytest.mark import MarkInfo, MarkDecorator def pytest_addoption(parser): group = parser.getgroup("general") group.addoption('--runxfail', action="store_true", dest="runxfail", ...
mpl-2.0
-278,946,424,704,177,280
34.99435
91
0.571574
false
mmnelemane/nova
nova/api/openstack/compute/legacy_v2/contrib/floating_ip_pools.py
79
2131
# Copyright (c) 2011 X.commerce, a business unit of eBay 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 req...
apache-2.0
3,354,623,288,483,381,000
30.80597
78
0.652276
false
EduardoMolina/SU2
SU2_PY/package_tests.py
1
9332
#!/usr/bin/env python ## \file package_tests.py # \brief _____________. # \author T. Lukaczyk # \version 7.0.3 "Blackbird" # # SU2 Project Website: https://su2code.github.io # # The SU2 Project is maintained by the SU2 Foundation # (http://su2foundation.org) # # Copyright 2012-2020, SU2 Contributors (cf. AUTHORS....
lgpl-2.1
6,661,521,788,380,340,000
27.364742
103
0.561402
false
SCSSG/Odoo-SCS
addons/edi/models/edi.py
277
31944
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-2014 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
-5,793,261,309,824,443,000
51.712871
139
0.557726
false
RossBrunton/django
tests/check_framework/test_model_field_deprecation.py
322
2584
from django.core import checks from django.db import models from django.test import SimpleTestCase from .tests import IsolateModelsMixin class TestDeprecatedField(IsolateModelsMixin, SimpleTestCase): def test_default_details(self): class MyField(models.Field): system_check_deprecated_details ...
bsd-3-clause
-2,592,567,449,084,340,700
29.4
92
0.522059
false
elemson/codeacademyfinalproj
cc_markov.py
4
2430
import re import random from collections import defaultdict, deque """ Codecademy Pro Final Project supplementary code Markov Chain generator This is a text generator that uses Markov Chains to generate text using a uniform distribution. num_key_words is the number of words that compose a key (suggested: 2 or ...
gpl-2.0
-7,707,940,413,404,563,000
28.277108
79
0.631276
false
Anaethelion/Geotrek
geotrek/core/models.py
1
20663
# -*- coding: utf-8 -*- import logging import functools from django.contrib.gis.db import models from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.contrib.gis.geos import fromstr, LineString from mapentity.models import MapEntityMixin from geotrek.authent.models imp...
bsd-2-clause
-6,801,243,864,983,624,000
35.832442
150
0.586507
false
dispansible/dispansible
ansible/library/disp_homebrew_tap.py
1
5742
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Daniel Jaouen <dcj24@cornell.edu> # Based on homebrew (Andrew Dunham <andrew@du.nham.ca>) # # 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 # t...
mit
-3,955,033,150,162,051,600
25.706977
73
0.575235
false
tuxfux-hlp-notes/python-batches
archieves/batch-62/files/myenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py
359
33591
from __future__ import absolute_import import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket try: # Python 3 from queue import LifoQueue, Empty, Full except ImportError: from Queue import LifoQueue, Empty, Full # Queue is im...
gpl-3.0
1,888,680,584,847,331,600
37.788684
99
0.595755
false
minorua/QGIS
tests/src/python/test_qgsdatetimeedit.py
12
1643
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsDateTimeEdit .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __...
gpl-2.0
-8,846,367,499,604,521,000
28.339286
78
0.667681
false
WolfgangAxel/ConGames
Python-Jeopardy/Editor.py
1
18974
#!/usr/bin/python # -*- coding: iso-8859-1 -*- import Tkinter,tkFont import math import glob import os class simpleapp_tk(Tkinter.Tk): def __init__(self,parent): Tkinter.Tk.__init__(self,parent) self.parent = parent self.initialize() def initialize(self): self.grid() self.HOME = os.getcwd() if not...
mit
722,170,261,903,929,300
46.793451
229
0.591125
false
ltilve/ChromiumGStreamerBackend
third_party/mojo/src/mojo/public/tools/bindings/mojom_bindings_generator.py
3
8427
#!/usr/bin/env python # Copyright 2013 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. """The frontend for the Mojo bindings system.""" import argparse import imp import os import pprint import sys # Disable lint check ...
bsd-3-clause
2,191,873,826,871,393,300
37.131222
80
0.638661
false
sam-m888/gramps
gramps/gen/filters/rules/family/_regexpfathername.py
5
1856
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # 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 you...
gpl-2.0
8,945,566,058,980,223,000
36.12
79
0.554418
false
Shivam-Miglani/AndroidViewClient
examples/monkeyrunner-issue-36544-workaround.py
9
2846
#! /usr/bin/env python ''' Copyright (C) 2012 Diego Torres Milano Created on Sep 8, 2012 @author: diego @see: http://code.google.com/p/android/issues/detail?id=36544 ''' import re import sys import os # This must be imported before MonkeyRunner and MonkeyDevice, # otherwise the import fails. # PyDev sets PYTHONPA...
apache-2.0
-2,726,321,241,022,355,500
29.602151
91
0.643008
false
atramos/facebook-photo-sync
facebook/requests/packages/urllib3/util/request.py
1008
2089
from base64 import b64encode from ..packages.six import b ACCEPT_ENCODING = 'gzip,deflate' def make_headers(keep_alive=None, accept_encoding=None, user_agent=None, basic_auth=None, proxy_basic_auth=None, disable_cache=None): """ Shortcuts for generating request headers. :param keep_ali...
gpl-3.0
-759,284,638,286,438,100
28.422535
85
0.61034
false
sankhesh/VTK
Examples/Infovis/Python/tables1.py
13
1485
#!/usr/bin/env python """ This file contains Python code illustrating the creation and manipulation of vtkTable objects. """ from __future__ import print_function from vtk import * #------------------------------------------------------------------------------ # Script Entry Point (i.e., main() ) #-------------------...
bsd-3-clause
4,190,046,905,745,310,000
28.7
79
0.445118
false
rjschof/gem5
src/arch/micro_asm.py
86
14724
# Copyright (c) 2003-2005 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
7,010,432,845,688,307,000
28.448
91
0.599022
false
UweFleis3/Uwe
py/openage/convert/hardcoded/langcodes.py
46
8618
# language codes, as used in PE file ressources # this file is used by pefile.py langcodes = { 1: 'ar', 2: 'bg', 3: 'ca', 4: 'zh_Hans', 5: 'cs', 6: 'da', 7: 'de', 8: 'el', 9: 'en', 10: 'es', 11: 'fi', 12: 'fr', 13: 'he', 14: 'hu', 15: 'is', 16: 'it', ...
gpl-3.0
-3,913,281,910,808,396,000
17.65368
47
0.423648
false
rue89-tech/edx-analytics-dashboard
analytics_dashboard/settings/logger.py
4
3377
"""Logging configuration""" import os import platform import sys from logging.handlers import SysLogHandler def get_logger_config(log_dir='/var/tmp', logging_env="no_env", edx_filename="edx.log", dev_env=False, debug=False, ...
agpl-3.0
8,683,102,707,940,834,000
31.471154
107
0.483269
false
rickerc/neutron_audit
neutron/db/routedserviceinsertion_db.py
17
4553
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 VMware, 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/li...
apache-2.0
-8,073,803,098,463,642,000
41.157407
79
0.624863
false
iheitlager/django-rest-framework
rest_framework/parsers.py
78
7968
""" Parsers are used to parse the content of incoming HTTP requests. They give us a generic way of being able to handle various media types on the request, such as form content or json encoded data. """ from __future__ import unicode_literals import json from django.conf import settings from django.core.files.upload...
bsd-2-clause
-8,359,600,898,694,691,000
34.891892
88
0.607555
false
cntnboys/410Lab6
build/django/build/lib.linux-x86_64-2.7/django/db/backends/postgresql_psycopg2/base.py
21
8837
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ from django.conf import settings from django.db.backends import (BaseDatabaseFeatures, BaseDatabaseWrapper, BaseDatabaseValidation) from django.db.backends.postgresql_psycopg2.operations import DatabaseOperation...
apache-2.0
-6,457,968,663,639,534,000
37.58952
105
0.636641
false
pypingou/pagure
dev-data.py
1
21989
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Populate the pagure db with some dev data. """ from __future__ import print_function, unicode_literals, absolute_import import argparse import os import tempfile import pygit2 import shutil import six from sqlalchemy import create_engine, MetaData import pagure imp...
gpl-2.0
-3,777,202,079,627,342,000
29.246217
90
0.576743
false
simonwydooghe/ansible
lib/ansible/modules/packaging/os/slackpkg.py
95
6148
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Kim Nørgaard # Written by Kim Nørgaard <jasen@jasen.dk> # Based on pkgng module written by bleader <bleader@ratonland.org> # that was based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com> # that was based on pacman module written by Afterburn <htt...
gpl-3.0
-5,681,596,031,009,584,000
29.420792
120
0.563222
false
simonwydooghe/ansible
lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py
8
14044
#!/usr/bin/python # # 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 distribut...
gpl-3.0
9,016,904,786,302,628,000
36.251989
117
0.609584
false
chris4795/u-boot-novena
tools/patman/get_maintainer.py
8
1239
# Copyright (c) 2012 The Chromium OS Authors. # # SPDX-License-Identifier: GPL-2.0+ # import command import gitutil import os def FindGetMaintainer(): """Look for the get_maintainer.pl script. Returns: If the script is found we'll return a path to it; else None. """ try_list = [ os.pa...
gpl-2.0
945,822,971,134,745,600
25.361702
74
0.634383
false
sanjuro/RCJK
vendor/gdata/Crypto/Hash/HMAC.py
226
3330
"""HMAC (Keyed-Hashing for Message Authentication) Python module. Implements the HMAC algorithm as described by RFC 2104. This is just a copy of the Python 2.2 HMAC module, modified to work when used on versions of Python before 2.2. """ __revision__ = "$Id: HMAC.py,v 1.5 2002/07/25 17:19:02 z3p Exp $" import strin...
apache-2.0
1,505,576,636,388,951,300
29.833333
78
0.606306
false
wayetender/whip
whip/src/adapter/frontends/rest.py
1
3325
from . import ProxyTerminus from flask import Flask from flask import request from flask import make_response import urllib2 import socket import json import threading import datetime import ssl import logging log = logging.getLogger('werkzeug') log.setLevel(logging.ERROR) network_times = open('times', 'w') network...
gpl-2.0
5,410,570,434,407,805,000
34
133
0.571128
false
Zhongqilong/kbengine
kbe/res/scripts/common/Lib/test/test_email/test_policy.py
79
13417
import io import types import textwrap import unittest import email.policy import email.parser import email.generator from email import headerregistry def make_defaults(base_defaults, differences): defaults = base_defaults.copy() defaults.update(differences) return defaults class PolicyAPITests(unittest.T...
lgpl-3.0
-7,406,632,348,161,437,000
39.412651
80
0.606246
false
drawks/ansible
lib/ansible/modules/database/aerospike/aerospike_migrations.py
25
18758
#!/usr/bin/python """short_description: Check or wait for migrations between nodes""" # Copyright: (c) 2018, Albert Autin # 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_METADA...
gpl-3.0
-1,620,266,335,480,614,400
34.866157
103
0.574848
false
beswarm/django-allauth
allauth/socialaccount/providers/vk/tests.py
71
1253
from __future__ import absolute_import from allauth.socialaccount.tests import create_oauth2_tests from allauth.socialaccount.providers import registry from allauth.tests import MockedResponse from .provider import VKProvider class VKTests(create_oauth2_tests(registry.by_id(VKProvider.id))): def get_mocked_res...
mit
-3,557,980,755,823,644,000
68.611111
724
0.661612
false
grivescorbett/heroku-buildpack-python
vendor/pip-pop/pip/baseparser.py
424
10465
"""Base option parser setup""" from __future__ import absolute_import import sys import optparse import os import re import textwrap from distutils.util import strtobool from pip._vendor.six import string_types from pip._vendor.six.moves import configparser from pip.locations import ( legacy_config_file, config_b...
mit
2,216,669,898,507,339,300
34.839041
79
0.587291
false
robovm/robovm-studio
python/lib/Lib/site-packages/django/contrib/admin/helpers.py
78
13324
from django import forms from django.conf import settings from django.contrib.admin.util import flatten_fieldsets, lookup_field from django.contrib.admin.util import display_for_field, label_for_field from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from d...
apache-2.0
2,401,198,676,081,120,000
37.845481
133
0.602372
false
turtleloveshoes/kitsune
kitsune/community/tests/test_api.py
13
8753
from datetime import datetime, timedelta from nose.tools import eq_ from django.test.client import RequestFactory from kitsune.community import api from kitsune.products.tests import product from kitsune.questions.tests import answer, answervote, question from kitsune.search.tests import ElasticTestCase from kitsune...
bsd-3-clause
318,551,336,583,031,500
31.782772
99
0.583686
false
ISIFoundation/influenzanet-website
apps/survey/api/resources.py
4
2676
from tastypie.resources import ModelResource from apps.survey.models import Profile, SurveyUser, Survey from apps.survey.survey import parse_specification from apps.survey.spec import Question, Branch, Else from pickle import loads from inspect import isclass class EpiwebModelResource(ModelResource): class Meta: ...
agpl-3.0
-4,251,068,543,518,573,600
29.067416
99
0.575859
false
lizardsystem/lizard-damage
lizard_damage/migrations/0025_auto__add_field_damagescenario_ahn_version.py
1
9142
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'DamageScenario.ahn_version' db.add_column(u'lizard_damage...
gpl-3.0
5,769,901,754,726,166,000
69.330769
163
0.550427
false
KamranMackey/readthedocs.org
readthedocs/projects/migrations/0041_add_programming_language.py
8
12231
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Project.programming_language' db.add_column(u'projects_pr...
mit
-3,244,198,992,383,329,000
82.210884
232
0.557436
false
teampopong/crawlers
election_commission/crawlers/assembly/base.py
3
3547
#!/usr/bin/python2.7 # -*- encoding=utf-8 -*- import gevent from gevent import monkey import itertools from urlparse import urljoin from utils import flatten, get_json, get_xpath, parse_cell, sanitize, split monkey.patch_all() class BaseCrawler(object): url_image_base = 'http://info.nec.go.kr' attrs = [] ...
agpl-3.0
-7,241,243,713,288,136,000
31.229358
88
0.59351
false
axinging/sky_engine
sky/tools/webkitpy/common/system/filesystem_mock.py
11
16806
# Copyright (C) 2009 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
3,958,192,683,675,603,000
33.368098
107
0.590444
false