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
gbook/nidb
src/qcmodules/MRStructuralMotion/MRStructuralMotion.py
1
14647
# the order of these calls is important... import sys import os import re import getopt import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as pyplot import scipy.ndimage import scipy.misc from scipy import stats import numpy import math import string import random from subprocess import call import shutil...
gpl-3.0
-5,409,883,533,740,066,000
34.814181
399
0.643545
false
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/build/android/gyp/generate_resource_rewriter.py
8
3415
#!/usr/bin/env python # # Copyright (c) 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. """Generate ResourceRewriter.java which overwrites the given package's resource id. """ import argparse import os import sys ...
gpl-3.0
-8,216,345,711,760,738,000
30.045455
73
0.603807
false
TheTimmy/spack
var/spack/repos/builtin/packages/pacbio-damasker/package.py
3
2074
############################################################################## # 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
380,387,239,340,774,340
43.12766
78
0.653809
false
sznekol/django-cms
cms/south_migrations/0046_move_apphooks.py
48
17147
# -*- coding: utf-8 -*- from south.v2 import DataMigration try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label = '%s.%s' % (User._meta.app_label, User._meta.object_name) user_model_...
bsd-3-clause
6,346,685,981,712,200,000
70.445833
124
0.538053
false
Multi2Sim/m2s-bench-parsec-3.0-src
libs/libxml2/src/python/tests/sync.py
87
3508
#!/usr/bin/python -u import sys import libxml2 # Memory debug specific libxml2.debugMemory(1) log = "" class callback: def startDocument(self): global log log = log + "startDocument:" def endDocument(self): global log log = log + "endDocument:" def startElement(self, tag...
bsd-3-clause
-1,046,406,412,938,018,300
24.985185
105
0.63455
false
nicholasserra/sentry
src/sentry/migrations/0159_auto__add_field_authidentity_last_verified__add_field_organizationmemb.py
34
36008
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'AuthIdentity.last_verified' db.add_column('sentry_authide...
bsd-3-clause
-5,045,018,182,291,331,000
86.398058
223
0.573317
false
Pinkerton/alexa-tinder
config.py
1
2753
import json import requests import pynder # class User(object): # """docstring for User""" # def __init__(self, bio, name, photo, age, gender, birth_date, jobs, schools, distance_km, common_connections, common_interests): # super(User, self).__init__() # self.bio = bio # self.name = n...
mit
-8,940,732,224,086,422,000
52.980392
497
0.674537
false
smasala/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/model/workitems.py
140
3429
# Copyright (C) 2010 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 ...
bsd-3-clause
-4,555,497,310,772,830,000
43.532468
105
0.719743
false
kamal-gade/rockstor-core
src/rockstor/backup/views/plugin.py
2
1165
""" Copyright (c) 2012-2014 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
gpl-3.0
5,736,944,950,595,678,000
31.361111
68
0.71073
false
mdickinson/pcgrandom
pcgrandom/test/test_pcg_xsh_rs_v0.py
1
1961
# Copyright 2017 Mark Dickinson # # 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
82,806,127,554,744,320
39.020408
79
0.702193
false
simonwydooghe/ansible
lib/ansible/modules/network/netvisor/pn_igmp_snooping.py
52
6474
#!/usr/bin/python # Copyright: (c) 2018, Pluribus Networks # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['...
gpl-3.0
-535,393,166,419,590,700
29.828571
92
0.614303
false
qifeigit/scikit-learn
sklearn/tests/test_isotonic.py
230
11087
import numpy as np import pickle from sklearn.isotonic import (check_increasing, isotonic_regression, IsotonicRegression) from sklearn.utils.testing import (assert_raises, assert_array_equal, assert_true, assert_false, assert_equal, ...
bsd-3-clause
-7,876,612,244,246,355,000
30.859195
82
0.615405
false
davidzchen/tensorflow
tensorflow/python/ops/numpy_ops/np_array_ops_test.py
5
41372
# Copyright 2020 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,045,265,442,249,348,000
33.620921
80
0.550662
false
cryptobanana/ansible
lib/ansible/modules/cloud/ovirt/ovirt_tags.py
75
7807
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
4,049,912,625,449,557,500
30.995902
110
0.586653
false
praekelt/python-gitmodel
gitmodel/test/fields/models.py
2
1451
import pygit2 from gitmodel import fields from gitmodel import models class Person(models.GitModel): slug = fields.SlugField() first_name = fields.CharField() last_name = fields.CharField() email = fields.EmailField() age = fields.IntegerField(required=False) account_balance = fields.DecimalF...
bsd-3-clause
3,132,161,697,148,300,300
29.87234
68
0.72295
false
edmorley/treeherder
tests/webapp/api/test_version.py
2
1331
from django.conf import settings from rest_framework.decorators import APIView from rest_framework.exceptions import NotAcceptable from rest_framework.response import Response from rest_framework.test import APIRequestFactory class RequestVersionView(APIView): def get(self, request, *args, **kwargs): retu...
mpl-2.0
-8,367,779,316,087,841,000
32.275
88
0.702479
false
tensorflow/model-optimization
tensorflow_model_optimization/python/core/clustering/keras/clustering_algorithm.py
1
7243
# Copyright 2021 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
-7,699,775,152,266,453,000
38.796703
105
0.700815
false
timthelion/FreeCAD
src/Mod/Sandbox/exportDRAWEXE.py
25
39258
#*************************************************************************** #* * #* Copyright (c) 2014 Sebastian Hoogen <github@sebastianhoogen.de> * #* * #* This p...
lgpl-2.1
3,901,556,866,134,063,600
45.023447
95
0.505426
false
brev/nupic
tests/unit/nupic/math/sparse_binary_matrix_test.py
35
44937
#!/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 ...
agpl-3.0
2,760,814,454,136,776,700
24.460057
84
0.489374
false
piotr-dobrogost/sqlalchemy-continuum
tests/schema/test_update_property_mod_flags.py
5
2946
from copy import copy import sqlalchemy as sa from sqlalchemy_continuum import version_class from sqlalchemy_continuum.plugins import PropertyModTrackerPlugin from sqlalchemy_continuum.schema import update_property_mod_flags from tests import TestCase class TestSchemaTools(TestCase): versioning_strategy = 'valid...
bsd-3-clause
8,909,968,334,957,848,000
28.757576
76
0.479294
false
EDUlib/edx-platform
openedx/core/djangolib/fields.py
4
1479
""" Custom Django fields. """ from django.db import models class CharNullField(models.CharField): """ CharField that stores NULL but returns '' """ description = "CharField that stores NULL but returns ''" def to_python(self, value): """Converts the value into the correct Python object....
agpl-3.0
-2,263,908,074,454,106,000
24.067797
67
0.574713
false
aslab/rct
higgs/branches/ros-fuerte/OMRosDrivers_py/src/meta_sensor_node.py
1
1309
#!/usr/bin/env python ''' @author: Carlos Hernandez @organization: ASLab @summary: module that realises perception up to the sensory processing, on rosnodes @status: second version - basic functionality but working ''' #import sys #import os #import xmlrpclib import roslib; roslib.load_manifest('OMRosDrivers_py') im...
gpl-3.0
6,531,602,515,343,444,000
26.87234
83
0.468296
false
tcwicklund/django
django/conf/global_settings.py
55
21393
# Default Django settings. Override these with settings in the module # pointed-to by the DJANGO_SETTINGS_MODULE environment variable. # This is defined here as a do-nothing function because we can't import # django.utils.translation -- that module depends on the settings. gettext_noop = lambda s: s #################...
bsd-3-clause
-765,393,959,901,958,500
33.728896
95
0.685318
false
mrry/tensorflow
tensorflow/contrib/training/python/training/sequence_queueing_state_saver.py
8
62383
# 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
-5,242,822,430,296,576,000
40.980485
80
0.659971
false
mrkm4ntr/incubator-airflow
airflow/operators/mysql_operator.py
7
1146
# # 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
7,128,508,593,891,113,000
38.517241
87
0.768761
false
tccworld/qualitybots
src/client_setup/chrome_manager.py
26
12730
#!/usr/bin/python2.6 # # Copyright 2010 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
554,440,827,767,252,200
32.766578
79
0.671956
false
gromez/Sick-Beard
lib/requests/api.py
55
4882
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: ISC, see LICENSE for more details. """ from . import sessions from .safe_mode import catch_exceptions_if_in_safe_mode @catch_exceptions_if_in_safe_mode def request(metho...
gpl-3.0
-4,496,708,070,567,321,000
36.553846
136
0.673085
false
ville-k/tensorflow
tensorflow/contrib/data/python/kernel_tests/bucketing_test.py
12
11950
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-1,428,894,726,061,464,000
39.924658
80
0.649791
false
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/pandas/tseries/tests/test_base.py
2
51601
from __future__ import print_function import re from datetime import datetime, timedelta import numpy as np import pandas as pd from pandas.tseries.base import DatetimeIndexOpsMixin from pandas.util.testing import assertRaisesRegexp, assert_isinstance from pandas.tseries.common import is_datetimelike from pandas import...
gpl-2.0
-4,558,944,431,381,636,600
42.362185
136
0.56028
false
gregdek/ansible
lib/ansible/modules/network/f5/bigip_imish_config.py
4
27901
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
2,009,471,882,682,759,700
35.235065
129
0.610444
false
ragavvenkatesan/Convolutional-Neural-Networks
pantry/tutorials/log_reg.py
1
2122
""" Notes: This code contains one method that explains how to build a logistic regression classifier for the MNIST dataset using the yann toolbox. For a more interactive tutorial refer the notebook at yann/pantry/tutorials/notebooks/Logistic Regression.ipynb """ from yann.network import network ...
mit
-82,940,062,386,131,800
28.082192
68
0.598963
false
ryanarnold/complaints_categorizer
categorizer/feature_selection.py
1
2179
from collections import Counter def TFIDF(TF, complaints, term): if TF >= 1: n = len(complaints) x = sum([1 for complaint in complaints if term in complaint['body']]) return log(TF + 1) * log(n / x) else: return 0 def DF(vocab, complaints): term_DF = dict() for term in ...
mit
-5,405,219,615,546,855,000
33.587302
121
0.496099
false
shawnadelic/shuup
shuup/core/pricing/_utils.py
2
3470
# This file is part of Shuup. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from ._discounts import get_discount_modules from ._module...
agpl-3.0
6,837,062,289,985,438,000
32.68932
75
0.703746
false
kobox/achilles.pl
src/profiles/models.py
1
1291
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.encoding import python_2_unicode_compatible import uuid from django.db import models from django.conf import settings from django.utils.translation import ugettext_lazy as _ class BaseProfile(models.Model): user = models.OneToOneFie...
mit
-4,330,266,230,584,631,000
39.25
90
0.649845
false
florianholzapfel/home-assistant
homeassistant/components/switch/verisure.py
29
1902
""" Support for Verisure Smartplugs. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.verisure/ """ import logging from homeassistant.components.verisure import HUB as hub from homeassistant.components.verisure import CONF_SMARTPLUGS from homeassis...
mit
-1,050,479,470,473,883,100
28.261538
74
0.655626
false
dmillington/ansible-modules-core
network/nxos/nxos_vrf_interface.py
8
15722
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
-8,995,805,310,054,887,000
30.196429
80
0.582496
false
persandstrom/home-assistant
tests/components/hangouts/test_config_flow.py
8
3316
"""Tests for the Google Hangouts config flow.""" from unittest.mock import patch from homeassistant import data_entry_flow from homeassistant.components.hangouts import config_flow async def test_flow_works(hass, aioclient_mock): """Test config flow without 2fa.""" flow = config_flow.HangoutsFlowHandler() ...
apache-2.0
7,163,476,850,427,890,000
35.043478
79
0.660736
false
xsteadfastx/beets
beetsplug/hook.py
11
4275
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2015, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation t...
mit
4,972,357,251,819,321,000
34.625
79
0.606082
false
nikste/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/beta_test.py
34
13683
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
3,180,073,985,276,255,000
36.694215
80
0.586202
false
dqnykamp/sympy
sympy/utilities/decorator.py
24
5885
"""Useful utility decorators. """ from __future__ import print_function, division import sys import types import inspect from sympy.core.decorators import wraps from sympy.core.compatibility import class_types, get_function_globals, get_function_name, iterable def threaded_factory(func, use_add): """A factory f...
bsd-3-clause
-2,804,504,702,888,716,000
29.651042
99
0.614274
false
John-Lin/ryu
ryu/tests/unit/ofproto/test_nx_flow_spec.py
27
3578
# Copyright (C) 2015 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2015 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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:...
apache-2.0
-6,615,435,769,633,998,000
36.663158
69
0.539966
false
thomasballinger/lazyload
test.py
1
2249
import sys from types import ModuleType import unittest from lazyload import make_lazy, _LazyModuleMarker class LazyLoadTestCase(unittest.TestCase): @classmethod def setUpClass(cls): cls.modname = 'abc' def tearDown(self): sys.modules.pop(self.modname, None) # remove from the modules. ...
mit
6,700,887,624,289,149,000
28.207792
79
0.564251
false
gvallarelli/inasafe
safe/common/numerics.py
3
8722
"""**Numerical tools** """ import numpy from utilities import verify def ensure_numeric(A, typecode=None): """Ensure that sequence is a numeric array. Args: * A: Sequence. If A is already a numeric array it will be returned unaltered If not, an attempt i...
gpl-3.0
-1,114,485,035,784,216,300
27.045016
79
0.564664
false
SoCo/SoCo
doc/conf.py
2
12634
#!/usr/bin/env python3 # # soco documentation build configuration file, created by # sphinx-quickstart on Mon Sep 14 08:03:37 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
mit
6,731,615,543,521,587,000
30.90404
79
0.699066
false
zheguang/voltdb
tests/scripts/examples/sql_coverage/index-count1-schema.py
2
1555
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2014 VoltDB Inc. # # 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 limitati...
agpl-3.0
-2,609,069,192,534,823,000
39.921053
72
0.693248
false
D-K-E/cltk
src/cltk/ner/processes.py
4
4577
"""This module holds the ``Process``es for NER.""" from copy import deepcopy from dataclasses import dataclass from typing import Any, List from boltons.cacheutils import cachedproperty from cltk.core.data_types import Doc, Process from cltk.ner.ner import tag_ner @dataclass class NERProcess(Process): """To be...
mit
9,002,386,539,407,553,000
31.834586
220
0.661553
false
jth/tez
tez-tools/swimlanes/swimlane.py
8
8470
# # 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
6,176,593,849,278,781,000
41.562814
173
0.634947
false
boompieman/iim_project
project_python2/lib/python2.7/site-packages/nltk/corpus/reader/reviews.py
3
12832
# Natural Language Toolkit: Product Reviews Corpus Reader # # Copyright (C) 2001-2015 NLTK Project # Author: Pierpaolo Pantone <24alsecondo@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ CorpusReader for reviews corpora (syntax based on Customer Review Corpus). - Custome...
gpl-3.0
-1,176,222,734,082,389,500
37.121951
125
0.593438
false
legacysurvey/legacypipe
py/legacyanalysis/test_djspsf.py
2
2808
from __future__ import print_function import sys if __name__ == '__main__': import matplotlib matplotlib.use('Agg') import pylab as plt import numpy as np from astrometry.util.file import trymakedirs from tractor import * from tractor.psfex import * from legacypipe.survey import * def main(): plt.figur...
bsd-3-clause
-6,667,524,599,436,785,000
25
76
0.630342
false
navotsil/Open-Knesset
okhelptexts/migrations/0001_initial.py
14
1844
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Helptext' db.create_table('okhelptexts_helptext', ( ('id', self.gf('django.db....
bsd-3-clause
-1,123,663,733,173,347,500
35.88
114
0.579718
false
ATIX-AG/ansible
test/units/module_utils/basic/test_imports.py
42
5657
# -*- coding: utf-8 -*- # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function ...
gpl-3.0
8,116,179,620,525,537,000
41.856061
103
0.621354
false
lncosie/antlr4
runtime/Python2/src/antlr4/atn/ATNDeserializationOptions.py
14
2185
#[The "BSD license"] # Copyright (c) 2013 Terence Parr # Copyright (c) 2013 Sam Harwell # Copyright (c) 2014 Eric Vergnaud # 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 ...
bsd-3-clause
-5,861,372,435,121,214,000
46.5
114
0.759268
false
andfoy/margffoy-tuay-server
env/lib/python2.7/site-packages/sockjs/tornado/periodic.py
12
1944
# -*- coding: utf-8 -*- """ sockjs.tornado.periodic ~~~~~~~~~~~~~~~~~~~~~~~ This module implements customized PeriodicCallback from tornado with support of the sliding window. """ import time import logging LOG = logging.getLogger("tornado.general") class Callback(object): """Custom implementati...
gpl-2.0
-5,663,372,414,082,614,000
24.578947
72
0.56893
false
FreekingDean/home-assistant
homeassistant/components/apcupsd.py
31
2422
""" Support for status output of APCUPSd via its Network Information Server (NIS). For more details about this component, please refer to the documentation at https://home-assistant.io/components/apcupsd/ """ import logging from datetime import timedelta import voluptuous as vol from homeassistant.const import (CONF...
mit
-3,529,324,538,836,102,000
25.911111
78
0.667217
false
aldian/tensorflow
tensorflow/python/kernel_tests/betainc_op_test.py
87
7919
# 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
-2,744,009,706,450,025,500
40.899471
80
0.607779
false
pengli09/Paddle
python/paddle/v2/dataset/tests/cifar_test.py
16
1874
# 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
-7,496,504,659,334,961,000
32.464286
74
0.653682
false
mKeRix/home-assistant
tests/util/test_volume.py
23
1523
"""Test Home Assistant volume utility functions.""" import pytest from homeassistant.const import ( VOLUME_FLUID_OUNCE, VOLUME_GALLONS, VOLUME_LITERS, VOLUME_MILLILITERS, ) import homeassistant.util.volume as volume_util INVALID_SYMBOL = "bob" VALID_SYMBOL = VOLUME_LITERS def test_convert_same_unit...
mit
7,672,790,912,589,595,000
30.081633
80
0.707157
false
eleonrk/SickRage
lib/future/backports/http/client.py
64
47192
"""HTTP/1.1 client library A backport of the Python 3.3 http/client.py module for python-future. <intro stuff goes here> <other stuff, too> HTTPConnection goes through a number of "states", which define when a client may legally make another request or fetch the response for a particular request. This diagram detail...
gpl-3.0
1,927,320,250,233,693,400
34.429429
129
0.564291
false
GenericStudent/home-assistant
tests/components/file/test_sensor.py
6
2611
"""The tests for local file sensor platform.""" import pytest from homeassistant.const import STATE_UNKNOWN from homeassistant.setup import async_setup_component from tests.async_mock import Mock, mock_open, patch from tests.common import mock_registry @pytest.fixture def entity_reg(hass): """Return an empty, l...
apache-2.0
-6,607,333,936,943,780,000
33.355263
88
0.646496
false
ujenmr/ansible
lib/ansible/plugins/become/doas.py
9
4239
# -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ become: doas short_description: Do As user ...
gpl-3.0
1,424,917,583,425,113,600
32.117188
117
0.545176
false
mongodb/mongo-python-driver
test/test_errors.py
2
4350
# Copyright 2020-present MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
apache-2.0
4,514,883,882,441,602,000
38.189189
79
0.624598
false
sdewald/madm
madm_restapi/menu/serializers.py
1
1713
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from rest_framework import serializers from rest_framework_recursive.fields import RecursiveField class NodeAttributeSerializer(serializers.Serializer): """ Serializes ``NavigationNode.attr`` """ auth_required = seriali...
gpl-3.0
4,987,595,727,607,305,000
33.26
76
0.727963
false
OCA/l10n-switzerland
l10n_ch_isr_payment_grouping/tests/test_l10n_ch_payment_isr.py
1
9692
# Copyright 2020 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import time from odoo import tools from odoo.modules.module import get_resource_path from odoo.tests import Form, common, tagged ISR1 = "703192500010549027000209403" ISR2 = "120000000000234478943216899" @tagged("post_inst...
agpl-3.0
3,165,505,731,563,697,000
39.049587
88
0.586463
false
DESHRAJ/django-organizations
tests/test_models.py
2
6989
# -*- coding: utf-8 -*- from functools import partial from django.db import IntegrityError from django.contrib.auth.models import User from django.test import TestCase from django.test.utils import override_settings from organizations.models import (Organization, OrganizationUser, OrganizationOwner) from org...
bsd-2-clause
-7,386,932,316,433,064,000
38.022346
83
0.669148
false
yatinkumbhare/openstack-nova
nova/tests/functional/v3/test_flavor_access.py
29
4566
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
2,449,985,247,922,982,400
36.735537
79
0.571616
false
wilebeast/FireFox-OS
B2G/external/sonivox/jet_tools/JetCreator/JetFile.py
7
32873
""" File: JetFile.py Contents and purpose: Auditions a jet file to simulate interactive music functions Copyright (c) 2008 Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtai...
apache-2.0
3,999,994,565,243,823,600
40.416774
187
0.563228
false
nazeehshoura/crawler
env/lib/python2.7/site-packages/django/contrib/auth/urls.py
113
1203
# The views used below are normally mapped in django.contrib.admin.urls.py # This URLs file is used to provide a reliable view deployment for test purposes. # It is also provided as a convenience to those who want to deploy these URLs # elsewhere. from django.conf.urls import patterns, url urlpatterns = patterns('', ...
mit
-8,834,554,418,533,865,000
62.315789
115
0.699086
false
adobe-flash/avmplus
build/buildbot/slaves/android/scripts/shell-client-android.py
8
1874
#!/usr/bin/env python # -*- python -*- # ex: set syntax=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import sys,socket,os,time,re port=None host=None if ...
mpl-2.0
6,161,776,138,839,652,000
24.324324
70
0.621665
false
asm666/sympy
sympy/galgebra/tests/test_ga.py
44
24800
# sympy/galgebra/tests/test_ga.py """ The reference D&L is "Geometric Algebra for Physicists" by Doran and Lasenby """ from sympy.core import expand, Rational, S, Symbol, symbols from sympy.core.compatibility import range from sympy.functions import sin, cos from sympy.galgebra.ga import MV, Nga, Com from sympy.galge...
bsd-3-clause
-7,081,937,909,611,391,000
33.831461
328
0.446532
false
handroissuazo/tensorflow
tensorflow/contrib/learn/python/learn/estimators/__init__.py
12
11510
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-3,052,571,009,100,019,000
33.773414
110
0.754909
false
nno/MOxUnit
tools/matlab_tokenizer.py
4
5432
# # simple Tokenizer for Matlab / Octave code # import re class Token(object): NAME = 1 OP = 2 COMMENT = 3 NL = 4 WHITESPACE = 5 def __init__(self, content, type): self.content = content self.type = type def __str__(self): return '"%s" [%s]' % (self.content, self....
mit
7,871,363,591,307,138,000
24.622642
80
0.489691
false
radoondas/elasticbeat
vendor/github.com/elastic/beats/dev-tools/aggregate_coverage.py
10
1735
#!/usr/bin/env python """Simple script to concatenate coverage reports. """ import os import sys import argparse import fnmatch def main(arguments): parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_arg...
apache-2.0
8,310,044,625,557,744,000
34.408163
90
0.548127
false
pietern/caffe2
caffe2/python/control_test.py
4
13092
# Copyright (c) 2016-present, Facebook, 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...
apache-2.0
2,566,413,039,581,512,000
36.83815
78
0.595936
false
GoogleCloudPlatform/Data-Pipeline
app/src/csvmatchreplace/timestamp_test.py
1
2460
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
-7,790,742,298,966,103,000
33.647887
75
0.599593
false
mdanielwork/intellij-community
python/lib/Lib/site-packages/django/contrib/formtools/preview.py
229
6829
""" Formtools Preview application. """ import cPickle as pickle from django.conf import settings from django.http import Http404 from django.shortcuts import render_to_response from django.template.context import RequestContext from django.utils.hashcompat import md5_constructor from django.utils.crypto import consta...
apache-2.0
-6,032,251,048,807,797,000
39.408284
115
0.615463
false
willprice/weboob
modules/nova/module.py
7
3545
# -*- coding: utf-8 -*- # Copyright(C) 2011 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opti...
agpl-3.0
4,192,967,228,599,084,000
33.417476
119
0.653315
false
eusi/MissionPlanerHM
Lib/site-packages/scipy/stats/stats.py
53
122717
# Copyright (c) Gary Strangman. All rights reserved # # Disclaimer # # This software is provided "as-is". There are no expressed or implied # warranties of any kind, including, but not limited to, the warranties # of merchantability and fitness for a given application. In no event # shall Gary Strangman be liable fo...
gpl-3.0
-1,053,418,467,456,475,400
30.473968
89
0.593398
false
olapaola/olapaola-android-scripting
python/src/Lib/DocXMLRPCServer.py
61
10599
"""Self documenting XML-RPC Server. This module can be used to create XML-RPC servers that serve pydoc-style documentation in response to HTTP GET requests. This documentation is dynamically generated based on the functions and methods registered with the server. This module is built upon the pydoc and SimpleXMLRPCSe...
apache-2.0
4,466,492,354,720,974,300
36.452297
85
0.572129
false
elba7r/lite-system
erpnext/patches/v5_4/fix_missing_item_images.py
41
4287
from __future__ import unicode_literals import frappe import os from frappe.utils import get_files_path from frappe.utils.file_manager import get_content_hash def execute(): files_path = get_files_path() # get files that don't have attached_to_name but exist unlinked_files = get_unlinked_files(files_path) if not ...
gpl-3.0
-8,873,948,628,527,166,000
33.02381
111
0.700023
false
VeNoMouS/Sick-Beard
sickbeard/metadata/generic.py
1
34333
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Lice...
gpl-3.0
4,174,870,005,911,169,000
38.148233
219
0.613724
false
spygg/liusblog
liusblog/urls.py
1
1124
"""liusblog URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-base...
gpl-3.0
8,298,488,587,895,058,000
36.366667
77
0.719643
false
openstack/tosca-parser
toscaparser/tests/test_toscatpl.py
1
45468
# 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
-7,939,371,029,896,823,000
43.796059
79
0.555688
false
gpoulter/pydedupe
tests/test_linkcsv.py
1
1959
#!/usr/bin/env python import logging import sys import unittest from os.path import dirname, join sys.path.insert(0, dirname(dirname(dirname(__file__)))) from dedupe import block, sim, linkcsv def classify(comparisons): """Returns match pairs and non-match pairs. :type comparisons: {(R, R):[float, ...]} ...
gpl-3.0
4,623,592,995,240,008,000
25.472973
79
0.562532
false
usc-isi/essex-baremetal-support
nova/network/linux_net.py
1
46295
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (t...
apache-2.0
977,142,080,698,136,200
37.708194
85
0.534658
false
nens/openradar
openradar/scripts/sync.py
1
2563
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst. from openradar import config from openradar import loghelper import logging import ftplib import os import io def ftp_transfer(source, target, name): """ Transfer ftp file from source ftp to target ftp. """ d...
gpl-3.0
1,327,143,132,923,059,500
27.477778
78
0.570425
false
Zhongqilong/mykbengineer
kbe/res/scripts/common/Lib/test/test_urllib_response.py
96
1728
"""Unit tests for code in urllib.response.""" import socket import tempfile import urllib.response import unittest class TestResponse(unittest.TestCase): def setUp(self): self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.fp = self.sock.makefile('rb') self.test_headers = {...
lgpl-3.0
4,286,188,718,203,682,300
28.288136
72
0.604167
false
berendkleinhaneveld/VTK
ThirdParty/Twisted/twisted/trial/test/test_log.py
40
7158
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test the interaction between trial and errors logged during test run. """ from __future__ import division import time from twisted.internet import reactor, task from twisted.python import failure, log from twisted.trial import unittest, repo...
bsd-3-clause
8,024,489,156,995,821,000
29.459574
87
0.582286
false
kzhong1991/Flight-AR.Drone-2
src/3rdparty/Qt4.8.4/src/3rdparty/webkit/Source/ThirdParty/gyp/test/sibling/gyptest-relocate.py
151
1144
#!/usr/bin/env python # 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. """ """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('build/all.gyp', chdir='src') test.relocate('src', 'relocate/src') test.bu...
bsd-3-clause
2,418,366,907,746,751,000
26.902439
76
0.65035
false
Work4Labs/lettuce
tests/integration/lib/Django-1.2.5/tests/modeltests/expressions/tests.py
92
7256
from django.core.exceptions import FieldError from django.db.models import F from django.test import TestCase from models import Company, Employee class ExpressionsTests(TestCase): def test_filter(self): Company.objects.create( name="Example Inc.", num_employees=2300, num_chairs=5, ...
gpl-3.0
7,817,955,045,821,819,000
32.284404
94
0.467751
false
franklingu/leetcode-solutions
questions/powerful-integers/Solution.py
1
1157
""" Given three integers x, y, and bound, return a list of all the powerful integers that have a value less than or equal to bound. An integer is powerful if it can be represented as xi + yj for some integers i >= 0 and j >= 0. You may return the answer in any order. In your answer, each value should occur at most onc...
mit
-8,213,286,438,694,132,000
20.018182
127
0.47619
false
henrykironde/deletedret
retriever/__main__.py
1
10187
"""Data Retriever This module handles the CLI for the Data retriever. """ import os import sys from retriever.engines import engine_list, choose_engine from retriever.lib.datasets import datasets, dataset_names, license from retriever.lib.defaults import sample_script, CITATION, SCRIPT_SEARCH_PATHS, LICENSE from retr...
mit
4,220,264,660,636,059,600
38.94902
108
0.491607
false
xzturn/tensorflow
tensorflow/lite/testing/op_tests/elementwise.py
7
2848
# Copyright 2019 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
-5,902,327,329,389,389,000
33.313253
80
0.670295
false
ndemir/scrapy
scrapy/contrib_exp/iterators.py
25
1383
from scrapy.http import Response from scrapy.selector import XmlXPathSelector def xmliter_lxml(obj, nodename, namespace=None): from lxml import etree reader = _StreamReader(obj) tag = '{%s}%s' % (namespace, nodename) if namespace else nodename iterable = etree.iterparse(reader, tag=tag, encoding=reade...
bsd-3-clause
-4,724,680,457,896,197,000
31.928571
81
0.606652
false
kjc88/sl4a
python/src/Demo/tkinter/guido/mbox.py
43
7478
#! /usr/bin/env python # Scan MH folder, display results in window import os import sys import re import getopt import string import mhlib from Tkinter import * from dialog import dialog mailbox = os.environ['HOME'] + '/Mail' def main(): global root, tk, top, mid, bot global folderbox, foldermenu, scanbox...
apache-2.0
-3,265,089,308,987,797,000
25.238596
74
0.567264
false
wwjiang007/flink
flink-python/pyflink/__init__.py
9
1969
################################################################################ # 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
5,074,365,070,938,166,000
36.865385
88
0.622651
false
wooga/airflow
airflow/contrib/operators/azure_cosmos_operator.py
5
1212
# # 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,149,111,524,280,959,000
42.285714
110
0.780528
false
thegodone/pyms
Deconvolution/BillerBiemann/Function.py
7
11308
""" BillerBiemann deconvolution algorithm Provides a class to perform Biller and Biemann deconvolution """ ############################################################################# # # # PyMS software for processing of metabolomic mass...
gpl-2.0
-7,241,045,248,024,179,000
31.96793
80
0.578971
false
edeposit/marcxml_parser
src/marcxml_parser/tools/resorted.py
1
1135
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Interpreter version: python 2.7 # # Imports ===================================================================== # Functions & classes ========================================================= def resorted(values): """ Sort values, but put numbers after alph...
mit
-5,493,531,104,246,858,000
23.148936
79
0.506608
false
ttm/oscEmRede
venv/lib/python2.7/site-packages/networkx/readwrite/adjlist.py
28
8490
# -*- coding: utf-8 -*- """ ************** Adjacency List ************** Read and write NetworkX graphs as adjacency lists. Adjacency list format is useful for graphs without data associated with nodes or edges and for nodes that can be meaningfully represented as strings. Format ------ The adjacency list format cons...
gpl-3.0
-3,221,138,793,373,243,000
26.031847
76
0.578935
false
suitai/MyTweetApp
bin/tweet-download-media.py
1
1697
#!/usr/bin/env python # -*- coding:utf-8 -*- import sys import getopt import cuitweet import download ### Functions def check_optlist(optlist): option = {} option_keys = { "-c": "count", "-s": "since_id", "-m": "max_id", "-o": "out_dir", "-k": "key_...
mit
4,680,785,438,082,030,000
27.283333
93
0.542133
false