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
texttochange/vusion-backend
vusion/persist/schedule/tests/test_schedule.py
1
1483
"""Tests for vusion.persist.schedule.""" from datetime import timedelta, datetime from twisted.trial.unittest import TestCase from vusion.persist import schedule_generator, DialogueSchedule from tests.utils import ObjectMaker from vusion.utils import time_from_vusion_format, time_to_vusion_format class TestSchedule...
bsd-3-clause
5,118,457,506,053,729,000
40.222222
101
0.660823
false
hanlind/nova
nova/tests/unit/api/openstack/compute/test_image_metadata.py
8
17028
# Copyright 2011 OpenStack Foundation # 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 requ...
apache-2.0
-3,512,464,980,217,446,400
44.408
79
0.60565
false
miltonruelas/cursotecnico
branch/l10n_pe_ple/__init__.py
8
1479
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
agpl-3.0
5,657,453,690,651,407,000
43.818182
78
0.686275
false
Bertrand256/dash-masternode-tool
src/dashd_intf.py
1
69200
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author: Bertrand256 # Created on: 2017-03 from __future__ import annotations import decimal import functools import json import os import re import socket import ssl import threading import time import datetime import logging from PyQt5.QtCore import QThread from bitcoi...
mit
8,209,623,023,224,227,000
41.821782
131
0.529335
false
Ruide/angr-dev
angr/angr/analyses/identifier/functions/atoi.py
5
2123
import random import string from ..func import Func, TestData class atoi(Func): def __init__(self): super(atoi, self).__init__() self.skips_whitespace = False self.allows_negative = True def rand_str(self, length, byte_list=None): #pylint disable=no-self-use if byte_list is ...
bsd-2-clause
7,520,515,114,895,593,000
26.934211
79
0.545455
false
hockeybuggy/twitter-sentiment
src/conductor.py
1
3409
#!/usr/bin/env python # File : conductor.py # Author : Douglas Anderson # Description: Simple driver for sentiment analysis implementation import os, sys import tokenize import normalize import labelselect import statsify import wordselection import dictizer import split_dataset from Token import Token fro...
mit
-6,072,132,011,073,518,000
33.785714
108
0.683778
false
dannyboi104/SickRage
lib/dogpile/cache/util.py
47
5679
from hashlib import sha1 import inspect import re import collections from . import compat def coerce_string_conf(d): result = {} for k, v in d.items(): if not isinstance(v, compat.string_types): result[k] = v continue v = v.strip() if re.match(r'^[-+]?\d+$', v)...
gpl-3.0
113,900,008,304,315,400
28.123077
77
0.550625
false
pawelmhm/scrapy
tests/test_webclient.py
3
16648
""" from twisted.internet import defer Tests borrowed from the twisted.web.client tests. """ import os import shutil import sys from pkg_resources import parse_version import cryptography import OpenSSL.SSL from twisted.trial import unittest from twisted.web import server, static, util, resource from twisted.internet ...
bsd-3-clause
-9,011,519,938,139,851,000
38.079812
115
0.601273
false
srippa/nn_deep
assignment1/cs231n/classifiers/softmax.py
3
2307
import numpy as np from random import shuffle def softmax_loss_naive(W, X, y, reg): """ Softmax loss function, naive implementation (with loops) Inputs: - W: C x D array of weights - X: D x N array of data. Data are D-dimensional columns - y: 1-dimensional array of length N with labels 0...K-1, for K class...
mit
5,503,033,794,580,793,000
40.196429
79
0.420026
false
opennode/waldur-mastermind
src/waldur_slurm/handlers.py
1
2767
import functools from django.conf import settings from django.db import transaction from django.db.models import Sum from waldur_core.core import utils as core_utils from waldur_freeipa import models as freeipa_models from . import models, tasks, utils def if_plugin_enabled(f): """Calls decorated handler only ...
mit
-5,899,177,402,627,099,000
29.406593
88
0.685219
false
chris-chambers/llvm
test/CodeGen/SystemZ/Large/spill-01.py
23
1245
# Test cases where MVC is used for spill slots that end up being out of range. # RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s # There are 8 usable call-saved GPRs, two of which are needed for the base # registers. The first 160 bytes of the frame are needed for the ABI # call frame, and a further 8 by...
gpl-3.0
-7,102,477,263,138,859,000
30.125
79
0.60241
false
LuqmanSahaf/kubernetes
third_party/htpasswd/htpasswd.py
897
5219
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2008-2013 Edgewall Software # Copyright (C) 2008 Eli Carter # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edge...
apache-2.0
4,181,964,981,834,340,000
33.111111
79
0.621
false
AltSchool/django
django/contrib/gis/utils/srs.py
45
3041
from django.contrib.gis.gdal import SpatialReference from django.db import DEFAULT_DB_ALIAS, connections def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None, database=None): """ This function takes a GDAL SpatialReference system and adds its information to the `spa...
bsd-3-clause
6,989,093,889,395,206,000
38.493506
79
0.665899
false
kaushik94/sympy
sympy/diffgeom/tests/test_hyperbolic_space.py
22
2583
r''' unit test describing the hyperbolic half-plane with the Poincare metric. This is a basic model of hyperbolic geometry on the (positive) half-space {(x,y) \in R^2 | y > 0} with the Riemannian metric ds^2 = (dx^2 + dy^2)/y^2 It has constant negative scalar curvature = -2 https://en.wikipedia.org/wiki/Poincare_h...
bsd-3-clause
823,497,478,222,230,900
27.384615
85
0.538521
false
Lancey6/redwind
migrations/20141130-eliminate-duplicate-tags.py
3
2273
""" """ import os import json from sqlalchemy import (create_engine, Table, Column, String, Integer, Float, Text, MetaData, select, ForeignKey, bindparam, delete, and_) from config import Configuration engine = create_engine(Configuration.SQLALCHEMY_DATABASE_URI, echo=Tr...
bsd-2-clause
-4,518,706,428,343,623,000
27.4125
79
0.547734
false
mega-force/osmc
package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x078.py
252
4648
data = ( 'Dang ', # 0x00 'Ma ', # 0x01 'Sha ', # 0x02 'Dan ', # 0x03 'Jue ', # 0x04 'Li ', # 0x05 'Fu ', # 0x06 'Min ', # 0x07 'Nuo ', # 0x08 'Huo ', # 0x09 'Kang ', # 0x0a 'Zhi ', # 0x0b 'Qi ', # 0x0c 'Kan ', # 0x0d 'Jie ', # 0x0e 'Fen ', # 0x0f 'E ', # 0x10 'Ya ', ...
gpl-2.0
8,636,432,027,483,705,000
17.015504
21
0.386833
false
voodka/ghostbakup
node_modules/testem/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py
1788
1435
#!/usr/bin/env python import re import json # https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae # http://stackoverflow.com/a/13436167/96656 def unisymbol(codePoint): if codePoint >= 0x0000 and codePoint <= 0xFFFF: return unichr(codePoint) elif codePoint >= 0x010000 and codePoint <= 0x10FFFF: ...
mit
3,253,380,593,608,419,000
27.7
78
0.70453
false
sbc100/native_client
src/trusted/validator_ragel/PRESUBMIT.py
12
4775
# Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Documentation on PRESUBMIT.py can be found at: # http://www.chromium.org/developers/how-tos/depottools/presubmit-scripts import json import hashl...
bsd-3-clause
-7,773,188,843,427,686,000
38.791667
80
0.687539
false
tudorbarascu/QGIS
tests/src/python/test_qgsscalewidget.py
15
2940
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsScaleWidget .. 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. """ __a...
gpl-2.0
8,558,736,179,206,132,000
29.309278
78
0.611905
false
aferr/TemporalPartitioningMemCtl
tests/configs/o3-timing.py
14
2408
# 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
-3,542,440,669,898,528,300
39.813559
72
0.739203
false
jirikuncar/invenio
invenio/testsuite/test_ext_email.py
16
11033
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 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...
gpl-2.0
1,295,170,862,831,917,800
34.249201
88
0.597662
false
sholtebeck/knarflog
lib/werkzeug/formparser.py
3
21790
# -*- coding: utf-8 -*- """ werkzeug.formparser ~~~~~~~~~~~~~~~~~~~ This module implements the form parsing. It supports url-encoded forms as well as non-nested multipart uploads. :copyright: 2007 Pallets :license: BSD-3-Clause """ import codecs import re from functools import update_wrapper ...
apache-2.0
4,256,815,946,803,647,000
36.1843
88
0.581184
false
apark263/tensorflow
tensorflow/contrib/summary/summary.py
23
3781
# 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
4,194,180,100,755,354,000
42.965116
86
0.757207
false
rbtcollins/pip
tests/lib/git_submodule_helpers.py
58
2960
from __future__ import absolute_import import textwrap def _create_test_package_submodule(env): env.scratch_path.join("version_pkg_submodule").mkdir() submodule_path = env.scratch_path / 'version_pkg_submodule' env.run('touch', 'testfile', cwd=submodule_path) env.run('git', 'init', cwd=submodule_path...
mit
4,581,578,188,407,214,000
35.097561
71
0.544595
false
vicky2135/lucious
oscar/lib/python2.7/site-packages/prompt_toolkit/token.py
23
1420
""" The Token class, interchangeable with ``pygments.token``. A `Token` has some semantics for a piece of text that is given a style through a :class:`~prompt_toolkit.styles.Style` class. A pygments lexer for instance, returns a list of (Token, text) tuples. Each fragment of text has a token assigned, which when combi...
bsd-3-clause
1,900,132,577,199,305,000
29.212766
78
0.689437
false
jeffmahoney/crash-python
crash/commands/syscmd.py
1
2069
# -*- coding: utf-8 -*- # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: """ SUMMARY ------- Display system information and configuration data :: sys [config] DESCRIPTION ----------- This command displays system-specific data. If no arguments are entered, the same system data shown during crash in...
gpl-2.0
7,658,069,106,556,025,000
25.87013
79
0.60319
false
EmreAtes/spack
var/spack/repos/builtin/packages/startup-notification/package.py
5
1756
############################################################################## # Copyright (c) 2013-2018, 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
825,322,512,889,543,700
44.025641
115
0.691344
false
FMCalisto/FMCalisto.github.io
node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py
65
4989
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import re import os import locale def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it ha...
mit
-873,029,233,404,161,700
29.796296
80
0.642814
false
grevutiu-gabriel/sympy
sympy/geometry/tests/test_plane.py
36
7702
from __future__ import division from sympy import (Abs, I, Dummy, Rational, Float, S, Symbol, cos, oo, pi, simplify, sin, sqrt, symbols, Derivative, asin, acos) from sympy.geometry import (Circle, Curve, Ellipse, GeometryError, Line, Point, Polygon, Ray, RegularPolygon, S...
bsd-3-clause
-2,150,645,828,502,788,000
37.318408
80
0.574137
false
rvalera01/platalist
cloudflare.py
221
2812
import sys,traceback,urllib2,re, urllib,xbmc def createCookie(url,cj=None,agent='Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0'): urlData='' try: import urlparse,cookielib,urllib2 class NoRedirection(urllib2.HTTPErrorProcessor): def http_response(self, reques...
gpl-2.0
2,319,688,773,289,185,000
38.055556
128
0.566501
false
dstftw/youtube-dl
youtube_dl/extractor/r7.py
53
4600
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import int_or_none class R7IE(InfoExtractor): _VALID_URL = r'''(?x) https?:// (?: (?:[a-zA-Z]+)\.r7\.com(?:/[^/]+)+/idmedia/| ...
unlicense
-8,723,090,007,608,064,000
40.0625
524
0.548598
false
jrbl/invenio
modules/webmessage/lib/webmessage.py
20
19732
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 t...
gpl-2.0
7,042,288,233,730,820,000
40.022869
113
0.529799
false
peterlauri/django
django/utils/dateformat.py
7
11927
""" PHP date() style date formatting See http://www.php.net/date for format strings Usage: >>> import datetime >>> d = datetime.datetime.now() >>> df = DateFormat(d) >>> print(df.format('jS F Y H:i')) 7th October 2003 11:39 >>> """ from __future__ import unicode_literals import calendar import datetime import re impo...
bsd-3-clause
-8,929,506,698,178,384,000
30.55291
102
0.552612
false
kyroskoh/js-test-tool
js_test_tool/tests/test_suite.py
3
26335
import unittest import mock import os import os.path from StringIO import StringIO import yaml import copy from textwrap import dedent from lxml import etree from js_test_tool.tests.helpers import TempWorkspaceTestCase from js_test_tool.suite import SuiteDescription, SuiteDescriptionError, \ SuiteRenderer, SuiteR...
apache-2.0
-6,969,714,067,693,987,000
35.98736
90
0.601291
false
elpaso/QGIS
tests/src/python/test_qgsxmlutils.py
3
6048
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsXmlUtils. .. 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. """ __aut...
gpl-2.0
6,973,646,045,881,198,000
28.502439
86
0.615741
false
mlperf/training_results_v0.7
Google/benchmarks/transformer/implementations/transformer-research-TF-tpu-v3-8192/lingvo/tasks/mt/params/wmt14_en_de.py
3
6670
# Lint as: python2, python3 # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
apache-2.0
-923,244,760,926,141,700
31.378641
107
0.632534
false
NickPresta/sentry
src/sentry/migrations/0020_auto__add_projectdomain__add_unique_projectdomain_project_domain.py
6
12686
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models, transaction class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ProjectDomain' db.create_table('sentry_projectdomain', ( ('id', self.gf('...
bsd-3-clause
-2,977,154,033,931,838,500
76.828221
182
0.553366
false
zstackorg/zstack-woodpecker
integrationtest/vm/virtualrouter/vr/test_vr_ha.py
2
1258
''' 1. Create 1 Test VMs with VR. 2. After 1 VM created, Check VR Appliance VM ha status. @author: Quarkonics ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import zstackwoodpecker.operations.ha_operations as...
apache-2.0
-8,793,476,895,990,900,000
26.590909
84
0.635135
false
marzique/cs50_finance
sql.py
1
6312
import datetime import decimal import importlib import logging import re import sqlalchemy import sqlparse import sys import warnings class SQL(object): """Wrap SQLAlchemy to provide a simple SQL API.""" def __init__(self, url, **kwargs): """ Create instance of sqlalchemy.engine.Engine. ...
mit
336,255,576,216,343,800
40.807947
156
0.571293
false
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.6.0/Lib/test/test_importlib/frozen/test_finder.py
17
2105
from .. import abc from .. import util machinery = util.import_importlib('importlib.machinery') import unittest class FindSpecTests(abc.FinderTests): """Test finding frozen modules.""" def find(self, name, path=None): finder = self.machinery.FrozenImporter return finder.find_spec(name, pat...
mit
-7,729,427,689,351,009,000
24.059524
61
0.636105
false
MediaMath/Diamond
src/collectors/beanstalkd/test/testbeanstalkd.py
2
6503
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from test import unittest from test import run_only from mock import Mock from mock import patch from diamond.collector import Coll...
mit
2,683,888,722,091,763,000
33.775401
80
0.448716
false
jtoppins/beaker
SchemaUpgrades/upgrade_0.6.8_system_status_duration.py
2
2652
#!/usr/bin/python import datetime from sqlalchemy import and_ from turbogears.database import session from bkr.server.util import load_config from bkr.server.model import System, SystemStatus, SystemActivity, \ SystemStatusDuration from bkr.server.test.assertions import assert_durations_not_overlapping, \ ...
gpl-2.0
-5,165,479,253,454,364,000
39.8
82
0.653846
false
odooindia/odoo
addons/base_action_rule/base_action_rule.py
12
15745
# -*- 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
6,269,191,399,835,874,000
49.143312
155
0.574913
false
Yannig/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_inventory.py
15
5168
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.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
3,951,237,933,088,589,000
29.579882
122
0.625967
false
nicebug/SuckerTest
web/wsgiserver/ssl_pyopenssl.py
177
9605
"""A library for integrating pyOpenSSL with CherryPy. The OpenSSL module must be importable for SSL functionality. You can obtain it from http://pyopenssl.sourceforge.net/ To use this module, set CherryPyWSGIServer.ssl_adapter to an instance of SSLAdapter. There are two ways to use SSL: Method One ---------- * ``s...
mit
-2,352,369,593,103,696,000
36.519531
86
0.5595
false
scorphus/passpie
passpie/database.py
2
4638
from datetime import datetime import logging import os import shutil from tinydb import TinyDB, Storage, where, Query import yaml from .utils import mkdir_open from .history import Repository from .credential import split_fullname, make_fullname class PasspieStorage(Storage): extension = ".pass" def __init...
mit
-3,531,396,421,367,122,000
34.676923
92
0.57417
false
bharatsingh430/py-R-FCN-multiGPU
lib/datasets/voc_eval.py
12
6938
# -------------------------------------------------------- # Fast/er R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Bharath Hariharan # -------------------------------------------------------- import xml.etree.ElementTree as ET import os import cPickle import numpy as np def parse_rec(f...
mit
-5,088,211,684,464,472,000
33.69
78
0.518882
false
SnappleCap/oh-mainline
vendor/packages/gdata/src/gdata/alt/appengine.py
77
11666
#!/usr/bin/python # # Copyright (C) 2008 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 ...
agpl-3.0
8,934,527,723,085,592,000
35.342679
79
0.674781
false
JKatzwinkel/mps-youtube
mps_youtube/c.py
1
1141
""" Module for holding colour code values. """ import os import re import sys try: # pylint: disable=F0401 from colorama import Fore, Style has_colorama = True except ImportError: has_colorama = False mswin = os.name == "nt" if mswin and has_colorama: white = Style.RESET_ALL ul = Style.DIM...
gpl-3.0
-1,001,906,387,397,352,100
23.804348
82
0.597721
false
b0ttl3z/SickRage
lib/twilio/rest/resources/recordings.py
23
1755
from .util import normalize_dates from .transcriptions import Transcriptions from .base import InstanceResource, ListResource class Recording(InstanceResource): subresources = [Transcriptions] def __init__(self, *args, **kwargs): super(Recording, self).__init__(*args, **kwargs) self.formats...
gpl-3.0
6,504,293,572,577,997,000
28.25
76
0.617664
false
mhbu50/erpnext
erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py
3
1463
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from erpnext.crm.report.campaign_efficiency.campaign_efficiency import get_lead_data def execute(filters=None): columns, da...
gpl-3.0
-2,346,251,921,959,471,600
19.319444
84
0.561859
false
boshnivolo/TIY-Assignments
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/input_test.py
1841
3207
#!/usr/bin/env python # Copyright 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for the input.py file.""" import gyp.input import unittest import sys class TestFindCycles(unittest.TestCase): def setUp(self...
cc0-1.0
5,005,541,937,834,412,000
34.633333
76
0.606174
false
nirmeshk/oh-mainline
vendor/packages/gdata/src/gdata/tlslite/TLSConnection.py
278
70347
""" MAIN CLASS FOR TLS LITE (START HERE!). """ from __future__ import generators import socket from utils.compat import formatExceptionTrace from TLSRecordLayer import TLSRecordLayer from Session import Session from constants import * from utils.cryptomath import getRandomBytes from errors import * from messages impor...
agpl-3.0
3,248,366,208,112,861,000
42.966875
83
0.571936
false
azumimuo/family-xbmc-addon
plugin.video.exodus/resources/lib/sources/tunemovie.py
7
6553
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any l...
gpl-2.0
-7,133,088,544,431,839,000
38.239521
193
0.491988
false
rwatson/chromium-capsicum
third_party/scons/scons-local/SCons/Tool/lex.py
3
3285
"""SCons.Tool.lex Tool-specific initialization for lex. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permiss...
bsd-3-clause
-7,175,742,991,458,954,000
34.322581
89
0.69102
false
czchen/debian-pgcli
pgcli/packages/expanded.py
2
1174
from .tabulate import _text_type def pad(field, total, char=u" "): return field + (char * (total - len(field))) def get_separator(num, header_len, data_len): total_len = header_len + data_len + 1 sep = u"-[ RECORD {0} ]".format(num) if len(sep) < header_len: sep = pad(sep, header_len - 1, u"-...
bsd-3-clause
-3,052,752,594,920,172,500
26.302326
66
0.560477
false
spadae22/odoo
addons/procurement/__openerp__.py
267
2661
# -*- 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
7,738,974,027,935,920,000
41.238095
92
0.650507
false
LuqueDaniel/ninja-ide
ninja_ide/gui/editor/checkers/__init__.py
7
1735
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE 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 # any later version. # # NIN...
gpl-3.0
-8,535,606,142,940,938,000
35.93617
74
0.721037
false
primoz-k/cookiecutter-django
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/contrib/sites/migrations/0001_initial.py
348
1025
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.contrib.sites.models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Site', fields=[ ...
bsd-3-clause
-4,517,479,185,735,276,500
32.064516
161
0.545366
false
slightlymadphoenix/activityPointsApp
activitypoints/lib/python3.5/site-packages/django/db/backends/mysql/base.py
44
16091
""" MySQL database backend for Django. Requires mysqlclient: https://pypi.python.org/pypi/mysqlclient/ MySQLdb is supported for Python 2 only: http://sourceforge.net/projects/mysql-python """ from __future__ import unicode_literals import datetime import re import sys import warnings from django.conf import settings...
mit
85,078,328,415,849,150
40.153453
117
0.614381
false
resmo/ansible
test/units/modules/network/onyx/test_onyx_ospf.py
68
4494
# # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.onyx impor...
gpl-3.0
6,812,963,723,654,281,000
41.396226
92
0.607254
false
moreati/django-allauth
allauth/socialaccount/providers/twitch/views.py
62
1037
import requests from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView) from .provider import TwitchProvider class TwitchOAuth2Adapter(OAuth2Adapt...
mit
-8,457,046,543,988,817,000
40.48
77
0.605593
false
papaloizouc/battlehack2014
website/spameggs/spameggs/settings.py
1
2945
""" Django settings for spameggs project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) i...
gpl-2.0
7,750,703,412,366,322,000
21.653846
72
0.663158
false
sugarlabs/sugar
src/jarabe/model/notifications.py
4
4491
# Copyright (C) 2008 One Laptop Per Child # # 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 distribu...
gpl-3.0
-3,469,826,087,039,333,000
34.085938
79
0.56758
false
giorgiop/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py
73
2264
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <olivie...
bsd-3-clause
-4,758,878,166,487,475,000
31.342857
78
0.735424
false
sarakha63/persomov
libs/git/ref.py
110
2981
# Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com> # 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 li...
gpl-3.0
2,606,914,636,875,828,000
49.525424
84
0.651459
false
RevolutionMC/Revolution
plugin.video.PsychoTV/resources/lib/libraries/f4mproxy/f4mDownloader.py
55
38147
import xml.etree.ElementTree as etree import base64 from struct import unpack, pack import sys import io import os import time import itertools import xbmcaddon import xbmc import urllib2,urllib import traceback import urlparse import posixpath import re import hmac import hashlib import binascii import zlib from hash...
gpl-2.0
-6,673,248,678,854,322,000
43.049654
548
0.577791
false
bzennn/blog_flask
python/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py
354
5544
"""A collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to do implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method taking a ...
gpl-3.0
8,496,672,513,950,690,000
37.769231
94
0.525072
false
chys87/pyCxxLookup
cxxlookup/expr.py
1
28952
#!/usr/bin/env python3 # vim: set ts=4 sts=4 sw=4 expandtab cc=80: # Copyright (c) 2014, 2016, chys <admin@CHYS.INFO> # 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 sour...
bsd-3-clause
631,598,003,262,371,100
29.443743
79
0.522693
false
crosswalk-project/crosswalk-test-suite
webapi/tct-csp-w3c-tests/csp-py/csp_ro_style-src_cross-origin.py
23
3064
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "style-src " + url1 ...
bsd-3-clause
8,381,908,714,418,443,000
38.792208
103
0.615862
false
liuwenf/moose
framework/contrib/nsiqcppstyle/rules/RULE_4_1_A_A_use_tab_for_indentation.py
43
1770
""" Use tabs for indentation. This rule check if the each line starts with a space. In addition, it suppresses the violation when the line contains only spaces and tabs. == Violation == void Hello() { [SPACE][SPACE]Hello(); <== Violation. Spaces are used for indentation. } == Good == void Hello()...
lgpl-2.1
899,098,830,497,844,400
23.929577
125
0.566102
false
Omegaphora/external_deqp
android/scripts/common.py
6
5274
# -*- coding: utf-8 -*- import os import re import sys import shlex import subprocess import multiprocessing class NativeLib: def __init__ (self, apiVersion, abiVersion): self.apiVersion = apiVersion self.abiVersion = abiVersion def getPlatform (): if sys.platform.startswith('linux'): return 'linux' else: ...
apache-2.0
100,138,489,912,904,580
24.852941
106
0.675958
false
Nikoala/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/vidme.py
36
2580
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, float_or_none, str_to_int, ) class VidmeIE(InfoExtractor): _VALID_URL = r'https?://vid\.me/(?:e/)?(?P<id>[\da-zA-Z]+)' _TEST = { 'url': 'https://vid.me/QNB', 'md...
gpl-3.0
8,308,384,121,911,167,000
36.941176
101
0.547674
false
lseyesl/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/comments.py
148
2030
# Copyright (c) 2009 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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...
bsd-3-clause
-2,630,273,562,701,257,000
47.333333
87
0.773399
false
Daksh/sugar-toolkit-gtk3
src/sugar3/graphics/palettemenu.py
2
7416
# Copyright 2012 One Laptop Per Child # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed ...
lgpl-2.1
-2,447,443,035,988,233,000
35.352941
77
0.582255
false
Vixionar/django
tests/forms_tests/widget_tests/test_selectmultiple.py
145
4951
from django.forms import SelectMultiple from .base import WidgetTest class SelectMultipleTest(WidgetTest): widget = SelectMultiple() numeric_choices = (('0', '0'), ('1', '1'), ('2', '2'), ('3', '3'), ('0', 'extra')) def test_render_selected(self): self.check_html(self.widget, 'beatles', ['J'], c...
bsd-3-clause
-7,946,617,110,642,536,000
38.608
95
0.531812
false
wzbozon/statsmodels
statsmodels/sandbox/km_class.py
31
11748
#a class for the Kaplan-Meier estimator from statsmodels.compat.python import range import numpy as np from math import sqrt import matplotlib.pyplot as plt class KAPLAN_MEIER(object): def __init__(self, data, timesIn, groupIn, censoringIn): raise RuntimeError('Newer version of Kaplan-Meier class available...
bsd-3-clause
-5,926,520,682,033,970,000
47.95
91
0.490637
false
pdellaert/ansible
contrib/vault/azure_vault.py
37
23745
#!/usr/bin/env python # # This script borrows a great deal of code from the azure_rm.py dynamic inventory script # that is packaged with Ansible. This can be found in the Ansible GitHub project at: # https://github.com/ansible/ansible/blob/devel/contrib/inventory/azure_rm.py # # The Azure Dynamic Inventory script was ...
gpl-3.0
2,316,225,355,410,499,600
39.109797
119
0.620594
false
ypu/tp-qemu
qemu/tests/timerdevice_tscwrite.py
3
1850
import logging from autotest.client.shared import error from autotest.client import utils @error.context_aware def run(test, params, env): """ Timer device tscwrite test: 1) Check for an appropriate clocksource on host. 2) Boot the guest. 3) Download and compile the newest msr-tools. 4) Execu...
gpl-2.0
4,940,656,101,771,483,000
32.035714
79
0.651351
false
timcera/hspfbintoolbox
tests/test_catalog.py
1
115314
# -*- coding: utf-8 -*- """ catalog ---------------------------------- Tests for `hspfbintoolbox` module. """ import csv import shlex import subprocess import sys from unittest import TestCase from pandas.testing import assert_frame_equal try: from cStringIO import StringIO except: from io import StringIO ...
bsd-3-clause
8,752,432,432,512,541,000
49.821507
84
0.647059
false
rossburton/yocto-autobuilder
lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/process/users/manual.py
4
9675
# This file is part of Buildbot. Buildbot 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 distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
-1,914,069,743,502,281,700
40.346154
82
0.514935
false
jaap-karssenberg/zim-desktop-wiki
zim/gui/templateeditordialog.py
1
6069
# Copyright 2012 Jaap Karssenberg <jaap.karssenberg@gmail.com> from gi.repository import Gtk from zim.newfs import LocalFile from zim.newfs.helpers import TrashHelper, TrashNotSupportedError from zim.config import XDG_DATA_HOME, data_file from zim.templates import list_template_categories, list_templates from zim.g...
gpl-2.0
7,698,457,529,109,229,000
28.038278
82
0.697644
false
joeythesaint/yocto-autobuilder
lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/test/test_dirdbm.py
41
5859
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for dirdbm module. """ import os, shutil, glob from twisted.trial import unittest from twisted.persisted import dirdbm class DirDbmTestCase(unittest.TestCase): def setUp(self): self.path = self.mktemp() sel...
gpl-2.0
-1,985,087,264,942,400,000
33.464706
119
0.569551
false
colinnewell/odoo
addons/website/tests/test_crawl.py
251
3415
# -*- coding: utf-8 -*- import logging import urlparse import time import lxml.html import openerp import re _logger = logging.getLogger(__name__) class Crawler(openerp.tests.HttpCase): """ Test suite crawling an openerp CMS instance and checking that all internal links lead to a 200 response. If a use...
agpl-3.0
5,025,868,008,489,267,000
34.572917
152
0.534407
false
drduh/config
lighttpd/upload.py
1
1501
#!/usr/bin/env python3 # https://github.com/drduh/config/blob/master/lighttpd/upload.py # Simple file uploader # Put into /var/www/cgi-bin/, make executable and enable CGI import cgi import os CHUNK_SIZE = 100000 UPLOAD = "/var/www/upload/" HEADER = """ <html><head><title>%s</title> <style type="text/css"> body { ...
mit
8,360,567,450,956,556,000
20.753623
64
0.567622
false
switowski/invenio
invenio/legacy/ckeditor/connector.py
13
5954
# -*- coding: utf-8 -*- # Comments and reviews for records. # This file is part of Invenio. # Copyright (C) 2008, 2010, 2011 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 ...
gpl-2.0
1,420,174,824,186,686,000
44.106061
339
0.634699
false
Lcaracol/ideasbox.lan
ideasbox/library/models.py
1
3341
from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.utils.translation import ugettext_lazy as _ from taggit.managers import TaggableManager from ideasbox.models import TimeStampedModel from ideasbox.search.models import SearchableQuerySet, SearchMixin...
mit
5,770,914,993,431,909,000
35.315217
78
0.6085
false
nvoron23/socialite
test/test_attrs.py
3
1423
""" Testing attribute/function access in a query. """ import unittest class TesetAttrs(unittest.TestCase): def __init__(self, methodName='runTest'): unittest.TestCase.__init__(self, methodName) `Foo(int i, Avg avg) groupby(1). Bar(int i).` def setUp(self): `clear Foo. ...
apache-2.0
-5,227,690,993,091,358,000
25.849057
81
0.505271
false
joshwalawender/POCS
pocs/scheduler/field.py
2
1797
from astroplan import FixedTarget from astropy.coordinates import SkyCoord from pocs import PanBase class Field(FixedTarget, PanBase): def __init__(self, name, position, equinox='J2000', **kwargs): """ An object representing an area to be observed A `Field` corresponds to an `~astroplan.Observi...
mit
-8,694,060,924,666,827,000
36.4375
106
0.432387
false
rdblue/Impala
testdata/bin/wait-for-hiveserver2.py
14
3445
#!/usr/bin/env impala-python # Copyright (c) 2012 Cloudera, 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...
apache-2.0
5,044,775,257,845,434,000
41.012195
87
0.727141
false
emfcamp/micropython
tests/basics/int1.py
44
1559
print(int(False)) print(int(True)) print(int(0)) print(int(1)) print(int(+1)) print(int(-1)) print(int('0')) print(int('+0')) print(int('-0')) print(int('1')) print(int('+1')) print(int('-1')) print(int('01')) print(int('9')) print(int('10')) print(int('+10')) print(int('-10')) print(int('12')) print(int('-12')) prin...
mit
-5,957,200,644,984,093,000
16.516854
59
0.563823
false
skuda/client-python
kubernetes/client/models/apps_v1beta1_deployment_strategy.py
1
4125
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
apache-2.0
8,397,912,927,662,578,000
28.464286
105
0.572606
false
kennedyshead/home-assistant
homeassistant/components/vultr/sensor.py
5
3249
"""Support for monitoring the state of Vultr Subscriptions.""" import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import CONF_MONITORED_CONDITIONS, CONF_NAME, DATA_GIGABYTES import homeassistant.helpers.config_validation as cv fr...
apache-2.0
-2,779,895,684,992,299,000
28.536364
84
0.642351
false
sf-wind/caffe2
caffe2/python/caffe_translator.py
3
35395
# Copyright (c) 2016-present, Facebook, 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...
apache-2.0
2,941,573,585,728,819,700
36.455026
90
0.616217
false
Ormod/Diamond
src/collectors/interrupt/soft.py
54
2024
# coding=utf-8 """ The SoftInterruptCollector collects metrics on software interrupts from /proc/stat #### Dependencies * /proc/stat """ import platform import os import diamond.collector # Detect the architecture of the system # and set the counters for MAX_VALUES # appropriately. Otherwise, rolling over # coun...
mit
-4,929,603,325,396,078,000
23.385542
73
0.553854
false
louietsai/python-for-android
python3-alpha/python3-src/Lib/idlelib/configHandler.py
48
28730
"""Provides access to stored IDLE configuration information. Refer to the comments at the beginning of config-main.def for a description of the available configuration files and the design implemented to update user configuration information. In particular, user configuration choices which duplicate the defaults will...
apache-2.0
-7,320,093,801,106,819,000
39.809659
83
0.563174
false
ASlave2Audio/Restaurant-App
mingw/bin/lib/lib2to3/pytree.py
325
29039
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """ Python parse tree definitions. This is a very concrete parse tree; we need to keep every token and even the comments and whitespace between tokens. There's also a pattern matching implementation here. """ __autho...
mit
7,885,396,676,802,129,000
31.738444
88
0.555322
false
ryfeus/lambda-packs
Tensorflow_Pandas_Numpy/source3.6/tensorflow/contrib/opt/python/training/nadam_optimizer.py
57
4017
# 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...
mit
7,756,948,106,105,243,000
42.193548
80
0.643266
false
partofthething/home-assistant
homeassistant/components/hlk_sw16/switch.py
16
1200
"""Support for HLK-SW16 switches.""" from homeassistant.components.switch import ToggleEntity from . import DATA_DEVICE_REGISTER, SW16Device from .const import DOMAIN PARALLEL_UPDATES = 0 def devices_from_entities(hass, entry): """Parse configuration and add HLK-SW16 switch devices.""" device_client = hass....
mit
2,793,657,185,546,965,500
29
75
0.664167
false
srom/chessbot
estimator/train/parse_logs/__main__.py
1
1947
from __future__ import unicode_literals import argparse import logging import re logger = logging.getLogger(__name__) def main(log_path): for log_line in yield_train_log_line(log_path): print log_line break class TrainLogLine(object): __slots__ = ('iteration', 'elapsed', 'test_loss', 'tra...
mit
6,165,180,149,807,101,000
24.618421
130
0.54905
false