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
14thibea/megamix
doc/example.py
1
2598
######################## # Prelude to the example ######################## """ This example is realized with a DP-VBGMM model The other mixtures and the K-means are working in the same way The available classes are: - Kmeans (kmeans) - GaussianMixture (GMM) - VariationalGaussianMixture (VBGMM) - DPVariation...
apache-2.0
5,257,591,040,589,627,000
25.793814
78
0.675905
false
pravsripad/mne-python
tutorials/source-modeling/plot_compute_covariance.py
4
8732
""" .. _tut_compute_covariance: Computing a covariance matrix ============================= Many methods in MNE, including source estimation and some classification algorithms, require covariance estimations from the recordings. In this tutorial we cover the basics of sensor covariance computations and construct a no...
bsd-3-clause
-342,805,886,594,376,450
46.456522
79
0.658383
false
tsdgeos/snapcraft
external_snaps_tests/__main__.py
5
3360
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
-8,513,185,958,405,063,000
30.111111
79
0.647024
false
openfun/edx-platform
lms/djangoapps/instructor/hint_manager.py
110
11466
""" Views for hint management. Get to these views through courseurl/hint_manager. For example: https://courses.edx.org/courses/MITx/2.01x/2013_Spring/hint_manager These views will only be visible if FEATURES['ENABLE_HINTER_INSTRUCTOR_VIEW'] = True """ import json import re from django.http import HttpResponse, Http...
agpl-3.0
-2,290,158,809,397,382,000
38.95122
109
0.647654
false
reshama/data-science-from-scratch
code/getting_data.py
60
6317
from __future__ import division from collections import Counter import math, random, csv, json from bs4 import BeautifulSoup import requests ###### # # BOOKS ABOUT DATA # ###### def is_video(td): """it's a video if it has exactly one pricelabel, and if the stripped text inside that pricelabel starts with 'Vi...
unlicense
8,779,195,072,058,586,000
27.327354
75
0.601551
false
Anonymouslemming/ansible
lib/ansible/modules/network/nxos/nxos_vrf_af.py
37
7795
#!/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
9,171,238,911,959,784,000
30.055777
85
0.61052
false
jmartinm/invenio
modules/bibformat/lib/elements/bfe_webauthorpage_data.py
18
1333
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011 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) a...
gpl-2.0
1,376,026,148,586,453,800
30
75
0.691673
false
cwadding/sensit-python
sensit/api/publication.py
1
2940
# Publications are stored actions which are taken when a feed is created, updated, deleted, or there is a matching percolator query. # # topic_id - The key for the parent topic # id - The identifier of the publication class Publication(): def __init__(self, topic_id, id, client): self.topic_id = topic_id self.id ...
mit
2,570,357,287,248,789,000
44.230769
204
0.709184
false
sysalexis/kbengine
kbe/src/lib/python/Lib/test/sortperf.py
92
4805
"""Sort performance test. See main() for command line syntax. See tabulate() for output format. """ import sys import time import random import marshal import tempfile import os td = tempfile.gettempdir() def randfloats(n): """Return a list of n random floats in [0, 1).""" # Generating floats is expensive,...
lgpl-3.0
5,491,446,564,412,256,000
27.431953
79
0.515921
false
kswiat/django
django/utils/module_loading.py
18
6640
from __future__ import absolute_import # Avoid importing `importlib` from this package. import copy from importlib import import_module import os import sys import warnings from django.core.exceptions import ImproperlyConfigured from django.utils import six from django.utils.deprecation import RemovedInDjango19Warni...
bsd-3-clause
-8,163,787,533,782,796,000
37.381503
88
0.55497
false
paterson/servo
tests/wpt/css-tests/css21_dev/xhtml1/support/fonts/makegsubfonts.py
820
14309
import os import textwrap from xml.etree import ElementTree from fontTools.ttLib import TTFont, newTable from fontTools.misc.psCharStrings import T2CharString from fontTools.ttLib.tables.otTables import GSUB,\ ScriptList, ScriptRecord, Script, DefaultLangSys,\ FeatureList, FeatureRecord, Feature,\ LookupLi...
mpl-2.0
-7,520,309,863,198,824,000
28.444444
135
0.641275
false
blacktear23/django
tests/regressiontests/utils/html.py
86
4753
import unittest from django.utils import html class TestUtilsHtml(unittest.TestCase): def check_output(self, function, value, output=None): """ Check that function(value) equals output. If output is None, check that function(value) equals value. """ if output is None: ...
bsd-3-clause
6,880,819,676,930,169,000
37.642276
127
0.489375
false
Beyond-Imagination/BlubBlub
ChatbotServer/ChatbotEnv/Lib/site-packages/numpy/polynomial/tests/test_laguerre.py
58
17242
"""Tests for laguerre module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.laguerre as lag from numpy.polynomial.polynomial import polyval from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_mod...
gpl-3.0
-4,871,106,777,705,268,000
31.593573
74
0.50377
false
alisaifee/limits
limits/_version.py
1
18450
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
mit
-5,901,818,309,689,888,000
34.480769
79
0.575176
false
jgonthier/psi4
tests/pytests/test_qcvars.py
10
8520
import copy import pytest from .utils import * import numpy as np import psi4 pytestmark = pytest.mark.quick _vars_entered = { 'VAR A': 4.0, 'VaR B': -4.0, 'MATVAR A': psi4.core.Matrix.from_array(np.arange(6).reshape(2, 3)), 'MatvaR B': psi4.core.Matrix.from_array(np.arange(3).reshape(1, 3)), '...
lgpl-3.0
7,590,267,403,531,396,000
29.106007
78
0.635211
false
vktr/CouchPotatoServer
couchpotato/core/media/movie/providers/automation/crowdai.py
12
3025
import re from couchpotato.core.helpers.rss import RSS from couchpotato.core.helpers.variable import tryInt, splitString from couchpotato.core.logger import CPLog from couchpotato.core.media.movie.providers.automation.base import Automation log = CPLog(__name__) autoload = 'CrowdAI' class CrowdAI(Aut...
gpl-3.0
2,018,766,652,589,445,400
31.988764
246
0.466446
false
openmips/stbgui
lib/python/Screens/TimeDateInput.py
25
2498
from Screen import Screen from Components.config import ConfigClock, ConfigDateTime, getConfigListEntry from Components.ActionMap import NumberActionMap from Components.ConfigList import ConfigListScreen from Components.Label import Label from Components.Pixmap import Pixmap import time import datetime class TimeDateI...
gpl-2.0
2,164,552,874,550,766,800
28.046512
101
0.696157
false
seaotterman/tensorflow
tensorflow/contrib/learn/python/learn/metric_spec_test.py
136
14891
# 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,618,708,374,674,634,000
33.3903
80
0.64858
false
KiChjang/servo
tests/wpt/web-platform-tests/tools/third_party/pywebsocket3/test/testdata/handlers/origin_check_wsh.py
21
1934
# 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 of conditions and the f...
mpl-2.0
3,945,826,400,840,328,700
43.976744
72
0.759049
false
lgp171188/cookiecutter
tests/test_generate_copy_without_render.py
25
2238
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_generate_copy_without_render --------------------------------- """ from __future__ import unicode_literals import os import pytest from cookiecutter import generate from cookiecutter import utils @pytest.fixture(scope='function') def remove_test_dir(request): ...
bsd-3-clause
7,118,681,708,085,399,000
30.521127
73
0.595621
false
h00dy/Diamond
src/collectors/slony/test/testslony.py
23
3624
#!/usr/bin/python # coding=utf-8 ############################################################################### from test import CollectorTestCase from test import get_collector_config from test import run_only from mock import patch from slony import SlonyCollector def run_only_if_psycopg2_is_available(func): ...
mit
-6,685,511,309,345,439,000
31.070796
79
0.51021
false
openstack/rally
tests/unit/test_resources.py
1
1715
# Copyright 2014: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
-2,202,229,556,121,345,300
39.833333
78
0.626822
false
mat650/metagoofil
discovery/googlesearch.py
15
1388
import string import httplib, sys import myparser import re import time class search_google: def __init__(self,word,limit,start,filetype): self.word=word self.results="" self.totalresults="" self.filetype=filetype self.server="www.google.com" self.hostname="www.google.com" self.userAgent="(Mozilla/5.0 (...
gpl-2.0
-896,784,996,591,188,000
27.916667
147
0.711095
false
fceller/arangodb
3rdParty/boost/1.62.0/libs/mpi/test/python/scatter_test.py
64
1300
# Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>. # Use, modification and distribution is subject to the Boost Software # License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Test scatter() collective. import boost.parallel.mpi as mpi from ...
apache-2.0
-2,034,549,639,160,177,200
35.111111
73
0.676923
false
drawks/ansible
test/units/module_utils/xenserver/test_xenserverobject.py
14
2121
# -*- coding: utf-8 -*- # # Copyright: (c) 2019, Bojan Vitnik <bvitnik@mainstream.rs> # 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 pytest from .FakeAnsibleModule import FakeAn...
gpl-3.0
-4,819,046,169,347,684,000
39.788462
125
0.688355
false
ahachete/gpdb
gpMgmt/bin/gppylib/commands/test/regress/test_regress_pg.py
54
1711
#!/usr/bin/env python # # Copyright (c) Greenplum Inc 2008. All Rights Reserved. # # Unit Testing of pg commands # import os import unittest import tempfile from gppylib.db import dbconn from gppylib.db.test import skipIfDatabaseDown from gppylib import gplog from gppylib.commands import pg from gppylib.gparray impo...
apache-2.0
954,840,922,570,454,900
28.5
95
0.607832
false
FrancisLab/bing_image_archiver
iorise_image_extractor.py
1
4682
import re import urllib from HTMLParser import HTMLParser class BlogAttachmentPageParser(HTMLParser): """HTMLParser used to extract the url of Bing images from a Blog Post Attachment Page from www.iorise.com (e.g.: http://www.iorise.com/blog/?attachment_id=44)""" def __init__(self, result_list): ...
mit
3,137,355,662,316,118,000
31.513889
126
0.559376
false
Distrotech/intellij-community
python/testData/inspections/PyTypeCheckerInspection/Generator.py
25
3013
def test(): def gen(n): for x in xrange(n): yield str(x) def f_1(xs): """ :type xs: list of int """ return xs def f_2(xs): """ :type xs: collections.Sequence of int """ return xs def f_3(xs): """ :type xs...
apache-2.0
-2,737,595,962,968,749,600
29.744898
128
0.50614
false
gbourdin/charlas
ml-notebook-to-prod/examples/mnistExample/mnistapi/mnistapi/__main__.py
1
1833
import click from os import cpu_count, environ, execvp from sys import prefix from .app import create_app @click.group() def cli(): pass @cli.command() def run_uwsgi(): """ Run API through uwsgi server. """ # avoid fork problems with tensorflow (and other non-serializable objects) environ[...
gpl-2.0
-5,149,527,838,607,180,000
29.55
94
0.648663
false
Walesson/angular2-movie-app
node_modules/node-forge/tests/forge_ssl/forge/ssl.py
169
16598
# Wrapper module for _ssl, providing some additional facilities # implemented in Python. Written by Bill Janssen. """\ This module provides some more Pythonic support for SSL. Object types: SSLSocket -- subtype of socket.socket which does SSL over the socket Exceptions: SSLError -- exception raised for I/O er...
gpl-3.0
1,523,085,738,166,268,200
33.152263
92
0.558983
false
aristotle-tek/cuny-bdif
AWS/ec2/lib/boto-2.34.0/tests/unit/vpc/test_routetable.py
64
20068
from tests.unit import unittest from tests.unit import AWSMockServiceTestCase from boto.vpc import VPCConnection, RouteTable class TestDescribeRouteTables(AWSMockServiceTestCase): connection_class = VPCConnection def default_body(self): return b""" <DescribeRouteTablesResponse xmlns="ht...
mit
-4,407,155,660,732,727,000
44.609091
99
0.568019
false
rc0r/afl-utils
afl_utils/afl_stats.py
1
15342
""" Copyright 2015-2016 @_rc0r <hlt99@blinkenshell.org> 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 t...
apache-2.0
3,642,230,502,189,135,000
33.868182
129
0.537023
false
jmdejong/Asciifarm
asciifarm/server/entity.py
1
4171
from . import serialize from .eventtarget import EventTarget class Entity: """ Attempt to implement an entity component system This is the base object Components are given on construction. Once a component is added to the object the attach method will be called on the component (if it has one). ...
gpl-3.0
6,339,724,012,334,653,000
29.669118
110
0.585231
false
yashrastogi16/python_koans
python2/runner/sensei.py
3
9891
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import re import sys import os import glob import helper from mockable_test_result import MockableTestResult from runner import path_to_enlightenment from libs.colorama import init, Fore, Style init() # init colorama class Sensei(MockableTestResult): ...
mit
-8,106,285,442,590,577,000
36.044944
87
0.528662
false
quole/gensim
gensim/corpora/wikicorpus.py
2
13419
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Copyright (C) 2012 Lars Buitinck <larsmans@gmail.com> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Construct a corpus from a Wikipedia (or other MediaWiki-based) database dum...
lgpl-2.1
2,339,635,076,073,072,000
40.162577
145
0.6148
false
vkroz/kafka
system_test/utils/system_test_utils.py
88
23697
# 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
-126,760,310,362,561,020
36.142633
143
0.601722
false
dudymas/python-openstacksdk
openstack/tests/unit/block_store/test_block_store_service.py
4
1110
# 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 t...
apache-2.0
-6,463,571,559,528,288,000
38.642857
75
0.730631
false
Serg09/socorro
socorro/external/postgresql/skiplist.py
8
3829
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import logging import psycopg2 from socorro.external import DatabaseError, MissingArgumentError from socorro.external.p...
mpl-2.0
-3,424,378,661,777,563,600
32.295652
78
0.583181
false
fuhongliang/odoo
addons/crm/wizard/crm_partner_binding.py
257
4570
# -*- 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,605,517,488,752,603,000
45.161616
130
0.601313
false
nevir/plexability
extern/depot_tools/third_party/logilab/common/proc.py
117
9352
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
gpl-2.0
-6,112,673,848,368,580,000
32.761733
83
0.591745
false
stefansommer/jetflows
code/run_two_jets.py
1
1970
#!/usr/bin/python # # This file is part of jetflows. # # Copyright (C) 2014, Henry O. Jacobs (hoj201@gmail.com), Stefan Sommer (sommer@di.ku.dk) # https://github.com/nefan/jetflows.git # # jetflows is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publishe...
agpl-3.0
3,034,996,930,457,353,700
31.295082
118
0.671066
false
mkeilman/sirepo
tests/template/srw_import_data/srx.py
2
35248
# -*- coding: utf-8 -*- ############################################################################# # SRWLIB Example: Virtual Beamline: a set of utilities and functions allowing to simulate # operation of an SR Beamline. # The standard use of this script is from command line, with some optional arguments, # e.g. for ...
apache-2.0
-2,868,898,278,633,323,500
66.915222
440
0.636064
false
luiseduardohdbackup/odoo
addons/auth_signup/res_config.py
445
2860
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
-8,442,038,951,579,543,000
54
119
0.647902
false
imjonsnooow/synapse
synapse/tests/test_async.py
1
3507
import time import unittest import threading import synapse.async as s_async import synapse.lib.threads as s_threads from synapse.tests.common import * class AsyncTests(SynTest): def test_async_basics(self): boss = s_async.Boss() data = {} def jobmeth(x, y=20): return x + y...
apache-2.0
2,413,508,944,930,172,000
21.480769
74
0.528372
false
rob356/SickRage
lib/unidecode/x06e.py
252
4640
data = ( 'Ben ', # 0x00 'Yuan ', # 0x01 'Wen ', # 0x02 'Re ', # 0x03 'Fei ', # 0x04 'Qing ', # 0x05 'Yuan ', # 0x06 'Ke ', # 0x07 'Ji ', # 0x08 'She ', # 0x09 'Yuan ', # 0x0a 'Shibui ', # 0x0b 'Lu ', # 0x0c 'Zi ', # 0x0d 'Du ', # 0x0e '[?] ', # 0x0f 'Jian ', # 0x10 'Mi...
gpl-3.0
-6,910,024,332,784,715,000
16.984496
20
0.388362
false
akshayaurora/kivy
kivy/uix/colorpicker.py
3
16388
''' Color Picker ============ .. versionadded:: 1.7.0 .. warning:: This widget is experimental. Its use and API can change at any time until this warning is removed. .. image:: images/colorpicker.png :align: right The ColorPicker widget allows a user to select a color from a chromatic wheel where pinch...
mit
-5,219,930,589,021,605,000
32.789691
79
0.538809
false
alhashash/odoomrp-wip
mrp_operations_time_control/models/operation_time.py
16
3343
# -*- encoding: utf-8 -*- ############################################################################## # # This program 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...
agpl-3.0
-1,394,578,828,778,536,400
37.872093
78
0.602453
false
milfeld/lammps
python/examples/mc.py
15
2535
#!/usr/bin/env python -i # preceeding line should have path for Python on your machine # mc.py # Purpose: mimic operation of example/MC/in.mc via Python # Syntax: mc.py in.mc # in.mc = LAMMPS input script import sys,random,math # set these parameters # make sure neigh skin (in in.mc) > 2*deltamove nloop =...
gpl-2.0
-400,698,895,635,863,000
22.472222
72
0.672978
false
linglung/ytdl
youtube_dl/extractor/morningstar.py
220
1732
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class MorningstarIE(InfoExtractor): IE_DESC = 'morningstar.com' _VALID_URL = r'https?://(?:www\.)?morningstar\.com/[cC]over/video[cC]enter\.aspx\?id=(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.mo...
unlicense
-8,856,469,103,416,465,000
35.851064
151
0.551963
false
defionscode/ansible
test/units/modules/network/slxos/test_slxos_config.py
30
8136
# # (c) 2018 Extreme Networks Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ans...
gpl-3.0
-2,331,172,785,893,253,600
40.723077
97
0.658555
false
felipedau/pyaxo
examples/axotor.py
2
24592
#!/usr/bin/env python import socket import threading import sys import os import curses import socks import stem.process from wh import WHMgr import random from binascii import a2b_base64 as a2b from binascii import b2a_base64 as b2a from getpass import getpass from smp import SMP from stem.control import Controller f...
gpl-3.0
474,111,654,373,516,160
34.486291
86
0.573073
false
kawamuray/ganeti
lib/watcher/state.py
2
7572
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google 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 2 of the License, or # (at your option) any later version. # ...
gpl-2.0
-1,895,066,879,734,944,500
28.348837
78
0.67644
false
imclab/CoECI-CMS-Healthcare-Fraud-Prevention
partnerclient/decision_module/decision_module/helper.py
3
1511
''' Copyright (C) 2013 TopCoder Inc., All Rights Reserved. ''' ''' This is the module that provides useful helper functions. Thread Safety: The implementation is thread safe. @author: TCSASSEMLBER @version: 1.0 ''' def log_entrance(logger, signature, parasMap): ''' Logs for entrance into public methods at DE...
apache-2.0
4,204,570,390,211,401,700
28.057692
79
0.628723
false
hoangt/tpzsimul.gem5
src/arch/x86/isa/insts/simd128/integer/logical/pand.py
91
3202
# 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
-389,914,660,292,749,500
38.04878
72
0.732355
false
arowla/csvkit
tests/test_unicsv.py
21
6571
#!/usr/bin/env python # -*- coding: utf-8 -*- import csv import os import six try: import unittest2 as unittest except ImportError: import unittest from csvkit import unicsv @unittest.skipIf(six.PY3, "Not supported in Python 3.") class TestUnicodeCSVReader(unittest.TestCase): def test_utf8(self): ...
mit
5,686,014,005,932,710,000
33.87234
95
0.558267
false
shuangshuangwang/spark
python/pyspark/sql/window.py
23
12863
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
-6,153,041,852,712,496,000
37.743976
100
0.612532
false
yencarnacion/jaikuengine
.google_appengine/lib/django-1.5/tests/regressiontests/admin_util/models.py
115
1303
from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible class Article(models.Model): """ A simple Article model for testing """ site = models.ForeignKey('sites.Site', related_name="admin_articles") title = models.CharField(max_length=...
apache-2.0
1,174,637,831,499,287,800
28.613636
75
0.708365
false
Clyde-fare/scikit-learn
sklearn/metrics/ranking.py
79
25426
"""Metrics to assess performance on classification task given scores Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria....
bsd-3-clause
5,139,893,970,337,328,000
34.26491
79
0.623889
false
GunnerJnr/_CodeInstitute
Stream-3/Full-Stack-Development/19.Djangos-Testing-Framework/4.How-To-Test-Models/we_are_social/accounts/forms.py
8
1889
from django import forms from django.contrib.auth.forms import UserCreationForm from django.core.exceptions import ValidationError from accounts.models import User class UserRegistrationForm(UserCreationForm): MONTH_ABBREVIATIONS = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept...
mit
404,499,046,444,078,000
29.967213
74
0.660667
false
atlassian/boto
tests/integration/ec2/elb/test_connection.py
100
12554
# Copyright (c) 2010 Hunter Blanks http://artifex.org/~hblanks/ # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation th...
mit
4,166,769,582,607,696,400
41.26936
120
0.634061
false
suiyuan2009/tensorflow
tensorflow/python/kernel_tests/sparse_tensors_map_ops_test.py
134
9952
# 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
-4,384,690,586,506,636,000
41.169492
80
0.665092
false
wrouesnel/ansible
lib/ansible/plugins/netconf/__init__.py
4
10724
# # (c) 2017 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
-9,121,203,277,571,318,000
42.241935
122
0.654233
false
BtbN/xbmc
lib/gtest/test/gtest_output_test.py
1733
12005
#!/usr/bin/env python # # Copyright 2008, 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-2.0
-6,145,831,389,545,537,000
34.835821
79
0.675635
false
skulbrane/metagoofil
hachoir_parser/program/exe_res.py
95
15292
""" Parser for resource of Microsoft Windows Portable Executable (PE). Documentation: - Wine project VS_FIXEDFILEINFO structure, file include/winver.h Author: Victor Stinner Creation date: 2007-01-19 """ from hachoir_core.field import (FieldSet, ParserError, Enum, Bit, Bits, SeekableFieldSet, UInt16, UInt3...
gpl-2.0
6,479,351,689,779,782,000
33.364045
100
0.576053
false
chdecultot/erpnext
erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py
7
1956
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import json from frappe.model.document import Document class EmployeeAttendanceTool(Document): pass @frappe.whitelist...
gpl-3.0
-8,111,983,554,132,141,000
31.6
125
0.714724
false
BT-ojossen/odoo
addons/crm_helpdesk/__openerp__.py
260
1956
# -*- 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,126,758,670,057,373,000
36.615385
78
0.618098
false
jaimahajan1997/sympy
sympy/physics/quantum/density.py
82
9834
from __future__ import print_function, division from itertools import product from sympy import Tuple, Add, Mul, Matrix, log, expand, Rational from sympy.core.trace import Tr from sympy.printing.pretty.stringpict import prettyForm from sympy.physics.quantum.dagger import Dagger from sympy.physics.quantum.operator imp...
bsd-3-clause
8,492,162,776,108,616,000
29.540373
90
0.575453
false
KarlTDebiec/westpa
lib/examples/wca-dimer_openmm/bruteforce/wcadimer.py
12
10747
#!/usr/local/bin/env python #============================================================================================= # MODULE DOCSTRING #============================================================================================= """ WCA fluid and WCA dimer systems. DESCRIPTION COPYRIGHT @author John D. Cho...
gpl-3.0
-6,536,331,286,747,009,000
35.804795
122
0.576068
false
wolverineav/neutron
neutron/core_extensions/base.py
32
1533
# Copyright (c) 2015 Red Hat Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
-6,785,748,535,176,739,000
30.9375
79
0.695369
false
40423105/2016fallcadp_hw
plugin/liquid_tags/graphviz.py
245
3198
""" GraphViz Tag --------- This implements a Liquid-style graphviz tag for Pelican. You can use different Graphviz programs like dot, neato, twopi etc. [1] [1] http://www.graphviz.org/ Syntax ------ {% graphviz <program> { <DOT code> } %} Examples -------- {% graphviz dot { digraph graph...
agpl-3.0
-6,084,093,312,393,851,000
23.984375
136
0.590369
false
Khilo84/PyQt4
pyuic/uic/Loader/loader.py
8
3049
############################################################################# ## ## Copyright (C) 2011 Riverbank Computing Limited. ## Copyright (C) 2006 Thorsten Marek. ## All right reserved. ## ## This file is part of PyQt. ## ## You may use this file under the terms of the GPL v2 or the revised BSD ## license as fol...
gpl-2.0
-7,973,019,566,549,408,000
41.943662
90
0.673008
false
c86j224s/snippet
Python_Pygments/lib/python3.6/site-packages/pygments/lexers/ooc.py
31
2999
# -*- coding: utf-8 -*- """ pygments.lexers.ooc ~~~~~~~~~~~~~~~~~~~ Lexers for the Ooc language. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, bygroups, words from pygments.token import Text, C...
apache-2.0
2,338,783,156,743,905,300
34.282353
81
0.400467
false
mytliulei/DCNRobotInstallPackages
windows/win32/pygal-1.7.0/pygal/test/test_pie.py
4
2015
# -*- coding: utf-8 -*- # This file is part of pygal # # A python svg graph plotting library # Copyright © 2012-2014 Kozea # # 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...
apache-2.0
-8,003,063,742,278,317,000
31.483871
79
0.644985
false
pbarton666/buzz_bot
djangoproj/djangoapp/csc/webapi/urls.py
1
2618
from django.conf.urls.defaults import * from piston.resource import Resource from csc.webapi.docs import documentation_view from csc.webapi.handlers import * # This gives a way to accept "query.foo" on the end of the URL to set the # format to 'foo'. "?format=foo" works as well. Q = r'(query\.(?P<emitter_format>.+))?$...
mit
3,591,715,415,787,534,300
55.913043
118
0.617647
false
s0930342674/pyload
module/plugins/container/RSDF.py
15
1699
# -*- coding: utf-8 -*- from __future__ import with_statement import binascii import re from Crypto.Cipher import AES from module.plugins.internal.Container import Container from module.utils import fs_encode class RSDF(Container): __name__ = "RSDF" __type__ = "container" __version__ = "0.31" ...
gpl-3.0
2,880,596,217,975,472,600
26.403226
82
0.542672
false
takis/django
django/contrib/gis/geoip2/base.py
335
9054
import os import socket import geoip2.database from django.conf import settings from django.core.validators import ipv4_re from django.utils import six from django.utils.ipv6 import is_valid_ipv6_address from .resources import City, Country # Creating the settings dictionary with any settings, if needed. GEOIP_SETT...
bsd-3-clause
-2,319,498,031,628,464,000
38.537118
113
0.617186
false
yawnosnorous/python-for-android
python-modules/twisted/twisted/web/test/test_error.py
52
5433
# Copyright (c) 2010 Twisted Matrix Laboratories. # See LICENSE for details. """ HTTP errors. """ from twisted.trial import unittest from twisted.web import error class ErrorTestCase(unittest.TestCase): """ Tests for how L{Error} attributes are initialized. """ def test_noMessageValidStatus(self): ...
apache-2.0
-8,810,419,224,234,900,000
34.980132
80
0.641082
false
Plexxi/st2
st2common/tests/unit/services/test_workflow.py
3
18346
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, Inc. # # 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
8,585,207,601,729,925,000
38.369099
89
0.630819
false
draugiskisprendimai/odoo
openerp/addons/base/tests/test_ir_attachment.py
433
3536
import hashlib import os import openerp import openerp.tests.common HASH_SPLIT = 2 # FIXME: testing implementations detail is not a good idea class test_ir_attachment(openerp.tests.common.TransactionCase): def setUp(self): super(test_ir_attachment, self).setUp() registry, cr, uid = self.regi...
agpl-3.0
6,441,844,423,614,154,000
37.434783
90
0.619061
false
zoidbergwill/lint-review
lintreview/config.py
2
5210
import os import logging.config from flask.config import Config from ConfigParser import ConfigParser from StringIO import StringIO def load_config(): """ Loads the config files merging the defaults with the file defined in environ.LINTREVIEW_SETTINGS if it exists. """ config = Config(os.getcwd()...
mit
-6,261,815,237,069,691,000
29.647059
72
0.583301
false
robfig/rietveld
third_party/oauth2client/multistore_file.py
52
12045
# Copyright 2011 Google Inc. All Rights Reserved. """Multi-credential file store with lock support. This module implements a JSON credential store where multiple credentials can be stored in one file. That file supports locking both in a single process and across processes. The credential themselves are keyed off of...
apache-2.0
8,741,447,103,262,036,000
28.449878
86
0.661934
false
hzruandd/AutobahnPython
examples/twisted/wamp/pubsub/unsubscribe/backend.py
8
2223
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with...
mit
-2,893,989,510,565,218,300
36.05
79
0.665317
false
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/scipy/sparse/csgraph/tests/test_graph_laplacian.py
26
4388
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # Jake Vanderplas <vanderplas@astro.washington.edu> # License: BSD from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_allclose, assert_array_almost_equal from pytest import raises as asser...
gpl-3.0
-4,008,578,468,169,761,000
31.264706
79
0.553099
false
upgoingstar/datasploit
emails/email_scribd.py
2
1462
#!/usr/bin/env python import base import re import sys import requests from termcolor import colored # Control whether the module is enabled or not ENABLED = True class style: BOLD = '\033[1m' END = '\033[0m' def banner(): print colored(style.BOLD + '\n---> Searching Scribd Docs\n' +...
gpl-3.0
-6,765,973,988,487,786,000
24.581818
107
0.582763
false
tumbl3w33d/ansible
test/lib/ansible_test/_internal/manage_ci.py
17
10692
"""Access Ansible Core CI remote services.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import tempfile import time from .util import ( SubprocessError, ApplicationError, cmd_quote, display, ANSIBLE_TEST_DATA_ROOT, ) from .util_common import...
gpl-3.0
5,801,061,022,044,204,000
32.4125
127
0.528152
false
mnahm5/django-estore
Lib/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py
17
10226
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc from fractions import gcd import six from cryptography impor...
mit
-8,585,657,132,831,152,000
27.093407
79
0.584882
false
defance/edx-platform
lms/djangoapps/ccx/tests/test_field_override_performance.py
27
9659
# coding=UTF-8 """ Performance tests for field overrides. """ import ddt import itertools import mock from nose.plugins.skip import SkipTest from courseware.views import progress from courseware.field_overrides import OverrideFieldData from datetime import datetime from django.conf import settings from django.core.cac...
agpl-3.0
739,997,729,702,790,500
35.587121
114
0.572005
false
zaccoz/odoo
addons/web_diagram/controllers/main.py
268
4321
import openerp from openerp.tools.safe_eval import safe_eval as eval class DiagramView(openerp.http.Controller): @openerp.http.route('/web_diagram/diagram/get_diagram_info', type='json', auth='user') def get_diagram_info(self, req, id, model, node, connector, src_node, des_node, label...
agpl-3.0
-5,902,369,261,231,614,000
38.281818
113
0.51863
false
mkennedy04/knodj
env/Lib/site-packages/django/utils/crypto.py
82
6844
""" Django's standard crypto functions and utilities. """ from __future__ import unicode_literals import binascii import hashlib import hmac import random import struct import time from django.conf import settings from django.utils import six from django.utils.encoding import force_bytes from django.utils.six.moves i...
mit
7,407,117,414,099,400,000
35.021053
80
0.621712
false
gunan/tensorflow
tensorflow/python/platform/sysconfig.py
3
2718
# 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,158,888,667,916,578,600
30.604651
86
0.699411
false
1013553207/django
django/utils/text.py
308
14923
from __future__ import unicode_literals import re import unicodedata from gzip import GzipFile from io import BytesIO from django.utils import six from django.utils.encoding import force_text from django.utils.functional import SimpleLazyObject, allow_lazy from django.utils.safestring import SafeText, mark_safe from ...
bsd-3-clause
1,815,738,182,112,071,200
33.305747
90
0.562957
false
forge33/CouchPotatoServer
libs/subliminal/cache.py
107
4619
# -*- coding: utf-8 -*- # Copyright 2012 Nicolas Wack <wackou@gmail.com> # # This file is part of subliminal. # # subliminal 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 Licen...
gpl-3.0
-7,303,303,058,693,914,000
33.470149
97
0.627625
false
maxamillion/ansible
lib/ansible/module_utils/compat/_selectors2.py
79
23517
# This file is from the selectors2.py package. It backports the PSF Licensed # selectors module from the Python-3.5 stdlib to older versions of Python. # The author, Seth Michael Larson, dual licenses his modifications under the # PSF License and MIT License: # https://github.com/SethMichaelLarson/selectors2#license #...
gpl-3.0
-8,857,409,347,936,489,000
34.903817
90
0.546668
false
IONISx/edx-platform
cms/djangoapps/contentstore/management/commands/import.py
64
2065
""" Script for importing courseware from XML format """ from django.core.management.base import BaseCommand, CommandError, make_option from django_comment_common.utils import (seed_permissions_roles, are_permissions_roles_seeded) from xmodule.modulestore.xml_importer import imp...
agpl-3.0
-7,177,496,454,057,260,000
37.240741
120
0.629056
false
msingh172/youtube-dl
youtube_dl/extractor/movieclips.py
126
2668
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, ) from ..utils import ( ExtractorError, clean_html, ) class MovieClipsIE(InfoExtractor): _VALID_URL = r'https?://movieclips\.com/(?P<id>[\da-zA-Z]+)(?:-(?P<display_id>[\da-z-]+))?' ...
unlicense
896,235,759,170,830,800
32.35
100
0.533733
false
402231466/40223146
static/Brython3.1.0-20150301-090019/Lib/unittest/test/test_break.py
785
8138
import gc import io import os import sys import signal import weakref import unittest @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") @unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 " "if threa...
gpl-3.0
-8,486,412,868,664,153,000
31.293651
79
0.600639
false
zaqwes8811/matlab_ext
code-miners/projects/mkt-processors/data_str_to_json/coursera_title_parser.py
1
4890
#-*- coding: utf-8 -*- import sys sys.path.append('D:/github-release') import unittest import json # Other import uasio.os_io.io_wrapper as iow # App import _http_requester as http_request def _split_url(url): """ http://www.dessci.com/en/products/mathplayer/ to www.dessci.com /en/products/mathplayer/ - д...
apache-2.0
4,511,170,139,111,586,300
25.62069
79
0.519862
false
rs2/pandas
pandas/io/sql.py
1
62655
""" Collection of query wrappers / abstractions to both facilitate data retrieval and to reduce dependency on DB-specific API. """ from contextlib import contextmanager from datetime import date, datetime, time from functools import partial import re from typing import Iterator, Optional, Union, overload import warnin...
bsd-3-clause
1,203,945,829,041,733,400
32.398188
88
0.582348
false
JuanjoA/l10n-spain
l10n_es_aeat_mod340/__init__.py
14
1171
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 20011 Ting (http://www.ting.es) # Copyright (c) 2011-2013 Acysos S.L. (http://acysos.com) # Ignacio Ibeas Izquierdo <ignacio@...
agpl-3.0
1,647,807,216,550,706,700
44.038462
78
0.608027
false
jaredly/django-feedback
test_settings.py
2
5566
# Django settings for demoproject project. from os.path import abspath, dirname, join demoproject_dir = dirname(abspath(__file__)) DEBUG = True ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgres...
mit
-1,599,479,976,711,509,800
32.53012
108
0.651096
false