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
liucode/tempest-master
tools/skip_tracker.py
46
5132
#!/usr/bin/env python # Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE...
apache-2.0
2,304,282,553,910,513,400
34.393103
79
0.558262
false
adrianholovaty/django
tests/regressiontests/forms/tests/forms.py
33
109561
# -*- coding: utf-8 -*- import datetime from django.core.files.uploadedfile import SimpleUploadedFile from django.forms import * from django.http import QueryDict from django.template import Template, Context from django.test import TestCase from django.utils.datastructures import MultiValueDict, MergeDict from django...
bsd-3-clause
2,757,336,895,553,193,500
59.509121
520
0.623939
false
tahmid-tanzim/youtube-dl
youtube_dl/extractor/cnet.py
101
3246
# coding: utf-8 from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import ( ExtractorError, ) class CNETIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?cnet\.com/videos/(?P<id>[^/]+)/' _TESTS = [{ 'url': 'http://www.cnet.com/videos/hands-on-wi...
unlicense
-1,452,262,025,714,894,800
37.188235
235
0.552988
false
tumbl3w33d/ansible
lib/ansible/modules/cloud/azure/azure_rm_mariadbserver.py
39
13580
#!/usr/bin/python # # Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.com> # Copyright (c) 2019 Matti Ranta, (@techknowlogick) # # 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 AN...
gpl-3.0
6,645,708,739,641,243,000
34
156
0.547938
false
394954369/horizon
openstack_dashboard/test/api_tests/network_tests.py
4
24747
# Copyright 2013 NEC Corporation # # 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
-537,489,905,778,685,800
43.669675
79
0.603103
false
simongoffin/my_odoo_tutorial
addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
337
3655
# -*- 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
-6,226,260,374,393,424,000
48.364865
209
0.630441
false
dejay313/dojostreams
script.module.urlresolver/lib/urlresolver/plugins/weshare.py
7
1762
""" grifthost urlresolver plugin Copyright (C) 2015 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. This program is d...
gpl-2.0
4,319,591,206,129,824,300
36.489362
109
0.679342
false
foreni-packages/urwid
urwid/tests/test_graphics.py
22
3925
import unittest from urwid import graphics from urwid.compat import B import urwid class LineBoxTest(unittest.TestCase): def border(self, tl, t, tr, l, r, bl, b, br): return [bytes().join([tl, t, tr]), bytes().join([l, B(" "), r]), bytes().join([bl, b, br]),] def test...
lgpl-2.1
2,891,930,729,549,816,300
39.463918
74
0.402803
false
mheap/ansible
lib/ansible/plugins/cache/yaml.py
15
1924
# (c) 2017, Brian Coca # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' cache: yaml short_descriptio...
gpl-3.0
4,063,753,266,278,565,000
28.151515
92
0.634615
false
iLoveTux/unitils
test/test_cp.py
1
3760
import os import unittest import unitils import platform try: from unittest import mock except ImportError: import mock class TestCpCli(unittest.TestCase): """Test the functionality of the cp.py cli """ @mock.patch("unitils.cp") def test_only_needs_src_and_dst(self, mock_cp): argv = [...
gpl-3.0
-3,452,405,707,591,704,000
40.318681
83
0.512234
false
SnappleCap/oh-mainline
vendor/packages/PyYaml/tests/lib3/test_tokens.py
62
2257
import yaml import pprint # Tokens mnemonic: # directive: % # document_start: --- # document_end: ... # alias: * # anchor: & # tag: ! # scalar _ # block_sequence_start: [[ # block_mapping_start: {{ # block_end: ]} # flow...
agpl-3.0
7,059,201,453,612,504,000
28.311688
83
0.55782
false
azureplus/hue
desktop/core/ext-py/Django-1.6.10/django/test/utils.py
105
15228
from contextlib import contextmanager import logging import re import sys from threading import local import time import warnings from functools import wraps from xml.dom.minidom import parseString, Node from django.conf import settings, UserSettingsHolder from django.core import mail from django.core.signals import r...
apache-2.0
-1,227,548,594,550,815,700
31.469083
81
0.642501
false
MFry/pyAlgoDataStructures
hacker_rank/WoC_24/simplified_chess_engine.py
1
2391
""" ref: https://www.hackerrank.com/contests/w24/challenges/simplified-chess-engine """ import unittest def get_moves(piece, r, c, board): def check_valid(x, y): """ :param board: playing board :param c: pieces color :param x: coord :param y: coord :return: boole...
mit
3,093,100,270,830,221,000
28.8875
94
0.44542
false
wgcv/SWW-Crashphone
lib/python2.7/site-packages/django/views/csrf.py
107
4958
from django.conf import settings from django.http import HttpResponseForbidden from django.template import Context, Template from django.utils.translation import ugettext as _ # We include the template inline since we need to be able to reliably display # this error message, especially for the sake of developers, and ...
apache-2.0
-447,410,678,017,498,240
36.847328
133
0.646027
false
ArthurGarnier/SickRage
lib/hachoir_parser/file_system/ntfs.py
86
11594
""" New Technology File System (NTFS) file system parser. Sources: - The NTFS documentation http://www.linux-ntfs.org/ - NTFS-3G driver http://www.ntfs-3g.org/ Creation date: 3rd january 2007 Author: Victor Stinner """ SECTOR_SIZE = 512 from hachoir_parser import Parser from hachoir_core.field import (FieldSet,...
gpl-3.0
-4,688,682,207,495,316,000
39.680702
101
0.603071
false
Intel-tensorflow/tensorflow
tensorflow/python/keras/applications/xception.py
6
13122
# 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
-7,995,841,609,387,500,000
38.763636
87
0.65897
false
Edraak/edx-platform
lms/djangoapps/discussion_api/forms.py
30
3800
""" Discussion API forms """ from django.core.exceptions import ValidationError from django.forms import ( BooleanField, CharField, ChoiceField, Form, IntegerField, NullBooleanField, Select) from opaque_keys import InvalidKeyError from opaque_keys.edx.locator import CourseLocator from opene...
agpl-3.0
-4,626,616,632,667,826,000
31.20339
101
0.655526
false
jburwell/ansible-modules-extras
source_control/bzr.py
38
6431
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, André Paramés <git@andreparames.com> # Based on the Git module by Michael DeHaan <michael.dehaan@gmail.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 a...
gpl-3.0
-4,883,286,191,305,738,000
31.459596
96
0.598724
false
wujuguang/sentry
tests/sentry/web/frontend/test_organization_audit_log.py
25
1571
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.models import AuditLogEntry, AuditLogEntryEvent from sentry.testutils import TestCase, PermissionTestCase class OrganizationAuditLogPermissionTest(PermissionTestCase): def setUp(self): super(OrganizationAudit...
bsd-3-clause
-2,964,239,215,208,088,600
32.425532
91
0.701464
false
ESOedX/edx-platform
pavelib/paver_tests/test_paver_quality.py
1
14003
""" Tests for paver quality tasks """ from __future__ import absolute_import, print_function import os import shutil import tempfile import textwrap import unittest import six from ddt import data, ddt, file_data, unpack from mock import MagicMock, mock_open, patch from path import Path as path from paver.easy import...
agpl-3.0
4,821,852,327,633,786,000
38.005571
134
0.629579
false
cneill/designate
designate/tests/test_context.py
8
2410
# Copyright 2012 Managed I.T. # # Author: Kiall Mac Innes <kiall@managedit.ie> # # 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 r...
apache-2.0
7,451,191,119,021,763,000
34.441176
75
0.697095
false
seisman/HinetPy
docs/conf.py
1
2654
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
mit
-3,297,595,446,637,114,000
32.594937
79
0.677845
false
Scalr/libcloud
libcloud/common/softlayer.py
58
2938
# 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 use ...
apache-2.0
8,291,923,869,185,621,000
32.386364
74
0.631042
false
weimingtom/python-for-android
python3-alpha/python3-src/Lib/tkinter/__init__.py
45
155000
"""Wrapper functions for Tcl/Tk. Tkinter provides classes which allow the display, positioning and control of widgets. Toplevel widgets are Tk and Toplevel. Other widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton, Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox LabelFrame and PanedWindow. ...
apache-2.0
1,819,160,448,004,354,300
40.745219
110
0.598432
false
emiquelito/django-cms-2.0
mptt/tests/testcases.py
9
13673
import re from django.test import TestCase from mptt.exceptions import InvalidMove from mptt.tests import doctests from mptt.tests.models import Category, Genre def get_tree_details(nodes): """Creates pertinent tree details for the given list of nodes.""" opts = nodes[0]._meta return '\n'.join(['%s %s %s...
bsd-3-clause
-6,830,206,834,231,831,000
43.249191
82
0.389015
false
gilbertw/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/palmos.py
96
3019
""" Python Character Mapping Codec for PalmOS 3.5. Written by Sjoerd Mullender (sjoerd@acm.org); based on iso8859_15.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def d...
apache-2.0
-3,364,468,177,213,943,000
34.373494
73
0.621067
false
nitin-cherian/LifeLongLearning
Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/pygments/lexers/stata.py
27
3627
# -*- coding: utf-8 -*- """ pygments.lexers.stata ~~~~~~~~~~~~~~~~~~~~~ Lexer for Stata :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, words from pygments.token import Comment, Keyword,...
mit
5,220,186,804,142,345,000
32.583333
83
0.458506
false
OnionIoT/i2c-exp-driver
examples/pwm-exp.py
1
1269
from OmegaExpansion import pwmExp import time import sys # check the arguments channel = 0 if len(sys.argv) == 2: channel = int(sys.argv[1]) print('>> Using channel %d'%channel) pwmExp.setVerbosity(0) # check initialization # should return 0 if the PWM Expansion has just been plugged in ret = pwmExp.checkInit() p...
agpl-3.0
7,553,283,897,252,582,000
18.523077
63
0.695035
false
carvalhomb/tsmells
guess/src/Lib/xml/dom/html/HTMLAppletElement.py
2
3614
######################################################################## # # File Name: HTMLAppletElement # # Documentation: http://docs.4suite.com/4DOM/HTMLAppletElement.html # ### This file is automatically generated by GenerateHtml.py. ### DO NOT EDIT! """ WWW: http://4suite.com/4DOM ...
gpl-2.0
9,161,584,029,305,290,000
26.234375
77
0.571666
false
mrphrazer/miasm
miasm/ir/translators/z3_ir.py
2
10225
from builtins import map from builtins import range import imp import logging # Raise an ImportError if z3 is not available WITHOUT actually importing it imp.find_module("z3") from miasm.ir.translators.translator import Translator log = logging.getLogger("translator_z3") console_handler = logging.StreamHandler() con...
gpl-2.0
7,791,933,840,641,675,000
35.3879
81
0.512567
false
srivassumit/servo
tests/wpt/css-tests/tools/py/testing/path/common.py
162
15649
import py import sys class CommonFSTests(object): def test_constructor_equality(self, path1): p = path1.__class__(path1) assert p == path1 def test_eq_nonstring(self, path1): p1 = path1.join('sampledir') p2 = path1.join('sampledir') assert p1 == p2 def test_new_ide...
mpl-2.0
2,882,451,676,089,745,400
32.295745
76
0.581315
false
jokey2k/ShockGsite
djangobb_forum/models.py
1
16225
from datetime import datetime import os import os.path from django.db import models from django.contrib.auth.models import User, Group from django.utils.html import escape from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.utils.hashcompat import sha_constructor from ...
bsd-3-clause
-5,403,392,065,625,880,000
39.766332
184
0.623729
false
thaumos/ansible
lib/ansible/modules/network/fortios/fortios_router_ospf.py
21
42092
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0
5,534,001,404,669,160,000
41.863544
129
0.394303
false
habibmasuro/django-wiki
testproject/testproject/wsgi.py
7
1342
""" WSGI config for testproject project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATIO...
gpl-3.0
1,497,821,301,507,728,400
38.470588
79
0.793592
false
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/sklearn/externals/joblib/numpy_pickle.py
18
15334
""" Utilities for fast persistence of big data, with optional compression. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import pickle import traceback import sys import os import zlib import warnings if sys.version_info[0...
agpl-3.0
-7,210,448,619,312,888,000
35.336493
79
0.594757
false
jss-emr/openerp-7-src
openerp/addons/l10n_si/account_wizard.py
51
1162
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) conexus.at # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public...
agpl-3.0
-6,961,064,539,702,717,000
33.117647
79
0.609483
false
miptliot/edx-ora2
openassessment/assessment/views.py
3
1860
import logging from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response from openassessment.assessment.api.peer import get_assessments from submissions.api import SubmissionRequestError, get_submissions log = logging.getLogger(__name__) @login_required() def get_eva...
agpl-3.0
-6,765,516,311,788,257,000
34.769231
113
0.68871
false
rosenjens/monad
OpenStreetMap/routesGenerator/src/python/test_router.py
2
1750
""" Copyright 2015 Ericsson AB 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 di...
apache-2.0
-1,978,394,238,091,488,800
25.515152
79
0.651429
false
chugunovyar/factoryForBuild
env/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py
109
5023
""" Creates permissions for all installed apps that need permissions. """ from __future__ import unicode_literals import getpass import unicodedata from django.apps import apps as global_apps from django.contrib.auth import get_permission_codename from django.core import exceptions from django.db import DEFAULT_DB_AL...
gpl-3.0
-5,430,994,550,526,959,000
31.830065
118
0.650408
false
scottrogowski/code2flow
code2flow/model.py
1
19171
import abc import os TRUNK_COLOR = '#966F33' LEAF_COLOR = '#6db33f' EDGE_COLOR = "#cf142b" NODE_COLOR = "#cccccc" class Namespace(dict): """ Abstract constants class Constants can be accessed via .attribute or [key] and can be iterated over. """ def __init__(self, *args, **kwargs): d = {...
lgpl-3.0
-5,236,679,395,363,168,000
29.52707
95
0.550154
false
vitamincpp/shadowsocks
shadowsocks/lru_cache.py
12
4286
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # 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 b...
apache-2.0
8,203,778,442,953,355,000
27.573333
78
0.555063
false
potash/scikit-learn
sklearn/datasets/mlcomp.py
289
3855
# Copyright (c) 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause """Glue code to load http://mlcomp.org data as a scikit.learn dataset""" import os import numbers from sklearn.datasets.base import load_files def _load_document_classification(dataset_path, metadata, set_=None, **kwargs): if ...
bsd-3-clause
-246,487,067,200,446,140
35.028037
79
0.630091
false
andymg/androguard
tests/test_axml.py
38
2563
#!/usr/bin/env python import logging import datetime import sys PATH_INSTALL = "./" sys.path.append(PATH_INSTALL) from optparse import OptionParser from androguard.core.analysis import auto from androguard.core.androconf import set_debug option_0 = {'name': ('-d', '--directory'), 'help': 'directory input', 'nargs':...
apache-2.0
3,257,721,387,415,138,300
25.42268
83
0.632852
false
sdeleeuw/contagement
contagement/settings_shared.py
1
5243
""" Django settings for contagement project. Generated by 'django-admin startproject' using Django 1.10.1. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ from ...
gpl-3.0
-1,511,700,114,988,813,800
24.70098
91
0.662407
false
stdweird/aquilon
lib/python2.6/aquilon/worker/commands/cat_cluster.py
2
2304
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor # # 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...
apache-2.0
-6,992,465,338,306,120,000
41.666667
85
0.667101
false
lahosken/pants
tests/python/pants_test/build_graph/test_target.py
2
8043
# 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) import os.path from ...
apache-2.0
3,229,958,781,113,421,000
42.475676
114
0.693895
false
mikethebeer/cr8
cr8/run_spec.py
1
10629
import argh import os import itertools from functools import partial from cr8 import aio, clients from .insert_json import to_insert from .bench_spec import load_spec from .engine import Runner, Result, run_and_measure, eval_fail_if from .misc import ( as_bulk_queries, as_statements, get_lines, parse_v...
mit
-2,924,106,021,507,890,000
33.067308
101
0.559883
false
kmonsoor/python-for-android
python3-alpha/python3-src/Lib/test/test_osx_env.py
59
1341
""" Test suite for OS X interpreter environment variables. """ from test.support import EnvironmentVarGuard, run_unittest import subprocess import sys import unittest class OSXEnvironmentVariableTestCase(unittest.TestCase): def _check_sys(self, ev, cond, sv, val = sys.executable + 'dummy'): with Environme...
apache-2.0
1,588,175,134,860,492,000
36.25
84
0.623415
false
alexlo03/ansible
lib/ansible/utils/module_docs_fragments/cnos.py
25
3793
# Copyright (C) 2017 Lenovo, 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. # # Ansi...
gpl-3.0
3,031,489,144,988,577,300
44.698795
121
0.665964
false
PacktPublishing/Mastering-Mesos
Chapter4/Aurora/src/main/python/apache/aurora/config/schema/base.py
2
5083
# # 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 # distributed under ...
mit
5,134,285,980,031,449,000
31.375796
97
0.674011
false
lukw00/spaCy
tests/munge/test_align.py
5
1085
from spacy.util import align_tokens def test_perfect_align(): ref = ['I', 'align', 'perfectly'] indices = [] i = 0 for token in ref: indices.append((i, i + len(token))) i += len(token) aligned = list(align_tokens(ref, indices)) assert aligned[0] == ('I', [(0, 1)]) assert al...
mit
-1,205,556,169,526,800,400
32.90625
75
0.501382
false
thezawad/flexx
setup.py
17
2416
# -*- coding: utf-8 -*- """ Flexx setup script. Release: * python setup.py register * python setup.py sdist bdist_wheel --universal upload * build conda packages? """ import os from os import path as op try: # use setuptools namespace, allows for "develop" import setuptools # noqa, analysis:ignore except...
bsd-2-clause
-4,922,623,488,440,363,000
27.761905
76
0.614238
false
CamelBackNotation/CarnotKE
jyhton/lib-python/2.7/plat-mac/findertools.py
29
30176
"""Utility routines depending on the finder, a combination of code by Jack Jansen and erik@letterror.com. Most events have been captured from Lasso Capture AE and than translated to python code. IMPORTANT Note that the processes() function returns different values depending on the OS version it is running on. On MacO...
apache-2.0
-3,229,427,225,874,835,000
35.138922
171
0.610551
false
mayk93/python_koans
python2/koans/about_scoring_project.py
89
2262
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # A greed roll is scored as follows: # # * A set of three ones is 10...
mit
-2,412,797,359,243,900,400
29.567568
79
0.618479
false
quantmind/pulsar
pulsar/apps/wsgi/routers.py
1
21405
import os import re import stat import mimetypes from collections import OrderedDict from functools import partial, lru_cache from email.utils import parsedate_tz, mktime_tz from pulsar.utils.httpurl import CacheControl from pulsar.utils.slugify import slugify from pulsar.utils.security import digest from pulsar.util...
bsd-3-clause
-5,155,463,011,957,915,000
32.708661
80
0.56968
false
al177/mbed
setup.py
44
1751
""" This module defines the attributes of the PyPI package for the Mbed SDK """ from shutil import copyfileobj from os.path import isfile, join from tempfile import TemporaryFile from setuptools import find_packages from distutils.core import setup LICENSE = open('LICENSE').read() DESCRIPTION = """A set of Python scr...
apache-2.0
2,054,967,390,499,829,200
34.734694
221
0.711022
false
jwlawson/tensorflow
tensorflow/python/keras/_impl/keras/layers/convolutional.py
3
73414
# 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
-5,713,564,470,865,948,000
42.960479
104
0.627891
false
JioCloud/nova_test_latest
nova/tests/unit/scheduler/filters/test_compute_filters.py
68
2286
# 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
-1,853,685,631,260,539,400
44.72
78
0.673228
false
sliz1/servo
tests/wpt/web-platform-tests/tools/py/py/_io/terminalwriter.py
175
12542
""" Helper functions for writing to terminals and files. """ import sys, os import py py3k = sys.version_info[0] >= 3 from py.builtin import text, bytes win32_and_ctypes = False colorama = None if sys.platform == "win32": try: import colorama except ImportError: try: import ctyp...
mpl-2.0
-8,180,665,201,239,004,000
35.04023
77
0.55669
false
QijunPan/ansible
lib/ansible/modules/cloud/openstack/os_client_config.py
21
2493
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # This module 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 late...
gpl-3.0
662,960,858,810,140,400
29.777778
85
0.674689
false
girving/meld
vcview.py
1
27928
### Copyright (C) 2002-2006 Stephen Kennedy <stevek@gnome.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 2 of the License, or ### (at your option) any later version. ...
gpl-2.0
-3,884,307,724,914,281,500
43.259905
197
0.552098
false
danilito19/django
tests/admin_scripts/tests.py
95
91070
# -*- coding: utf-8 -*- """ A series of tests to establish that the command-line management tools work as advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE and default settings.py files. """ from __future__ import unicode_literals import codecs import os import re import shutil import ...
bsd-3-clause
4,741,640,470,759,631,000
43.639216
271
0.64056
false
jeffery-do/Vizdoombot
doom/lib/python3.5/site-packages/dask/array/image.py
6
1997
from __future__ import absolute_import, division, print_function from glob import glob import os try: from skimage.io import imread as sk_imread except ImportError: pass from .core import Array from ..base import tokenize def add_leading_dimension(x): return x[None, ...] def imread(filename, imread=N...
mit
-25,959,412,088,231,750
27.126761
80
0.63345
false
miptliot/edx-platform
common/djangoapps/course_modes/signals.py
24
1561
""" Signal handler for setting default course mode expiration dates """ from django.core.exceptions import ObjectDoesNotExist from django.dispatch.dispatcher import receiver from xmodule.modulestore.django import SignalHandler, modulestore from .models import CourseMode, CourseModeExpirationConfig @receiver(SignalH...
agpl-3.0
-8,358,130,343,705,271,000
41.189189
112
0.713645
false
vquinones/admindemo
myadmin/views.py
2
1463
from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.views.generic.base import TemplateView #from django.contrib.admin.views.decorators import staff_member_required from django.conf.urls import patterns from django.contrib import admin class Screen...
gpl-2.0
-6,269,147,511,937,451,000
33.857143
85
0.71907
false
mtdewulf/incubator-airflow
airflow/contrib/operators/dataflow_operator.py
14
3784
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
-3,506,925,557,319,353,300
33.715596
90
0.640328
false
cjaffar/jaffarchiosa
jaffarchiosa/lib/python2.7/site-packages/pip/vcs/mercurial.py
392
5820
import os import tempfile import re import sys from pip.util import call_subprocess from pip.util import display_path, rmtree from pip.log import logger from pip.vcs import vcs, VersionControl from pip.download import path_to_url from pip.backwardcompat import ConfigParser class Mercurial(VersionControl): name = ...
mit
-4,101,710,055,672,019,000
37.543046
82
0.546564
false
totto82/opm-common
python/opm/io/ecl/__init__.py
7
7470
from opm._common import eclArrType from opm._common import EclFile from opm._common import ERst from opm._common import ESmry from opm._common import EGrid from opm._common import ERft from opm._common import EclOutput import sys import datetime import numpy as np import datetime # When extracting the strings from CH...
gpl-3.0
-4,546,163,157,257,080,300
32.348214
134
0.61071
false
stansonhealth/ansible-modules-core
packaging/os/apt_key.py
14
10248
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2012, Jayson Vantuyl <jayson@aggressive.ly> # # 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 #...
gpl-3.0
8,129,839,031,717,676,000
33.16
137
0.606557
false
bryanph/OIPA
OIPA/api/v3/resources/aggregation_resources.py
1
18208
# Tastypie specific from tastypie.resources import ModelResource # cache specific from api.cache import NoTransformCache from iati.models import AidType from iati.models import Activity from cache.validator import Validator # Direct sql specific import ujson from django.db import connection from django.http import Ht...
agpl-3.0
-5,366,025,164,750,461,000
45.687179
215
0.575571
false
alunarbeach/spark
examples/src/main/python/streaming/network_wordcount.py
85
1915
# # 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
7,952,121,839,769,879,000
38.081633
100
0.716971
false
rogerscristo/BotFWD
env/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.py
355
4939
from __future__ import absolute_import, division, unicode_literals from xml.dom import Node from ..constants import namespaces, voidElements, spaceCharacters __all__ = ["DOCUMENT", "DOCTYPE", "TEXT", "ELEMENT", "COMMENT", "ENTITY", "UNKNOWN", "TreeWalker", "NonRecursiveTreeWalker"] DOCUMENT = Node.DOCUMEN...
mit
1,480,387,847,660,471,000
31.926667
103
0.538976
false
thnee/ansible
lib/ansible/modules/storage/ibm/ibm_sa_host.py
61
3264
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2018 IBM CORPORATION # Author(s): Tzur Eliyahu <tzure@il.ibm.com> # # 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_META...
gpl-3.0
-6,257,879,633,015,056,000
25.536585
102
0.612439
false
sunshineDrizzle/FreeROI
froi/algorithm/meshtool.py
2
36643
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import os import subprocess import numpy as np from scipy import sparse from scipy.spatial.distance import cdist, pdist from scipy.stats import pearsonr def _fast_cross_3d(x, y): """Compute cross pr...
bsd-3-clause
-7,127,751,725,429,031,000
34.166027
115
0.598614
false
fauferoth/assignment
.mywaflib/waflib/Tools/tex.py
4
14765
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) """ TeX/LaTeX/PDFLaTeX/XeLaTeX support Example:: def configure(conf): conf.load('tex') if not conf.env.LATEX: conf.fatal('The program LaTex is required') def build(bld): bld( features = 'tex', type = 'latex', # pdflatex or x...
bsd-3-clause
3,714,176,706,981,665,000
27.725681
192
0.649103
false
mengxn/tensorflow
tensorflow/contrib/slim/python/slim/nets/inception_v3.py
89
30528
# 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,537,503,690,995,678,000
41.518106
80
0.579468
false
mlperf/training_results_v0.5
v0.5.0/google/cloud_v2.8/ssd-tpuv2-8/code/ssd/model/tpu/models/experimental/show_and_tell/show_and_tell_model.py
5
13300
# 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,738,249,219,019,677,000
34.185185
80
0.655564
false
h2educ/scikit-learn
examples/mixture/plot_gmm_sin.py
248
2747
""" ================================= Gaussian Mixture Model Sine Curve ================================= This example highlights the advantages of the Dirichlet Process: complexity control and dealing with sparse data. The dataset is formed by 100 points loosely spaced following a noisy sine curve. The fit by the GMM...
bsd-3-clause
7,111,627,896,384,050,000
32.5
77
0.621769
false
racker/cloud-init-debian-pkg
cloudinit/config/cc_phone_home.py
6
3666
# vi: ts=4 expandtab # # Copyright (C) 2011 Canonical Ltd. # Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P. # # Author: Scott Moser <scott.moser@canonical.com> # Author: Juerg Haefliger <juerg.haefliger@hp.com> # # This program is free software: you can redistribute it and/or modify #...
gpl-3.0
8,440,992,280,787,142,000
29.806723
78
0.580469
false
crookedreyes/py4e-specialization
course-5/week-02/pagerank-ori/bs4/builder/_lxml.py
24
9031
__all__ = [ 'LXMLTreeBuilderForXML', 'LXMLTreeBuilder', ] from io import BytesIO from io import StringIO import collections from lxml import etree from bs4.element import ( Comment, Doctype, NamespacedAttribute, ProcessingInstruction, ) from bs4.builder import ( FAST, HTML, HTML...
lgpl-2.1
-6,045,552,353,726,071,000
35.415323
85
0.609013
false
lixt/lily2-gem5
configs/topologies/MeshDirCorners.py
15
6049
# Copyright (c) 2010 Advanced Micro Devices, 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...
bsd-3-clause
7,596,799,117,114,871,000
44.141791
93
0.60291
false
ingokegel/intellij-community
plugins/hg4idea/testData/bin/mercurial/hg.py
90
21956
# hg.py - repository classes for mercurial # # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from i18n import _ from lock ...
apache-2.0
-2,962,814,856,865,498,000
33.685624
80
0.576471
false
NeovaHealth/odoo
addons/membership/__openerp__.py
197
2207
# -*- 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
2,576,041,998,617,390,000
36.40678
87
0.5913
false
stackforge/tacker
tacker/db/migration/cli.py
2
6050
# Copyright 2012 New Dream Network, LLC (DreamHost) # # 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 a...
apache-2.0
-3,596,578,781,574,618,000
32.988764
79
0.638843
false
tumi8/sKnock
common/modules/Platform/LinuxUtils.py
1
1054
# Copyright (C) 2015-2016 Daniel Sel # # 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 distributed i...
gpl-3.0
-4,546,158,544,842,113,000
35.344828
69
0.732448
false
fw1121/zulip
zerver/test_subs.py
113
63624
# -*- coding: utf-8 -*- from __future__ import absolute_import from zerver.lib import cache from zerver.lib.test_helpers import ( AuthedTestCase, queries_captured, stub, tornado_redirected_to_list ) from zerver.decorator import ( JsonableError ) from zerver.lib.test_runner import ( slow ) from zerver.m...
apache-2.0
-5,557,696,432,808,420,000
41.51738
117
0.602868
false
stackforge/cloudbase-init
cloudbaseinit/models/network.py
1
2857
# Copyright 2012 Cloudbase Solutions Srl # # 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
-366,018,888,440,008,900
19.119718
78
0.60483
false
larme/hy
hy/models/__init__.py
7
1687
# Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org> # # 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, modif...
mit
-3,754,105,714,082,415,000
44.594595
77
0.705987
false
mrcslws/nupic.research
tests/unit/frameworks/pytorch/le_sparse_net_test.py
3
3282
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or modify # it unde...
agpl-3.0
-5,630,712,774,432,770,000
32.835052
78
0.600244
false
kenwang815/KodiPlugins
script.module.youtube.dl/lib/youtube_dl/extractor/keek.py
105
1307
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class KeekIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?keek\.com/keek/(?P<id>\w+)' IE_NAME = 'keek' _TEST = { 'url': 'https://www.keek.com/keek/NODfbab', 'md5': '9b0636f8c0f7614afa4ea5e4c6e57...
gpl-2.0
1,743,605,058,638,927,600
32.512821
71
0.517215
false
timesking/MITMf
core/servers/KarmaSMB.py
26
26385
#!/usr/bin/python # Copyright (c) 2015 CORE Security Technologies # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # Karma SMB # # Author: # Alberto Solino (@agsolino) # Original idea by @mubix # # Desc...
gpl-3.0
-4,407,417,093,689,317,400
44.569948
160
0.63574
false
haowu4682/gem5
src/base/vnc/Vnc.py
66
2503
# Copyright (c) 2010 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
-4,493,650,668,590,789,000
49.06
72
0.780264
false
gpodder/mygpo
mygpo/podcasts/views/episode.py
1
7048
from datetime import datetime from functools import wraps import dateutil.parser from django.shortcuts import render from django.http import HttpResponseRedirect, Http404 from django.contrib.auth.decorators import login_required from django.contrib.sites.requests import RequestSite from django.contrib.contenttypes.mo...
agpl-3.0
1,967,175,203,275,658,000
26.857708
84
0.653377
false
seecr/meresco-components
meresco/components/fieldlets.py
1
2437
## begin license ## # # "Meresco Components" are components to build searchengines, repositories # and archives, based on "Meresco Core". # # Copyright (C) 2007-2009 SURF Foundation. http://www.surf.nl # Copyright (C) 2007 SURFnet. http://www.surfnet.nl # Copyright (C) 2007-2010 Seek You Too (CQ2) http://www.cq2.nl ...
gpl-2.0
5,668,907,887,453,926,000
35.373134
95
0.6984
false
ashang/calibre
src/calibre/linux.py
5
45743
__license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' ''' Post installation script for linux ''' import sys, os, cPickle, textwrap, stat, errno from subprocess import check_call, check_output from functools import partial from calibre import __appname__, prints, guess_type from calib...
gpl-3.0
-8,055,978,416,307,630,000
39.878463
483
0.538159
false
clouddocx/boto
tests/integration/s3/test_key.py
75
20790
# -*- coding: utf-8 -*- # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # All rights reserved. # # 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 # withou...
mit
306,620,027,754,640,960
37.928839
99
0.604531
false
marcosdiez/ansible-modules-extras
monitoring/zabbix_host.py
1
19612
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013-2014, Epic Games, 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
1,476,384,767,791,123,700
37.758893
122
0.585305
false
PureMVC/puremvc-python-demo-gae-blog
src/puremvc/patterns/facade.py
1
9327
""" PureMVC Python Port by Toby de Havilland <toby.de.havilland@puremvc.org> PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. Your reuse is governed by the Creative Commons Attribution 3.0 License """ import puremvc.core import puremvc.interfaces import puremvc.patterns.observer class Fac...
bsd-3-clause
-2,889,186,708,972,809,700
32.078014
110
0.733998
false
pombredanne/grumpy
grumpy-runtime-src/lib/os_test.py
5
4620
# Copyright 2016 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 a...
apache-2.0
-2,934,263,753,439,450,600
17.188976
80
0.656926
false
stonebig/bokeh
examples/plotting/file/elements.py
5
1855
import pandas as pd from bokeh.models import ColumnDataSource, LabelSet from bokeh.plotting import figure, show, output_file from bokeh.sampledata.periodic_table import elements elements = elements.copy() elements = elements[elements["atomic number"] <= 82] elements = elements[~pd.isnull(elements["melting point"])] m...
bsd-3-clause
-4,367,250,376,229,642,000
35.372549
114
0.673315
false