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
KyleJamesWalker/ansible-modules-core
cloud/amazon/ec2_vpc_net.py
35
9734
#!/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
-6,942,301,985,924,098,000
32.108844
173
0.627902
false
public-ink/public-ink
server/appengine/lib/numpy/distutils/__config__.py
2
1398
# This file is generated by /private/var/folders/w8/mp6r1h_s51dfzfhtclzq7jdjj2krv0/T/pip-build-_1SLS7/numpy/-c # It contains system_info results at the time of building this package. __all__ = ["get_info","show"] atlas_3_10_blas_info={} atlas_3_10_blas_threads_info={} atlas_threads_info={} blas_opt_info={'extra_link_a...
gpl-3.0
-7,659,316,054,906,746,000
37.861111
225
0.594421
false
alanswanson/webserver
qa/180-RuleExists2.py
8
1074
from base import * FILE1 = 'special_file_for_180' FILE2 = 'foobar180_file' MAGIC = 'Alvaro: http://www.alobbs.com/' FORBIDDEN = 'This is forbidden string' CONF = """ vserver!1!rule!1800!match = exists vserver!1!rule!1800!match!exists = %s vserver!1!rule!1800!match!final = 1 vserver!1!rule!1800!handler = f...
gpl-2.0
6,776,258,135,934,844,000
25.85
65
0.604283
false
Tomtomgo/phantomjs
src/qt/qtwebkit/Tools/BuildSlaveSupport/build.webkit.org-config/committer_auth_unittest.py
123
9892
#!/usr/bin/env python # # Copyright (C) 2011 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
-7,621,212,252,201,272,000
43.963636
132
0.711585
false
jordanemedlock/psychtruths
temboo/Library/SendGrid/NewsletterAPI/Lists/RenameRecipientList.py
5
4167
# -*- coding: utf-8 -*- ############################################################################### # # RenameRecipientList # Rename a recipient list. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file ex...
apache-2.0
2,302,183,327,188,124,200
39.456311
179
0.680586
false
DBuildService/atomic-reactor
tests/utils/test_cachito.py
1
11889
""" Copyright (c) 2019 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from atomic_reactor.utils.cachito import ( CachitoAPI, CachitoAPIInvalidRequest, CachitoAPIRequestTimeout, CachitoAPIUnsuccessfulRequest)...
bsd-3-clause
3,292,987,063,324,609,500
37.228296
100
0.621835
false
mylene-campana/hpp-rbprm-corba
src/hpp/corbaserver/rbprm/tools/generateROMs.py
4
2394
from hpp.corbaserver.rbprm.rbprmbuilder import Builder from hpp.corbaserver.rbprm.rbprmfullbody import FullBody from hpp.gepetto import Viewer packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urdf and srdf files. urdfName = "hrp2_14"...
lgpl-3.0
-4,386,679,132,875,762,000
25.307692
105
0.677527
false
artwr/airflow
airflow/contrib/plugins/metastore_browser/main.py
3
6084
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
-8,649,331,040,541,137,000
32.61326
75
0.601907
false
suncycheng/intellij-community
python/lib/Lib/site-packages/django/core/serializers/__init__.py
74
3535
""" Interfaces for serializing Django objects. Usage:: from django.core import serializers json = serializers.serialize("json", some_query_set) objects = list(serializers.deserialize("json", json)) To add your own serializers, use the SERIALIZATION_MODULES setting:: SERIALIZATION_MODULES = { ...
apache-2.0
-1,974,267,624,255,860,700
30.283186
92
0.693918
false
hackaugusto/raiden
raiden/tests/integration/network/proxies/test_token_network_registry.py
1
4120
from unittest.mock import patch import pytest from eth_utils import is_same_address, to_canonical_address from raiden.constants import ( RED_EYES_PER_CHANNEL_PARTICIPANT_LIMIT, RED_EYES_PER_TOKEN_NETWORK_LIMIT, ) from raiden.exceptions import AddressWithoutCode, InvalidToken, RaidenRecoverableError from raide...
mit
-6,327,332,786,881,505,000
44.274725
97
0.726699
false
sekikn/incubator-airflow
airflow/contrib/hooks/__init__.py
15
1053
# # 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...
apache-2.0
-294,459,698,375,317,600
38
93
0.755935
false
wakermahmud/sync-engine
inbox/util/url.py
2
4681
import dns from dns.resolver import Resolver from dns.resolver import NoNameservers, NXDOMAIN, Timeout, NoAnswer from urllib import urlencode from inbox.log import get_logger import re log = get_logger('inbox.util.url') from inbox.providers import providers # http://www.regular-expressions.info/email.html EMAIL_REGEX...
agpl-3.0
-6,848,782,863,651,681,000
30
78
0.62508
false
erdewit/ib_insync
ib_insync/order.py
1
12269
"""Order types used by Interactive Brokers.""" from dataclasses import dataclass, field from typing import ClassVar, List, NamedTuple, Set from eventkit import Event from .contract import Contract, TagValue from .objects import Fill, SoftDollarTier, TradeLogEntry from .util import UNSET_DOUBLE, UNSET_INTEGER, datacl...
bsd-2-clause
8,655,842,321,981,788,000
29.071078
77
0.646426
false
sumedhasingla/VTK
Examples/Infovis/Python/selection.py
18
3457
#!/usr/bin/env python from vtk import * source = vtkRandomGraphSource() source.DirectedOff() source.SetNumberOfVertices(100) source.SetEdgeProbability(0) # Basically generates a tree source.SetUseEdgeProbability(True) source.SetStartWithTree(True) source.IncludeEdgeWeightsOn() # Connect to the Boost centrality filter...
bsd-3-clause
-6,445,229,048,414,973,000
29.59292
73
0.819786
false
christiandev/l10n-brazil
__unported__/l10n_br_account_product/sped/nfe/serializer/txt.py
2
52934
# -*- encoding: utf-8 -*- # ############################################################################## # # # Copyright (C) 2009 Renato Lima - Akretion # # ...
agpl-3.0
456,036,301,785,395,140
45.795756
137
0.420606
false
quake0day/Dodrio
scrape_author.py
1
4074
import sys # used for taking input from the command line from bs4 import BeautifulSoup # used for parsing and doing some funky HTML stuff import urllib # used for grabbing data from URLs import unicodedata # for converting unicode to ascii """ Jon Hurlock's Google Scholar Tools by Jon Hurlock (@jonhurlock) * is licens...
mit
-388,806,886,892,948,900
41.884211
219
0.624939
false
jetty840/ReplicatorG
skein_engines/skeinforge-50/fabmetheus_utilities/geometry/statements/while.py
13
1165
""" Polygon path. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities.geometry.geometry_utilities import evaluate __author__...
gpl-2.0
-8,100,691,912,260,379,000
33.264706
157
0.754506
false
woelfware/BluMote
test/button_learn.py
1
2538
#!/usr/bin/env python # Copyright (C) 2011 Woelfware from bluetooth import * import blumote import cPickle import os import sys import time class Blumote_Client(blumote.Services): def __init__(self): blumote.Services.__init__(self) self.addr = None def find_blumote_pods(self, pod_name = None): if pod_name is...
gpl-3.0
-1,597,566,200,518,623,000
25.4375
83
0.648148
false
rsj217/tornado--scaffold
tornapro/ghost/app/helper.py
1
1216
#!/usr/bin/env python # -*- coding:utf-8 -*- __author__ = 'ghost' import urlparse import tornado.web from tornado.httputil import HTTPServerRequest from .auth.models import User class BaseAuthHandler(tornado.web.RequestHandler): def get_current_user(self): cookie = self.get_secure_cookie('user') ...
mit
9,117,913,689,934,622,000
28.682927
105
0.675987
false
mattjmorrison/ReportLab
tests/test_pdfbase_pdfmetrics.py
5
4192
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #test_pdfbase_pdfmetrics_widths """ Various tests for PDF metrics. The main test prints out a PDF documents enabling checking of widths of every glyph in every standard font. Long! """ __version__='''$Id: test_pdfbase_pdfmetrics.py 3288 2...
bsd-3-clause
-5,471,092,999,996,303,000
33.360656
157
0.642653
false
stephane-martin/salt-debian-packaging
salt-2016.3.2/salt/utils/preseed.py
2
2635
# -*- coding: utf-8 -*- ''' Utilities for managing Debian preseed .. versionadded:: Beryllium ''' from __future__ import absolute_import import yaml import shlex import salt.utils def mksls(src, dst=None): ''' Convert a preseed file to an SLS file ''' ps_opts = {} with salt.utils.fopen(src, 'r') ...
apache-2.0
4,357,955,646,474,317,000
32.782051
91
0.531689
false
ntuecon/server
pyenv/Lib/site-packages/win32comext/shell/demos/browse_for_folder.py
4
1701
# A couple of samples using SHBrowseForFolder import sys, os from win32com.shell import shell, shellcon import win32gui # A callback procedure - called by SHBrowseForFolder def BrowseCallbackProc(hwnd, msg, lp, data): if msg== shellcon.BFFM_INITIALIZED: win32gui.SendMessage(hwnd, shellcon.BFFM_SE...
bsd-3-clause
5,427,967,116,793,838,000
40.525
76
0.559083
false
KawashiroNitori/Anubis
anubis/handler/base.py
1
16407
import base64 import accept import asyncio import calendar import functools import hmac import logging import markupsafe import pytz import sockjs import time import traceback from aiohttp import web from email import utils from anubis import app from anubis import error from anubis import template from anubis.model ...
gpl-3.0
-6,119,790,597,871,543,000
35.059341
104
0.582069
false
rds0751/colinkers
env/Lib/encodings/cp1026.py
272
13113
""" Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,inp...
agpl-3.0
4,469,631,770,379,715,000
41.713355
118
0.520018
false
yvaucher/stock-logistics-workflow
__unported__/stock_location_flow_creator/stock_location_path_template.py
33
1734
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher (Camptocamp) # Copyright 2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licens...
agpl-3.0
-7,329,265,911,819,929,000
42.35
106
0.625144
false
13W/phantomjs
src/breakpad/src/tools/gyp/pylib/gyp/MSVSProject.py
137
7491
#!/usr/bin/python2.4 # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Visual Studio project reader/writer.""" import common import xml.dom import xml.dom.minidom import MSVSNew #----------------------------...
bsd-3-clause
2,222,586,826,869,150,000
29.70082
79
0.639701
false
little-dude/monolithe
setup.py
1
2205
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent 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 # no...
bsd-3-clause
-2,036,156,927,630,756,900
46.934783
86
0.738322
false
MostlyOpen/odoo_addons
myo_summary/models/summary.py
1
2051
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by #...
agpl-3.0
6,563,273,727,848,346,000
32.622951
97
0.58313
false
X-DataInitiative/tick
tick/base/base.py
2
20133
# License: BSD 3 clause # import warnings import os import inspect from datetime import datetime from abc import ABCMeta import json import pydoc import numpy as np import numpydoc as nd from numpydoc import docscrape import copy # The metaclass inherits from ABCMeta and not type, since we'd like to # do abstract cla...
bsd-3-clause
-3,154,933,509,442,437,600
34.570671
80
0.542095
false
Censio/filterpy
filterpy/kalman/tests/test_sensor_fusion.py
1
2585
# -*- coding: utf-8 -*- """Copyright 2015 Roger R Labbe Jr. FilterPy library. http://github.com/rlabbe/filterpy Documentation at: https://filterpy.readthedocs.org Supporting book at: https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python This is licensed under an MIT license. See the readme.MD file for mor...
mit
6,188,903,500,340,922,000
19.68
66
0.530368
false
sjtufs/GroundHog
experiments/nmt/sample.py
1
18993
#!/usr/bin/env python import argparse import cPickle import traceback import logging import time import sys import numpy import experiments.nmt from experiments.nmt import\ RNNEncoderDecoder,\ prototype_state,\ parse_input from experiments.nmt.numpy_compat import argpartition logger = logging.getLogger...
bsd-3-clause
-1,090,722,943,041,143,000
37.062124
123
0.531301
false
iegor/kdeutils
superkaramba/examples/image/image.py
4
4192
#this import statement allows access to the karamba functions import karamba images = [0,0,0,0,0,0,0,0,0,0,0,0,0,0] c = 0 #this is called when you widget is initialized def initWidget(widget): global images images[0] = karamba.getThemeImage(widget, "image0") images[1] = karamba.getThemeImage(widget, "imag...
gpl-2.0
1,748,586,711,910,167,800
33.644628
93
0.637643
false
bootphon/tde
tde/substrings/acss.py
1
3207
"""Find common substrings. """ from itertools import combinations import numpy as np from tde.substrings.ccss import allcommonsubstrings as _acss from tde.data.interval import Interval from tde.data.fragment import FragmentToken def pairwise_substring_completion(fragment1, fragment2, corpus, ...
gpl-3.0
1,124,958,771,564,618,200
27.891892
78
0.582476
false
piquadrat/django
django/db/models/sql/subqueries.py
14
7198
""" Query subclasses which provide extra functionality beyond simple data retrieval. """ from django.core.exceptions import FieldError from django.db import connections from django.db.models.query_utils import Q from django.db.models.sql.constants import ( CURSOR, GET_ITERATOR_CHUNK_SIZE, NO_RESULTS, ) from django...
bsd-3-clause
-976,074,645,308,756,100
36.295337
96
0.598222
false
dwoods/gn-maps
geonode/maps/management/__init__.py
9
1764
######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 #...
gpl-3.0
7,782,925,544,287,832,000
46.675676
127
0.687075
false
deepmind/spriteworld
tests/renderers/pil_renderer_test.py
1
3531
# Copyright 2019 DeepMind Technologies Limited. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
apache-2.0
6,902,517,400,239,255,000
37.380435
79
0.649391
false
NunoEdgarGub1/nupic
tests/swarming/nupic/swarming/experiments/smart_speculation_temporal/description.py
8
16830
# ---------------------------------------------------------------------- # 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 apply: # # This progra...
gpl-3.0
-8,510,389,376,337,210,000
38.881517
110
0.576946
false
Affirm/moto
moto/ec2/responses/elastic_ip_addresses.py
3
6250
from __future__ import unicode_literals from moto.core.responses import BaseResponse from moto.ec2.utils import filters_from_querystring class ElasticIPAddresses(BaseResponse): def allocate_address(self): domain = self._get_param('Domain', if_none='standard') if self.is_not_dryrun('AllocateAddres...
apache-2.0
-3,767,235,936,547,010,600
42.706294
113
0.62464
false
cliffano/swaggy-jenkins
clients/python/generated/swaggyjenkins/models/github_scmlinks.py
1
3557
# coding: utf-8 """ Swaggy Jenkins Jenkins API clients generated from Swagger / Open API specification # noqa: E501 OpenAPI spec version: 1.1.1 Contact: blah@cliffano.com Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six class GithubScmlinks(o...
mit
4,873,425,758,211,513,000
24.589928
85
0.526848
false
ProfessionalIT/maxigenios-website
sdk/google_appengine/lib/django-1.2/django/contrib/gis/db/models/proxy.py
404
2512
""" The GeometryProxy object, allows for lazy-geometries. The proxy uses Python descriptors for instantiating and setting Geometry objects corresponding to geographic model fields. Thanks to Robert Coup for providing this functionality (see #4322). """ class GeometryProxy(object): def __init__(self, klass, field...
mit
3,504,497,969,373,523,000
38.25
121
0.614252
false
M4sse/chromium.src
tools/perf/benchmarks/octane.py
9
5659
# Copyright 2012 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. """Runs Octane 2.0 javascript benchmark. Octane 2.0 is a modern benchmark that measures a JavaScript engine's performance by running a suite of tests repres...
bsd-3-clause
2,049,505,463,369,379,300
37.236486
80
0.676091
false
arnedesmedt/dotfiles
.config/sublime-text-3/Packages.symlinkfollow/pygments/all/pygments/formatters/bbcode.py
50
3314
# -*- coding: utf-8 -*- """ pygments.formatters.bbcode ~~~~~~~~~~~~~~~~~~~~~~~~~~ BBcode formatter. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments.util import get_bool_opt __al...
mit
2,784,837,008,139,455,500
29.40367
78
0.539529
false
aaxelb/SHARE
tests/share/regulate/steps/test_block_extra_values.py
2
1810
import pytest from share.regulate.steps.block_extra_values import BlockExtraValues from share.util.graph import MutableGraph class TestBlockExtraValuesStep: @pytest.fixture def graph(self): g = MutableGraph() g.add_node(1, 'creativework', { 'title': 'A work!', 'extra':...
apache-2.0
-311,704,125,936,537,100
31.909091
71
0.534807
false
hemny-singh/squealy
squealy/migrations/0004_auto_20170331_0620.py
5
1655
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-03-31 06:20 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import squealy.models class Migration(migrations.Migration): dependencies = [ ('squealy', '0003_merge_20170330_1334')...
mit
-2,030,424,154,329,464,300
34.212766
150
0.603021
false
Splo0sh/3DCT
pyto/test/test_affine_2d.py
2
23214
""" Tests module affine_2d # Author: Vladan Lucic # $Id: test_affine_2d.py 1152 2015-05-26 08:53:37Z vladan $ """ __version__ = "$Revision: 1152 $" from copy import copy, deepcopy import unittest import numpy import numpy.testing as np_test import scipy from pyto.affine_2d import Affine2D class TestAffine2D(np_...
gpl-3.0
-7,662,259,094,853,936,000
41.361314
80
0.563108
false
REMEXLabs/SmartKitchen-BLE-Gateway
src/rest_utility.py
1
5462
import base64 import json import logging import time import threading import requests # This is designed for OpenHab # TODO: Refactor to work with arbitrary REST Server class OpenHabRestInterface(threading.Thread): prev_state = {} # stores item states update = False def __init__(self, host, port, user,...
apache-2.0
9,190,229,965,251,586,000
36.930556
79
0.520688
false
lukauskas/scipy
doc/source/tutorial/stats/plots/kde_plot4.py
142
1457
from functools import partial import numpy as np from scipy import stats import matplotlib.pyplot as plt def my_kde_bandwidth(obj, fac=1./5): """We use Scott's Rule, multiplied by a constant factor.""" return np.power(obj.n, -1./(obj.d+4)) * fac loc1, scale1, size1 = (-2, 1, 175) loc2, scale2, size2 = (2, ...
bsd-3-clause
-5,344,178,218,315,971,000
32.113636
78
0.649279
false
keshashah/GCompris
src/administration-activity/admin/profile_edit.py
1
4836
# gcompris - profile_edit.py # # Copyright (C) 2005, 2008 Bruno Coudoin and Yves Combe # # 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 o...
gpl-2.0
-4,434,151,743,182,543,400
33.056338
97
0.601944
false
karthikvadla16/spark-tk
integration-tests/tests/test_frame_binary_classification_metrics.py
12
4932
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
-8,548,154,022,411,239,000
49.5625
127
0.698187
false
MyAOSP/external_chromium_org
third_party/tlslite/tlslite/utils/xmltools.py
259
7358
"""Helper functions for XML. This module has misc. helper functions for working with XML DOM nodes.""" import re from compat import * import os if os.name != "java": from xml.dom import minidom from xml.sax import saxutils def parseDocument(s): return minidom.parseString(s) else: from javax....
bsd-3-clause
-1,338,596,729,319,123,000
35.606965
124
0.636042
false
pkuyym/Paddle
python/paddle/dataset/flowers.py
3
7010
# 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
1,566,393,690,081,595,000
34.226131
78
0.671612
false
mbernasocchi/QGIS
python/plugins/processing/algs/grass7/ext/v_distance.py
45
2340
# -*- coding: utf-8 -*- """ *************************************************************************** v_distance.py ------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ********************************...
gpl-2.0
810,388,381,730,716,500
43.884615
107
0.583119
false
blueburningcoder/nupic
examples/opf/experiments/anomaly/temporal/hotgym/description.py
6
16403
# ---------------------------------------------------------------------- # 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 apply: # # This progra...
agpl-3.0
-8,356,152,980,887,444,000
38.620773
91
0.600256
false
willingc/oh-mainline
vendor/packages/Django/django/utils/importlib.py
124
1228
# Taken from Python 2.7 with permission from/by the original author. import sys def _resolve_name(name, package, level): """Return the absolute name of the module to be imported.""" if not hasattr(package, 'rindex'): raise ValueError("'package' not set to a string") dot = len(package) for x in ...
agpl-3.0
1,929,293,942,333,754,600
33.111111
78
0.601792
false
MycChiu/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/distribution_test.py
96
8140
# 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
-8,300,425,414,723,408,000
41.176166
80
0.652457
false
rs2/bokeh
examples/models/server/widgets.py
3
2268
from __future__ import print_function from datetime import date import random random.seed(1) from bokeh.client import push_session from bokeh.io import curdoc from bokeh.models.glyphs import Line, Circle from bokeh.models import ( Plot, ColumnDataSource, DataRange1d, LinearAxis, DatetimeAxis, Grid, HoverTool ...
bsd-3-clause
-8,242,039,926,395,556,000
27.35
97
0.681217
false
vismartltd/edx-platform
lms/djangoapps/shoppingcart/pdf.py
103
18493
""" Template for PDF Receipt/Invoice Generation """ from PIL import Image import logging from reportlab.lib import colors from django.conf import settings from django.utils.translation import ugettext as _ from reportlab.pdfgen.canvas import Canvas from reportlab.lib.pagesizes import letter from reportlab.lib.units imp...
agpl-3.0
8,083,949,421,226,324,000
37.527083
119
0.55329
false
yatinag/selfcure
lib/flask/_compat.py
783
2164
# -*- coding: utf-8 -*- """ flask._compat ~~~~~~~~~~~~~ Some py2/py3 compatibility support based on a stripped down version of six so we don't have to depend on a specific version of it. :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import sys PY...
apache-2.0
1,596,701,297,700,256,500
28.643836
72
0.614603
false
liyy7/scrapy
scrapy/extensions/httpcache.py
102
16232
from __future__ import print_function import os import gzip from six.moves import cPickle as pickle from importlib import import_module from time import time from weakref import WeakKeyDictionary from email.utils import mktime_tz, parsedate_tz from w3lib.http import headers_raw_to_dict, headers_dict_to_raw from scrapy....
bsd-3-clause
-3,284,364,658,948,232,000
37.103286
106
0.616375
false
cschenck/SmoothParticleNets
tests/test_particleprojection.py
1
9566
import os import sys # Add path to python source to path. sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "python")) import SmoothParticleNets as spn import itertools import numpy as np import torch import torch.autograd from gradcheck import gradcheck from test_convsdf impor...
mit
-1,487,342,410,900,119,600
36.517647
104
0.560004
false
adamreis/nyc-jazz
src/lib/wtforms/form.py
51
10965
from wtforms.compat import with_metaclass, iteritems, itervalues __all__ = ( 'BaseForm', 'Form', ) class BaseForm(object): """ Base Form Class. Provides core behaviour like field construction, validation, and data and error proxying. """ def __init__(self, fields, prefix=''): ""...
mit
145,577,383,215,137,860
35.188119
113
0.594346
false
royc1/gpdb
gpMgmt/bin/gppylib/gparray.py
4
104546
#!/usr/bin/env python # # Copyright (c) Greenplum Inc 2008. All Rights Reserved. # """ gparray.py: Contains three classes representing configuration information of a Greenplum array: GpArray - The primary interface - collection of all GpDB within an array GpDB - represents configuration info...
apache-2.0
-7,036,764,323,330,625,000
39.396445
179
0.522593
false
luotao1/Paddle
python/paddle/fluid/contrib/slim/tests/test_imperative_qat_addquantdequant.py
1
19505
# copyright (c) 2018 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 app...
apache-2.0
-5,166,531,978,702,620,000
38.483806
119
0.521764
false
loonycyborg/scons-plusplus
python_modules/Tool/link.py
1
13850
"""SCons.Tool.link Tool-specific initialization for the generic Posix linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2019 The SCons Foundation # # Permission is hereby grant...
gpl-3.0
8,132,936,026,171,753,000
37.15427
129
0.674152
false
bitcity/django
tests/utils_tests/test_crypto.py
447
4581
from __future__ import unicode_literals import binascii import hashlib import unittest from django.utils.crypto import constant_time_compare, pbkdf2 class TestUtilsCryptoMisc(unittest.TestCase): def test_constant_time_compare(self): # It's hard to test for constant time, just test the result. s...
bsd-3-clause
258,763,043,447,486,560
30.8125
75
0.459943
false
kennedyshead/home-assistant
homeassistant/components/caldav/calendar.py
5
11867
"""Support for WebDav Calendar.""" import copy from datetime import datetime, timedelta import logging import re import caldav import voluptuous as vol from homeassistant.components.calendar import ( ENTITY_ID_FORMAT, PLATFORM_SCHEMA, CalendarEventDevice, calculate_offset, get_date, is_offset_...
apache-2.0
-3,375,627,984,068,140,500
34.52994
95
0.586585
false
haoxli/web-testing-service
wts/tests/csp/w3c/CSP_004.py
25
1810
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "script-src 'self' 'un...
bsd-3-clause
-6,538,322,835,638,088,000
44.25
102
0.598343
false
2015fallproject/2015fallcase2
static/Brython3.2.0-20150701-214155/Lib/encodings/cp869.py
37
33654
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors=...
agpl-3.0
4,271,767,498,386,678,300
46.844702
97
0.587389
false
Lilykos/invenio-oaiharvester
invenio_oaiharvester/tasks/harvesting.py
3
10144
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
gpl-2.0
-3,671,993,437,604,622,000
37.570342
86
0.623817
false
ybrs/terminator-forked
build/lib.linux-x86_64-2.7/terminatorlib/configobj/configobj.py
98
88163
# configobj.py # A config file reader/writer that supports nested sections in config files. # Copyright (C) 2005-2010 Michael Foord, Nicola Larosa # E-mail: fuzzyman AT voidspace DOT org DOT uk # nico AT tekNico DOT net # ConfigObj 4 # http://www.voidspace.org.uk/python/configobj.html # Released subject to th...
gpl-2.0
-7,567,007,959,904,652,000
34.722447
114
0.517439
false
andrestr02/blender
measureit/src/measureit_render.py
3
12230
# ***** BEGIN GPL LICENSE BLOCK ***** # # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distribute...
gpl-2.0
-8,287,959,353,142,565,000
35.616766
107
0.494767
false
rabernat/PyTables
examples/array4.py
13
1713
from __future__ import print_function import numpy as np import tables basedim = 4 file = "array4.h5" # Open a new empty HDF5 file fileh = tables.open_file(file, mode="w") # Get the root group group = fileh.root # Set the type codes to test dtypes = [np.int8, np.uint8, np.int16, np.int, np.float32, np.float] i = 1 for...
bsd-3-clause
-6,422,476,813,375,116,000
30.722222
68
0.655575
false
gymnasium/edx-platform
lms/djangoapps/mobile_api/course_info/tests.py
20
8097
""" Tests for course_info """ import ddt from django.conf import settings from milestones.tests.utils import MilestonesTestCaseMixin from nose.plugins.attrib import attr from xmodule.html_module import CourseInfoModule from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore ...
agpl-3.0
2,502,485,065,076,403,000
43.734807
118
0.63715
false
davidszotten/pytest
testing/code/test_code.py
2
4979
# coding: utf-8 from __future__ import absolute_import, division, print_function import sys import _pytest._code import pytest from six import text_type from test_excinfo import TWMock try: import mock except ImportError: import unittest.mock as mock def test_ne(): code1 = _pytest._code.Code(compile('...
mit
404,160,852,564,740,740
23.24878
87
0.573124
false
DarkmoonFaire/server
dep/ACE_wrappers/bin/sets-manager.py
94
7640
#!/usr/bin/env python """ This script implements branching and tagging in the DOC group repository, and automates the process of creating sets. """ import os def parse_args (): from optparse import OptionParser parser = OptionParser ("usage: %prog [options] name") parser.add_option ("-A", "--ACE", dest=...
gpl-2.0
8,253,985,156,531,034,000
34.207373
92
0.53966
false
kcompher/abstract_rendering
abstract_rendering/numeric.py
2
7604
from __future__ import print_function, division, absolute_import from six.moves import reduce import numpy as np import math import abstract_rendering.core as core import abstract_rendering.util as util # ----------- Aggregators ----------- class Count(core.GlyphAggregator): """Count the number of items that fal...
bsd-3-clause
-2,480,353,876,405,352,400
29.910569
78
0.570752
false
gqwest-erp/server
openerp/addons/sale/__openerp__.py
56
3440
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-8,047,033,807,942,736,000
35.989247
141
0.615988
false
Workday/OpenFrame
native_client_sdk/src/tools/nacl_config.py
11
7496
#!/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. """A helper script to print paths of NaCl binaries, includes, libs, etc. It is similar in behavior to pkg-config or sdl-config. """ i...
bsd-3-clause
1,757,797,454,159,511,600
26.558824
80
0.655816
false
nealtodd/django
django/contrib/gis/gdal/feature.py
439
4153
from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException, OGRIndexError from django.contrib.gis.gdal.field import Field from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType from django.contrib.gis.gdal.prototypes import ds as capi, geom as geom_api fro...
bsd-3-clause
5,758,184,754,920,024,000
33.322314
84
0.62509
false
rajanandakumar/DIRAC
DataManagementSystem/Agent/NamespaceBrowser.py
7
1213
# ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### # ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### # # import random,types # from DIRAC.Core.Utilities.List import sortList # # class NamespaceBrowser: # # def __init__(se...
gpl-3.0
-7,219,743,114,676,511,000
27.880952
98
0.646331
false
proxysh/Safejumper-for-Mac
buildlinux/env32/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py
2715
30098
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 Benjamin Peterson # # 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 with...
gpl-2.0
-7,102,640,859,579,775,000
33.675115
98
0.631471
false
raycarnes/account-financial-tools
account_tax_analysis/__openerp__.py
18
1258
# -*- coding: utf-8 -*- ############################################################################## # # Author Vincent Renaville. Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publis...
agpl-3.0
-1,526,170,595,455,729,400
40.933333
78
0.609698
false
sysbot/CouchPotatoServer
libs/pyutil/test/out_of_shape/test_cache.py
106
16980
#!/usr/bin/env python # Copyright (c) 2002-2010 Zooko "Zooko" Wilcox-O'Hearn # This file is part of pyutil; see README.rst for licensing terms. import random, unittest from pyutil.assertutil import _assert from pyutil.humanreadable import hr from pyutil import memutil from pyutil import cache class Bencher: ...
gpl-3.0
4,727,043,779,251,313,000
36.400881
244
0.576973
false
madj4ck/ansible
plugins/callbacks/hipchat.py
69
6961
# (C) 2014, Matt Martz <matt@sivel.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 Software Foundation, either version 3 of the License, or # (at your option) any later version. # #...
gpl-3.0
-4,552,620,902,583,362,600
33.29064
107
0.585979
false
jbdubois/obus
src/obusgen/c/__init__.py
1
1864
#=============================================================================== # obusgen - obus source code generator. # # @file __init__.py # # @brief obus vala source code generator # # @author jean-baptiste.dubois@parrot.com # # Copyright (c) 2013 Parrot S.A. # All rights reserved. # # Redistribution and use in so...
lgpl-2.1
4,728,993,101,715,613,000
49.378378
80
0.702253
false
darmaa/odoo
addons/project_mrp/project_mrp.py
10
8111
# -*- 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,833,546,263,860,887,600
49.378882
172
0.646653
false
matthiasdiener/spack
var/spack/repos/builtin/packages/pdt/package.py
3
3475
############################################################################## # 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
3,064,235,868,237,471,000
43.551282
103
0.644604
false
elba7r/system
erpnext/accounts/doctype/pos_profile/pos_profile.py
18
2780
# 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 import msgprint, _ from frappe.utils import cint from erpnext.accounts.doctype.sales_invoice.sales_invoice import set_account_...
gpl-3.0
-4,965,687,334,683,408,000
34.189873
115
0.694245
false
lucienfostier/gaffer
python/GafferUITest/BackgroundMethodTest.py
2
6726
########################################################################## # # Copyright (c) 2018, Image Engine Design 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: # # * Redistrib...
bsd-3-clause
80,307,906,161,694,880
27.866953
80
0.688968
false
thompsjj/MTA_delay_prediction
system_model/sql_interface.py
1
2246
# -*- coding: utf-8 -*- """ Created on Tue Feb 24 08:02:02 2015 @author: Jared J. Thompson """ import psycopg2 from psycopg2.extras import DictCursor import sys,os def connect_to_db(dbname, user, host, password, port='5432' ): try: conn = psycopg2.connect(dbname=dbname, user=user, \ host=host...
mit
-8,858,372,717,245,583,000
28.565789
104
0.633571
false
davidmwine/gitinspector
gitinspector/blame.py
47
11442
# coding: utf-8 # # Copyright © 2012-2014 Ejwa Software. All rights reserved. # # This file is part of gitinspector. # # gitinspector 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 Lic...
gpl-3.0
7,638,432,591,050,298,000
36.267101
123
0.625295
false
caphrim007/ansible
lib/ansible/modules/cloud/ovirt/ovirt_host_pm.py
14
7728
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUME...
gpl-3.0
4,080,229,181,468,817,000
30.542857
149
0.593427
false
ronie/script.cu.lrclyrics
resources/lib/mutagen_culrc/_constants.py
45
3393
# -*- coding: utf-8 -*- """Constants used by Mutagen.""" GENRES = [ u"Blues", u"Classic Rock", u"Country", u"Dance", u"Disco", u"Funk", u"Grunge", u"Hip-Hop", u"Jazz", u"Metal", u"New Age", u"Oldies", u"Other", u"Pop", u"R&B", u"Rap", u"Reggae", ...
gpl-2.0
-2,814,477,674,103,794,700
16.050251
32
0.510168
false
jonzobrist/Percona-Server-5.1
kewpie/lib/sys_mgmt/port_management.py
1
6830
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2010 Patrick Crews # # 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 ...
bsd-3-clause
-2,811,493,026,787,058,000
34.388601
92
0.554026
false
MySQLOnRocksDB/mysql-5.6
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/bug884737_test.py
24
4796
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2011 Patrick Crews # # # 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 Softwar...
gpl-2.0
-4,904,217,432,998,357,000
38.311475
102
0.581109
false
smolix/incubator-mxnet
python/mxnet/symbol_doc.py
44
10153
# 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
2,221,059,778,835,584,500
31.541667
87
0.576677
false
neilhan/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/in_memory_source_test.py
30
3738
# 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
4,293,685,302,408,798,000
35.291262
87
0.634831
false
brycefrank/pyfor
pyfor/rasterizer.py
1
12374
# Functions for rasterizing import numpy as np import pandas as pd import matplotlib.pyplot as plt from pyfor import gisexport import pyfor.metrics class Grid: """The Grid object is a representation of a point cloud that has been sorted into X and Y dimensional bins. From \ the Grid object we can derive other...
mit
-9,151,430,093,013,256,000
36.72561
138
0.586876
false
jcherqui/searx
tests/unit/engines/test_spotify.py
6
4843
from collections import defaultdict import mock from searx.engines import spotify from searx.testing import SearxTestCase class TestSpotifyEngine(SearxTestCase): def test_request(self): query = 'test_query' dicto = defaultdict(dict) dicto['pageno'] = 0 params = spotify.request(que...
agpl-3.0
-6,240,814,666,330,290,000
38.056452
104
0.504646
false
piccolbo/rightload
embedUI.py
1
4508
"""Insert feedback UI in feed entry.""" import bs4 as bs from colour import Color from content_extraction import get_text, get_url from feature_extraction import text2sentences from flask import request from fuzzywuzzy import fuzz import logging as log import numpy as np from scipy.stats import rankdata from traceback...
agpl-3.0
1,841,669,907,705,201,000
27.713376
86
0.601597
false