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
ZeitOnline/zeit.cms
src/zeit/cms/relation/migrate.py
1
1112
import sys import transaction import zeit.cms.interfaces import zeit.cms.relation.interfaces import zope.component import zope.site.hooks # these are 'zopectl run' scripts to migrate the old indexes into the new index # created for #6300. def dump_references(root): zope.site.hooks.setSite(root) relations = ...
bsd-3-clause
-5,317,633,710,645,745,000
26.8
79
0.679856
false
js0701/chromium-crosswalk
build/android/devil/utils/parallelizer.py
17
7129
# 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. """ Wrapper that allows method execution in parallel. This class wraps a list of objects of the same type, emulates their interface, and executes any functi...
bsd-3-clause
-1,170,502,808,236,534,800
28.458678
79
0.661804
false
andyzsf/django-cms
cms/sitemaps/cms_sitemap.py
59
2556
# -*- coding: utf-8 -*- from django.contrib.sitemaps import Sitemap from django.contrib.sites.models import Site from django.db.models import Q from django.utils import translation from cms.models import Title def from_iterable(iterables): """ Backport of itertools.chain.from_iterable """ for it in ...
bsd-3-clause
531,333,557,893,730,560
36.588235
92
0.632629
false
zooniverse/aggregation
experimental/algorithms/list_panoptes_projects.py
2
1210
__author__ = 'greg' import os import yaml import psycopg2 if os.path.exists("/home/ggdhines"): base_directory = "/home/ggdhines" else: base_directory = "/home/greg" environment = "staging" try: database_file = open("config/database.yml") except IOError: database_file = open(base_directory+"/Databases...
apache-2.0
1,590,876,713,343,120,600
24.765957
98
0.687603
false
hekra01/mercurial
mercurial/httppeer.py
2
10214
# httppeer.py - HTTP repository proxy classes for mercurial # # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from node i...
gpl-2.0
-3,929,770,281,057,725,000
36.141818
79
0.538379
false
crr0004/taiga-back
taiga/base/api/pagination.py
18
5727
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # 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 F...
agpl-3.0
-5,270,728,050,940,114,000
37.945578
90
0.600873
false
Tong-Chen/scikit-learn
sklearn/neighbors/nearest_centroid.py
12
5948
# -*- coding: utf-8 -*- """ Nearest Centroid Classification """ # Author: Robert Layton <robertlayton@gmail.com> # Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import numpy as np from scipy import sparse as sp from ..base import BaseEstimator, ClassifierMixin from ..externals.six.moves...
bsd-3-clause
4,153,182,852,088,243,000
36.408805
79
0.598689
false
edwinsteele/biblebox-pi
ansible/plugins/mitogen-0.2.2/ansible_mitogen/runner.py
2
21803
# Copyright 2017, David Wilson # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # 2....
apache-2.0
174,056,317,507,906,750
32.084977
79
0.608678
false
luzheqi1987/nova-annotation
nova/tests/unit/virt/vmwareapi/test_driver_api.py
1
118590
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 VMware, Inc. # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. Yo...
apache-2.0
3,063,938,931,821,469,700
43.750943
79
0.561936
false
encukou/samba
source4/dsdb/tests/python/ad_dc_search_performance.py
7
10234
#!/usr/bin/env python # -*- coding: utf-8 -*- import optparse import sys sys.path.insert(0, 'bin/python') import os import samba import samba.getopt as options import random import tempfile import shutil import time import itertools from samba.netcmd.main import cmd_sambatool # We try to use the test infrastructure ...
gpl-3.0
-7,918,764,731,114,739,000
33.691525
82
0.548075
false
huggingface/transformers
src/transformers/models/mbart/modeling_tf_mbart.py
1
72804
# coding=utf-8 # Copyright 2021 The Fairseq Authors and The HuggingFace Inc. team. 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/...
apache-2.0
906,839,023,626,584,400
46.709043
236
0.627754
false
sean797/Flexget
flexget/tests/api_tests/test_movie_list_api.py
4
17008
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import copy from flexget.api.app import empty_response, base_message from flexget.api.plugins.movie_list import ObjectsContainer as OC from flexget.manager import Session ...
mit
-6,042,560,452,963,223,000
38.738318
104
0.602481
false
elianerpereira/gtg
GTG/backends/rtm/rtm.py
2
11133
# Python library for Remember The Milk API __author__ = 'Sridhar Ratnakumar <http://nearfar.org/>' __all__ = ( 'API', 'createRTM', 'set_log_level', ) import urllib from hashlib import md5 from GTG import _ from GTG.tools.logger import Log _use_jsonlib = False try: import simplejson as json asse...
gpl-3.0
-2,318,017,735,025,414,700
25.826506
74
0.512081
false
whitehorse-io/encarnia
Encarnia/world/npcs.py
1
10554
from evennia import DefaultObject from evennia import default_cmds, CmdSet, utils from commands.default_cmdsets import ChargenCmdset, ShopCmdset, BankCmdset, MerchantCmdset from world import english_utils, npc_rules # , npc_rules from random import randint import time from evennia import TICKER_HANDLER as tickerh...
mit
5,858,861,048,160,334,000
38.444444
164
0.585939
false
overtherain/scriptfile
software/googleAppEngine/google/appengine/ext/mapreduce/output_writers.py
2
23241
#!/usr/bin/env python # # Copyright 2007 Google 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 required by applicable law o...
mit
-1,572,801,001,554,753,500
29.946738
80
0.661417
false
davidam/python-examples
scikit/plot_sgd_iris.py
64
2208
""" ======================================== Plot multi-class SGD on the iris dataset ======================================== Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the three one-versus-all (OVA) classifiers are represented by the dashed lines. """ print(__doc__) ...
gpl-3.0
8,629,269,298,321,392,000
25.60241
75
0.627264
false
allomov/ursula
playbooks/neutron-openvswitch-to-ml2-vlan-migration/files/migrate_to_ml2.py
15
18194
# Copyright (c) 2014 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 require...
mit
-3,285,101,139,318,126,000
39.07489
102
0.607398
false
eleme/polaris
tests/test_dashboard.py
1
2724
import json import unittest from nose.tools import ( assert_dict_contains_subset, assert_equal, assert_in, assert_true, ) from _fixtures import PolarisUserFixture _load_json = lambda rv: json.loads(rv.data.decode(rv.charset)) class PolarisDashboardTest(PolarisUserFixture): basic_dashboard = {...
mit
8,006,790,950,830,173,000
30.310345
78
0.609031
false
kasioumis/invenio
invenio/legacy/bibsched/bibtask_config.py
13
4632
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License,...
gpl-2.0
-7,300,059,729,449,066,000
28.883871
77
0.575561
false
Luxoft/SDLP2
SDL_Core/tools/InterfaceGenerator/Generator.py
6
3166
""" Generator application that generates c++ interfaces code from xml description usage: Generator.py [-h] --parser-type {sdlrpcv2} source-xml namespace output-dir SmartSchema interface generator positional arguments: source-xml namespace output-dir optional arguments: -h, --help ...
lgpl-2.1
-1,325,988,316,143,789,800
26.293103
77
0.663298
false
bentwire/mbed
workspace_tools/test_exporters.py
8
14475
""" mbed SDK Copyright (c) 2011-2014 ARM Limited 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 wr...
apache-2.0
3,163,911,003,437,014,000
41.324561
136
0.488774
false
KousikaGanesh/purchaseandInventory
openerp/addons/crm/crm_lead.py
13
55311
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-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
1,571,504,345,232,854,300
49.009946
265
0.580716
false
huddlej/pnwmoths
django/pnwmoths/species/models.py
1
18638
import datetime import os from Levenshtein import distance from sorl.thumbnail import ImageField import re from django.conf import settings from cms.models.pagemodel import Page from cms.models.fields import PageField, PlaceholderField from django.contrib.auth.models import User from django.contrib.localflavor.ca.ca_...
gpl-3.0
-9,086,595,317,074,321,000
33.073126
162
0.63113
false
c86j224s/snippet
Python_asyncio_binary_echo/pyclient2/Lib/site-packages/pip/_internal/req/__init__.py
8
2083
from __future__ import absolute_import import logging from .req_install import InstallRequirement from .req_set import RequirementSet from .req_file import parse_requirements from pip._internal.utils.logging import indent_log __all__ = [ "RequirementSet", "InstallRequirement", "parse_requirements", "install...
apache-2.0
3,843,066,817,071,842,000
29.188406
73
0.518963
false
jrowan/zulip
zerver/forms.py
1
13178
from __future__ import absolute_import from django import forms from django.conf import settings from django.contrib.auth.forms import SetPasswordForm, AuthenticationForm, \ PasswordResetForm from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.core.validators...
apache-2.0
-7,326,778,381,734,900,000
43.073579
109
0.61891
false
liberorbis/libernext
env/lib/python2.7/site-packages/IPython/terminal/interactiveshell.py
7
26795
# -*- coding: utf-8 -*- """Subclass of InteractiveShell for terminal based frontends.""" #----------------------------------------------------------------------------- # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> # Copyright (C) 2001-2007 Fernando Perez. <fperez@colorado.edu> # Copyright (C) 2008-2011 The...
gpl-2.0
-5,010,834,765,169,441,000
37.169516
93
0.539056
false
ndingwall/scikit-learn
benchmarks/bench_feature_expansions.py
34
1761
import matplotlib.pyplot as plt import numpy as np import scipy.sparse as sparse from sklearn.preprocessing import PolynomialFeatures from time import time degree = 2 trials = 3 num_rows = 1000 dimensionalities = np.array([1, 2, 8, 16, 32, 64]) densities = np.array([0.01, 0.1, 1.0]) csr_times = {d: np.zeros(len(dimens...
bsd-3-clause
-6,607,959,709,884,071,000
34.938776
72
0.625781
false
courtarro/gnuradio
gr-blocks/python/blocks/qa_add_mult_v.py
57
12447
#!/usr/bin/env python # # Copyright 2004,2007,2010,2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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...
gpl-3.0
8,207,791,014,937,373,000
33.671309
104
0.617659
false
amyvmiwei/chromium
webkit/tools/layout_tests/layout_package/test_expectations.py
2
21219
# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A helper class for reading in and dealing with tests expectations for layout tests. """ import logging import os import re import sys import tim...
bsd-3-clause
9,104,155,038,464,956,000
35.584483
80
0.660446
false
vrieni/orange
Orange/OrangeWidgets/Unsupervised/OWSymMatrixTransform.py
6
4036
""" <name>Matrix Transformation</name> <description>Tranforms matrix according to selected criteria</description> <contact>Miha Stajdohar</contact> <icon>icons/MatrixTransformation.svg</icon> <priority>1110</priority> """ from OWWidget import * import OWGUI import orange import exceptions import os.path import pickle ...
gpl-3.0
4,697,385,649,094,829,000
35.690909
170
0.5555
false
vermouth1992/tf-playground
analysis/cs231n/optim.py
2
6570
import numpy as np """ This file implements various first-order update rules that are commonly used for training neural networks. Each update rule accepts current weights and the gradient of the loss with respect to those weights and produces the next set of weights. Each update rule has the same interface: def updat...
apache-2.0
-2,592,331,041,924,055,600
39.555556
82
0.534551
false
RTSYork/bibtex
bibtexparser/bibdatabase.py
4
1905
from collections import OrderedDict class BibDatabase(object): """ A bibliographic database object following the data structure of a BibTeX file. """ def __init__(self): #: List of BibTeX entries, for example `@book{...}`, `@article{...}`, etc. Each entry is a simple dict with #: BibTe...
mit
7,349,558,520,342,299,000
37.12
115
0.586352
false
behdad/compreffor
setup.py
2
7861
#!/usr/bin/env python from __future__ import print_function from setuptools import setup, find_packages, Extension import os from distutils.errors import DistutilsSetupError from distutils import log from distutils.dep_util import newer_group from distutils.core import Command import pkg_resources import platform impor...
apache-2.0
1,821,552,777,176,334,000
34.40991
80
0.581605
false
naziris/HomeSecPi
upisStatus.py
1
1919
# /******************************************************* # * # * Copyright (C) 2015-2016 Kyriakos Naziris <kyriakos@naziris.co.uk> # * This is a thesis project of University of Portsmouth. # * # * This file is part of HomeSecPi. # * # * Feel free to use and modify the source code as long as # * as you give ...
apache-2.0
-8,687,632,902,161,164,000
25.287671
92
0.609171
false
joaormatos/anaconda
mmfparser/player/event/get_subclasses.py
1
1262
# Copyright (c) Mathias Kaerlev 2012. # This file is part of Anaconda. # Anaconda 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. # ...
gpl-3.0
3,229,002,860,561,867,000
36.147059
77
0.670365
false
Azure/azure-sdk-for-python
sdk/cognitiveservices/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_tag_py3.py
1
3936
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-4,850,283,640,241,665,000
39.163265
78
0.598069
false
davduran/thumbor
thumbor/loaders/strict_https_loader.py
7
1051
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com from thumbor.loaders import http_loader from tornado.concurrent impo...
mit
2,193,925,524,879,463,700
25.275
91
0.707897
false
Smattacus/data-analysis
python/modules/linreg.py
1
4281
#Module file that implements some basic Phillips - Twomey methods. import numpy as np def genConstB(M): ''' Generates and returns an (M-1) X M first difference matrix according to 19.5.3 of Numerical Recipes 3rd edition. B = [[-1, 1, 0, ... 0], [0, -1, 1, 0, ..., 0], ...
gpl-2.0
7,838,695,160,158,173,000
29.361702
80
0.554777
false
sanmugamk/django-nicedit
nicedit/tests.py
1
1897
import os from StringIO import StringIO from django.conf import settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.test import TestCase from django.utils import simplejson from .models import NicEditImage class ImageUploadTestCase(TestCase): def test_...
mit
7,046,270,147,133,991,000
39.361702
85
0.667897
false
fgregg/felzenszwalb
felzenszwalb/_felzenszwalb.py
1
3029
import warnings import numpy as np from _felzenszwalb_cy import _felzenszwalb_grey def felzenszwalb(image, scale=1, sigma=0.8, min_size=20): """Computes Felsenszwalb's efficient graph based image segmentation. Produces an oversegmentation of a multichannel (i.e. RGB) image using a fast, minimum spanning...
bsd-3-clause
-1,773,833,845,602,873,300
38.337662
79
0.659954
false
Veenk/Enigma
enigma1.py
1
3795
Alphabet = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] Rottor3 = [0,1,3,7,15,4,9,19,0,2,5,11,21,12,25,14,24,16,8,17,22,20,10,23,18,6,2,13,13]## числа соответсвуют индексам букв английского алфавита начиная с 0 Rottor2 = [5,8,23,21,24,14,12,22,5,2,3,10,11,7...
gpl-3.0
-1,478,236,694,083,896,800
34.656863
172
0.452795
false
franek/weboob
modules/okc/pages.py
3
7657
# -*- coding: utf-8 -*- # Copyright(C) 2012 Roger Philibert # # This file is part of weboob. # # weboob 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 op...
agpl-3.0
-8,842,928,831,012,691,000
42.477273
238
0.594224
false
sbaechler/thumbor-universalimages
tests/test_regions1.py
1
13981
# coding: utf-8 from __future__ import unicode_literals, absolute_import import numpy as np from .base import FilterTestCase from universalimages.filters.xmp.v01 import Xmp_API from os.path import abspath, join, dirname STORAGE_PATH = abspath(join(dirname(__file__), 'fixtures')) filter_data = { 'async': False,...
mit
6,788,511,776,829,995,000
40.120588
88
0.610328
false
thauser/pnc-cli
test/integration/test_buildrecords_api.py
1
7593
import pytest from pnc_cli.swagger_client.apis.buildrecords_api import BuildrecordsApi from pnc_cli.swagger_client.apis.buildconfigurations_api import BuildconfigurationsApi from test import testutils import pnc_cli.user_config as uc @pytest.fixture(scope='function', autouse=True) def get_builds_api(): global b...
apache-2.0
3,650,665,469,204,672,000
33.671233
108
0.733965
false
gnott/bot-lax-adaptor
src/conf.py
1
2822
import os, json, logging from os.path import join from pythonjsonlogger import jsonlogger ROOTLOG = logging.getLogger("") _supported_keys = [ #'asctime', #'created', 'filename', 'funcName', 'levelname', #'levelno', 'lineno', 'module', 'msecs', 'message', 'name', 'pathna...
gpl-3.0
-2,787,461,447,767,457,300
28.705263
99
0.67399
false
Tejal011089/osmosis_erpnext
erpnext/accounts/doctype/sales_invoice/sales_invoice.py
2
22870
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import frappe.defaults from frappe.utils import cint, cstr, flt from frappe import _, msgprint, throw from erpnext.accounts.party import g...
agpl-3.0
3,846,718,917,772,958,000
33.442771
153
0.670267
false
weilneb/twitter-utils
sample.py
1
2394
#!/usr/bin/env python import sys import tweepy import twutils import time import logging def getUserTimeline(tweepy_api,id,count=1): """ Returns a hash of tweetIDs mapped to tweet objects 1 <= count <= 200 """ api = tweepy_api out = {} for tweet in tweepy.Cursor(api.user_timeline,id=id).items(count): out[...
mit
-9,216,636,873,530,983,000
22.242718
91
0.672097
false
Grassboy/plugin.video.plurkTrend
youtube_dl/extractor/collegehumor.py
1
3241
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import int_or_none class CollegeHumorIE(InfoExtractor): _VALID_URL = r'^(?:https?://)?(?:www\.)?collegehumor\.com/(video|embed|e)/(?P<videoid>[0-9]+)/?(?P<shorttitle>.*)$' _TESTS = [{ 'url':...
mit
4,546,778,985,165,100,000
31.737374
119
0.495526
false
metaml/nupic
tests/integration/nupic/engine/vector_file_sensor_test.py
34
17754
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
3,986,534,284,211,292,000
36.298319
80
0.61879
false
konstruktoid/ansible-upstream
lib/ansible/modules/cloud/ovirt/ovirt_external_provider.py
12
14901
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 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 #...
gpl-3.0
-5,126,470,205,957,652,000
35.522059
147
0.619153
false
ypersyntelykos/GitSavvy
core/git_mixins/status.py
6
2987
from collections import namedtuple FileStatus = namedtuple("FileStatus", ("path", "path_alt", "index_status", "working_status")) IndexedEntry = namedtuple("IndexEntry", ( "src_path", "dst_path", "src_mode", "dst_mode", "src_hash", "dst_hash", "status", "status_score" )) IndexedEntr...
mit
-5,368,982,065,902,506,000
31.467391
93
0.567124
false
openstack/keystone
keystone/api/_shared/saml.py
2
2985
# 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 # d...
apache-2.0
-6,079,887,210,299,784,000
38.276316
78
0.673032
false
apple/llvm-project
lldb/test/API/functionalities/unwind/aarch64_unwind_pac/TestAArch64UnwindPAC.py
4
1788
""" Test that we can backtrace correctly when AArch64 PAC is enabled """ import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class AArch64UnwindPAC(TestBase): mydir = TestBase.compute_mydir(__file__) @skipIf(archs=no_match(["aarch64"]...
apache-2.0
716,156,616,507,187,200
37.042553
89
0.625839
false
tiancj/emesene
emesene/e3/xmpp/SleekXMPP/sleekxmpp/xmlstream/filesocket.py
3
1442
# -*- coding: utf-8 -*- """ sleekxmpp.xmlstream.filesocket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module is a shim for correcting deficiencies in the file socket implementation of Python2.6. Part of SleekXMPP: The Sleek XMPP Library :copyright: (c) 2011 Nathanael C. Fritz :license: MIT, see ...
gpl-3.0
-6,615,066,029,708,049,000
29.680851
75
0.651179
false
piti118/docker-compose-ui
scripts/requires_auth.py
3
1601
""" Authentication module inspired by http://flask.pocoo.org/snippets/8/ """ from functools import wraps import os from flask import request, Response def authentication_enabled(): """ check if authentication is enabled """ return os.environ.has_key('COMPOSE_USERNAME') and os.environ.has_key('COMPOSE_...
mit
7,541,984,439,492,792,000
27.589286
98
0.660837
false
15Dkatz/pants
src/python/pants/backend/jvm/tasks/coverage/engine.py
2
1946
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from abc import abst...
apache-2.0
-2,344,551,836,928,947,700
28.044776
100
0.708119
false
lwerdna/prdbg
prdbg.py
2
8586
#!/usr/bin/python # from python import os import re import sys import struct import string import readline # alib sys.path.append(os.environ['PATH_ALIB_PY']) import utils import bytes import parsing import toolchain import output # ours import ksyms import config mem = config.mem probe = config.probe toolchainOpts =...
gpl-2.0
2,522,112,454,598,080,000
29.884892
91
0.444794
false
eahneahn/free
djangoproject/frespo_currencies/models.py
4
1346
from django.db import models import json from django.utils import timezone __author__ = 'tony' class Rates(models.Model): blockchain_data = models.TextField(null=False) last_update_blockchain = models.DateTimeField(null=False) oer_data = models.TextField(null=False) last_update_oer = models.DateTimeF...
agpl-3.0
-4,470,000,685,680,424,400
24.884615
61
0.564636
false
walter-weinmann/wwe-euler
problems/solved/031_Solution.py
1
2320
''' Created on 19.08.2013 @author: Walter In England the currency is made up of pound, £, and pence, p, and there are eight coins in general circulation: 1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p). It is possible to make £2 in the following way: 1×£1 + 1×50p + 2×20p + 1×5p + 1×2p + 3×1p How many d...
apache-2.0
7,907,150,036,581,205,000
23.553191
79
0.354853
false
PennyQ/glue-3d-viewer
glue_vispy_viewers/extern/vispy/visuals/shaders/function.py
20
26400
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Classses representing GLSL objects (functions, variables, etc) that may be composed together to create complete shaders. See the docstring of Function for details. Detail...
bsd-2-clause
8,510,016,238,352,711,000
32.976834
79
0.545417
false
cloudera/hue
desktop/core/ext-py/kombu-4.3.0/t/unit/utils/test_compat.py
3
2898
from __future__ import absolute_import, unicode_literals import socket import sys import types from case import Mock, mock, patch from kombu.five import bytes_if_py2 from kombu.utils import compat from kombu.utils.compat import entrypoints, maybe_fileno class test_entrypoints: @mock.mask_modules('pkg_resource...
apache-2.0
-6,441,847,748,269,812,000
32.310345
77
0.600414
false
pablorecio/resistencia-1812
guadaboard/real_interaction.py
1
4813
# -*- coding: utf-8 -*- ############################################################################### # This file is part of Resistencia Cadiz 1812. # # # # This program is free software: you can redistribute it...
gpl-3.0
2,373,830,386,468,814,000
31.965753
79
0.534386
false
srmcc/survival_factor_model
survival/cox_funct.py
1
25300
""" Survival Factor Model, Copyright (C) 2017, Shannon McCurdy and Regents of the University of California. Contact: Shannon McCurdy, smccurdy@berkeley.edu. This file is part of Survival Factor Model. Survival Factor Model is free software: you can redistribute it and/or modify it under the terms of th...
gpl-3.0
5,043,679,131,369,757,000
46.378277
150
0.583755
false
jhertzog/pi
setup/opencv-ip-camera.py
1
2391
#!/usr/bin/python ''' Author: Igor Maculan - n3wtron@gmail.com A Simple mjpg stream http server https://gist.github.com/n3wtron/4624820 ''' import cv2 from PIL import Image import threading from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from SocketServer import ThreadingMixIn import StringIO import...
mit
-1,821,938,691,638,854,000
30.460526
84
0.56629
false
pschmitt/home-assistant
tests/components/coolmaster/test_config_flow.py
5
3195
"""Test the Coolmaster config flow.""" from homeassistant import config_entries, setup from homeassistant.components.coolmaster.const import AVAILABLE_MODES, DOMAIN from tests.async_mock import patch def _flow_data(): options = {"host": "1.1.1.1"} for mode in AVAILABLE_MODES: options[mode] = True ...
apache-2.0
4,301,952,349,206,945,300
31.272727
83
0.639124
false
Narrato/mongotron
docs/conf.py
1
8209
# -*- coding: utf-8 -*- # # Mongotron documentation build configuration file, created by # sphinx-quickstart on Wed Apr 10 17:59:31 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. # # A...
bsd-2-clause
5,100,492,511,956,259,000
31.44664
83
0.703253
false
blaze225/zulip
zproject/test_settings.py
6
4458
from __future__ import absolute_import import os # test_settings.py works differently from # dev_settings.py/prod_settings.py; it actually is directly referenced # by the test suite as DJANGO_SETTINGS_MODULE and imports settings.py # directly and then hacks up the values that are different for the # test suite. As wil...
apache-2.0
-681,926,775,158,144,600
35.243902
88
0.715792
false
asm0dey/Flexget
flexget/plugins/output/utorrent.py
1
3775
# -*- coding: utf-8 -*- from __future__ import unicode_literals, division, absolute_import import os from logging import getLogger from flexget import plugin from flexget.event import event from flexget.utils import requests from flexget.utils.soup import get_soup from flexget.utils.template import RenderError log ...
mit
5,257,146,993,961,259,000
35.298077
118
0.542781
false
nilnvoid/wagtail
wagtail/wagtailcore/migrations/0026_group_collection_permission.py
9
1281
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ('wagtailcore', '0025_collection_initial_data'), ] operations = [ migrations.CreateModel( ...
bsd-3-clause
1,976,197,143,398,402,000
39.03125
166
0.602654
false
NicovincX2/Python-3.5
Statistiques/Estimation (statistique)/Régression/ard_ols.py
1
2006
# -*- coding: utf-8 -*- import os import numpy as np import matplotlib.pyplot as plt from scipy import stats from sklearn.linear_model import ARDRegression, LinearRegression ############################################################################### # Generating simulated data with Gaussian weights # Parameters...
gpl-3.0
-3,763,972,797,468,654,000
28.940299
79
0.629113
false
bdh1011/wau
venv/lib/python2.7/site-packages/kombu/tests/__init__.py
32
2646
from __future__ import absolute_import import anyjson import atexit import os import sys from kombu.exceptions import VersionMismatch # avoid json implementation inconsistencies. try: import json # noqa anyjson.force_implementation('json') except ImportError: anyjson.force_implementation('simplejson') ...
mit
-6,503,958,529,895,079,000
28.076923
74
0.586924
false
mrjmad/gnu_linux_mag_drf
hall_of_cards/cardsgame/models.py
1
1058
# -*- coding: utf-8 -*- from __future__ import (print_function, division, absolute_import, unicode_literals) from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class CardType(models.Model): ...
mit
679,843,265,352,483,700
35.482759
84
0.695652
false
SPIhub/hummingbird
src/interface/ui/plotdata_table.py
2
12101
# -------------------------------------------------------------------------------------- # Copyright 2016, Benedikt J. Daurer, Filipe R.N.C. Maia, Max F. Hantke, Carl Nettelblad # Hummingbird is distributed under the terms of the Simplified BSD License. # ----------------------------------------------------------------...
bsd-2-clause
7,816,441,092,447,014,000
41.017361
117
0.60119
false
googleapis/python-memcache
google/cloud/memcache_v1beta2/services/cloud_memcache/transports/grpc.py
1
21102
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
apache-2.0
-5,307,335,109,750,029,000
42.689441
87
0.624585
false
jralls/gramps
gramps/gen/db/utils.py
1
6346
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2006 Donald N. Allingham # Copyright (C) 2011 Tim G L Lyons # Copyright (C) 2012 Doug Blank <doug.blank@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public...
gpl-2.0
-3,890,247,338,012,597,000
34.060773
79
0.551686
false
jascoul/caleido
caleido/tools.py
1
4138
import sys import os import json from pyramid.paster import get_appsettings from caleido import main from caleido.models import Person, Group, Work import transaction import sqlalchemy as sql import sqlalchemy.dialects.postgresql as postgresql from sqlalchemy.inspection import inspect def initialize_db(): if len...
agpl-3.0
-4,961,558,611,436,631,000
35.946429
76
0.568874
false
angr/angr
angr/knowledge_plugins/sync/sync_controller.py
1
10815
from functools import wraps from typing import Optional, List import time try: import binsync from binsync.client import Client from binsync.data.stack_variable import StackVariable, StackOffsetType binsync_available = True except ImportError: binsync_available = False from ... import knowledge_p...
bsd-2-clause
5,660,337,447,992,865,000
28.958449
113
0.588534
false
normanmaurer/autobahntestsuite-maven-plugin
src/main/resources/twisted/mail/test/test_smtp.py
1
53646
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for twisted.mail.smtp module. """ from zope.interface import implements, directlyProvides from twisted.python.util import LineLog from twisted.trial import unittest, util from twisted.protocols import basic, loopback from twisted....
apache-2.0
-918,394,436,964,376,800
31.493035
94
0.616038
false
mfx9/MolarisTools
MolarisTools/Scripts/ParseScans.py
2
8470
#------------------------------------------------------------------------------- # . File : ParseScans.py # . Program : MolarisTools # . Copyright : USC, Mikolaj Feliks (2015-2018) # . License : GNU GPL v3.0 (http://www.gnu.org/licenses/gpl-3.0.en.html) #--------------------------------------------------...
gpl-3.0
4,872,990,960,361,510,000
39.917874
185
0.468241
false
turnkeylinux/tklbam-duplicity
duplicity/dup_time.py
8
11205
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2002 Ben Escoto <ben@emerose.org> # Copyright 2007 Kenneth Loafman <kenneth@loafman.com> # # This file is part of duplicity. # # Duplicity is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License...
gpl-2.0
4,531,641,270,694,817,300
36.85473
92
0.604373
false
watspidererik/testenv
flask/lib/python2.7/site-packages/openid/store/sqlstore.py
154
17190
""" This module contains C{L{OpenIDStore}} implementations that use various SQL databases to back them. Example of how to initialize a store database:: python -c 'from openid.store import sqlstore; import pysqlite2.dbapi2; sqlstore.SQLiteStore(pysqlite2.dbapi2.connect("cstore.db")).createTables()' """ import re i...
mit
-4,553,668,678,451,956,700
32.313953
150
0.584235
false
thalamus/Flexget
flexget/plugins/modify/trackers.py
13
3935
from __future__ import unicode_literals, division, absolute_import import logging import re from flexget import plugin from flexget.event import event log = logging.getLogger('modify_torrents') class AddTrackers(object): """ Adds tracker URL to torrent files. Configuration example: ad...
mit
1,655,974,635,850,178,600
32.347458
102
0.529606
false
Uncaught-Exceptions/minedash
minedash/settings/base.py
1
3086
from __future__ import absolute_import, unicode_literals import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(PROJECT_DIR) # Application definition INSTALLED_APPS = [ 'overextends',...
gpl-2.0
-4,513,725,192,964,907,500
26.070175
73
0.675632
false
google/llvm-propeller
lldb/test/API/python_api/default-constructor/sb_target.py
13
2204
""" Fuzz tests an object after the default construction to make sure it does not crash lldb. """ import lldb def fuzz_obj(obj): obj.GetProcess() listener = lldb.SBListener() error = lldb.SBError() obj.Launch(listener, None, None, None, None, None, None, 0, True, error) obj.LaunchSimple(None, None...
apache-2.0
-7,780,246,359,565,545,000
32.907692
88
0.703721
false
jorgeblanco/newsstand_db
newsstand_db/tests/test_report.py
1
1270
from unittest import TestCase from newsstand_db import newsstandDB as ndb from os.path import isfile from os import remove from os import path class TestStats(TestCase): def setUp(self): self.__path = path.split(__file__)[0] self.__db = ndb(path.join(self.__path,'test.sql')) self.__db.creat...
gpl-2.0
-4,419,936,002,422,274,600
32.447368
105
0.607087
false
lukeiwanski/tensorflow
tensorflow/contrib/framework/python/ops/script_ops.py
22
5526
# 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,456,788,569,328,632,300
37.643357
80
0.69544
false
lfalvarez/votai
backend_staff/tests/mails_for_staff_tests.py
2
2615
# coding=utf-8 from popular_proposal.tests import ProposingCycleTestCaseBase as TestCase from votai_utils.send_mails import send_mails_to_staff from django.contrib.auth.models import User from popular_proposal.models import ProposalTemporaryData, PopularProposal from django.core import mail class MailsForStaffTestCas...
gpl-3.0
8,251,438,532,874,561,000
51.3
87
0.535373
false
JohnyEngine/CNC
heekscnc/nc/emc2.py
1
6948
import nc import iso import math class Creator(iso.Creator): def init(self): iso.Creator.init(self) def SPACE(self): return('') def TAP(self): return('G33.1') def TAP_DEPTH(self, format, depth): return(self.SPACE() + 'K' + (format.string(depth))) def BORE_FEED_OUT(self): return('G85') def BORE...
apache-2.0
5,745,079,074,543,860,000
28.565957
215
0.526051
false
talha81/TACTIC-DEV
src/tactic/ui/table/button_wdg.py
2
11838
########################################################### # # Copyright (c) 2005-2008, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written ...
epl-1.0
-1,662,967,524,765,522,400
29.510309
142
0.542321
false
EvanK/ansible
lib/ansible/modules/cloud/ovirt/ovirt_storage_connection.py
28
9861
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 Red Hat, Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMEN...
gpl-3.0
1,015,716,794,833,192,000
33.844523
136
0.593753
false
DominoTree/servo
tests/wpt/web-platform-tests/webdriver/tests/get_element_tag_name/user_prompts.py
26
3997
# META: timeout=long import pytest from tests.support.asserts import assert_error, assert_success, assert_dialog_handled from tests.support.inline import inline def get_element_tag_name(session, element_id): return session.transport.send("GET", "session/{session_id}/element/{element_id}/name".format( se...
mpl-2.0
-5,480,916,247,277,577,000
33.756522
97
0.707781
false
bigswitch/neutron
neutron/tests/unit/cmd/server/__init__.py
9
1323
# 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 # d...
apache-2.0
2,318,171,026,742,593,000
37.911765
78
0.714286
false
nttks/edx-platform
openedx/core/djangoapps/user_api/ga_accounts/views.py
1
3856
""" NOTE: this API is WIP and has not yet been approved. Do not use this API without talking to Hiro. """ import re from django.db import transaction from rest_framework import permissions, status from rest_framework.authentication import SessionAuthentication from rest_framework.views import APIView from rest_framew...
agpl-3.0
-1,958,526,097,132,670,500
31.957265
87
0.637707
false
brittlewis12/vim-config
bundle/conque_2.0/autoload/conque_term/conque_sole_shared_memory.py
11
5550
# FILE: autoload/conque_term/conque_sole_shared_memory.py {{{ # AUTHOR: Nico Raffo <nicoraffo@gmail.com> # WEBSITE: http://conque.googlecode.com # MODIFIED: 2010-11-15 # VERSION: 2.0, for Vim 7.0 # LICENSE: # Conque - Vim terminal/console emulator # Copyright (C) 2009-2010 Nico Raffo # # MIT License # # Permiss...
mit
2,889,391,370,352,451,000
26.475248
128
0.552432
false
lorensen/VTKExamples
src/Python/Filtering/Glyph2D.py
1
1221
#!/usr/bin/env python import vtk def main(): points = vtk.vtkPoints() points.InsertNextPoint(0,0,0) points.InsertNextPoint(1,1,0) points.InsertNextPoint(2,2,0) polydata = vtk.vtkPolyData() polydata.SetPoints(points) # Create anything you want here, we will use a polygon for the d...
apache-2.0
3,128,714,650,843,218,400
26.133333
72
0.695332
false
ManuSchmi88/landlab
landlab/components/stream_power/tests/test_sp_storms.py
6
2318
"""Test the storm generator and simple stream power eroder both execute.""" import os import pylab import time import copy import numpy as np from numpy.testing import assert_array_equal, assert_array_almost_equal try: from nose.tools import assert_is except ImportError: from landlab.testing.tools import asse...
mit
863,650,582,049,192,000
36.387097
77
0.667386
false
prathamtandon/g4gproblems
Arrays/generate_sorted_arrays.py
1
2409
import unittest """ Given two sorted arrays A and B, generate all possible arrays such that first element is taken from A then from B then from A and so on in increasing order till the arrays are exhausted. The generated arrays should end in an element from B. Input: A: 10 15 25 B: 1 5 20 30 Output: 10 20 10 20 25 30 1...
mit
4,995,010,734,875,396,000
30.285714
114
0.596928
false
lmd-in-learning/MachineLearning
SVM/svmMLia.py
1
9351
#SVM algorithm from numpy import * def loadDataSet(fileName): dataMat = []; labelMat = [] fr = open(fileName) for line in fr.readlines(): lineArr = line.strip().split('\t') dataMat.append([float(lineArr[0]), float(lineArr[1])]) labelMat.append(float(lineArr[2])) return dataMat, ...
gpl-3.0
6,473,314,718,721,273,000
33.505535
103
0.533847
false
funtoo/portage-funtoo
pym/portage/_emirrordist/FetchTask.py
1
17338
# Copyright 2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import collections import errno import logging import random import stat import subprocess import sys import portage from portage import _encodings, _unicode_encode from portage import os from portage.util._async.Fil...
gpl-2.0
-8,183,330,286,195,856,000
26.964516
104
0.657342
false
santoshdeshpande/transbiz
config/wsgi.py
1
1618
""" WSGI config for transbiz project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION``...
bsd-3-clause
-1,970,745,092,300,419,800
41.578947
79
0.797281
false