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
aquemy/HCBR
data/process_audiology.py
1
2309
import csv import os import sys def feature_to_index(cases, column_nb, offset=0): feature_set = set() for case in cases: feature_set.add(case[column_nb]) l = list(feature_set) index = {} i = 0 for f in l: if f != '': index[f] = i + offset i += 1 retur...
mit
4,552,662,785,093,896,000
26.176471
118
0.543525
false
psiwczak/openstack
nova/tests/rpc/test_qpid.py
1
13965
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2012, Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
4,080,920,901,437,090,000
40.316568
79
0.576083
false
tonybenny2004/or-tools
examples/python/send_most_money.py
34
3489
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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 ...
apache-2.0
3,532,085,075,948,093,400
27.365854
74
0.656062
false
renyi533/tensorflow
tensorflow/lite/testing/op_tests/resolve_constant_strided_slice.py
11
2039
# 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
1,413,380,974,479,435,800
38.980392
80
0.687592
false
RAtechntukan/CouchPotatoServer
libs/unrar2/windows.py
54
10914
# Copyright (c) 2003-2005 Jimmy Retzlaff, 2008 Konstantin Yegupov # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy...
gpl-3.0
-3,787,577,499,002,732,000
33.757962
172
0.615723
false
nafitzgerald/allennlp
tests/data/dataset_readers/language_modeling_dataset_test.py
1
1666
# pylint: disable=no-self-use,invalid-name from allennlp.data.dataset_readers import LanguageModelingReader from allennlp.common.testing import AllenNlpTestCase class TestLanguageModelingDatasetReader(AllenNlpTestCase): def test_read_from_file(self): reader = LanguageModelingReader(tokens_per_instance=3) ...
apache-2.0
8,587,836,367,144,935,000
56.448276
114
0.64886
false
bhargav2408/kivy
kivy/storage/dictstore.py
43
2284
''' Dictionary store ================= Use a Python dictionary as a store. ''' __all__ = ('DictStore', ) try: import cPickle as pickle except ImportError: import pickle from os.path import exists from kivy.compat import iteritems from kivy.storage import AbstractStore class DictStore(AbstractStore): '...
mit
4,555,821,813,723,845,600
24.662921
74
0.544658
false
mancoast/CPythonPyc_test
cpython/253_test_asynchat.py
19
2391
# test asynchat -- requires threading import thread # If this fails, we can't test this module import asyncore, asynchat, socket, threading, time import unittest from test import test_support HOST = "127.0.0.1" PORT = 54322 class echo_server(threading.Thread): def run(self): sock = socket.socket(socket....
gpl-3.0
5,670,115,013,137,137,000
24.709677
66
0.578001
false
Slach/Diamond
src/collectors/squid/test/testsquid.py
31
6954
#!/usr/bin/python # coding=utf-8 ########################################################################## from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch from diamond.collector import Collector from squid import SquidCol...
mit
-595,809,820,373,499,900
34.845361
76
0.504602
false
sxjscience/mxnet
benchmark/opperf/utils/common_utils.py
11
5369
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
-775,430,578,229,791,000
32.767296
120
0.61315
false
openstack/trove
trove/guestagent/models.py
1
3048
# Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
8,454,399,229,808,631,000
32.494505
78
0.656496
false
lmazuel/azure-sdk-for-python
azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/tracked_resource.py
2
1808
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-8,186,692,194,587,403,000
33.113208
78
0.57135
false
TheWardoctor/Wardoctors-repo
plugin.video.salts/scrapers/movieblast_scraper.py
7
4156
""" SALTS XBMC Addon Copyright (C) 2014 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. T...
apache-2.0
-8,555,988,969,447,919,000
42.291667
170
0.612849
false
nagyistoce/nips14-ssl
learn_yz_x_ss.py
4
12614
import sys import os, numpy as np import scipy.stats import anglepy.paramgraphics as paramgraphics import anglepy.ndict as ndict from anglepy.sfo import SFO from adam import AdaM import theano import theano.tensor as T import preprocessing as pp import time def main(n_passes, n_labeled, n_z, n_hidden, dataset, se...
mit
-2,804,854,358,435,884,500
38.917722
216
0.543365
false
letouriste001/SmartForest_2.0
python3.4Smartforest/lib/python3.4/site-packages/django/utils/functional.py
1
14569
import copy import operator from functools import total_ordering, wraps from django.utils import six # You can't trivially replace this with `functools.partial` because this binds # to classes and returns bound instances, whereas functools.partial (on # CPython) is a type and its instances don't bind. def curry(_cur...
mit
-2,134,086,999,665,588,000
34.276029
92
0.579175
false
sephiroth6/nodeshot
nodeshot/core/layers/views.py
3
4580
from django.http import Http404 from django.utils.translation import ugettext_lazy as _ from rest_framework import generics, permissions, authentication from rest_framework.response import Response from nodeshot.core.base.utils import Hider from nodeshot.core.nodes.views import NodeList from nodeshot.core.nodes.seria...
gpl-3.0
-6,957,845,717,749,241,000
30.369863
97
0.700437
false
Sumith1896/sympy
sympy/combinatorics/tests/test_tensor_can.py
96
24791
from sympy.core.compatibility import range from sympy.combinatorics.permutations import Permutation, Perm from sympy.combinatorics.tensor_can import (perm_af_direct_product, dummy_sgs, riemann_bsgs, get_symmetric_group_sgs, canonicalize, bsgs_direct_product) from sympy.combinatorics.testutil import canonicalize_nai...
bsd-3-clause
4,903,138,451,708,447,000
42.955674
278
0.52035
false
klmitch/keystone
keystone/policy/backends/rules.py
3
2734
# Copyright (c) 2011 OpenStack, LLC. # 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 requi...
apache-2.0
-2,786,660,870,483,186,000
28.717391
78
0.678493
false
Percona-QA/package-testing
molecule/psmdb40-install/molecule/default/tests/test_psmdb40_install.py
1
4946
import os import pytest import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') DEB_PACKAGES = ['percona-server-mongodb', 'percona-server-mongodb-server', 'percona-server-mongodb-mongos', 'percon...
gpl-2.0
2,460,827,243,178,622,000
33.830986
117
0.664982
false
djpine/pyman
Book/chap8/Supporting Materials/FitOscDecay.py
3
2239
import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec # for unequal plot boxes import scipy.optimize # define function to calculate reduced chi-squared def RedChiSqr(func, x, y, dy, params): resids = y - func(x, *params) chisq = ((resids/dy)**2).sum() return chisq/float...
cc0-1.0
-4,827,395,123,857,624,000
30.985714
109
0.652077
false
FDewaleyne/rhns-utils
db-tools/rhns-package-infos.py
1
3424
#!/usr/bin/python # script aimed at running a couple sql commands against satellite 5.6 to fetch info for a package we have ID from __author__ = "Felix Dewaleyne" __credits__ = ["Felix Dewaleyne"] __license__ = "GPL" __version__ = "0.3" __maintainer__ = "Felix Dewaleyne" __email__ = "fdewaley@redhat.com" __status__ = ...
gpl-2.0
-3,109,453,926,577,234,000
37.47191
175
0.622371
false
ChristopherRabotin/bungiesearch
bungiesearch/fields.py
2
6140
from django.template import Context, loader from django.template.defaultfilters import striptags from six import iteritems from elasticsearch_dsl.analysis import Analyzer class AbstractField(object): ''' Represents an elasticsearch index field and values from given objects. Currently does not support bin...
bsd-3-clause
185,962,642,136,293,570
36.212121
201
0.605537
false
tsauerwein/c2cgeoportal
c2cgeoportal/scaffolds/update/CONST_alembic/versions/20137477bd02_update_icons_url.py
2
3713
# -*- coding: utf-8 -*- # Copyright (c) 2011-2014, Camptocamp SA # 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 #...
bsd-2-clause
-558,641,575,320,640,640
39.358696
85
0.640991
false
notfoundsam/raspberry
app/__init__.py
1
15732
import os, functools, json, logging from flask import Flask, redirect, session, request, g, jsonify, make_response, abort, send_from_directory from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager, login_user, logout_user, current_user, login_required from flask_socketio import SocketIO, emit fro...
unlicense
-6,534,579,340,163,614,000
28.627119
289
0.624142
false
martyone/sailfish-qtcreator
scripts/packageIfw.py
6
5571
#!/usr/bin/env python ################################################################################ # Copyright (C) 2015 The Qt Company Ltd # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # ...
lgpl-2.1
-3,399,315,499,870,055,400
38.792857
179
0.630228
false
rgs1/zktraffic
zktraffic/endpoints/stats_server.py
2
3534
# ================================================================================================== # Copyright 2014 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
6,366,073,485,425,913,000
30.553571
100
0.614035
false
QingChenmsft/azure-cli
src/command_modules/azure-cli-extension/azure/cli/command_modules/extension/tests/test_extension_commands.py
3
2972
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mit
-2,684,690,568,069,361,000
34.807229
103
0.610363
false
RedhawkSDR/integration-gnuhawk
components/vector_to_streams_bb_1o/tests/test_vector_to_streams_bb_1o.py
1
4089
#!/usr/bin/env python # # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of GNUHAWK. # # GNUHAWK is free software: you can redistribute it and/or modify is under the # terms of the GNU General Public License as published by ...
gpl-3.0
7,337,619,982,029,532,000
47.105882
133
0.593055
false
codedude/pySequence
src/Referentiel.py
1
81736
#!/usr/bin/env python # -*- coding: utf-8 -*- ##This file is part of pySequence ############################################################################# ############################################################################# ## ## ## ...
gpl-3.0
-7,552,781,065,959,422,000
36.609036
138
0.403817
false
stfc/cvmfs-stratum-uploader
uploader/packages/tests.py
1
1390
import os import uuid import shutil from django.utils.unittest import TestCase from uploader.projects.models import FileSystem, Project from uploader.packages.models import Package from uploader import settings class PackageTestCase(TestCase): def setUp(self): uid = str(uuid.uuid4())[0:8] self.fs ...
apache-2.0
-1,488,561,087,601,985,300
27.387755
85
0.63741
false
Daksh/sugar-toolkit-gtk3
src/sugar3/dispatch/dispatcher.py
10
6905
import weakref try: set except NameError: from sets import Set as set # Python 2.3 fallback from sugar3.dispatch import saferef WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref) def _make_id(target): if hasattr(target, 'im_func'): return (id(target.im_self), id(target.im_func)...
lgpl-2.1
-2,754,231,332,817,313,000
34.050761
77
0.597683
false
andyh616/mne-python
mne/io/compensator.py
21
5199
import numpy as np from .constants import FIFF def get_current_comp(info): """Get the current compensation in effect in the data """ comp = None first_comp = -1 for k, chan in enumerate(info['chs']): if chan['kind'] == FIFF.FIFFV_MEG_CH: comp = int(chan['coil_type']) >> 16 ...
bsd-3-clause
-3,155,455,671,426,067,500
31.49375
79
0.523562
false
adereis/avocado
avocado/utils/process.py
1
41941
# 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 distributed in the hope that it will be useful, # bu...
gpl-2.0
-5,677,319,964,287,682,000
35.249784
92
0.559548
false
Mr-Linus/geekcloud
jumpserver/settings.py
3
5025
""" Django settings for jumpserver project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)...
gpl-2.0
-8,093,519,214,317,810,000
27.551136
117
0.663682
false
RobinCPC/algorithm-practice
IntegerArray/searchRange.py
1
1030
""" #: 34 Title: Search Range Description: ------ Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the order of O(log n). If the target is not found in the array, return `[-1, -1]`. For example, Given `[5, 7, 7, 8, 8, 10]`...
mit
-3,248,157,489,963,977,700
21.888889
96
0.562136
false
erikr/django
tests/queries/models.py
15
17755
""" Various complex queries that have been problematic in the past. """ from __future__ import unicode_literals import threading from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible class DumbCategory(models.Model): pass class ProxyCategory(Du...
bsd-3-clause
-8,513,429,399,777,632,000
23.02571
103
0.689271
false
ravwojdyla/incubator-beam
sdks/python/apache_beam/examples/cookbook/bigshuffle.py
10
3561
# # 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 us...
apache-2.0
-2,634,683,038,395,595,000
36.882979
78
0.664701
false
Samnsparky/cdibase
prog_code/util/report_util_test.py
1
9480
"""Tests for utility functions used in generating CSV downloads. Copyright (C) 2014 A. Samuel Pottinger ("Sam Pottinger", gleap.org) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 ...
gpl-3.0
2,576,852,700,520,960,000
37.225806
104
0.51962
false
klahnakoski/JsonSchemaToMarkdown
vendor/jx_python/expression_compiler.py
3
1448
# encoding: utf-8 # # # 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/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import from __f...
mpl-2.0
816,323,967,807,150,700
22.354839
89
0.627072
false
natanielruiz/android-yolo
jni-build/jni/include/tensorflow/contrib/learn/python/learn/tests/dataframe/reader_source_test.py
19
3162
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
821,125,180,497,613,000
37.096386
85
0.629349
false
nozuono/calibre-webserver
src/calibre/gui2/tweak_book/spell.py
2
53002
#!/usr/bin/env python # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>' import cPickle, os, sys from collections import defaultdict, OrderedDict from...
gpl-3.0
1,952,062,430,409,724,200
39.365575
123
0.598528
false
peercoin/peercoin
test/functional/p2p_leak.py
3
5513
#!/usr/bin/env python3 # Copyright (c) 2017-2019 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 message sending before handshake completion. A node should never send anything other than VERSION...
mit
-7,404,786,810,299,223,000
40.765152
127
0.699982
false
sounay/flaminggo-test
onadata/apps/logger/migrations/0038_auto__del_field_instance_is_deleted.py
13
12143
# -*- coding: 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): # Deleting field 'Instance.is_deleted' db.delete_column(u'odk_logger_instance', 'is_deleted') def back...
bsd-2-clause
-6,523,173,707,022,303,000
75.85443
187
0.548546
false
fffonion/you-get
src/you_get/extractors/songtaste.py
20
1473
#!/usr/bin/env python __all__ = ['songtaste_download'] from ..common import * import urllib.error def songtaste_download(url, output_dir = '.', merge = True, info_only = False): if re.match(r'http://www.songtaste.com/song/\d+', url): old_fake_headers = fake_headers id = r1(r'http://www.songtaste....
mit
-19,731,022,208,494,020
33.255814
109
0.521385
false
famz/patchew
tests/test_mbox.py
1
1637
#!/usr/bin/env python3 # # Copyright 2017 Red Hat, Inc. # # Authors: # Fam Zheng <famz@redhat.com> # # This work is licensed under the MIT License. Please see the LICENSE file or # http://opensource.org/licenses/MIT. import os import sys import mbox sys.path.append(os.path.dirname(__file__)) from patchewtest impo...
mit
-7,637,856,859,237,374,000
28.214286
78
0.627139
false
EarthSystemCoG/COG
cog/views/utils.py
2
8411
from django.shortcuts import render from django.db.models import Q from django.template import RequestContext from django.contrib.auth.models import User import datetime from cog.models import UserProfile, Project from cog.utils import getJson, str2bool from cog.models.peer_site import getPeerSites from django.contrib....
bsd-3-clause
-1,279,384,678,244,559,400
38.674528
113
0.562597
false
jj0hns0n/geonode
geonode/groups/admin.py
5
1470
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 ...
gpl-3.0
-7,623,183,077,955,132,000
29.625
73
0.656463
false
tanzquotient/tq_website
groups/services/update_groups.py
2
1088
import logging from django.contrib.auth.models import Group from courses.models import UserProfile from ..definitions import GroupDefinitions log = logging.getLogger('update_groups') def update_groups(queryset=None): log.info("Updating groups") # All groups if queryset is None: for group_defi...
gpl-2.0
-1,408,957,220,435,228,700
27.631579
100
0.659007
false
JioCloud/horizon
openstack_dashboard/test/integration_tests/tests/test_user_settings.py
14
2337
# 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
-8,152,542,669,743,697,000
43.09434
78
0.643988
false
lino-framework/lino
lino/modlib/publisher/mixins.py
1
2653
# -*- coding: UTF-8 -*- # Copyright 2020 Rumma & Ko Ltd # License: GNU Affero General Public License v3 (see file COPYING for details) from lino.api import dd, rt, _ from django import http from django.conf import settings from django.utils.translation import get_language from lino.modlib.printing.mixins import Print...
bsd-2-clause
-1,319,844,503,397,587,500
33.012821
80
0.6536
false
betterlife/flask-psi
psi/app/views/components/image_field.py
2
2447
from wtforms import StringField class ImageInput(object): """ Image upload controller, supports 1. Multiple file upload one time 2. Preview existing image files on server. 3. Preview to be uploaded image files on the fly before uploading. Template file components/image_field.html is needed for...
mit
-6,832,428,777,246,576,000
37.234375
105
0.6085
false
asyncee/python-obscene-words-filter
obscene_words_filter/words_filter.py
1
1150
# coding: utf-8 from __future__ import unicode_literals import re from functools import partial class ObsceneWordsFilter(object): def __init__(self, bad_regexp, good_regexp): self.bad_regexp = bad_regexp self.good_regexp = good_regexp def find_bad_word_matches(self, text): return se...
mit
351,474,502,604,419,460
28.487179
73
0.623478
false
labordoc/labordoc-next
modules/docextract/lib/refextract_config.py
7
5828
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## ...
gpl-2.0
3,909,561,055,325,194,000
49.241379
96
0.687886
false
imatge-upc/saliency-salgan-2017
scripts/utils.py
1
1858
import os import numpy as np import cv2 import theano import lasagne from constants import HOME_DIR def chunks(l, n): """Yield successive n-sized chunks from l.""" for i in xrange(0, len(l), n): yield l[i:i + n] def load_weights(net, path, epochtoload): """ Load a pretrained model :param...
mit
1,986,471,042,272,540,400
33.407407
121
0.668999
false
eNuvol/s3cmd
S3/AccessLog.py
15
2970
## Amazon S3 - Access Control List representation ## Author: Michal Ludvig <michal@logix.cz> ## http://www.logix.cz/michal ## License: GPL Version 2 import S3Uri from Exceptions import ParameterError from Utils import getTreeFromXml from ACL import GranteeAnonRead try: import xml.etree.ElementTree as ET e...
gpl-2.0
-1,506,036,610,399,320,600
31.282609
112
0.602694
false
plilja/project-euler
problem_17/test_english_numbers.py
1
4741
import unittest from english_numbers import * class TestEnglishNumbers(unittest.TestCase): def test_digits(self): self.assertEqual('zero', english_number(0)) self.assertEqual('one', english_number(1)) self.assertEqual('two', english_number(2)) self.assertEqual('three', english_num...
apache-2.0
1,017,037,745,907,725,300
46.41
94
0.673698
false
XXLRay/libreshot
build/lib.linux-x86_64-2.7/libreshot/uploads/youtube/gdata/sample_util.py
106
10714
#!/usr/bin/env python # # Copyright (C) 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
gpl-3.0
-2,702,435,142,644,116,500
38.828996
79
0.614523
false
Birion/python-ffdl
pyffdl/sites/tgstory.py
1
3917
import re from typing import Any, Dict, Tuple, Union from sys import exit as sysexit import attr import pendulum # type: ignore from bs4 import BeautifulSoup # type: ignore from bs4.element import Tag # type: ignore from furl import furl # type: ignore from requests import Response from pyffdl.sites.story import ...
mit
1,630,131,043,255,856,000
33.973214
83
0.567016
false
effigies/mne-python
mne/io/meas_info.py
1
35635
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Matti Hamalainen <msh@nmr.mgh.harvard.edu> # Teon Brooks <teon.brooks@gmail.com> # # License: BSD (3-clause) from warnings import warn from copy import deepcopy import os.path as op import numpy as np from scipy import linalg f...
bsd-3-clause
9,196,523,345,549,300,000
34.635
79
0.551761
false
svk/harmless7drl
cursesui.py
1
6727
import curses import sys import time def main( rootwidget, *args, **kwargs ): from harmless7drl import MainLoop rv = None try: cui = CursesInterface( debug=True ) rv = MainLoop( cui ).query( rootwidget, *args, **kwargs ) cui.shutdown() except: handleException() retur...
mit
-5,567,437,666,297,782,000
33.675258
94
0.478371
false
TGAC/earlham-galaxytools
tools/hcluster_sg_parser/hcluster_sg_parser.py
3
1541
""" A simple parser to convert the hcluster_sg output into lists of IDs, one list for each cluster. When a minimum and/or maximum number of cluster elements are specified, the IDs contained in the filtered-out clusters are collected in the "discarded IDS" output dataset. Usage: python hcluster_sg_parser.py [-m <N>] ...
mit
-4,329,951,946,097,758,000
37.525
171
0.53926
false
sarvex/depot-tools
recipes/webrtc.py
17
1117
# Copyright (c) 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 sys import recipe_util # pylint: disable=F0401 # This class doesn't need an __init__ method, so we disable the warning # pylint: disable=W0232...
bsd-3-clause
-1,632,004,421,401,554,400
21.34
72
0.585497
false
boooka/GeoPowerOff
venv/lib/python2.7/site-packages/test/tools_control.py
1
1076
# coding: utf-8 from unittest import TestCase import time from grab.tools.control import sleep, repeat class ControlToolsTestCase(TestCase): def test_sleep(self): now = time.time() sleep(0.9, 1.1) self.assertTrue(1.2 > (time.time() - now) > 0.8) now = time.time() sleep(0, ...
apache-2.0
5,076,641,471,661,331,000
25.9
87
0.539033
false
jphnoel/udata
udata/harvest/backends/ckan.py
1
8735
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import logging from uuid import UUID from urlparse import urljoin from voluptuous import ( Schema, All, Any, Lower, Coerce, DefaultTo ) from udata.models import db, Resource, License, SpatialCoverage from udata.utils import get_by, dat...
agpl-3.0
8,610,673,050,826,417,000
33.662698
77
0.569891
false
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/others/temboo/Library/SunlightLabs/Congress/Legislator/GetByCoordinates.py
4
4696
# -*- coding: utf-8 -*- ############################################################################### # # GetByCoordinates # Returns all legislators that currently represent an area (district or state) that contains a given Geo point. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed un...
apache-2.0
-643,487,047,451,474,600
40.928571
176
0.675681
false
Arcanemagus/SickRage
sickbeard/metadata/helpers.py
1
1508
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: https://sick-rage.github.io # # 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 ...
gpl-3.0
-7,566,578,462,335,683,000
31.782609
119
0.714854
false
PuchatekwSzortach/face_detection
face/geometry.py
1
3679
""" Module with geometry related functions, mostly relating to bounding boxes processing """ import shapely.geometry import shapely.affinity import cv2 def get_bounding_box(left, top, width, height): """ Given left and top coordinates and width and height of a bounding box, return a bounding box instance ...
mit
-6,511,548,540,223,265,000
30.715517
111
0.690949
false
jucacrispim/toxicbuild
tests/webui/__init__.py
1
6900
# -*- coding: utf-8 -*- # package with behave tests import os import time from selenium import webdriver from selenium.common.exceptions import ( NoSuchElementException, StaleElementReferenceException ) from selenium.webdriver.common.action_chains import ActionChains from toxicbuild.core.utils import now, date...
agpl-3.0
-5,694,029,584,247,244,000
28.361702
79
0.580145
false
mlperf/inference_results_v0.7
closed/Cisco/code/bert-99.9/tensorrt/evaluate.py
26
3419
""" Official evaluation script for v1.1 of the SQuAD dataset. """ from __future__ import print_function from collections import Counter import string import re import argparse import json import sys def normalize_answer(s): """Lower text and remove punctuation, articles and extra whitespace.""" def remove_art...
apache-2.0
512,214,946,775,979,700
35.37234
77
0.621819
false
bharadwaj-raju/libdesktop
libdesktop/system.py
1
6802
# coding: utf-8 # This file is part of libdesktop # The MIT License (MIT) # # Copyright (c) 2016 Bharadwaj Raju # # 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, includ...
mit
488,043,641,069,394,800
26.99177
126
0.563805
false
cpyou/odoo
addons/point_of_sale/wizard/pos_session_opening.py
15
5032
from openerp.osv import osv, fields from openerp.tools.translate import _ from openerp.addons.point_of_sale.point_of_sale import pos_session class pos_session_opening(osv.osv_memory): _name = 'pos.session.opening' _columns = { 'pos_config_id' : fields.many2one('pos.config', string='Point of Sale', ...
agpl-3.0
4,784,035,911,628,702,000
42.37931
110
0.545509
false
mach327/chirp_fork
chirp/drivers/vx7.py
2
11036
# Copyright 2010 Dan Smith <dsmith@danplanet.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is ...
gpl-3.0
942,188,671,914,474,500
29.486188
73
0.554639
false
rahulvgmail/TripMapR
TripMapR/travelogue/tests/test_views_travelogue.py
1
3438
from django.test import TestCase from .factories import TravelogueFactory class RequestTravelogueTest(TestCase): urls = 'travelogue.tests.test_urls' def setUp(self): super(RequestTravelogueTest, self).setUp() self.travelogue = TravelogueFactory(slug='test-travelogue') def test_archive_t...
bsd-3-clause
-7,713,778,036,676,238,000
37.2
88
0.645433
false
DarkEnergyScienceCollaboration/ReprocessingTaskForce
scripts/run_mergeCoaddMeasurements.py
2
1557
#!/usr/bin/env python from __future__ import print_function import os import glob import libRun as LR def build_cmd(patch, configFile, input, output) : if not os.path.isdir("scripts"): os.makedirs("scripts") cmd = "mv "+ patch + " scripts" os.system(cmd) cmd = "mergeCoaddMeasurements.py %...
gpl-2.0
4,190,196,103,252,527,000
30.77551
101
0.617213
false
moylop260/stock-logistics-warehouse
__unported__/stock_move_location/__openerp__.py
8
1711
# -*- coding: utf-8 -*- ################################################################################# # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr> # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
-5,584,330,758,636,996,000
32.54902
81
0.568089
false
bowang/tensorflow
tensorflow/contrib/layers/python/layers/__init__.py
18
1796
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
978,811,709,208,615,800
50.314286
80
0.767261
false
SteveMcGrath/pySecurityCenter
examples/sc4/csv_gen/runcsv.py
1
3078
#!/usr/bin/env python # CSV Report Generator # -------------------- # This script is designed to pull vulnerability data from Security Center 4.2 # and format it into a CSV file. While Security Center can already do this, # this script will also break out the Plugin Text field into individial fields # before generatin...
bsd-3-clause
-7,626,626,793,328,045,000
38.461538
80
0.671215
false
swpease/Flavify
flavors/migrations/0001_initial.py
1
1265
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-05-03 21:41 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Ingredie...
mit
8,676,821,688,018,126,000
34.138889
243
0.550198
false
benjaminy/Charcoal
RealAppAnalysis/Browsers/funcdata_to_graphs.py
1
3628
import matplotlib.pyplot as pyplot from csv import DictReader from datautil import findFile, parseCmdLnArgs, _flagged, _flaggedRetArg, log, extract, readCSV import sys from os.path import join def main(argv): opts, args = parseCmdLnArgs(argv,"ho:sdg:", ["help", "outdir=", "show", "debug"]) _handleHel...
mit
8,720,110,406,313,218,000
26.574803
94
0.581748
false
PayloadSecurity/VxAPI
tests/_requests_scenarios/overview/overview_refresh.py
1
1235
scenarios = [ { "url": "/key/current", "method": "get", "status_code": 200, "json": {"api_key": "111", "auth_level": 100, "auth_level_name": "default"}, "headers": { "content-type": "application/json", "webservice-version": "8.10", "api-ver...
gpl-3.0
4,935,258,597,403,407,000
44.740741
337
0.479352
false
google-research/deeplab2
model/layers/convolutions.py
1
24647
# coding=utf-8 # Copyright 2021 The Deeplab2 Authors. # # 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 ...
apache-2.0
-6,441,769,110,858,099,000
36.007508
107
0.664178
false
mbatchkarov/dc_evaluation
eval/pipeline/feature_selectors.py
1
7143
import logging from sklearn.base import BaseEstimator, TransformerMixin from sklearn.feature_selection import SelectKBest, chi2 import numpy as np from sklearn.feature_selection.univariate_selection import _clean_nans from discoutils.thesaurus_loader import Vectors from eval.utils.misc import calculate_log_odds, update...
bsd-3-clause
-3,467,563,906,106,328,000
48.262069
117
0.659387
false
indro/t2c
apps/external_apps/django_extensions/management/modelviz.py
2
8563
#!/usr/bin/env python """Django model to DOT (Graphviz) converter by Antonio Cavedoni <antonio@cavedoni.org> Make sure your DJANGO_SETTINGS_MODULE is set to your project or place this script in the same directory of the project and call the script like this: $ python modelviz.py [-h] [-a] [-d] [-g] [-i <model_names>]...
mit
1,218,517,478,839,711,700
29.47331
106
0.548523
false
mytliulei/DCNRobotInstallPackages
windows/win32/pygal-1.7.0/pygal_gen.py
4
2328
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of pygal # # A python svg graph plotting library # Copyright © 2012-2014 Kozea # # This library is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foun...
apache-2.0
6,623,995,898,823,301,000
33.731343
79
0.641599
false
gandreello/openthread
tests/scripts/thread-cert/Cert_9_2_08_PersistentDatasets.py
3
7902
#!/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
2,855,262,090,080,147,500
39.111675
116
0.65553
false
ganeti-github-testing/ganeti-test-1
lib/client/gnt_storage.py
10
6269
# # # Copyright (C) 2012 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and ...
bsd-2-clause
4,203,276,629,836,977,700
29.580488
78
0.652736
false
InfinitiveOS/external_skia
platform_tools/android/tests/gyp_to_android_tests.py
68
1434
#!/usr/bin/python # Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Test gyp_to_android.py """ import os import shutil import sys import tempfile import test_variables import unittest # Path to gyp_to_android sys.path.append(test...
bsd-3-clause
539,606,457,793,804,900
24.607143
72
0.671548
false
sorenk/ansible
lib/ansible/modules/storage/netapp/netapp_e_volume_copy.py
14
16472
#!/usr/bin/python # (c) 2016, NetApp, 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', 'status': ['preview'], ...
gpl-3.0
5,547,773,659,108,487,000
40.18
145
0.580561
false
franosincic/edx-platform
cms/djangoapps/contentstore/tests/test_contentstore.py
15
93797
# -*- coding: utf-8 -*- import copy import mock from mock import patch import shutil import lxml.html from lxml import etree import ddt from datetime import timedelta from fs.osfs import OSFS from json import loads from path import Path as path from textwrap import dedent from uuid import uuid4 from functools import ...
agpl-3.0
-166,267,854,494,191,520
42.28024
190
0.645101
false
SUSE/azure-storage-python
tests/test_table_batch.py
3
21414
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apa...
apache-2.0
-2,093,046,100,258,508,000
35.664384
118
0.599664
false
TomTranter/OpenPNM
openpnm/io/MAT.py
1
3499
import scipy.io as spio from flatdict import FlatDict from openpnm.io import GenericIO, Dict from openpnm.utils import sanitize_dict, logging, Workspace logger = logging.getLogger(__name__) ws = Workspace() class MAT(GenericIO): r""" MAT files are a format used by Matlab Notes ----- The 'mat' fil...
mit
1,862,196,102,815,398,400
32.32381
79
0.570163
false
ImageEngine/gaffer
python/GafferImageTest/ResizeTest.py
5
11709
########################################################################## # # Copyright (c) 2015, 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
-3,489,131,475,276,243,000
36.770968
125
0.668631
false
Edraak/edraak-platform
openedx/core/djangoapps/theming/storage.py
11
13777
""" Comprehensive Theming support for Django's collectstatic functionality. See https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/ """ import os.path import posixpath import re from django.conf import settings from django.contrib.staticfiles.finders import find from django.contrib.staticfiles.storage impor...
agpl-3.0
-9,073,491,955,328,966,000
42.053125
120
0.628221
false
ijstokes/sql-analysis-with-django-orm
datasnoop/employees/admin_filter.py
1
1857
from django.contrib import admin # Register your models here. from datasnoop.employees.models import Departments, DeptEmp, DeptManager, Employees, Salaries, Titles #for cls in (Departments, DeptEmp, DeptManager, Employees, Salaries, Titles): # admin.site.register(cls) class DepartmentsAdmin(admin.ModelAdmin): ...
bsd-3-clause
2,275,079,886,573,565,200
38.510638
101
0.686053
false
vauxoo-dev/stock-logistics-warehouse
stock_inventory_preparation_filter/models/stock_inventory.py
10
5857
# -*- encoding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the...
agpl-3.0
4,326,832,313,444,453,400
43.037594
79
0.569746
false
kiddinn/plaso
tests/parsers/sqlite_plugins/twitter_android.py
3
3470
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for Twitter on Android plugin.""" import unittest from plaso.lib import definitions from plaso.parsers.sqlite_plugins import twitter_android from tests.parsers.sqlite_plugins import test_lib class TwitterAndroidTest(test_lib.SQLitePluginTestCase): """Tests ...
apache-2.0
-1,690,875,949,172,419,800
34.773196
80
0.645533
false
duhzecca/cinder
cinder/tests/unit/api/contrib/test_types_extra_specs.py
20
11529
# Copyright (c) 2011 Zadara Storage Inc. # Copyright (c) 2011 OpenStack Foundation # Copyright 2011 University of Southern California # 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 ...
apache-2.0
-7,949,947,533,359,578,000
37.43
78
0.610634
false
chatelak/RMG-Py
rmgpy/data/thermo.py
2
61952
#!/usr/bin/python # -*- coding: utf-8 -*- ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the # RMG Team (rmg_dev@mit.edu) # # Permission is hereby granted, free of c...
mit
3,841,461,204,941,031,400
46.076748
195
0.581886
false
TheMOOCAgency/edx-platform
openedx/core/djangoapps/cors_csrf/tests/test_views.py
16
2390
"""Tests for cross-domain request views. """ import ddt import json from django.test import TestCase from django.core.urlresolvers import reverse, NoReverseMatch from config_models.models import cache from ..models import XDomainProxyConfiguration @ddt.ddt class XDomainProxyTest(TestCase): """Tests for the xd...
agpl-3.0
6,803,070,102,987,931,000
31.739726
87
0.625941
false
kingvuplus/ee
lib/python/Screens/SoftwareUpdate.py
4
13104
from Screens.ChoiceBox import ChoiceBox from Screens.MessageBox import MessageBox from Screens.ParentalControlSetup import ProtectedScreen from Screens.Screen import Screen from Screens.Standby import TryQuitMainloop from Screens.TextBox import TextBox #from Screens.About import CommitInfo from Components.config import...
gpl-2.0
-1,112,558,620,414,389,900
40.732484
525
0.715583
false