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
Pennebaker/wagtail
wagtail/contrib/wagtailroutablepage/tests.py
9
8024
import unittest import warnings import django from django.test import TestCase, RequestFactory from django.core.urlresolvers import NoReverseMatch from wagtail.wagtailcore.models import Page, Site from wagtail.tests.routablepage.models import OldStyleRoutablePageTest, NewStyleRoutablePageTest, routable_page_external_...
bsd-3-clause
4,869,643,648,671,386,000
37.951456
125
0.664257
false
SOKP/external_chromium_org
tools/telemetry/build/update_docs.py
103
4616
# 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. import logging import optparse import os import pkgutil import pydoc import re import sys import telemetry from telemetry.core import util telemetry_dir = u...
bsd-3-clause
1,412,440,408,988,980,700
30.189189
78
0.686958
false
tkelman/utf8rewind
tools/gyp/test/sibling/gyptest-relocate.py
100
1365
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import TestGyp test = TestGyp.TestGyp() # The xcode-ninja generator handles gypfiles which are not at the # project root incorrectly. # cf...
mit
-6,118,153,865,311,462,000
30.022727
76
0.668132
false
theguardian/JIRA-APPy
lib/tlslite/integration/pop3_tls.py
1
3161
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. """TLS Lite + poplib.""" import socket from poplib import POP3, POP3_SSL_PORT from lib.tlslite.tlsconnection import TLSConnection from lib.tlslite.integration.clienthelper import ClientHelper class POP3_TLS(POP3, ClientH...
gpl-2.0
-474,568,430,061,664,600
36.630952
72
0.653274
false
lemontree-testing/python_training
generator/contact.py
1
1376
__author__ = 'lemontree' from model.contact import Contacts import random import string import os.path import jsonpickle import getopt import sys try: opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contacts", "file"]) except getopt.GetoptError as err: getopt.usage() sys.exit(2) n = 5 f = "da...
apache-2.0
-1,113,756,245,671,404,800
34.307692
140
0.627907
false
florian-dacosta/OpenUpgrade
addons/point_of_sale/report/account_statement.py
380
2031
# -*- 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
-6,909,535,260,814,191,000
34.017241
79
0.611521
false
matthiasdiener/spack
var/spack/repos/builtin/packages/vegas2/package.py
5
2039
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
7,927,590,896,728,356,000
40.612245
78
0.664541
false
thelo-gaultier/itri-disco-ci
nodepool/scripts/cache_git_repos.py
22
2918
#!/usr/bin/env python # Copyright (C) 2011-2013 OpenStack Foundation # # 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 ...
apache-2.0
-3,296,116,432,426,094,000
32.159091
76
0.600754
false
rednach/krill
test/test_template_loop.py
15
1160
#!/usr/bin/env python # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # # This file is part of Shinken. # # Shinken 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
-289,257,760,535,701,800
29.526316
77
0.726724
false
msabramo/ansible
lib/ansible/modules/windows/win_command.py
6
4268
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Ansible, 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 o...
gpl-3.0
6,283,905,914,413,347,000
32.873016
174
0.693065
false
francisco-dlp/hyperspy
hyperspy/tests/component/test_erf.py
3
1327
# -*- coding: utf-8 -*- # Copyright 2007-2016 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
688,667,090,489,936,400
32.175
73
0.6948
false
jboeuf/grpc
src/python/grpcio_testing/grpc_testing/_server/_rpc.py
19
5233
# Copyright 2017 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
2,691,414,279,139,599,400
32.76129
80
0.609975
false
maxhome1/l10n-italy
l10n_it_withholding_tax/__init__.py
11
1133
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>) # Copyright (C) 2012 Domsense srl (<http://www.domsense.com>) # Copyright (C) 2012-2013 Associazione OpenERP Italia # (<http:...
agpl-3.0
-418,849,495,089,883,650
46.208333
80
0.60812
false
TheChymera/chr-helpers
chr_matplotlib.py
1
2908
__author__="Paul H, Horea Christian, Leonor Carcia Gutierrez" import numpy as np import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import AxesGrid def auto_remap(data): start=0 midpoint=0.5 stop=1.0 if np.nanmin(data) >= 0: raise ValueError('You do not need to rescale your cmap to c...
gpl-3.0
-3,362,460,810,394,572,300
32.425287
92
0.656121
false
dqnykamp/sympy
sympy/matrices/matrices.py
1
127921
from __future__ import print_function, division import collections from sympy.core.add import Add from sympy.core.basic import Basic, C, Atom from sympy.core.expr import Expr from sympy.core.function import count_ops from sympy.core.logic import _fuzzy_group_inverse, fuzzy_and from sympy.core.power import Pow from sym...
bsd-3-clause
-2,354,744,259,997,355,000
29.728081
137
0.486011
false
cgstudiomap/cgstudiomap
main/eggs/Django-1.9-py2.7.egg/django/contrib/auth/middleware.py
258
5718
from django.contrib import auth from django.contrib.auth import load_backend from django.contrib.auth.backends import RemoteUserBackend from django.core.exceptions import ImproperlyConfigured from django.utils.functional import SimpleLazyObject def get_user(request): if not hasattr(request, '_cached_user'): ...
agpl-3.0
-7,053,930,043,317,610,000
41.671642
92
0.671563
false
lihui7115/ChromiumGStreamerBackend
tools/telemetry/third_party/typ/typ/fakes/tests/test_result_server_fake_test.py
81
1298
# Copyright 2014 Google 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 by applicable law or ag...
bsd-3-clause
6,539,671,711,344,100,000
35.055556
74
0.646379
false
SPKian/Testing2
erpnext/config/learn.py
9
4470
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("General"), "items": [ { "type": "help", "label": _("Navigating"), "youtube_id": "YDoI2DF4Lmc" }, { "type": "help", "label": _("Setup Wizard"), "youtube_id": "oIOf_zCFWK...
agpl-3.0
5,598,275,060,044,430,000
17.781513
54
0.451678
false
yoazmenda/Hearthstone_deck_builder
tests/agents/trade/play_tests.py
9
4964
import unittest from hearthbreaker.cards import ArgentSquire, DireWolfAlpha, HarvestGolem, BloodfenRaptor, MagmaRager, Wisp, Ysera from hearthbreaker.cards.spells.neutral import TheCoin from tests.agents.trade.test_helpers import TestHelpers from hearthbreaker.agents.trade.possible_play import PossiblePlays from tests....
mit
3,940,870,178,594,227,700
35.5
118
0.636986
false
shiora/The-Perfect-Pokemon-Team-Balancer
libs/env/Lib/site-packages/pip/_vendor/pkg_resources.py
160
98660
""" Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipul...
gpl-2.0
8,350,441,626,344,375,000
35.285399
110
0.601176
false
firmlyjin/brython
www/tests/unittests/test/test_slice.py
93
4433
# tests for slice objects; in particular the indices method. import unittest from test import support from pickle import loads, dumps import sys class SliceTest(unittest.TestCase): def test_constructor(self): self.assertRaises(TypeError, slice) self.assertRaises(TypeError, slice, 1, 2, 3, 4) ...
bsd-3-clause
8,911,903,977,536,788,000
31.837037
73
0.544778
false
RickyZhong/SaltAdmin
view/monitor.py
7
1408
#!/usr/bin/env python #-*- coding:utf-8 -*- from main import * # 监控中心 # Redis class M_Redis: def GET(self): if getLogin(): sData = getLogin() SID = sData['SID'] ShowName = sData['ShowName'] #print sData #print "ShowName: " + ShowName ...
gpl-2.0
5,275,046,352,538,790,000
29.26087
70
0.521552
false
NoctuaNivalis/qutebrowser
qutebrowser/misc/editor.py
2
7874
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
-2,013,850,728,556,712,400
35.623256
79
0.605156
false
uppalk1/RackHD
test/tests/api/v1_1/discovery_tests.py
11
3302
from config.api1_1_config import * from config.amqp import * from modules.logger import Log from on_http_api1_1 import NodesApi as Nodes from on_http_api1_1.rest import ApiException from proboscis.asserts import assert_equal from proboscis.asserts import assert_not_equal from proboscis.asserts import assert_is_not_none...
apache-2.0
5,107,084,632,558,063,000
36.101124
90
0.584494
false
tempbottle/rethinkdb
external/v8_3.30.33.16/tools/testrunner/local/utils.py
40
3816
# Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditi...
agpl-3.0
2,254,796,295,720,101,000
30.53719
74
0.697327
false
vikomall/pyrax
samples/images/list_tasks.py
13
1270
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2014 Rackspace US, 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.ap...
apache-2.0
-5,131,889,018,133,898,000
32.421053
78
0.689764
false
rohit21122012/DCASE2013
runs/2013/xgboost10/src/features.py
33
9663
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy import librosa import scipy from scikits.talkbox import lpc from scikits.talkbox.tools import segment_axis from scipy.fftpack import fft,dct def feature_extraction_lp_group_delay(y, fs=44100, statistics=True, lpgd_params=None, win_params=None): eps = num...
mit
941,603,693,741,511,000
28.824074
113
0.546
false
aequitas/home-assistant
tests/components/history/test_init.py
12
20961
"""The tests the History component.""" # pylint: disable=protected-access,invalid-name from datetime import timedelta import unittest from unittest.mock import patch, sentinel from homeassistant.setup import setup_component, async_setup_component import homeassistant.core as ha import homeassistant.util.dt as dt_util ...
apache-2.0
-1,814,927,104,001,444,000
38.84981
79
0.587472
false
mantidproject/mantid
Framework/PythonInterface/test/python/mantid/kernel/CompositeValidatorTest.py
3
2871
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + impo...
gpl-3.0
5,166,492,582,031,719,000
36.285714
106
0.650644
false
everhopingandwaiting/tg
tg-test.py
199
1450
import tgl import pprint from functools import partial our_id = 0 pp = pprint.PrettyPrinter(indent=4) binlog_done = False; def on_binlog_replay_end(): binlog_done = True; def on_get_difference_end(): pass def on_our_id(id): our_id = id return "Set ID: " + str(our_id) def msg_cb(success, msg): ...
gpl-2.0
8,663,102,060,940,580,000
20.014493
98
0.676552
false
DanielNeugebauer/adhocracy
src/adhocracy/migration/versions/013_Remove_issues.py
4
2793
from datetime import datetime from sqlalchemy import * from migrate import * meta = MetaData() delegateable_table = Table('delegateable', meta, Column('id', Integer, primary_key=True), Column('label', Unicode(255), nullable=False), Column('type', String(50)), Column('create_time', DateTime, default=...
agpl-3.0
-6,173,455,753,641,332,000
41.318182
97
0.685643
false
Eseoghene/bite-project
deps/mrtaskman/server/mapreduce/lib/files/testutil.py
44
1888
#!/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...
apache-2.0
-2,878,187,332,483,750,400
28.5
74
0.709216
false
haojin2/peloton
script/formatting/formatter.py
1
6784
#!/usr/bin/env python # encoding: utf-8 ## ============================================== ## GOAL : Format code, Update headers ## ============================================== import argparse import logging import os import re import sys import datetime import subprocess ## ========================================...
apache-2.0
-8,610,997,829,027,205,000
37.988506
177
0.557636
false
KimNorgaard/ansible-modules-extras
cloud/amazon/ecs_cluster.py
60
7977
#!/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
-3,243,108,086,548,033,000
32.516807
160
0.638335
false
ProfessionalIT/maxigenios-website
sdk/google_appengine/lib/django-1.5/django/middleware/http.py
225
1670
from django.utils.http import http_date, parse_http_date_safe class ConditionalGetMiddleware(object): """ Handles conditional GET operations. If the response has a ETag or Last-Modified header, and the request has If-None-Match or If-Modified-Since, the response is replaced by an HttpNotModified. ...
mit
3,015,810,562,610,804,700
46.714286
84
0.62515
false
ehashman/oh-mainline
vendor/packages/twisted/twisted/protocols/amp.py
18
85502
# -*- test-case-name: twisted.test.test_amp -*- # Copyright (c) 2005 Divmod, Inc. # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ This module implements AMP, the Asynchronous Messaging Protocol. AMP is a protocol for sending multiple asynchronous request/response pairs over the same connec...
agpl-3.0
6,013,759,020,139,823,000
32.10182
84
0.630395
false
adamwwt/chvac
venv/lib/python2.7/site-packages/pygments/lexers/math.py
71
76438
# -*- coding: utf-8 -*- """ pygments.lexers.math ~~~~~~~~~~~~~~~~~~~~ Lexers for math languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.util import shebang_matches from pygments.lexer import Lexer, Re...
mit
-7,700,838,676,769,804,000
45.269976
86
0.463735
false
c0defreak/python-for-android
python3-alpha/python3-src/Lib/idlelib/HyperParser.py
89
10310
""" HyperParser =========== This module defines the HyperParser class, which provides advanced parsing abilities for the ParenMatch and other extensions. The HyperParser uses PyParser. PyParser is intended mostly to give information on the proper indentation of code. HyperParser gives some information on the structure ...
apache-2.0
2,054,362,599,779,848,400
41.780083
80
0.559748
false
yogeshVU/matplotlib_apps
timeline_bar.py
1
2447
#this line prepares IPython for working with matplotlib %matplotlib inline # # this actually imports matplotlib # import numpy as np # import matplotlib.pyplot as plt # x = np.linspace(0, 10, 30) #array of 30 points from 0 to 10 # y = np.sin(x) # z = y + np.random.normal(size=30) * .2 # plt.plot(x, y, 'b+:', lab...
mit
3,249,564,711,606,906,400
25.89011
80
0.628933
false
belmiromoreira/nova
nova/virt/vmwareapi/host.py
60
3232
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 VMware, 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/lic...
apache-2.0
1,525,631,986,731,032,600
36.149425
78
0.636139
false
wkschwartz/django
django/conf/locale/en_AU/formats.py
35
1889
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j M Y' # '25 Oct 2006' TIME_FORMAT = 'P' # '2:30 p.m.' DATE...
bsd-3-clause
1,471,695,996,724,988,000
51.472222
79
0.468502
false
waiducom/jaikuengine
common/component.py
34
2277
# Copyright 2009 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 or agreed to in writing, ...
apache-2.0
8,464,246,132,832,205,000
26.768293
79
0.676768
false
3nids/QGIS
python/plugins/processing/algs/grass7/ext/v_net_distance.py
30
3316
# -*- coding: utf-8 -*- """ *************************************************************************** v_net_distance.py --------------------- Date : December 2015 Copyright : (C) 2015 by Médéric Ribreux Email : medspx at medspx dot fr ********************...
gpl-2.0
-5,298,522,606,253,958,000
41.435897
117
0.6
false
geodynamics/gale
boost/libs/python/test/calling_conventions.py
44
1638
# Copyright Nicolas Lelong, 2010. Distributed under 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) """ >>> from calling_conventions_ext import * >>> f_0__cdecl() 17041 >>> f_1__cdecl(1) 1 >>> f_2__cdecl(1, 2) 21 >>> f_3__cdecl(1, 2,...
gpl-2.0
-5,346,983,323,797,423,000
19.222222
71
0.541514
false
4Kaylum/SkyBot
cogs/utils/objection_frame.py
1
3991
class ObjectionFrame(object): DEFENSE_CHARACTERS = { "Apollo Justice": 60, "Mia Fey": 15, "Miles Edgeworth (Defense)": 690, "Phoenix Wright": 1, } PROSECUTION_CHARACTERS = { "Franziska von Karma": 21, "Godot": 175, "Klavier Gavin": 65, "Manfr...
gpl-3.0
-3,416,992,533,582,573,600
26.715278
149
0.482335
false
google-research/language
language/conpono/cpc/preproc/ccnews_preproc_pipeline.py
1
6627
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
apache-2.0
-2,896,787,652,479,410,700
32.639594
80
0.668779
false
nirs/vdsm
lib/vdsm/momIF.py
2
5451
# # Copyright (C) 2012, IBM Corporation # # 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. # # This program is distribute...
gpl-2.0
1,281,836,495,252,377,900
31.254438
78
0.589617
false
kennethlove/django
django/core/files/uploadedfile.py
8
4156
""" Classes representing uploaded files. """ import os from io import BytesIO from django.conf import settings from django.core.files.base import File from django.core.files import temp as tempfile from django.utils.encoding import smart_str __all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryUploadedFile',...
bsd-3-clause
4,337,413,812,739,497,500
32.248
92
0.602743
false
adiseshu219/visualisation
django-admin-sortable/adminsortable/templatetags/adminsortable_tags.py
5
1394
from django import template register = template.Library() @register.simple_tag(takes_context=True) def render_sortable_objects(context, objects, sortable_objects_template='adminsortable/shared/objects.html'): context.update({'objects': objects}) tmpl = template.loader.get_template(sortable_o...
agpl-3.0
1,445,963,338,138,425,000
37.828571
85
0.733859
false
JCBarahona/edX
cms/djangoapps/contentstore/tests/test_users_default_role.py
115
5183
""" Unit tests for checking default forum role "Student" of a user when he creates a course or after deleting it creates same course again """ from contentstore.tests.utils import AjaxEnabledTestClient from contentstore.utils import delete_course_and_groups, reverse_url from courseware.tests.factories import UserFactor...
agpl-3.0
1,113,210,910,319,352,300
44.069565
111
0.671812
false
Onager/plaso
plaso/parsers/sqlite_plugins/skype.py
1
37870
# -*- coding: utf-8 -*- """SQLite parser plugin for Skype database files.""" from dfdatetime import posix_time as dfdatetime_posix_time from plaso.containers import events from plaso.containers import time_events from plaso.parsers import sqlite from plaso.parsers.sqlite_plugins import interface class SkypeChatEven...
apache-2.0
-2,332,548,678,466,177,500
47.303571
79
0.667573
false
mitsuhiko/sqlalchemy
examples/adjacency_list/adjacency_list.py
32
3538
from sqlalchemy import Column, ForeignKey, Integer, String, create_engine from sqlalchemy.orm import Session, relationship, backref,\ joinedload_all from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm.collections import attribute_mapped_collection Base = declara...
mit
397,386,556,952,218,700
30.873874
80
0.544941
false
Moriadry/tensorflow
tensorflow/contrib/boosted_trees/estimator_batch/custom_loss_head.py
87
3030
# Copyright 2017 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,643,304,451,509,174,300
40.506849
83
0.675578
false
noodle-learns-programming/python-social-auth
social/backends/instagram.py
61
1611
""" Instagram OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/instagram.html """ from social.backends.oauth import BaseOAuth2 class InstagramOAuth2(BaseOAuth2): name = 'instagram' AUTHORIZATION_URL = 'https://instagram.com/oauth/authorize' ACCESS_TOKEN_URL = 'https://instagram.com/...
bsd-3-clause
2,998,450,565,766,202,000
40.307692
79
0.612042
false
owlabs/incubator-airflow
airflow/dag/base_dag.py
4
2812
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
2,733,690,980,644,605,400
26.841584
82
0.639403
false
mbox/django
django/contrib/gis/forms/fields.py
74
4444
from __future__ import unicode_literals from django import forms from django.utils.translation import ugettext_lazy as _ # While this couples the geographic forms to the GEOS library, # it decouples from database (by not importing SpatialBackend). from django.contrib.gis.geos import GEOSException, GEOSGeometry from ....
bsd-3-clause
2,887,019,537,537,169,400
33.184615
107
0.628038
false
CasparLi/calibre
src/calibre/utils/chm/__init__.py
24
1221
## Copyright (C) 2003-2006 Rubens Ramos <rubensr@users.sourceforge.net> ## pychm 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-3.0
-8,149,772,005,081,259,000
41.103448
73
0.719083
false
KaranToor/MA450
google-cloud-sdk/.install/.backup/lib/googlecloudsdk/calliope/display_info.py
3
3141
# Copyright 2016 Google 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 by applicable law or ag...
apache-2.0
4,463,528,974,978,981,400
28.632075
77
0.701369
false
ThirdProject/android_external_chromium_org
chrome/common/extensions/docs/server2/branch_utility_test.py
24
7646
#!/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. import os import sys import unittest from branch_utility import BranchUtility, ChannelInfo from fake_url_fetcher import FakeUrlFet...
bsd-3-clause
-3,131,024,255,091,981,000
42.19774
78
0.658514
false
elkingtonmcb/sympy
sympy/parsing/ast_parser.py
122
2811
""" This module implements the functionality to take any Python expression as a string and fix all numbers and other things before evaluating it, thus 1/2 returns Integer(1)/Integer(2) We use the Python ast module for that, which is in python2.6 and later. It is well documented at docs.python.org. Some tips to und...
bsd-3-clause
2,664,286,478,434,307,000
32.86747
77
0.63465
false
nbschool/ecommerce_api
models.py
2
24442
""" Application ORM Models built with Peewee """ import datetime import os from exceptions import (InsufficientAvailabilityException, WrongQuantity, SearchAttributeMismatch) from uuid import uuid4 from flask_login import UserMixin from passlib.hash import pbkdf2_sha256 from peewee import (Boole...
gpl-3.0
-8,222,649,810,627,081,000
32.574176
100
0.578267
false
cntnboys/cmput410-project
venv/lib/python2.7/site-packages/pip/_vendor/packaging/__about__.py
257
1073
# Copyright 2014 Donald Stufft # # 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, so...
apache-2.0
-3,064,279,896,319,619,000
33.612903
74
0.680336
false
alex-docker/zerorpc-python
tests/test_channel.py
76
3964
# -*- coding: utf-8 -*- # Open Source Initiative OSI - The MIT License (MIT):Licensing # # The MIT License (MIT) # Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Softwa...
mit
675,822,349,931,340,000
32.880342
81
0.696519
false
jerryhebert/django-rest-framework
rest_framework/authtoken/serializers.py
80
1032
from django.contrib.auth import authenticate from django.utils.translation import ugettext_lazy as _ from rest_framework import exceptions, serializers class AuthTokenSerializer(serializers.Serializer): username = serializers.CharField() password = serializers.CharField(style={'input_type': 'password'}) ...
bsd-2-clause
4,420,054,060,117,486,600
33.4
70
0.619186
false
Vutshi/qutip
examples/ex_floquet_modes.py
1
4002
# # Example: Find the floquet modes and quasi energies for a driven system and # plot the floquet states/quasienergies for one period of the driving. # from qutip import * from pylab import * import time def hamiltonian_t(t, args): """ evaluate the hamiltonian at time t. """ H0 = args[0] H1 = args[1] w...
gpl-3.0
5,483,225,955,861,051,000
27.183099
107
0.575212
false
sam-roth/Keypad
keypad/plugins/shell/fish_model.py
1
2290
import subprocess from keypad.api import AttributedString, Cursor from .bourne_model import BourneCodeModel, ShellCompletionResults import logging class GetCompletionsTask: def __init__(self, prefix): self.prefix = prefix def __call__(self, ns): # print(self.prefix) # take advantag...
gpl-3.0
-4,402,944,597,227,308,000
26.939024
102
0.501747
false
teltek/edx-platform
common/djangoapps/xblock_django/admin.py
24
2419
""" Django admin dashboard configuration. """ from config_models.admin import ConfigurationModelAdmin, KeyedConfigurationModelAdmin from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from xblock_django.models import XBlockConfiguration, XBlockStudioConfiguration, XBlockStudioConf...
agpl-3.0
7,044,585,941,651,339,000
38.655738
117
0.63828
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_express_route_service_providers_operations.py
1
5138
# 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 may ...
mit
6,532,201,200,480,831,000
46.574074
135
0.653367
false
bbci/wyrm
examples/performance.py
1
5907
#!/usr/bin/env python from __future__ import division import time import logging import cPickle as pickle import sys import argparse sys.path.append('../') import numpy as np from matplotlib import pyplot as plt from wyrm import processing as proc from wyrm.types import BlockBuffer, RingBuffer, Data logger = log...
mit
-4,807,947,238,860,077,000
26.732394
109
0.576096
false
mergecoin-project/Mergecoin-master
contrib/devtools/update-translations.py
2
8105
#!/usr/bin/env python # Copyright (c) 2014 Wladimir J. van der Laan # Copyright (c) 2017 Mitchell Cash # Distributed under the MIT 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 f...
mit
-7,809,133,914,902,732,000
37.966346
124
0.622209
false
liorvh/infernal-twin
build/pillow/selftest.py
11
6176
# minimal sanity check from __future__ import print_function import sys import os if "--installed" in sys.argv: sys_path_0 = sys.path[0] del sys.path[0] from PIL import Image, ImageDraw, ImageFilter, ImageMath from PIL import features if "--installed" in sys.argv: sys.path.insert(0, sys_path_0) ROOT = ...
gpl-3.0
6,434,199,418,645,953,000
27.330275
79
0.533841
false
xgfone/snippet
snippet/example/python/pool.py
1
6109
from __future__ import absolute_import, unicode_literals, print_function, division import time from queue import Queue, Empty from threading import Lock class _ResourcePoolSession(object): def __init__(self, pool, obj, close_on_exc=False): self.__pool = pool self.__obj = obj self.__close...
mit
4,201,147,693,320,598,000
26.394619
83
0.530365
false
zhiyzhan/micolog
app/gmemsess.py
14
3217
# gmemsess.py - memcache-backed session Class for Google Appengine # Version 1.4 # Copyright 2008 Greg Fawcett <greg@vig.co.nz> # # 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...
mit
-3,583,858,618,670,186,500
35.556818
80
0.633199
false
matrumz/RPi_Custom_Files
Printing/hplip-3.15.2/fab.py
1
24917
#!/usr/bin/env python # -*- coding: utf-8 -*- # # (c) Copyright 2003-2009 Hewlett-Packard Development Company, L.P. # # 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 Lice...
gpl-2.0
-3,544,811,321,671,645,700
27.123025
121
0.493438
false
guc-cs/Campus-Vision
opencv-1.1.0/samples/python/morphology.py
6
1894
#!/usr/bin/python import sys from opencv.cv import * from opencv.highgui import * src = 0; image = 0; dest = 0; element = 0; element_shape = CV_SHAPE_RECT; global_pos = 0; def Opening(pos): element = cvCreateStructuringElementEx( pos*2+1, pos*2+1, pos, pos, element_shape, None ); cvErode(src,image,element,1); ...
mit
4,811,496,042,274,781,000
36.88
94
0.694298
false
ContinuumIO/numpy
numpy/lib/_datasource.py
46
21267
"""A file interface for handling local and remote data files. The goal of datasource is to abstract some of the file system operations when dealing with data files so the researcher doesn't have to know all the low-level details. Through datasource, a researcher can obtain and use a file with one function call, regar...
bsd-3-clause
4,802,015,507,962,624,000
30.932432
79
0.581135
false
simone/django-gb
django/conf/locale/lt/formats.py
82
1834
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'Y \m. E j \d.' TIME_FORMAT = 'H:...
bsd-3-clause
8,006,521,112,955,683,000
37.208333
81
0.505453
false
jptomo/rpython-lang-scheme
rpython/translator/exceptiontransform.py
2
22163
from rpython.translator.simplify import join_blocks, cleanup_graph from rpython.translator.unsimplify import varoftype from rpython.translator.unsimplify import insert_empty_block, split_block from rpython.translator.backendopt import canraise, inline from rpython.flowspace.model import Block, Constant, Variable, Link,...
mit
-3,329,323,977,064,311,000
41.376673
99
0.599242
false
dkubiak789/odoo
addons/hr_recruitment/wizard/__init__.py
381
1095
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-Today OpenERP (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
-960,492,239,037,765,900
42.8
78
0.621918
false
Cybernetic1/bookcam
crop-fixed.py
1
5190
#!/usr/bin/python # -*- coding: UTF-8 -*- ## Automatically crop book margins ## ================================================================ ## Use SimpleCV from SimpleCV import * from math import sqrt import sys import numpy as np from subprocess import call import cv import cv2 standard_height = 1600.0 #1430....
apache-2.0
1,072,018,867,070,504,300
25.891192
98
0.579576
false
MakeHer/edx-platform
lms/djangoapps/mobile_api/test_milestones.py
80
5550
""" Milestone related tests for the mobile_api """ from mock import patch from courseware.access_response import MilestoneError from courseware.tests.helpers import get_request_for_user from courseware.tests.test_entrance_exam import answer_entrance_exam_problem, add_entrance_exam_milestone from util.milestones_helper...
agpl-3.0
-1,274,170,322,345,450,000
40.41791
111
0.673694
false
kaideyi/KDYSample
kYPython/Scrapy/zhihu/zhihu/items.py
1
1897
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # https://doc.scrapy.org/en/latest/topics/items.html import scrapy from scrapy import Item, Field class ZhihuItem(scrapy.Item): # define the fields for your item here like: id = Field() name = Field() ac...
mit
2,951,811,868,062,052,000
26.1
52
0.619926
false
sg00dwin/origin
vendor/github.com/google/certificate-transparency/python/ct/cert_analysis/observation.py
24
1620
import logging class Observation(object): """Describes certificate observation.""" def __init__(self, description, reason=None, details=None): self.description = description self.reason = reason self.details = details def __repr__(self): return "%s(%s, %s, %s)" % (self.__cl...
apache-2.0
-6,754,409,700,666,020,000
33.468085
80
0.534568
false
jml/flocker
flocker/acceptance/test_moving_applications.py
3
2010
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Tests for moving applications between nodes. """ from twisted.trial.unittest import TestCase from .testtools import (require_cluster, MONGO_APPLICATION, MONGO_IMAGE, get_mongo_application, require_flocker_...
apache-2.0
-5,244,662,356,083,625,000
30.40625
77
0.576617
false
dyninst/toolchain-origin
script/FeatGen.py
1
3014
import sys import argparse import os from subprocess import * compilerList = ["GCC", "ICC", "LLVM", "PGI"] def getParameters(): parser = argparse.ArgumentParser(description='Extract function level code features for toolchain identification') parser.add_argument("--filelist", help="A list of binaries to extrac...
lgpl-2.1
-7,891,701,671,745,130,000
35.313253
117
0.675514
false
eblot/miscripts
Python/embeddev/btparse.py
1
5918
#!/usr/bin/env python2.7 # Parse and decode an ARM-EABI MAP file from optparse import OptionParser from subprocess import Popen, PIPE, STDOUT import binascii import re import struct import sys demangle_cache = {} def parse_map_file(mapf): symbols = {} text_section = False symcre = re.compile(r'^\s+(0x[...
mit
-7,736,179,818,517,225,000
33.011494
77
0.500676
false
klmitch/python-keystoneclient
keystoneclient/tests/unit/auth/test_token.py
8
1876
# 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
4,172,357,339,928,892,400
35.076923
75
0.629531
false
afifnz/django-material
tests/integration/tests/test_fileinput.py
10
4507
import json from django import forms from django_webtest import WebTest from . import build_test_urls class FileInputForm(forms.Form): test_field = forms.FileField() data_field = forms.BooleanField(required=False, widget=forms.HiddenInput, help_text='To produce non empty P...
bsd-3-clause
-386,502,964,207,881,340
35.642276
122
0.607499
false
MarcosCommunity/odoo
openerp/addons/base/tests/test_ir_actions.py
291
20121
import unittest2 from openerp.osv.orm import except_orm import openerp.tests.common as common from openerp.tools import mute_logger class TestServerActionsBase(common.TransactionCase): def setUp(self): super(TestServerActionsBase, self).setUp() cr, uid = self.cr, self.uid # Models ...
agpl-3.0
2,734,627,377,854,829,000
48.316176
163
0.578599
false
glewis17/cvxpy
cvxpy/tests/test_quad_form.py
11
3160
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_allclose, assert_equal from scipy import linalg import cvxopt import cvxpy from cvxpy.tests.base_test import BaseTest class TestNonOptimal(BaseTest): def test_singular_quad_form(self): """...
gpl-3.0
1,821,027,409,571,000,800
36.619048
77
0.518671
false
fitermay/intellij-community
python/helpers/py2only/docutils/parsers/rst/directives/misc.py
106
22888
# $Id: misc.py 7487 2012-07-22 21:20:28Z milde $ # Authors: David Goodger <goodger@python.org>; Dethe Elza # Copyright: This module has been placed in the public domain. """Miscellaneous directives.""" __docformat__ = 'reStructuredText' import sys import os.path import re import time from docutils import io, nodes, ...
apache-2.0
47,689,937,248,896,470
41.861423
82
0.553128
false
cowlicks/odo
odo/utils.py
3
9847
from __future__ import absolute_import, division, print_function import inspect import datetime import tempfile import os import shutil import numpy as np from contextlib import contextmanager from multiprocessing.pool import ThreadPool from multipledispatch import Dispatcher from datashape import dshape, Record f...
bsd-3-clause
-2,275,764,229,381,918,200
24.05598
80
0.568295
false
gnrfan/chichafortunes
fortunes/views.py
1
2195
#-*- coding: utf-8 -*- # Create your views here. from django.http import HttpResponse, HttpResponseRedirect from django.views.generic.simple import direct_to_template from django.core.urlresolvers import reverse from django.db import connection, transaction from django.shortcuts import get_object_or_404 from helpers....
bsd-3-clause
-4,631,595,428,743,279,000
32.769231
92
0.622779
false
endlessm/chromium-browser
content/test/gpu/gpu_tests/pixel_integration_test.py
1
11760
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os import sys import time from gpu_tests import gpu_integration_test from gpu_tests import pixel_test_pages from gpu_tests import skia...
bsd-3-clause
7,329,041,483,706,697,000
39.136519
79
0.696344
false
cjqian/incubator-airflow
tests/contrib/operators/test_emr_terminate_job_flow_operator.py
56
1676
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
-8,955,721,768,540,988,000
31.230769
97
0.690931
false
firepick1/jansson
doc/ext/refcounting.py
17
1715
""" refcounting ~~~~~~~~~~~ Reference count annotations for C API functions. Has the same result as the sphinx.ext.refcounting extension but works for all functions regardless of the signature, and the reference counting information is written inline with the documentation instead of a sepa...
mit
-6,974,925,644,238,028,000
28.067797
73
0.65481
false
OPM/ResInsight
ThirdParty/Ert/python/ecl/well/well_segment.py
2
2422
from cwrap import BaseCClass from ecl import EclPrototype class WellSegment(BaseCClass): TYPE_NAME = "well_segment" _active = EclPrototype("bool well_segment_active(well_segment)") _main_stem = EclPrototype("bool well_segment_main_stem(well_segment)") _nearest_wellhead = EclPrototype(...
gpl-3.0
-7,212,708,780,737,720,000
30.868421
105
0.581338
false
coder-han/hugula
Client/tools/site-packages/pyExcelerator/Row.py
15
8282
#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Roman V. Kiseliov # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must re...
mit
3,119,860,886,874,149,400
34.857143
165
0.548298
false
tjcsl/ion
intranet/apps/eighth/management/commands/update_counselors.py
1
2090
#!/usr/bin/env python3 import csv import sys from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand class Command(BaseCommand): help = "Update counselor information" def add_arguments(self, parser): parser.add_argument("filename", type=str, help="Path to ...
gpl-2.0
-5,161,390,259,945,978,000
38.433962
119
0.607177
false
shanot/imp
modules/multifit/test/test_surface_sample_protein.py
2
1150
import IMP import IMP.test import sys import IMP.em import IMP.multifit import os class Tests(IMP.test.TestCase): """Tests for sampled density maps""" def setUp(self): """initialize IMP environment create particles""" IMP.test.TestCase.setUp(self) # init IMP model ( the environment) ...
gpl-3.0
-6,188,507,334,428,642,000
30.944444
75
0.598261
false