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
Acehaidrey/incubator-airflow
airflow/migrations/versions/1507a7289a2f_create_is_encrypted.py
8
2164
# # 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
761,006,620,763,616,100
33.903226
105
0.729667
false
JCBarahona/edX
common/djangoapps/student/helpers.py
9
10576
"""Helpers for the student app. """ from datetime import datetime import urllib from pytz import UTC from django.core.urlresolvers import reverse, NoReverseMatch import third_party_auth from verify_student.models import VerificationDeadline, SoftwareSecurePhotoVerification # pylint: disable=import-error from course_...
agpl-3.0
-9,220,555,660,969,416,000
44.586207
119
0.656203
false
ric2b/Vivaldi-browser
chromium/build/toolchain/win/tool_wrapper.py
1
8967
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions for Windows builds. This file is copied to the build directory as part of toolchain setup and is used to set up calls to tools used...
bsd-3-clause
-5,499,808,972,816,153,000
36.995763
80
0.6515
false
acenario/Payable
lib/python2.7/site-packages/django/template/engine.py
38
10794
import warnings from django.core.exceptions import ImproperlyConfigured from django.utils import lru_cache, six from django.utils.deprecation import RemovedInDjango110Warning from django.utils.functional import cached_property from django.utils.module_loading import import_string from .base import Context, Lexer, Par...
mit
2,153,381,243,266,280,200
39.126394
79
0.606448
false
tadeegan/eiger-application-aware
test/system/test_thrift_server.py
3
101018
# 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
3,436,283,627,131,109,000
50.35638
623
0.621414
false
brainstorm/python_koans
python3/koans/about_iteration.py
8
4399
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutIteration(Koan): def test_iterators_are_a_type(self): it = iter(range(1,6)) fib = 0 for num in it: fib += num self.assertEqual(__ , fib) def test_iter...
mit
8,868,223,150,466,946,000
29.337931
84
0.493294
false
CriticalD20/Final-Project
ggame/headlessdeps.py
228
9672
def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: return True if module_exists('PIL'): from PIL import Image class _body(object): def __init__(self): self.events = {} def appendChild(self, obj): self...
mit
19,355,924,348,117,150
21.811321
161
0.567204
false
laurentgo/pants
src/python/pants/backend/codegen/register.py
9
2481
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.c...
apache-2.0
9,080,289,010,000,181,000
46.711538
99
0.775091
false
hajgato/easybuild-easyblocks
easybuild/easyblocks/s/suitesparse.py
4
7013
## # Copyright 2009-2013 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
gpl-2.0
2,263,510,020,006,973,000
38.621469
121
0.553543
false
AmurG/tardis
tardis/simulation.py
11
2036
import logging import time from pandas import HDFStore import os # Adding logging support logger = logging.getLogger(__name__) def run_radial1d(radial1d_model, history_fname=None): if history_fname: if os.path.exists(history_fname): logger.warn('History file %s exists - it will be overwritten...
bsd-3-clause
8,237,934,514,099,977,000
34.103448
133
0.694499
false
detrout/debian-statsmodels
statsmodels/stats/tabledist.py
34
11643
# -*- coding: utf-8 -*- """ Created on Sat Oct 01 20:20:16 2011 Author: Josef Perktold License: BSD-3 TODO: check orientation, size and alpha should be increasing for interp1d, but what is alpha? can be either sf or cdf probability change it to use one consistent notation check: instead of bound checking I could us...
bsd-3-clause
8,863,982,460,301,678,000
35.384375
222
0.542042
false
ConeyLiu/spark
examples/src/main/python/ml/power_iteration_clustering_example.py
54
1604
# # 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
-5,044,319,384,614,019,000
31.734694
90
0.694514
false
littlepea/django-docs
docs/tests/runtests.py
1
1998
#!/usr/bin/env python """ This script is a trick to setup a fake Django environment, since this reusable app will be developed and tested outside any specific Django project. Via ``settings.configure`` you will be able to set all necessary settings for your app and run the tests as if you were calling ``./manage.py te...
bsd-3-clause
2,247,700,670,860,673,500
26.75
89
0.649149
false
fone4u/python-oauth2
tests/test_oauth.py
301
53269
# -*- coding: utf-8 -*- """ The MIT License Copyright (c) 2009 Vic Fryzel 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, co...
mit
-7,663,618,451,523,635,000
39.68984
345
0.623848
false
CosmicFish/CosmicFish
bundled/doxygen/testing/testsqlite3.py
27
3977
#! /usr/bin/python from xml.etree import cElementTree as ET import os import sqlite3 import sys import getopt # map XML attributes/elements to SQL rows # --POC: iterate through the children and attributes of the memberdef elelement # and search it in doxygen_sqlite3.db g_conn=None val=[] def print_unprocessed_...
gpl-3.0
5,021,940,119,359,037,000
26.239726
83
0.580588
false
OpenFacetracker/facetracker-core
lib/youtube-dl/youtube_dl/extractor/fourtube.py
39
3885
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_request, ) from ..utils import ( parse_duration, parse_iso8601, str_to_int, ) class FourTubeIE(InfoExtractor): IE_NAME = '4tube' _VALID_URL = r'https?://(?:www\.)?4tube\.c...
gpl-2.0
-7,221,526,289,495,031,000
35.308411
106
0.521236
false
aboutsajjad/Bridge
app_packages/youtube_dl/extractor/streetvoice.py
60
1615
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str from ..utils import unified_strdate class StreetVoiceIE(InfoExtractor): _VALID_URL = r'https?://(?:.+?\.)?streetvoice\.com/[^/]+/songs/(?P<id>[0-9]+)' _TESTS = [{ 'url': 'http://s...
mit
3,681,202,117,461,243,400
31.632653
90
0.509694
false
txemi/ansible
lib/ansible/modules/network/panos/panos_address.py
78
6066
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.com> # # 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 publish...
gpl-3.0
-4,013,644,965,740,481,500
27.083333
94
0.614573
false
veloutin/papas
lib6ko/tests/mocks/interactive_console.py
1
2406
# PAPAS Access Point Administration System # Copyright (c) 2010 Revolution Linux inc. <info@revolutionlinux.com> # # 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
8,644,686,759,651,102,000
26.340909
74
0.613882
false
konstruktoid/ansible-upstream
lib/ansible/module_utils/network/junos/junos.py
19
13610
# # (c) 2017 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 # (at your option) any later version. # # Ansible is ...
gpl-3.0
-4,763,414,703,028,277,000
32.604938
130
0.578178
false
home-assistant/home-assistant
homeassistant/components/smappee/sensor.py
2
12427
"""Support for monitoring a Smappee energy sensor.""" from homeassistant.components.sensor import SensorEntity from homeassistant.const import DEVICE_CLASS_POWER, ENERGY_WATT_HOUR, POWER_WATT, VOLT from .const import DOMAIN TREND_SENSORS = { "total_power": [ "Total consumption - Active power", Non...
apache-2.0
6,418,672,370,187,563,000
32.050532
87
0.501811
false
j-mracek/ci-dnf-stack
dnf-docker-test/features/steps/gpg_steps.py
2
4886
from __future__ import absolute_import from __future__ import unicode_literals import jinja2 from whichcraft import which from behave import given from command_steps import step_i_successfully_run_command import table_utils GPGKEY_CONF_TMPL = """ %no-protection %transient-key Key-Type: {{ key_type|default("RSA") }}...
gpl-3.0
2,344,471,620,306,567,000
32.465753
125
0.605608
false
shizhai/wprobe
staging_dir/host/lib/scons-2.1.0/SCons/compat/_scons_hashlib.py
21
2524
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # with...
gpl-2.0
5,609,816,593,408,743,000
32.210526
101
0.703645
false
stefanfoulis/django-cms
cms/south_migrations/0001_initial.py
48
30500
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models 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...
bsd-3-clause
6,616,331,201,036,141,000
74.49505
184
0.591803
false
kevlar1818/dotfiles
bspwm/.config/polybar/package_update_checker.py
1
1205
#!/usr/bin/env python import sys from subprocess import run def colorize_text(text, color): return f'%{{F{color}}}{text}%{{F-}}' if __name__ == '__main__': xrdb = run('xrdb -query', shell=True, capture_output=True, text=True, check=True) raw_colors = ( line.replace('*', '').split(':') f...
mit
1,138,485,814,041,129,200
22.627451
85
0.578423
false
djboersma/puppy
mhd_zpad.py
1
7768
#!/usr/bin/env python import SimpleITK as sitk import numpy as np def zpad(img,nzbot=0,nztop=0): """ Return an augmented copy of an image object: the central part is the same as the original, but we add nzbot (nztop) copies of the bottom (top) layer to the bottom (top). """ if type(img) != sit...
gpl-3.0
-5,428,839,327,566,029,000
48.164557
138
0.58535
false
nubark/odoo
addons/mrp/mrp.py
2
73120
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import time from collections import OrderedDict import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv from openerp.tools import DEFAULT_SERVER_DATE_FORMAT from openerp.tools import float_comp...
gpl-3.0
5,254,029,830,879,599,000
53.607916
296
0.602065
false
jabesq/home-assistant
homeassistant/components/file/notify.py
7
1796
"""Support for file notification.""" import logging import os import voluptuous as vol from homeassistant.const import CONF_FILENAME import homeassistant.helpers.config_validation as cv import homeassistant.util.dt as dt_util from homeassistant.components.notify import ( ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_...
apache-2.0
2,733,631,440,896,969,700
32.259259
78
0.641982
false
bsipocz/statsmodels
statsmodels/graphics/tests/test_mosaicplot.py
17
18878
from __future__ import division from statsmodels.compat.python import iterkeys, zip, lrange, iteritems, range from numpy.testing import assert_, assert_raises, dec from numpy.testing import run_module_suite # utilities for the tests from statsmodels.compat.collections import OrderedDict from statsmodels.api import d...
bsd-3-clause
6,946,553,200,555,242,000
42.298165
90
0.560494
false
RJVB/audacity
lib-src/lv2/lv2/waflib/Build.py
265
20971
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,sys,errno,re,shutil try: import cPickle except ImportError: import pickle as cPickle from waflib import Runner,TaskGen,Utils,ConfigSet,Task,Logs,Options,Context,Er...
gpl-2.0
-6,701,819,960,606,762,000
26.666227
115
0.670688
false
aselle/tensorflow
tensorflow/contrib/tensorrt/test/test_tftrt.py
13
9983
# 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
8,616,485,993,979,084,000
33.783972
80
0.654212
false
Ragowit/fireplace
tests/test_tgt.py
2
19665
from utils import * def test_anubarak(): game = prepare_empty_game() anubarak = game.player1.give("AT_036") anubarak.play() game.player1.discard_hand() assert len(game.player1.field) == 1 assert len(game.player1.hand) == 0 anubarak.destroy() assert len(game.player1.field) == 1 assert len(game.player1.hand) =...
agpl-3.0
5,344,247,810,717,893,000
25.828104
71
0.718739
false
mattsch/Sickbeard
cherrypy/tutorial/tut04_complex_site.py
2
2889
""" Tutorial - Multiple objects This tutorial shows you how to create a site structure through multiple possibly nested request handler objects. """ import cherrypy class HomePage: def index(self): return ''' <p>Hi, this is the home page! Check out the other fun stu...
gpl-3.0
3,776,424,224,766,485,500
29.402174
84
0.541018
false
ZHAW-INES/rioxo-uClinux-dist
user/python/python-2.4.4/Lib/xdrlib.py
5
7353
"""Implements (a subset of) Sun XDR -- eXternal Data Representation. See: RFC 1014 """ import struct try: from cStringIO import StringIO as _StringIO except ImportError: from StringIO import StringIO as _StringIO __all__ = ["Error", "Packer", "Unpacker", "ConversionError"] # exceptions class Error(Exceptio...
gpl-2.0
-8,780,110,644,129,253,000
24.8
78
0.521284
false
imsparsh/python-social-auth
social/backends/exacttarget.py
12
3066
""" ExactTarget OAuth support. Support Authentication from IMH using JWT token and pre-shared key. Requires package pyjwt """ from datetime import timedelta, datetime import jwt from social.exceptions import AuthFailed, AuthCanceled from social.backends.oauth import BaseOAuth2 class ExactTargetOAuth2(BaseOAuth2): ...
bsd-3-clause
-6,618,487,774,451,353,000
37.325
79
0.599152
false
Russell-IO/ansible
lib/ansible/modules/cloud/ovirt/ovirt_networks_facts.py
73
3447
#!/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
5,040,724,228,287,098,000
30.336364
142
0.653902
false
camilonova/django-pipeline
pipeline/manifest.py
18
2084
from __future__ import unicode_literals import os from django.contrib.staticfiles.finders import get_finders from pipeline.conf import settings from manifesto import Manifest from pipeline.packager import Packager class PipelineManifest(Manifest): def __init__(self): self.packager = Packager() ...
mit
-5,537,099,026,780,206,000
35.561404
80
0.607006
false
freevo/freevo1
src/plugins/idlebar/cdstatus.py
1
3044
# -*- coding: iso-8859-1 -*- # ----------------------------------------------------------------------- # cdstatus.py - IdleBarplugin for monitoring the cdstatus # ----------------------------------------------------------------------- # $Id$ # # ----------------------------------------------------------------------- # ...
gpl-2.0
8,410,327,112,332,063,000
39.586667
81
0.572602
false
proxysh/Safejumper-for-Desktop
buildlinux/env64/lib/python2.7/site-packages/twisted/internet/iocpreactor/tcp.py
13
19849
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ TCP support for IOCP reactor """ import socket, operator, errno, struct from zope.interface import implementer, classImplements from twisted.internet import interfaces, error, address, main, defer from twisted.internet.protocol import Proto...
gpl-2.0
8,159,723,927,599,959,000
31.592775
83
0.593632
false
rgfernandes/libesedb
setup.py
3
7773
#!/usr/bin/env python # # Script to build and install Python-bindings. # Version: 20150725 import glob import platform import os import shutil import subprocess import sys from distutils import sysconfig from distutils import util from distutils.ccompiler import new_compiler from distutils.command.build_ext import bu...
lgpl-3.0
3,063,948,536,624,565,000
28.003731
91
0.669626
false
himleyb85/django
django/contrib/gis/db/backends/spatialite/operations.py
24
10581
""" SQL functions reference lists: http://www.gaia-gis.it/spatialite-3.0.0-BETA/spatialite-sql-3.0.0.html https://web.archive.org/web/20130407175746/http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.0.0.html http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html """ import re import sys from django.contrib.gis.db....
bsd-3-clause
8,362,909,175,052,995,000
38.04428
102
0.621586
false
mlc0202/vitess
test/queryservice_tests/cache_tests.py
9
11106
from vtdb import dbexceptions from vtdb import field_types import framework import cache_cases1 import cache_cases2 import cases_framework class TestWillNotBeCached(framework.TestCase): def setUp(self): self.env.log.reset() def tearDown(self): self.env.execute("drop table vtocc_nocache") def test_no...
bsd-3-clause
-8,745,042,034,446,636,000
44.330612
122
0.665766
false
jundongl/scikit-feast
skfeature/example/test_SPEC.py
3
1385
import scipy.io from skfeature.function.similarity_based import SPEC from skfeature.utility import unsupervised_evaluation def main(): # load data mat = scipy.io.loadmat('../data/COIL20.mat') X = mat['X'] # data X = X.astype(float) y = mat['Y'] # label y = y[:, 0] # specify the seco...
gpl-2.0
-2,330,790,505,575,653,000
31.232558
112
0.657762
false
playm2mboy/edx-platform
common/test/acceptance/pages/studio/component_editor.py
73
5069
from bok_choy.page_object import PageObject from selenium.webdriver.common.keys import Keys from ..common.utils import click_css from selenium.webdriver.support.ui import Select class BaseComponentEditorView(PageObject): """ A base :class:`.PageObject` for the component and visibility editors. This class...
agpl-3.0
-3,077,454,631,583,364,600
32.793333
122
0.604261
false
basicthinker/Sexain-MemController
gem5-stable/src/mem/slicc/ast/CheckAllocateStatementAST.py
91
2239
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
apache-2.0
-5,894,067,440,828,977,000
46.638298
72
0.752121
false
memtoko/django
docs/conf.py
6
11881
# -*- coding: utf-8 -*- # # Django documentation build configuration file, created by # sphinx-quickstart on Thu Mar 27 09:06:53 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
bsd-3-clause
-8,856,747,297,277,825,000
32.002778
105
0.698174
false
im-infamou5/volatility
volatility/timefmt.py
54
4522
# Volatility # # Authors: # Mike Auty <mike.auty@gmail.com> # # This file is part of Volatility. # # Volatility 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 op...
gpl-2.0
5,139,097,557,819,314,000
35.176
139
0.601504
false
dcroc16/skunk_works
google_appengine/lib/django-1.2/django/core/handlers/modpython.py
71
9160
import os from pprint import pformat from django import http from django.core import signals from django.core.handlers.base import BaseHandler from django.core.urlresolvers import set_script_prefix from django.utils import datastructures from django.utils.encoding import force_unicode, smart_str, iri_to_uri # NOTE: d...
mit
-334,845,048,645,626,500
39.175439
130
0.576092
false
elopio/snapcraft
snapcraft/plugins/jdk.py
13
1395
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
-6,998,529,156,662,512,000
36.702703
75
0.648746
false
pamapa/callblocker
usr/var/www/callblocker/python-fcgi/api.py
1
2252
#!/usr/bin/env python3 # callblocker - blocking unwanted calls from your home phone # Copyright (C) 2015-2020 Patrick Ammann <pammann@gmx.net> # # 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; ...
gpl-2.0
8,056,197,029,257,497,000
36.533333
96
0.706483
false
aimas/TuniErp-8.0
addons/account_followup/__init__.py
436
1098
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-5,878,300,791,559,717,000
41.230769
78
0.622951
false
ogenstad/ansible
lib/ansible/modules/network/avi/avi_sslprofile.py
23
8496
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
gpl-3.0
4,235,574,452,734,194,700
39.075472
157
0.628413
false
liorvh/golismero
thirdparty_libs/yaml/resolver.py
474
8972
__all__ = ['BaseResolver', 'Resolver'] from error import * from nodes import * import re class ResolverError(YAMLError): pass class BaseResolver(object): DEFAULT_SCALAR_TAG = u'tag:yaml.org,2002:str' DEFAULT_SEQUENCE_TAG = u'tag:yaml.org,2002:seq' DEFAULT_MAPPING_TAG = u'tag:yaml.org,2002:map' ...
gpl-2.0
-5,004,611,397,061,416,000
39.053571
82
0.529202
false
Sorsly/subtle
google-cloud-sdk/platform/gsutil/third_party/boto/tests/unit/emr/test_emr_responses.py
98
17266
# Copyright (c) 2010 Jeremy Thurgood <firxen+boto@gmail.com> # # 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, mod...
mit
7,093,604,040,317,337,000
43.5
99
0.569269
false
aselle/tensorflow
tensorflow/examples/speech_commands/freeze_test.py
5
3289
# 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
98,841,784,893,417,460
37.244186
80
0.643661
false
rigid/jobpip3
tests/test_record.py
1
1172
import unittest from jobpip3 import Record class TestRecord(unittest.TestCase): """Record() tests""" def test_dict(self): """a Record() mimics a dict. Test that here""" # create a record a = Record() # __setattr__ a['foo'] = 2.5 self.assertEqual(a['foo'],...
gpl-3.0
8,638,985,109,165,751,000
21.113208
78
0.535836
false
karanvivekbhargava/robot-butler-enpm808x
vendor/googletest/googletest/test/gtest_test_utils.py
344
10823
#!/usr/bin/env python # # Copyright 2006, 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...
mit
4,753,262,380,326,900,000
32.821875
79
0.67412
false
plilja/project-euler
problem_60/prime_set.py
1
1038
import sys from ast import literal_eval import os infile = open(os.path.join(os.path.dirname(__file__), 'prime_pairs.txt')) PRIME_PAIRS = literal_eval(infile.read()) for key in PRIME_PAIRS.keys(): PRIME_PAIRS[key] = set(PRIME_PAIRS[key]) # literal_eval doesn't support sets, hence we convert here infile.close() ...
apache-2.0
-5,889,047,692,538,977,000
32.483871
107
0.635838
false
vjmac15/Lyilis
lib/youtube_dl/extractor/skysports (VJ Washington's conflicted copy 2017-08-29).py
34
1156
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import strip_or_none class SkySportsIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?skysports\.com/watch/video/(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.skysports.com/watch/video/10328419/ba...
gpl-3.0
-3,953,745,120,645,159,000
33
90
0.545848
false
piyush0609/scipy
scipy/weave/tests/test_numpy_scalar_spec.py
91
4001
from __future__ import absolute_import, print_function import os import sys import tempfile import numpy from numpy.testing import TestCase, assert_, run_module_suite from scipy.weave import inline_tools, ext_tools from scipy.weave.build_tools import msvc_exists, gcc_exists from scipy.weave.catalog import unique_fil...
bsd-3-clause
-8,572,259,517,166,163,000
26.593103
77
0.548863
false
weblabdeusto/weblabdeusto
server/src/test/unit/weblab/translator/test_stores_everything_except_for_files_translator.py
3
1892
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2005 onwards University of Deusto # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of contributions made by many individuals, # list...
bsd-2-clause
-1,191,880,542,313,486,300
27.666667
97
0.665433
false
srthurman/transitland-python-client
transitland/route.py
2
1704
"""Route Entity.""" import geom import util import errors from entity import Entity class Route(Entity): """Transitland Route Entity.""" onestop_type = 'r' def geohash(self): """Return 10 characters of geohash.""" return geom.geohash_features(self.stops()) def add_tags_gtfs(self, gtfs_entity): ke...
mit
-6,408,115,028,204,271,000
24.432836
63
0.607981
false
meisterpeeps/grpc
src/python/src/grpc/_cython/adapter_low.py
3
3285
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
4,021,874,509,633,270,000
27.815789
80
0.749772
false
alexandrucoman/vbox-nova-driver
nova/tests/functional/v3/test_availability_zone.py
23
2082
# 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,617,116,321,623,102,000
40.64
79
0.655139
false
Carmezim/tensorflow
tensorflow/contrib/slim/python/slim/nets/inception_v2_test.py
111
11157
# 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,300,898,173,703,184,400
39.718978
80
0.660841
false
betoesquivel/fil2014
build/django/build/lib.linux-x86_64-2.7/django/contrib/gis/gdal/prototypes/geom.py
219
4737
from ctypes import c_char_p, c_double, c_int, c_void_p, POINTER from django.contrib.gis.gdal.envelope import OGREnvelope from django.contrib.gis.gdal.libgdal import lgdal from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope from django.contrib.gis.gdal.prototypes.generation import (const_s...
mit
7,426,358,838,808,826,000
47.336735
137
0.732531
false
ishay2b/tensorflow
tensorflow/contrib/learn/python/learn/dataframe/transforms/sum.py
102
1987
# 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,393,743,644,878,806,000
32.677966
80
0.689482
false
geier/alot
alot/commands/thread.py
1
46406
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com> # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file from __future__ import absolute_import import argparse import logging import mailcap import os import re import subprocess import temp...
gpl-3.0
6,342,498,106,170,416,000
38.663248
85
0.551136
false
raxenak/borg
src/borg/platform/base.py
2
6272
import errno import os from borg.helpers import truncate_and_unlink """ platform base module ==================== Contains platform API implementations based on what Python itself provides. More specific APIs are stubs in this module. When functions in this module use platform APIs themselves they access the public...
bsd-3-clause
1,871,296,687,235,688,400
29.153846
116
0.644292
false
CorySimon/pyIAST
test/python_scripts/Test IAST for Langmuir case.py
2
7330
# coding: utf-8 # # Test pyIAST for match with competitive Langmuir model # In the case that the pure-component isotherms $N_{i,pure}(P)$ follow the Langmuir model with the same saturation loading $M$: # # $N_{i,pure} = M \frac{K_iP}{1+K_iP},$ # # The mixed gas adsorption isotherm follows the competitive Langmuir iso...
mit
6,045,858,510,552,020,000
27.858268
315
0.633834
false
stasiek/robotframework
src/robot/running/timeouts/jython.py
26
1627
# Copyright 2008-2015 Nokia Solutions and Networks # # 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,030,940,735,534,092,000
28.053571
75
0.646589
false
jmmartinez84/yowsup
yowsup/layers/protocol_contacts/protocolentities/notification_contact_remove.py
68
1295
from yowsup.structs import ProtocolTreeNode from .notification_contact import ContactNotificationProtocolEntity class RemoveContactNotificationProtocolEntity(ContactNotificationProtocolEntity): ''' <notification offline="0" id="{{NOTIFICATION_ID}}" notify="{{NOTIFY_NAME}}" type="contacts" t="{{TIME...
gpl-3.0
-2,857,252,732,414,753,300
42.2
109
0.695753
false
tachylyte/HydroGeoPy
conversion.py
1
1110
# Useful unit conversions def secsToDays(s): '''Assume s is time in seconds and a positive integer or float. Return time in days''' days = s / (60 * 60 * 24) return days def daysToSecs(d): '''Assume d is time in days and a positive integer or float. Return time in seconds''' secs = (60 * ...
bsd-2-clause
2,671,667,052,882,306,600
23.666667
67
0.627928
false
mhbu50/frappe
frappe/desk/doctype/desktop_icon/test_desktop_icon.py
10
2904
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest from frappe.desk.doctype.desktop_icon.desktop_icon import (get_desktop_icons, add_user_icon, set_hidden_list, set_order, clear_desktop_i...
mit
-5,705,930,931,028,322,000
26.140187
92
0.69697
false
jjmachan/activityPointsApp
activitypoints/lib/python3.5/site-packages/django/contrib/gis/db/backends/oracle/adapter.py
273
1866
from cx_Oracle import CLOB from django.contrib.gis.db.backends.base.adapter import WKTAdapter from django.contrib.gis.geos import GeometryCollection, Polygon from django.utils.six.moves import range class OracleSpatialAdapter(WKTAdapter): input_size = CLOB def __init__(self, geom): """ Oracl...
mit
5,707,912,012,881,019,000
33.555556
74
0.608253
false
fxfitz/ansible
lib/ansible/modules/cloud/amazon/rds_instance_facts.py
5
12095
#!/usr/bin/python # Copyright (c) 2017, 2018 Michael De La Rue # Copyright (c) 2017, 2018 Will Thames # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'communi...
gpl-3.0
5,083,689,119,113,021,000
29.389447
138
0.632741
false
davidsims9t/itis-graphql
venv/lib/python3.4/site-packages/setuptools/namespaces.py
54
2648
import os from distutils import log import itertools from setuptools.extern.six.moves import map flatten = itertools.chain.from_iterable class Installer: nspkg_ext = '-nspkg.pth' def install_namespaces(self): nsp = self._get_all_ns_packages() if not nsp: return filenam...
gpl-3.0
9,048,486,773,029,176,000
27.473118
73
0.555514
false
jthomm/game-center-db
gcdb/__init__.py
1
18930
__version__ = '0.0.1' """Reading and executing SQL""" from os import path class Table(object): """Given a table name and a `sqlite3.Cursor`, execute `CREATE TABLE` and `INSERT INTO`. """ SQL_PATH = path.abspath(path.join(path.dirname(__file__), 'sql')) def __init__(self, name): self....
mit
2,776,360,542,175,904,300
28.531981
83
0.529794
false
maiome-development/malibu
src/malibu/design/borgish.py
1
2517
# -*- coding: utf-8 -*- __doc__ = """ malibu.design.borgish --------------------- Borgish was designed as a more extended implementation of Alex Martelli's Borg design pattern, which aims to provide state consistency similar to a singleton design, but without the terribleness of singletons. """ class SharedState(ob...
unlicense
-1,089,426,769,305,444,700
28.964286
78
0.576083
false
Abdoctor/behave
features/steps/behave_active_tags_steps.py
4
3394
# -*- coding: UTF-8 -*- """ .. code-block:: gherkin Given I setup the current values for active tags with: | category | value | | foo | xxx | Then the following active tag combinations are enabled: | tags | enabled? | | @active.with_foo=xxx ...
bsd-2-clause
-982,836,100,588,529,400
38.465116
79
0.611668
false
dwhswenson/mdtraj
mdtraj/formats/prmtop.py
10
9196
############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2013 Stanford University and the Authors # # Authors: TJ Lane # Contributors: Robert McGibbon, Jason Swails # # MDTr...
lgpl-2.1
-3,115,195,362,124,371,500
36.688525
104
0.584493
false
minghuascode/pyj
examples/hangman/Wordlist_15.py
8
5084
words=[ 'counterintelligence', 'interdenominational', 'nonrepresentational', 'characteristically', 'chlorofluorocarbon', 'disproportionately', 'electrocardiograph', 'oversimplification', 'telecommunications', 'transubstantiation', 'commercialization', 'comprehensiveness', 'conscientiousness', 'constitutionality', 'cont...
apache-2.0
-3,621,075,683,523,182,600
18.40458
22
0.79465
false
spbguru/repo1
tests/unit/py2/nupic/encoders/vector_test.py
4
3552
#!/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
-2,094,198,378,204,621,000
33.485437
92
0.671171
false
psathyrella/partis-deprecated
packages/ighutil/python/versioneer.py
6
27828
#! /usr/bin/python """versioneer.py (like a rocketeer, but for versions) * https://github.com/warner/python-versioneer * Brian Warner * License: Public Domain * Version: 0.8+ This file helps distutils-based projects manage their version number by just creating version-control tags. For developers who work from a V...
gpl-3.0
-1,280,063,522,429,077,200
38.697575
91
0.624551
false
manipopopo/tensorflow
tensorflow/python/saved_model/tag_constants.py
20
1516
# 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
-347,356,818,770,536,800
31.956522
80
0.689314
false
AlexanderYAPPO/stackalytics
tests/unit/test_default_data_processor.py
4
4084
# Copyright (c) 2013 Mirantis 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 writi...
apache-2.0
6,464,993,703,635,968,000
40.252525
79
0.555093
false
zanderle/django
django/utils/baseconv.py
650
2982
# Copyright (c) 2010 Guilherme Gondim. All rights reserved. # Copyright (c) 2009 Simon Willison. All rights reserved. # Copyright (c) 2002 Drew Perttula. All rights reserved. # # License: # Python Software Foundation License version 2 # # See the file "LICENSE" for terms & conditions for usage, and a DISCLAIMER OF # ...
bsd-3-clause
-7,579,263,414,675,249,000
28.82
82
0.633132
false
jfemiani/facade-segmentation
pyfacades/util/process_strip.py
1
3952
import numpy as np import skimage from skimage.transform import rescale def split_tiles(image, shape, overlap=16): """ Rescale and split the input images to get several overlapping images of a given shape. *** The inpput must be CHANNELS FIRST *** The input image is rescaled so that height matches the o...
mit
1,486,153,020,294,306,600
37
120
0.623482
false
bazz-erp/erpnext
erpnext/setup/doctype/authorization_control/authorization_control.py
29
9897
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, has_common, comma_or from frappe import session, _ from erpnext.utilities.transaction_base import Tran...
gpl-3.0
8,880,196,421,029,807,000
42.599119
123
0.648176
false
FrankBian/kuma
vendor/packages/sqlalchemy/test/aaa_profiling/test_orm.py
7
3012
from sqlalchemy.test.testing import eq_, assert_raises, \ assert_raises_message from sqlalchemy import exc as sa_exc, util, Integer, String, ForeignKey from sqlalchemy.orm import exc as orm_exc, mapper, relationship, \ sessionmaker from sqlalchemy.test import testing, profiling from test.orm import _base from s...
mpl-2.0
1,606,634,505,143,193,900
32.466667
72
0.583333
false
ddRPB/rpb-server
services/OCStudyEventDefinitionWsService.py
1
6030
#### ## ## ######## ####### ######## ######## ###### ## ### ### ## ## ## ## ## ## ## ## ## ## #### #### ## ## ## ## ## ## ## ## ## ## ### ## ######## ## ## ######## ## ###### ## ## ## ## ## ## ## ## ## ## ## ## #...
gpl-3.0
-1,384,357,441,810,418,000
39.469799
105
0.482421
false
danux/danjd
cv/models.py
1
1371
# ~*~ coding: utf-8 ~*~ from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models class Skill(models.Model): """ A skill has a name and a skill level. """ name = models.CharField(max_length=30) skill_level = models.IntegerField(validators=[MinValueValidat...
mit
8,111,518,980,008,673,000
27.5625
96
0.675419
false
jspricke/python-remind
setup.py
1
1133
from setuptools import setup setup(name='remind', version='0.17.0', description='Remind Python library', long_description=open('README.rst').read(), author='Jochen Sprickerhof', author_email='remind@jochen.sprickerhof.de', license='GPLv3+', url='https://github.com/jspricke/pyt...
gpl-3.0
5,867,303,875,851,519,000
33.333333
87
0.571933
false
Ballz0fSteel/Umeko
lib/youtube_dl/extractor/ketnet.py
33
2589
from __future__ import unicode_literals from .common import InfoExtractor class KetnetIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?ketnet\.be/(?:[^/]+/)*(?P<id>[^/?#&]+)' _TESTS = [{ 'url': 'https://www.ketnet.be/kijken/zomerse-filmpjes', 'md5': 'd907f7b1814ef0fa285c0475d9994ed7', ...
gpl-3.0
3,440,093,713,125,056,000
34.958333
93
0.493241
false
Lyleo/nupic
tests/integration/nupic/opf/opf_checkpoint_test/opf_checkpoint_test.py
17
16469
#!/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
-4,267,358,597,152,112,600
34.115139
80
0.619953
false
rockstor/rockstor-core
src/rockstor/storageadmin/models/network_interface.py
2
9858
""" Copyright (c) 2012-2020 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,127,370,030,339,019,000
35.783582
92
0.641814
false
soarpenguin/ansible
lib/ansible/module_utils/cnos.py
2
133164
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by # Ansible still belong to the author of the module, and may assign their own # license to the complete wo...
gpl-3.0
1,350,055,591,790,685,200
36.981746
79
0.50362
false
mith1979/ansible_automation
applied_python/applied_python/lib/python2.7/site-packages/pyasn1/type/char.py
172
2043
# ASN.1 "character string" types from pyasn1.type import univ, tag class NumericString(univ.OctetString): tagSet = univ.OctetString.tagSet.tagImplicitly( tag.Tag(tag.tagClassUniversal, tag.tagFormatSimple, 18) ) class PrintableString(univ.OctetString): tagSet = univ.OctetString.tagSet.tagImpli...
apache-2.0
2,133,283,242,103,077,600
30.921875
63
0.715125
false
yamada-h/ryu
ryu/lib/of_config/base.py
7
4331
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 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
-5,527,494,506,060,488,000
26.941935
77
0.528746
false
kangkot/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_gdbm.py
58
2501
import gdbm import unittest import os from test.test_support import verbose, TESTFN, run_unittest, unlink filename = TESTFN class TestGdbm(unittest.TestCase): def setUp(self): self.g = None def tearDown(self): if self.g is not None: self.g.close() unlink(filename) d...
apache-2.0
-4,189,007,148,702,575,000
29.5
80
0.57617
false