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
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/gio/_gio/AppInfo.py
1
4475
# encoding: utf-8 # module gio._gio # from /usr/lib/python2.7/dist-packages/gtk-2.0/gio/_gio.so # by generator 1.135 # no doc # imports import gio as __gio import glib as __glib import gobject as __gobject import gobject._gobject as __gobject__gobject class AppInfo(__gobject.GInterface): # no doc def add_sup...
gpl-2.0
2,142,959,814,228,090,600
31.427536
107
0.602458
false
xxshutong/openerp-7.0
openerp/addons/project/res_config.py
55
4724
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
4,962,764,906,963,353,000
58.05
131
0.649238
false
MihaiMoldovanu/ansible
test/units/module_utils/basic/test_log.py
63
10557
# -*- coding: utf-8 -*- # (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, ...
gpl-3.0
-1,994,164,833,596,180,700
37.341912
117
0.640905
false
mattseymour/django
tests/gis_tests/geoadmin/tests.py
21
4334
from django.contrib.gis import admin from django.contrib.gis.geos import Point from django.test import TestCase, override_settings, skipUnlessDBFeature from django.test.utils import patch_logger from .admin import UnmodifiableAdmin from .models import City, site @skipUnlessDBFeature("gis_enabled") @override_settings...
bsd-3-clause
7,441,994,320,966,214,000
41.910891
107
0.63221
false
aseber/OpenCV
ZBarImageReader.py
2
2601
#!/usr/bin/env python import cv2 # import rospy # import roslib import numpy as np import os.path import zbar from GenericCascade import GenericCascade # roslib.load_manifest('object_detection') # from sensor_msgs.msg import Image # from cv_bridge import CvBridge, CvBridgeError ''' ####################################...
apache-2.0
7,358,476,522,411,866,000
34.630137
126
0.507497
false
stuart-knock/tvb-library
contrib/from_articles/region_deterministic_bnm_wc.py
5
3642
# -*- coding: utf-8 -*- """ What: Reproduces Figures 23 and 24 of Sanz-Leon P., Knock, S. A., Spiegler, A. and Jirsa V. Mathematical framework for large-scale brain network modelling in The Virtual Brain. Neuroimage, 2014, (in review) Needs: A working installation of tvb Run: python region_de...
gpl-2.0
1,177,383,668,646,414,600
28.617886
131
0.664745
false
EDRN/CancerDataExpo
src/edrn.rdf/edrn/rdf/labcascollectionrdfgenerator.py
2
6485
# encoding: utf-8 # Copyright 2012–2020 California Institute of Technology. ALL RIGHTS # RESERVED. U.S. Government Sponsorship acknowledged. '''LabCAS RDF Generator. ''' from .rdfgenerator import IRDFGenerator from .utils import validateAccessibleURL from Acquisition import aq_inner from edrn.rdf import _ from pysolr...
apache-2.0
8,891,032,098,620,185,000
50.672
134
0.682923
false
kmacinnis/sympy
sympy/core/tests/test_evalf.py
4
16253
from sympy import (Add, ceiling, cos, E, Eq, exp, factorial, fibonacci, floor, Function, GoldenRatio, I, log, Mul, oo, pi, Pow, Rational, sin, sqrt, sstr, Sum, sympify, S, integrate, atan, product) from sympy.core.evalf import complex_accuracy, PrecisionExhausted, scaled_zero from ...
bsd-3-clause
-1,519,290,334,075,983,400
37.976019
98
0.584261
false
yaojingwu1992/XlsxWriter
xlsxwriter/test/comparison/test_chart_data_labels08.py
8
1708
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
8,319,891,939,407,652,000
24.878788
79
0.526347
false
tombstone/models
official/nlp/modeling/losses/weighted_sparse_categorical_crossentropy_test.py
1
8816
# Copyright 2019 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,183,514,108,654,816,000
41.384615
101
0.669351
false
ryfeus/lambda-packs
Opencv_pil/source36/PIL/IcnsImagePlugin.py
2
11843
# # The Python Imaging Library. # $Id$ # # macOS icns file decoder, based on icns.py by Bob Ippolito. # # history: # 2004-10-09 fl Turned into a PIL plugin; removed 2.3 dependencies. # # Copyright (c) 2004 by Bob Ippolito. # Copyright (c) 2004 by Secret Labs. # Copyright (c) 2004 by Fredrik Lundh. # Copyright (c) 201...
mit
5,472,864,526,495,313,000
28.831234
78
0.532466
false
CodyKochmann/sync_lab
simple_notepad_server/cherrypy/test/webtest.py
20
20601
"""Extensions to unittest for web frameworks. Use the WebCase.getPage method to request a page from your HTTP server. Framework Integration ===================== If you have control over your server process, you can handle errors in the server-side of the HTTP conversation a bit better. You must run both the client ...
mit
7,772,666,909,876,156,000
32.883224
79
0.529295
false
lordtangent/arsenalsuite
python/scripts/joberror_handler.py
10
2441
#!/usr/bin/python from PyQt4.QtCore import * from PyQt4.QtSql import * from blur.Stone import * from blur.Classes import * import blur.email, blur.jabber import sys, time, re, os from math import ceil import traceback if sys.argv.count('-daemonize'): from blur.daemonize import createDaemon createDaemon() app = QCo...
gpl-2.0
-3,009,072,343,365,999,600
27.057471
108
0.722245
false
alexis-roche/nipy
examples/labs/need_data/parcel_intra.py
4
1546
#!/usr/bin/env python # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from __future__ import print_function # Python 2/3 compatibility __doc__ = """ Example of script to parcellate the data from one subject, using various algorithms. Note that it can ta...
bsd-3-clause
-1,804,532,448,694,970,400
28.730769
78
0.65912
false
andrey-malets/web-page-replay
rules/rule.py
30
1507
#!/usr/bin/env python # Copyright 2015 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...
apache-2.0
-7,237,323,335,670,548,000
36.675
78
0.723955
false
memo/tensorflow
tensorflow/contrib/distributions/python/ops/vector_laplace_linear_operator.py
15
10591
# 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
-3,761,288,340,628,081,000
35.02381
80
0.647059
false
mgagne/nova
nova/tests/unit/api/openstack/compute/test_plugins/basic.py
46
1179
# Copyright 2014 IBM Corp. # # 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...
apache-2.0
-7,285,498,098,815,392,000
26.418605
78
0.691264
false
googleapis/python-dialogflow
google/cloud/dialogflow_v2beta1/services/contexts/async_client.py
1
32318
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
6,658,342,818,587,550,000
44.263305
165
0.615725
false
b-me/django
django/db/models/base.py
39
70506
from __future__ import unicode_literals import copy import inspect import warnings from itertools import chain from django.apps import apps from django.conf import settings from django.core import checks from django.core.exceptions import ( NON_FIELD_ERRORS, FieldDoesNotExist, FieldError, MultipleObjectsReturned,...
bsd-3-clause
6,986,162,137,101,732,000
40.522968
114
0.542195
false
xtenex/raft
extras/Raft2CaptureProcessor.py
11
9240
# # A urllib2 compatible processor module to generate RAFT capture files # # Copyright (c) 2011 by RAFT Team # # 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 ...
gpl-3.0
-3,434,426,910,176,377,300
39.884956
169
0.577597
false
20tab/django-filer
filer/admin/permissionadmin.py
14
1644
#-*- coding: utf-8 -*- import inspect from django.contrib import admin from filer import settings from filer.fields import folder class PermissionAdmin(admin.ModelAdmin): fieldsets = ( (None, {'fields': (('type', 'folder',))}), (None, {'fields': (('user', 'group', 'everybody'),)}), (None, ...
bsd-3-clause
8,472,635,527,406,561,000
41.153846
118
0.60219
false
pymedusa/SickRage
ext/requests/sessions.py
14
29316
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os import sys import time from datetime import timedelta from collections import OrderedDict from .auth import _basic_auth_str from ....
gpl-3.0
8,679,848,211,856,939,000
37.122237
106
0.613829
false
mjkoster/HypermediaToolkit
MachineHypermediaToolkit/resource/HypermediaCollection.py
3
7316
""" Hypermedia Collection extends the Hypermedia Resource class by adding hypermedia based URI routing and senml modeling of items and subresources. Routing uses link relations rel=grp, rel=sub and rel=item routing is done by identifying subresources that match the next uri segment to be routed until the last segm...
apache-2.0
3,675,314,918,895,081,500
48.768707
114
0.644751
false
DShokes/ArcREST
src/arcrest/packages/ntlm3/HTTPNtlmAuthHandler.py
6
6364
# This library is free software: you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation, either # version 3 of the License, or (at your option) any later version. # This library is distributed in the hope that it will be useful...
apache-2.0
1,067,616,923,344,088
42.889655
148
0.615336
false
aiyyoi/DevFest-MaxBond
MaxBond/env/lib/python2.7/site-packages/pip/_vendor/requests/cookies.py
821
16686
# -*- coding: utf-8 -*- """ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import time import collections from .compat import cookielib, urlparse, urlunparse, Morsel try: import threading # grr, pyflakes: this fixes...
mit
-939,759,460,870,436,000
35.753304
111
0.632806
false
390910131/Misago
misago/conf/dbsettings.py
8
3143
from misago.core import threadstore CACHE_KEY = 'misago_db_settings' class DBSettings(object): def __init__(self): self._settings = self._read_cache() self._overrides = {} def _read_cache(self): from misago.core.cache import cache data = cache.get(CACHE_KEY, 'nada') ...
gpl-2.0
-2,329,223,233,609,291,000
31.739583
75
0.562838
false
CiscoSystems/vespa
neutron/plugins/nicira/extensions/nvp_networkgw.py
9
6480
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 VMware. 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/license...
apache-2.0
293,186,502,713,928,200
33.105263
79
0.592284
false
DarkFenX/Pyfa
graphs/data/base/getter.py
2
3453
# ============================================================================= # Copyright (C) 2010 Diego Duclos # # This file is part of pyfa. # # pyfa is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either ...
gpl-3.0
745,421,423,085,128,400
35.347368
111
0.60614
false
kmolab/kmolab.github.io
data/Brython-3.3.4/Lib/unittest/suite.py
748
9715
"""TestSuite""" import sys from . import case from . import util __unittest = True def _call_if_exists(parent, attr): func = getattr(parent, attr, lambda: None) func() class BaseTestSuite(object): """A simple test suite that doesn't provide class or module shared fixtures. """ def __init__(se...
agpl-3.0
3,256,658,755,996,121,600
31.275748
80
0.580237
false
ankanch/tieba-zhuaqu
DSV-user-application-plugin-dev-kit/default-plugins/multiwords/main.py
3
1524
from tkinter import * # 导入 Tkinter 库 import multiwords root = Tk() root.resizable(False,False) root.title("统计对比多个词语") #KCC基本分析组件 #该组件用于列举出包含指定词语的帖子/回帖 ##插件信息定义 KCC_PLUGIN_NAME="multiwordS" KCC_PLUGIN_DESCRIPTION="用来统计多个词语的频率并以条形统计图显示" KCC_PLUGIN_COPYRIGHT="kanch" ##定义结束 def btnclick(): ...
gpl-3.0
7,291,300,060,364,400,000
30.7
96
0.70347
false
abenzbiria/clients_odoo
addons/account/report/account_balance.py
183
6162
# -*- 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
-5,884,478,103,610,047,000
43.652174
236
0.554852
false
LamCiuLoeng/gap
gapproject/controllers/order.py
1
32750
# -*- coding: utf-8 -*- from datetime import datetime as dt import json import os import random import subprocess import traceback import urllib2 import zipfile import zlib # turbogears imports from tg import expose, redirect, validate, flash, request, response, override_template, config from tg.decorators import pag...
mit
-3,066,168,022,429,044,000
41.755875
187
0.466382
false
secretsquirrel/sslstrip
sslstrip.py
72
4066
#!/usr/bin/env python """sslstrip is a MITM tool that implements Moxie Marlinspike's SSL stripping attacks.""" __author__ = "Moxie Marlinspike" __email__ = "moxie@thoughtcrime.org" __license__= """ Copyright (c) 2004-2009 Moxie Marlinspike <moxie@thoughtcrime.org> This program is free software; you can redistribu...
gpl-3.0
-5,218,438,217,862,130,000
36.648148
94
0.586326
false
rbaghdadi/ISIR
utils/speedup_model/src/model/model_bn_ELU.py
2
1139
import torch import torch.nn as nn import torch.nn.functional as F class Model_BN_ELU(nn.Module): def __init__(self, input_size, output_size, hidden_sizes=[10, 10, 10], drops=[0.4, 0.4, 0.4]): super().__init__() hidden_sizes = [input_size] + hidden_sizes self.hidden_layers = nn.ModuleList...
mit
5,676,362,339,808,443,000
30.666667
98
0.60755
false
pyramania/scipy
scipy/optimize/tests/test_lsq_linear.py
59
5067
import numpy as np from numpy.linalg import lstsq from numpy.testing import (assert_allclose, assert_equal, assert_, run_module_suite, assert_raises) from scipy.sparse import rand from scipy.sparse.linalg import aslinearoperator from scipy.optimize import lsq_linear A = np.array([ [0.17...
bsd-3-clause
4,210,580,782,234,345,000
32.335526
77
0.523189
false
Hakuba/youtube-dl
youtube_dl/extractor/stitcher.py
30
2934
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, js_to_json, unescapeHTML, ) class StitcherIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?stitcher\.com/podcast/(?:[^/]+/)+e/(?:(?P<display_id>[^/#?&]+?)-)?(...
unlicense
5,672,505,000,983,537,000
35.222222
144
0.542604
false
jjs0sbw/CSPLN
apps/scaffolding/linux/web2py/gluon/contrib/login_methods/email_auth.py
44
1493
import smtplib import logging def email_auth(server="smtp.gmail.com:587", domain="@gmail.com", tls_mode=None): """ to use email_login: from gluon.contrib.login_methods.email_auth import email_auth auth.settings.login_methods.append(email_auth("smtp.gmail.com:587", ...
gpl-3.0
-8,123,834,125,198,811,000
31.456522
76
0.468855
false
Danisan/odoo-1
addons/sale_crm/__openerp__.py
260
2036
# -*- 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,234,519,974,734,491,000
38.921569
81
0.599705
false
Manishearth/servo
tests/wpt/web-platform-tests/subresource-integrity/tools/generate_javascript.py
210
1297
from os import path, listdir from hashlib import sha512, sha256, md5 from base64 import b64encode import re JS_DIR = path.normpath(path.join(__file__, "..", "..")) ''' Yield each file in the javascript directory ''' def js_files(): for f in listdir(JS_DIR): if path.isfile(f) and f.endswith(".js"): yield f...
mpl-2.0
-6,332,837,608,327,683,000
23.942308
62
0.651503
false
mkocka/galaxytea
integral/domcek/numerical_integration.py
1
3477
#!/usr/bin/env python from __future__ import division import matplotlib.pyplot as plt import matplotlib from scipy import constants as const from pylab import * # def planck(T,lambda_i,lambda_f,step=10**(-1)): x ,y = ([] for i in range(2)) for i in arange(lambda_i,lambda_f,step): # i*10**(-9) - correctuin to nm ...
mit
-5,598,893,081,135,091,000
32.114286
117
0.681334
false
eufarn7sp/egads-eufar
egads/algorithms/microphysics/mass_conc_dmt.py
2
4982
__author__ = "mfreer, ohenry" __date__ = "2017-01-26 13:07" __version__ = "1.2" __all__ = ['MassConcDmt'] import numpy import egads.core.egads_core as egads_core import egads.core.metadata as egads_metadata class MassConcDmt(egads_core.EgadsAlgorithm): """ FILE mass_conc_dmt.py VERSION 1.2 ...
bsd-3-clause
-2,269,251,180,287,172,600
58.309524
317
0.449217
false
jelugbo/tundex
common/lib/xmodule/xmodule/modulestore/exceptions.py
25
2613
""" Exceptions thrown by KeyStore objects """ class ItemNotFoundError(Exception): pass class ItemWriteConflictError(Exception): pass class InsufficientSpecificationError(Exception): pass class OverSpecificationError(Exception): pass class InvalidLocationError(Exception): pass class NoPat...
agpl-3.0
7,999,397,897,774,008,000
27.714286
134
0.663988
false
hackerdeen/hackhub
web.py
1
9524
from flask import request, jsonify, Response, json, redirect, abort, render_template, session, json from hackhub import app, spaceapi, get_db, DOOR_CODE from member import Member from status import Status, new_status from event import new_event, recent_events from bank import bank from door_code import new_code, add_ur...
bsd-2-clause
-1,944,650,796,873,534,500
32.65371
114
0.614133
false
skosukhin/spack
var/spack/repos/builtin/packages/cask/package.py
1
2353
############################################################################## # 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
2,862,337,569,363,112,000
41.781818
79
0.661708
false
JeffAMcGee/friendloc
friendloc/base/gisgraphy.py
1
2955
import json import re import logging import time import restkit.errors from restkit import Resource from http_parser.http import NoMoreData import friendloc from friendloc.base.models import GeonamesPlace from friendloc.base.utils import in_local_box class GisgraphyResource(Resource): COORD_RE = re.compile('(-?\...
bsd-2-clause
-6,646,361,931,881,866,000
31.119565
76
0.516074
false
bowang/tensorflow
tensorflow/contrib/graph_editor/reroute.py
35
18201
# 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
-2,124,623,436,486,289,200
37.398734
80
0.680018
false
esthermm/odoomrp-wip
purchase_homologation/models/__init__.py
8
1676
# -*- coding: utf-8 -*- ############################################################################## # # # OpenERP, Open Source Management Solution. # # ...
agpl-3.0
205,098,448,591,644,100
68.791667
78
0.391642
false
waytai/odoo
addons/stock_dropshipping/__init__.py
223
1085
# -*- 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,759,190,502,600,697,000
44.208333
78
0.621198
false
faywong/FFPlayer
project/jni/python/src/Lib/test/test_dict.py
53
17651
import unittest from test import test_support import UserDict, random, string import gc, weakref class DictTest(unittest.TestCase): def test_constructor(self): # calling built-in types without argument must return empty self.assertEqual(dict(), {}) self.assert_(dict() is not {}) def ...
lgpl-2.1
-607,127,680,445,711,200
28.815878
94
0.474761
false
simodalla/pg_harep_lab
ssh/__init__.py
1
1370
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import os from fabric import colors from fabric.api import task, run, cd from fabric.contrib.files import exists, contains, append @task def prepare_ssh_autologin(ssh_pub_key='~/.ssh/id_rsa.pub'): """Prepare server for ssh autologi...
gpl-3.0
3,429,752,479,844,583,400
34.153846
63
0.559124
false
SamiHiltunen/invenio-groups
setup.py
2
4258
# -*- 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
-3,736,109,423,962,307,000
29.198582
75
0.616017
false
nowopen/scrapy
tests/mockserver.py
110
6622
from __future__ import print_function import sys, time, random, os, json import six from six.moves.urllib.parse import urlencode from subprocess import Popen, PIPE from twisted.web.server import Site, NOT_DONE_YET from twisted.web.resource import Resource from twisted.internet import reactor, defer, ssl from scrapy imp...
bsd-3-clause
-2,948,963,261,497,439,000
29.376147
105
0.597554
false
sznekol/django-cms
cms/tests/static_placeholder.py
13
9795
# -*- coding: utf-8 -*- from __future__ import with_statement import json from django.contrib.admin.sites import site from django.template import Context from django.template.base import Template from django.utils.encoding import force_text from cms.api import add_plugin from cms.constants import PLUGIN_MOVE_ACTION, ...
bsd-3-clause
-2,422,253,638,531,713,500
50.015625
143
0.645942
false
digwanderlust/pants
tests/python/pants_test/backend/jvm/targets/test_jvm_binary.py
1
9783
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import unittest from...
apache-2.0
-240,695,848,955,246,560
41.534783
115
0.646632
false
tillraab/thunderfish
setup.py
3
2124
from setuptools import setup, find_packages exec(open('thunderfish/version.py').read()) long_description = """ # ThunderFish Algorithms and programs for analysing electric field recordings of weakly electric fish. [Documentation](https://bendalab.github.io/thunderfish) | [API Reference](https://bendalab.github.io/t...
gpl-3.0
1,345,981,698,893,402,400
39.826923
112
0.678756
false
sivas2811/mocha_739
hotdot_env/lib/python2.7/site-packages/pip/vendor/distlib/locators.py
79
43778
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import gzip from io import BytesIO import json import logging import os import posixpath import re import threading import zlib from . ...
unlicense
-6,417,767,858,820,116,000
37.707339
96
0.532939
false
zyq001/ryu
ryu/services/protocols/bgp/core_managers/import_map_manager.py
52
1677
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # # 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 appli...
apache-2.0
8,531,024,979,198,958,000
36.266667
71
0.729875
false
nakato/AuthKit
authkit/authorize/pylons_adaptors.py
2
3015
"""Pylons specific code to facilitate using AuthKit with Pylons There is a full Pylons manual in addition to the AuthKit manual which you should read if you plan to use AuthKit with Pylons .. Note :: In addition to the authorize methods described here, you can also use the default ``authkit.authorize.middle...
mit
-370,770,899,685,263,200
36.6875
81
0.703151
false
hujingguang/OpsSystem
ops_system/utils.py
1
1182
import commands import os def get_system_info(): cmd_get_cpu_sockect=r"lscpu|grep Socket|awk '{print $NF}'" cmd_get_cpu_cores=r"cat /proc/cpuinfo|grep processor|wc -l" cmd_get_mem_total=r"free -m |head -n 2|tail -n 1|awk '{print $2}'" cmd_get_mem_used=r"free -m |tail -n 2|head -n 1|awk '{print $3}'" ...
mit
-2,268,576,211,385,603,300
37.129032
209
0.678511
false
gregdek/ansible
lib/ansible/modules/cloud/rackspace/rax_mon_entity.py
77
5795
#!/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
193,395,294,235,573,280
29.661376
95
0.615531
false
meomancer/field-campaigner
flask_project/campaign_manager/insights_functions/feature_attribute_completeness.py
1
5735
__author__ = 'Irwan Fathurrahman <irwan@kartoza.com>' __date__ = '17/05/17' import json from campaign_manager.insights_functions._abstract_overpass_insight_function \ import AbstractOverpassInsightFunction class FeatureAttributeCompleteness(AbstractOverpassInsightFunction): function_name = "Feature completene...
bsd-3-clause
-202,850,214,237,184,000
30.861111
78
0.544551
false
commaai/openpilot
selfdrive/debug/disable_ecu.py
2
1433
#!/usr/bin/env python3 import traceback import cereal.messaging as messaging from selfdrive.car.isotp_parallel_query import IsoTpParallelQuery from selfdrive.swaglog import cloudlog EXT_DIAG_REQUEST = b'\x10\x03' EXT_DIAG_RESPONSE = b'\x50\x03' COM_CONT_REQUEST = b'\x28\x83\x03' COM_CONT_RESPONSE = b'' def disable_e...
mit
-339,605,990,058,087,000
34.825
122
0.688067
false
jseabold/statsmodels
statsmodels/tools/tests/test_transform_model.py
5
1784
# -*- coding: utf-8 -*- """ Created on Tue May 27 13:26:01 2014 Author: Josef Perktold License: BSD-3 """ import numpy as np from numpy.testing import assert_allclose, assert_equal from scipy import stats from statsmodels.regression.linear_model import OLS from statsmodels.tools.transform_model import StandardizeTr...
bsd-3-clause
-6,023,487,591,097,528,000
26.030303
66
0.654148
false
Connor-R/nba_shot_charts
processing/shots_Relative_Career.py
1
3244
import requests import urllib import csv import os import sys from time import time from py_data_getter import data_getter from py_db import db db = db('nba_shots') def initiate(): print "-------------------------" print "shots_Relative_Career.py" start_time = time() process() end_time = ti...
mit
5,642,844,113,090,502,000
33.510638
353
0.612207
false
paran0ids0ul/pupy
pupy/packages/windows/x86/psutil/_psbsd.py
72
15012
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """FreeBSD platform implementation.""" import errno import functools import os import xml.etree.ElementTree as ET from collections ...
bsd-3-clause
-471,803,451,455,515,900
31.993407
79
0.602984
false
txm/make-good
django/contrib/gis/utils/ogrinspect.py
321
8939
""" This module is for inspecting OGR data sources and generating either models for GeoDjango and/or mapping dictionaries for use with the `LayerMapping` utility. Author: Travis Pinney, Dane Springmeyer, & Justin Bronn """ from itertools import izip # Requires GDAL to use. from django.contrib.gis.gdal import DataSourc...
bsd-3-clause
-6,391,217,659,338,946,000
38.728889
132
0.635642
false
bradleyayers/django-attest
django_attest/runner.py
1
1875
# coding: utf-8 __all__ = () try: # Django 1.2 doesn't have this from django.utils import unittest except ImportError: pass else: from attest import capture_output, TestFailure, TestResult, get_reporter_by_name from django.test.simple import DjangoTestSuiteRunner __all__ += ("Runner", ) ...
bsd-2-clause
-3,418,506,053,887,871,500
32.482143
84
0.5488
false
tushar7795/MicroBlog
flask/lib/python2.7/site-packages/whoosh/lang/snowball/italian.py
96
9125
from .bases import _StandardStemmer from whoosh.compat import u class ItalianStemmer(_StandardStemmer): """ The Italian Snowball stemmer. :cvar __vowels: The Italian vowels. :type __vowels: unicode :cvar __step0_suffixes: Suffixes to be deleted in step 0 of the algorithm. :type __step0_suff...
bsd-3-clause
-2,874,668,802,668,124,000
38.673913
78
0.367342
false
nebril/fuel-web
fuel_agent/fuel_agent/utils/grub.py
2
9231
# Copyright 2014 Mirantis, 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
-8,222,956,413,820,338,000
34.918288
79
0.619868
false
SEMT2Group1/Node.js_SmartCar_API_Server
server/restful.py
1
1389
from flask import Flask, request from flask_restful import Resource, Api, reqparse from json import dumps import account app = Flask(__name__) api = Api(app) #Parser that parses incoming messages. userParser = reqparse.RequestParser() userParser.add_argument('username', help='The username the user wants to register.'...
mit
8,972,038,008,543,625,000
27.346939
84
0.682505
false
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/construct-2.5.2/construct/protocols/layer3/ipv6.py
9
1239
""" Internet Protocol version 6 (TCP/IP protocol stack) """ from construct import * from ipv4 import ProtocolEnum from binascii import unhexlify import six class Ipv6AddressAdapter(Adapter): def _encode(self, obj, context): if bytes is str: return "".join(part.decode("hex") for part in obj.spl...
mit
362,072,169,786,432,000
22.826923
73
0.594027
false
Incoming5643/-tg-station
SQL/admin_import_2018-02-03.py
61
4853
#Python 3+ Script for importing admins.txt and admin_ranks.txt made by Jordie0608 # #Before starting ensure you have installed the mysqlclient package https://github.com/PyMySQL/mysqlclient-python #It can be downloaded from command line with pip: #pip install mysqlclient #And that you have run the most recent commands ...
agpl-3.0
-1,946,534,785,364,917,500
48.020202
326
0.617144
false
XMPPwocky/rust
src/etc/snapshot.py
37
8006
# Copyright 2011-2015 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or ht...
apache-2.0
4,420,976,382,069,023,000
25.686667
80
0.568574
false
julienmalard/Tikon
tikon/datos/obs.py
1
2572
import numpy as np import pandas as pd import xarray as xr from tikon.utils import EJE_TIEMPO, EJE_PARC class Obs(object): def __init__(símismo, datos): símismo.datos = datos def fechas(símismo): tiempos = símismo.datos[EJE_TIEMPO].values if np.issubdtype(tiempos.dtype, np.datetime64...
agpl-3.0
6,527,871,470,874,191,000
34.541667
116
0.566237
false
watonyweng/horizon
openstack_dashboard/enabled/_1020_project_overview_panel.py
39
1025
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
apache-2.0
-5,513,275,247,203,443,000
41.708333
76
0.763902
false
Embisto/lightblue-0.4
build/lib/lightblue/_lightblue.py
52
19766
# Copyright (c) 2009 Bea Lam. All rights reserved. # # This file is part of LightBlue. # # LightBlue 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
-4,555,903,661,843,647,500
35.671614
165
0.623495
false
cchurch/ansible
lib/ansible/modules/windows/win_partition.py
48
4629
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Varun Chopra (@chopraaa) <v@chopraaa.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCU...
gpl-3.0
-6,239,480,351,418,658,000
38.564103
149
0.703176
false
dulton/mpv
waftools/waf_customizations.py
22
1574
from waflib.Configure import conf @conf def get_config_header(self, defines=True, headers=False, define_prefix=''): """ Only difference is it outputs `#define VAR 0` or `#define VAR value` instead of `#undef VAR` or `#define VAR val`. """ from waflib.Tools.c_config import DEFKEYS, INCKEYS lst =...
gpl-2.0
6,849,075,788,414,234,000
28.698113
77
0.564168
false
bhargav2408/python-for-android
python3-alpha/python3-src/Lib/encodings/cp1140.py
272
13105
""" Python Character Mapping Codec cp1140 generated from 'python-mappings/CP1140.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='stri...
apache-2.0
-4,374,575,595,905,266,700
41.687296
103
0.51881
false
skyfielders/python-skyfield
skyfield/tests/test_earth_deflection.py
1
1520
"""Hand-crafted tests against specific NOVAS behaviors. The tests in the neighboring `tests_against_novas.py` are automatically generated and in general demonstrate close agreement with NOVAS. But the hand-crafted tests here are aimed at specific edge conditions that we want to make sure we get correct. """ from num...
mit
1,926,846,675,783,124,500
41.222222
113
0.708553
false
Percona-QA/percona-qa
pxc-tests/percona-xtradb-cluster-tests/sst/python/testtools/tests/test_content.py
42
7772
# Copyright (c) 2008-2011 testtools developers. See LICENSE for details. import os import tempfile import unittest from testtools import TestCase from testtools.compat import ( _b, _u, StringIO, ) from testtools.content import ( attach_file, Content, content_from_file, content_from_str...
gpl-2.0
4,801,299,778,702,921,000
33.852018
78
0.604864
false
seamicro/python-seamicroclient
seamicroclient/tests/v2/test_SMCards.py
1
1137
# -*- coding: utf-8 -*- # # 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 i...
apache-2.0
-8,894,556,390,306,461,000
33.454545
78
0.69657
false
sebrandon1/nova
nova/virt/libvirt/firewall.py
7
15320
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complianc...
apache-2.0
-4,736,752,725,676,229,000
40.182796
79
0.555875
false
qqzwc/XX-Net
code/default/python27/1.0/lib/noarch/hyper/common/headers.py
4
8868
# -*- coding: utf-8 -*- """ hyper/common/headers ~~~~~~~~~~~~~~~~~~~~~ Contains hyper's structures for storing and working with HTTP headers. """ import collections from hyper.common.util import to_bytestring, to_bytestring_tuple class HTTPHeaderMap(collections.MutableMapping): """ A structure that contains...
bsd-2-clause
4,092,967,873,478,398,000
33.107692
79
0.603631
false
copyninja/apt-offline
apt_offline_core/AptOffline_argparse.py
30
87352
# -*- coding: utf-8 -*- # Copyright © 2006-2009 Steven J. Bethard <steven.bethard@gmail.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...
gpl-3.0
-1,564,179,843,732,258,800
36.123247
79
0.56068
false
FrankBian/kuma
kuma/wiki/migrations/0017_deferred_rendering.py
5
15728
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Document.rendered_html' db.add_column('wiki_document', 'rendered_html', self.gf('django.db...
mpl-2.0
-4,909,553,737,868,249,000
74.980676
187
0.564407
false
fearthecowboy/pygments
Pygments/pygments-lib/pygments/lexers/actionscript.py
47
11179
# -*- coding: utf-8 -*- """ pygments.lexers.actionscript ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for ActionScript and MXML. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, using,...
bsd-2-clause
997,439,249,473,584,100
45.579167
109
0.510064
false
palerdot/calibre
src/calibre/ebooks/metadata/pdb.py
24
1552
# -*- coding: utf-8 -*- ''' Read meta information from pdb files. ''' __license__ = 'GPL v3' __copyright__ = '2009, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' import re from calibre.ebooks.metadata import MetaInformation from calibre.ebooks.pdb.header import PdbHeaderReader from c...
gpl-3.0
1,426,999,206,903,524,400
24.866667
119
0.678479
false
Blazemeter/taurus
tests/resources/selenium/generated_from_requests_appium_browser.py
1
2336
# coding=utf-8 import logging import random import string import sys import unittest from time import time, sleep import apiritif import os import re from appium import webdriver from selenium.common.exceptions import NoSuchElementException, TimeoutException from selenium.webdriver.common.by import By from selenium....
apache-2.0
8,361,257,525,624,428,000
35.5
111
0.634418
false
brandond/ansible
lib/ansible/module_utils/storage/emc/emc_vnx.py
79
1915
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
6,880,551,585,794,340,000
55.323529
92
0.753003
false
simonwydooghe/ansible
lib/ansible/modules/storage/purestorage/purefa_hg.py
21
7794
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Simon Dodsley (simon@purestorage.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
-5,977,218,752,274,065,000
28.634981
110
0.593662
false
PGower/PyCanvas
pycanvas/apis/quiz_questions.py
1
25992
"""QuizQuestions API Version 1.0. This API client was generated using a template. Make sure this code is valid before using it. """ import logging from datetime import date, datetime from base import BaseCanvasAPI from base import BaseModel class QuizQuestionsAPI(BaseCanvasAPI): """QuizQuestions API V...
mit
2,625,124,092,112,508,000
40.961983
394
0.63558
false
75651/kbengine_cloud
kbe/src/lib/python/Lib/test/test_ipaddress.py
72
74848
# Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. """Unittest for ipaddress module.""" import unittest import re import contextlib import operator import ipaddress class BaseTestCase(unittest.TestCase): # One big change in ipaddress over the original ipaddr module is # error rep...
lgpl-3.0
-1,630,705,145,046,040,600
43.210278
80
0.591599
false
liorvh/raspberry_pwn
src/pentest/metagoofil/hachoir_parser/audio/id3.py
9
16092
""" ID3 metadata parser, supported versions: 1.O, 2.2, 2.3 and 2.4 Informations: http://www.id3.org/ Author: Victor Stinner """ from hachoir_core.field import (FieldSet, MatchError, ParserError, Enum, UInt8, UInt24, UInt32, CString, String, RawBytes, Bit, Bits, NullBytes, NullBits) from hachoir_core.text...
gpl-3.0
-6,110,628,827,335,393,000
31.574899
104
0.518021
false
twitchyliquid64/misc-scripts
s3tool/boto/mashups/order.py
153
7584
# Copyright (c) 2006,2007 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...
mit
2,352,073,102,309,059,600
34.943128
99
0.581619
false
johankaito/fufuka
microblog/old-flask/lib/python2.7/site-packages/whoosh/query/positional.py
52
9427
# Copyright 2007 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
apache-2.0
-7,203,016,080,639,171,000
36.859438
79
0.607404
false
PATRIC3/p3_solr
lucene/core/src/java/org/apache/lucene/util/automaton/createLevAutomata.py
8
14571
# 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 use ...
apache-2.0
4,511,295,861,666,875,400
28.142
132
0.572713
false
drglove/SickRage
lib/unidecode/x011.py
252
4135
data = ( 'g', # 0x00 'gg', # 0x01 'n', # 0x02 'd', # 0x03 'dd', # 0x04 'r', # 0x05 'm', # 0x06 'b', # 0x07 'bb', # 0x08 's', # 0x09 'ss', # 0x0a '', # 0x0b 'j', # 0x0c 'jj', # 0x0d 'c', # 0x0e 'k', # 0x0f 't', # 0x10 'p', # 0x11 'h', # 0x12 'ng', # 0x13 'nn', ...
gpl-3.0
8,337,126,373,366,162,000
15.089494
20
0.360097
false
realtsiry/rockbox4linux
utils/common/deploy-themeeditor.py
1
2023
#!/usr/bin/python # __________ __ ___. # Open \______ \ ____ ____ | | _\_ |__ _______ ___ # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < # Firmware |____|_ /\____/ \___ >__|_ \|___ /\___...
gpl-2.0
7,692,057,364,275,853,000
37.169811
75
0.583292
false
aewallin/openvoronoi
python_examples/arc/arc_predicates.py
1
6658
# import ocl import openvoronoi as ovd import ovdvtk # import time import vtk # import datetime import math import random """ This script does not use OpenVoronoi, it is used merely for drawing and verifying solutions etc. There are functions for: - voronoi-bisectors and verifying the parametric equations for bisector...
lgpl-2.1
-2,320,525,933,126,909,000
28.591111
97
0.598228
false