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
TomBaxter/osf.io
website/mails/mails.py
3
12575
# -*- coding: utf-8 -*- """OSF mailing utilities. Email templates go in website/templates/emails Templates must end in ``.txt.mako`` for plaintext emails or``.html.mako`` for html emails. You can then create a `Mail` object given the basename of the template and the email subject. :: CONFIRM_EMAIL = Mail(tpl_pre...
apache-2.0
5,083,910,488,932,319,000
29.972906
145
0.702028
false
Pkthunder/geoq
geoq/core/migrations/0010_auto__add_comment.py
6
11088
# -*- 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 model 'Comment' db.create_table(u'core_comment', ( (u'id', self.gf('django.db.models.fi...
mit
7,043,335,804,573,859,000
77.091549
208
0.548791
false
UrbanDaddy/django-cloud-browser
fabfile.py
2
5064
"""Fabric file.""" from __future__ import with_statement import os from contextlib import contextmanager from fabric.api import abort, local, settings ############################################################################### # Constants #########################################################################...
mit
9,121,494,613,016,004,000
26.977901
79
0.512046
false
mujiansu/pip
tests/unit/test_req.py
26
12500
import os import shutil import sys import tempfile import pytest from mock import Mock, patch, mock_open from pip.exceptions import (PreviousBuildDirError, InvalidWheelFilename, UnsupportedWheel) from pip.download import PipSession from pip.index import PackageFinder from pip.req import (I...
mit
-2,582,548,588,130,387,500
35.337209
79
0.60592
false
mahak/cinder
cinder/tests/unit/volume/drivers/nexenta/test_nexenta.py
2
27978
# Copyright 2016 Nexenta Systems, 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 req...
apache-2.0
-3,926,105,661,432,004,600
39.140603
79
0.586747
false
haphaeu/yoshimi
DijkstraMinPath/min_path_figure.py
1
2722
# -*- coding: utf-8 -*- """ Created on Tue Aug 30 14:31:04 2016 @author: rarossi """ from matplotlib import pylab import numpy as np import DijkstraMinPath from DijkstraMinPath import Edge, Vertex def ascii_print(m): for rw in m: for p in rw: print('#' if p > 1 else '.', end='') prin...
lgpl-3.0
-4,280,893,732,563,898,000
28.268817
98
0.613887
false
shubhdev/edx-platform
cms/djangoapps/contentstore/views/certificates.py
17
19142
""" Certificates Data Model: course.certificates: { 'certificates': [ { 'version': 1, // data contract version 'id': 12345, // autogenerated identifier 'name': 'Certificate 1', 'description': 'Certificate 1 Description', 'course_title': 'course ti...
agpl-3.0
4,784,177,607,453,490,000
39.641189
121
0.637708
false
belatrix/BackendAllStars
activities/serializers.py
1
1458
from .models import Message, Activity from employees.models import Employee from rest_framework import serializers class MessageSerializer(serializers.ModelSerializer): def get_avatar(self, data): employee = Employee.objects.get(pk=data.from_user.pk) if employee.avatar: avatar_url = e...
apache-2.0
-169,379,988,387,175,140
27.038462
77
0.638546
false
fraoustin/piwigotools
piwigotools/progressbar/compat.py
23
1460
#!/usr/bin/python # -*- coding: utf-8 -*- # # progressbar - Text progress bar library for Python. # Copyright (c) 2005 Nilton Volpato # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; ei...
gpl-2.0
-6,906,054,314,206,795,000
31.444444
76
0.7
false
Pikecillo/genna
external/PyXML-0.8.4/test/perf_expatbuilder.py
1
2891
"""\ Performance comparison for the xml.dom.expatbuilder DOM loader. Usage: %(program)s [-f file] [-p] [file] -f file Read the document to use from `file'. -p Enable profiling support. file Read the document to use from `file'. Use this or the `-f' option...
gpl-2.0
-8,733,914,879,606,533,000
22.128
79
0.571774
false
iafan/zing
pootle/core/mail.py
11
1219
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from django.core.mail import EmailMultiAlter...
gpl-3.0
-3,968,172,486,360,754,700
38.322581
79
0.602133
false
mhbu50/erpnext
erpnext/stock/doctype/stock_entry/stock_entry_utils.py
3
3633
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe, erpnext from frappe.utils import cint, flt from six import string_types @frappe.whitelist() def make_stock_entry(**args): '''Helper function to make a Stock Entry :item_cod...
gpl-3.0
9,031,309,293,804,771,000
25.713235
95
0.699422
false
SimpleITK/SimpleITK
Testing/Unit/Python/sitkTransformTests.py
4
12885
#========================================================================== # # Copyright NumFOCUS # # 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
-7,635,567,261,828,404,000
31.374372
137
0.54901
false
OpenCode/l10n-italy
l10n_it_base/__openerp__.py
3
1618
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2010-2011 OpenERP Italian Community # <http://www.openerp-italia.org> # Copyright (C) 2014 Associazione Odoo Italia # (<http://www.openerp-italia.org>). # # This program is free soft...
agpl-3.0
-6,157,538,019,771,838,000
34.173913
78
0.596415
false
NERC-CEH/jules-jasmin
majic/joj/controllers/home.py
1
4474
""" #header """ from pylons import url, config from joj.lib import helpers from datetime import datetime import logging from joj.lib.base import BaseController, c, request, render, redirect from joj.services.general import ServiceException log = logging.getLogger(__name__) class HomeController(BaseController): ...
gpl-2.0
1,308,699,953,669,700,000
30.957143
108
0.548055
false
teamfx/openjfx-10-dev-rt
modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/common/system/workspace_unittest.py
2
3599
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
gpl-2.0
-2,016,655,781,169,812,000
47.635135
149
0.70853
false
auduny/chains
lib/chains/service/__init__.py
1
7502
from chains.common import introspect, utils, log, ChainsException, ParameterException, NoSuchServiceException, NoSuchActionException from chains.common.amqp import AmqpDaemon from chains.service import config import os, threading, time def factory(conf): if not conf.get('class'): raise Exception('Missing m...
gpl-2.0
3,533,020,341,266,517,500
31.47619
132
0.602239
false
tcmoore3/mdtraj
mdtraj/utils/external/astor/codegen.py
11
15848
# -*- coding: utf-8 -*- """ This module converts an AST into Python source code. Original code copyright (c) 2008 by Armin Ronacher and is distributed under the 3-clause BSD license. It was derived from a modified version found here: https://gist.github.com/1250562 """ import ast from .misc import (ExplicitNo...
lgpl-2.1
-5,933,956,041,093,977,000
30.13556
79
0.560071
false
ParanoidAndroid/android_external_skia
tools/download_baselines.py
39
9990
''' Downloads the actual gm results most recently generated by the Skia buildbots, and adds any new ones to SVN control. Launch with --help to see more information. Copyright 2011 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. ''' # common Python modul...
bsd-3-clause
-6,376,088,978,622,449,000
41.510638
100
0.653053
false
baiyunping333/BurpSuite-Plugins
Sqlmap/tamper/charencode.py
7
1379
#!/usr/bin/env python """ Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import string from lib.core.enums import PRIORITY __priority__ = PRIORITY.LOWEST def dependencies(): pass def tamper(payload, **kwargs): """ Url-encodes all ch...
gpl-2.0
-552,197,703,144,670,340
25.519231
150
0.583756
false
ChristosChristofidis/bokeh
sphinx/source/docs/tutorials/solutions/lines.py
20
1405
from bokeh.plotting import figure, HBox, output_file, show, VBox from bokeh.models import Range1d # create some data using python lists x1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] y1 = [0, 8, 2, 4, 6, 9, 15, 18, 19, 25, 28] # EXERCISE: create two more data sets, x2, y2 and x3, y3, however # you want. Make sure the co...
bsd-3-clause
-1,030,995,672,292,040,400
33.292683
72
0.671886
false
pyocd/pyOCD
pyocd/target/builtin/target_HC32L13x.py
2
4843
# pyOCD debugger # Copyright (c) 2021 Huada Semiconductor Corporation # Copyright (c) 2021 Chris Reed # SPDX-License-Identifier: Apache-2.0 # # 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 # #...
apache-2.0
-3,362,456,083,583,873,000
39.024793
99
0.701631
false
deepsrijit1105/edx-platform
openedx/core/djangoapps/bookmarks/services.py
44
4441
""" Bookmarks service. """ import logging from django.core.exceptions import ObjectDoesNotExist from xmodule.modulestore.django import modulestore from xmodule.modulestore.exceptions import ItemNotFoundError from request_cache.middleware import RequestCache from . import DEFAULT_FIELDS, api log = logging.getLogger...
agpl-3.0
5,938,451,651,446,815,000
31.181159
102
0.618329
false
indirectlylit/kolibri
kolibri/core/hooks.py
2
2092
""" Kolibri Core hooks ------------------ WIP! Many applications are supposed to live inside the core namespace to make it explicit that they are part of the core. Do we put all their hooks in one module or should each app have its own hooks module? Anyways, for now to get hooks started, we have some defined here......
mit
1,000,853,315,046,404,500
24.82716
101
0.719407
false
DTRPVisualDiagnostics/DTRS11-LSA
code/calculateCoherence.py
1
2445
# -*- coding: utf-8 -*- import logging, os from gensim import corpora, models, matutils from code.util import loadFileIntoList logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) def calculateCoherence(config): lsaModel = models.LsiModel.load(config['LSA']['modelFileLoc...
mit
7,677,914,977,239,281,000
41.172414
132
0.551738
false
Bharath-J/Mezzanine
mezzanine/template/__init__.py
40
4855
from __future__ import unicode_literals from functools import wraps from django import template from django.template.context import Context from django.template.loader import get_template, select_template from mezzanine.utils.device import templates_for_device class Library(template.Library): """ Extends `...
bsd-2-clause
1,481,508,452,047,112,400
37.531746
78
0.513491
false
chazy/reviewboard
reviewboard/admin/forms.py
1
25260
# # reviewboard/admin/forms.py -- Form classes for the admin UI # # Copyright (c) 2008-2010 Christian Hammond # Copyright (c) 2008-2010 David Trowbridge # # 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...
mit
-8,924,207,634,628,988,000
36.311669
89
0.561599
false
jakirkham/bokeh
bokeh/sampledata/tests/test_commits.py
3
1961
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
bsd-3-clause
3,637,179,828,679,504,000
32.810345
82
0.316675
false
Nithanaroy/GeoReachPaths
tests/Test_GeoReachPaths.py
1
6969
import unittest import networkx as nx from GeoReachPaths import GeoReachPaths class TestGeoReachPaths(unittest.TestCase): @staticmethod def graph_fixture(): """ This graph doesn't have any cycles (A)-->(B) are friends (A)-->(R1), A checked in at R1 (B)-->(R2), A check...
apache-2.0
-9,072,578,653,056,907,000
38.151685
112
0.500933
false
sansbacon/nba
queries.py
1
4364
# queries.py def missing_game_boxscores(tz='CST'): ''' Query for missing linescores in boxv2015 Args: None Returns: str: query ''' return """ SELECT nbacom_game_id as gid, to_char(game_date, 'YYYYmmdd') as gd FROM game WHERE game_date < (...
mit
2,639,853,785,639,424,000
25.779141
109
0.588222
false
gkc1000/pyscf
pyscf/scf/test/test_h2o.py
1
16528
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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 # # U...
apache-2.0
5,606,861,536,222,591,000
39.116505
90
0.592389
false
tanmaykm/edx-platform
common/test/acceptance/pages/studio/import_export.py
15
9542
""" Import/Export pages. """ import time from datetime import datetime from bok_choy.promise import EmptyPromise import os import re import requests from common.test.acceptance.pages.common.utils import click_css from common.test.acceptance.pages.studio.library import LibraryPage from common.test.acceptance.pages.st...
agpl-3.0
8,945,605,599,233,442,000
31.236486
111
0.602075
false
akissa/BaruwaAPI
tests/012-test-resources.py
1
3372
import sys import mock try: import unittest2 except ImportError: if sys.version_info < (2, 7): raise import unittest as unittest2 from restkit.wrappers import Response from BaruwaAPI.endpoints import ENDPOINTS from BaruwaAPI.resource import BaruwaAPIClient from BaruwaAPI.exceptions import BaruwaAPI...
mpl-2.0
8,671,056,282,436,821,000
36.88764
75
0.637604
false
raphaelm/iad16
python/tsp04_modifications.py
1
5908
import sys import tsplib from tsp02a_nextneighbor import next_neighbor_tour from tsp03_spacefilling import spacefilling_tour class NodeLink: def __init__(self, node, next=None, prev=None): self.node = node self.next = next self.prev = prev def __eq__(self, other): return self...
gpl-3.0
2,997,068,781,055,913,000
26.947867
103
0.579956
false
akbargumbira/inasafe
safe/common/parameters/validators.py
3
1978
# coding=utf-8 """List of custom validations for parameter container.""" from safe.definitions.constants import STATIC, SINGLE_DYNAMIC import logging LOGGER = logging.getLogger('InaSAFE') __copyright__ = "Copyright 2017, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "info@inasafe.org" __revision__ = ...
gpl-3.0
-2,158,287,695,850,862,800
29.430769
77
0.634985
false
oOXuOo/JianZhiYueDu
server/Extractors/core_ex_func.py
1
2188
#!/usr/bin/python3 #-*- coding:utf-8 -*- import lxml.html as H def _count_chr_in_list(str_list): total = 0 for html_string in str_list: html_string_without_n = html_string.replace('\n','').strip() total += len(html_string_without_n) return total def _get_all_text_count_in_tag(tag): a...
gpl-3.0
-1,265,012,167,027,417,600
24.44186
97
0.600091
false
SomethingExplosive/android_external_chromium_org
third_party/tlslite/tlslite/integration/ClientHelper.py
86
6851
""" A helper class for using TLS Lite with stdlib clients (httplib, xmlrpclib, imaplib, poplib). """ from tlslite.Checker import Checker class ClientHelper: """This is a helper class used to integrate TLS Lite with various TLS clients (e.g. poplib, smtplib, httplib, etc.)""" def __init__(self, ...
bsd-3-clause
5,833,097,470,447,489,000
41.03681
76
0.618596
false
qedsoftware/commcare-hq
corehq/apps/cleanup/tests/test_merge_checkpoints.py
1
1997
from django.test.testcases import SimpleTestCase from corehq.apps.cleanup.pillow_migrations import get_merged_sequence from pillowtop.models import DjangoPillowCheckpoint class TestMergeCheckpoints(SimpleTestCase): def test_merge_sequence(self): checkpoints_topics = [ (DjangoPillowCheckpoint(...
bsd-3-clause
-5,786,465,609,913,038,000
35.981481
102
0.579369
false
markofu/scripts
nmap/nmap/zenmap/zenmapCore/BasePaths.py
4
10866
#!/usr/bin/env python # -*- coding: utf-8 -*- # ***********************IMPORTANT NMAP LICENSE TERMS************************ # * * # * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is * # * also a registered trademark of Inse...
gpl-2.0
8,548,821,630,298,396,000
64.065868
78
0.567734
false
kevin-coder/tensorflow-fork
tensorflow/python/ops/tensor_array_ops.py
2
47074
# 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
-1,573,840,520,983,097,300
36.419714
80
0.647789
false
junhuac/MQUIC
src/build/android/pylib/gtest/gtest_config.py
56
1489
# Copyright (c) 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. """Configuration file for android gtest suites.""" # Add new suites here before upgrading them to the stable list below. EXPERIMENTAL_TEST_SUITES = [ ...
mit
-6,504,586,503,587,997,000
26.574074
75
0.687038
false
heddle317/moto
tests/test_ses/test_ses.py
12
3708
from __future__ import unicode_literals import email import boto from boto.exception import BotoServerError import sure # noqa from moto import mock_ses_deprecated @mock_ses_deprecated def test_verify_email_identity(): conn = boto.connect_ses('the_key', 'the_secret') conn.verify_email_identity("test@examp...
apache-2.0
-1,292,834,659,467,200,800
30.965517
101
0.664779
false
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/setuptools/dist.py
46
40364
__all__ = ['Distribution'] import re import os import warnings import numbers import distutils.log import distutils.core import distutils.cmd import distutils.dist import itertools from collections import defaultdict from distutils.errors import ( DistutilsOptionError, DistutilsPlatformError, DistutilsSetupError, ...
mit
678,886,864,920,459,100
38.885375
79
0.610272
false
quokkaproject/flask-mongoengine
flask_mongoengine/operation_tracker.py
1
9627
import functools import time import inspect import copy import sys import os try: import SocketServer except ImportError: import socketserver as SocketServer import pymongo import pymongo.collection import pymongo.cursor import pymongo.helpers from bson import SON __all__ = ['queries', 'inserts', 'updates',...
bsd-3-clause
-757,353,559,589,404,200
28.897516
78
0.599771
false
Max-Might/godot
platform/x11/detect.py
5
8541
import os import platform import sys def is_active(): return True def get_name(): return "X11" def can_build(): if (os.name != "posix" or sys.platform == "darwin"): return False # Check the minimal dependencies x11_error = os.system("pkg-config --version > /dev/null") if (x11_err...
mit
8,130,079,055,029,444,000
34.5875
121
0.585294
false
ThreatConnect-Inc/tcex
tests/batch/test_attributes_1.py
2
1808
"""Test the TcEx Batch Module.""" # third-party import pytest class TestAttributes: """Test the TcEx Batch Module.""" @pytest.mark.parametrize( 'name,description,attr_type,attr_value,displayed,source', [ ( 'pytest-adversary-i1-001', 'Attribute Testi...
apache-2.0
-2,736,007,814,706,602,500
29.644068
79
0.563053
false
scott-maddox/simplepl
src/simplepl/simple_pl_parser.py
1
7649
# # Copyright (c) 2013-2014, Scott J Maddox # # This file is part of SimplePL. # # SimplePL is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your opt...
agpl-3.0
5,430,585,899,583,333,000
39.257895
79
0.570271
false
paulmartel/voltdb
tests/scripts/sqltests.py
1
10116
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2016 VoltDB 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 limitati...
agpl-3.0
-1,615,442,028,539,770,400
30.222222
88
0.575129
false
gfyoung/pandas
pandas/tests/dtypes/cast/test_downcast.py
2
2805
import decimal import numpy as np import pytest from pandas.core.dtypes.cast import maybe_downcast_to_dtype from pandas import DatetimeIndex, Series, Timestamp import pandas._testing as tm @pytest.mark.parametrize( "arr,dtype,expected", [ ( np.array([8.5, 8.6, 8.7, 8.8, 8.9999999999995]...
bsd-3-clause
-8,931,763,998,186,558,000
27.333333
72
0.603565
false
atsao72/sympy
sympy/vector/coordsysrect.py
34
24297
from sympy.core.basic import Basic from sympy.vector.scalar import BaseScalar from sympy import eye, trigsimp, ImmutableMatrix as Matrix, Symbol from sympy.core.compatibility import string_types, range from sympy.core.cache import cacheit from sympy.vector.orienters import (Orienter, AxisOrienter, BodyOrienter, ...
bsd-3-clause
4,333,595,431,451,432,000
33.415014
78
0.553196
false
stevekuznetsov/ansible
lib/ansible/module_utils/azure_rm_common.py
14
26408
# # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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, e...
gpl-3.0
-7,091,998,074,351,442,000
42.291803
126
0.605536
false
OCM-Lab-PUC/switch-chile
examples/3zone_toy_stochastic_PySP/ReferenceModel.py
1
3881
# Copyright 2016 The Switch Authors. All rights reserved. # Licensed under the Apache License, Version 2, which is in the LICENSE file. """ Generate a model for use with the PySP pyomo module, either for use with the runef or runph commands. Both these scripts require a single .py file that creates a pyomo model obje...
apache-2.0
-666,210,461,152,430,600
45.202381
121
0.728936
false
Hellowlol/PyTunes
libs/guessit/plugins/transformers.py
11
7890
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
3,534,629,704,936,772,600
41.419355
161
0.64512
false
heke123/chromium-crosswalk
tools/auto_bisect/math_utils.py
45
4347
# 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. """General statistical or mathematical functions.""" import math def TruncatedMean(data_set, truncate_proportion): """Calculates the truncated mean of a...
bsd-3-clause
7,741,367,293,032,532,000
30.5
77
0.703014
false
tuxfux-hlp-notes/python-batches
batch-67/19-files/myenv/bin/runxlrd.py
1
16321
#!/home/khyaathi/Documents/git_repos/python-batches/batch-67/19-files/myenv/bin/python # Copyright (c) 2005-2012 Stephen John Machin, Lingfo Pty Ltd # This script is part of the xlrd package, which is released under a # BSD-style licence. from __future__ import print_function cmd_doc = """ Commands: 2rows ...
gpl-3.0
961,524,753,423,855,100
38.422705
101
0.491269
false
eeshangarg/oh-mainline
vendor/packages/twisted/twisted/protocols/test/test_tls.py
18
22242
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.protocols.tls}. """ try: from twisted.protocols.tls import TLSMemoryBIOProtocol, TLSMemoryBIOFactory except ImportError: # Skip the whole test module if it can't be imported. skip = "pyOpenSSL 0.10 or newer req...
agpl-3.0
-7,666,246,242,465,656,000
38.29682
102
0.69108
false
whausen/part
src/adhocracy/controllers/page.py
1
26602
import json import logging from operator import itemgetter import formencode from formencode import htmlfill, Invalid, validators from pylons import request, tmpl_context as c from pylons.controllers.util import abort, redirect from pylons.decorators import validate from pylons.i18n import _ from adhocracy import f...
agpl-3.0
-8,375,141,798,514,522,000
39.490107
79
0.571649
false
amyvmiwei/kbengine
kbe/src/lib/python/Lib/test/test_email/test__header_value_parser.py
15
110949
import string import unittest from email import _header_value_parser as parser from email import errors from email import policy from test.test_email import TestEmailBase, parameterize class TestTokens(TestEmailBase): # EWWhiteSpaceTerminal def test_EWWhiteSpaceTerminal(self): x = parser.EWWhiteSpace...
lgpl-3.0
2,289,985,365,944,320,500
41.7633
93
0.53743
false
ikoz/mitmproxy
test/mitmproxy/test_filt.py
2
7853
import cStringIO from mitmproxy import filt from mitmproxy.models import Error from mitmproxy.models import http from netlib.http import Headers from . import tutils class TestParsing: def _dump(self, x): c = cStringIO.StringIO() x.dump(fp=c) assert c.getvalue() def test_parse_err(se...
mit
823,048,642,139,963,600
27.146953
67
0.503629
false
festicket/django-extended-choices
extended_choices/fields.py
1
3019
# -*- coding: utf-8 -*- from django import forms from extended_choices import Choices class NamedExtendedChoiceFormField(forms.Field): """ Special fields, where the values are the constants names instead of the integer (could be usefull for example for an API). Should not be very userfull in normal HT...
gpl-3.0
267,738,949,212,996,030
34.517647
99
0.657834
false
biddisco/VTK
ThirdParty/Twisted/twisted/internet/iocpreactor/tcp.py
18
18263
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ TCP support for IOCP reactor """ import socket, operator, errno, struct from zope.interface import implements, classImplements from twisted.internet import interfaces, error, address, main, defer from twisted.internet.abstract import _LogOw...
bsd-3-clause
-3,516,946,672,433,453,600
30.596886
83
0.596671
false
OpenSmalltalk/vm
processors/ARM/gdb-8.3.1/gdb/python/lib/gdb/command/frame_filters.py
8
16256
# Frame-filter commands. # Copyright (C) 2013-2019 Free Software Foundation, 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 License, or # (at your option) any late...
mit
7,557,683,514,263,090,000
34.649123
90
0.611528
false
danielsadowsky/dannyscf
deriv.py
1
4359
""" computes first and second derivatives of nuclear repulsion term """ import math import numpy def distance( xbohr, ybohr, zbohr, Z ): natoms = len(xbohr) R = numpy.zeros( ( natoms, natoms ) ) Vnn = 0.0 for a in range( natoms ): for b in range( natoms ): if a == b: ...
gpl-2.0
-8,964,571,675,977,420,000
45.37234
165
0.398027
false
teltek/edx-platform
lms/djangoapps/experiments/views.py
4
4736
from django.contrib.auth import get_user_model from django.db import transaction from django_filters.rest_framework import DjangoFilterBackend from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication from edx_rest_framework_extensions.auth.session.authentication import SessionAuthenticationAl...
agpl-3.0
-6,945,687,686,227,207,000
42.054545
119
0.696579
false
Jumpscale/jumpscale_core8
lib/JumpScale/tools/aggregator/RealityProcess.py
1
1271
from JumpScale import j from InfluxDumper import InfluxDumper from MongoDumper import MongoDumper from ECODumper import ECODumper class RealitProcess: """ """ def __init__(self): self.__jslocation__ = "j.tools.realityprocess" def influxpump(self, influxdb, cidr='127.0.0.1', ports=[7777], re...
apache-2.0
8,696,851,971,993,155,000
24.938776
118
0.598741
false
thelinuxkid/ubernear
ubernear/test/util.py
1
1830
import tempfile import functools import shutil def assert_raises(excClass, callableObj, *args, **kwargs): """ Like unittest.TestCase.assertRaises, but returns the exception. """ try: callableObj(*args, **kwargs) except excClass, e: return e else: if hasattr(excClass,'__n...
mit
4,985,778,466,543,835,000
28.516129
70
0.47541
false
thfabian/serialbox2
src/serialbox-python/sdb/sdbgui/globalconfig.py
2
1293
#!/usr/bin/python3 # -*- coding: utf-8 -*- ##===-----------------------------------------------------------------------------*- Python -*-===## ## ## S E R I A L B O X ## ## This file is distributed under terms of BSD license. ## See LICENSE.txt for more information. ## ##===----------...
bsd-2-clause
-1,933,573,800,080,817,000
27.733333
100
0.499613
false
SP2RC-Coding-Club/Codes
13_07_2017/alfven_mixed_driver.py
1
12445
# -*- coding: utf-8 -*- """ Created on Tue Mar 21 14:00:14 2017 @author: Matt """ import numpy as np import slab_functions as sf import move_seed_points as msp from pysac.plot.mayavi_seed_streamlines import SeedStreamline from mayavi import mlab import mayavi_plotting_functions as mpf import img2vid as i2v #########...
mit
-8,117,881,370,476,537,000
34.867435
164
0.54544
false
wscullin/spack
var/spack/repos/builtin/packages/fastmath/package.py
3
2776
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
6,531,931,475,108,145,000
41.707692
79
0.668228
false
pywinauto/pywinauto
pywinauto/controlproperties.py
1
9337
# GUI Application automation and testing library # Copyright (C) 2006-2018 Mark Mc Mahon and Contributors # https://github.com/pywinauto/pywinauto/graphs/contributors # http://pywinauto.readthedocs.io/en/latest/credits.html # All rights reserved. # # Redistribution and use in source and binary forms, with or with...
bsd-3-clause
1,715,702,829,530,420,000
32.453875
80
0.554996
false
jackrzhang/zulip
zerver/tests/test_event_queue.py
2
18192
import mock import time import ujson from django.http import HttpRequest, HttpResponse from typing import Any, Callable, Dict, Tuple from zerver.lib.actions import do_mute_topic, do_change_subscription_property from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_helpers import POSTRequestMock from ...
apache-2.0
-1,950,368,500,923,652,400
53.304478
104
0.60741
false
anupash/privseams
process_modules.py
1
12037
#!/usr/bin/python # # Copyright (c) 2010 Aalto University and RWTH Aachen University. # # 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...
gpl-2.0
-27,310,060,578,153,080
42.930657
138
0.559774
false
allanino/nupic
nupic/research/temporal_memory.py
15
28377
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, 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 progra...
agpl-3.0
-1,435,996,559,675,555,600
33.396364
181
0.645452
false
laborautonomo/opps
opps/images/templatetags/images_tags.py
1
2532
# -*- coding: utf-8 -*- from django import template from django.template import Node, TemplateSyntaxError, Variable from django.conf import settings from django.utils.translation import ugettext as _ from ..generate import image_url as url register = template.Library() class AllImagesCheckPermissionForObjectsNode(N...
mit
2,152,113,324,878,205,400
28.103448
75
0.605845
false
pizzathief/scipy
scipy/io/matlab/mio4.py
8
20257
''' Classes for read / write of matlab (TM) 4 files ''' import sys import warnings import numpy as np from numpy.compat import asbytes, asstr import scipy.sparse from .miobase import (MatFileReader, docfiller, matdims, read_dtype, convert_dtypes, arr_to_chars, arr_dtype_number) from .mio_utils...
bsd-3-clause
2,324,193,741,068,944,400
31.991857
80
0.537049
false
micgro42/ReceiptEval
receipteval/tests/test_collection.py
1
5100
# encoding: utf-8 ''' Created on Apr 19, 2015 @author: Michael Große <mic.grosse@posteo.de> ''' from receipteval.receipt_collection import ReceiptCollection from receipteval.purchase import Purchase from collections import namedtuple def test_category_correct(): rC = ReceiptCollection() rC.category_dict.ite...
gpl-3.0
6,200,700,817,419,248,000
41.823529
72
0.432889
false
paultag/hy
hy/compiler.py
1
92649
# -*- encoding: utf-8 -*- # # Copyright (c) 2013, 2014 Paul Tagliamonte <paultag@debian.org> # Copyright (c) 2013 Julien Danjou <julien@danjou.info> # Copyright (c) 2013 Nicolas Dandrimont <nicolas.dandrimont@crans.org> # Copyright (c) 2013 James King <james@agentultra.com> # Copyright (c) 2013, 2014 Bob Tolbert <bob@t...
mit
-8,411,418,910,202,074,000
34.494636
79
0.492611
false
MS-DDOS/enc
enc.py
1
24038
# enc - A free utility for encrypting Python code bases. # Copyright (C) 2017 M. Tyler Springer # 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 Licen...
gpl-3.0
-7,796,415,790,641,151,000
50.806034
297
0.622722
false
ict-felix/stack
core_kvm/lib/am/geniutils/src/time/timewrapper.py
3
1370
from types import StringTypes import dateutil.parser import datetime import time #from openflow.optin_manager.sfa.util.sfalogging import logger DATEFORMAT = "%Y-%m-%dT%H:%M:%SZ" def utcparse(input): """ Translate a string into a time using dateutil.parser.parse but make sure it's in UTC time and strip the timezo...
apache-2.0
8,876,203,193,740,754,000
30.860465
107
0.690511
false
codilime/contrail-controller
src/config/api-server/vnc_perms.py
1
8322
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import sys import cfgm_common from cfgm_common import jsonutils as json import string import uuid from provision_defaults import * from cfgm_common.exceptions import * from pysandesh.gen_py.sandesh.ttypes import SandeshLevel class VncPermissions(obje...
apache-2.0
-981,609,686,758,688,500
35.340611
120
0.564528
false
ndawe/rootpy
rootpy/extern/byteplay3/byteplay.py
4
35468
# byteplay: CPython assembler/disassembler # Copyright (C) 2006 Noam Raphael | Version: http://code.google.com/p/byteplay # Rewritten 2009 Demur Rumed | Version: http://github.com/serprex/byteplay # Screwed the style over, modified stack logic to be more flexible, updated to Python 3 # # This...
bsd-3-clause
2,950,950,612,980,968,000
42.465686
159
0.532621
false
0Chencc/CTFCrackTools
Lib/test/test_list.py
10
3007
import sys from test import test_support, list_tests class ListTest(list_tests.CommonTest): type2test = list def test_basic(self): self.assertEqual(self.type2test([]), []) l0_3 = [0, 1, 2, 3] l0_3_bis = self.type2test(l0_3) self.assertEqual(l0_3, l0_3_bis) self.assertT...
gpl-3.0
5,879,253,342,959,712,000
35.670732
81
0.569671
false
hakatashi/youtube-dl
youtube_dl/extractor/roosterteeth.py
2
5951
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_HTTPError, compat_str, ) from ..utils import ( ExtractorError, int_or_none, str_or_none, urlencode_postdata, ) class RoosterTeethIE(InfoExtractor): _VALID_URL...
unlicense
6,983,534,510,018,885,000
39.209459
150
0.552344
false
mrkm4ntr/incubator-airflow
airflow/providers/google/cloud/transfers/postgres_to_gcs.py
7
5366
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-3,853,518,885,535,074,300
33.844156
110
0.645919
false
dazer/ShadowCraft-Engine
scripts/combat.py
2
5810
# Simple test program to debug + play with assassination models. from os import path import sys sys.path.append(path.abspath(path.join(path.dirname(__file__), '..'))) from shadowcraft.calcs.rogue.Aldriana import AldrianasRogueDamageCalculator from shadowcraft.calcs.rogue.Aldriana import settings from shadowcraft.obje...
lgpl-3.0
-8,030,266,530,642,710,000
39.068966
208
0.642685
false
gouxiayibu/deep_nets_iclr04
misc/parse_training_log.py
3
4270
# A simple script to parse through the training log and extract per-epoch # test and training set errors. This is very crude. import sys import re # This function is a little hacky, but I think I got most of the cases. # It just returns the first number in a string (integer or decimal) def get_first_num(str)...
gpl-2.0
1,743,192,364,753,288,200
45.977528
149
0.528337
false
Glottotopia/aagd
moin/local/moin/MoinMoin/support/passlib/hosts.py
2
3815
"""passlib.hosts""" #============================================================================= # imports #============================================================================= # core import sys from warnings import warn # pkg from passlib.context import LazyCryptContext from passlib.exc import Pass...
mit
-2,023,734,657,901,252,900
31.173913
79
0.45426
false
firebase/grpc
src/python/grpcio_testing/grpc_testing/_server/_server.py
13
6302
# Copyright 2017 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
2,593,735,012,452,988,000
39.922078
80
0.628055
false
crmccreary/openerp_server
openerp/addons/auction/wizard/auction_lots_buyer_map.py
9
6024
# -*- 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...
agpl-3.0
3,772,532,868,702,690,300
43.955224
160
0.547145
false
blbarker/spark-tk
regression-tests/sparktkregtests/lib/sparktk_test.py
5
3465
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel 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 require...
apache-2.0
6,326,802,609,345,600,000
31.257143
117
0.655447
false
Biblicity/biblicity
scripts/todays_texts.py
2
1809
""" Each day, pull the reading for the day from the source API and save it for use. """ import logging logging.basicConfig(format='[%(asctime)s] %(levelname)s: %(message)s', level=logging.DEBUG) log = logging.getLogger(__name__) import os, re, sys, json, traceback from datetime import date from lxml import etree from...
mpl-2.0
-5,202,560,067,151,058,000
35.918367
101
0.595909
false
mlperf/training_results_v0.7
Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/python/tvm/contrib/graph_runtime.py
2
8403
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
-128,755,818,856,065,740
31.444015
82
0.604665
false
n-west/pybombs
mod_pybombs/plex/machines.py
11
11194
# # Copyright 2013 Tim O'Shea # # This file is part of PyBOMBS # # PyBOMBS 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, or (at your option) # any later version. # # PyBOMBS is distributed ...
gpl-3.0
4,565,636,013,165,428,000
30.711048
78
0.551188
false
cloudera/hue
desktop/core/ext-py/cx_Oracle-6.4.1/samples/InsertGeometry.py
2
2095
#------------------------------------------------------------------------------ # Copyright 2016, 2017, Oracle and/or its affiliates. All rights reserved. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # # Portions Copyright 2001-2007, Computronix (Canada) Ltd., Edmonton, Alberta, # Canada. Al...
apache-2.0
-9,180,419,493,623,350,000
35.12069
79
0.606683
false
jaggu303619/asylum-v2.0
openerp/addons/l10n_lu/__openerp__.py
22
2739
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2011 Thamini S.à.R.L (<http://www.thamini.com>) # Copyright (C) 2011 ADN Consultants S.à...
agpl-3.0
-7,850,103,750,621,853,000
42.444444
90
0.607234
false
shepdelacreme/ansible
lib/ansible/modules/cloud/azure/azure_rm_virtualmachineimage_facts.py
17
6797
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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 ANS...
gpl-3.0
4,613,891,408,098,842,000
29.895455
104
0.553774
false
nuxleus/cherokee-webserver
qa/161-RuleNot2.py
8
1148
from base import * VSERVER = "rulenot2" MAGIC = "Just a not rule test" DIR = "DIR1" CONF = """ vserver!1610!nick = %s vserver!1610!document_root = %s vserver!1610!rule!10!match = default vserver!1610!rule!10!handler = file vserver!1610!rule!20!match = not vserver!1610!rule!20!match!right = directory vserver!1...
gpl-2.0
5,751,892,977,922,049,000
23.956522
72
0.555749
false
pachorome/cs50
pset7/finance/application.py
2
11710
from cs50 import SQL from flask import Flask, flash, redirect, render_template, request, session, url_for from flask_session import Session from passlib.apps import custom_app_context as pwd_context from tempfile import gettempdir from helpers import * # configure application app = Flask(__name__) # ensure responses...
gpl-2.0
1,082,871,157,275,978,900
36.899676
132
0.59778
false
diegospc/pyafipws.rece2py
controllers/appadmin.py
24
14367
# -*- coding: utf-8 -*- # ########################################################## # ## make sure administrator is on localhost # ########################################################### import os import socket import datetime import copy import gluon.contenttype import gluon.fileutils # ## critical --- make a ...
agpl-3.0
7,726,136,888,515,178,000
32.334107
126
0.51493
false
pywbem/pywbemtools
pywbemtools/__init__.py
1
1122
# (C) Copyright 2020 IBM Corp. # (C) Copyright 2020 Inova Development 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-...
apache-2.0
-5,775,127,611,189,580,000
37.689655
80
0.738859
false