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
WarrenWeckesser/numpy
numpy/ma/extras.py
3
58577
""" Masked arrays add-ons. A collection of utilities for `numpy.ma`. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu :version: $Id: extras.py 3473 2007-10-29 15:18:13Z jarrod.millman $ """ __all__ = [ 'apply_along_axis', 'apply_over_axes', 'atleast_1d', 'atleast_2d', 'atleast_3d', 'average'...
bsd-3-clause
-720,906,215,882,748,500
29.382261
105
0.556703
false
wearpants/osf.io
website/addons/mendeley/tests/test_models.py
22
2134
# -*- coding: utf-8 -*- import mock from mendeley.exception import MendeleyApiException from tests.base import OsfTestCase from website.addons.base.testing.models import ( CitationAddonProviderTestSuiteMixin, OAuthAddonUserSettingTestSuiteMixin, OAuthCitationsNodeSettingsTestSuiteMixin, ) from website.add...
apache-2.0
-3,289,433,580,620,220,000
37.107143
90
0.772259
false
goldenbull/grpc
test/distrib/python/distribtest.py
10
1770
# 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
1,420,580,575,112,794,000
48.166667
73
0.783051
false
jazzband/django-discover-jenkins
tests/tests/test_runner.py
3
2456
from unittest import skipIf import django from discover_jenkins import runner, tasks from django.test import TestCase try: from unittest.mock import MagicMock, patch except ImportError: from mock import MagicMock, patch class FakeTestRunner(object): """ A fake object to stub out the base methods tha...
bsd-3-clause
-6,197,833,367,805,272,000
29.320988
79
0.599756
false
xzturn/tensorflow
xzturn/wechat/train.py
1
6281
# -*- coding: utf-8 -*- from __future__ import print_function import tensorflow as tf import argparse import time import os from six.moves import cPickle from utils import WechatLoader from model import Model def train(args): data_loader = WechatLoader(args.corpus_file, args.batch_size, args.seq_length) ar...
apache-2.0
-8,568,529,064,496,981,000
50.909091
140
0.575068
false
dikshant2210/Neural-Machine-Translation
utils.py
1
1309
import unicodedata import re import time import math import matplotlib.pyplot as plt import matplotlib.ticker as ticker import numpy as np MAX_LENGTH = 10 eng_prefixes = ( "i am", " i m ", "he is", "he s ", "she is", "she s", "you are", "you re ", "we are", "we re ", "they are", "they re " ) ...
mit
-8,415,463,011,659,523,000
19.453125
56
0.563025
false
arrdem/pixie
pixie/vm/persistent_hash_set.py
8
2777
py_object = object import pixie.vm.object as object from pixie.vm.primitives import nil, true, false import pixie.vm.persistent_hash_map as persistent_hash_map import pixie.vm.stdlib as proto from pixie.vm.code import extend, as_var, intern_var import pixie.vm.rt as rt VAR_KEY = intern_var(u"pixie.stdlib", u"key") ...
gpl-3.0
-3,826,382,706,349,838,300
26.77
67
0.681311
false
koomik/CouchPotatoServer
couchpotato/core/media/_base/providers/base.py
1
9912
from urlparse import urlparse import json import re import time import traceback import xml.etree.ElementTree as XMLTree from couchpotato.core.event import addEvent, fireEvent from couchpotato.core.helpers.encoding import ss from couchpotato.core.helpers.variable import tryFloat, mergeDicts, md5, \ possibleTitles ...
gpl-3.0
-7,051,217,317,254,229,000
28.325444
115
0.55226
false
bittner/django-media-tree
media_tree/admin/actions/core_actions.py
1
6256
from media_tree.models import FileNode from media_tree.admin.actions.utils import get_actions_context from media_tree.admin.actions.forms import FileNodeActionsWithUserForm, MoveSelectedForm, CopySelectedForm, ChangeMetadataForSelectedForm from media_tree.forms import MetadataForm from media_tree.utils.filenode import ...
bsd-3-clause
-9,033,927,466,320,195,000
46.037594
140
0.683664
false
sjb3/python_koans
python2/koans/about_regex.py
79
5171
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * import re class AboutRegex(Koan): """ These koans are based on Ben's book: Regular Expressions in 10 minutes. I found this book very useful, so I decided to write a koan file in order to practice everything it taught...
mit
3,334,287,433,442,224,000
35.935714
78
0.514601
false
qiyuangong/leetcode
python/962_Maximum_Width_Ramp.py
2
1385
class Solution(object): # def maxWidthRamp(self, A): # """ # :type A: List[int] # :rtype: int # """ # # TLE # if not A or len(A) == 0: # return 0 # for ans in range(len(A) - 1, 0, -1): # for i in range(len(A)): # if i + ...
mit
246,707,342,427,156,130
29.108696
67
0.41444
false
smirnovpaul/flussonic-api-py
api/http.py
1
2788
# -*- coding: utf-8 -*- import requests from .log import LOGGER from requests.auth import HTTPBasicAuth as Auth class HttpApi(object): """ User and Password are data from Flussonic Server (see to edit_auth, view_auth). HTTP Basic auth. """ def __init__(self, user, password, url): sel...
mit
5,657,737,442,988,486,000
28.978495
90
0.574605
false
muccg/rdrf
scripts/run_yaml_cde_calculation_tests.py
1
6126
#!/usr/bin/env python """ Runs test files """ from __future__ import print_function from collections import namedtuple import io import os.path import subprocess import sys import yaml import csv import argparse import tempfile import json def main(): parser = argparse.ArgumentParser(description="Tests CDE calcu...
agpl-3.0
-5,159,092,810,754,563,000
31.242105
104
0.547502
false
tgavankar/unifolio
vendor-local/lib/python/pygments/lexers/agile.py
14
80954
# -*- coding: utf-8 -*- """ pygments.lexers.agile ~~~~~~~~~~~~~~~~~~~~~ Lexers for agile languages. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, \ Le...
bsd-3-clause
-6,039,682,143,026,706,000
40.323124
87
0.471848
false
cedrick-f/pySequence
src/pyXorga.py
1
65552
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals ##This file is part of pyXorga ############################################################################# ############################################################################# ## ...
gpl-3.0
-3,015,395,779,734,700,000
36.335425
131
0.481107
false
linyaoli/acm
tree/hard/implement_trie.prefix_tree.py
2
1693
class TrieNode: # Initialize your data structure here. def __init__(self): self.val = "" self.count = 0 self.children = {} class Trie: def __init__(self): self.root = TrieNode() # @param {string} word # @return {void} # Inserts a word into the tri...
gpl-2.0
102,015,981,198,967,100
24.873016
59
0.520969
false
nicolasmcnair/magpy
old/1.0/misc.py
1
10162
# -*- coding: utf-8 -*- """ Created on Thu Jan 07 14:08:10 2016 Miscellaneous magpy functions @author: Nicolas McNair """ import multiprocessing import serial from sys import platform #switch timer based on platform if platform == 'win32': # On Windows, use time.clock from time import clock ...
gpl-3.0
-6,650,430,580,335,798,000
49.065327
196
0.551269
false
trac-ja/trac-ja
trac/admin/tests/console.py
3
54118
# -*- coding: utf-8 -*- # # Copyright (C) 2004-2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software cons...
bsd-3-clause
6,559,324,094,399,952,000
40.693374
81
0.622307
false
tempbottle/ironpython3
Tests/compat/sbs_exceptions/shared.py
3
14427
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of t...
apache-2.0
685,047,043,244,113,400
37.784946
113
0.528246
false
mpetyx/django-rdfGraph
graphBackend/graphBackend/api/rdfResource.py
1
3651
__author__ = 'mpetyx' from tastypie.resources import Resource from tastypie.authorization import Authorization from tastypie.bundle import Bundle from tastypie import fields from rdfConnector import rdfClient from RdfObject import RdfObject """ or this is also working https://gist.github.com/mhluongo/5789513...
mit
3,618,065,893,409,287,000
30.482759
122
0.620926
false
larsks/cloud-init
cloudinit/config/cc_ubuntu_drivers.py
2
5800
# This file is part of cloud-init. See LICENSE file for license information. """Ubuntu Drivers: Interact with third party drivers in Ubuntu.""" import os from textwrap import dedent from cloudinit.config.schema import ( get_schema_doc, validate_cloudconfig_schema) from cloudinit import log as logging from cloudi...
gpl-3.0
-5,457,773,030,827,138,000
35.25
79
0.605517
false
codekaki/odoo
addons/warning/warning.py
13
14284
# -*- 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,694,981,993,264,431,000
41.260355
224
0.578339
false
nabsboss/CouchPotatoServer
couchpotato/core/plugins/score/main.py
5
1798
from couchpotato.core.event import addEvent from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable import getTitle from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin from couchpotato.core.plugins.score.scores import nameScore, nameRatioScor...
gpl-3.0
8,710,509,199,096,340,000
32.296296
95
0.634594
false
zenoss/pywbem
tests/unittest/pywbem/test_cim_xml.py
1
55852
""" Unit tests for pywbem cim_xml.py module. """ from __future__ import absolute_import try: from collections.abc import Iterable except ImportError: # py2 from collections import Iterable import unittest import six import pytest from pywbem import cim_xml from ..utils.validate import validate_cim_xml, CIM...
lgpl-2.1
1,312,035,014,946,303,000
25.890708
79
0.544654
false
FuegoFro/mongo-web-shell
mongows/mws/views.py
7
12296
# Copyright 2013 10gen 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...
apache-2.0
-6,339,074,579,026,056,000
31.702128
79
0.630774
false
cemoody/chainer
examples/mnist/train_mnist.py
1
4391
#!/usr/bin/env python """Chainer example: train a multi-layer perceptron on MNIST This is a minimal example to write a feed-forward net. """ from __future__ import print_function import argparse import numpy as np import six import chainer from chainer import computational_graph from chainer import cuda import chai...
mit
1,720,002,836,869,415,200
31.768657
74
0.63038
false
architecture-building-systems/CEAforArcGIS
cea/tests/run_all_plots.py
2
1790
""" Load all the plot classes and generate the plots for test purposes (This is run at the end of ``cea test --workflow slow`` as it requires a scenario with all the data from the whole workflow to be present) """ import shutil import tempfile import cea.plots import cea.plots.cache import cea.config import cea.w...
mit
-8,398,397,072,217,587,000
31.563636
108
0.637989
false
michaelpacer/scikit-image
doc/source/conf.py
6
9627
# -*- coding: utf-8 -*- # # skimage documentation build configuration file, created by # sphinx-quickstart on Sat Aug 22 13:00:30 2009. # # 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...
bsd-3-clause
6,259,562,681,117,678,000
31.305369
80
0.667705
false
DrKylstein/Media-Gizmo
text_display.py
1
2554
# Copyright (c) 2014 Kyle Delaney # 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 an...
bsd-3-clause
-5,620,178,843,297,378,000
36.573529
75
0.668755
false
jvican/dumbq
client/utils/test_utils.py
1
1138
# -*- coding: utf-8 -*- # DumbQ 2.0 - A lightweight job scheduler # Copyright (C) 2015-2016 Jorge Vicente Cantero, CERN # 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 t...
gpl-2.0
-4,158,798,769,107,847,000
36.933333
78
0.717926
false
horance-liu/tensorflow
tensorflow/python/ops/distributions/kullback_leibler.py
35
5456
# 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
258,418,001,918,616,160
34.660131
80
0.669538
false
dchud/unalog2
settings.py
1
3333
# Django settings for unalog2 project. from os.path import abspath, dirname DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Your name', 'you@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': '', 'USER': '',...
mit
5,551,549,108,930,240,000
27.487179
88
0.70207
false
HalcyonChimera/osf.io
osf/migrations/0069_auto_20171127_1119.py
20
2240
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2017-11-27 17:19 from __future__ import unicode_literals import logging from django.db import migrations from osf.utils.migrations import disable_auto_now_fields logger = logging.getLogger(__name__) def add_preprint_doi_created(state, schema): """ Sets ...
apache-2.0
2,025,173,990,394,870,000
43.8
151
0.695536
false
jabesq/home-assistant
tests/components/demo/test_geo_location.py
7
2852
"""The tests for the demo platform.""" import unittest from unittest.mock import patch from homeassistant.components import geo_location from homeassistant.components.demo.geo_location import \ NUMBER_OF_DEMO_DEVICES, DEFAULT_UNIT_OF_MEASUREMENT, \ DEFAULT_UPDATE_INTERVAL from homeassistant.setup import setup_...
apache-2.0
6,124,653,382,466,511,000
37.540541
78
0.593969
false
ianblenke/awsebcli
ebcli/docker/dockerrun.py
1
5119
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
apache-2.0
6,774,757,003,490,146,000
28.085227
77
0.697793
false
nburn42/tensorflow
tensorflow/contrib/slim/python/slim/data/parallel_reader_test.py
51
7874
# 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
4,977,076,060,767,239,000
33.234783
80
0.661798
false
TangXT/edx-platform
lms/djangoapps/instructor/tests/test_legacy_xss.py
13
2296
""" Tests of various instructor dashboard features that include lists of students """ from django.conf import settings from django.test.client import RequestFactory from django.test.utils import override_settings from markupsafe import escape from courseware.tests.tests import TEST_DATA_MIXED_MODULESTORE from student...
agpl-3.0
-4,525,045,904,103,281,000
35.444444
87
0.675087
false
Khan/reviewboard
reviewboard/site/models.py
2
3213
# # models.py -- Models for the "reviewboard.site" app. # # Copyright (c) 2010 David Trowbridge # # 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 lim...
mit
5,471,718,910,881,945,000
43.013699
80
0.709617
false
xodus7/tensorflow
tensorflow/contrib/framework/python/ops/variables_test.py
2
59220
# 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
-6,440,173,154,006,627,000
40.528752
80
0.647619
false
gangadhar-kadam/sapphire_app
selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.py
2
1965
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes.utils import getdate, cint def execute(filters=None): if not filters: filters ={} days_since_last_order = filters.get("days_since_la...
agpl-3.0
3,845,790,205,213,018,000
30.709677
103
0.69313
false
DiamondLightSource/auto_tomo_calibration-experimental
old_code_scripts/lmfit-py/lmfit/printfuncs.py
7
6963
# -*- coding: utf-8 -*- """ Created on Fri Apr 20 19:24:21 2012 @author: Tillsten Changes: - 13-Feb-2013 M Newville complemented "report_errors" and "report_ci" with "error_report" and "ci_report" (respectively) which return the text of the report. Thus report_errors() is simply: def ...
apache-2.0
7,645,644,019,731,446,000
34.345178
78
0.537125
false
chromium/chromium
net/tools/build_hpack_constants.py
43
18730
#!/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. """This script builds a table that has to be manully inserted into net/spdy/hpack/hpack_constants.cc. It also contains data that poten...
bsd-3-clause
1,459,966,701,684,311,300
60.409836
80
0.430486
false
goblinbr/python-flask-rest-api-example
test/test_apiv1p0.py
1
12666
import unittest from run import app from app import database import json class TestApiv1p0(unittest.TestCase): def setUp(self): self.server = app.test_client() database.clear() self.user1 = database.create_user({'name': 'new user 1'}) self.user2 = database.create_user({'name': 'n...
mit
1,805,150,519,838,539,500
50.697959
195
0.640928
false
gloryofrobots/langs
codegen/node_gen.py
2
2085
from tpl import render NODES = [ # internals "NT_GOTO", # code nodes "NT_TRUE", "NT_FALSE", "NT_VOID", "NT_INT", "NT_FLOAT", "NT_STR", "NT_MULTI_STR", "NT_CHAR", "NT_WILDCARD", "NT_NAME", "NT_TEMPORARY", "NT_SYMBOL", "NT_TYPE", "NT_MAP", "NT_LIST", "NT_TUPLE", "NT_INDEXED", ...
gpl-2.0
-317,272,711,578,826,000
14.676692
85
0.476259
false
schlitzered/pyredis
tests/unit/test_protocol.py
1
10345
from unittest import TestCase import pyredis.protocol as hiredis from pyredis.protocol import writer, to_bytes import sys # The class ReaderTest is more or less copied from the hiredis python package. # The Licence Terms of hiredis (BSD) appeal to the ReaderTest class! class ReaderTest(TestCase): def setUp(self)...
mit
-5,533,343,915,852,620,000
33.013158
107
0.605029
false
murat1985/bagpipe-bgp
bagpipe/exabgp/structure/rtc.py
1
3836
""" Copyright (c) 2014, Orange All rights reserved. File released under the BSD 3-Clause license. 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 noti...
apache-2.0
5,667,648,205,401,776,000
35.188679
122
0.660323
false
mdlavin/billiards-analyzer
analyzer/analyze.py
1
10916
import pymc as pm import numpy as np import markov import markov_symbolic import math import itertools import functools import collections class Match(object): def __init__(self, players, winning_team, order="unordered", foul_end=False): self.order = order self.players = players ...
mit
2,051,371,986,648,766,200
36.641379
79
0.504031
false
hendrasaputra/hendrasaputra.com
analytics/misc/log-analytics/import_logs.py
3
56979
#!/usr/bin/python # -*- coding: utf-8 -*- # # Piwik - Open source web analytics # # @link http://piwik.org # @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later # @version $Id$ # # For more info see: http://piwik.org/log-analytics/ import base64 import bz2 import ConfigParser import datetime import fnmat...
gpl-2.0
-3,288,608,415,037,848,600
35.108365
194
0.557135
false
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/openmdao.main-0.13.0-py2.7.egg/openmdao/main/test/test_pkg_res_factory.py
1
3476
""" pkg_res_factory test """ import logging import os import unittest # pylint: disable-msg=F0401 from pkg_resources import DistributionNotFound, VersionConflict from pkg_resources import Requirement, Environment, working_set from openmdao.main.pkg_res_factory import PkgResourcesFactory from openmdao.main.api import...
gpl-2.0
-3,696,755,660,376,390,700
44.736842
137
0.60702
false
ewenmaclean/coinvent_demo
settings_pre.py
1
2248
###### The number of models to be generated (0 for all models) numModels = 10 ###### The minimal number of iterations for generalization minIterationsGeneralize = 1 ###### The maximal number of iterations for generalization maxIterationsGeneralize = 20 ###### The minimal number of iterations for blending # minIterat...
gpl-2.0
9,096,900,775,222,598,000
41.415094
306
0.718416
false
losywee/rethinkdb
test/interface/stat.py
13
16258
#!/usr/bin/env python # Copyright 2010-2012 RethinkDB, all rights reserved. # This file tests the `rethinkdb.stats` admin table. # The scenario works by starting a cluster of two servers and two tables. The tables are # then sharded across the two servers (no replicas), and populated with 100 rows. # A small read/writ...
agpl-3.0
7,437,367,249,533,312,000
47.531343
138
0.58974
false
SmithsonianEnterprises/django-cms
cms/admin/settingsadmin.py
47
3428
# -*- coding: utf-8 -*- from functools import update_wrapper import json from django.conf.urls import url from django.contrib import admin from django.contrib.admin import ModelAdmin from django.contrib.auth.admin import csrf_protect_m from django.db import transaction from django.http import HttpResponseRedirect, Htt...
bsd-3-clause
-4,519,536,094,190,621,000
32.940594
79
0.595683
false
n4hy/gnuradio
gr-uhd/apps/uhd_fft.py
1
10069
#!/usr/bin/env python # # Copyright 2011 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 option) ...
gpl-3.0
-4,927,043,735,244,295,000
36.154982
100
0.571755
false
googleapis/python-documentai
samples/snippets/batch_process_documents_sample.py
1
4812
# Copyright 2020 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 law or agreed to in writing, so...
apache-2.0
-8,379,463,069,707,998,000
35.180451
110
0.663965
false
tombstone/models
research/efficient-hrl/environments/ant.py
4
4728
# 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 applicab...
apache-2.0
-369,024,179,318,738,500
32.531915
106
0.616117
false
Chibin/gpdb
gpMgmt/bin/gppylib/mainUtils.py
14
22032
# Line too long - pylint: disable=C0301 # Invalid name - pylint: disable=C0103 """ mainUtils.py ------------ This file provides a rudimentary framework to support top-level option parsing, initialization and cleanup logic common to multiple programs. The primary interface function is 'simple_main'. For an example ...
apache-2.0
7,866,382,653,266,481,000
34.708266
119
0.61969
false
DolphinDream/sverchok
nodes/viz/viewer_gp.py
2
10182
# This file is part of project Sverchok. It's copyrighted by the contributors # recorded in the version control history of the file, available from # its original location https://github.com/nortikin/sverchok/commit/master # # SPDX-License-Identifier: GPL3 # License-Filename: LICENSE import itertools import bpy # i...
gpl-3.0
2,320,242,830,080,912,000
35.758123
152
0.634748
false
toddeye/home-assistant
homeassistant/components/switch/tellduslive.py
2
1832
""" homeassistant.components.switch.tellduslive ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support for Tellstick switches using Tellstick Net and the Telldus Live online service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.tellduslive/ """ im...
mit
-4,169,689,991,394,150,400
27.625
74
0.646288
false
AntonChankin/thefuck
tests/rules/test_mvn_no_command.py
13
3648
import pytest from thefuck.rules.mvn_no_command import match, get_new_command from tests.utils import Command @pytest.mark.parametrize('command', [ Command(script='mvn', stdout='[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<g...
mit
-7,063,368,682,495,941,000
90.2
788
0.657346
false
twiest/openshift-tools
ansible/roles/lib_git/library/git_commit.py
12
15635
#!/usr/bin/env python # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| # | |) | (_) | | .` | (_) || | | _|| |) | | ...
apache-2.0
5,626,749,291,229,485,000
30.27
120
0.52165
false
HopeFOAM/HopeFOAM
ThirdParty-0.1/ParaView-5.0.1/VTK/Rendering/Annotation/Testing/Python/xyPlot4.py
20
7507
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # This version of the script # test ploting arbitrary array components (Momentum) # without using the dataset to data object filter # and its cryptic indexing of arrays. # create pipe...
gpl-3.0
-2,813,464,151,114,149,400
34.079439
71
0.803384
false
GoogleCloudPlatform/analytics-componentized-patterns
retail/recommendation-system/bqml-scann/ann_grpc/match_pb2_grpc.py
1
4364
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc import match_pb2 as match__pb2 class MatchServiceStub(object): """MatchService is a Google managed service for efficient vector similarity search at sc...
apache-2.0
-5,007,113,471,602,414,000
39.036697
132
0.646196
false
SterlingPeet/madesigner
tests/demo-blend.py
2
1355
#!/usr/bin/env python try: import svgwrite except ImportError: import sys, os sys.path.insert(0, os.path.abspath(os.path.split(os.path.abspath(__file__))[0]+'/..')) import svgwrite try: import airfoil import contour import layout except ImportError: # if airfoil is not 'installed' appe...
gpl-2.0
8,593,519,020,748,511,000
21.966102
94
0.626568
false
hkwi/twink
twink/ofp5/parse.py
1
51714
from __future__ import absolute_import import struct from collections import namedtuple from . import * _len = len _type = type def _align(length): return (length+7)//8*8 class _pos(object): offset = 0 def _cursor(offset): if isinstance(offset, _pos): return offset elif isinstance(offset, int...
apache-2.0
-7,787,175,382,925,324,000
32.453031
120
0.707101
false
xuleiboy1234/autoTitle
tensorflow/tensorflow/contrib/rnn/python/ops/gru_ops.py
24
5476
# 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...
mit
-5,857,453,629,991,839,000
29.592179
82
0.622535
false
orgito/ansible
lib/ansible/module_utils/basic.py
2
116522
# Copyright (c), Michael DeHaan <michael.dehaan@gmail.com>, 2012-2013 # Copyright (c), Toshio Kuratomi <tkuratomi@ansible.com> 2016 # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function SIZE_RANGES = ...
gpl-3.0
-3,507,961,514,487,396,400
38.904795
155
0.552419
false
andresailer/DIRAC
Core/Utilities/Distribution.py
4
16711
# $HeadURL$ __RCSID__ = "$Id$" import urllib2, re, tarfile, os, types, sys, subprocess, urlparse, tempfile from DIRAC import gLogger, S_OK, S_ERROR from DIRAC.Core.Utilities import CFG, File, List class Distribution: cernAnonRoot = 'http://svn.cern.ch/guest/dirac' googleAnonRoot = 'http://dirac-grid.googlecode....
gpl-3.0
2,413,525,882,851,796,500
35.015086
115
0.611094
false
LIS/lis-tempest
tempest/api/identity/v2/test_users.py
4
3312
# Copyright 2015 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
-4,845,776,916,875,552,000
41.461538
79
0.654891
false
noironetworks/horizon
openstack_dashboard/dashboards/project/volume_groups/tests.py
1
15316
# 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 # d...
apache-2.0
6,501,920,724,235,035,000
39.518519
79
0.591799
false
simar7/build-mozharness
configs/vcs_sync/build-repos.py
3
2940
import os import socket hostname = socket.gethostname() build_repos = ( 'autoland', 'buildapi', 'buildbot-configs', 'buildbotcustom', 'mozharness', 'opsi-package-sources', 'partner-repacks', 'preproduction', 'puppet', 'puppet-manifests', 'rpm-sources', 'talos', 'tool...
mpl-2.0
8,176,191,087,614,149,000
24.344828
75
0.506463
false
je-nunez/callgrind_to_NewRelic
callgrind_to_newrelic.py
2
16728
#!/usr/bin/env python """ Parse the grammar, summarize the syntactic tree, and upload a Valgring callgrind file to New Relic. """ # Just a first incrementally parsing some Valgrind callgrind file format # using the PLY module (the Natural Language Toolkit, NLTK, is also # another possibility) import sys import ply.l...
gpl-2.0
6,906,496,149,653,901,000
35.12959
121
0.577296
false
hradec/gaffer
python/GafferCortexUITest/__init__.py
7
2108
########################################################################## # # Copyright (c) 2014, 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
1,904,418,245,696,576,000
48.023256
78
0.706831
false
tinyendian/eb_cray
easyblocks/ncl.py
1
7879
## # Copyright 2009-2017 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
-6,446,298,528,248,462,000
32.961207
104
0.597665
false
ranjiao/raysdemo
crazydepot/src/creoleparser/__init__.py
1
1127
# __init__.py # # Copyright (c) 2009 Stephen Day # # This module is part of Creoleparser and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php # import string import keyword from core import Parser, ArgParser from dialects import (creole11_base, creole10_base, creepy10_...
apache-2.0
5,605,196,396,034,681,000
30.2
78
0.650399
false
arjoly/scikit-learn
sklearn/utils/testing.py
6
26573
"""Testing utilities.""" # Copyright (c) 2011, 2012 # Authors: Pietro Berkes, # Andreas Muller # Mathieu Blondel # Olivier Grisel # Arnaud Joly # Denis Engemann # Giorgio Patrini # License: BSD 3 clause import os import inspect import pkgutil import warnings import...
bsd-3-clause
3,945,235,352,036,388,400
32.722081
81
0.613141
false
luzpaz/QGIS
tests/src/python/test_qgslayoutpagecollection.py
11
40077
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsLayoutPageCollection .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version...
gpl-2.0
8,580,895,409,850,832,000
40.020471
179
0.652594
false
wkritzinger/asuswrt-merlin
release/src/router/samba-3.5.8/source4/heimdal/lib/wind/gen-errorlist.py
22
3655
#!/usr/local/bin/python # -*- coding: iso-8859-1 -*- # $Id: gen-errorlist.py,v 1.1.1.1 2011/06/10 09:34:43 andrew Exp $ # Copyright (c) 2004 Kungliga Tekniska Högskolan # (Royal Institute of Technology, Stockholm, Sweden). # All rights reserved. # # Redistribution and use in source and binary forms, with or withou...
gpl-2.0
-8,359,673,033,513,507,000
29.45
77
0.671866
false
wkeeling/ansible
lib/ansible/cli/vault.py
4
6699
# (c) 2014, James Tanner <tanner.jc@gmail.com> # # 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 i...
gpl-3.0
-7,298,703,271,782,055,000
37.0625
130
0.63293
false
Jeremy123W/Optimizing-Employee-Shuttle-Stops
Scripts/sector4.py
1
3275
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 1 20:31:46 2017 @author: jeremy """ import math import pandas as pd import gmplot import itertools import datetime emp_addresses = pd.read_csv('employees_with_geocode.csv') bus_stops = pd.read_csv('bus_stops_with_geocode.csv') #37.78<longitu...
gpl-3.0
-5,817,398,604,057,692,000
27.486957
127
0.634504
false
Eyepea/aiohttp
tests/test_run_app.py
1
16585
import asyncio import contextlib import os import platform import signal import socket import ssl import subprocess import sys from unittest import mock from uuid import uuid4 import pytest from aiohttp import web from aiohttp.test_utils import loop_context # Test for features of OS' socket support _has_unix_domain...
apache-2.0
6,413,558,800,703,907,000
28.198944
78
0.60404
false
Yelp/paasta
tests/deployd/test_queue.py
1
3654
import time from queue import Empty from pytest import fixture from pytest import raises from zake.fake_client import FakeClient from paasta_tools.deployd.common import ServiceInstance from paasta_tools.deployd.queue import ZKDelayDeadlineQueue def make_si(wait_until, bounce_by): """Just using mock.Mock(wait_un...
apache-2.0
-867,561,398,820,208,500
37.463158
120
0.637931
false
arnaudsj/pybrain
pybrain/tools/plotting/ciaoplot.py
6
1584
__author__ = 'Tom Schaul, tom@idsia.ch' from scipy import zeros, array, amin, amax, sqrt from colormaps import ColorMap class CiaoPlot(ColorMap): """ CIAO plot of coevolution performance with respect to the best individuals from previous generations (Hall of Fame). Requires 2 populations. """ @stat...
bsd-3-clause
1,752,950,691,779,675,600
31.326531
89
0.535354
false
WesleyAC/lemonscript-transpiler
tests/test_transpiler.py
1
4113
import os import subprocess import shutil import transpiler class TestTranspiler: def clean_auto_funcs(self): try: shutil.rmtree("/tmp/auto_files") os.remove("/tmp/auto_functions.cpp") os.remove("/tmp/auto_functions.h") os.remove("auto_functions.cpp") ...
mit
-1,578,675,538,517,193,700
40.969388
222
0.621201
false
jigarmistry/sofi
sofi/ui/label.py
2
1145
from .element import Element from .span import Span class Label(Element): """Implements a Bootstrap Label <span class="label"> tag""" SEVERITIES = { 'danger': 'label-danger', 'success': 'label-success', 'info': 'label-info', 'warning': 'label-warnin...
mit
3,120,153,539,774,151,700
29.945946
94
0.534498
false
malaterre/ITK
Examples/DataRepresentation/Image/ImageToArray.py
2
1238
#========================================================================== # # Copyright NumFOCUS # # 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/l...
apache-2.0
-5,761,217,888,762,148,000
26.511111
77
0.652666
false
werbk/task-7.20
generator/contact.py
4
2518
from fixture.TestBase import random_string from tests_contract.contact_helper import Contact import os.path import json import getopt import sys import jsonpickle try: opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contact", "file"]) except getopt.GetoptError as err: getopt.usage() sys.exi...
apache-2.0
-1,664,942,867,452,397,800
45.648148
111
0.437252
false
PyCQA/pydocstyle
src/pydocstyle/checker.py
3
42125
"""Parsed source code checkers for docstring violations.""" import ast import string import tokenize as tk from collections import namedtuple from itertools import chain, takewhile from re import compile as re from . import violations from .config import IllegalConfiguration from .parser import ( AllError, Cl...
mit
-6,593,910,018,758,575,000
35.694251
86
0.562777
false
FX31337/FX-BT-Scripts
mt_modify.py
1
5633
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import argparse import sys import struct from copy import copy from bstruct import BStruct from bstruct_defs import SymbolsRaw # # Exceptions for internal use # class WrongStructFormat(Exception): pass class NoSuchField(Exception): pass class InvalidDataForma...
mit
2,481,857,460,083,460,600
22.668067
88
0.578022
false
motion2015/edx-platform
lms/djangoapps/instructor/tests/test_enrollment.py
25
23157
# -*- coding: utf-8 -*- """ Unit tests for instructor.enrollment methods. """ import json import mock from abc import ABCMeta from courseware.models import StudentModule from django.conf import settings from django.test import TestCase from django.utils.translation import get_language from django.utils.translation imp...
agpl-3.0
6,489,823,800,440,749,000
33.923077
128
0.621145
false
solashirai/edx-platform
openedx/core/djangoapps/credit/models.py
3
25622
# -*- coding: utf-8 -*- """ Models for Credit Eligibility for courses. Credit courses allow students to receive university credit for successful completion of a course on EdX """ from collections import defaultdict import datetime import logging from config_models.models import ConfigurationModel from django.conf im...
agpl-3.0
-6,041,291,443,425,161,000
34.002732
110
0.630864
false
spidercensus/py-junos-eznc
lib/jnpr/junos/facts/swver.py
1
3314
import re class version_info(object): def __init__(self, verstr): """verstr - version string""" m1 = re.match('(.*?)([RBIXSF-])(.*)', verstr) self.type = m1.group(2) self.major = tuple(map(int, m1.group(1).split('.'))) # creates tuyple after_type = m1.group(3).split('.') ...
apache-2.0
-4,367,478,845,355,745,300
29.127273
79
0.490042
false
kaerdsar/website
website_analytics_piwik/__openerp__.py
14
1454
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2015 Therp BV <http://therp.nl>. # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
3,634,952,265,974,780,000
36.282051
78
0.583219
false
DinoCow/airflow
airflow/operators/dagrun_operator.py
5
1152
# # 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
-5,327,493,859,159,075,000
38.724138
93
0.770833
false
tequa/ammisoft
ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Scripts/EditWithIdleX.py
5
5567
""" IdleX Windows Configuration Adds/removes "Edit with IdleX" to the right-click context menu for .py files. Author: Roger D. Serwy Date: 2011-11-28 2012-04-13 modified to work with setup.py License: See LICENSE.txt """ import os import sys import shlex WINREG = True if sys.version < '3': import...
bsd-3-clause
-853,398,582,292,607,700
27.548718
91
0.599425
false
ehopsolidaires/ehop-solidaires.fr
ehop/ehopSolidaire_providers_register/forms.py
1
10906
# -*- coding: utf-8 -*- # @copyright (C) 2014-2015 #Developpeurs 'BARDOU AUGUSTIN - BREZILLON ANTOINE - EUZEN DAVID - FRANCOIS SEBASTIEN - JOUNEAU NICOLAS - KIBEYA AISHA - LE CONG SEBASTIEN - # MAGREZ VALENTIN - NGASSAM NOUMI PAOLA JOVANY - OUHAMMOUCH SALMA - RIAND MORGAN - TREIMOLEIRO ALEX - TRULLA AUREL...
agpl-3.0
-7,623,138,704,339,617,000
44.070248
143
0.599303
false
Rogergonzalez21/TelegramSGirlsBot
app.py
1
4445
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters import telegram, logging, requests, json, secrets, botan from random import randint # Enable logging logging.basicConfig( format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO) logger = logging.getLog...
mit
-2,338,562,011,305,615,000
36.677966
240
0.668841
false
jurcicek/extended-hidden-vector-state-parser
confusion/clnum-1.4/build/lib.linux-i686-2.4/clnum/__init__.py
2
2479
#----------------------------------------------------------------------------- # Copyright (c) 2006 Raymond L. Buvel # # This file is part of clnum, a Python interface to the Class Library for # Numbers. This module provides module initialization and some functions coded # in Python instead of C++. # # The clnum modu...
gpl-2.0
-6,374,207,803,796,737,000
27.825581
79
0.588544
false
setten/pymatgen
pymatgen/analysis/bond_valence.py
6
21514
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals import collections import numpy as np import operator import os from math import exp, sqrt from six.moves import filter from six.moves import zip from monty....
mit
-1,407,815,677,928,642,600
39.363977
80
0.524914
false
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/IPython/utils/localinterfaces.py
10
8414
"""Simple utility for building a list of local IPs using the socket module. This module defines two constants: LOCALHOST : The loopback interface, or the first interface that points to this machine. It will *almost* always be '127.0.0.1' LOCAL_IPS : A list of IP addresses, loopback first, that point to t...
bsd-3-clause
-5,542,274,935,904,721,000
29.266187
97
0.558831
false
luotao1/Paddle
python/paddle/fluid/tests/unittests/test_naive_best_fit_gpu_memory_limit.py
2
1634
# Copyright (c) 2020 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 appli...
apache-2.0
8,708,300,202,930,062,000
29.259259
76
0.644431
false