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
paulballesty/zxcvbn
data-scripts/build_keyboard_adjacency_graphs.py
9
4051
#!/usr/bin/python import sys import simplejson def usage(): return ''' constructs adjacency_graphs.coffee from QWERTY and DVORAK keyboard layouts usage: %s adjacency_graphs.coffee ''' % sys.argv[0] qwerty = r''' `~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ qQ wW eE rR tT yY uU iI oO pP [{ ]} \| aA sS dD fF gG...
mit
8,791,864,322,519,584,000
35.827273
99
0.567267
false
rghe/ansible
contrib/inventory/nagios_ndo.py
42
3808
#!/usr/bin/env python # (c) 2014, Jonathan Lestrelin <jonathan.lestrelin@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 as published by # the Free Software Foundation, either version 3 of the Licens...
gpl-3.0
-210,779,300,152,225,630
33.93578
112
0.612658
false
balachandrana/pythonista_stash_utilities
catbinascii.py
1
2770
""" cat bin asccii Examples: """ """ todo: __doc__ test examples """ import argparse import fileinput import os import re import sys import binascii def main(args): ap = argparse.ArgumentParser(description=__doc__) ap.add_argument('files', nargs='*', help='files to be processed') ap.add_argument('...
mit
-7,256,439,255,489,745,000
31.209302
79
0.438628
false
devs1991/test_edx_docmode
lms/djangoapps/shoppingcart/utils.py
103
2782
""" Utility methods for the Shopping Cart app """ from django.conf import settings from microsite_configuration import microsite from pdfminer.pdfparser import PDFParser from pdfminer.pdfdocument import PDFDocument from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.converter import PDF...
agpl-3.0
4,464,919,487,932,740,000
36.594595
102
0.714234
false
thomazs/geraldo
site/newsite/django_1_0/django/contrib/markup/templatetags/markup.py
38
3646
""" Set of "markup" template filters for Django. These filters transform plain text markup syntaxes to HTML; currently there is support for: * Textile, which requires the PyTextile library available at http://dealmeida.net/projects/textile/ * Markdown, which requires the Python-markdown library from ...
lgpl-3.0
-7,105,715,288,604,475,000
37.787234
134
0.679649
false
geomagpy/MARTAS
libmqtt/lorawanserver.py
1
7323
from __future__ import print_function from __future__ import absolute_import # ################################################################### # Import packages # ################################################################### from magpy.stream import DataStream, KEYLIST, NUMKEYLIST, subtractStreams import st...
gpl-3.0
7,231,067,676,429,583,000
43.114458
438
0.543083
false
kobotoolbox/kpi
kpi/tests/api/v1/test_api_permissions.py
1
5983
# coding: utf-8 from django.contrib.auth.models import User, Permission from django.urls import reverse from django.utils import timezone from rest_framework import status from kpi.constants import ASSET_TYPE_COLLECTION from kpi.models import Asset, ObjectPermission from kpi.models.object_permission import get_anonymo...
agpl-3.0
4,349,195,161,084,878,300
38.622517
96
0.669062
false
deepmind/dm_control
dm_control/viewer/user_input_test.py
1
6472
# Copyright 2018 The dm_control 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 or agreed to i...
apache-2.0
5,779,521,694,902,967,000
36.627907
79
0.696075
false
Nepherhotep/django
tests/postgres_tests/test_ranges.py
98
24582
import datetime import json import unittest from django import forms from django.core import exceptions, serializers from django.db import connection from django.db.models import F from django.test import TestCase, override_settings from django.utils import timezone from . import PostgreSQLTestCase from .models impor...
bsd-3-clause
-4,758,179,205,725,029,000
37.89557
118
0.616142
false
Delgan/w2ui
server/python/bottle/bottle.py
28
143552
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Bottle is a fast and simple micro-framework for small web applications. It offers request dispatching (Routes) with url parameter support, templates, a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and template engines - all in a single file an...
mit
5,009,132,559,782,079,000
38.502477
108
0.580326
false
with-git/tensorflow
tensorflow/contrib/grid_rnn/python/ops/grid_rnn_cell.py
76
23199
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
4,799,294,087,729,401,000
33.885714
80
0.59925
false
albertz/music-player
mac/pyobjc-core/PyObjCTest/test_object_property.py
2
19504
from __future__ import unicode_literals from PyObjCTools.TestSupport import * import objc import copy from PyObjCTest.fnd import * objc.registerMetaDataForSelector( b"NSObject", b"validateValue:forKey:error:", dict( arguments={ 2: dict(type_modifier=objc._C_INOUT), ...
bsd-2-clause
6,946,988,906,597,692,000
31.779832
87
0.566499
false
flwh/KK_mt6589_iq451
prebuilts/python/linux-x86/2.7.5/lib/python2.7/distutils/tests/test_cmd.py
87
3901
"""Tests for distutils.cmd.""" import unittest import os from test.test_support import captured_stdout, run_unittest from distutils.cmd import Command from distutils.dist import Distribution from distutils.errors import DistutilsOptionError from distutils import debug class MyCmd(Command): def initialize_options(...
gpl-2.0
7,578,320,308,979,014,000
29.716535
79
0.583953
false
tombstone/models
research/slim/nets/mobilenet/mobilenet_v3_test.py
3
5913
# 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
-6,931,470,342,817,953,000
41.235714
87
0.663623
false
pv/scikit-learn
sklearn/tree/tests/test_export.py
76
9318
""" Testing for export functions of decision trees (sklearn.tree.export). """ from numpy.testing import assert_equal from nose.tools import assert_raises from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor from sklearn.tree import export_graphviz from sklearn.externals.six import StringIO # toy sa...
bsd-3-clause
142,422,423,081,847,460
40.413333
78
0.449775
false
igel-kun/pyload
module/plugins/hoster/XDCC.py
1
3550
# -*- coding: utf-8 -*- import os import re from module.plugins.internal.Hoster import Hoster from module.network.XDCCRequest import XDCCRequest from module.plugins.internal.misc import parse_name, safejoin class XDCC(Hoster): __name__ = "XDCC" __type__ = "hoster" __version__ = "99" __status__ ...
gpl-3.0
5,521,874,226,707,542,000
42.82716
138
0.561127
false
nyuwireless/ns3-mmwave
.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Tools/dmd.py
21
1487
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import sys from waflib.Tools import ar,d from waflib.Configure import conf @conf def find_dmd(conf): conf.find_program(['dmd','dmd2','ldc'],var='D') out=conf.cmd_and_log(conf.env.D+['--help']) if ...
gpl-2.0
6,021,294,095,337,380,000
28.156863
78
0.628783
false
OrlandoSoto/retirement
retirement_api/urls.py
1
1116
from django.conf.urls import patterns, include, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from django.conf import settings admin.autodiscover() urlpatterns = patterns('', # url(r'^retirement-api/admin/', include(admin.site.urls)), url(r'^retirement...
cc0-1.0
5,216,972,956,740,240,000
57.736842
149
0.707885
false
s20121035/rk3288_android5.1_repo
frameworks/base/tools/layoutlib/rename_font/build_font_single.py
1
6688
#!/usr/bin/env python # Copyright (C) 2014 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
gpl-3.0
-5,051,433,683,380,599,000
31.153846
104
0.683762
false
arcivanov/pybuilder
src/integrationtest/python/smoke_setup_tests.py
3
1045
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2020 PyBuilder Team # # 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/l...
apache-2.0
-3,214,572,679,451,836,000
31.65625
82
0.717703
false
neurodebian/htcondor
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/Languages/pl.py
10
7899
apiAttachAvailable = u'API jest dost\u0119pne' apiAttachNotAvailable = u'Niedost\u0119pny' apiAttachPendingAuthorization = u'Autoryzacja w toku' apiAttachRefused = u'Odmowa' apiAttachSuccess = u'Sukces' apiAttachUnknown = u'Nieznany' budDeletedFriend = u'Usuni\u0119ty z listy znajomych' budFriend = u'Znajomy' b...
apache-2.0
-8,796,664,608,180,221,000
40.240642
95
0.791493
false
miptliot/edx-platform
common/djangoapps/terrain/stubs/catalog.py
19
1690
""" Stub implementation of catalog service for acceptance tests """ # pylint: disable=invalid-name, missing-docstring import re import urlparse from .http import StubHttpRequestHandler, StubHttpService class StubCatalogServiceHandler(StubHttpRequestHandler): def do_GET(self): pattern_handlers = { ...
agpl-3.0
-5,810,156,140,571,770,000
31.5
82
0.643195
false
firebase/grpc-SwiftPM
src/python/grpcio/grpc_core_dependencies.py
1
48612
# Copyright 2015 gRPC 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 or agreed to in writing...
apache-2.0
-1,551,413,842,074,994,000
57.639324
118
0.723422
false
Yukarumya/Yukarum-Redfoxes
python/mozbuild/mozbuild/frontend/mach_commands.py
2
7822
# 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/. from __future__ import absolute_import, print_function, unicode_literals from collections import defaultdict import os ...
mpl-2.0
-4,686,500,835,082,777,000
34.880734
100
0.557914
false
probml/pyprobml
scripts/svi_gmm_tfp_scratch.py
1
7626
# SVI for a GMM # Modified from # https://github.com/brendanhasz/svi-gaussian-mixture-model/blob/master/BayesianGaussianMixtureModel.ipynb #pip install tf-nightly #pip install --upgrade tfp-nightly -q # Imports import numpy as np import matplotlib.pyplot as plt import seaborn as sns import tensorflow as tf import ten...
mit
3,546,635,113,897,697,000
30.254098
106
0.600839
false
blacklin/kbengine
kbe/res/scripts/common/Lib/concurrent/futures/_base.py
88
19638
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. __author__ = 'Brian Quinlan (brian@sweetapp.com)' import collections import logging import threading import time FIRST_COMPLETED = 'FIRST_COMPLETED' FIRST_EXCEPTION = 'FIRST_EXCEPTION' ALL_COMPLETED = 'ALL_COMPLETED...
lgpl-3.0
-6,628,829,400,186,757,000
33.153043
80
0.587789
false
igoralmeida/tahoe-lafs
src/allmydata/test/test_deepcheck.py
6
60303
import os, simplejson, urllib from cStringIO import StringIO from twisted.trial import unittest from twisted.internet import defer from twisted.internet import threads # CLI tests use deferToThread from allmydata.immutable import upload from allmydata.mutable.common import UnrecoverableFileError from allmydata.mutable...
gpl-2.0
-2,333,116,309,238,673,000
47.088517
159
0.589506
false
z-jason/anki
thirdparty/BeautifulSoup.py
20
79554
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup parses a (possibly invalid) XML or HTML document into a tree representation. It provides methods and Pythonic idioms that make it easy to navigate, search, and modify the tree. A well-formed X...
agpl-3.0
8,123,461,818,184,523,000
38.46131
186
0.570518
false
broferek/ansible
test/units/modules/network/check_point/test_cp_mgmt_host_facts.py
19
2820
# Ansible module to manage CheckPoint Firewall (c) 2019 # # 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 dist...
gpl-3.0
8,973,006,014,143,455,000
33.390244
133
0.694326
false
acutesoftware/AIKIF
aikif/.z_prototype/search.py
1
1453
# -*- coding: utf-8 -*- import argparse import aikif.config as cfg def search(search_string): """ main function to search using indexes """ print('Searching for ' + search_string) ndxFiles = cfg.params['index_files'] numResults = 0 totLines = 0 for fname in ndxFiles: print("Se...
gpl-3.0
8,887,818,560,919,525,000
38.297297
118
0.582244
false
William-Hai/volatility
volatility/scan.py
44
9086
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # Derived from source in PyFlag developed by: # Copyright 2004: Commonwealth of Australia. # Michael Cohen <scudette@users.sourceforge.net> # David Collett <daveco@users.sourceforge.net> # # This file is part of Volatility. # # Volatility is free software;...
gpl-2.0
8,870,765,082,792,051,000
40.113122
112
0.623817
false
magdamagda/geny-chorobowe
geny_chorobowe/find_disease_genes/migrations/0010_auto_20160106_0951.py
1
1184
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-06 09:51 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('find_disease_genes', '0009_auto_20160105_2120'), ] operations = [ migrations...
gpl-2.0
4,839,723,874,064,484,000
32.828571
171
0.576014
false
tanyunshi/python-docx
features/steps/table.py
6
12947
# encoding: utf-8 """ Step implementations for table-related features """ from __future__ import ( absolute_import, division, print_function, unicode_literals ) from behave import given, then, when from docx import Document from docx.enum.table import WD_TABLE_ALIGNMENT, WD_TABLE_DIRECTION from docx.shared impo...
mit
-1,849,273,605,797,733,400
30.732843
77
0.653974
false
nop33/indico
indico/modules/events/registration/placeholders/invitations.py
2
1675
# This file is part of Indico. # Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
6,436,381,824,222,359,000
31.211538
82
0.725373
false
Taapat/enigma2-openpli-vuplus
lib/python/Components/Sources/Boolean.py
162
1264
from Source import Source from Components.Element import cached from enigma import eTimer # a small warning: # you can use that boolean well to express screen-private # conditional expressions. # # however, if you think that there is ANY interest that another # screen could use your expression, please put your calcula...
gpl-2.0
5,022,945,174,676,182,000
25.333333
78
0.721519
false
getnikola/plugins
v7/link_figure/link_figure.py
2
4919
# -*- coding: utf-8 -*- # Copyright © 2014 Ivan Teoh and others. # 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, cop...
mit
8,292,915,414,803,617,000
33.152778
83
0.618341
false
abhiii5459/sympy
sympy/parsing/sympy_parser.py
43
30008
"""Transform a string with Python-like source code into SymPy expression. """ from __future__ import print_function, division from .sympy_tokenize import \ generate_tokens, untokenize, TokenError, \ NUMBER, STRING, NAME, OP, ENDMARKER from keyword import iskeyword import ast import re import unicodedata im...
bsd-3-clause
2,356,793,139,194,653,700
32.679012
103
0.540956
false
Tetchain/pycoin
tests/encoding_test.py
18
9641
#!/usr/bin/env python import unittest from pycoin import encoding from pycoin.serialize import h2b class EncodingTestCase(unittest.TestCase): def test_to_from_long(self): def do_test(as_int, prefix, as_rep, base): self.assertEqual((as_int, prefix), encoding.to_long(base, encoding.byte_to_int...
mit
3,333,543,564,550,442,500
55.711765
146
0.672648
false
google/glazier
testing/run_tests.py
1
1660
# Copyright 2019 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
-1,978,808,782,491,652,600
30.923077
77
0.642169
false
YueLinHo/Subversion
subversion/tests/cmdline/svntest/verify.py
1
34138
# # verify.py: routines that handle comparison and display of expected # vs. actual output # # Subversion is a tool for revision control. # See http://subversion.tigris.org for more information. # # ==================================================================== # Licensed to the Apache Softwar...
apache-2.0
8,446,738,257,630,799,000
34.671891
113
0.620247
false
BT-astauder/odoo
openerp/tools/cache.py
100
5907
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
3,479,117,339,764,277,000
32
83
0.562722
false
GeoscienceAustralia/Geodesy-Web-Services
aws/amazonia/test/unit_tests/test_stack.py
2
27223
from amazonia.classes.api_gateway_config import ApiGatewayMethodConfig from amazonia.classes.api_gateway_config import ApiGatewayResponseConfig, ApiGatewayRequestConfig from amazonia.classes.asg_config import AsgConfig from amazonia.classes.block_devices_config import BlockDevicesConfig from amazonia.classes.cf_distrib...
bsd-3-clause
-6,543,121,254,940,597,000
49.600372
119
0.455975
false
joopert/home-assistant
tests/components/fan/test_init.py
4
1116
"""Tests for fan platforms.""" import unittest from homeassistant.components.fan import FanEntity import pytest class BaseFan(FanEntity): """Implementation of the abstract FanEntity.""" def __init__(self): """Initialize the fan.""" pass class TestFanEntity(unittest.TestCase): """Test ...
apache-2.0
2,273,334,755,325,178,600
26.219512
62
0.609319
false
cpina/science-cruise-data-management
ScienceCruiseDataManagement/main/management/commands/importprojects.py
1
1792
from django.core.management.base import BaseCommand, CommandError from main.models import Project, Person import csv # This file is part of https://github.com/cpina/science-cruise-data-management # # This project was programmed in a hurry without any prior Django experience, # while circumnavigating the Antarctic on t...
mit
2,968,487,484,177,550,300
39.727273
118
0.647321
false
havt/odoo
addons/account/wizard/account_use_model.py
341
3361
# -*- 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,215,197,671,965,624,000
43.813333
157
0.565903
false
dannyboi104/SickRage
lib/mako/ast.py
60
6702
# mako/ast.py # Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """utilities for analyzing expressions and blocks of Python code, as well as generating Python from AS...
gpl-3.0
-7,948,000,596,961,553,000
36.651685
79
0.565801
false
joopert/home-assistant
tests/components/input_datetime/test_reproduce_state.py
5
2723
"""Test reproduce state for Input datetime.""" from homeassistant.core import State from tests.common import async_mock_service async def test_reproducing_states(hass, caplog): """Test reproducing Input datetime states.""" hass.states.async_set( "input_datetime.entity_datetime", "2010-10-10 0...
apache-2.0
-1,225,122,979,564,478,200
33.910256
87
0.600441
false
0jpq0/kbengine
kbe/res/scripts/common/Lib/idlelib/OutputWindow.py
88
4394
from tkinter import * from idlelib.EditorWindow import EditorWindow import re import tkinter.messagebox as tkMessageBox from idlelib import IOBinding class OutputWindow(EditorWindow): """An editor window that can serve as an output file. Also the future base class for the Python shell window. This class ...
lgpl-3.0
687,982,925,328,611,700
29.513889
77
0.528903
false
mageec/mageec
script/generate-builds.py
1
12030
#!/usr/bin/env python3 import argparse import os import random import sys import mageec gcc_flags = [ #'-faggressive-loop-optimizations', # Not supported in 4.5 '-falign-functions', '-falign-jumps', '-falign-labels', '-falign-loops', '-fbranch-count-reg', '-fbranch-target-load-optimize', ...
gpl-3.0
8,509,774,038,920,799,000
35.56535
91
0.566085
false
cstipkovic/spidermonkey-research
testing/talos/talos/cmanager_mac.py
2
2801
# 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/. """CounterManager for Mac OSX""" import subprocess from cmanager import CounterManager import sys def GetProcessData(...
mpl-2.0
-6,439,433,337,595,770,000
31.569767
79
0.62799
false
thaim/ansible
lib/ansible/plugins/action/cnos.py
38
3535
# (C) 2017 Red Hat Inc. # Copyright (C) 2017 Lenovo. # # GNU General Public License v3.0+ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for ...
mit
-7,932,380,170,677,422,000
41.083333
122
0.65884
false
jamesblunt/edx-platform
lms/djangoapps/class_dashboard/tests/test_views.py
133
4061
""" Tests for class dashboard (Metrics tab in instructor dashboard) """ import json from django.test.client import RequestFactory from mock import patch from nose.plugins.attrib import attr from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestC...
agpl-3.0
7,651,137,132,831,873,000
38.427184
126
0.680128
false
deroneriksson/incubator-systemml
src/main/python/systemml/random/sampling.py
7
5336
# ------------------------------------------------------------- # # 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 unde...
apache-2.0
6,646,452,491,699,643,000
30.761905
130
0.593703
false
amarant/servo
tests/wpt/web-platform-tests/tools/py/py/_path/cacheutil.py
278
3333
""" This module contains multithread-safe cache implementations. All Caches have getorbuild(key, builder) delentry(key) methods and allow configuration when instantiating the cache class. """ from time import time as gettime class BasicCache(object): def __init__(self, maxentries=128): self.maxe...
mpl-2.0
1,975,793,741,031,625,200
28.236842
67
0.59796
false
SoftwareExperiment4/SungkyunWiki
wiki/plugins/haystack/search_indexes.py
16
1113
from __future__ import absolute_import from __future__ import unicode_literals from haystack import indexes from wiki import models class ArticleIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) created = indexes.DateTimeField(model_attr='created') m...
gpl-3.0
5,482,800,041,241,543,000
41.807692
110
0.72956
false
michaelneuder/image_quality_analysis
bin/nets/old/conv_net_SSIM.py
1
6635
#!/usr/bin/env python3 import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2' import numpy as np np.set_printoptions(threshold=np.nan) import tensorflow as tf import time from PIL import Image as im def convolve_inner_layers(x, W, b): y = tf.nn.conv2d(x, W, strides = [1,1,1,1], padding='SAME') y = tf.nn.bias_add(y, ...
mit
930,283,126,851,834,000
41.532051
123
0.559759
false
derDavidT/sympy
sympy/calculus/euler.py
54
3152
from sympy import Function, sympify, diff, Eq, S, Symbol, Derivative from sympy.core.compatibility import ( combinations_with_replacement, iterable, range) def euler_equations(L, funcs=(), vars=()): r""" Find the Euler-Lagrange equations [1]_ for a given Lagrangian. Parameters ========== L :...
bsd-3-clause
5,167,032,256,292,410,000
30.838384
78
0.571066
false
KyoungRan/Django_React_ex
Django_React_Workshop-mbrochh/django/myvenv/lib/python3.4/site-packages/django/contrib/gis/db/backends/spatialite/operations.py
28
10604
""" 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....
mit
7,782,957,256,435,374,000
38.129151
102
0.621652
false
skiselev/upm
examples/python/relay.py
7
1896
from __future__ import print_function # Author: Sarah Knepper <sarah.knepper@intel.com> # Copyright (c) 2015 Intel Corporation. # # 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 restr...
mit
-1,082,877,575,210,683,600
37.693878
72
0.707806
false
richardcs/ansible
lib/ansible/plugins/lookup/mongodb.py
84
8872
# (c) 2016, Marcos Diez <marcos@unitron.com.br> # https://github.com/marcosdiez/ # # 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
-7,530,318,172,670,179,000
36.277311
159
0.599865
false
pablorecio/resistencia-1812
resistencia/gui/round_results.py
1
6387
# -*- coding: utf-8 -*- ############################################################################### # This file is part of Resistencia Cadiz 1812. # # # # This program is free software: you can redistribute it...
gpl-3.0
-3,368,089,194,443,015,000
41.865772
91
0.546109
false
rysson/filmkodi
plugin.video.mrknow/lib/parser2.py
2
28077
# -*- coding: utf-8 -*- import common import sys, os, traceback import time import random import re import urllib import string from string import lower from entities.CList import CList from entities.CItemInfo import CItemInfo from entities.CListItem import CListItem from entities.CRuleItem import CRuleItem import c...
apache-2.0
-2,253,433,605,346,059,300
35.275194
148
0.435766
false
samithaj/headphones
lib/pytz/__init__.py
61
34011
''' datetime.tzinfo timezone definitions generated from the Olson timezone database: ftp://elsie.nci.nih.gov/pub/tz*.tar.gz See the datetime section of the Python Library Reference for information on how to use these modules. ''' # The Olson database is updated several times a year. OLSON_VERSION = '2014j' VERSI...
gpl-3.0
-7,961,348,532,706,557,000
21.47918
81
0.652583
false
shepdelacreme/ansible
lib/ansible/modules/network/aos/_aos_login.py
44
4110
#!/usr/bin/python # # (c) 2017 Apstra Inc, <community@apstra.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 published by # the Free Software Foundation, either version 3 of the License, or # (at your opt...
gpl-3.0
-2,178,526,695,427,118,600
28.568345
89
0.66983
false
lmtim/iOSBlogCN
Export.py
65
1482
__author__ = 'wwxiang' #coding=utf-8 import os import re work = os.getcwd() resxml = work + os.path.sep + 'blogcn.opml' workmd = work + os.path.sep + 'README.md' def handler(): isblock = True handlerData = [] lineNo = 0 try: with open(workmd,'rb') as linefs: lineCout = len(linefs...
gpl-2.0
-4,641,633,338,557,022,000
30.347826
150
0.507628
false
ddzialak/boto
boto/cloudsearch2/search.py
16
13430
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. # 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 # without limitation the rights...
mit
-2,765,473,993,947,969,000
35.594005
134
0.595905
false
Sylrob434/CouchPotatoServer
libs/CodernityDB/debug_stuff.py
44
7678
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011-2013 Codernity (http://codernity.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/L...
gpl-3.0
1,710,699,627,838,807,000
35.388626
98
0.502084
false
cdepman/falcon_api
site-packages/wheel/test/test_install.py
455
1866
# Test wheel. # The file has the following contents: # hello.pyd # hello/hello.py # hello/__init__.py # test-1.0.data/data/hello.dat # test-1.0.data/headers/hello.dat # test-1.0.data/scripts/hello.sh # test-1.0.dist-info/WHEEL # test-1.0.dist-info/METADATA # test-1.0.dist-info/RECORD # The ...
mit
4,381,787,573,899,417,000
31.963636
82
0.623258
false
bcornwellmott/erpnext
erpnext/hr/report/employee_birthday/employee_birthday.py
120
1328
# 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 import _ from frappe.utils import flt def execute(filters=None): if not filters: filters = {} columns = get_columns() dat...
gpl-3.0
6,694,553,669,898,430,000
32.2
102
0.652108
false
notmyname/swift
test/unit/common/test_exceptions.py
51
1959
# Copyright (c) 2010-2012 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 law or agree...
apache-2.0
80,773,942,721,669,070
38.18
78
0.58193
false
otherness-space/myProject002
my_project_002/lib/python2.7/site-packages/django/contrib/contenttypes/management.py
96
2903
from django.contrib.contenttypes.models import ContentType from django.db import DEFAULT_DB_ALIAS, router from django.db.models import get_apps, get_models, signals from django.utils.encoding import smart_text from django.utils import six from django.utils.six.moves import input def update_contenttypes(app, created_m...
mit
-7,901,137,522,889,848,000
31.617978
97
0.612125
false
onceuponatimeforever/oh-mainline
vendor/packages/bleach/bleach/tests/test_basics.py
21
5094
import html5lib from nose.tools import eq_ import bleach def test_empty(): eq_('', bleach.clean('')) def test_comments_only(): comment = '<!-- this is a comment -->' open_comment = '<!-- this is an open comment' eq_('', bleach.clean(comment)) eq_('', bleach.clean(open_comment)) eq_(comment,...
agpl-3.0
8,802,816,271,392,228,000
28.964706
79
0.56223
false
blueyed/ycmd
ycmd/request_validation.py
29
2422
#!/usr/bin/env python # # Copyright (C) 2014 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe 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 you...
gpl-3.0
-664,107,804,409,604,200
36.84375
79
0.714699
false
nolanliou/tensorflow
tensorflow/python/kernel_tests/sparse_conditional_accumulator_test.py
132
22955
# 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
8,486,528,713,473,834,000
37.644781
80
0.594947
false
bitfinder/thrift
contrib/fb303/py/fb303/FacebookBase.py
173
1917
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
apache-2.0
-6,590,703,830,105,765,000
22.378049
61
0.710485
false
tjsavage/full_nonrel_starter
django/templatetags/static.py
233
2149
from django import template from django.utils.encoding import iri_to_uri register = template.Library() class PrefixNode(template.Node): def __repr__(self): return "<PrefixNode for %r>" % self.name def __init__(self, varname=None, name=None): if name is None: raise template.Templa...
bsd-3-clause
1,365,877,122,325,783,800
24.583333
66
0.579805
false
michhar/flask-webapp-aml
env/Lib/site-packages/wtforms/i18n.py
142
2175
import os def messages_path(): """ Determine the path to the 'messages' directory as best possible. """ module_path = os.path.abspath(__file__) locale_path = os.path.join(os.path.dirname(module_path), 'locale') if not os.path.exists(locale_path): locale_path = '/usr/share/locale' r...
mit
7,357,021,100,776,778,000
28
85
0.68092
false
xakepru/x14.11-coding-hyperv
src/hyperv4/distorm/examples/tests/test_distorm3.py
4
68909
# # Gil Dabah 2006, http://ragestorm.net/distorm # Tests for diStorm3 # import os import distorm3 from distorm3 import * import struct import unittest import random REG_NONE = 255 _REGISTERS = ["RAX", "RCX", "RDX", "RBX", "RSP", "RBP", "RSI", "RDI", "R8", "R9", "R10", "R11", "R12", "R13", "R14", "R15", "EAX", "ECX",...
mit
4,522,999,987,624,009,000
40.611715
163
0.66093
false
minhphung171093/GreenERP_V9
openerp/addons/sale_service/__openerp__.py
23
1356
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Create Tasks from SO', 'version': '1.0', 'category': 'Project Management', 'description': """ Automatically creates project tasks from procurement lines. ======================================...
gpl-3.0
-5,719,672,554,160,219,000
36.666667
80
0.688791
false
fidomason/kbengine
kbe/src/lib/python/Lib/encodings/cp037.py
266
13121
""" Python Character Mapping Codec cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
lgpl-3.0
7,037,566,738,572,221,000
41.739414
116
0.519092
false
luistorresm/odoo
addons/email_template/email_template.py
196
30189
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 Sharoon Thomas # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it ...
agpl-3.0
186,850,029,866,402,720
50.341837
151
0.572725
false
kaushik94/boto
boto/mws/__init__.py
429
1101
# Copyright (c) 2008, Chris Moyer http://coredumped.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, modify, ...
mit
-6,297,680,319,543,344,000
51.428571
74
0.770209
false
GoogleCloudPlatform/Data-Pipeline
app/src/pipelines/shardstage_test.py
1
3800
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
-4,107,881,364,371,993,600
35.893204
80
0.587632
false
dimm0/tacc_stats
tacc_stats/pickler/tests/pickler_test.py
1
4459
from __future__ import print_function import os, sys from nose import with_setup import cPickle as pickle from tacc_stats.pickler import job_pickles from tacc_stats.pickler import job_stats, batch_acct sys.modules['pickler.job_stats'] = job_stats sys.modules['pickler.batch_acct'] = batch_acct path = os.path.dirname(o...
lgpl-2.1
6,955,468,638,837,430,000
39.536364
146
0.545638
false
Slezhuk/ansible
lib/ansible/modules/network/nmcli.py
21
41915
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Chris Long <alcamie@gmail.com> <chlong@redhat.com> # # This file is a module for Ansible that interacts with Network Manager # # 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
-1,055,855,326,051,997,400
33.900083
150
0.578862
false
noisemaster/AdamTestBot
future/builtins/newround.py
2
3204
""" ``python-future``: pure Python implementation of Python 3 round(). """ from future.utils import PYPY, PY26, bind_method # Use the decimal module for simplicity of implementation (and # hopefully correctness). from decimal import Decimal, ROUND_HALF_EVEN def newround(number, ndigits=None): """ ...
mit
569,651,341,855,183,740
30.363636
89
0.609863
false
glwu/python-for-android
python-build/python-libs/xmpppy/xmpp/roster.py
203
9163
## roster.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## 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, or (at your option) ## any later version. ...
apache-2.0
1,597,796,118,777,687,600
48.798913
172
0.624141
false
Astrophilic/Algorithms_Example
Bitap Algorithm/Python/BiTap.py
9
6159
# -*- coding: utf-8 -*- import sys """Auxiliary procedure for printing each item of row in columns in binary form """ def _printTable(t, size): out = "" for i in range(len(t)): binaryForm = bin(t[i]) binaryForm = binaryForm[2 : ] binaryForm = binaryForm.zfill(size) out += binary...
apache-2.0
-6,937,071,466,671,167,000
39.052288
123
0.634465
false
cyberark-bizdev/ansible
lib/ansible/modules/clustering/k8s/k8s_raw.py
2
4093
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Chris Houseknecht <@chouseknecht> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
-321,503,115,781,719,200
24.110429
105
0.658441
false
LookThisCode/DeveloperBus
Season 2013/Brazil/Projects/QueroMe-master/openid/test/discoverdata.py
87
4109
"""Module to make discovery data test cases available""" import urlparse import os.path from openid.yadis.discover import DiscoveryResult, DiscoveryFailure from openid.yadis.constants import YADIS_HEADER_NAME tests_dir = os.path.dirname(__file__) data_path = os.path.join(tests_dir, 'data') testlist = [ # success, i...
apache-2.0
-7,413,361,997,418,337,000
31.872
72
0.577269
false
urisimchoni/samba
python/samba/tests/dcerpc/string.py
9
4393
# Unix SMB/CIFS implementation. # Copyright (C) Andrew Bartlett <abartlet@samba.org> 2016 # # 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)...
gpl-3.0
-789,884,531,257,083,000
32.030075
73
0.64967
false
brandsoulmates/incubator-airflow
airflow/utils/operator_helpers.py
30
1546
# -*- 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,152,516,698,229,415,000
38.641026
89
0.699871
false
demarle/VTK
Examples/Modelling/Python/SpherePuzzle.py
14
3824
#!/usr/bin/env python # A game with VTK and Tkinter. :) import Tkinter import vtk from vtk.tk.vtkTkRenderWindowInteractor import vtkTkRenderWindowInteractor # Create the pipeline puzzle = vtk.vtkSpherePuzzle() mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(puzzle.GetOutputPort()) actor = vtk.vtkActor() a...
bsd-3-clause
3,958,530,549,741,020,000
22.460123
74
0.699006
false
koomik/CouchPotatoServer
libs/caper/__init__.py
81
5426
# Copyright 2013 Dean Gardiner <gardiner91@gmail.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 law or a...
gpl-3.0
4,125,948,053,443,144,000
26.825641
84
0.533727
false
TEAM-Gummy/platform_external_chromium_org
tools/telemetry/telemetry/core/backends/chrome/inspector_runtime_unittest.py
25
1042
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.core import exceptions from telemetry.unittest import tab_test_case class InspectorRuntimeTest(tab_test_case.TabTestCase): def testRuntimeEv...
bsd-3-clause
-1,642,055,858,081,244,400
32.612903
72
0.676583
false
MiltosD/CEFELRC
lib/python2.7/site-packages/django/middleware/http.py
154
1696
from django.core.exceptions import MiddlewareNotUsed from django.utils.http import http_date, parse_http_date_safe class ConditionalGetMiddleware(object): """ Handles conditional GET operations. If the response has a ETag or Last-Modified header, and the request has If-None-Match or If-Modified-Since, ...
bsd-3-clause
-5,667,663,759,282,940,000
46.111111
84
0.629717
false
littley/pyvolution
internal/BreedingPool.py
1
3508
import random import math class BreedingPool(object): """ This class is a container for Chromosomes. Allows efficient selection of chromosomes to be "bred". This class implements a binary tree """ class node(): """ Each node represents the "value" of a single chromosome. Used to...
apache-2.0
5,555,422,844,769,349,000
30.330357
120
0.540764
false
GodBlessPP/w16b_test
static/Brython3.1.3-20150514-095342/Lib/numbers.py
883
10398
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for numbers, according to PEP 3141. TODO: Fill out more detailed documentation on the operators.""" from abc import ABCMeta, abstractmethod __all__ = ["Number", "Complex", "Real", "Rat...
agpl-3.0
-1,816,912,727,000,814,600
25.390863
80
0.597711
false
kw217/omim
3party/protobuf/python/google/protobuf/internal/message_python_test.py
74
2359
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
apache-2.0
7,464,430,236,552,387,000
42.685185
74
0.778296
false
nekulin/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/distutils/cygwinccompiler.py
50
17299
"""distutils.cygwinccompiler Provides the CygwinCCompiler class, a subclass of UnixCCompiler that handles the Cygwin port of the GNU C compiler to Windows. It also contains the Mingw32CCompiler class which handles the mingw32 port of GCC (same as cygwin in no-cygwin mode). """ # problems: # # * if you use a msvc com...
apache-2.0
1,542,957,634,429,855,000
37.700224
88
0.558876
false