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
nycholas/ask-undrgz
src/ask-undrgz/django/contrib/gis/tests/geoapp/feeds.py
326
1856
from django.contrib.gis import feeds from django.contrib.gis.tests.utils import mysql from models import City, Country class TestGeoRSS1(feeds.Feed): link = '/city/' title = 'Test GeoDjango Cities' def items(self): return City.objects.all() def item_link(self, item): return '/city/%s/...
bsd-3-clause
7,496,078,380,103,000,000
28.460317
71
0.656789
false
DimensionDataCBUSydney/libcloud
libcloud/test/test_file_fixtures.py
50
1229
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
5,021,350,735,820,555,000
37.40625
74
0.738812
false
jazkarta/edx-platform-for-isc
cms/djangoapps/contentstore/management/commands/git_export.py
18
2804
""" This command exports a course from CMS to a git repository. It takes as arguments the course id to export (i.e MITx/999/2020 ) and the repository to commit too. It takes username as an option for identifying the commit, as well as a directory path to place the git repository. By default it will use settings.GIT_R...
agpl-3.0
2,256,731,160,365,950,700
36.386667
84
0.646576
false
mrshelly/openerp71313
openerp/addons/mail/tests/test_mail_message.py
1
23446
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
8,600,911,126,959,699,000
61.522667
217
0.625053
false
inflector/singnet
agent/sn_agent/api/poller.py
6
1373
import asyncio import datetime import logging from contextlib import suppress from aiohttp import web logger = logging.getLogger(__file__) class Periodic: def __init__(self, func, time): self.func = func self.time = time self.is_started = False self._task = None async def st...
mit
8,070,426,383,488,599,000
23.517857
59
0.612527
false
echodaemon/Empire
lib/common/messages.py
8
16901
""" Common terminal messages used across Empire. Titles, agent displays, listener displays, etc. """ import os import time import textwrap # Empire imports import helpers ############################################################### # # Messages # ###############################################################...
bsd-3-clause
-5,717,281,891,315,895,000
35.424569
423
0.503816
false
augustozuniga/arisgames
zxing-master/cpp/scons/scons-local-2.0.0.final.0/SCons/compat/_scons_collections.py
34
1869
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without li...
mit
8,439,368,118,038,856,000
40.533333
95
0.751204
false
ychfan/tensorflow
tensorflow/python/profiler/profile_context_test.py
32
4282
# 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
8,503,255,060,501,801,000
36.234783
80
0.652265
false
pjurik2/pykarma
feeds/rss.py
1
3205
import os, sys import random import time import feedparser import itertools import HTMLParser from feed import Feed if os.getcwd().rstrip(os.sep).endswith('feeds'): os.chdir('..') sys.path.insert(0, os.getcwd()) from gui_client import new_rpc import web import reddit class RSSFeed(Feed): def __init__(se...
mit
5,330,201,188,933,551,000
24.64
91
0.531669
false
aman-iitj/scipy
scipy/linalg/tests/test_special_matrices.py
36
22800
"""Tests for functions in special_matrices.py.""" from __future__ import division, print_function, absolute_import import numpy as np from numpy import arange, add, array, eye, copy, sqrt from numpy.testing import (TestCase, run_module_suite, assert_raises, assert_equal, assert_array_equal, assert_array_almost_eq...
bsd-3-clause
662,025,206,139,913,100
38.041096
92
0.539649
false
leedm777/ansible-modules-core
files/acl.py
47
9778
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
-573,065,690,727,570,600
30.954248
341
0.595521
false
tashaxe/Red-DiscordBot
lib/discord/ext/commands/bot.py
17
27409
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2016 Rapptz 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 u...
gpl-3.0
1,922,032,840,912,959,700
30.982497
123
0.587654
false
slank/ansible
lib/ansible/modules/system/hostname.py
12
23676
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Hiroaki Nakamura <hnakamur@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...
gpl-3.0
-5,561,625,591,487,425,000
30.31746
130
0.559765
false
qtekfun/htcDesire820Kernel
external/chromium_org/chrome/test/mini_installer/verifier.py
85
2063
# 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. class Verifier: """Verifies that the current machine states match the expectation.""" def VerifyInput(self, verifier_input, variable_expander): """...
gpl-2.0
-8,644,935,867,121,428,000
38.673077
80
0.705768
false
jpike88/crosswalk
tools/reflection_generator/java_method.py
3
29922
#!/usr/bin/env python # Copyright (c) 2014 Intel Corporation. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import re from collections import OrderedDict from string import Template def ConvertClassExpressionToClassType(class_name): """ ...
bsd-3-clause
5,073,345,167,352,662,000
35.940741
80
0.632344
false
polypmer/obligarcy
obligarcy/migrations/0040_action.py
1
1184
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('contenttypes', '0002_remove_content_type_...
gpl-3.0
-7,166,020,798,836,472,000
37.193548
130
0.589527
false
pombredanne/disco
tests/test_util.py
10
1840
import os from datetime import datetime from disco.test import TestCase from disco.util import flatten, iterify, urlsplit def function(x): return x + 0 sequence = 0, [1, [2, 3], [[4, [5, [6]]]]] class UtilTestCase(TestCase): def test_flatten(self): self.assertEquals(list(range(7)), list(flatten(sequ...
bsd-3-clause
-3,961,319,045,020,269,000
41.790698
80
0.488587
false
napsternxg/twitter_nlp
hbc/python/Vocab.py
10
1046
class Vocab: def __init__(self, vocabFile=None): self.nextId = 1 self.word2id = {} self.id2word = {} if vocabFile: for line in open(vocabFile): line = line.rstrip('\n') (word, wid) = line.split('\t') self.word2id[word] = int...
gpl-3.0
3,255,228,867,409,189,400
28.055556
63
0.533461
false
michaelWagner/oppia
extensions/triggers/trigger_classes.py
19
2484
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
-3,891,276,192,605,168,000
31.684211
78
0.672303
false
jermowery/xos
xos/tosca/tests/computetest.py
4
4688
from basetest import BaseToscaTest from core.models import Instance, Slice class ComputeTest(BaseToscaTest): tests = [ # "create_compute_m1_tiny", XXX m1.tiny does not exist on cloudlab "create_compute_m1_small", "create_compute_m1_large_8192MB", "create_compute_m1_large_8GB...
apache-2.0
-3,877,471,315,966,018,000
47.833333
134
0.609002
false
yampiopl/Yamcoin
contrib/bitrpc/bitrpc.py
2348
7835
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:8332") else: access = Ser...
mit
-8,455,746,696,829,122,000
23.185185
79
0.661774
false
ashray/VTK-EVM
ThirdParty/Twisted/twisted/web/test/test_static.py
28
56293
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web.static}. """ import inspect import mimetypes import os import re import StringIO from zope.interface.verify import verifyObject from twisted.internet import abstract, interfaces from twisted.python.runtime import plat...
bsd-3-clause
3,713,034,365,914,449,400
35.553896
101
0.616684
false
liukaijv/XlsxWriter
xlsxwriter/test/worksheet/test_worksheet03.py
8
4143
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...worksheet import Worksheet from ...format ...
bsd-2-clause
-57,700,026,657,502,620
38.457143
171
0.522327
false
petertodd/bitcoin
contrib/devtools/update-translations.py
54
2334
#!/usr/bin/python # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Run this script from the root of the repository to update all translations from transifex. It will do the follo...
mit
-5,883,293,023,253,031,000
34.363636
101
0.682519
false
traveloka/ansible
lib/ansible/modules/network/eos/eos_config.py
25
12504
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
2,057,121,600,524,428,000
34.322034
81
0.651871
false
0k/odoo
addons/web_tip/__openerp__.py
31
1291
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
-2,850,283,671,045,597,700
33.891892
78
0.563129
false
alex/warehouse
tests/unit/test_sessions.py
1
21090
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
apache-2.0
-3,131,396,116,381,256,700
33.016129
79
0.580986
false
tensorflow/tensorflow
tensorflow/python/ops/structured/structured_array_ops.py
6
20742
# Lint as python3 # Copyright 2020 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 r...
apache-2.0
-6,387,066,496,174,278,000
34.45641
92
0.654566
false
theheros/kbengine
kbe/res/scripts/common/Lib/test/test_winreg.py
3
18930
# Test the windows specific win32reg module. # Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey import os, sys import unittest from test import support threading = support.import_module("threading") from platform import machine # Do this first so test will be skipped if module doesn't exis...
lgpl-3.0
7,014,132,232,162,777,000
41.888631
79
0.576496
false
vhaupert/mitmproxy
mitmproxy/proxy/protocol/http2.py
1
30035
import threading import time import functools from typing import Dict, Callable, Any, List, Optional # noqa import h2.exceptions from h2 import connection from h2 import events import queue from mitmproxy import connections # noqa from mitmproxy import exceptions from mitmproxy import http from mitmproxy.proxy.prot...
mit
6,689,100,719,969,246,000
40.143836
136
0.610488
false
creasyw/IMTAphy
documentation/doctools/tags/0.4.3/sphinx/linkcheck.py
11
3581
# -*- coding: utf-8 -*- """ sphinx.linkcheck ~~~~~~~~~~~~~~~~ The CheckExternalLinksBuilder class. :copyright: 2008 by Georg Brandl, Thomas Lamb. :license: BSD. """ import socket from os import path from urllib2 import build_opener, HTTPError from docutils import nodes from sphinx.builder impor...
gpl-2.0
-7,146,254,761,796,531,000
27.648
81
0.51131
false
ahmadiga/min_edx
common/test/acceptance/tests/studio/test_studio_asset.py
37
1708
""" Acceptance tests for Studio related to the asset index page. """ from ...pages.studio.asset_index import AssetIndexPage from .base_studio_test import StudioCourseTest from ...fixtures.base import StudioApiLoginError class AssetIndexTest(StudioCourseTest): """ Tests for the Asset index page. """ ...
agpl-3.0
6,913,080,152,349,685,000
29.5
72
0.608899
false
renfredxh/pylletTown
pylletTown.py
1
8123
import pygame import tmx class Player(pygame.sprite.Sprite): def __init__(self, location, orientation, *groups): super(Player, self).__init__(*groups) self.image = pygame.image.load('sprites/player.png') self.imageDefault = self.image.copy() self.rect = pygame.Rect(location, (64,64)...
mit
4,085,456,416,287,287,000
37.870813
81
0.543395
false
carlmw/oscar-wager
django/contrib/gis/gdal/field.py
264
6059
from ctypes import byref, c_int from datetime import date, datetime, time from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import OGRException from django.contrib.gis.gdal.prototypes import ds as capi # For more information, see the OGR C API source code: # http://www.gdal.org/ogr/...
bsd-3-clause
4,473,317,701,176,517,000
33.039326
101
0.606536
false
DJMelonz/basic-blog
django/views/generic/simple.py
245
2319
from django.template import loader, RequestContext from django.http import HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponseGone from django.utils.log import getLogger import warnings warnings.warn( 'Function-based generic views have been deprecated; use class-based views instead.', ...
bsd-3-clause
-6,451,735,320,082,775,000
35.234375
107
0.644674
false
RockRaidersInc/ROS-Main
gps/src/FSM.py
1
1234
"""TODO.""" from enum import Enum import UBX def isObj(obj, cls): """Test if UBX message obj is of class cls.""" return obj._class == cls._class and obj._id == cls._id def isACK(obj): """Test whether message obj is a ACK.""" return isObj(obj, UBX.ACK.ACK) def isNAK(obj): """Test whether messag...
gpl-3.0
5,613,455,981,996,897,000
26.422222
69
0.550243
false
incaser/odoo-odoo
doc/_extensions/odoo/translator.py
207
26718
# -*- coding: utf-8 -*- import os.path import posixpath import re import urllib from docutils import nodes from sphinx import addnodes, util from sphinx.locale import admonitionlabels def _parents(node): while node.parent: node = node.parent yield node class BootstrapTranslator(nodes.NodeVisitor...
agpl-3.0
-5,262,659,755,275,446,000
38.346097
127
0.576246
false
brettatoms/cerberus
docs/conf.py
1
8056
# -*- coding: utf-8 -*- # # Cerberus documentation build configuration file, created by # sphinx-quickstart on Thu Oct 11 15:52:25 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
isc
2,494,742,778,687,457,300
31.615385
102
0.705437
false
aam-at/tensorflow
tensorflow/python/ops/ragged/ragged_tensor.py
1
117296
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-2,884,416,179,128,553,000
38.828862
82
0.62639
false
niphlod/pydal
pydal/connection.py
1
5577
# -*- coding: utf-8 -*- import os from ._compat import itervalues from ._globals import GLOBAL_LOCKER, THREAD_LOCAL from ._load import OrderedDict from .helpers._internals import Cursor class ConnectionPool(object): POOLS = {} check_active_connection = True def __init__(self): _iid_ = str(id(self...
bsd-3-clause
647,975,468,857,402,200
31.805882
80
0.551013
false
pmav99/praktoras
checks.d/windows_service.py
9
3049
""" Collect status information for Windows services """ # project from checks import AgentCheck from checks.wmi_check import WinWMICheck from utils.containers import hash_mutable from utils.timeout import TimeoutException class WindowsService(WinWMICheck): STATE_TO_VALUE = { 'Stopped': AgentCheck.CRITICAL...
bsd-3-clause
7,398,474,776,349,262,000
36.641975
94
0.58675
false
av8ramit/tensorflow
tensorflow/contrib/copy_graph/python/util/copy_test.py
112
3739
# 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
-514,260,967,706,795,900
32.383929
80
0.695641
false
jparyani/capnproto
doc/_plugins/capnp_lexer.py
35
2103
#! /usr/bin/env python from pygments.lexer import RegexLexer from pygments.token import * class CapnpLexer(RegexLexer): name = "Cap'n Proto lexer" aliases = ['capnp'] filenames = ['*.capnp'] tokens = { 'root': [ (r'#.*?$', Comment.Single), (r'@[0-9a-zA-Z]*', Name.Decor...
mit
-155,919,753,465,851,780
31.859375
114
0.410842
false
inveniosoftware/iugw2017
3-datamodels/custom-data-module/custom_data_module/providers.py
1
1974
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2017 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-3.0
-4,090,832,047,793,225,000
35.555556
76
0.727964
false
PowerDNS/exabgp
dev/unittest2/connection.py
6
1401
#!/usr/bin/env python # encoding: utf-8 """ connection.py Created by Thomas Mangin on 2013-07-13. Copyright (c) 2009-2013 Exa Networks. All rights reserved. """ import os import sys import unittest from exabgp.util.od import od def test (): OPEN = ''.join([chr(int(_,16)) for _ in "FF FF FF FF FF FF FF FF FF FF FF ...
bsd-3-clause
6,275,132,405,746,301,000
22.35
139
0.673804
false
infoxchange/django-localflavor
localflavor/nz/forms.py
4
4267
# -*- coding: utf-8 -*- """ New Zealand specific form helpers """ from __future__ import unicode_literals import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.encoding import smart_str from djang...
bsd-3-clause
-3,785,158,740,881,121,300
29.478571
101
0.627842
false
huanpc/IoT-1
gui/controller/.venv/lib/python3.5/site-packages/rest_framework/test.py
7
8635
# -- coding: utf-8 -- # Note that we import as `DjangoRequestFactory` and `DjangoClient` in order # to make it harder for the user to import the wrong thing without realizing. from __future__ import unicode_literals from django.conf import settings from django.test import testcases from django.test.client import Clie...
mit
-7,925,660,871,083,471,000
36.543478
88
0.633353
false
shanot/imp
modules/multifit/test/test_connected_components.py
2
1704
import sys import os import IMP import IMP.em import IMP.test import IMP.core import IMP.atom import IMP.multifit class Tests(IMP.test.TestCase): """Test connected components """ def setUp(self): """Build test model and optimizer""" IMP.test.TestCase.setUp(self) IMP.set_log_level(IMP...
gpl-3.0
-9,053,860,916,981,820,000
32.411765
80
0.474178
false
yunlongliukm/chm1_scripts
AlignmentReaders.py
2
1464
#!/usr/bin/env python class Alignment: def __init__(self): self.qname = "" self.tname = "" self.qstat = 0 self.qend = 0 self.qstrand = 0 self.qlen = 0 self.tstart = 0 self.tend = 0 self.tstrand = 0 self.tlen = 0 self.score...
mit
1,735,863,842,657,650,400
26.622642
141
0.495219
false
jriehl/numba
numba/roc/hsadrv/devices.py
2
3256
""" Expose each GPU device directly """ from __future__ import print_function, absolute_import, division import functools from numba import servicelib from .driver import hsa as driver, Context as _Context class _culist(object): """A thread local list of GPU instances """ def __init__(self): self...
bsd-2-clause
2,244,699,453,681,832,400
19.738854
71
0.577088
false
prestoncarman/vxquery
vxquery-server/src/main/resources/scripts/cluster_cli.py
11
3506
#!/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 "Lic...
apache-2.0
6,922,124,569,572,692,000
38.393258
127
0.577581
false
dyyi/moneybook
venv/Lib/site-packages/pip/_vendor/requests/packages/urllib3/fields.py
200
5872
from __future__ import absolute_import import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. ...
apache-2.0
3,371,072,089,198,396,000
31.988764
88
0.586683
false
thaumos/ansible
lib/ansible/modules/network/fortios/fortios_webfilter_content.py
24
10670
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2018 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
gpl-3.0
-2,413,479,616,187,359,000
30.568047
124
0.515558
false
kemalakyol48/python-for-android
python-modules/twisted/twisted/names/test/test_names.py
49
31329
# -*- test-case-name: twisted.names.test.test_names -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for twisted.names. """ import socket, operator, copy from twisted.trial import unittest from twisted.internet import reactor, defer, error from twisted.internet.de...
apache-2.0
-5,313,144,541,597,137,000
33.926421
110
0.574388
false
openconnectome/m2g
MR-OCP/MROCPdjango/computation/plotting/HBMPlot.py
2
14895
#!/usr/bin/env python # Copyright 2014 Open Connectome Project (http://openconnecto.me) # # 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 # #...
apache-2.0
-4,639,764,769,957,461,000
27.373333
116
0.590198
false
arush0311/scrapy
scrapy/mail.py
12
4745
""" Mail sending helpers See documentation in docs/topics/email.rst """ import logging from six.moves import cStringIO as StringIO import six from email.utils import COMMASPACE, formatdate from six.moves.email_mime_multipart import MIMEMultipart from six.moves.email_mime_text import MIMEText from six.moves.email_mim...
bsd-3-clause
-2,012,089,322,382,089,200
36.362205
112
0.598946
false
kaplun/inspire-next
inspirehep/modules/literaturesuggest/__init__.py
1
1056
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
gpl-3.0
939,974,482,425,567,500
38.111111
77
0.756629
false
stinos/micropython
tests/extmod/uasyncio_lock_cancel.py
16
1373
# Test that locks work when cancelling multiple waiters on the lock try: import uasyncio as asyncio except ImportError: try: import asyncio except ImportError: print("SKIP") raise SystemExit async def task(i, lock, lock_flag): print("task", i, "start") try: await l...
mit
-8,540,278,473,537,875,000
23.963636
80
0.624909
false
travisjwarren/train_track
train_track/tests/apps/event/test_event_delete_attendee_views.py
1
2680
__author__ = 'traviswarren' from django.test import TestCase from django.core.urlresolvers import reverse from django.contrib.auth.models import User from train_track.apps.profile.models import UserProfileEvent from train_track.tests.model_factory import UserProfileEventFactory class EventGetDeleteViewTestCases(Tes...
gpl-3.0
-935,778,037,017,512,600
39.014925
115
0.689179
false
reinout/django
tests/migrations/test_loader.py
26
19137
from django.db import connection, connections from django.db.migrations.exceptions import ( AmbiguityError, InconsistentMigrationHistory, NodeNotFoundError, ) from django.db.migrations.loader import MigrationLoader from django.db.migrations.recorder import MigrationRecorder from django.test import TestCase, modify_...
bsd-3-clause
297,046,835,465,353,800
38.86875
107
0.603491
false
kmoocdev/edx-platform
docs/shared/conf.py
158
10580
# -*- coding: utf-8 -*- # # getting_started documentation build configuration file, created by # sphinx-quickstart on Tue Apr 16 11:19:12 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file....
agpl-3.0
7,472,479,033,266,397,000
29.755814
173
0.684594
false
longman694/youtube-dl
youtube_dl/extractor/vube.py
64
6933
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, ) from ..utils import ( int_or_none, ExtractorError, ) class VubeIE(InfoExtractor): IE_NAME = 'vube' IE_DESC = 'Vube.com' _VALID_URL = r'https?://vube\.com/(?:[^/]+/)+(?P<id...
unlicense
-505,294,144,034,248,100
39.30814
145
0.504399
false
kleins11/intdatasci-byte2
jmankoff-mobile/lib/werkzeug/__init__.py
55
6917
# -*- coding: utf-8 -*- """ werkzeug ~~~~~~~~ Werkzeug is the Swiss Army knife of Python web development. It provides useful classes and functions for any WSGI application to make the life of a python web developer much easier. All of the provided classes are independent from each other so yo...
apache-2.0
1,952,082,143,620,249,600
44.506579
79
0.575394
false
goliate/sarakha63-persomov
couchpotato/core/media/_base/providers/nzb/binnewz/nzbdownloader.py
7
2796
import urllib2 from StringIO import StringIO import gzip import cookielib import time class NZBDownloader(object): def __init__( self ): self.cj = cookielib.CookieJar() self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cj)) self.lastRequestTime = None ...
gpl-3.0
3,298,821,325,182,967,300
34.405063
152
0.635551
false
ArthurGarnier/SickRage
lib/imdb/parser/http/searchCompanyParser.py
76
2929
""" parser.http.searchCompanyParser module (imdb package). This module provides the HTMLSearchCompanyParser class (and the search_company_parser instance), used to parse the results of a search for a given company. E.g., when searching for the name "Columbia Pictures", the parsed page would be: http://akas.imdb.co...
gpl-3.0
-3,595,158,417,871,122,000
40.253521
85
0.629908
false
nvoron23/hadoop-fundamentals
tfidf/framework.py
17
1300
import os import sys from itertools import groupby from operator import itemgetter SEPARATOR = "\t" class Streaming(object): @staticmethod def get_job_conf(name): name = name.replace(".", "_").upper() return os.environ.get(name) def __init__(self, infile=sys.stdin, separator=SEPARATOR):...
mit
-3,567,691,209,392,632,000
25
78
0.623077
false
mikeh77/mi-instrument
mi/instrument/seabird/sbe37smb/ooicore/test/sample_data.py
2
2612
from mi.instrument.seabird.sbe37smb.ooicore.driver import NEWLINE SAMPLE_DS = "SBE37-SMP V 2.6 SERIAL NO. 2165 05 Feb 2013 19:11:43" + NEWLINE + \ "not logging: received stop command" + NEWLINE + \ "sample interval = 20208 seconds" + NEWLINE + \ "samplenumber = 0, free = 200000"...
bsd-2-clause
-7,487,891,058,974,034,000
50.215686
91
0.487366
false
wzmao/mbio
mbio/Application/math.py
1
11942
# -*- coding: utf-8 -*- """This module contains some math and statistics functions. In the future plan: Eigenvalue, Inverse, Matrix Multiplication, SVD, PCA """ __author__ = 'Wenzhi Mao' __all__ = ['isSquare', 'ANOVA', 'performRegression', 'performPolyRegression'] def isSquare(x): """It is a...
mit
2,013,940,946,260,258,600
34.227139
118
0.504103
false
sysadminmatmoz/OCB
addons/auth_signup/res_users.py
25
14601
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime, timedelta import random from urlparse import urljoin import werkzeug from openerp.addons.base.ir.ir_mail_server import MailDeliveryException from openerp.osv import osv, fields from openerp...
agpl-3.0
7,313,346,925,181,784,000
46.405844
139
0.598041
false
arsenovic/clifford
clifford/test/test_g3c_tools.py
1
54096
import random from functools import reduce import time import functools import numpy as np import numpy.testing as npt from numpy import exp import pytest import numba from clifford import Cl from clifford.g3c import * from clifford import general_exp from clifford.tools.g3c import * from clifford.tools.g3c.rotor_pa...
bsd-3-clause
4,710,371,365,385,834,000
38.399854
132
0.551723
false
wummel/linkchecker
third_party/dnspython/tests/set.py
9
5255
# Copyright (C) 2003-2007, 2009-2011 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 "...
gpl-2.0
-4,161,545,223,461,990,000
24.264423
72
0.492864
false
siddhuwarrier/lockindicator-applet
src/xkb/XkbWrapper.py
2
14017
import ctypes.util import types import logging.handlers from typeutils.TypeChecker import require # Copyright (c) 2010 Siddhu Warrier (http://siddhuwarrier.homelinux.org, # siddhuwarrier AT gmail DOT com). # # This file is part of the xkb package. # The xkb package is free software: you can redistribute it and/or m...
gpl-3.0
4,055,779,405,065,198,600
50.160584
142
0.624099
false
snnn/tensorflow
tensorflow/python/kernel_tests/matrix_solve_op_test.py
47
7968
# 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
7,698,070,976,769,442,000
37.868293
80
0.584086
false
boyxuper/urllib3
test/test_util.py
3
17347
import hashlib import warnings import logging import unittest import ssl from itertools import chain from mock import patch, Mock from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers from urllib3.util.timeout import Timeout from urllib3.util.url import ( get_host, ...
mit
-5,254,778,066,646,307,000
38.06982
140
0.575777
false
nckx/dstat
plugins/dstat_vm_mem.py
4
1136
### Author: Bert de Bruijn <bert+dstat$debruijn,be> ### VMware memory stats ### Displays memory stats coming from the hypervisor inside VMware VMs. ### The vmGuestLib API from VMware Tools needs to be installed class dstat_plugin(dstat): def __init__(self): self.name = 'vmware memory' self.vars = ...
gpl-2.0
6,929,635,710,274,059,000
33.454545
73
0.589789
false
jbogaardt/chainladder-python
chainladder/development/tests/test_munich.py
1
1554
import numpy as np import chainladder as cl from rpy2.robjects.packages import importr from rpy2.robjects import r CL = importr("ChainLadder") def test_mcl_paid(): df = r("MunichChainLadder(MCLpaid, MCLincurred)").rx("MCLPaid") p = cl.MunichAdjustment(paid_to_incurred=("paid", "incurred")).fit( cl.De...
mit
-1,914,535,040,318,041,600
34.318182
88
0.660232
false
meteorcloudy/tensorflow
tensorflow/contrib/image/python/ops/image_ops.py
6
21765
# 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
9,122,117,178,000,511,000
41.344358
87
0.666713
false
simongoffin/my_odoo_tutorial
addons/crm/report/crm_phonecall_report.py
16
4157
# -*- 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
1,779,903,230,843,479,000
44.681319
145
0.565552
false
pratikmallya/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf/manifest.py
84
1387
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # 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; either # version 2.1 of the L...
apache-2.0
4,005,676,801,716,220,000
32.804878
80
0.733045
false
sureleo/leetcode
archive/python/math/MaxPointsOnALine.py
2
1654
# Definition for a point class Point: def __init__(self, a=0, b=0): self.x = a self.y = b class Solution: # @param points, a list of Points # @return an integer def maxPoints(self, points): result = 0 for i in xrange(len(points)): d = {} duplicate...
mit
-8,209,997,378,053,230,000
29.62963
57
0.384522
false
kubeflow/kfp-tekton-backend
sdk/python/kfp/azure.py
1
3009
# Copyright 2019 The Kubeflow 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...
apache-2.0
-4,223,764,411,932,221,000
38.592105
82
0.473579
false
rockerbox/kazoo
docs/conf.py
8
8004
# -*- coding: utf-8 -*- # # kazoo documentation build configuration file, created by # sphinx-quickstart on Fri Nov 11 13:23:01 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
apache-2.0
-2,662,345,440,492,113,000
30.143969
80
0.69965
false
kevin-who/socket-chat
node_modules/node-gyp/gyp/pylib/gyp/common.py
366
19638
# 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. from __future__ import with_statement import collections import errno import filecmp import os.path import re import tempfile import sys # A minimal memoizing d...
mit
-7,770,871,766,627,708,000
31.784641
83
0.662898
false
rokups/Urho3D
Source/Tools/BindTool/util.py
1
2213
import os import subprocess def cpp_demangle(name): return subprocess.check_output(['c++filt', name]).decode('utf-8').strip() def split_identifier(identifier): """Splits string at _ or between lower case and uppercase letters.""" prev_split = 0 parts = [] if '_' in identifier: parts = [...
mit
3,886,588,096,399,914,500
28.118421
98
0.586082
false
mhnatiuk/phd_sociology_of_religion
scrapper/build/Twisted/twisted/trial/_dist/workerreporter.py
43
3922
# -*- test-case-name: twisted.trial._dist.test.test_workerreporter -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test reporter forwarding test results over trial distributed AMP commands. @since: 12.3 """ from twisted.python.failure import Failure from twisted.python.reflect impor...
gpl-2.0
2,528,751,842,829,035,500
30.886179
78
0.559663
false
arowla/commando
commando/tests/test_conf.py
5
1988
from commando.conf import AutoProp, ConfigDict class TestClass(AutoProp): @AutoProp.default def source(self): return 'source' def test_auto(): t = TestClass() assert t.source == 'source' def test_override(): t = TestClass() t.source = 'source1' assert t.source == 'source1' ...
mit
3,387,926,526,823,716,000
17.933333
59
0.464789
false
jss-emr/openerp-7-src
openerp/addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py
51
2829
#-*- 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,732,602,998,527,396,000
38.859155
138
0.600566
false
VaibhavAgarwalVA/sympy
sympy/physics/optics/medium.py
93
4875
""" **Contains** * Medium """ from __future__ import division __all__ = ['Medium'] from sympy import Symbol, sympify, sqrt from sympy.physics.units import c, u0, e0 class Medium(Symbol): """ This class represents an optical medium. The prime reason to implement this is to facilitate refraction, Fermat...
bsd-3-clause
-4,062,103,619,393,661,000
25.351351
82
0.582359
false
robinro/ansible
lib/ansible/playbook/loop_control.py
66
1328
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
6,573,447,607,688,028,000
33.947368
82
0.72741
false
soldag/home-assistant
homeassistant/components/nexia/sensor.py
10
7063
"""Support for Nexia / Trane XL Thermostats.""" from nexia.const import UNIT_CELSIUS from homeassistant.const import ( DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE, PERCENTAGE, TEMP_CELSIUS, TEMP_FAHRENHEIT, ) from .const import DOMAIN, NEXIA_DEVICE, UPDATE_COORDINATOR from .entity import Nexi...
apache-2.0
1,420,966,559,329,984,000
27.946721
77
0.485488
false
samsu/neutron
tests/unit/services/vpn/test_vpnaas_driver_plugin.py
12
7430
# Copyright 2013, Nachi Ueno, NTT I3, 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...
apache-2.0
-1,457,303,419,768,473,600
45.149068
79
0.543742
false
Openlights/firemix
plugins/fixture_step.py
1
2195
# This file is part of Firemix. # # Copyright 2013-2016 Jonathan Evans <jon@craftyjon.com> # # Firemix 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...
gpl-3.0
3,343,524,579,706,074,000
32.769231
93
0.642369
false
sgallagher/anaconda
pyanaconda/modules/storage/storage.py
1
14418
# # Kickstart module for the storage. # # Copyright (C) 2018 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is di...
gpl-2.0
-1,372,997,665,625,709,300
33.905569
100
0.669742
false
LLNL/spack
var/spack/repos/builtin/packages/muparser/package.py
5
1625
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Muparser(Package): """C++ math expression parser library.""" homepage = "http://mupars...
lgpl-2.1
-7,941,525,877,107,056,000
30.862745
97
0.597538
false
pkuyym/Paddle
paddle/contrib/float16/float16_transpiler.py
3
11063
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
1,695,814,833,258,386,400
42.214844
88
0.573443
false
lshain-android-source/external-chromium_org
media/tools/constrained_network_server/traffic_control_test.py
187
5943
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """End-to-end tests for traffic control library.""" import os import re import sys import unittest import traffic_control class...
bsd-3-clause
7,303,329,471,316,451,000
33.352601
80
0.633182
false
nishad-jobsglobal/odoo-marriot
addons/account/project/project.py
273
2423
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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,416,558,254,399,800,000
47.46
345
0.635163
false
blaze/dask
dask/array/reductions.py
1
52217
import builtins from collections.abc import Iterable import operator from functools import partial from itertools import product, repeat from math import factorial, log, ceil, log2 import numpy as np from numbers import Integral, Number from tlz import compose, partition_all, get, accumulate, pluck, drop from . impo...
bsd-3-clause
-6,353,376,076,036,699,000
30.608354
102
0.599747
false
1suming/readthedocs.org
readthedocs/projects/migrations/0035_make_null.py
13
12994
# -*- 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): # Changing field 'Project.num_point' db.alter_column('projects_project', 'num_point', self.gf('django.db.mo...
mit
-7,147,823,058,791,610,000
78.723926
230
0.561105
false
wilx/autoconf-archive
macro.py
9
4436
#! /usr/bin/env python from contextlib import closing import os, sys, subprocess, re, textwrap def loadFile(path): with closing( open(path) ) as fd: return fd.read() def writeFile(path, buffer): with closing( open(path, "w") ) as fd: fd.write(buffer) def splitSections(buffer): while buffer: assert...
gpl-3.0
7,881,672,914,899,835,000
33.929134
149
0.556357
false