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
bonnetb/sqoop
sqoop-patch-review.py
11
6554
#!/usr/local/bin/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 #...
apache-2.0
1,354,102,830,513,533,700
36.884393
391
0.692707
false
Dhivyap/ansible
test/units/module_utils/facts/other/test_facter.py
33
8046
# unit tests for ansible other facter fact collector # -*- coding: utf-8 -*- # # 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
-5,379,392,229,592,238,000
34.289474
313
0.636465
false
eneldoserrata/marcos_openerp
oemedical/oemedical_genetics/oemedical_disease_gene.py
3
3935
# -*- coding: utf-8 -*- #/############################################################################# # # Tech-Receptives Solutions Pvt. Ltd. # Copyright (C) 2004-TODAY Tech-Receptives(<http://www.techreceptives.com>) # Special Credit and Thanks to Thymbra Latinoamericana S.A. # # This program is free sof...
agpl-3.0
-3,134,129,462,536,588,300
36.836538
116
0.593139
false
jonashaag/django-nonrel-nohistory
tests/modeltests/model_formsets/tests.py
51
60319
import datetime import re from datetime import date from decimal import Decimal from django import forms from django.db import models from django.forms.models import (_get_foreign_key, inlineformset_factory, modelformset_factory, modelformset_factory) from django.test import TestCase, skipUnlessDBFeature from mod...
bsd-3-clause
8,938,211,447,957,292,000
50.687232
381
0.601916
false
dstockwell/catapult
dashboard/dashboard/bisect_stats_test.py
2
1969
# Copyright 2015 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. """Unit tests for bisect_stats module.""" import unittest import mock import webapp2 import webtest from dashboard import bisect_stats from dashboard impo...
bsd-3-clause
-1,683,844,818,047,048,400
29.765625
77
0.662773
false
Karolain/cms
frontend/cms_plugins.py
3
1864
from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from cms.models.pluginmodel import CMSPlugin from django.utils.translation import ugettext_lazy as _ # Countdown Plugin ### from .models import Countdown class CountdownPlugin(CMSPluginBase): name = _("Countdown") module = _("A...
mit
-4,276,260,711,096,398,000
22.3125
55
0.695815
false
nmc-probe/emulab-nome
protogeni/test/am3/describe.py
1
2095
#! /usr/bin/env python # # Copyright (c) 2012 University of Utah and the Flux Group. # # {{{GENIPUBLIC-LICENSE # # GENI Public License # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restricti...
agpl-3.0
-5,219,179,064,586,430,000
28.097222
72
0.721241
false
qilicun/python
python2/PyMOTW-1.132/PyMOTW/shutil/shutil_rmtree.py
1
1313
#!/usr/bin/env python # # Copyright 2007 Doug Hellmann. # # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in all # copies and tha...
gpl-3.0
-3,167,228,598,858,271,000
31.825
70
0.753237
false
Hiyorimi/scikit-image
skimage/viewer/plugins/base.py
42
9408
""" Base class for Plugins that interact with ImageViewer. """ from warnings import warn import numpy as np from ..qt import QtWidgets, QtCore, Signal from ..utils import RequiredAttr, init_qtapp class Plugin(QtWidgets.QDialog): """Base class for plugins that interact with an ImageViewer. A plugin connects ...
bsd-3-clause
5,815,172,323,526,911,000
35.045977
79
0.627551
false
NTNU-IndEcol/pySUT
setup.py
2
1212
# from setuptools import setup from distutils.core import setup setup( name='pysut', version="1.1", packages=["pysut", "pysut.tests"], author="Stefan Pauliuk", description="Python class for efficient handling of supply and use tables (SUTs)", author_email="stefan.pauliuk@ntnu.no", license=o...
bsd-3-clause
-8,601,455,997,002,817,000
39.4
86
0.638614
false
kennedyshead/home-assistant
tests/components/wilight/test_config_flow.py
2
5396
"""Test the WiLight config flow.""" from unittest.mock import patch import pytest from pywilight.const import DOMAIN from homeassistant.components.wilight.config_flow import ( CONF_MODEL_NAME, CONF_SERIAL_NUMBER, ) from homeassistant.config_entries import SOURCE_SSDP from homeassistant.const import CONF_HOST,...
apache-2.0
2,774,680,026,070,842,400
30.190751
74
0.672721
false
daeyun/dshinpy
dshin/third_party/colormap.py
1
13010
# Source: https://github.com/BIDS/colormap/blob/master/fake_parula.py from matplotlib.colors import LinearSegmentedColormap # Used to reconstruct the colormap in viscm parameters = {'xp': [8.6840042204210732, -21.378780072752193, -13.715204596193757, -94.858944936224646, 53.679179741776352, -9.6], 'yp':...
mpl-2.0
3,176,346,284,619,651,600
47.544776
130
0.555188
false
sievetech/rgc
rgc/rgc.py
1
1602
#coding: utf-8 import pyrax from clint.textui import progress def _process(cont, deleted, dryrun, objects, rule): for obj in progress.bar(objects, label="Removing Objects"): if rule.apply(obj): if not dryrun: try: cont.delete_object(obj.name) ...
bsd-3-clause
-5,786,316,661,409,944,000
30.411765
78
0.636704
false
wgml/sysrek
uart_echo/python/COMMngr.py
2
1190
#!/usr/bin/env python import itertools import serial, os, re from serial.tools import list_ports from Logger import Logger class COMMngr(): _WINDOWSREGISTRY = 'HARDWARE\\DEVICEMAP\\SERIALCOMM' def __init__(self): pass @staticmethod def getAllPorts(): #pass ...
gpl-2.0
-6,647,648,734,014,338,000
29.368421
110
0.487395
false
tbarnetlamb/hyphen
hyphen/marshall_ctor.py
1
31739
"""Haskell *type constructors* and *data constructors* that the user imports to python are transformed into python <type> objects. If we create types for several data constructors (X, Y and Z, say) for a given type constructor (T, say), then the corresponding python <type> objects that we create will be related by inhe...
gpl-2.0
-3,317,047,028,139,664,000
47.6049
97
0.685812
false
w1ll1am23/home-assistant
tests/components/dexcom/test_init.py
6
1892
"""Test the Dexcom config flow.""" from unittest.mock import patch from pydexcom import AccountError, SessionError from homeassistant.components.dexcom.const import DOMAIN from homeassistant.config_entries import ENTRY_STATE_LOADED, ENTRY_STATE_NOT_LOADED from tests.common import MockConfigEntry from tests.component...
apache-2.0
7,805,751,921,027,894,000
28.5625
83
0.681818
false
jeroendierckx/Camelot
camelot/view/controls/editors/timeeditor.py
1
2934
# ============================================================================ # # Copyright (C) 2007-2012 Conceptive Engineering bvba. All rights reserved. # www.conceptive.be / project-camelot@conceptive.be # # This file is part of the Camelot Library. # # This file may be used under the terms of the GNU General...
gpl-2.0
1,678,732,745,265,478,000
36.973684
103
0.601909
false
chuan9/chromium-crosswalk
tools/telemetry/telemetry/core/platform/power_monitor/msr_power_monitor_unittest.py
4
1063
# 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 logging import time import unittest from telemetry.core.platform.power_monitor import msr_power_monitor from telemetry.core.platform import win_platf...
bsd-3-clause
-8,144,821,161,799,450,000
35.655172
74
0.762935
false
dscorbett/pygments
pygments/styles/stata_light.py
4
1274
# -*- coding: utf-8 -*- """ pygments.styles.stata_light ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Light Style inspired by Stata's do-file editor. Note this is not meant to be a complete style, just for Stata's file formats. :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. :license: BSD, se...
bsd-2-clause
2,354,031,027,009,207,300
31.666667
70
0.525903
false
opoplawski/ansible
lib/ansible/plugins/action/unarchive.py
19
4317
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2013, Dylan Martin <dmartin@seattlecentral.edu> # # 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 v...
gpl-3.0
1,682,675,790,891,705,900
37.20354
114
0.596942
false
ubccr/tacc_stats
pickler/human.py
5
2151
import time def ftime(epoch, fmt="%b %d %H:%M:%S"): return time.strftime(fmt, time.localtime(epoch)) def fhms(t): t = int(t) s = "" if t < 0: t = -t s = "-" return "%s%02d:%02d:%02d" % (s, t / 3600, (t % 3600) / 60, t % 60) # Based on coreutils human_readable() # TODO Handle small...
lgpl-2.1
2,365,281,063,548,961,300
26.935065
70
0.453278
false
MicBrain/Bank_Account_Sample
bank.py
1
8206
# A Banking account for the Bank X # Some algorithms were created just to demonstrate basic methods Birthday_data = {'David': '03.03.1994', 'George': '12.01.1991', 'Andrey': '09/05/1990'} SSN = {'David': '23423443', 'George': '343423423', 'Andrey': '34333432'} Account_Type = {'David': 'Checking', 'George': 'Saving', '...
mit
-4,838,618,070,273,833,000
25.217252
103
0.629539
false
Tisseo/navitia
source/jormungandr/jormungandr/tests/__init__.py
6
1209
# coding=utf-8 # Copyright (c) 2001-2016, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility an...
agpl-3.0
-3,613,960,069,887,952
39.3
79
0.751861
false
sjazayeri/minifeet
engine/geometry.py
1
1074
"""This module contains functions and classes to facilitate geometrical calculations""" import math epsilon = 0.5 class Vector: """A vector in the cartesian plane Vector(x, y) -> creates a vector """ def __init__(self, x, y): self.x = x self.y = y def __add__(self, u): ret...
gpl-2.0
-6,931,295,392,094,831,000
20.48
71
0.481378
false
sloanyang/gyp
test/ios/gyptest-per-config-settings.py
1
4079
#!/usr/bin/env python # Copyright (c) 2012 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. """ Verifies that device and simulator bundles are built correctly. """ import plistlib import TestGyp import subprocess import sys def C...
bsd-3-clause
4,196,860,065,660,636,700
34.469565
79
0.65874
false
opixido/palabre
modules/simpleLogin.py
1
2305
#!/usr/bin/env python # -*- coding: utf-8 -*- # Palabre - helloworld.py # # Copyright 2003-2005 Célio Conort # # This file is part of Palabre. # # Palabre 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; eithe...
gpl-2.0
-9,132,791,496,984,028,000
29.342105
100
0.564425
false
admk/soap
soap/lattice/base.py
1
4885
import functools from soap.common.cache import Flyweight def _decorate(cls): if not hasattr(cls, '_decorated'): cls._decorated = set() if cls is Lattice or cls in cls._decorated: return def decorate_self(base_func, decd_func): if not decd_func: raise ValueError( ...
mit
-7,497,752,793,039,520,000
29.31677
76
0.56136
false
Interoute/VDC-API-examples-Python
networks_get_by_zone.py
1
2030
#! /usr/bin/env python # Python script for the Interoute Virtual Data Centre API: # Name: networks_get_by_zone.py # Purpose: List available networks in a specific zone # Requires: class VDCApiCall in the file vdc_api_call.py # For download and information: # http://cloudstore.interoute.com/main/knowledge-centr...
apache-2.0
4,084,341,794,966,609,000
30.230769
88
0.606404
false
yiyangyi/cc98-tornado
application.py
1
3329
#!/usr/bin/env python # coding=utf-8 # # Copyright 2015 cc98.org import sys reload(sys) sys.setdefaultencoding("utf-8") import os.path import re import memcache import torndb import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web import handler.base import handler.user import hand...
mit
8,757,867,963,137,970,000
29.263636
125
0.668068
false
byterom/android_external_chromium_org
tools/metrics/histograms/extract_histograms.py
36
15042
# 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. """Extract histogram names from the description XML file. For more information on the format of the XML file, which is self-documenting, see histograms.xml;...
bsd-3-clause
-3,016,418,056,126,012,000
31.631236
80
0.681093
false
djevans071/Rebalancing-Citibike
websitetools/workflow/features.py
1
4181
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Jun 15 22:15:40 2017 @author: psamtik071 """ #functions for feature-engineering import pandas as pd # make sure tot_docks > 0 (especially when calculating bikes available) def bulk_query(year): # query all bikes after or before a certain time ...
mit
2,161,171,724,034,710,000
32.18254
108
0.611576
false
mfussenegger/jedi
test/completion/descriptors.py
13
3399
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
-1,436,094,243,243,915,800
14.520548
74
0.509562
false
MiltosD/CEFELRC
metashare/repository/tests/test_nightly.py
6
4115
import logging from zipfile import ZipFile from django.test import TestCase from django.test.client import Client from metashare import test_utils, xml_utils from metashare.settings import ROOT_PATH, LOG_HANDLER, TEST_MODE_NAME from metashare.repository.supermodel import OBJECT_XML_CACHE from metashare.repositor...
bsd-3-clause
-927,641,756,684,187,000
32.579832
92
0.605832
false
wscullin/spack
lib/spack/spack/test/url_substitution.py
3
3468
############################################################################## # Copyright (c) 2013-2017, 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
9,106,709,786,761,228,000
52.353846
97
0.682526
false
jonparrott/gcloud-python
resource_manager/google/cloud/resource_manager/client.py
3
7343
# Copyright 2015 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, s...
apache-2.0
-7,320,076,018,285,686,000
37.244792
86
0.604385
false
schlos/eden
modules/s3/sync_adapter/adashi.py
3
13592
# -*- coding: utf-8 -*- """ S3 Synchronization: Peer Repository Adapter for ADASHI @copyright: 2011-14 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to...
mit
-413,225,383,325,348,160
36.035422
79
0.471012
false
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/samba/_glue.py
1
1836
# encoding: utf-8 # module samba._glue # from /usr/lib/python2.7/dist-packages/samba/_glue.so # by generator 1.135 """ Python bindings for miscellaneous Samba functions. """ # no imports # Variables with simple values version = '4.1.11-Debian' # functions def generate_random_password(min, max): # real signature unk...
gpl-2.0
-2,689,156,166,753,454,000
27.6875
109
0.659041
false
keras-team/keras-io
examples/vision/conv_lstm.py
1
9194
""" Title: Next-Frame Video Prediction with Convolutional LSTMs Author: [Amogh Joshi](https://github.com/amogh7joshi) Date created: 2021/06/02 Last modified: 2021/06/05 Description: How to build and train a convolutional LSTM model for next-frame video prediction. """ """ ## Introduction The [Convolutional LSTM](http...
apache-2.0
-364,400,819,512,629,500
30.813149
103
0.703176
false
yamt/neutron
quantum/plugins/bigswitch/plugin.py
1
52526
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Big Switch Networks, 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.a...
apache-2.0
-241,474,743,344,927,200
40.853386
79
0.549614
false
joaduo/mepinta
core/python_core/mepinta/plugins_creation/module_to_cpp/templates/processor_plugin/ProcessorPluginCPPTemplates.py
1
1552
# -*- coding: utf-8 -*- ''' Mepinta Copyright (c) 2011-2012, Joaquin G. Duo This file is part of Mepinta. Mepinta 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 opti...
gpl-3.0
-3,045,722,401,488,933,000
36.853659
103
0.729381
false
h2oai/h2o-dev
py2/testdir_single_jvm/test_parse_covtype_2.py
20
3137
import unittest, sys sys.path.extend(['.','..','../..','py']) import h2o2 as h2o import h2o_cmd, h2o_import as h2i, h2o_browse as h2b from h2o_test import find_file, dump_json, verboseprint expectedZeros = [0, 4914, 656, 24603, 38665, 124, 13, 5, 1338, 51, 320216, 551128, 327648, 544044, 577981, 573487, 576189, 5686...
apache-2.0
8,927,826,356,312,453,000
36.345238
109
0.608543
false
paulscherrerinstitute/pyscan
tests/test_readme.py
1
11593
import unittest from itertools import cycle import sys # BEGIN EPICS MOCK. from threading import Thread from tests.helpers.mock_epics_dal import MockReadGroupInterface, MockWriteGroupInterface, fixed_values scan_module = sys.modules["pyscan.scan"] utils_module = sys.modules["pyscan.scan_actions"] utils_module.EPIC...
gpl-3.0
72,598,954,154,467,070
37.643333
115
0.580264
false
rlbabyuk/integration_tests
cfme/web_ui/history.py
7
2574
# -*- coding: utf-8 -*- """Module handling the history button. :var HISTORY_ITEMS: Locator that finds all the history items from dropdown :var SINGLE_HISTORY_BUTTON: Locator that finds the history button if it is without the dropdown. """ from cfme.fixtures import pytest_selenium as sel from . import toolbar HISTORY...
gpl-2.0
2,590,633,193,847,941,000
32
99
0.666278
false
khkaminska/bokeh
bokeh/server/settings.py
13
3106
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------...
bsd-3-clause
-6,739,283,922,724,767,000
28.028037
80
0.555377
false
jbedorf/tensorflow
tensorflow/contrib/rnn/python/ops/gru_ops.py
12
7835
# 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,293,991,928,860,184,000
31.645833
80
0.644288
false
Distrotech/bzr
bzrlib/tests/blackbox/test_clean_tree.py
2
4097
# Copyright (C) 2005-2010 Canonical Ltd # # 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
6,717,461,706,597,125,000
33.720339
78
0.617769
false
andrewyoung1991/django-restframework-stripe
tests/test_charge.py
1
2263
from unittest import mock import pytest import stripe from model_mommy import mommy from rest_framework.reverse import reverse from restframework_stripe import models from restframework_stripe.test import get_mock_resource @mock.patch("stripe.Charge.create") @pytest.mark.django_db def test_create_stripe_charge(cre...
bsd-2-clause
-105,157,011,203,283,260
29.581081
72
0.680513
false
quodlibet/mutagen
mutagen/easymp4.py
1
8696
# Copyright (C) 2009 Joe Wreschnig # # 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. from typing import Dict, Callable...
gpl-2.0
1,643,178,733,980,151,800
29.299652
79
0.569342
false
ClimbsRocks/scikit-learn
sklearn/utils/fixes.py
9
14907
"""Compatibility fixes for older version of python, numpy and scipy If you add content to this file, please give the version of the package at which the fixe is no longer needed. """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # ...
bsd-3-clause
-8,259,559,200,076,530,000
32.498876
84
0.573288
false
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/tensorflow/models/embedding/word2vec.py
5
19618
# 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...
agpl-3.0
1,114,555,787,794,870,300
35.737828
80
0.623866
false
dmick/teuthology
teuthology/task/parallel.py
3
2033
""" Task to group parallel running tasks """ import sys import logging from teuthology import run_tasks from teuthology import parallel log = logging.getLogger(__name__) def task(ctx, config): """ Run a group of tasks in parallel. example:: - parallel: - tasktest: - taskt...
mit
-5,962,651,389,765,162,000
27.633803
76
0.581407
false
mykytamorachov/outpost
flask/lib/python2.7/site-packages/whoosh/qparser/syntax.py
6
18138
# Copyright 2011 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
gpl-2.0
-297,175,290,654,484,200
27.790476
79
0.597199
false
SEA000/uw-empathica
empathica/anyserver.py
1
11418
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) This file is based, although a rewrite, on MIT-licensed code from the Bottle web framework. """ import os,...
mit
-8,174,010,267,480,177,000
36.933555
129
0.606061
false
BenevolentAI/guacamol
guacamol/assess_distribution_learning.py
1
4189
import datetime import json import logging from collections import OrderedDict from typing import List, Dict, Any import guacamol from guacamol.distribution_learning_benchmark import DistributionLearningBenchmark, DistributionLearningBenchmarkResult from guacamol.distribution_matching_generator import DistributionMatc...
mit
-504,245,012,287,924,200
44.532609
119
0.643352
false
CyanogenMod/android_external_deqp
scripts/check_resolution_list.py
7
1896
# -*- coding: utf-8 -*- import re import sys from fnmatch import fnmatch def fail (msg): print "ERROR: " + msg sys.exit(-1) # filename -> [case name] def readCaseList (filename): f = open(filename, 'rb') cases = [] for line in f: if line[0:6] == "TEST: ": cases.append(line[6:].strip()) f.close() return c...
apache-2.0
3,019,330,788,221,660,700
24.972603
87
0.660865
false
jlspyaozhongkai/Uter
third_party_backup/Python-2.7.9/Lib/plat-mac/applesingle.py
42
4957
r"""Routines to decode AppleSingle files """ from warnings import warnpy3k warnpy3k("In 3.x, the applesingle module is removed.", stacklevel=2) import struct import sys try: import MacOS import Carbon.File except: class MacOS: def openrf(path, mode): return open(path + '.rsrc', mode) ...
gpl-3.0
3,149,104,052,289,757,000
32.952055
89
0.587452
false
jrbourbeau/cr-composition
comptools/cluster.py
1
1873
import os import shutil from contextlib import contextmanager def check_on_condor(): if os.getenv('_CONDOR_SCRATCH_DIR'): on_condor = True else: on_condor = False return on_condor def localize_path(path): local_outdir = os.getenv('_CONDOR_SCRATCH_DIR') if local_outdir is None: ...
mit
-1,290,523,983,670,929,700
21.841463
83
0.618259
false
BT-jmichaud/partner-contact
base_location_geonames_import/__openerp__.py
12
1894
# -*- encoding: utf-8 -*- ############################################################################## # # Base Location Geonames Import module for OpenERP # Copyright (C) 2014 Akretion (http://www.akretion.com) # @author Alexis de Lattre <alexis.delattre@akretion.com> # Copyright (C) 2014 Agile Business ...
agpl-3.0
1,637,655,935,534,107,400
38.4375
78
0.592182
false
cogeorg/BlackRhino
networkx/algorithms/centrality/subgraph_alg.py
2
9546
# -*- coding: utf-8 -*- """ Subraph centrality and communicability betweenness. """ # Copyright (C) 2011 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import networkx as nx from networkx.utils import * __au...
gpl-3.0
-796,757,737,122,835,700
28.45679
95
0.592833
false
jreback/pandas
pandas/core/util/hashing.py
2
8952
""" data hash pandas / numpy objects """ import itertools from typing import Optional import numpy as np import pandas._libs.hashing as hashing from pandas.core.dtypes.common import ( is_categorical_dtype, is_extension_array_dtype, is_list_like, ) from pandas.core.dtypes.generic import ABCDataFrame, ABCI...
bsd-3-clause
-1,539,286,372,442,669,800
29.552901
88
0.607574
false
ingadhoc/product
product_replenishment_cost_sale_margin/models/sale_order_line.py
1
1562
from odoo import models, api, fields class SaleOrderLine(models.Model): _inherit = 'sale.order.line' def _compute_margin(self, order_id, product_id, product_uom_id): if product_id.replenishment_cost: frm_cur = product_id.currency_id to_cur = order_id.pricelist_id.currency_id ...
agpl-3.0
-5,488,537,172,704,366,000
44.941176
97
0.610115
false
eReuse/DeviceHub
ereuse_devicehub/rest.py
1
4757
import copy from contextlib import suppress from urllib.parse import urlencode from eve.methods.delete import deleteitem_internal from eve.methods.patch import patch_internal from eve.methods.post import post_internal from flask import current_app, json, g from pydash import map_values from ereuse_devicehub.exception...
agpl-3.0
-7,480,437,822,431,119,000
44.304762
115
0.677738
false
jkthompson/nupic
tests/integration/py2/nupic/algorithms/tp_segment_learning.py
9
20879
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
gpl-3.0
6,410,620,779,423,789,000
33.116013
80
0.580248
false
kstilwell/tcex
app_init/service_trigger/app.py
2
1924
"""ThreatConnect Trigger Service App""" # first-party from service_app import ServiceApp # Import default Service App Class (Required) # pylint: disable=unused-argument from tcex.playbooks import Playbooks class App(ServiceApp): """Service App Template.""" def run(self) -> None: """Run the trigge...
apache-2.0
-3,659,584,399,092,530,700
38.265306
100
0.654366
false
ChristophKirst/ClearMap
ClearMap/Test/misc.py
2
6500
# -*- coding: utf-8 -*- """ Created on Sat Jun 20 14:00:49 2015 @author: ckirst """ # open data #mount windows folder #sudo mount -t vboxsf D_DRIVE ./Windows/ #fn = '/home/ckirst/Science/Projects/BrainActivityMap/Data/iDISCO_2015_06/Adult cfos C row 20HF 150524.ims'; #fn = '/run/media/ckirst/Christ...
gpl-3.0
9,105,066,177,019,647,000
18.877676
123
0.671077
false
srgtrujillo/TuiterPy
model/post/timeline.py
1
1260
# -*- encoding: utf-8 -*- ################################################################################ # TuiterPy - A Python Command Line Social Network Application # Copyright (C) 2016 Sergio Trujillo (sergiotrujillomartinez@gmail.com) # # This program is free software: you can redistribute it and/or mod...
gpl-3.0
-5,460,411,615,059,723,000
37.181818
80
0.6
false
hemokosa/poetry
dada/brainfuck/Braindada.py
1
6171
#!/usr/bin/python # Author: Mark Dadisman (mbomb007) # Date: Sept. 26, 2015 # Description: Interpret a Self-modifying Brainfuck program # - Language created by Simon Howard <fraggle@removethisbit.gmail.com> # References: # - [https://]esolangs.org/wiki/Self-modifying_Brainfuck # - [https://]soulsphere.org/hacks/smbf/...
mit
-7,534,267,166,227,915,000
28.108491
368
0.52925
false
kubeflow/kfp-tekton-backend
components/gcp/container/component_sdk/python/tests/google/ml_engine/test__train.py
1
1886
# Copyright 2018 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, ...
apache-2.0
5,545,364,217,736,374,000
35.980392
78
0.576352
false
google-research/receptive_field
receptive_field/python/util/parse_layer_parameters.py
1
13027
# coding=utf-8 # Copyright 2019 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
5,889,039,245,859,731,000
36.979592
79
0.669533
false
Southpaw-TACTIC/Team
src/python/Lib/site-packages/pythonwin/pywin/framework/stdin.py
1
6903
# Copyright (c) 2000 David Abrahams. Permission to copy, use, modify, sell # and distribute this software is granted provided this copyright # notice appears in all copies. This software is provided "as is" without # express or implied warranty, and with no claim as to its suitability for # any purpose. """Provide...
epl-1.0
7,147,605,313,017,927,000
36.361111
91
0.603216
false
ifwe/wxpy
src/tests/wxPythonTests/testGraphicsPath.py
1
1038
"""Unit tests for wx.GraphicsPath. Methods yet to test: __del__, AddArc, AddArcToPoint, AddCircle, AddCurveToPoint, AddEllipse, AddLineToPoint, AddPath, AddQuadCurveToPoint, AddRectangle, AddRoundedRectangle, CloseSubpath, Contains, GetBox, GetCurrentPoint, GetNativePath, MoveToPoint, Transform, UnGetNativePath""" im...
mit
3,421,812,681,688,917,500
32.516129
84
0.708092
false
TravisCG/SI_scripts
getfusiondepth.py
1
1592
#!/usr/bin/python """ Read the fusion protein boundaries and a position sorted BAM file and calculate the read ration before and after the fusion breakpoint """ import sys import re import subprocess def bamprocess(bamfile, region): bam = subprocess.Popen(["samtools", "view", bamfile, region], stdout = subpro...
gpl-3.0
9,134,746,883,000,479,000
29.615385
90
0.665829
false
tensorflow/tensorflow
tensorflow/python/util/lock_util.py
14
4268
# 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,814,203,008,096,961,000
31.333333
80
0.656748
false
chdecultot/frappe
frappe/tests/test_utils.py
3
4240
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import unittest from frappe.utils import evaluate_filters, money_in_words, scrub_urls, get_url from frappe.utils import ceil, floor class TestFilters(unittest.TestCase): def te...
mit
3,771,580,447,214,136,300
39
111
0.61533
false
nicolasmoreau/NodeSoftware
nodes/tipbase/node/util_models.py
4
1467
class XsamsDataset: def __init__(self): self.dataDescription = None self.TabData = None class Result: def __init__(self): self.header = {} self._headerFields = { 'COUNT-SOURCES':None, 'COUNT-ATOMS' : None, 'COUNT-MOLECULES':None, 'CO...
gpl-3.0
-5,379,423,626,701,520,000
24.293103
65
0.541241
false
QuickSander/CouchPotatoServer
libs/guessit/transfo/guess_filetype.py
94
7514
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
-5,939,421,741,482,658,000
36.758794
124
0.612457
false
junhuac/MQUIC
src/tools/variations/fieldtrial_util.py
10
3428
# Copyright 2015 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 json import sys def _hex(ch): hv = hex(ord(ch)).replace('0x', '') hv.zfill(2) return hv.upper() # URL escapes the delimiter characters from t...
mit
-5,305,286,554,517,993,000
32.940594
79
0.656651
false
Dan-field/Jazz
MusicXMLWriter.py
1
22645
#################################################################### # Music XML Writer class by Daniel Field # # # # This class handles the creation and appending of a MusicXML file # # ...
mit
6,988,731,307,540,402,000
45.498973
176
0.530713
false
michaelld/gnuradio
gr-blocks/python/blocks/qa_argmax.py
7
2195
#!/usr/bin/env python # # Copyright 2007,2010,2013 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 ...
gpl-3.0
-2,197,206,323,405,953,300
28.662162
71
0.637813
false
boundary/boundary-api-cli
tests/unit/boundary/metric_update.py
4
3801
#!/usr/bin/env python # # Copyright 2015 BMC Software, 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 applicab...
apache-2.0
6,753,482,391,708,482,000
38.59375
76
0.56301
false
mszczodrak/openthread
tests/scripts/thread-cert/mle.py
10
30987
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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 # ...
bsd-3-clause
6,377,414,168,940,775,000
25.898438
128
0.60761
false
slovelan/NRAODev
carta/html5/common/skel/source/class/skel/simulation/tLoadImage.py
3
5677
import Util import time import unittest import selectBrowser from selenium import webdriver from flaky import flaky from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.su...
gpl-2.0
8,385,093,189,529,867,000
42.669231
142
0.653338
false
chippey/gaffer
python/GafferTest/TestCase.py
2
9150
########################################################################## # # Copyright (c) 2012, John Haddon. 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 so...
bsd-3-clause
-5,065,511,732,213,199,000
32.272727
137
0.692896
false
JA-VON/python-helpers-msbm
main.py
1
24289
__author__ = 'javon' import itertools import math import heapq def func(): options = [] n = raw_input() a,b = n.split() a,b = int(a),int(b) return (a+b)+(a-b)+(b+a)+(b-a) evaluations = {"+": lambda num1, num2, ans: (num1 + num2) == ans, "-": lambda num1, num2, ans: (num1 - num2) ==...
mit
8,788,391,688,941,698,000
31.257636
304
0.443122
false
alsrgv/tensorflow
tensorflow/python/autograph/converters/slices.py
38
2836
# 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,906,073,645,817,839,000
32.364706
80
0.689704
false
Lekensteyn/buildbot
master/buildbot/db/buildsets.py
3
9571
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
2,990,508,977,454,804,500
38.065306
93
0.552502
false
newfies-dialer/newfies-dialer
newfies/appointment/models/calendars.py
5
2139
# -*- coding: utf-8 -*- from django.db import models from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from django.utils import timezone from user_profile.models import CalendarUser import datetime import pytz class Calendar(models.Model): """ This is for gr...
mpl-2.0
-8,416,147,827,699,024,000
35.87931
100
0.649836
false
slightstone/SickRage
sickbeard/notifiers/prowl.py
25
4221
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License,...
gpl-3.0
4,800,968,536,802,754,000
38.083333
167
0.628524
false
rombie/contrail-controller
src/config/test/config_systest.py
5
1771
#!/usr/bin/env python # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # # # analytics_systest.py # # System tests for analytics # import sys builddir = sys.path[0] + '/../..' from gevent import monkey monkey.patch_all() import os import unittest import testtools import fixtures import socket from...
apache-2.0
-5,892,167,858,839,688,000
24.3
67
0.66629
false
eagleamon/home-assistant
homeassistant/components/switch/rpi_rf.py
6
3769
""" Allows to configure a switch using a 433MHz module via GPIO on a Raspberry Pi. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.rpi_rf/ """ import logging import voluptuous as vol from homeassistant.components.switch import (SwitchDevice, PLAT...
apache-2.0
1,263,693,605,866,328,000
29.893443
78
0.631467
false
vpaprots/fabric
bddtests/steps/compose.py
2
4422
# Copyright IBM Corp. 2016 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 ag...
apache-2.0
4,481,646,573,299,418,000
44.122449
151
0.636816
false
lbryio/lbrycrd
test/functional/rpc_createmultisig.py
12
3736
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test transaction signing using the signrawtransaction* RPCs.""" from test_framework.test_framework imp...
mit
-7,520,316,894,745,888,000
35.990099
160
0.61349
false
communityshare/communityshare
community_share/models/survey.py
1
6274
from datetime import datetime import logging import json from sqlalchemy import Column, Integer, String, DateTime, Boolean from sqlalchemy import ForeignKey from sqlalchemy.orm import relationship from community_share import Base from community_share.models.base import Serializable logger = logging.getLogger(__name_...
mpl-2.0
649,587,632,954,101,200
30.847716
81
0.617788
false
xiaoyaozi5566/DynamicCache
parsers/miss_trace.py
1
1590
#!/ufs/cluster/yao/bin/python import re, os import string import sys import array import random import shutil from os import walk def genTrace(input_filename): print "Parsing " + input_filename # output filename output_filename = input_filename.split('.')[0] + "_total_misses.trc" # open input file ...
bsd-3-clause
-5,672,554,308,921,390,000
26.912281
72
0.610063
false
dgjustice/ansible
lib/ansible/modules/files/blockinfile.py
20
10640
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, 2015 YAEGASHI Takeshi <yaegashi@debian.org> # # 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 ...
gpl-3.0
2,098,085,154,795,181,600
30.951952
124
0.610338
false
xbed/Mixly_Arduino
mixly_arduino/mpBuild/common/lib/uasyncio.py
1
8734
# (c) 2014-2019 Paul Sokolovsky. MIT license. import uerrno import uselect as select import usocket as _socket from uasynciocore import * DEBUG = 0 log = None def set_debug(val): global DEBUG, log DEBUG = val if val: import logging log = logging.getLogger("uasyncio") class PollEventLoop...
apache-2.0
-7,271,358,886,230,652,000
31.958491
88
0.552553
false
Esri/raster-functions
functions/deprecated/Windchill.py
1
6277
import numpy as np class Windchill(): def __init__(self): self.name = "Windchill Function" self.description = ("This function computes windchill given " "wind speed and air temperature.") self.tUnits = 'f' self.wUnits = 'M' self.oUnit...
apache-2.0
-7,348,298,746,600,962,000
37.727848
142
0.487653
false
poojavade/Genomics_Docker
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/numpy/core/tests/test_dtype.py
14
24096
from __future__ import division, absolute_import, print_function import sys import numpy as np from numpy.core.test_rational import rational from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_raises, dec ) def assert_dtype_equal(a, b): assert_equal(a, b) assert_equa...
apache-2.0
-6,602,419,464,583,819,000
40.402062
87
0.449286
false
nck0405/MyOwn
modules/s3/s3task.py
4
18708
# -*- coding: utf-8 -*- """ Asynchronous Task Execution - falls back to Synchronous if no workers are alive Worker nodes won't run on Win32 yet. To run a worker node: python web2py.py -K eden or use UWSGI's 'Mule' NB Need WEB2PY_PATH environment variable to be defined (e.g. /etc/profile)...
mit
6,759,770,734,973,360,000
37.179592
115
0.501924
false
Xpray/flink
flink-libraries/flink-python/src/main/python/org/apache/flink/python/api/flink/plan/Environment.py
17
14723
################################################################################ # 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...
apache-2.0
8,732,757,498,326,981,000
37.541885
181
0.577192
false