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
duyet-website/api.duyet.net
lib/flask/testsuite/__init__.py
564
7022
# -*- coding: utf-8 -*- """ flask.testsuite ~~~~~~~~~~~~~~~ Tests Flask itself. The majority of Flask is already tested as part of Werkzeug. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import print_function import os import sys im...
mit
-1,463,234,021,303,636,000
27.544715
79
0.600826
false
Nirvedh/CoarseCoherence
src/arch/x86/isa/insts/simd128/integer/data_reordering/unpack_and_interleave.py
91
5843
# Copyright (c) 2007 The Hewlett-Packard Development Company # 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 implemen...
bsd-3-clause
3,458,599,504,992,559,000
30.583784
72
0.694506
false
switchyrascal/beeps
test/beeps/controllers/test_plancontroller.py
1
27725
# Copyright © 2012-2015 Jonty Pearson. # # This file is part of Beeps. # # Beeps is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
gpl-3.0
2,481,457,002,851,311,600
45.989831
150
0.732326
false
renegelinas/mi-instrument
mi/dataset/parser/spkir_abj_dcl.py
5
14646
#!/usr/bin/env python """ @package mi.dataset.parser.spkir_abj_dcl @file marine-integrations/mi/dataset/parser/spkir_abj_dcl.py @author Steve Myerson @brief Parser for the spkir_abj_dcl dataset driver This file contains code for the spkir_abj_dcl parsers and code to produce data particles. For telemetered data, there...
bsd-2-clause
2,326,846,086,161,012,700
39.126027
104
0.611839
false
himacro/Vintageous
ex/parser/scanner_command_write_and_quit_all.py
9
1591
from .state import EOF from .tokens import TokenEof from .tokens_base import TOKEN_COMMAND_WRITE_AND_QUIT_ALL from .tokens_base import TokenOfCommand from Vintageous import ex from Vintageous.ex.ex_error import ERR_INVALID_ARGUMENT from Vintageous.ex.ex_error import VimError plus_plus_translations = { 'ff': 'fil...
mit
5,719,361,145,746,287,000
26.912281
103
0.590195
false
DianaDespa/marian-train
contrib/vim/.ycm_extra_conf.py
7
5255
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
mit
3,280,157,860,109,356,000
33.346405
80
0.707326
false
Nick-Hall/gramps
gramps/gen/lib/src.py
8
15993
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2010 Michiel D. Nauta # Copyright (C) 2011 Tim G L Lyons # Copyright (C) 2013 Doug Blank <doug.blank@gmail.com> # Copyright (C) 2017 Nick Hall # # This program is free software; you...
gpl-2.0
-3,088,902,356,311,433,700
36.106729
82
0.530482
false
unreal666/youtube-dl
youtube_dl/extractor/instagram.py
3
13288
from __future__ import unicode_literals import itertools import hashlib import json import re from .common import InfoExtractor from ..compat import ( compat_str, compat_HTTPError, ) from ..utils import ( ExtractorError, get_element_by_attribute, int_or_none, lowercase_escape, std_headers,...
unlicense
-6,490,519,569,618,890,000
35.808864
106
0.450557
false
apple/swift-lldb
packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py
13
2526
"""Test lldb's expression evaluations and collect statistics.""" from __future__ import print_function import sys import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbbench import * from lldbsuite.test.lldbtest import * from lldbsuite.test import configuration from lldbsuite.test import lldbut...
apache-2.0
7,554,860,002,284,278,000
29.804878
77
0.578781
false
sdg-mit/gitless
setup.py
1
2370
#!/usr/bin/env python # -*- coding: utf-8 -*- import ast import re import sys from setuptools import setup _version_re = re.compile(r'__version__\s+=\s+(.*)') with open('gitless/cli/gl.py', 'rb') as f: version = str(ast.literal_eval(_version_re.search( f.read().decode('utf-8')).group(1))) # Build helper ...
mit
8,401,610,538,682,015,000
27.214286
78
0.64557
false
lzpfmh/electron
script/upload-windows-pdb.py
156
1174
#!/usr/bin/env python import os import glob import sys from lib.config import s3_config from lib.util import atom_gyp, execute, rm_rf, safe_mkdir, s3put SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) SYMBOLS_DIR = 'dist\\symbols' DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\libchr...
mit
2,435,537,939,567,535,600
23.458333
74
0.663543
false
cruzegoodin/TSC-ShippingDetails
flask/lib/python2.7/site-packages/whoosh/lang/__init__.py
71
4308
# coding=utf-8 # Copyright 2012 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of co...
bsd-3-clause
-3,488,715,890,363,436,500
29.607143
78
0.6014
false
ruchee/vimrc
vimfiles/bundle/vim-python/submodules/pylint/tests/functional/e/excess_escapes.py
2
1040
# pylint:disable=pointless-string-statement, fixme, misplaced-comparison-constant, comparison-with-itself """Stray backslash escapes may be missing a raw-string prefix.""" __revision__ = '$Id$' # Bad escape sequences, which probably don't do what you expect. A = "\[\]\\" # [anomalous-backslash-in-string,anomalous-ba...
mit
5,189,513,768,835,509,000
31.5
105
0.694231
false
allo-/feedjack
feedjack/migrations.south/0015_auto__add_field_feed_skip_errors.py
2
9139
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Feed.skip_errors' db.add_column('feedjack_feed', 'skip_errors', self.g...
bsd-3-clause
292,323,603,956,105,540
72.709677
181
0.545136
false
fishroot/nemoa
nemoa/base/nbase.py
1
18737
# -*- coding: utf-8 -*- """Base classes.""" __author__ = 'Patrick Michl' __email__ = 'frootlab@gmail.com' __license__ = 'GPLv3' __docformat__ = 'google' from pathlib import Path from nemoa.base import entity, check, ndict, env from nemoa.types import Any, ClassVar, Dict, OptInt, OptStr, PathLike class ObjectIP: ...
gpl-3.0
2,705,300,763,946,531,300
31.083904
79
0.570529
false
simongoffin/website_version
addons/report_intrastat/__openerp__.py
116
1888
# -*- 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,186,504,309,289,817,000
37.530612
82
0.599576
false
chris-chris/tensorflow
tensorflow/python/training/moving_averages.py
41
20098
# 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
-3,701,441,313,788,508,000
40.958246
80
0.675042
false
ita1024/samba
third_party/waf/wafadmin/Tools/suncxx.py
48
1840
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006 (ita) # Ralf Habacker, 2006 (rh) import os, optparse import Utils, Options, Configure import ccroot, ar from Configure import conftest @conftest def find_sxx(conf): v = conf.env cc = None if v['CXX']: cc = v['CXX'] elif 'CXX' in conf.environ: cc = conf.e...
gpl-3.0
-7,500,031,606,856,537,000
23.533333
86
0.573913
false
etxc/namebench
nb_third_party/dns/rdtypes/ANY/CERT.py
248
4263
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
-8,183,175,487,415,405,000
31.541985
79
0.611776
false
ssorgatem/qiime
tests/test_core_microbiome.py
15
4217
#!/usr/bin/env python # File created on 08 Jun 2012 from __future__ import division __author__ = "Greg Caporaso" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = ["Greg Caporaso"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Greg Caporaso" __email__ = "gregcaporaso@gmail.com" from...
gpl-2.0
-5,947,229,993,245,698,000
55.986486
908
0.526678
false
splunk/splunk-webframework
contrib/django/django/contrib/gis/gdal/base.py
224
1155
from ctypes import c_void_p from django.contrib.gis.gdal.error import GDALException from django.utils import six class GDALBase(object): """ Base object for GDAL objects that has a pointer access property that controls access to the underlying C pointer. """ # Initially the pointer is NULL. _p...
apache-2.0
5,080,525,172,835,518,000
31.083333
95
0.632035
false
ageazrael/godot
modules/mono/config.py
3
6083
import imp import os import sys from SCons.Script import BoolVariable, Environment, Variables monoreg = imp.load_source('mono_reg_utils', 'modules/mono/mono_reg_utils.py') def find_file_in_dir(directory, files, prefix='', extension=''): if not extension.startswith('.'): extension = '.' + extension ...
mit
-1,885,713,694,005,796,900
32.059783
117
0.570278
false
augustomatheuss/myjoy
src/myjoy.py
1
3782
# Copyright (c) 2015, Augusto Damasceno. # All rights reserved. # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions ...
bsd-2-clause
-8,496,281,784,079,442,000
41.977273
88
0.637758
false
crepererum/invenio
invenio/modules/oaiharvester/tasks/harvesting.py
13
8009
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
gpl-2.0
6,134,715,825,674,059,000
36.957346
85
0.624298
false
taohaoge/vincent
vincent/marks.py
9
3996
# -*- coding: utf-8 -*- """ Marks: Classes to define Vega Marks """ from .core import grammar, GrammarClass, KeyedList from .values import ValueRef from .properties import PropertySet from ._compat import str_types class MarkProperties(GrammarClass): """Sets of all Mark properties Mark properties can chang...
mit
-7,876,248,159,342,856,000
28.6
79
0.597097
false
dfunckt/django
tests/get_earliest_or_latest/tests.py
12
6850
from __future__ import unicode_literals from datetime import datetime from django.test import TestCase from .models import Article, IndexErrorArticle, Person class EarliestOrLatestTests(TestCase): """Tests for the earliest() and latest() objects methods""" def tearDown(self): """Makes sure Article...
bsd-3-clause
-6,846,425,904,974,773,000
39.532544
95
0.612701
false
mmauroy/SickRage
lib/sqlalchemy/ext/associationproxy.py
76
33046
# ext/associationproxy.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Contain the ``AssociationProxy`` class. The ``AssociationProxy`` is a Pyth...
gpl-3.0
6,393,086,826,157,728,000
30.382716
84
0.581916
false
J861449197/edx-platform
common/lib/xmodule/xmodule/contentstore/mongo.py
51
20789
import pymongo import gridfs from gridfs.errors import NoFile from xmodule.contentstore.content import XASSET_LOCATION_TAG import logging from .content import StaticContent, ContentStore, StaticContentStream from xmodule.exceptions import NotFoundError from fs.osfs import OSFS import os import json from bson.son imp...
agpl-3.0
8,510,748,736,491,291,000
41.168357
121
0.578094
false
castroflavio/ryu
ryu/contrib/tinyrpc/exc.py
44
1239
#!/usr/bin/env python # -*- coding: utf-8 -*- class RPCError(Exception): """Base class for all excetions thrown by :py:mod:`tinyrpc`.""" class BadRequestError(RPCError): """Base class for all errors that caused the processing of a request to abort before a request object could be instantiated.""" de...
apache-2.0
-4,202,040,209,265,694,000
29.975
79
0.697337
false
sundresh/organize_photos
main/exif_cache.py
1
6076
# # organize_photos.py: (C) 2011-2014 Sameer Sundresh. No warranty. # # exif_cache.py is a helper for organize_photos.py # # It maintains a cache file exif_cache.json in the source directory that # keeps track of which files have already been copied out of that source # directory, including where they were copied and t...
agpl-3.0
3,503,629,716,021,574,700
39.506667
95
0.60056
false
timedcy/python-goose
goose/article.py
9
3085
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by Xavier Grangier for Recrutae Gravity.co...
apache-2.0
-5,399,423,943,165,036,000
31.135417
84
0.652188
false
m11s/MissionPlanner
Lib/site-packages/scipy/misc/doccer.py
55
3935
''' Utilities to allow inserting docstring fragments for common parameters into function and method docstrings''' import sys def docformat(docstring, docdict=None): ''' Fill a function docstring from variables in dictionary Adapt the indent of the inserted docs Parameters ---------- docstring : ...
gpl-3.0
1,370,763,946,041,247,700
28.148148
76
0.614231
false
vacancy/TensorArtist
tartist/nn/optimizer/grad_modifier.py
1
3480
# -*- coding:utf8 -*- # File : grad_modifier.py # Author : Jiayuan Mao # Email : maojiayuan@gmail.com # Date : 1/28/17 # # This file is part of TensorArtist. import tensorflow as tf from ..tfutils import clean_name from ...core.logger import get_logger from ...core.utils.match import NameMatcher logger = get_l...
mit
2,537,123,683,788,178,000
26.619048
117
0.576724
false
william-richard/moto
tests/test_ec2/test_vpn_connections.py
2
2787
from __future__ import unicode_literals import boto import boto3 import pytest import sure # noqa from boto.exception import EC2ResponseError from moto import mock_ec2, mock_ec2_deprecated @mock_ec2_deprecated def test_create_vpn_connections(): conn = boto.connect_vpc("the_key", "the_secret") vpn_connection...
apache-2.0
-3,591,734,099,145,872,000
36.16
81
0.701112
false
Moriadry/tensorflow
tensorflow/contrib/distributions/python/ops/quantized_distribution.py
81
17379
# 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
6,139,454,608,078,837,000
33.143418
83
0.601358
false
andreparames/odoo
addons/account_bank_statement_extensions/report/bank_statement_balance_report.py
378
2723
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
6,009,245,642,738,804,000
41.546875
116
0.598972
false
softak/webfaction_demo
vendor-local/lib/python/django_any/contrib/auth.py
3
1115
# -*- coding: utf-8 -*- from django.contrib.auth.models import User, Permission, Group from django_any import any_model def any_user(password=None, permissions=[], groups=[], **kwargs): """ Shortcut for creating Users Permissions could be a list of permission names If not specified, creates active, n...
bsd-3-clause
-8,831,076,806,846,703,000
28.342105
78
0.637668
false
isandlaTech/cohorte-runtime
python/src/lib/python/jinja2/ext.py
603
25078
# -*- coding: utf-8 -*- """ jinja2.ext ~~~~~~~~~~ Jinja extensions allow to add custom tags similar to the way django custom tags work. By default two example extensions exist: an i18n and a cache extension. :copyright: (c) 2010 by the Jinja Team. :license: BSD. """ from jinja2 import nod...
apache-2.0
5,159,654,526,291,423,000
38.430818
81
0.606707
false
N-Parsons/exercism-python
exercises/rectangles/example.py
2
2901
import itertools class corners(object): def __init__(self, i, j): # i, j are position of corner self.i = i self.j = j def __str__(self): return "[" + str(self.i) + ", " + str(self.j) + "]" # return corner on the same line def same_line(index, list): for c in list: ...
mit
7,508,009,135,986,596,000
25.135135
78
0.554636
false
sippy/b2bua
sippy/UasStateTrying.py
1
7753
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved. # Copyright (c) 2006-2014 Sippy Software, Inc. All rights reserved. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistrib...
bsd-2-clause
-432,909,464,323,048,770
48.382166
105
0.617309
false
whr20120503/wy
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/mac_tool.py
377
19309
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. ""...
mit
-8,215,567,836,340,460,000
36.786693
80
0.673054
false
jun66j5/trac-ja
trac/tests/perm.py
1
14135
# -*- coding: utf-8 -*- # # Copyright (C) 2004-2013 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consi...
bsd-3-clause
-2,807,932,945,174,019,600
40.819527
79
0.600637
false
nguy/PyDisdrometer
pydsd/utility/expfit.py
3
2022
import numpy as np from scipy.optimize import curve_fit def expfit(x, y): """ expfit calculates an exponential power law fit based upon levenburg-marquardt minimization. Fits are of the form. y = ax**b Parameters: ----------- x: array_like independent variable y: array_like ...
lgpl-2.1
-2,990,485,505,601,125,000
24.594937
101
0.606825
false
ryepdx/shipping_api
report/summary_report.py
1
2179
# -*- 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
-4,062,300,994,077,641,700
39.37037
107
0.598899
false
eric-stanley/RetroArch
gfx/glsym/glgen.py
4
4663
#!/usr/bin/env python3 """ License statement applies to this file (glgen.py) only. """ """ 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 limi...
gpl-3.0
6,069,777,845,376,129,000
34.59542
217
0.62063
false
mdrumond/tensorflow
tensorflow/python/profiler/tfprof_logger_test.py
52
2982
# 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,156,236,285,362,299,000
36.275
80
0.666331
false
urandu/rethinkdb
external/v8_3.30.33.16/tools/stats-viewer.py
143
15033
#!/usr/bin/env python # # Copyright 2008 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # noti...
agpl-3.0
3,964,033,559,789,936,000
30.849576
79
0.653762
false
tomkralidis/inasafe
safe/gui/tools/wizard_dialog.py
1
179113
# coding=utf-8 """ InaSAFE Disaster risk assessment tool by AusAid **GUI InaSAFE Wizard Dialog.** Contact : ole.moller.nielsen@gmail.com .. note:: 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 Found...
gpl-3.0
-5,908,274,928,395,027,000
39.141865
79
0.583704
false
Drahflow/lymph
lymph/web/wsgi_server.py
11
1200
import logging from gevent.pywsgi import WSGIServer, WSGIHandler logger = logging.getLogger(__name__) class LymphWSGIHandler(WSGIHandler): def format_request(self): # XXX(Mouad): Copied shamessly from gevent.pywsgi.WSGIHandler's format_request # and removed only the datetime from the output, s...
apache-2.0
-946,782,471,492,515,700
33.285714
114
0.624167
false
user-none/calibre
src/calibre/ebooks/oeb/polish/tests/base.py
14
3643
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import os, unittest, shutil from calibre import CurrentDir from calibre.pte...
gpl-3.0
6,065,995,719,595,907,000
33.367925
110
0.576722
false
mojeto/django
django/contrib/gis/db/models/sql/conversion.py
11
2426
""" This module holds simple classes to convert geospatial values from the database. """ from decimal import Decimal from django.contrib.gis.db.models.fields import GeoSelectFormatMixin from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.measure import Area, Distance class BaseField: ...
bsd-3-clause
3,402,006,066,017,740,300
28.228916
81
0.66488
false
abinashk-inf/AstroBox
src/ext/sockjs/tornado/transports/rawwebsocket.py
9
2637
# -*- coding: utf-8 -*- """ sockjs.tornado.transports.rawwebsocket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Raw websocket transport implementation """ import logging import socket from sockjs.tornado import websocket, session from sockjs.tornado.transports import base LOG = logging.getLogger("tornado.gener...
agpl-3.0
-5,703,634,699,476,184,000
27.354839
87
0.614714
false
rnyberg/pyfibot
pyfibot/modules/available/module_forecast.py
2
1114
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function, division import logging log = logging.getLogger("forecast") has_pywapi = False try: import pywapi has_pywapi = True except: log.error('Error loading library pywapi. Library not found.') def fahrenheit_to_celcius(f): re...
bsd-3-clause
5,223,996,139,730,087,000
27.512821
80
0.596223
false
jonhadfield/linkchecker
linkcheck/gui/syntax.py
7
3578
# -*- coding: iso-8859-1 -*- # Copyright (C) 2011-2014 Bastian Kleineidam # # 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 versi...
gpl-2.0
7,163,881,046,305,214,000
35.510204
73
0.604807
false
szeged/servo
tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/_code/code.py
32
32343
from __future__ import absolute_import, division, print_function import inspect import sys import traceback from inspect import CO_VARARGS, CO_VARKEYWORDS import attr import re from weakref import ref from _pytest.compat import _PY2, _PY3, PY35, safe_str from six import text_type import py builtin_repr = repr if _PY...
mpl-2.0
756,837,724,535,387,500
32.343299
117
0.554834
false
csdl/makahiki
makahiki/apps/managers/predicate_mgr/predicate_mgr.py
2
15003
'''Manager for predicates. Created on Jun 15, 2013 @author: Cam Moore ''' import sys import inspect from apps.managers.challenge_mgr.models import RoundSetting, GameInfo from apps.widgets.smartgrid_library.models import LibraryEvent, LibraryAction from apps.widgets.smartgrid_design.models import DesignerLevel, Design...
mit
-7,216,325,315,947,898,000
38.585752
99
0.659601
false
robosafe/testbench_vRAL_hydro
bert2_simulator/sim_step_monitors/AM_ifSensorsNotOK_notRelease.py
1
6001
#!/usr/bin/env python """ AM_ifSensorsNotOK_notRelease Assertion monitor For use in Human-Robot Interaction simulator. Created by David Western, July 2015. Implements assertion: if human is ready and NOT sensorsOk and contact_robot_hand_and_object ==1 then assert after T, contact_robot_hand_and_object == 1 (robot d...
gpl-3.0
-6,965,395,529,337,508,000
35.150602
151
0.63906
false
RPGOne/Skynet
scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/examples/linear_model/plot_iris_logistic.py
283
1678
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logistic Regression 3-class Classifier ========================================================= Show below is a logistic-regression classifiers decision boundaries on the `iris <http://en.wikipedia.org/wiki/Iris_f...
bsd-3-clause
-6,047,827,956,118,446,000
27.423729
76
0.632081
false
m-ochi/RiotGameApiChallenge2016
lolcrawler.py
1
3730
#!/usr/local/bin/python # -*- coding: utf-8 -*- ''' Created on Oct 20, 2015 クロールの流れ 1.FeaturedGamesで最近のゲームを取得 2.ParticipantsのSummonerNamesを取得 3.SummonerNamesを使ってSummonerIdを取得 4.SummonerIdを使ってSummonerGamesを取得 5.SummonerGamesからMatchStatsを取得 6.保存 @author: ochi ''' import urllib2 import urllib import json import lolapi...
apache-2.0
-979,281,018,528,778,800
28.933884
92
0.551353
false
Pexego/odoo
addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.py
374
5518
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
-7,923,142,380,941,902,000
39.277372
102
0.554549
false
sangoma/sangoma-sbc-provisioning
common/attr/validators.py
1
3489
""" Commonly useful validators. """ from __future__ import absolute_import, division, print_function from ._make import attr, attributes @attributes(repr=False, slots=True) class _InstanceOfValidator(object): type = attr() def __call__(self, inst, attr, value): """ We use a callable class t...
gpl-2.0
-5,579,103,273,543,965,000
29.605263
79
0.60963
false
GenericStudent/home-assistant
homeassistant/components/picotts/tts.py
26
1854
"""Support for the Pico TTS speech service.""" import logging import os import shutil import subprocess import tempfile import voluptuous as vol from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider _LOGGER = logging.getLogger(__name__) SUPPORT_LANGUAGES = ["en-US", "en-GB", "de-DE", "es-ES"...
apache-2.0
-3,127,726,662,319,629,000
26.264706
78
0.61219
false
davidvoler/ate_meteor
launcher/api/python/notifier/notify_monitor.py
1
2261
import requests import redis from requests.exceptions import Timeout, ConnectionError, HTTPError import json import time from tornado.options import options import config from ate_logger import AteLogger class NotifyMonitor(object): def __init__(self, logger=None): if logger: self.__logger = ...
mit
-868,136,828,224,130,800
32.25
114
0.636886
false
zcm19900902/picasso-graphic
tools/gyp/pylib/gyp/SCons.py
253
5848
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ SCons generator. This contains class definitions and supporting functions for generating pieces of SCons files for the different types of GYP targets. """ im...
bsd-3-clause
8,385,293,136,331,921,000
28.386935
77
0.64894
false
zcbenz/cefode-chromium
chrome/test/pyautolib/omnibox_info.py
69
4320
# Copyright (c) 2011 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. """Python representation for Chromium Omnibox. Obtain one of these from PyUITestSuite::GetOmniboxInfo() call. Example: class MyTest(pyauto.PyUITest): ...
bsd-3-clause
-5,654,108,129,798,670,000
29.857143
79
0.622222
false
cernops/nova
nova/console/websocketproxy.py
4
6962
# Copyright (c) 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-2.0 # # Unless ...
apache-2.0
4,487,071,705,288,082,000
39.242775
78
0.606148
false
tutorcruncher/morpheus
morpheus/app/patches.py
1
7326
import asyncio from atoolbox import patch from atoolbox.db.helpers import run_sql_section from textwrap import dedent, indent from time import time from tqdm import tqdm @patch async def run_logic_sql(conn, settings, **kwargs): """ run the "logic" section of models.sql """ await run_sql_section('logic...
mit
-4,704,837,679,300,637,000
34.736585
120
0.644554
false
hgl888/chromium-crosswalk-efl
tools/telemetry/telemetry/results/page_test_results.py
32
6232
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import copy import traceback from telemetry import value as value_module from telemetry.results import page_run from telemetry.results im...
bsd-3-clause
8,316,439,513,002,947,000
33.054645
75
0.693999
false
takis/django
tests/template_tests/syntax_tests/test_regroup.py
367
3984
from datetime import date from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class RegroupTagTests(SimpleTestCase): @setup({'regroup01': '' '{% regroup data by bar as grouped %}' '{% for group in gro...
bsd-3-clause
3,075,434,005,305,183,700
38.058824
77
0.443273
false
defionscode/ansible
test/units/modules/network/f5/test_bigip_firewall_dos_profile.py
8
3629
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys from nose.plugins.skip i...
gpl-3.0
-3,020,930,308,509,654,000
31.990909
91
0.680628
false
harlanhaskins/swift
utils/gyb_syntax_support/PatternNodes.py
12
3648
from Child import Child from Node import Node # noqa: I201 PATTERN_NODES = [ # type-annotation -> ':' type Node('TypeAnnotation', kind='Syntax', children=[ Child('Colon', kind='ColonToken'), Child('Type', kind='Type'), ]), # enum-case-pattern -> type-identifie...
apache-2.0
-6,545,401,852,280,253,000
32.46789
73
0.514803
false
xiaoyaozi5566/DiamondCache
src/mem/slicc/symbols/SymbolTable.py
14
5906
# 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...
bsd-3-clause
-5,852,742,959,842,511,000
32.748571
75
0.635963
false
kanagasabapathi/python-for-android
python-modules/twisted/twisted/manhole/_inspectro.py
62
10118
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """An input/output window for the glade reactor inspector. """ import time import gtk import gobject import gtk.glade from twisted.python.util import sibpath from twisted.python import reflect from twisted.manhole.ui import gtk2manhol...
apache-2.0
2,285,607,363,313,309,000
26.420054
78
0.568492
false
nkrinner/nova
nova/cells/filters/target_cell.py
26
2862
# Copyright (c) 2012-2013 Rackspace Hosting # 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 # # Unles...
apache-2.0
4,194,269,038,920,204,000
37.675676
78
0.665968
false
clemkoa/scikit-learn
examples/plot_johnson_lindenstrauss_bound.py
39
7489
r""" ===================================================================== The Johnson-Lindenstrauss bound for embedding with random projections ===================================================================== The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly projected i...
bsd-3-clause
8,605,176,948,871,718,000
36.633166
100
0.722793
false
mearleycf/mwepd
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/ninja_test.py
610
1611
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import sys import TestCommon ...
gpl-2.0
8,053,624,731,567,576,000
35.613636
74
0.646803
false
clairetang6/bokeh
examples/embed/simple/simple.py
4
2031
'''This example demonstrates embedding a standalone Bokeh document into a simple Flask application, with a basic HTML web form. To view the example, run: python simple.py in this directory, and navigate to: http://localhost:5000 ''' from __future__ import print_function import flask from bokeh.embed impo...
bsd-3-clause
-7,129,391,511,357,709,000
24.3875
93
0.642541
false
devcline/mtasa-blue
vendor/google-breakpad/src/testing/test/gmock_leak_test.py
224
3584
#!/usr/bin/env python # # Copyright 2009, 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...
gpl-3.0
8,672,953,853,256,990,000
38.822222
80
0.686942
false
shaufi/odoo
openerp/addons/base/ir/ir_model.py
148
62274
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
-3,361,404,553,823,068,700
47.31187
207
0.558371
false
upworkgluu71/CE_v1
genSchemaMarkdown.py
3
3430
#!/usr/bin/python # MIT License # # Copyright 2014 Gluu, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software # and associated documentation files (the Software), to deal in the Software without restriction, # including without limitation the rights to use, copy, modif...
mit
5,584,636,900,356,251,000
34
97
0.604665
false
efajardo/osg-test
osgtest/tests/test_170_pbs.py
1
5425
import os import time from datetime import date import osgtest.library.core as core import osgtest.library.files as files import osgtest.library.osgunittest as osgunittest import osgtest.library.service as service class TestStartPBS(osgunittest.OSGTestCase): pbs_config = """ create queue batch queue_type=executi...
apache-2.0
1,993,299,584,414,067,700
44.208333
106
0.619171
false
camargoanderso/thumbor
thumbor/storages/redis_storage.py
11
4960
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/globocom/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com import logging import inspect from json import loads, dumps from da...
mit
6,211,598,423,491,158,000
28.005848
78
0.617339
false
Earthson/RecGen
recgen.py
2
4323
#!/usr/bin/env python import sys import types from traceback import format_exc def rec_gen(func, callback=None, err_callback=None): ''' callback accept arguments with output of func err_callback is called after Exception occured, accept Exception instance as it's arguments ''' def trans_func(*args...
mit
-5,362,806,630,386,945,000
29.878571
96
0.547768
false
mdworks2016/work_development
Python/05_FirstPython/Chapter9_WebApp/fppython_develop/lib/python3.7/site-packages/pip/_vendor/pep517/wrappers.py
22
5912
from contextlib import contextmanager import os from os.path import dirname, abspath, join as pjoin import shutil from subprocess import check_call import sys from tempfile import mkdtemp from . import compat _in_proc_script = pjoin(dirname(abspath(__file__)), '_in_process.py') @contextmanager def tempdir(): td...
apache-2.0
-6,558,537,575,456,037,000
35.269939
79
0.633457
false
chipx86/reviewboard
reviewboard/diffviewer/filetypes.py
10
2625
from __future__ import unicode_literals import re # A list of regular expressions for headers in the source code that we can # display in collapsed regions of diffs and diff fragments in reviews. HEADER_REGEXES = { '.cs': [ re.compile( r'^\s*((public|private|protected|static)\s+)+' ...
mit
-7,895,959,472,329,690,000
26.061856
74
0.400762
false
mohamed--abdel-maksoud/chromium.src
third_party/libxml/src/check-xinclude-test-suite.py
347
5333
#!/usr/bin/python import sys import time import os import string sys.path.insert(0, "python") import libxml2 # # the testsuite description # DIR="xinclude-test-suite" CONF="testdescr.xml" LOG="check-xinclude-test-suite.log" log = open(LOG, "w") os.chdir(DIR) test_nr = 0 test_succeed = 0 test_failed = 0 test_error =...
bsd-3-clause
2,339,830,988,688,862,700
23.131222
85
0.591224
false
sdiehl/numpile
numpile.py
1
29002
# LLVM based numeric specializer in 1000 lines. from __future__ import print_function from functools import reduce import sys import ast import types import ctypes import inspect import pprint import string import numpy as np from textwrap import dedent from collections import deque, defaultdict from llvmlite import...
mit
9,192,580,984,235,952,000
28.031031
83
0.562306
false
RannyeriDev/Solfege
tools/screenshot.py
5
1316
#!/usr/bin/python import os import sys import re from subprocess import * import time def run(cmd): print "run:", cmd os.system(cmd) def get_image_dim(fn): output = Popen(["file", fn], stdout=PIPE).communicate()[0] r = re.compile("(\d+)\s*x+\s*(\d+)") m = r.search(output) if m: return...
gpl-3.0
-2,471,564,551,908,236,300
22.927273
68
0.570669
false
AyoubZahid/odoo
addons/hr_recruitment/models/hr_job.py
37
5037
# Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import _, api, fields, models class Job(models.Model): _inherit = "hr.job" _name = "hr.job" _inherits = {'mail.alias': 'alias_id'} @api.model def _default_address_id(self): return self.env.user.compan...
gpl-3.0
-2,836,516,430,629,853,000
45.638889
190
0.609887
false
jyotikamboj/container
django/contrib/admin/__init__.py
160
1237
# ACTION_CHECKBOX_NAME is unused, but should stay since its import from here # has been referenced in documentation. from django.contrib.admin.decorators import register from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME from django.contrib.admin.options import (HORIZONTAL, VERTICAL, ModelAdmin, StackedI...
mit
-3,329,540,222,273,793,000
44.814815
79
0.789814
false
ScreamingUdder/mantid
Framework/PythonInterface/test/python/mantid/geometry/IPeakTest.py
1
6523
import unittest from mantid.kernel import V3D from mantid.simpleapi import CreateSimulationWorkspace, CreatePeaksWorkspace import numpy as np import numpy.testing as npt class IPeakTest(unittest.TestCase): def setUp(self): # IPeak cannot currently be instatiated so this is a quick way # getting a...
gpl-3.0
-5,101,369,517,707,989,000
34.069892
93
0.635291
false
aeklant/scipy
scipy/ndimage/__init__.py
4
4755
""" ========================================================= Multidimensional image processing (:mod:`scipy.ndimage`) ========================================================= .. currentmodule:: scipy.ndimage This package contains various functions for multidimensional image processing. Filters ======= .. autosum...
bsd-3-clause
6,112,507,694,913,354,000
28.171779
74
0.724501
false
samsara/samsara
clients/python/samsara_sdk/constants.py
2
1329
# -*- coding: utf-8 -*- """ samsara_sdk.constants ~~~~~~~~~~~~~~~~~~~~~ Samsara SDK client constants """ # Samara specific HTTP Header PUBLISHED_TIMESTAMP_HEADER = "X-Samsara-publishedTimestamp" API_PATH = '/v1/events' DEFAULT_CONFIG = { # a samsara ingestion api endpoint "http://samsara-ingestion.lo...
apache-2.0
-6,348,739,950,510,200,000
26.122449
73
0.662152
false
junhuac/MQUIC
depot_tools/git_rebase_update.py
1
11254
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Tool to update all branches to have the latest changes from their upstreams. """ import argparse import collections import logging...
mit
8,658,482,790,569,833,000
33.415902
79
0.641639
false
MultiPath/Dep-Compo
execute.py
1
1033
#/usr/bin/python2.7 #*-coding:utf-8-*- from structure import DependencyTree from DepNN import DepNN #Main class to execute the task. class Execute(object): def __init__(self): self.depnn = DepNN() self.depnn.extendLookUp('../data/depcheck2') self.depnn.load_wordvector('../data/word-vec.bin'...
gpl-2.0
-6,566,271,291,311,976,000
27.694444
68
0.619555
false
FreeAgent/djangoappengine-starter
djangotoolbox/middleware.py
85
2801
from django.conf import settings from django.http import HttpResponseRedirect from django.utils.cache import patch_cache_control LOGIN_REQUIRED_PREFIXES = getattr(settings, 'LOGIN_REQUIRED_PREFIXES', ()) NO_LOGIN_REQUIRED_PREFIXES = getattr(settings, 'NO_LOGIN_REQUIRED_PREFIXES', ()) ALLOWED_DOMAINS = getattr(setting...
bsd-3-clause
-1,271,916,617,337,417,700
44.177419
80
0.640843
false
soasme/rio
tests/blueprints/dashboard/test_views.py
1
1243
# -*- coding: utf-8 -*- from flask import url_for from flask_login import login_user def test_new_project_require_name(client, login): resp = client.post(url_for('dashboard.new_project'), data={'name': ''}) assert resp.status_code == 400 assert resp.json['errors']['name'] def test_new_project_success(cli...
mit
4,806,526,466,730,353,000
41.862069
86
0.661303
false
teoliphant/numpy-refactor
numpy/lib/twodim_base.py
5
22944
""" Basic functions for manipulating 2d arrays """ __all__ = ['diag','diagflat','eye','fliplr','flipud','rot90','tri','triu', 'tril','vander','histogram2d','mask_indices', 'tril_indices','tril_indices_from','triu_indices','triu_indices_from', ] from numpy.core.numeric import asanyarr...
bsd-3-clause
8,970,260,017,086,218,000
25.161916
89
0.530073
false
ChronoMonochrome/android_external_chromium_org
tools/linux/procfs.py
23
20724
#!/usr/bin/env python # 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. # A Python library to read and store procfs (/proc) information on Linux. # # Each information storage class in this file stores origin...
bsd-3-clause
4,213,629,520,312,965,600
27.427984
80
0.557711
false
sorgerlab/indra
indra/sources/isi/experiments.py
6
2074
import pickle import time import os from indra.sources.isi.api import process_preprocessed from indra.sources.isi.preprocessor import IsiPreprocessor def abstracts_runtime(): pfile = '/Users/daniel/Downloads/text_content_sample.pkl' dump = pickle.load(open(pfile, 'rb')) all_abstracts = dump['pubmed'] ...
bsd-2-clause
634,808,397,518,998,700
33
79
0.559306
false