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
eayunstack/nova
nova/tests/objects/test_instance.py
4
54406
# Copyright 2013 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 agree...
apache-2.0
718,426,613,512,638,200
45.302979
79
0.553248
false
Vagab0nd/SiCKRAGE
sickchill/oldbeard/providers/kat.py
1
7549
import re import traceback import urllib from collections import OrderedDict from urllib.parse import urljoin import validators from sickchill import logger from sickchill.helper.common import convert_size, try_int from sickchill.oldbeard import tvcache from sickchill.oldbeard.bs4_parser import BS4Parser from sickchi...
gpl-3.0
2,564,928,592,693,131,300
43.934524
164
0.522851
false
jackrzhang/zulip
zerver/tests/test_timestamp.py
14
1871
from django.utils.timezone import utc as timezone_utc from zerver.lib.test_classes import ZulipTestCase from zerver.lib.timestamp import floor_to_hour, floor_to_day, ceiling_to_hour, \ ceiling_to_day, timestamp_to_datetime, datetime_to_timestamp, \ TimezoneNotUTCException, convert_to_UTC from datetime import...
apache-2.0
-4,594,811,745,338,252,300
44.634146
97
0.643506
false
lnielsen/invenio
invenio/legacy/bibedit/webinterface.py
2
13635
## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011, 2014 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
-1,200,456,052,752,920,800
42.148734
138
0.512578
false
hbrls/weixin-api-mockup
appl/jssdk/views.py
1
1060
# -*- coding: utf-8 -*- import logging from uuid import uuid4 from flask import Blueprint, request, current_app, jsonify _logger = logging.getLogger(__name__) mod = Blueprint('jssdk', __name__, template_folder='templates') @mod.route('/cgi-bin/ticket/getticket', methods=['GET']) def getticket(): """ 获取 j...
mit
-823,091,781,175,057,400
25
171
0.586538
false
rahiel/shellstats
shellstats.py
1
3629
# -*- coding: utf-8 -*- from __future__ import division from os import getenv from os.path import isfile from sys import exit import click @click.command() @click.option("--n", default=10, help="How many commands to show.") @click.option("--plot", is_flag=True, help="Plot command usage in pie chart.") @click.option(...
mit
8,060,386,650,571,835,000
34.930693
87
0.567925
false
18padx08/PPTex
PPTexEnv_x86_64/lib/python2.7/site-packages/sympy/core/tests/test_eval_power.py
9
11820
from sympy.core import (Rational, Symbol, S, Float, Integer, Number, Pow, Basic, I, nan, pi, symbols) from sympy.core.tests.test_evalf import NS from sympy.functions.elementary.miscellaneous import sqrt, cbrt from sympy.functions.elementary.exponential import exp, log from sympy.functions.elementary.trigonometric impor...
mit
-7,808,279,482,758,563,000
34.178571
91
0.521997
false
woltage/ansible-modules-core
web_infrastructure/django_manage.py
5
11099
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Scott Anderson <scottanderson42@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 o...
gpl-3.0
5,044,081,640,488,415,000
38.219081
215
0.655104
false
mdavid/cherokee-webserver-svnclone
admin/plugins/ssi.py
3
1122
# -*- coding: utf-8 -*- # # Cherokee-admin # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2010 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the Free Softwa...
gpl-2.0
-3,857,819,819,776,940,000
32
67
0.717469
false
snakeleon/YouCompleteMe-x86
python/ycm/tests/event_notification_test.py
1
18402
# coding: utf-8 # # Copyright (C) 2015-2016 YouCompleteMe contributors # # This file is part of YouCompleteMe. # # YouCompleteMe 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
-7,903,755,591,903,361,000
36.365854
80
0.63713
false
partofthething/home-assistant
tests/components/zwave/test_climate.py
16
32535
"""Test Z-Wave climate devices.""" import pytest from homeassistant.components.climate.const import ( ATTR_TARGET_TEMP_HIGH, ATTR_TARGET_TEMP_LOW, CURRENT_HVAC_COOL, CURRENT_HVAC_HEAT, HVAC_MODE_COOL, HVAC_MODE_HEAT, HVAC_MODE_HEAT_COOL, HVAC_MODE_OFF, HVAC_MODES, PRESET_AWAY, ...
mit
5,659,001,596,047,276,000
35.55618
88
0.678684
false
inspirehep/sqlalchemy
lib/sqlalchemy/ext/associationproxy.py
45
33253
# ext/associationproxy.py # Copyright (C) 2005-2015 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 """Contain the ``AssociationProxy`` class. The ``AssociationProxy`` is a Py...
mit
-2,829,490,381,578,768,000
30.341188
79
0.581812
false
gautam1858/tensorflow
tensorflow/python/keras/applications/nasnet.py
17
1814
# 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 # # Unless required by applica...
apache-2.0
-1,192,352,238,814,521,300
34.568627
80
0.728776
false
aadrian/w2ui
server/python/django_w2ui/django_w2ui/demo/migrations/0001_initial.py
25
4991
# -*- 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 model 'Tipo_User' db.create_table(u'demo_tipo_user', ( ...
mit
4,548,978,994,194,011,000
71.347826
194
0.58866
false
reinhrst/hooks
checks/compile.py
1
4934
import os import subprocess from . import base from . import filetype from . import status class CompileCheck(base.PerFileCheck): COMPILECOMMAND = [] ONLY_IF_OLDFILE_COMPILES = True def prepareOldFileDir(self, dirname): return dirname def checkOldFile(self, changedFile): with base.T...
mit
-2,194,930,266,072,547,600
36.953846
79
0.541548
false
davehunt/kuma
vendor/packages/nose/plugins/xunit.py
48
11667
"""This plugin provides test results in the standard XUnit XML format. It's designed for the `Jenkins`_ (previously Hudson) continuous build system, but will probably work for anything else that understands an XUnit-formatted XML representation of test results. Add this shell command to your builder :: nosetests...
mpl-2.0
3,531,498,034,428,540,400
33.214076
81
0.563898
false
codeaudit/pattern-1
pattern/web/json/encoder.py
26
21771
"""Implementation of JSONEncoder """ import re from decimal import Decimal def _import_speedups(): try: import _speedups return _speedups.encode_basestring_ascii, _speedups.make_encoder except ImportError: return None, None c_encode_basestring_ascii, c_make_encoder = _import_speedups() ...
bsd-3-clause
-2,631,113,945,259,697,000
37.396825
87
0.527123
false
mkhuthir/learnPython
Book_pythonlearn_com/code3/bs4/__init__.py
20
18244
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup uses a pluggable XML or HTML parser to parse a (possibly invalid) document into a tree representation. Beautiful Soup provides provides methods and Pythonic idioms that make it easy to navigate...
mit
7,125,214,579,258,331,000
37.982906
467
0.591373
false
pbaesse/Sissens
lib/python2.7/site-packages/sqlalchemy/orm/path_registry.py
28
7751
# orm/path_registry.py # Copyright (C) 2005-2017 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 """Path tracking utilities, representing mapper graph traversals. """ from .. ...
gpl-3.0
832,123,739,482,167,700
27.601476
76
0.595536
false
EntityFXCode/arsenalsuite
cpp/lib/PyQt4/examples/demos/embeddeddialogs/embeddeddialogs.py
15
9138
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2010 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
gpl-2.0
-6,895,222,502,349,413,000
38.387931
129
0.646312
false
yencarnacion/jaikuengine
.google_appengine/lib/django-1.2/django/db/backends/sqlite3/introspection.py
65
5857
import re from django.db.backends import BaseDatabaseIntrospection # This light wrapper "fakes" a dictionary interface, because some SQLite data # types include variables in them -- e.g. "varchar(30)" -- and can't be matched # as a simple dictionary lookup. class FlexibleFieldLookupDict: # Maps SQL types to Django...
apache-2.0
-8,169,105,904,665,678,000
40.539007
112
0.575209
false
mrbandrews/bitcoin
qa/rpc-tests/netutil.py
8
4561
#!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Linux network utilities import sys import socket import fcntl import struct import array import os import bin...
mit
-5,939,139,010,465,586,000
31.81295
113
0.583644
false
chacoroot/planetary
addons/hr_expense/__init__.py
436
1079
# -*- 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
-2,422,844,497,721,098,000
40.5
78
0.617238
false
chaubold/opengm
src/interfaces/python/test.py
2
52311
import numpy import opengm import os import sys import random import opengm.learning class TestAllExampes: def test_run(self): for r, d, f in os.walk("examples"): for files in f: if files.endswith(".py"): if(not str(files).endswith('gui.py')): ...
mit
814,070,450,038,851,300
39.394595
157
0.531877
false
fengbeihong/tempest_automate_ironic
tempest/scenario/test_load_balancer_basic.py
4
13056
# Copyright 2014 Mirantis.inc # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
7,608,615,314,487,169,000
39.9279
79
0.559053
false
prospwro/odoo
addons/hr_evaluation/__init__.py
432
1084
# -*- encoding: 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 G...
agpl-3.0
930,902,949,428,508,300
40.692308
78
0.619004
false
yiannist/ganeti
test/py/ganeti.locking_unittest.py
9
34568
#!/usr/bin/python # # Copyright (C) 2006, 2007, 2010 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: # # 1. Redistributions of source code must retain the above copyright notice, # ...
bsd-2-clause
-6,438,217,864,445,574,000
29.322807
79
0.650486
false
hamiltont/CouchPotatoServer
couchpotato/core/_base/_core/__init__.py
16
3338
from .main import Core from uuid import uuid4 def start(): return Core() config = [{ 'name': 'core', 'order': 1, 'groups': [ { 'tab': 'general', 'name': 'basics', 'description': 'Needs restart before changes take effect.', 'wizard': True, ...
gpl-3.0
1,166,122,914,705,334,300
32.38
111
0.334332
false
GREO/gnuradio-git
gnuradio-examples/python/usrp2/qt_wfm_interface.py
10
6160
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'qt_wfm_interface.ui' # # Created: Thu Jun 18 23:41:03 2009 # by: PyQt4 UI code generator 4.4.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_InterfaceWindow(object): def setupUi(...
gpl-3.0
8,151,632,256,941,568,000
61.222222
142
0.730195
false
mtr574/Midburn-ThemeCamps
midburn/models.py
3
4096
from django.db import models from django.contrib.auth.models import User CAMPSTATUS = ( (0, 'Deleted'), (1, 'Accepting new members'), (2, 'Closed to new members'), (3, 'Camp will not come to Midburn 2016'), ) # Create your models here. class Camp(models.Model): users = models.ManyToManyField(User) ...
apache-2.0
4,628,022,054,827,346,000
30.751938
96
0.671387
false
gartung/dxr
dxr/plugins/rust/__init__.py
1
40098
"""DXR plugin for Rust. Relies on output from running rustc with -Zsave-analysis It is somewhat painful dealing with the untyped-ness of the CSV input. We want to treat all ids as ints rather than strings, getting this wrong causes annoying bugs because Python will not check the type of things, but does distinguish be...
mit
-8,749,179,638,295,343,000
36.721543
246
0.561699
false
olafhauk/mne-python
mne/io/bti/read.py
14
2981
# Authors: Denis A. Engemann <denis.engemann@gmail.com> # simplified BSD-3 license import numpy as np from ..utils import read_str def _unpack_matrix(fid, rows, cols, dtype, out_dtype): """Unpack matrix.""" dtype = np.dtype(dtype) string = fid.read(int(dtype.itemsize * rows * cols)) out =...
bsd-3-clause
-2,974,149,963,007,538,700
24.698276
62
0.621268
false
briancoutinho0905/2dsampling
ext/ply/test/yacc_error3.py
174
1485
# ----------------------------------------------------------------------------- # yacc_error3.py # # Bad p_error() function # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import tokens # ...
bsd-3-clause
2,357,410,049,017,217,000
21.164179
79
0.491582
false
ahmadRagheb/goldenHR
erpnext/config/hr.py
19
6497
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("Employee and Attendance"), "items": [ { "type": "doctype", "name": "Employee", "description": _("Employee records."), }, { "type": "doctype", "name": "Employee Attendance To...
gpl-3.0
3,082,866,873,085,429,000
19.560127
80
0.487764
false
fhaoquan/kbengine
kbe/src/lib/python/Lib/tkinter/_fix.py
76
2897
import sys, os # Delay import _tkinter until we have set TCL_LIBRARY, # so that Tcl_FindExecutable has a chance to locate its # encoding directory. # Unfortunately, we cannot know the TCL_LIBRARY directory # if we don't know the tcl version, which we cannot find out # without import Tcl. Fortunately, Tcl will itself ...
lgpl-3.0
3,164,252,328,874,640,000
36.141026
74
0.574732
false
CG-F16-4-Rutgers/steersuite-rutgers
steerstats/steersuitedb/Test.py
8
7607
import psycopg2 import psycopg2.extras from steersuitedb.Util import getTime from Sequence import TestSequence # this is not completely encapsulated by another transaction so it should # be used by the client when inserting data class Test(object): """A simple example class""" __id_name = "test_id" __tabl...
gpl-3.0
-3,820,726,596,370,665,500
30.695833
193
0.604838
false
valkjsaaa/sl4a
python/gdata/tests/gdata_tests/youtube/service_test.py
89
23513
#!/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 ...
apache-2.0
9,138,632,734,908,374,000
39.821181
80
0.702505
false
yanheven/console
openstack_dashboard/dashboards/project/network_topology/routers/tables.py
8
1108
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 NTT Innovation Institute 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...
apache-2.0
45,672,959,536,783,200
34.741935
78
0.720217
false
bartvm/pylearn2
pylearn2/datasets/tests/test_dense_design_matrix.py
12
3329
import numpy as np from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix from pylearn2.datasets.dense_design_matrix import DenseDesignMatrixPyTables from pylearn2.datasets.dense_design_matrix import DefaultViewConverter from pylearn2.datasets.dense_design_matrix import from_dataset from pylearn2.utils im...
bsd-3-clause
-4,092,660,507,010,322,000
29.824074
75
0.651247
false
bopo/tablib
tablib/packages/xlwt3/ExcelFormulaParser.py
46
22812
### $ANTLR 2.7.7 (20060930): "xlwt/excel-formula.g" -> "ExcelFormulaParser.py"$ ### import antlr and other modules .. import sys from . import antlr ### header action >>> import struct from . import Utils from .UnicodeUtils import upack1 from .ExcelMagic import * _RVAdelta = {"R": 0, "V": 0x20, "A": 0x...
mit
-3,495,928,913,831,055,400
32.616085
143
0.441785
false
geometalab/osmaxx
tests/conversion/converters/inside_worker_test/nonop_way_test.py
2
7148
from contextlib import closing import pytest import sqlalchemy from sqlalchemy.sql.schema import Table as DbTable from osmaxx.utils.frozendict import frozendict from tests.conftest import TagCombination from tests.conversion.converters.inside_worker_test.conftest import slow from tests.conversion.converters.inside_wo...
mit
591,218,811,448,632,800
34.386139
118
0.718243
false
guewen/connector
connector/tests/test_mapper.py
1
20300
# -*- coding: utf-8 -*- import unittest2 import mock import openerp.tests.common as common from openerp.addons.connector.unit.mapper import ( Mapper, ImportMapper, ImportMapChild, MappingDefinition, changed_by, only_create, convert, m2o_to_backend, backend_to_m2o, none, Map...
agpl-3.0
-408,886,055,127,792,100
34.243056
97
0.503793
false
austinhyde/ansible-modules-core
cloud/openstack/os_nova_flavor.py
93
6844
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # 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 the License, or # (at your option) any late...
gpl-3.0
-3,063,250,834,862,408,700
27.877637
77
0.585184
false
vivianli32/TravelConnect
flask/lib/python3.4/site-packages/whoosh/matching/binary.py
94
24452
# Copyright 2010 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...
mit
1,762,680,918,025,518,800
29.450809
79
0.537625
false
geekaia/edx-platform
cms/envs/aws_migrate.py
87
1229
""" A Django settings file for use on AWS while running database migrations, since we don't want to normally run the LMS with enough privileges to modify the database schema. """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=...
agpl-3.0
-6,698,457,249,484,909,000
39.966667
81
0.715216
false
evilgroot/ethercut
ethercut/master.py
1
6570
# coding: utf-8 # ETHERCUT SUITE # Author: Ivan 'evilgroot' Luengo # Email: evilgroot@gmail.com # This project is released under a GPLv3 license """ Master: Handles the program loop """ import pcap, Queue, logging import contextlib import ethercut.ui as ui import ethercut.log as log import ethercut...
gpl-3.0
-3,700,081,429,847,109,000
33.578947
101
0.568341
false
hetajen/vnpy161
vn.api/vn.ctp/py3/pyscript/ctp_struct.py
40
315084
# encoding: UTF-8 structDict = {} #////////////////////////////////////////////////////////////////////// #@system 新一代交易所系统 #@company 上海期货信息技术有限公司 #@file ThostFtdcUserApiStruct.h #@brief 定义了客户端接口使用的业务数据结构 #@history #////////////////////////////////////////////////////////////////////// #信息分发 CThostFtdcDis...
mit
3,841,622,015,476,943,400
29.514254
111
0.817871
false
chen0510566/MissionPlanner
Lib/distutils/ccompiler.py
50
49641
"""distutils.ccompiler Contains CCompiler, an abstract base class that defines the interface for the Distutils compiler abstraction model.""" __revision__ = "$Id$" import sys import os import re from distutils.errors import (CompileError, LinkError, UnknownFileError, Distut...
gpl-3.0
-1,847,854,513,878,652,000
41.354585
86
0.590742
false
michaelkuty/django-oscar
tests/integration/basket/form_tests.py
45
3927
from django.test import TestCase from django.conf import settings import mock from oscar.apps.basket import forms from oscar.test import factories class TestBasketLineForm(TestCase): def setUp(self): self.basket = factories.create_basket() self.line = self.basket.all_lines()[0] def mock_ava...
bsd-3-clause
-5,335,687,175,264,762,000
34.7
79
0.639929
false
sofianehaddad/ot-svn
python/test/t_FORM_sensitivity.py
2
3930
#! /usr/bin/env python from openturns import * from math import * from math import * def printNumericalPoint(point, digits): oss = "[" eps = pow(0.1, digits) for i in range(point.getDimension()): if i == 0: sep = "" else: sep = "," if fabs(point[i]) < eps:...
mit
-928,647,824,808,329,200
30.95122
95
0.654453
false
cmshobe/landlab
landlab/io/esri_ascii.py
3
17226
#! /usr/bin/env python """Read/write data from an ESRI ASCII file into a RasterModelGrid. ESRI ASCII functions ++++++++++++++++++++ .. autosummary:: ~landlab.io.esri_ascii.read_asc_header ~landlab.io.esri_ascii.read_esri_ascii ~landlab.io.esri_ascii.write_esri_ascii """ import os import pathlib import r...
mit
-1,968,568,468,763,445,800
28.24618
128
0.582492
false
swiftstack/swift
swift/obj/server.py
1
67311
# Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
5,072,200,039,205,637,000
45.90662
79
0.588091
false
Zarokka/exaile
plugins/lastfmlove/__init__.py
4
10746
# Copyright (C) 2011 Mathias Brodala <info@noctus.net> # # 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 progr...
gpl-2.0
-6,094,412,419,796,677,000
29.9683
86
0.594268
false
40223149/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/zipfile.py
620
66368
""" Read and write ZIP files. XXX references to utf-8 need further investigation. """ import io import os import re import imp import sys import time import stat import shutil import struct import binascii try: import zlib # We may need its compression method crc32 = zlib.crc32 except ImportError: zlib =...
gpl-3.0
-8,797,345,527,266,180,000
36.390423
103
0.547432
false
double12gzh/nova
nova/api/openstack/compute/contrib/os_tenant_networks.py
8
8472
# Copyright 2013 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
-5,706,419,390,907,437,000
36.321586
78
0.596553
false
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.2/Lib/importlib/test/source/test_abc_loader.py
51
31363
import importlib from importlib import abc from .. import abc as testing_abc from .. import util from . import util as source_util import imp import inspect import io import marshal import os import sys import types import unittest import warnings class SourceOnlyLoaderMock(abc.SourceLoader): # Globals that sh...
mit
741,450,913,225,220,600
34.797945
79
0.598744
false
cccfran/sympy
sympy/polys/tests/test_modulargcd.py
125
9007
from sympy.polys.rings import ring from sympy.polys.domains import ZZ, QQ, AlgebraicField from sympy.polys.modulargcd import ( modgcd_univariate, modgcd_bivariate, _chinese_remainder_reconstruction_multivariate, modgcd_multivariate, _to_ZZ_poly, _to_ANP_poly, func_field_modgcd, _func_fie...
bsd-3-clause
3,054,125,712,414,328,300
26.713846
108
0.512157
false
e-q/scipy
scipy/sparse/linalg/tests/test_pydata_sparse.py
19
5954
import pytest import numpy as np import scipy.sparse as sp import scipy.sparse.linalg as splin from numpy.testing import assert_allclose try: import sparse except Exception: sparse = None pytestmark = pytest.mark.skipif(sparse is None, reason="pydata/sparse not installed") ...
bsd-3-clause
6,461,715,653,502,411,000
24.33617
76
0.633692
false
bright-sparks/chromium-spacewalk
chrome/browser/metrics/variations/generate_resources_map_unittest.py
16
3094
#!/usr/bin/python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unittests for generate_resources_map.py""" import unittest import generate_resources_map class GenerateResourcesMapUnittest(unittest...
bsd-3-clause
-721,776,451,401,817,700
33
80
0.62702
false
deshipu/micropython
tests/basics/int1.py
46
1581
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
-1,526,860,424,142,122,800
16.566667
59
0.5642
false
jayme-github/CouchPotatoServer
libs/enzyme/real.py
180
4547
# -*- coding: utf-8 -*- # enzyme - Video metadata parser # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # Copyright 2003-2006 Thomas Schueppel <stain@acm.org> # Copyright 2003-2006 Dirk Meyer <dischi@freevo.org> # # This file is part of enzyme. # # enzyme is free software; you can redistribute it and/or mod...
gpl-3.0
1,306,237,727,436,258,000
37.533898
90
0.545415
false
pwoodworth/intellij-community
python/helpers/docutils/parsers/rst/directives/html.py
61
3223
# $Id: html.py 4667 2006-07-12 21:40:56Z wiemann $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Directives for typically HTML-specific constructs. """ __docformat__ = 'reStructuredText' import sys from docutils import nodes, utils from docutils.parse...
apache-2.0
-8,302,856,566,071,981,000
35.625
73
0.572448
false
cbertinato/pandas
pandas/tests/frame/test_axis_select_reindex.py
1
44030
from datetime import datetime import numpy as np import pytest from pandas.errors import PerformanceWarning import pandas as pd from pandas import ( Categorical, DataFrame, Index, MultiIndex, Series, date_range, isna) from pandas.tests.frame.common import TestData import pandas.util.testing as tm from pandas.uti...
bsd-3-clause
3,177,258,851,787,552,000
37.787665
79
0.53857
false
lfz/Guided-Denoise
Attackset/Iter4_ensv3_resv2_inresv2_random/nets/inception_v4.py
45
15643
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
2,829,554,062,622,032,000
47.430341
80
0.59036
false
mupif/mupif
mupif/EnsightReader2.py
1
13109
# # MuPIF: Multi-Physics Integration Framework # Copyright (C) 2010-2015 Borek Patzak # # Czech Technical University, Faculty of Civil Engineering, # Department of Structural Mechanics, 166 29 Prague, Czech Republic # # This library is free software; you can redistribute it and/or # modi...
lgpl-3.0
-3,159,519,565,527,876,600
41.287097
164
0.5468
false
ClearCorp-dev/odoo
addons/account/report/account_invoice_report.py
60
12934
# -*- 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
-1,653,493,608,334,182,100
54.51073
200
0.546621
false
stadelmanma/OpenPNM
test/unit/Network/GenericNetworkTest.py
1
14373
import OpenPNM import scipy as sp class GenericNetworkTest: def setup_class(self): self.net = OpenPNM.Network.Cubic(shape=[10, 10, 10]) def teardown_class(self): mgr = OpenPNM.Base.Workspace() mgr.clear() def test_find_connected_pores_numeric_not_flattend(self): a = self....
mit
-4,780,750,674,859,090,000
41.649852
79
0.549016
false
godfather1103/WeiboRobot
python27/1.0/lib/ctypes/test/test_unicode.py
35
5126
# coding: latin-1 import unittest import ctypes from ctypes.test import need_symbol import _ctypes_test @need_symbol('c_wchar') class UnicodeTestCase(unittest.TestCase): @classmethod def setUpClass(cls): dll = ctypes.CDLL(_ctypes_test.__file__) cls.wcslen = dll.my_wcslen cls.wcslen.argt...
gpl-3.0
-5,835,137,217,168,437,000
36.144928
83
0.603199
false
chaosim/dao
samples/hello.py
1
1301
from dao import word from samplevars import x def parse(grammar_element, text): x = Var() code = grammar_element(x)+x return eval([code, text]) def match(grammar_element, text): x = Var() code = grammar_element(x) return eval([code, text]) print parse(word, 'hello') print match(word, 'h...
gpl-3.0
-1,657,078,229,050,500,600
12.977011
62
0.484243
false
nbp/git-repo
editor.py
85
2660
# # Copyright (C) 2008 The Android Open Source Project # # 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 la...
apache-2.0
382,766,275,043,493,800
23.181818
74
0.61391
false
jsheperd/rotate_backup
rotate_backup.py
1
2651
#!/usr/bin/env python import sys import os import glob import time class archive: # The archive class represent an archive media with its age related parameters def __init__(self, path): self.path = path self.time = time.gmtime(os.path.getmtime(path)) self.year = time.strftime("%Y", sel...
unlicense
-853,748,002,442,862,600
34.346667
85
0.62467
false
ehirt/odoo
addons/board/__init__.py
439
1144
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
9,056,403,539,778,147,000
43
78
0.618881
false
rghe/ansible
test/units/modules/network/netscaler/test_netscaler_cs_policy.py
18
12568
# Copyright (c) 2017 Citrix Systems # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
gpl-3.0
7,039,932,926,364,580,000
37.200608
133
0.619828
false
cloudera/ibis
ibis/tests/expr/test_pipe.py
3
1763
# Copyright 2014 Cloudera 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, so...
apache-2.0
-947,330,347,682,574,000
25.712121
74
0.648327
false
r2t2sdr/r2t2
u-boot/tools/buildman/toolchain.py
5
8510
# Copyright (c) 2012 The Chromium OS Authors. # # SPDX-License-Identifier: GPL-2.0+ # import re import glob import os import bsettings import command class Toolchain: """A single toolchain Public members: gcc: Full path to C compiler path: Directory path containing C compiler cross: ...
gpl-3.0
826,594,270,267,984,000
33.453441
79
0.5604
false
borjam/exabgp
src/exabgp/bgp/message/update/nlri/vpls.py
3
3647
# encoding: utf-8 """ vpls.py Created by Nikita Shirokov on 2014-06-16. Copyright (c) 2014-2017 Nikita Shirokov. All rights reserved. Copyright (c) 2014-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ from struct import unpack from struct import pack from exabgp.protocol.fa...
bsd-3-clause
-3,046,368,619,695,330,300
31.274336
96
0.57609
false
mrchapp/meta-openembedded
meta-oe/lib/oeqa/selftest/cases/meta_oe_sources.py
4
1206
import os import re import glob as g import shutil import tempfile from oeqa.selftest.case import OESelftestTestCase from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars class MetaOESourceMirroring(OESelftestTestCase): # Can we download everything from the OpenEmbedded Sources Mirror over http ...
mit
-4,816,193,112,612,254,000
39.2
84
0.617745
false
pepeportela/edx-platform
common/djangoapps/util/model_utils.py
6
7263
""" Utilities for django models. """ import re import unicodedata from django.conf import settings from django.dispatch import Signal from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe from django_countries.fields import Country from eventtracking import tracker # The setti...
agpl-3.0
-1,455,315,741,796,901,000
37.226316
130
0.666667
false
wweiradio/django
tests/flatpages_tests/test_forms.py
165
4569
from __future__ import unicode_literals from django.conf import settings from django.contrib.flatpages.forms import FlatpageForm from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.test import TestCase, modify_settings, override_settings from django.utils impor...
bsd-3-clause
323,132,750,961,510,200
40.917431
115
0.649376
false
gpetretto/monty
tests/test_os.py
2
1196
__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest import os from monty.os.path import which, zpath from monty.os import cd test_dir = os.path.join(os.path.d...
mit
2,371,059,867,865,757,000
25
75
0.609532
false
double-y/django
tests/forms_tests/tests/test_validators.py
261
1540
from __future__ import unicode_literals import re from unittest import TestCase from django import forms from django.core import validators from django.core.exceptions import ValidationError class UserForm(forms.Form): full_name = forms.CharField( max_length=50, validators=[ validato...
bsd-3-clause
-57,411,264,725,189,270
28.056604
132
0.585714
false
eicher31/compassion-switzerland
partner_communication_switzerland/models/partner_communication.py
3
28550
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 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__.py...
agpl-3.0
-7,057,945,540,565,169,000
39.902579
79
0.536567
false
Page-David/wget-fast
configer.py
1
2463
#!/usr/bin/env python3 import urllib.parse import requests import queue import os import interface class Download_Configer(object): # Init download settings... def __init__(self, url, saveto): self.url = url parse_result = urllib.parse.urlparse(self.url) self.filename = self.url.split...
gpl-3.0
4,602,840,414,384,887,300
35.761194
124
0.600487
false
lalithsuresh/QEMU-Device-State-Visualisations
scripts/simpletrace.py
12
2522
#!/usr/bin/env python # # Pretty-printer for simple trace backend binary trace files # # Copyright IBM, Corp. 2010 # # This work is licensed under the terms of the GNU GPL, version 2. See # the COPYING file in the top-level directory. # # For help see docs/tracing.txt import sys import struct import re header_event_...
gpl-2.0
-3,143,958,515,632,104,000
26.11828
76
0.601507
false
hobarrera/django
tests/responses/tests.py
33
4881
# -*- coding: utf-8 -*- from __future__ import unicode_literals import io from django.conf import settings from django.core.cache import cache from django.http import HttpResponse from django.http.response import HttpResponseBase from django.test import SimpleTestCase UTF8 = 'utf-8' ISO88591 = 'iso-8859-1' class ...
bsd-3-clause
-7,511,904,347,758,875,000
35.133333
106
0.662772
false
abhiatgithub/shogun-toolbox
examples/undocumented/python_modular/mathematics_logdet.py
29
2923
#!/usr/bin/env python from numpy import * from scipy.io import mmread # Loading an example sparse matrix of dimension 479x479, real, unsymmetric mtx=mmread('../../../data/logdet/west0479.mtx') parameter_list=[[mtx,100,60,1]] def mathematics_logdet (matrix=mtx,max_iter_eig=1000,max_iter_lin=1000,num_samples=1): fr...
gpl-3.0
7,516,256,802,962,936,000
32.215909
86
0.770099
false
fcolamar/AliPhysics
PWGJE/EMCALJetTasks/Tracks/analysis/base/TriggerEfficiency.py
41
2551
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
bsd-3-clause
-3,924,809,552,928,824,000
53.297872
169
0.580949
false
kalev/anaconda
pyanaconda/iw/partition_gui.py
2
72665
# # partition_gui.py: allows the user to choose how to partition their disks # # Copyright (C) 2001, 2002 Red Hat, Inc. All rights reserved. # # 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; e...
gpl-2.0
-5,637,757,379,904,662,000
37.406448
109
0.551572
false
alikins/ansible
lib/ansible/modules/cloud/amazon/efs.py
14
24211
#!/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
128,512,197,075,159,620
34.5
154
0.571517
false
Runscope/pysaml2
src/saml2/mdie.py
34
4757
#!/usr/bin/env python from saml2 import element_to_extension_element from saml2 import extension_elements_to_elements from saml2 import SamlBase from saml2 import md __author__ = 'rolandh' """ Functions used to import metadata from and export it to a pysaml2 format """ IMP_SKIP = ["_certs", "e_e_", "_extatt"] EXP_SK...
bsd-2-clause
8,209,176,597,055,246,000
31.141892
77
0.505571
false
BlindHunter/django
tests/model_formsets_regress/tests.py
173
20725
from __future__ import unicode_literals from django import forms from django.forms.formsets import DELETION_FIELD_NAME, BaseFormSet from django.forms.models import ( BaseModelFormSet, inlineformset_factory, modelform_factory, modelformset_factory, ) from django.forms.utils import ErrorDict, ErrorList from djan...
bsd-3-clause
4,951,472,987,322,792,000
37.027523
111
0.587696
false
terbolous/CouchPotatoServer
libs/git/files.py
122
1831
# 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
211,344,630,695,542,900
56.21875
82
0.743856
false
moas/carbooking
booking/courses/models.py
1
3802
from __future__ import unicode_literals import datetime from django.core.exceptions import ValidationError from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext as _ from django.db.models import signals from django.db import model...
mit
5,173,369,820,820,748,000
28.472868
72
0.61152
false
thomasvincent/utilities
NagiosPlugins/check_procs/pexpect/examples/chess2.py
17
4026
#!/usr/bin/env python '''This demonstrates controlling a screen oriented application (curses). It starts two instances of gnuchess and then pits them against each other. ''' import pexpect import string import ANSI import sys, os, time class Chess: def __init__(self, engine = "/usr/local/bin/gnuchess -a -h ...
apache-2.0
-4,886,961,951,130,979,000
29.732824
90
0.476403
false
hdinsight/hue
desktop/core/ext-py/Django-1.6.10/tests/reverse_single_related/tests.py
150
1491
from __future__ import absolute_import from django.test import TestCase from .models import Source, Item class ReverseSingleRelatedTests(TestCase): """ Regression tests for an object that cannot access a single related object due to a restrictive default manager. """ def test_reverse_single_rel...
apache-2.0
8,916,072,218,406,376,000
37.230769
88
0.682093
false
DDelon/youtube-dl
youtube_dl/extractor/extremetube.py
31
3146
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, sanitized_Request, str_to_int, ) class ExtremeTubeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?extremetube\.com/(?:[^/]+/)?video/(?P<id>[^/#?&]+)' _TESTS = [{ 'u...
unlicense
482,804,688,309,103,100
33.195652
116
0.487603
false
vigov5/pvp-game
build_question.py
1
1744
#!venv/bin/python # -*- coding: utf-8 -*- import tornado import tornado.websocket import tornado.wsgi import logging import time import json import random from app import app, db from app.models import User, Game, Fact, Deck, ROLE_USER, ROLE_ADMIN, get_object_or_404 a = {'あ':'a', 'い':'i', 'う':'u', 'え':'e', 'お':'o', ...
mit
-1,658,984,893,185,239,600
11.081967
87
0.438263
false
the-c0d3r/CapTipper
CTMagic.py
11
6620
# # CapTipper is a malicious HTTP traffic explorer tool # By Omri Herscovici <omriher AT gmail.com> # http://omriher.com # @omriher # # # This file is part of CapTipper, and part of the Whatype library # Whatype is an independent file type identification pyt...
gpl-3.0
-4,080,978,668,031,667,700
32.852632
106
0.514955
false
DavidNorman/tensorflow
tensorflow/python/kernel_tests/reduction_ops_test_big.py
30
8764
# 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,155,660,840,395,140,000
43.040201
80
0.589571
false
nikolas/lettuce
tests/integration/lib/Django-1.3/django/contrib/localflavor/pe/forms.py
309
2272
# -*- coding: utf-8 -*- """ PE-specific Form helpers. """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import RegexField, CharField, Select from django.utils.translation import ugettext_lazy as _ class PERegionSelect(Select): """ A Select wi...
gpl-3.0
-402,604,362,268,588,160
30.541667
78
0.607221
false