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
ArcherSys/ArcherSys
Lib/site-packages/django/views/decorators/clickjacking.py
550
1759
from functools import wraps from django.utils.decorators import available_attrs def xframe_options_deny(view_func): """ Modifies a view function so its response has the X-Frame-Options HTTP header set to 'DENY' as long as the response doesn't already have that header set. e.g. @xframe_optio...
mit
-9,076,937,187,656,219,000
26.484375
78
0.643547
false
MaximNevrov/neutron
neutron/db/migration/alembic_migrations/versions/mitaka/expand/13cfb89f881a_add_is_default_to_subnetpool.py
9
1141
# Copyright 2015 Cisco Systems # # 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 agre...
apache-2.0
2,508,075,501,191,261,000
29.026316
78
0.669588
false
openlabs/nereid
trytond_nereid/tests/test_website.py
6
2763
# This file is part of Tryton & Nereid. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. import unittest import json import trytond.tests.test_tryton from trytond.tests.test_tryton import POOL, USER, DB_NAME, CONTEXT from trytond.transaction import Transac...
gpl-3.0
1,489,055,089,800,838,000
30.397727
78
0.570033
false
mbauskar/omnitech-demo-erpnext
erpnext/hr/doctype/holiday_list/holiday_list.py
41
1984
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cint from frappe.model.naming import make_autoname from frappe import throw, _ from frappe.model.document impor...
agpl-3.0
-3,599,700,979,823,459,300
31.52459
83
0.713206
false
damonkohler/sl4a
python/src/Mac/Modules/launch/launchsupport.py
39
3391
# This script generates a Python interface for an Apple Macintosh Manager. # It uses the "bgen" package to generate C code. # The function specifications are generated by scanning the mamager's header file, # using the "scantools" package (customized for this particular manager). import string # Declarations that cha...
apache-2.0
4,790,544,681,487,571,000
32.574257
82
0.682689
false
klmitch/keystone
keystone/federation/routers.py
3
10198
# 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 t...
apache-2.0
-7,687,832,246,629,353,000
39.468254
79
0.610904
false
shrucis1/em-data-gan
em_gan_models.py
1
6116
from keras.layers import Conv3D, Conv3DTranspose, UpSampling3D, Dense, Reshape, Flatten, Activation, Input from keras.models import Sequential from keras.layers.advanced_activations import LeakyReLU from keras_adversarial.legacy import l1l2 def em_generator(latent_dim, input_shape, leaky_alpha = 6*[0.2],reg = lambda: ...
gpl-2.0
-2,246,662,852,997,200,400
33.167598
114
0.655167
false
petrutlucian94/nova_dev
nova/tests/virt/vmwareapi/test_vm_util_datastore_selection.py
3
5170
# # 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 # ...
apache-2.0
1,464,107,609,677,450,200
40.36
78
0.609284
false
peterpolidoro/kicad_bom
kicad_bom/kicad_bom.py
2
8824
# # Python script to generate BOM in multiple formats from a KiCad generic netlist. # import kicad_netlist_reader import os import csv class KicadBom: def __init__(self,netlist_path=None): self._netlist_ext = '.xml' self._netlist_path = None self._netlist = None self._grouped_compo...
gpl-2.0
3,522,183,218,604,058,600
35.920502
93
0.559157
false
mapycz/python-mapnik
test/python_tests/raster_symbolizer_test.py
1
8474
import os from nose.tools import eq_ import mapnik from .utilities import execution_path, get_unique_colors, run_all def setup(): # All of the paths used are relative, if we run the tests # from another directory we need to chdir() os.chdir(execution_path('.')) def test_dataraster_coloring(): srs...
lgpl-2.1
185,168,056,905,545,100
34.755274
86
0.577531
false
vimagick/youtube-dl
youtube_dl/extractor/collegerama.py
111
3306
from __future__ import unicode_literals import json from .common import InfoExtractor from ..compat import compat_urllib_request from ..utils import ( float_or_none, int_or_none, ) class CollegeRamaIE(InfoExtractor): _VALID_URL = r'https?://collegerama\.tudelft\.nl/Mediasite/Play/(?P<id>[\da-f]+)' _...
unlicense
-130,349,944,642,521,630
34.934783
147
0.538717
false
mfcloud/python-zvm-sdk
zvmsdk/tests/unit/test_utils.py
1
1438
# Copyright 2017 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,297,826,587,745,079,000
36.842105
78
0.68637
false
xkcd1253/Mimi
flask/lib/python2.7/site-packages/sqlalchemy/events.py
18
16768
# sqlalchemy/events.py # Copyright (C) 2005-2012 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 """Core event interfaces.""" from sqlalchemy import event, exc, util engine = ut...
gpl-2.0
-840,459,298,511,997,700
35.215983
119
0.631202
false
shepdelacreme/ansible
contrib/inventory/freeipa.py
67
3992
#!/usr/bin/env python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) import argparse from distutils.version import LooseVersion import json import os import sys from ipalib import api, errors, __version__ as IPA_VERSION from six import ...
gpl-3.0
5,674,663,424,913,788,000
31.455285
92
0.632014
false
AlanZatarain/pysal
pysal/contrib/network/lincs.py
15
13081
#!/usr/bin/env python """ A library for computing local indicators of network-constrained clusters Author: Myunghwa Hwang mhwang4@gmail.com """ import unittest import numpy as np import scipy.stats as stats import geodanet.network as pynet import pysal, copy import time def unconditional_sim(event, base, s): "...
bsd-3-clause
5,834,655,050,970,138,000
36.481375
123
0.581072
false
jkthompson/nupic
examples/tp/tp_test.py
9
90129
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
gpl-3.0
986,237,723,167,486,200
38.016883
107
0.541025
false
MrTheodor/espressopp
src/esutil/GammaVariate.py
7
1686
# Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redistribute it and/or modify # it under the terms of t...
gpl-3.0
-844,262,637,597,430,000
32.058824
105
0.66548
false
rawrgulmuffins/flask
tests/test_helpers.py
1
24772
# -*- coding: utf-8 -*- """ tests.helpers ~~~~~~~~~~~~~~~~~~~~~~~ Various helpers. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import os import datetime import flask from logging import StreamHandler from werkzeug.http import parse_cache...
bsd-3-clause
8,046,502,167,546,162,000
34.872464
98
0.506989
false
vefimova/rally
tests/unit/plugins/common/sla/test_iteration_time.py
14
2035
# 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 b...
apache-2.0
-3,738,975,836,526,985,700
38.134615
78
0.659459
false
hackshel/metaCollecter
src/meta/modules/mod_linux_osinfo.py
1
1138
#!/usr/bin/python # -*- coding: utf-8 -*- import os import re class State( object ): def __init__( self ,args=None ): if not args: pass #添加默认参数信息 else: self.args = list(args) self.rel = '/etc/redhat-release' self.verRe = re.compile("^(\d+(\.\d+)?)") ...
bsd-3-clause
368,279,468,261,424,060
19.035714
49
0.455437
false
KennethNielsen/SoCo
tests/test_integration.py
1
36566
# -*- coding: utf-8 -*- # pylint: disable-msg=too-few-public-methods, redefined-outer-name, no-self-use """This file contains the classes used to perform integration tests on the methods in the SoCo class. They access a real Sonos system. PLEASE TAKE NOTE: All of these tests are designed to run on a Sonos system with...
mit
3,428,653,241,685,943,000
37.69418
87
0.605645
false
Debaq/Triada
FullAxis_GUI/DB/BASE DE DATOS EXPERIMENTO/experimento 3/gaby hernandez/medidor3.py
27
3052
import argparse import sys import matplotlib import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import numpy as np import json parser = argparse.ArgumentParser(description="Does some awesome things.") parser.add_argument('message', type=str, help="pass a message into the script") args = parser....
gpl-3.0
3,158,160,798,917,926,400
24.016393
147
0.609436
false
imrehg/labhardware
projects/slm/cri_slm.py
2
3677
#!/usr/bin/env python # USB Serial support for CRI Spatial Light Modulator # import serial import os class SLM: """ Spatial Light Modulator """ def __init__(self, serialport=None): """ Create motor controller serial interface Input: serialport : name of the serial port (eg. '...
mit
2,575,026,858,986,606,600
27.068702
80
0.521077
false
yvaucher/purchase-workflow
__unported__/purchase_fiscal_position_update/purchase.py
4
3820
# -*- coding: utf-8 -*- ############################################################################# # # Purchase Fiscal Position Update module for OpenERP # Copyright (C) 2011-2014 Julius Network Solutions SARL <contact@julius.fr> # Copyright (C) 2014 Akretion (http://www.akretion.com) # @author Mathieu V...
agpl-3.0
8,083,647,412,110,307,000
44.47619
78
0.556545
false
derekjchow/models
research/compression/entropy_coder/all_models/all_models_test.py
14
2447
# 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 applicab...
apache-2.0
3,970,156,336,602,349,600
34.985294
80
0.630977
false
jacegem/lotto-store
lib/libfuturize/fixes/fix_future_builtins.py
62
2028
""" For the ``future`` package. Adds this import line:: from builtins import XYZ for each of the functions XYZ that is used in the module. Adds these imports after any other imports (in an initial block of them). """ from __future__ import unicode_literals from lib2to3 import fixer_base from lib2to3.pygram im...
apache-2.0
-8,237,667,547,049,572,000
32.8
100
0.592702
false
sniemi/SamPy
sandbox/src1/TCSE3-3rd-examples/src/app/wavesim2D/F77/autoedit.py
1
5475
#!/usr/bin/env python # automatic execution of HPC exercises import shutil, sys, os, re, glob counter = 0 def edit(from_to, filename='F77WAVE.fcp'): """ substitute (from,to) in from_to list, e.g. edit((r'from',r'to')) """ shutil.copy(filename + ".orig", filename) f = open(filename, 'r') f...
bsd-2-clause
585,225,314,672,017,000
32.181818
153
0.571142
false
nadley/Sick-Beard
lib/hachoir_parser/archive/bzip2_parser.py
90
2896
""" BZIP2 archive file Author: Victor Stinner """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import (ParserError, String, Bytes, Character, UInt8, UInt32, CompressedField) from lib.hachoir_core.endian import LITTLE_ENDIAN from lib.hachoir_core.text_handler import textHandler, hexadecimal t...
gpl-3.0
-5,672,394,775,429,717,000
33.070588
92
0.560083
false
SINGROUP/pycp2k
pycp2k/classes/_each6.py
1
1112
from pycp2k.inputsection import InputSection class _each6(InputSection): def __init__(self): InputSection.__init__(self) self.Just_energy = None self.Powell_opt = None self.Qs_scf = None self.Xas_scf = None self.Md = None self.Pint = None self.Metady...
lgpl-3.0
282,738,108,875,091,140
41.769231
447
0.57554
false
DMLoy/ECommerceBasic
lib/python2.7/site-packages/south/utils/__init__.py
119
1945
""" Generally helpful utility functions. """ def _ask_for_it_by_name(name): "Returns an object referenced by absolute path." bits = str(name).split(".") ## what if there is no absolute reference? if len(bits) > 1: modulename = ".".join(bits[:-1]) else: modulename = bits[0] mo...
mit
3,645,856,226,838,437,400
25.643836
83
0.603085
false
foxichu/etherkeeper
etherkeeper/util/helpers.py
2
1433
import json import datetime import time from django.conf import settings from django.http import HttpResponse from django.template import loader def epoch_time(add=0): 'Returns time since epoch' return time.mktime(datetime.datetime.now().timetuple()) + add def jsonify(*args, **kwargs): 'Returns a json res...
mit
6,562,339,523,179,939,000
31.568182
74
0.661549
false
jpshort/odoo
addons/hr/__openerp__.py
260
2372
# -*- 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,866,910,892,218,683,000
33.882353
146
0.591484
false
eufarn7sp/egads-eufar
egads/thirdparty/quantities/units/area.py
4
1079
""" """ from __future__ import absolute_import from ..unitquantity import UnitQuantity from .length import m, rod are = ares = UnitQuantity( 'are', 100*m**2, aliases=['ares'] ) b = barn = UnitQuantity( 'barn', 1e-28*m**2, symbol='b', aliases=['barnes'] ) cmil = circular_mil = UnitQuantity(...
bsd-3-clause
-159,291,984,541,271,460
18.981481
71
0.613531
false
WinterNis/sqlalchemy
test/dialect/postgresql/test_types.py
10
79161
# coding: utf-8 from sqlalchemy.testing.assertions import eq_, assert_raises, \ assert_raises_message, is_, AssertsExecutionResults, \ AssertsCompiledSQL, ComparesTables from sqlalchemy.testing import engines, fixtures from sqlalchemy import testing import datetime from sqlalchemy import Table, MetaData, Column...
mit
6,205,702,595,165,859,000
31.183483
79
0.514367
false
sysadminmatmoz/pmis
stock_analytic_account/model/product.py
1
1712
# -*- coding: utf-8 -*- # Copyright 2014-17 Eficent Business and IT Consulting Services S.L. # Copyright 2016 Matmoz d.o.o. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models class Product(models.Model): _inherit = "product.product" def _get_domain_locations(self):...
agpl-3.0
130,033,320,225,076,450
45.27027
73
0.537967
false
felixma/nova
nova/tests/unit/objects/test_instance_group.py
27
14526
# Copyright (c) 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
-2,400,233,006,557,818,400
43.151976
79
0.587636
false
mogoweb/chromium-crosswalk
net/tools/testserver/testserver.py
2
74923
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """This is a simple HTTP/FTP/TCP/UDP/BASIC_AUTH_PROXY/WEBSOCKET server used for testing Chrome. It supports several test URLs, as spec...
bsd-3-clause
-2,685,347,812,664,488,000
34.609791
80
0.627751
false
alexgorban/models
research/object_detection/dataset_tools/create_oid_tf_record.py
3
5198
# 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
-1,982,384,001,396,718,600
43.42735
80
0.708927
false
ksachs/invenio
modules/bibformat/lib/elements/bfe_collection.py
30
1404
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 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,644,117,540,399,086,000
35
76
0.7151
false
onitake/ansible
lib/ansible/modules/network/cloudengine/ce_ntp.py
7
20797
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
6,023,727,877,520,343,000
32.982026
120
0.522864
false
styleseat/django-waffle
waffle/__init__.py
1
3408
from decimal import Decimal import random import django from waffle.utils import get_setting VERSION = (0, 10, 1) __version__ = '.'.join(map(str, VERSION)) def set_flag(request, flag_name, active=True, session_only=False): """Set a flag value on a request object.""" if not hasattr(request, 'waffles'): ...
bsd-3-clause
770,809,443,631,103,500
28.128205
80
0.606514
false
googleapis/python-documentai
setup.py
1
2078
# -*- coding: utf-8 -*- # Copyright (C) 2019 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 ...
apache-2.0
8,297,299,862,579,325,000
30.969231
74
0.6564
false
agentmilindu/stratos
components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/healthstatspublisher/abstracthealthstatisticspublisher.py
2
1992
# 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 u...
apache-2.0
-3,116,723,697,712,090,600
30.619048
91
0.685241
false
brandonxiang/geojson-python-utils
test.py
1
5920
from __future__ import print_function import unittest import json import math class Test(unittest.TestCase): def test_linestrings_intersect(self): from geojson_utils import linestrings_intersect diagonal_up_str = '{ "type": "LineString","coordinates": [[0, 0], [10, 10]]}' diagonal_down_st...
mit
1,422,448,424,963,876,400
47.92562
147
0.612162
false
krmahadevan/selenium
py/selenium/webdriver/remote/switch_to.py
13
4610
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-6,852,608,438,345,720,000
33.402985
106
0.619957
false
bjlittle/iris
tools/gen_translations.py
6
7503
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ Processing of metarelate metOcean content to provide Iris encodings of metOcean mapping translations. """ from datetime i...
lgpl-3.0
-3,879,047,992,770,026,000
33.736111
80
0.636545
false
timlinux/QGIS
python/plugins/processing/algs/qgis/PointsDisplacement.py
30
7999
# -*- coding: utf-8 -*- """ *************************************************************************** PointsDisplacement.py --------------------- Date : July 2013 Copyright : (C) 2013 by Alexander Bruy Email : alexander dot bruy at gmail dot com *********...
gpl-2.0
681,938,856,417,958,400
42.005376
130
0.524441
false
longman694/youtube-dl
youtube_dl/extractor/kaltura.py
16
14151
# coding: utf-8 from __future__ import unicode_literals import re import base64 from .common import InfoExtractor from ..compat import ( compat_urlparse, compat_parse_qs, ) from ..utils import ( clean_html, ExtractorError, int_or_none, unsmuggle_url, smuggle_url, ) class KalturaIE(InfoEx...
unlicense
-7,624,033,642,876,033,000
39.663793
178
0.456222
false
zhuyue1314/Empire
lib/modules/credentials/mimikatz/dcsync.py
3
2901
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-Mimikatz DCsync', 'Author': ['@gentilkiwi', '@JosephBialek'], 'Description': ("Runs PowerSploit's Invoke-Mimikatz function " ...
bsd-3-clause
-9,211,016,527,689,461,000
30.879121
104
0.479145
false
SyndicateLtd/SyndicateQT
test/functional/feature_nulldummy.py
4
5757
#!/usr/bin/env python3 # Copyright (c) 2016-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test NULLDUMMY softfork. Connect to a single node. Generate 2 blocks (save the coinbases for later). G...
mit
-4,893,625,334,562,059,000
42.613636
134
0.666667
false
rmk135/objects
tests/unit/providers/test_coroutines_py35.py
1
10067
"""Dependency injector coroutine providers unit tests.""" import asyncio import unittest2 as unittest from dependency_injector import ( providers, errors, ) # Runtime import to get asyncutils module import os _TOP_DIR = os.path.abspath( os.path.sep.join(( os.path.dirname(__file__), '../'...
bsd-3-clause
-6,741,752,844,861,839,000
33.241497
75
0.626006
false
soarpenguin/ansible
test/units/module_utils/basic/test_heuristic_log_sanitize.py
66
3816
# -*- coding: utf-8 -*- # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (a...
gpl-3.0
6,259,126,086,543,162,000
40.032258
122
0.6326
false
jlblatt/Hollowbot
links.py
1
3835
import datetime import json import time from conf import _ from init import db, cur, opener import log import lib import stats lcount = 0 def get(url): log.write("Getting %d page(s) of %d links from: %s..." % (_['page_limit'], _['links_per_page'], url), 'message') start = time.time() after = '' fo...
gpl-3.0
-972,618,575,875,689,000
34.841121
126
0.370535
false
amagdas/eve
eve/methods/put.py
2
8754
# -*- coding: utf-8 -*- """ eve.methods.put ~~~~~~~~~~~~~~~ This module imlements the PUT method. :copyright: (c) 2015 by Nicola Iarocci. :license: BSD, see LICENSE for more details. """ from werkzeug import exceptions from datetime import datetime from eve.auth import requires_auth from eve.def...
bsd-3-clause
4,318,831,065,750,273,500
38.61086
79
0.645533
false
crakensio/django_training
lib/python2.7/site-packages/sphinx/ext/coverage.py
11
9788
# -*- coding: utf-8 -*- """ sphinx.ext.coverage ~~~~~~~~~~~~~~~~~~~ Check Python modules and C API for coverage. Mostly written by Josip Dzolonga for the Google Highly Open Participation contest. :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for d...
cc0-1.0
-5,137,196,170,311,452,000
35.935849
80
0.46179
false
nikhilprathapani/python-for-android
python3-alpha/python3-src/Tools/unicode/makeunicodedata.py
47
40714
# # (re)generate unicode property and type databases # # this script converts a unicode 3.2 database file to # Modules/unicodedata_db.h, Modules/unicodename_db.h, # and Objects/unicodetype_db.h # # history: # 2000-09-24 fl created (based on bits and pieces from unidb) # 2000-09-25 fl merged tim's splitbin fixes, se...
apache-2.0
4,244,505,271,554,104,000
33.947639
101
0.512747
false
Cinntax/home-assistant
homeassistant/components/ads/sensor.py
4
2436
"""Support for ADS sensors.""" import logging import voluptuous as vol from homeassistant.components import ads from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import CONF_NAME, CONF_UNIT_OF_MEASUREMENT import homeassistant.helpers.config_validation as cv from . import CONF_ADS_F...
apache-2.0
-4,366,137,681,356,022,000
30.636364
86
0.632594
false
ondrejmular/pcs
pcs_test/tier0/lib/cib/test_resource_common.py
3
45469
# pylint: disable=too-many-lines from unittest import TestCase from lxml import etree from pcs_test.tools.assertions import ( assert_report_item_list_equal, assert_xml_equal, ) from pcs_test.tools import fixture from pcs_test.tools.xml import etree_to_str from pcs.common.reports import codes as report_codes f...
gpl-2.0
-3,650,003,279,635,627,500
31.33926
92
0.524775
false
rsennrich/multidomain_smt
main.py
1
5816
#!/usr/bin/python # -*- coding: utf-8 -*- # please set paths to the required tools in config.py # this scripts performs (part of) the experiments described in (Sennrich, Schwenk & Aransa 2013). # Specifically, it takes a vector of (source-side) texts (LM_TEXTS), trains a language model on each, # and then clusters a ...
gpl-2.0
1,992,344,677,844,068,900
37.013072
182
0.672799
false
Tesora-Release/tesora-trove
trove/guestagent/datastore/postgresql/service.py
1
38986
# Copyright (c) 2013 OpenStack Foundation # Copyright (c) 2016 Tesora, 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...
apache-2.0
4,807,858,642,811,049,000
36.271511
79
0.577848
false
BiaDarkia/scikit-learn
examples/plot_multioutput_face_completion.py
79
2986
""" ============================================== Face completion with a multi-output estimators ============================================== This example shows the use of multi-output estimator to complete images. The goal is to predict the lower half of a face given its upper half. The first column of images sho...
bsd-3-clause
-2,321,649,883,988,826,600
29.161616
72
0.626591
false
awkspace/ansible
lib/ansible/modules/cloud/google/gcp_compute_health_check_facts.py
9
12633
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
-108,840,449,611,291,340
33.235772
133
0.583947
false
south-coast-science/scs_core
src/scs_core/control/command.py
1
4918
""" Created on 11 May 2017 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) https://pymotw.com/2/subprocess/ """ import os from collections import OrderedDict from subprocess import Popen, PIPE, TimeoutExpired from scs_core.data.json import JSONable, JSONify # ------------------------------------------...
mit
8,905,780,105,853,913,000
25.159574
118
0.43595
false
yarikoptic/python-pygit2
pygit2/blame.py
2
4614
# -*- coding: utf-8 -*- # # Copyright 2010-2014 The pygit2 contributors # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, # as published by the Free Software Foundation. # # In addition to the permissions in the GNU General Public Li...
gpl-2.0
5,904,400,236,099,159,000
27.481481
90
0.632206
false
simpleoncall/simpleoncall
simpleoncall/templatetags/form.py
1
2106
from django import template from simpleoncall.models import NotificationType from simpleoncall.templatetags.icons import EvilIconNode register = template.Library() def pop_default(l, d): if len(l): return l.pop(0) return d class NotificationSettingRowNode(template.Node): TYPE_OPTIONS = { ...
mit
6,347,889,593,953,753,000
29.970588
84
0.612061
false
maohongyuan/kbengine
kbe/src/lib/python/Lib/idlelib/AutoExpand.py
122
3395
'''Complete the current word before the cursor with words in the editor. Each menu selection or shortcut key selection replaces the word with a different word with the same prefix. The search for matches begins before the target and moves toward the top of the editor. It then starts after the cursor and moves down. It...
lgpl-3.0
6,375,868,031,802,404,000
31.644231
73
0.57673
false
felixfontein/ansible
test/units/module_utils/test_distro.py
35
1512
# (c) 2018 Adrian Likins <alikins@redhat.com> # Copyright (c) 2018 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # or # Apache License v2.0 (see http://www.apache.org/licenses/LICENSE-2.0) # # Dual licensed so any test cases could potentially be included ...
gpl-3.0
6,761,864,695,492,232,000
38.789474
114
0.69246
false
Shapes/pisa-fix-django
sx/pisa3/pisa_util.py
1
26066
# -*- coding: ISO-8859-1 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 requir...
apache-2.0
-8,176,339,682,187,302,000
33.2523
133
0.572355
false
sorenk/ansible
lib/ansible/modules/cloud/oneandone/oneandone_public_ip.py
14
10224
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
-5,017,952,996,996,959,000
28.80758
95
0.60358
false
Batterfii/django
tests/gis_tests/gis_migrations/test_commands.py
276
2723
from __future__ import unicode_literals from django.core.management import call_command from django.db import connection from django.test import TransactionTestCase, skipUnlessDBFeature @skipUnlessDBFeature("gis_enabled") class MigrateTests(TransactionTestCase): """ Tests running the migrate command in Geodj...
bsd-3-clause
7,980,074,628,612,000,000
40.892308
100
0.667279
false
Pikecillo/genna
external/4Suite-XML-1.0.2/Ft/Lib/TestSuite/TestModule.py
1
6155
######################################################################## # $Header: /var/local/cvsroot/4Suite/Ft/Lib/TestSuite/TestModule.py,v 1.9 2006/08/11 15:50:12 jkloth Exp $ """ Provides the TestModule class for wrapping modules/packages. Copyright 2006 Fourthought, Inc. (USA). Detailed license and copyright inf...
gpl-2.0
-3,965,541,180,541,956,000
34.994152
106
0.534362
false
bcherry/adequatelygood
utils/external/simplejson/__init__.py
55
13802
r""" A simple, fast, extensible JSON encoder and decoder JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. simplejson exposes an API familiar to uses of the standard library marshal and pickle modules. Encoding b...
mit
-323,733,950,001,608,600
35.707447
103
0.639255
false
Passtechsoft/TPEAlpGen
blender/release/scripts/addons_contrib/automat/__init__.py
2
1958
# Copyright 2015 Théo Friberg under GNU GPL 3 bl_info = { "name": "Cycles Automatic Materials", "author": "Théo Friberg", "blender": (2, 70, 0), "version": (0, 39), "location": "Space > Automatic / Adjustable Material from Image", "description": "One-click material setup from texture for Cycles. Blur from b°wide...
gpl-3.0
-307,255,672,791,147,500
30.031746
100
0.749361
false
lucashmorais/x-Bench
mozmill-env/python/Lib/site-packages/requests/adapters.py
58
12272
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import socket from .models import Response from .packages.urllib3.poolmanager import PoolManager, ProxyManager from .packages.urllib3.response import...
mit
-3,772,555,509,317,696,500
34.883041
97
0.607888
false
abinashk-inf/AstroBox
src/ext/makerbot_driver/GcodeAssembler.py
6
7063
from __future__ import absolute_import import json import makerbot_driver """ A machine profile object that holds all values for a specific profile. """ import json import os import re import logging GcodeRecipes = { "PLA" : { "print_start_sequence" : { "heat_platform" : "no_heat" }, "print_e...
agpl-3.0
-506,478,922,230,023,700
32.794258
111
0.576242
false
datalogics-robb/scons
test/Value.py
2
4889
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, modify, merge, publish, ...
mit
-4,503,395,222,439,846,400
32.258503
81
0.637963
false
baylabs/grpc
src/python/grpcio_tests/tests/unit/_cython/_read_some_but_not_all_responses_test.py
21
11192
# Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
4,290,066,182,273,725,000
42.379845
83
0.598106
false
cnoviello/micropython
tests/bytecode/pylib-tests/socketserver.py
24
24196
"""Generic socket server classes. This module tries to capture the various aspects of defining a server: For socket-based servers: - address family: - AF_INET{,6}: IP (Internet Protocol) sockets (default) - AF_UNIX: Unix domain sockets - others, e.g. AF_DECNET are conceivable (see <socket.h> ...
mit
6,516,165,451,495,028,000
31.477852
84
0.639362
false
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/python/Lib/OpenGL/arrays/strings.py
2
3076
"""String-array-handling code for PyOpenGL """ #from OpenGL.arrays._strings import dataPointer as old from OpenGL import constants from OpenGL.arrays import formathandler import ctypes psas = ctypes.pythonapi.PyString_AsString # it's a c_char_p, but if we use that then the code will # attempt to use null-terminated v...
agpl-3.0
4,912,807,957,211,058,000
44.25
87
0.673277
false
janastu/swtstore
swtstore/classes/utils/urlnorm.py
2
7460
# urlnorm.py - Normalize URLs # Copyright (C) 2010 Kurt McKee <contactme@kurtmckee.org> # # This program 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 o...
bsd-2-clause
-6,409,520,235,715,007,000
30.344538
95
0.534853
false
solarjoe/numpy
numpy/matlib.py
161
9584
from __future__ import division, absolute_import, print_function import numpy as np from numpy.matrixlib.defmatrix import matrix, asmatrix # need * as we're copying the numpy namespace from numpy import * __version__ = np.__version__ __all__ = np.__all__[:] # copy numpy namespace __all__ += ['rand', 'randn', 'repmat...
bsd-3-clause
-6,543,387,584,175,341,000
25.77095
81
0.549353
false
eestay/edx-platform
pavelib/paver_tests/test_prereqs.py
99
1862
import os import unittest from pavelib.prereqs import no_prereq_install class TestPaverPrereqInstall(unittest.TestCase): """ Test the status of the NO_PREREQ_INSTALL variable, its presence and how paver handles it. """ def check_val(self, set_val, expected_val): """ Verify that set...
agpl-3.0
1,487,678,467,796,444,200
27.212121
77
0.568743
false
eckucukoglu/arm-linux-gnueabihf
lib/python2.7/unittest/test/test_result.py
104
19064
import sys import textwrap from StringIO import StringIO from test import test_support import traceback import unittest class Test_TestResult(unittest.TestCase): # Note: there are not separate tests for TestResult.wasSuccessful(), # TestResult.errors, TestResult.failures, TestResult.testsRun or # TestRes...
gpl-2.0
1,884,594,026,994,755,000
32.622575
94
0.6079
false
openqt/algorithms
leetcode/python/lc934-shortest-bridge.py
1
1132
# coding=utf-8 import unittest """934. Shortest Bridge https://leetcode.com/problems/shortest-bridge/description/ In a given 2D binary array `A`, there are two islands. (An island is a 4-directionally connected group of `1`s not connected to any other 1s.) Now, we may change `0`s to `1`s so as to connect the two is...
gpl-3.0
-5,471,964,926,556,568,000
15.647059
76
0.545936
false
rlucio/cinder-violin-driver-icehouse
cinder/volume/drivers/violin/vxg/__init__.py
1
8636
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Violin Memory, 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 # # ...
apache-2.0
6,026,190,611,061,615,000
36.71179
78
0.57573
false
leezu/mxnet
python/mxnet/gluon/probability/distributions/exponential.py
5
3500
# 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 u...
apache-2.0
-4,202,046,132,979,292,700
30.818182
80
0.624857
false
unseenlaser/python-for-android
python-modules/twisted/twisted/scripts/test/test_mktap.py
60
3509
# Copyright (c) 2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.scripts.mktap}. """ import sys try: import pwd, grp except ImportError: pwd = None from twisted.trial.unittest import TestCase from twisted.scripts.mktap import run, getid, loadPlugins from twisted.applicati...
apache-2.0
7,131,502,105,814,299,000
27.762295
81
0.596751
false
skython/eXe
exe/webui/multiselectblock.py
3
5253
# =========================================================================== # eXe # Copyright 2004-2006, University of Auckland # Copyright 2006-2007 eXe Project, New Zealand Tertiary Education Commission # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General...
gpl-2.0
1,890,537,488,019,350,300
34.02
77
0.565582
false
hyperoslo/django-pipeline
pipeline/compilers/common_css.py
1
5354
import re from os.path import dirname, normpath from datetime import datetime from pipeline.compilers import SubProcessCompiler class BaseFileTree(object): """ The BaseFileTree represents a node and its children in a tree of @imported CSS files. It handles the parsing of them, in order to be able to chec...
mit
-7,904,379,815,820,774,000
27.940541
79
0.523534
false
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/numpy-1.9.2/numpy/distutils/fcompiler/vast.py
184
1775
from __future__ import division, absolute_import, print_function import os from numpy.distutils.fcompiler.gnu import GnuFCompiler compilers = ['VastFCompiler'] class VastFCompiler(GnuFCompiler): compiler_type = 'vast' compiler_aliases = () description = 'Pacific-Sierra Research Fortran 90 Compiler' ...
mit
-2,278,884,408,474,757,400
30.696429
83
0.593239
false
w1ll1am23/home-assistant
homeassistant/components/slide/__init__.py
21
5503
"""Component for the Slide API.""" from datetime import timedelta import logging from goslideapi import GoSlideCloud, goslideapi import voluptuous as vol from homeassistant.const import ( CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_USERNAME, STATE_CLOSED, STATE_CLOSING, STATE_OPEN, STATE_OPEN...
apache-2.0
1,866,137,530,605,364,500
30.809249
86
0.524441
false
jmcorgan/gnuradio
gr-qtgui/examples/pyqt_example_f.py
58
6185
#!/usr/bin/env python # # Copyright 2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your optio...
gpl-3.0
-4,701,066,750,781,455,000
32.432432
82
0.629749
false
harry-7/addons-server
src/olympia/amo/tests/test_readonly.py
2
1197
from django.db import models import MySQLdb as mysql import pytest from pyquery import PyQuery as pq from olympia.addons.models import Addon @pytest.yield_fixture def read_only_mode(client, settings, db): def _db_error(*args, **kwargs): raise mysql.OperationalError("You can't do this in read-only mode....
bsd-3-clause
-1,802,900,783,168,899,300
25.021739
78
0.700919
false
olologin/scikit-learn
build_tools/circle/check_build_doc.py
49
2478
"""Check whether we or not we should build the documentation If the last commit message has a "[doc skip]" marker, do not build the doc. On the contrary if a "[doc build]" marker is found, build the doc instead of relying on the subsequent rules. We always build the documentation for jobs that are not related to a sp...
bsd-3-clause
-2,127,552,872,043,076,900
36.545455
77
0.715093
false
azumimuo/family-xbmc-addon
plugin.video.sanctuary/lib/freeview/process.py
1
10551
import urllib2, urllib, xbmcgui, xbmcplugin, xbmc, re, sys, os, xbmcaddon, json, time ADDON_PATH = xbmc.translatePath('special://home/addons/plugin.video.sanctuary/') USERDATA_PATH = xbmc.translatePath('special://home/userdata/addon_data') ADDON_DATA = USERDATA_PATH + '/Sanctuary/' if not os.path.exists(ADDON_DATA): ...
gpl-2.0
-8,317,378,145,975,604,000
32.709265
231
0.57786
false
abloomston/sympy
sympy/plotting/pygletplot/plot_interval.py
94
5432
from __future__ import print_function, division from sympy import Symbol, Integer, sympify from sympy.core.compatibility import range class PlotInterval(object): """ """ _v, _v_min, _v_max, _v_steps = None, None, None, None def require_all_args(f): def check(self, *args, **kwargs): ...
bsd-3-clause
-621,689,257,187,097,500
29.01105
81
0.506443
false
dongweiming/code
vilya/models/sphinx_docs.py
3
17656
# coding: utf-8 import pickle import tempfile import os import logging logging.basicConfig() logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) debug = logger.debug warn = logger.warn import subprocess as sp import shutil import datetime as dt from urllib import quote import sphinx # noqa Some pickles...
bsd-3-clause
-6,934,036,229,434,776,000
32.376181
118
0.57159
false
jinjin123/devops2.0
devops/ops/views/assets/assets.py
1
15231
#!/usr/bin/env python # _#_ coding:utf-8 _*_ import os,sys from django.http import JsonResponse from django.shortcuts import render from django.template import RequestContext from django.contrib.auth.decorators import login_required from ops.models import * from ops.views.ssh_settings import keyfile_dir from django.db...
mit
285,532,736,084,045,570
53.113139
119
0.440413
false
LoLab-VU/pymc
pymc/tests/test_step.py
12
2958
from .checks import * from .models import simple_model, mv_simple, mv_simple_discrete, simple_2model from theano.tensor import constant from scipy.stats.mstats import moment def check_stat(name, trace, var, stat, value, bound): s = stat(trace[var][2000:], axis=0) close_to(s, value, bound) def test_step_cont...
apache-2.0
-8,578,971,325,624,793,000
31.152174
79
0.598039
false
ashhher3/ibis
docs/source/conf.py
9
8595
# -*- coding: utf-8 -*- # # Ibis documentation build configuration file, created by # sphinx-quickstart on Wed Jun 10 11:06:29 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
apache-2.0
5,471,861,641,531,071,000
29.587189
79
0.706806
false