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
tensorflow/tensorflow
tensorflow/python/ops/image_ops_impl.py
6
226930
# 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,365,389,480,885,356,000
38.411254
88
0.642189
false
motion2015/edx-platform
cms/lib/xblock/authoring_mixin.py
163
1500
""" Mixin class that provides authoring capabilities for XBlocks. """ import logging from django.conf import settings from xblock.core import XBlock from xblock.fields import XBlockMixin from xblock.fragment import Fragment log = logging.getLogger(__name__) VISIBILITY_VIEW = 'visibility_view' @XBlock.needs("i18n...
agpl-3.0
2,505,907,580,996,359,000
29.612245
115
0.66
false
stonebig/bokeh
bokeh/models/axes.py
2
11338
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
6,628,841,109,837,154,000
33.048048
147
0.611836
false
sopier/django
django/contrib/contenttypes/management.py
476
2521
from django.apps import apps from django.db import DEFAULT_DB_ALIAS, router from django.utils import six from django.utils.six.moves import input def update_contenttypes(app_config, verbosity=2, interactive=True, using=DEFAULT_DB_ALIAS, **kwargs): """ Creates content types for models in the given app, removin...
bsd-3-clause
6,550,575,133,137,145,000
29.011905
101
0.595795
false
datalogics-robb/scons
test/Scanner/parallel-rescan.py
2
2125
#!/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
-1,010,770,543,265,059,500
28.513889
73
0.700706
false
Bristol-Braille/canute-ui
ui/i18n.py
1
2127
import gettext import logging from collections import namedtuple, OrderedDict log = logging.getLogger(__name__) def install(locale_code): try: translations = gettext.translation( 'canute', localedir='ui/locale', languages=[locale_code], fallback=False ) except OSError ...
gpl-3.0
-3,407,019,175,297,618,400
33.306452
73
0.716502
false
super3/PyDev
Old Workspace/EndlessScroll.py
1
1826
# EndlessScroll.py # Objective: Make an endless scrollable world. # Author: Super3boy (super3.org) # Imports import pygame # Start PyGame pygame.init() # Define Colors black = [0, 0 ,0] white = [255, 255, 255] blue = [ 0, 0 , 255] green = [ 0, 255, 0] red = [255, 0, 0] class Block(pygame.sprite.Sprite): def __ini...
mit
7,367,442,955,149,169,000
19.761364
65
0.697152
false
Tithen-Firion/youtube-dl
youtube_dl/extractor/fivemin.py
79
1917
from __future__ import unicode_literals from .common import InfoExtractor class FiveMinIE(InfoExtractor): IE_NAME = '5min' _VALID_URL = r'(?:5min:|https?://(?:[^/]*?5min\.com/|delivery\.vidible\.tv/aol)(?:(?:Scripts/PlayerSeed\.js|playerseed/?)?\?.*?playList=)?)(?P<id>\d+)' _TESTS = [ { ...
unlicense
-753,836,174,347,529,500
34.5
155
0.491914
false
CloudI/cloudi_api_python
cloudi.py
2
34829
#!/usr/bin/env python #-*-Mode:python;coding:utf-8;tab-width:4;c-basic-offset:4;indent-tabs-mode:()-*- # ex: set ft=python fenc=utf-8 sts=4 ts=4 sw=4 et nomod: # # MIT License # # Copyright (c) 2011-2021 Michael Truog <mjtruog at protonmail dot com> # # Permission is hereby granted, free of charge, to any person obtain...
mit
-7,751,938,131,055,474,000
36.250267
80
0.509834
false
bopo/tablib
tablib/packages/xlwt/antlr.py
57
84201
## This file is part of PyANTLR. See LICENSE.txt for license ## details..........Copyright (C) Wolfgang Haefelinger, 2004. ## This file was copied for use with xlwt from the 2.7.7 ANTLR distribution. Yes, it ## says 2.7.5 below. The 2.7.5 distribution version didn't have a ## version in it. ## Here is the contents of...
mit
-8,496,658,699,182,714,000
28.297495
108
0.561205
false
tmm1/pygments.rb
vendor/pygments-main/pygments/lexers/rust.py
1
8235
# -*- coding: utf-8 -*- """ pygments.lexers.rust ~~~~~~~~~~~~~~~~~~~~ Lexers for the Rust language. :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, bygroups, words, default from pygments...
mit
6,084,747,765,619,548,000
35.763393
79
0.433394
false
UCL-RITS/django-shibboleth-remoteuser
shibboleth/views.py
10
2867
from django.conf import settings from django.contrib import auth from django.contrib.auth.decorators import login_required from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse from django.shortcuts import redirect from django.utils.decorators import method_decorator fr...
mit
93,624,724,161,175,470
33.8375
105
0.657482
false
v-iam/azure-sdk-for-python
azure-mgmt-web/azure/mgmt/web/models/recover_response.py
3
1933
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
6,860,574,707,578,278,000
33.517857
108
0.566994
false
silviolima/EstudoAppengine
tekton/tekton-master/src/tekton/gae/middleware/email_errors.py
4
2552
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import json import logging import traceback import time from google.appengine.api import app_identity, mail, capabilities from google.appengine.runtime import DeadlineExceededError from tekton.router import PathNotFound def get_apis_st...
mit
-8,949,559,600,167,558,000
33.026667
97
0.605408
false
zielmicha/freeciv-android
lib/freeciv/maptiles.py
4
6047
import ui import graphics import time import contextlib from ui import stream from ui import ctrl from client import freeciv SELECT_POPUP = 0 class MapWidget(ui.Widget): def __init__(self, client): self.client = client self.size = (0, 0) self.drawer = TileDrawer(client) self.tile_...
gpl-2.0
-5,600,320,362,428,581,000
32.782123
91
0.539937
false
Distrotech/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/tests/test_spatialrefsys.py
94
6686
from django.db import connection from django.contrib.gis.tests.utils import mysql, no_mysql, oracle, postgis, spatialite from django.utils import unittest test_srs = ({'srid' : 4326, 'auth_name' : ('EPSG', True), 'auth_srid' : 4326, 'srtext' : 'GEOGCS["WGS 84",DATUM["WGS_1984",S...
apache-2.0
-8,447,798,340,356,719,000
58.168142
737
0.615465
false
MelanieBittl/dolfin
demo/undocumented/functional/python/demo_functional.py
3
1638
"""This demo program computes the value of the functional M(v) = int v^2 + (grad v)^2 dx on the unit square for v = sin(x) + cos(y). The exact value of the functional is M(v) = 2 + 2*sin(1)*(1 - cos(1)) The functional M corresponds to the energy norm for a simple reaction-diffusion equation.""" # Copyright (C) ...
gpl-3.0
-199,221,757,950,484,350
31.117647
81
0.704518
false
CalSol/Impulse
Tracker/register.py
1
3076
# Copyright 2010 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 or agreed to in writi...
apache-2.0
-3,292,369,212,837,635,600
36.060241
80
0.645969
false
livc/Paddle
python/paddle/utils/preprocess_util.py
18
13149
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
apache-2.0
-5,976,977,793,880,472,000
35.323204
112
0.599437
false
erikr/django
django/db/migrations/operations/models.py
12
33007
from __future__ import unicode_literals from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.state import ModelState from django.db.models.options import normalize_together from django.utils import six from django.utils.functional import cached_property fro...
bsd-3-clause
-6,790,830,960,815,898,000
37.604678
119
0.570879
false
deniszgonjanin/ckanext-geojsonview
ckanext/geojsonview/plugin.py
1
1204
import ckan.plugins as plugins import ckan.plugins.toolkit as toolkit import ckanext.resourceproxy.plugin as proxy import ckan.lib.datapreview as datapreview from ckan.common import json class GeojsonviewPlugin(plugins.SingletonPlugin): plugins.implements(plugins.IConfigurer, inherit=True) plugins.implements(...
agpl-3.0
114,481,911,625,623,890
30.684211
75
0.656146
false
cs591B1-Project/Social-Media-Impact-on-Stock-Market-and-Price
data/13 Honeywell/parseJSON.py
26
1412
def getSocialData(post): # Get Thread Object threadObject = post["thread"] domain_rank = threadObject["domain_rank"] #domain_rank #print 'domain_rank:' + str(domain_rank) socialObject = threadObject["social"] #social data object facebookData = socialObject["facebook"] #facebook data #print 'facebook data...
mit
6,337,773,367,350,701,000
34.325
129
0.706799
false
mbareta/edx-platform-ft
common/lib/calc/calc/tests/test_preview.py
257
8723
# -*- coding: utf-8 -*- """ Unit tests for preview.py """ import unittest from calc import preview import pyparsing class LatexRenderedTest(unittest.TestCase): """ Test the initializing code for LatexRendered. Specifically that it stores the correct data and handles parens well. """ def test_sim...
agpl-3.0
3,517,765,545,005,773,300
33.752988
80
0.561848
false
nicanor-romero/OctoPrint
src/octoprint/printer/standard.py
7
31006
# coding=utf-8 """ This module holds the standard implementation of the :class:`PrinterInterface` and it helpers. """ from __future__ import absolute_import __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C...
agpl-3.0
-1,232,424,329,876,951,300
31.670179
252
0.708005
false
stevekuznetsov/ansible
test/units/modules/network/nxos/test_nxos_system.py
51
6189
# # (c) 2016 Red Hat Inc. # # 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 d...
gpl-3.0
-6,410,508,891,350,388,000
46.607692
93
0.635482
false
vponomaryov/manila
manila/share/drivers/hpe/hpe_3par_mediator.py
1
70220
# Copyright 2015 Hewlett Packard Enterprise Development LP # # 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
-3,297,285,315,249,804,300
39.636574
79
0.48358
false
Opentaste/bombolone
bombolone/routes/content.py
1
5760
# -*- coding: utf-8 -*- """ content.py ~~~~~~ :copyright: (c) 2014 by @zizzamia :license: BSD (See LICENSE for details) """ from flask import (Blueprint, abort, request, session, g, current_app, render_template, send_from_directory) # Imports inside Bombolone import bombolone.model.pa...
bsd-3-clause
-3,717,585,810,710,158,300
34.226415
108
0.530556
false
fujunwei/chromium-crosswalk
tools/resources/find_used_resources.py
24
2073
#!/usr/bin/env 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. import argparse import re import sys USAGE = """find_used_resources.py [-h] [-i INPUT] [-o OUTPUT] Outputs the sorted list of resourc...
bsd-3-clause
-8,252,867,062,735,365,000
34.135593
80
0.723589
false
mavenlin/tensorflow
tensorflow/contrib/slim/python/slim/data/data_decoder.py
146
2302
# 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 applica...
apache-2.0
3,815,528,316,752,580,000
30.972222
80
0.694179
false
BryceBrown/LinkstrDjango
rest_framework/tests/hyperlinkedserializers.py
1
9456
from __future__ import unicode_literals import json from django.test import TestCase from django.test.client import RequestFactory from rest_framework import generics, status, serializers from rest_framework.compat import patterns, url from rest_framework.tests.models import Anchor, BasicModel, ManyToManyModel, BlogPos...
apache-2.0
5,860,538,968,587,696,000
34.954373
167
0.662119
false
bisphon/pontiac
settings.py
1
5654
import multiprocessing from six.moves import queue DEBUG = True LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'simple': { 'format': '%(levelname)s %(message)s' }, 'standard': { 'format': '[%(asctime)s] %(levelname)s [%(name)s:%...
mit
-2,026,968,043,772,551,200
26.990099
155
0.454192
false
sontek/rethinkdb
test/interface/table_wait.py
13
5807
#!/usr/bin/env python # Copyright 2014 RethinkDB, all rights reserved. """The `interface.table_wait` test checks that waiting for a table returns when the table is available for writing.""" from __future__ import print_function import multiprocessing, os, sys, time, traceback, pprint startTime = time.time() sys.pa...
agpl-3.0
7,869,045,691,783,210,000
40.184397
138
0.632685
false
Impactstory/sherlockoa
endpoint.py
1
25387
import datetime import json import os from random import random from time import sleep from time import time import requests import shortuuid from sickle import Sickle, oaiexceptions from sickle.iterator import OAIItemIterator from sickle.models import ResumptionToken from sickle.oaiexceptions import NoRecordsMatch, B...
mit
-3,842,098,944,671,516,000
39.749599
145
0.596486
false
xavfernandez/pip
tests/functional/test_search.py
2
5507
import logging import pretend import pytest from pip._internal.cli.status_codes import NO_MATCHES_FOUND, SUCCESS from pip._internal.commands import create_command from pip._internal.commands.search import ( highest_version, print_results, transform_hits, ) from tests.lib import pyversion if pyversion >= ...
mit
6,978,525,318,228,855,000
26.262376
79
0.595606
false
kbrebanov/ansible
lib/ansible/modules/monitoring/honeybadger_deployment.py
49
3829
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2014 Benjamin Curtis <benjamin.curtis@gmail.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_versi...
gpl-3.0
6,300,777,613,414,374,000
27.154412
113
0.640376
false
youdonghai/intellij-community
python/lib/Lib/posixfile.py
87
7843
"""Extended file operations available in POSIX. f = posixfile.open(filename, [mode, [bufsize]]) will create a new posixfile object f = posixfile.fileopen(fileobject) will create a posixfile object from a builtin file object f.file() will return the original builtin file object f.dup() will r...
apache-2.0
-2,616,030,543,840,185,000
32.374468
79
0.531429
false
Distrotech/qtwebkit
Tools/Scripts/webkitpy/w3c/test_importer_unittest.py
115
3011
#!/usr/bin/env python # Copyright (C) 2013 Adobe Systems Incorporated. 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 n...
lgpl-3.0
-5,907,856,606,055,863,000
37.113924
164
0.724676
false
jaehyuk/High-Frequency-Trading-Model-with-IB
params/ib_data_types.py
7
1835
""" Author: James Ma Email stuff here: jamesmawm@gmail.com """ """ API doumentation: https://www.interactivebrokers.com/en/software/api/apiguide/java/reqhistoricaldata.htm https://www.interactivebrokers.com/en/software/api/apiguide/tables/tick_types.htm """ FIELD_BID_SIZE = 0 FIELD_BID_PRICE = 1 FIELD_ASK_PRICE = 2 F...
mit
5,982,893,194,443,235,000
21.9375
86
0.711172
false
arante/pyloc
microblog/flask/lib/python3.5/site-packages/whoosh/support/base85.py
95
2473
""" This module contains generic base85 encoding and decoding functions. The whoosh.util.numeric module contains faster variants for encoding and decoding integers. Modified from: http://paste.lisp.org/display/72815 """ import struct from whoosh.compat import xrange # Instead of using the character set from the as...
gpl-3.0
-2,040,205,077,659,435,800
23.009709
82
0.556814
false
freedesktop-unofficial-mirror/gstreamer__sdk__cerbero
cerbero/ide/xcode/fwlib.py
13
8433
#!/usr/bin/env python # cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free So...
lgpl-2.1
-7,344,319,975,056,721,000
39.936893
106
0.583304
false
robertostling/hnmt
hnmt/bleu.py
1
3963
#!/usr/bin/env python3 """calculate BLEU scores script taken from https://github.com/vikasnar/Bleu and adjusted by Jörg Tiedemann """ import sys import codecs import os import math import operator import json import functools def fetch_data(cand, ref): """ Store each reference and candidate sentences as a lis...
gpl-3.0
-7,621,562,214,709,178,000
27.919708
82
0.551237
false
philsch/ansible
lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule_member.py
11
10209
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Darren Worrall <darren@iweb.co.uk> # (c) 2015, René Moser <mail@renemoser.net> # # 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 So...
gpl-3.0
-5,395,444,621,496,917,000
26.964384
128
0.616146
false
GeyerA/android_external_chromium_org
tools/gdb/gdb_chrome.py
30
10090
# Copyright (c) 2011 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. """GDB support for Chrome types. Add this to your gdb by amending your ~/.gdbinit as follows: python import sys sys.path.insert(0, "/path/to/tools...
bsd-3-clause
3,970,690,216,523,493,000
33.087838
80
0.606739
false
bplancher/odoo
addons/l10n_be_invoice_bba/invoice.py
8
11056
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. import re, time, random from openerp import api from openerp.osv import fields, osv from openerp.tools.translate import _ import logging ...
agpl-3.0
-1,151,263,108,695,639,000
51.669903
177
0.499819
false
laurentgo/pants
src/python/pants/backend/jvm/repository.py
17
1337
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os class Re...
apache-2.0
-3,409,492,094,387,366,000
30.833333
99
0.622289
false
tanium/pytan
BUILD/doc/source/examples/ask_saved_question_by_name_sse_code.py
1
3070
# import the basic python packages we need import os import sys import tempfile import pprint import traceback # disable python from generating a .pyc file sys.dont_write_bytecode = True # change me to the path of pytan if this script is not running from EXAMPLES/PYTAN_API pytan_loc = "~/gh/pytan" pytan_static_path =...
mit
4,185,640,925,806,190,600
32.736264
90
0.71759
false
erjohnso/ansible
lib/ansible/modules/network/junos/junos_config.py
8
13496
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # 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
2,989,866,363,501,046,300
32.572139
92
0.642042
false
vilorious/pyload
module/network/Browser.py
40
4190
#!/usr/bin/env python # -*- coding: utf-8 -*- from logging import getLogger from HTTPRequest import HTTPRequest from HTTPDownload import HTTPDownload class Browser(object): __slots__ = ("log", "options", "bucket", "cj", "_size", "http", "dl") def __init__(self, bucket=None, options={}): self.log = ...
gpl-3.0
-3,494,078,334,252,524,500
27.69863
106
0.597375
false
gregdek/ansible
lib/ansible/modules/network/aci/aci_contract.py
12
8772
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
3,903,769,901,249,731,600
27.666667
148
0.603397
false
atsaki/libcloud
example_loadbalancer.py
58
2483
#!/usr/bin/env python # 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 "Licen...
apache-2.0
-4,751,802,172,801,826,000
33.971831
74
0.662908
false
varunarya10/basicdb
basicdb/utils.py
3
4735
import re BATCH_QUERY_REGEX = re.compile(r'Item\.(\d+)\.(.*)') PUT_ATTRIBUTE_QUERY_REGEX = re.compile(r'Attribute\.(\d+)\.(Name|Value|Replace)') DELETE_QUERY_ARG_REGEX = re.compile(r'Attribute\.(\d+)\.(Name|Value)') EXPECTED_QUERY_ARG_REGEX = re.compile(r'Expected\.(\d+)\.(Name|Value|Exists)') def extract_numbered_ar...
apache-2.0
1,404,700,660,640,621,300
36.88
81
0.540655
false
mfherbst/spack
var/spack/repos/builtin/packages/pigz/package.py
4
1886
############################################################################## # 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
8,219,573,443,659,824,000
39.12766
78
0.657476
false
liberatorqjw/scikit-learn
sklearn/tests/test_multiclass.py
8
21910
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing ...
bsd-3-clause
6,644,685,680,957,347,000
38.265233
81
0.57654
false
HackLinux/python-adb
adb_test.py
3
6340
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
2,538,067,745,087,401,000
29.334928
82
0.671767
false
304471720/mongrel2
examples/ws/python/echo.py
55
3488
import simplejson as json from mongrel2 import handler import wsutil import sys import time import re sender_id = "82209006-86FF-4982-B5EA-D1E29E55D480" conn = handler.Connection(sender_id, "tcp://127.0.0.1:9990", "tcp://127.0.0.1:9989") CONNECTION_TIMEOUT=5 closingMessages={} badUnicode=...
bsd-3-clause
7,351,966,733,813,497,000
27.826446
74
0.571961
false
kapilrastogi/Impala
tests/common/impala_cluster.py
1
8569
# 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 required by applicable law o...
apache-2.0
7,098,882,221,587,213,000
35.619658
89
0.673241
false
z01nl1o02/tests
cnn_layer_size/show_conv_dim.py
1
1705
import os,sys,pdb import argparse ap = argparse.ArgumentParser() ap.add_argument('--height','-H',help='input height',type=int) ap.add_argument('--width','-W',help='input width',type=int) ap.add_argument('--layers','-F',help='layer info txt with each line for one layer') ap.add_argument('--deconv','-D',help='0 for con...
gpl-2.0
8,830,490,057,427,566,000
23.014085
101
0.557771
false
cretingame/Yarr-fw
script/debug.py
1
5687
import os import subprocess script_path = os.getcwd() + "/" + os.path.splitext(__file__)[0] + ".tcl" script_file = open(script_path, "w+") os.chdir("..") project_path = os.getcwd() script_file.write( "######################################################\n" + "# Generated file to open the virtual logic analyyer\...
gpl-3.0
-2,069,367,810,578,305,000
46.789916
220
0.657113
false
Gloomymoon/SecKill
manage.py
1
1215
#!/usr/bin/env python # -*- coding: UTF-8 -* import os from app import create_app, db from app.models import User, Role, Permission, Coupon, SecKill, Datemark from flask_script import Manager, Shell from flask_migrate import Migrate, MigrateCommand app = create_app(os.getenv('ATH_CONFIG') or 'default') manager = Manag...
gpl-3.0
-8,661,893,249,062,246,000
25.434783
111
0.68642
false
xzturn/tensorflow
tensorflow/python/compiler/tensorrt/test/biasadd_matmul_test.py
3
4713
# 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
3,452,165,737,496,780,300
35.820313
93
0.643115
false
beeftornado/sentry
src/sentry/api/endpoints/project_key_stats.py
3
2056
from __future__ import absolute_import import six from collections import OrderedDict from django.db.models import F from rest_framework.response import Response from sentry import tsdb from sentry.api.base import StatsMixin from sentry.api.bases.project import ProjectEndpoint from sentry.api.exceptions import Resou...
bsd-3-clause
8,782,102,129,794,222,000
35.714286
99
0.57393
false
javachengwc/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/openpyxl/shared/password_hasher.py
118
1850
# file openpyxl/shared/password_hasher.py # Copyright (c) 2010 openpyxl # # 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 us...
apache-2.0
8,326,501,430,527,015,000
38.361702
79
0.727027
false
skycucumber/Messaging-Gateway
webapp/venv/lib/python2.7/site-packages/twisted/python/release.py
52
1107
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ A release-automation toolkit. Don't use this outside of Twisted. Maintainer: Christopher Armstrong """ import os # errors class DirectoryExists(OSError): """ Some directory exists when it shouldn't. """ pass class Dire...
gpl-2.0
-5,842,044,035,875,407,000
16.571429
66
0.61879
false
leekchan/django_test
django/contrib/admindocs/utils.py
23
4114
"Misc. utility functions/classes for admin documentation generator." import re from email.parser import HeaderParser from email.errors import HeaderParseError from django.utils.safestring import mark_safe from django.core.urlresolvers import reverse from django.utils.encoding import force_bytes try: import docuti...
bsd-3-clause
-9,213,072,462,321,522,000
28.597122
94
0.60841
false
Rundll/django-mailer-2
django_mailer/lockfile.py
179
15120
""" lockfile.py - Platform-independent advisory file locks. Requires Python 2.5 unless you apply 2.4.diff Locking is done on a per-thread basis instead of a per-process basis. Usage: >>> lock = FileLock('somefile') >>> try: ... lock.acquire() ... except AlreadyLocked: ... print 'somefile', 'is locked alread...
mit
2,514,133,598,610,212,000
29.361446
77
0.513294
false
beebotte/ISS-realtime-position
iss_position_pub.py
1
3041
#!/usr/bin/python # coding: utf8 ############################################################ # Author Bachar Wehbi <me@bachwehbi.net> # Copyright (c) 2013-2014 Beebotte <contact@beebotte.com> # This program is published under the MIT License # Check http://opensource.org/licenses/MIT for details. # # This code uses...
mit
6,291,293,306,692,910,000
27.157407
98
0.624466
false
ansible/ansible-modules-core
network/netvisor/pn_vlan.py
29
8941
#!/usr/bin/python """ PN CLI vlan-create/vlan-delete """ # # 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...
gpl-3.0
3,900,338,691,962,531,000
27.749196
79
0.618387
false
antoan2/incubator-mxnet
python/mxnet/module/sequential_module.py
38
17331
# 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,246,953,449,106,535,400
38.47836
98
0.592984
false
yeming233/rally
tests/unit/plugins/openstack/scenarios/ceilometer/test_stats.py
2
1757
# 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 law or agreed to in...
apache-2.0
8,847,066,008,096,648,000
38.044444
78
0.586796
false
stevenbaker/dotfiles
.vim/bundle/jedi-vim/jedi/test/completion/descriptors.py
14
2662
class RevealAccess(object): """ A data descriptor that sets and returns values normally and prints a message logging their access. """ def __init__(self, initval=None, name='var'): self.val = initval self.name = name def __get__(self, obj, objtype): print('Retrieving', s...
mit
-5,508,422,796,701,280,000
13.626374
63
0.493614
false
Nofe92/srcdemo2
launcher/SrcDemo2Launcher.py
8
10302
import sys import os import re import time import base64 import tempfile import subprocess import threading if __name__ == '__main__': print 'Please do not launch this file directly.' sys.exit(0) def module_path(): if hasattr(sys, "frozen"): return os.path.dirname(sys.executable) return os.path.dirname(__file__...
bsd-2-clause
6,488,521,361,306,192,000
32.339806
329
0.693749
false
stackforge/cloudbase-init
cloudbaseinit/tests/metadata/services/test_maasservice.py
1
17075
# Copyright 2014 Cloudbase Solutions Srl # # 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 l...
apache-2.0
-6,710,028,509,444,999,000
41.264851
79
0.573353
false
sysalexis/kbengine
kbe/res/scripts/common/Lib/traceback.py
87
11167
"""Extract, format and print information about Python stack traces.""" import linecache import sys import operator __all__ = ['extract_stack', 'extract_tb', 'format_exception', 'format_exception_only', 'format_list', 'format_stack', 'format_tb', 'print_exc', 'format_exc', 'print_exception', ...
lgpl-3.0
-1,010,462,565,069,940,100
34.677316
79
0.646637
false
magnatronus/titanium-sac
lib/tiutils.py
1
2781
# # tiutils.py is a Titanium function library for use with the SpiralArm Titanium plug-in for Sublime Text 3 # # developed by Steve Rogers, SpiralArm Consulting Ltd (www.spiralarm.uk) # @sarmcon # # import sublime, subprocess,os from os.path import expanduser # read in our default Titanium settings settings = subl...
mit
7,324,114,253,495,125,000
32.506024
221
0.701906
false
r0h4n/commons
tendrl/commons/flows/expand_cluster/gluster_help.py
2
1884
from tendrl.commons.flows.exceptions import FlowExecutionFailedError from tendrl.commons.utils import log_utils as logger def get_node_ips(parameters): node_ips = [] for node, config in parameters["Cluster.node_configuration"].iteritems(): node_ips.append(config["provisioning_ip"]) return node_ips...
lgpl-2.1
-8,369,157,104,479,833,000
29.885246
77
0.597665
false
Tiendil/deworld
deworld/cartographer.py
1
4067
# coding: utf-8 import os try: from PIL import Image except: pass from deworld.map_colors import HeightColorMap, RGBColorMap from deworld.layers import VEGETATION_TYPE def draw_image(turn, catalog, layer, power_points, colorizer): if not os.path.exists(catalog): os.makedirs(catalog) img = ...
bsd-2-clause
7,333,891,058,448,866,000
30.527132
74
0.598967
false
pfeyz/psiTurk
psiturk/command_line.py
6
3137
''' This module supports commandline functionality ''' import argparse import sys, os from psiturk.version import version_number from psiturk.psiturk_org_services import ExperimentExchangeServices def process(): ''' Figure out how we were invoked ''' invoked_as = os.path.basename(sys.argv[0]) if invoked...
mit
3,108,617,503,214,783,000
29.163462
78
0.63532
false
llvm/llvm-lnt
lnt/util/wsgi_restart.py
1
3202
# This code lifted from the mod_wsgi docs. from __future__ import print_function from future import standard_library standard_library.install_aliases() import os from pathlib import Path from typing import Sequence import sys import signal import threading import atexit import queue _interval = 1.0 _times = {} _files ...
apache-2.0
-1,150,562,447,778,956,900
24.412698
76
0.601499
false
zhangyage/Python-oldboy
day07/paramiko-1.15.2/paramiko-1.15.2/paramiko/pipe.py
44
4005
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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 2.1 of the License, or (a...
apache-2.0
4,168,675,356,764,557,000
25.879195
79
0.599501
false
alanjw/GreenOpenERP-Win-X86
python/Lib/site-packages/win32/Demos/mmapfile_demo.py
4
2822
import win32api, mmapfile import winerror import tempfile, os from pywin32_testutil import str2bytes system_info=win32api.GetSystemInfo() page_size=system_info[1] alloc_size=system_info[7] fname=tempfile.mktemp() mapping_name=os.path.split(fname)[1] fsize=8*page_size print fname, fsize, mapping_name m1...
agpl-3.0
-6,936,967,356,234,964,000
27.705263
85
0.67399
false
pdellaert/ansible
lib/ansible/modules/cloud/azure/azure_rm_cdnendpoint_info.py
19
10046
#!/usr/bin/python # # Copyright (c) 2019 Hai Cao, <t-haicao@microsoft.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
714,812,297,882,869,600
30.892063
155
0.570078
false
galaxy001/libtorrent
python_BTL_BitTorrent-5.3-GPL/BTL/twisted_brpc.py
5
24332
# 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 distributed in the hope that it will be useful, # bu...
mit
3,917,561,130,355,708,400
35.370703
106
0.612239
false
jhayworth/config
.emacs.d/elpy/rpc-venv/lib/python2.7/distutils/__init__.py
5
4374
import os import sys import warnings # opcode is not a virtualenv module, so we can use it to find the stdlib # Important! To work on pypy, this must be a module that resides in the # lib-python/modified-x.y.z directory import opcode dirname = os.path.dirname distutils_path = os.path.join(os.path.dirname(opcode.__fi...
gpl-3.0
6,473,410,251,523,373,000
31.641791
119
0.671925
false
hoeck/webkitwindow
webkitwindow.py
1
27686
import sys import os import Queue import StringIO import urlparse import mimetypes import pkgutil import itertools try: from PyQt4 import QtCore, QtGui, QtWebKit, QtNetwork except ImportError: from PySide import QtCore, QtGui, QtWebKit, QtNetwork HTTP_STATUS = { 200: 'OK', 301: 'Moved Permanently', ...
bsd-3-clause
7,293,582,756,853,621,000
33.096059
150
0.612728
false
sivas2811/mocha_739
hotdot_env/lib/python2.7/site-packages/setuptools/_backport/hashlib/_sha512.py
77
14505
""" This code was Ported from CPython's sha512module.c """ import struct SHA_BLOCKSIZE = 128 SHA_DIGESTSIZE = 64 def new_shaobject(): return { 'digest': [0]*8, 'count_lo': 0, 'count_hi': 0, 'data': [0]* SHA_BLOCKSIZE, 'local': 0, 'digestsize': 0 } ROR64 = lam...
unlicense
8,364,937,748,310,473,000
49.364583
186
0.569459
false
moreati/ppeg
setup.py
1
1037
#!/usr/bin/env python import io import os from setuptools import setup, Extension def read(fname, encoding='utf-8'): here = os.path.dirname(__file__) with io.open(os.path.join(here, fname), encoding=encoding) as f: return f.read() setup ( name='PPeg', version='0.9.4', description="A Py...
mit
8,715,464,515,694,957,000
22.568182
71
0.588235
false
tomSny/XStarLogViewer
LogAnalyzer/py2exe/LogAnalyzer.py
3
12537
#!/usr/bin/env python # # A module to analyze and identify any common problems which can be determined from log files # # Initial code by Andrew Chapman (amchapman@gmail.com), 16th Jan 2014 # # some logging oddities noticed while doing this, to be followed up on: # - tradheli MOT labels Mot1,Mot2,Mot3,Mot4,GGain # ...
gpl-3.0
1,564,750,051,588,259,800
46.851145
179
0.602457
false
ubic135/odoo-design
addons/crm_partner_assign/__openerp__.py
114
2453
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-5,485,563,293,609,356,000
39.883333
103
0.602528
false
jviada/QuantEcon.py
quantecon/tests/test_lqcontrol.py
7
2299
""" Author: Chase Coleman Filename: test_lqcontrol Tests for lqcontrol.py file """ import sys import os import unittest import numpy as np from scipy.linalg import LinAlgError from numpy.testing import assert_allclose from quantecon.lqcontrol import LQ class TestLQControl(unittest.TestCase): def setUp(self): ...
bsd-3-clause
5,212,364,272,007,663,000
23.457447
74
0.541975
false
4dn-dcic/fourfront
src/encoded/upgrade/file.py
2
2394
from snovault import ( upgrade_step, ) @upgrade_step('file_fastq', '1', '2') @upgrade_step('file_calibration', '1', '2') @upgrade_step('file_microscopy', '1', '2') @upgrade_step('file_processed', '1', '2') @upgrade_step('file_reference', '1', '2') def file_1_2(value, system): file_format = value.get('file_for...
mit
-838,971,727,424,048,300
34.205882
77
0.559315
false
ContextLogic/luigi
test/contrib/bigquery_test.py
5
6811
# -*- coding: utf-8 -*- # # Copyright 2015 Twitter 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 ...
apache-2.0
3,045,274,923,417,055,000
29.004405
95
0.661283
false
aricchen/openHR
openerp/addons/portal_project/tests/__init__.py
170
1124
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
4,672,943,897,118,079,000
39.142857
78
0.618327
false
public-ink/public-ink
server/appengine/lib/numpy/core/tests/test_function_base.py
16
11429
from __future__ import division, absolute_import, print_function from numpy import (logspace, linspace, geomspace, dtype, array, sctypes, arange, isnan, ndarray, sqrt, nextafter) from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_raises, assert_array_equal,...
gpl-3.0
8,972,132,414,561,593,000
34.166154
80
0.549392
false
ismael-liceras/php-invaders
gameengine.py
1
12699
import pygame from pygame.locals import * from player import Player from stagegenerator import StageGenerator from gamestatus import GameStatus from gameconfig import GameConfig class GameEngine(): def __init__(self, modes=None): pygame.init() self.screen = pygame.display.set_mode((800, 600)) ...
mit
628,601,575,994,094,200
40.368078
144
0.586739
false
AutorestCI/azure-sdk-for-python
azure-mgmt-sql/azure/mgmt/sql/models/location_capabilities.py
2
1723
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-1,544,947,971,819,445,500
35.659574
109
0.609983
false
Forage/Gramps
gramps/plugins/docgen/rtfdoc.py
1
21285
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2006 Donald N. Allingham # Copyright (C) 2007-2009 Brian G. Matherly # Copyright (C) 2009 Gary Burton # Copyright (C) 2010 Peter Landgren # Copyright (C) 2011 Adam Stein <adam@csh.rit.edu> # # This program is free software; you...
gpl-2.0
2,147,923,212,365,953,000
38.198895
91
0.477097
false
taedla01/MissionPlanner
Lib/dumbdbm.py
63
9070
"""A dumb and slow but simple dbm clone. For database spam, spam.dir contains the index (a text file), spam.bak *may* contain a backup of the index (also a text file), while spam.dat contains the data (a binary file). XXX TO DO: - seems to contain a bug when updating... - reclaim free space (currently, sp...
gpl-3.0
8,398,417,208,798,621,000
34.28
78
0.574642
false
cmcdowell/weatherpy
weatherpy/wind.py
1
1807
class Wind(object): """ Current forecast information about the wind. Attributes: chill: Wind chill in degrees (integer). If a value for wind chill is not found, chill will be None. direction: Wind direction in degrees (integer). If a value for wind direction is not...
mit
-1,106,267,896,262,292,900
31.267857
80
0.563918
false
WURFL/wurfl-cloud-client-python
setup.py
1
1722
from setuptools import setup import os.path __license__ = """ Copyright (c) 2015 ScientiaMobile Inc. The WURFL Cloud Client is intended to be used in both open-source and commercial environments. To allow its use in as many situations as possible, the WURFL Cloud Client is dual-licensed. You may choose to use th...
gpl-2.0
-1,736,531,335,121,346,800
34.875
83
0.5964
false
richardnpaul/FWL-Website
lib/python2.7/site-packages/django/contrib/sitemaps/tests/urls/http.py
97
1691
from datetime import datetime from django.conf.urls import patterns, url from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap, views from django.contrib.auth.models import User from django.views.decorators.cache import cache_page from django.contrib.sitemaps.tests.base import TestModel class ...
gpl-3.0
100,383,664,389,942,800
35.76087
84
0.668835
false