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
andreparrish/python-for-android
python-modules/twisted/twisted/python/win32.py
56
5492
# -*- test-case-name: twisted.python.test.test_win32 -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Win32 utilities. See also twisted.python.shortcut. @var O_BINARY: the 'binary' mode flag on Windows, or 0 on other platforms, so it may safely be OR'ed into a mask for os...
apache-2.0
-121,966,900,089,244,530
31.690476
100
0.663511
false
jazkarta/edx-platform
openedx/core/djangoapps/credit/migrations/0007_auto__add_field_creditprovider_enable_integration__chg_field_creditpro.py
84
11967
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'CreditProvider', fields ['provider_url'] ...
agpl-3.0
-5,275,183,595,681,171,000
77.215686
206
0.575583
false
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python2.7/test/test_getargs2.py
35
12391
import unittest from test import test_support # Skip this test if the _testcapi module isn't available. test_support.import_module('_testcapi') from _testcapi import getargs_keywords import warnings """ > How about the following counterproposal. This also changes some of > the other format codes to be a little more re...
gpl-2.0
-2,718,851,958,843,407,000
35.444118
99
0.624486
false
ORNL-CEES/Cap
python/example/helpers.py
3
2254
from pycap import Observer, ECLabAsciiFile from IPython import display from numpy import real, imag, absolute, angle from matplotlib import pyplot from sys import stdout, exit from os import remove class PrintColumns(Observer): def __new__(cls, *args, **kwargs): return object.__new__(PrintColumns) d...
bsd-3-clause
-2,055,714,181,210,565,000
30.746479
74
0.499556
false
dkodnik/Ant
addons/auth_oauth_signup/res_users.py
39
2471
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
3,613,528,635,671,150,600
40.183333
117
0.58276
false
Lyrositor/CoilSnake
coilsnake/model/eb/map_music.py
5
1493
from coilsnake.model.common.table import TableEntry, LittleEndianIntegerTableEntry, RowTableEntry from coilsnake.model.eb.table import EbEventFlagTableEntry MapMusicSubTableEntry = RowTableEntry.from_schema( name="Map Music Sub Table Entry", schema=[EbEventFlagTableEntry, type("Music", (LittleEndi...
gpl-3.0
-1,171,493,632,317,762,000
31.478261
97
0.673141
false
wxkdesky/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert_unittest.py
122
5545
# Copyright (C) 2011 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...
bsd-3-clause
-66,336,683,328,485,384
45.208333
284
0.717042
false
vovojh/gem5
src/arch/x86/isa/insts/general_purpose/compare_and_test/bit_test.py
89
10961
# Copyright (c) 2007-2008 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 imp...
bsd-3-clause
-3,468,643,259,217,742,300
24.973934
72
0.617371
false
mjg2203/edx-platform-seas
common/djangoapps/django_comment_common/migrations/0001_initial.py
188
6980
# -*- coding: utf-8 -*- from south.v2 import SchemaMigration class Migration(SchemaMigration): # # cdodge: This is basically an empty migration since everything has - up to now - managed in the django_comment_client app # But going forward we should be using this migration # def forwards(self, orm): pass ...
agpl-3.0
-1,834,592,948,679,717,600
74.869565
182
0.559169
false
dgarros/ansible
test/units/modules/network/nxos/test_nxos_bgp_neighbor.py
23
1955
# (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 # (at your option) any later version. # # Ansible is dis...
gpl-3.0
2,099,865,522,995,505,400
37.333333
112
0.720205
false
rafaelang/django-rest-framework
rest_framework/utils/formatting.py
72
2012
""" Utility functions to return a formatted name and description for a given view. """ from __future__ import unicode_literals import re from django.utils.encoding import force_text from django.utils.html import escape from django.utils.safestring import mark_safe from rest_framework.compat import apply_markdown d...
bsd-2-clause
-2,424,002,164,958,572,000
29.953846
83
0.663022
false
jymannob/Sick-Beard
lib/socks/__init__.py
138
16505
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. 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 retain the above copyright notice, this ...
gpl-3.0
-6,014,055,344,877,889,000
40.997455
136
0.608119
false
jbq/uwsgi
t/pypy/t_continulet1.py
11
1191
""" simplified test for continulet without checking for partial writes to enable continulets you only need to call uwsgi_pypy_setup_continulets() soon after startup: uwsgi --pypy-wsgi-file t/pypy/t_continulet1.py --http-socket :9090 --pypy-home /opt/pypy --pypy-eval "uwsgi_pypy_setup_continulets()" --async 8 """ imp...
gpl-2.0
-3,104,819,487,717,847,000
28.775
143
0.626364
false
xrmx/django
django/contrib/sessions/backends/cache.py
25
2491
from django.conf import settings from django.contrib.sessions.backends.base import CreateError, SessionBase from django.core.cache import caches from django.utils.six.moves import range KEY_PREFIX = "django.contrib.sessions.cache" class SessionStore(SessionBase): """ A cache-based session store. """ ...
bsd-3-clause
-1,960,187,883,226,638,600
32.662162
79
0.592533
false
MMOwning/MMOCore
dep/libmpq/bindings/python/mpq.py
107
10430
"""wrapper for libmpq""" # 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 distributed in the hope th...
gpl-2.0
-1,329,452,218,278,043,600
31.391304
79
0.56232
false
edxzw/edx-platform
openedx/core/djangoapps/user_api/models.py
55
4107
""" Django ORM model specifications for the User API application """ from django.contrib.auth.models import User from django.core.validators import RegexValidator from django.db import models from django.db.models.signals import post_delete, pre_save, post_save from django.dispatch import receiver from model_utils.mode...
agpl-3.0
-6,575,693,342,164,058,000
34.713043
105
0.693937
false
dhomeier/astropy
astropy/time/core.py
3
109168
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ The astropy.time package provides functionality for manipulating times and dates. Specific emphasis is placed on supporting time scales (e.g. UTC, TAI, UT1) and time representations (e.g. JD, MJD, ISO 8601) that are used in astr...
bsd-3-clause
8,982,258,529,772,467,000
39.613095
99
0.567996
false
DataDog/integrations-core
gitlab_runner/tests/common.py
1
1976
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import os from datadog_checks.base.utils.common import get_docker_hostname HERE = os.path.dirname(os.path.abspath(__file__)) # Networking HOST = get_docker_hostname() GITLAB_TEST_TOKEN = "ddtesttoken"...
bsd-3-clause
7,270,947,547,602,448,000
27.637681
103
0.620951
false
x111ong/django
tests/generic_views/models.py
382
1631
from django.core.urlresolvers import reverse from django.db import models from django.db.models import QuerySet from django.db.models.manager import BaseManager from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Artist(models.Model): name = models.CharField(max_length...
bsd-3-clause
-7,957,408,296,685,748,000
23.343284
73
0.6916
false
claudio-bonati/sun-topo-c
tools/analisi_top.py
1
2132
#!/usr/bin/env python3 import os, glob, sys import numpy as np from scipy.optimize import fmin out_form="The output is #latox, latoy, latoz, latot, beta and then\n" out_form+="i, <Q^2>/vol, b_2, b_4, k_1/vol, k_2/vol, k_3/vol, k_4/vol, <Q Q_{noncool}>/<Q^2> \n" out_form+="where Q=top. charge after i*cooling and k_n a...
gpl-3.0
6,910,895,158,170,259,000
25
114
0.643527
false
JioEducation/edx-platform
common/test/acceptance/tests/lms/test_library.py
20
13509
# -*- coding: utf-8 -*- """ End-to-end tests for LibraryContent block in LMS """ import ddt import textwrap from nose.plugins.attrib import attr from ..helpers import UniqueCourseTest, TestWithSearchIndexMixin from ...pages.studio.auto_auth import AutoAuthPage from ...pages.studio.overview import CourseOutlinePage fro...
agpl-3.0
4,069,543,507,361,344,500
41.215625
116
0.64209
false
c2g14/cda_0628
static/Brython3.1.1-20150328-091302/Lib/ui/dialog.py
607
4994
from . import widget from browser import html, document class Dialog(widget.DraggableWidget): def __init__(self, id=None): self._div_shell=html.DIV( Class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-draggable ui-resizable", style={'position': 'absolute', 'height': 'auto',...
agpl-3.0
2,988,261,768,199,673,000
34.671429
116
0.578694
false
hacksterio/pygments.rb
vendor/pygments-main/pygments/lexers/trafficscript.py
23
1546
# -*- coding: utf-8 -*- """ pygments.lexers.trafficscript ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexer for RiverBed's TrafficScript (RTS) language. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexe...
mit
7,999,638,424,461,369,000
27.62963
83
0.431436
false
vrooje/pulsar-hunters-analysis
aggregate_pulsarclass.py
1
33505
#Python 2.7.9 (default, Apr 5 2015, 22:21:35) import sys, os # file with raw classifications (csv) # put this way up here so if there are no inputs we exit quickly before even trying to load everything else try: classfile_in = sys.argv[1] except: #classfile_in = 'data/2e3d12a2-56ca-4d1f-930a-9ecc7fd39885.csv'...
mit
-6,155,461,191,444,731,000
47.139368
225
0.649008
false
DirtyUnicorns/android_external_chromium_org
third_party/jstemplate/compile.py
184
1402
#!/usr/bin/env python # Copyright (c) 2011 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. """Combines the javascript files needed by jstemplate into a single file.""" import httplib import urllib def main(): srcs = [...
bsd-3-clause
3,702,262,107,703,629,000
30.863636
77
0.68117
false
WhireCrow/openwrt-mt7620
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/tarfile.py
26
88986
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- #------------------------------------------------------------------- # tarfile.py #------------------------------------------------------------------- # Copyright (C) 2002 Lars Gustäbel <lars@gustaebel.de> # All rights reserved. # # Permission is hereby granted, fre...
gpl-2.0
-6,145,806,086,749,065,000
33.357529
103
0.535893
false
dhermes/gcloud-python
bigtable/tests/unit/test_app_profile.py
4
26669
# Copyright 2018 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 agreed to in writing,...
apache-2.0
8,463,865,001,744,410,000
38.686012
88
0.655405
false
kenshay/ImageScripter
ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/telemetry/value/trace.py
5
5019
# 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. import datetime import logging import os import random import shutil import sys import tempfile from py_utils import cloud_storage # pylint: disable=import...
gpl-3.0
-9,124,240,241,216,004,000
30.173913
78
0.670652
false
LeShadow/MTGProject
data_process/set.py
1
1308
class Set: def __init__(self): self.name = "" self.code = "" self.code_magiccards = "" self.is_promo = False self.date = "" def setName(self, name): self.name = name def getName(self, name): return self.name def setCode(self, code): sel...
gpl-3.0
7,232,723,267,882,710,000
23.660377
83
0.509564
false
mozilla-b2g/external_skia
gm/rebaseline_server/imagediffdb.py
65
16019
#!/usr/bin/python """ Copyright 2013 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Calulate differences between image pairs, and store them in a database. """ import contextlib import csv import logging import os import re import shutil import sys impo...
bsd-3-clause
732,922,496,002,968,800
37.693237
80
0.682752
false
blueboxgroup/nova
nova/objects/migration.py
7
4655
# Copyright 2013 IBM Corp. # # 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 agree...
apache-2.0
727,068,138,006,875,900
38.786325
78
0.643609
false
TangHao1987/intellij-community
python/lib/Lib/email/quopriMIME.py
93
10839
# Copyright (C) 2001-2006 Python Software Foundation # Author: Ben Gertzfield # Contact: email-sig@python.org """Quoted-printable content transfer encoding per RFCs 2045-2047. This module handles the content transfer encoding method defined in RFC 2045 to encode US ASCII-like 8-bit data called `quoted-printable'. It...
apache-2.0
-8,606,305,746,822,068,000
30.785924
79
0.612695
false
hkchenhongyi/django
django/core/management/utils.py
405
2590
from __future__ import unicode_literals import os import sys from subprocess import PIPE, Popen from django.utils import six from django.utils.encoding import DEFAULT_LOCALE_ENCODING, force_text from .base import CommandError def popen_wrapper(args, os_err_exc_type=CommandError, universal_newlines=True): """ ...
bsd-3-clause
-563,720,369,513,792,060
31.78481
84
0.601158
false
Genomon-Project/paplot
scripts/paplot/convert.py
1
5764
# -*- coding: utf-8 -*- """ Created on Thu May 12 12:34:57 2016 @author: okada $Id: convert.py 208 2017-08-16 06:16:25Z aokada $ """ import paplot.subcode.tools as tools def prohibition(text): import re new_text = re.sub(r'[\'"/;:\[\] ]', "_", text) if re.match(r'^[0-9]', new_text): new_text = "_...
mit
6,178,503,601,004,975,000
28.558974
138
0.506419
false
iulian787/spack
var/spack/repos/builtin/packages/candle-benchmarks/package.py
2
1543
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class CandleBenchmarks(Package): """ECP-CANDLE Benchmarks""" homepage = "https://github.com...
lgpl-2.1
-1,825,181,354,599,968,500
38.564103
103
0.65068
false
wfxiang08/ansible
test/integration/setup_gce.py
131
1388
''' Create GCE resources for use in integration tests. Takes a prefix as a command-line argument and creates two persistent disks named ${prefix}-base and ${prefix}-extra and a snapshot of the base disk named ${prefix}-snapshot. prefix will be forced to lowercase, to ensure the names are legal GCE resource names. ''' ...
gpl-3.0
9,190,609,888,011,545,000
32.047619
80
0.669308
false
nestle1998/srs
trunk/3rdparty/gprof/gprof2dot.py
46
72884
#!/usr/bin/env python # # Copyright 2008-2009 Jose Fonseca # # This program 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 License, or # (at your option) any later version. # # ...
mit
3,963,263,790,249,693,700
31.727436
154
0.533821
false
uw-it-aca/spotseeker_server
spotseeker_server/test/search/uw_noise_level.py
1
4334
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from django.test import TestCase from django.test.client import Client from django.test.utils import override_settings import simplejson as json from spotseeker_server.models import Spot, SpotExtendedInfo from spotseeker_server.org_...
apache-2.0
2,249,616,714,496,011,800
42.34
79
0.651592
false
wanghaven/readthedocs.org
readthedocs/restapi/views/core_views.py
25
3594
from rest_framework import decorators, permissions, status from rest_framework.renderers import JSONPRenderer, JSONRenderer, BrowsableAPIRenderer from rest_framework.response import Response import json import requests from django.conf import settings from django.core.cache import cache from django.shortcuts import g...
mit
-1,025,355,632,832,327,600
31.378378
97
0.683639
false
SivilTaram/edx-platform
cms/djangoapps/contentstore/push_notification.py
154
2772
""" Helper methods for push notifications from Studio. """ from uuid import uuid4 from django.conf import settings from logging import exception as log_exception from contentstore.tasks import push_course_update_task from contentstore.models import PushNotificationConfig from xmodule.modulestore.django import modules...
agpl-3.0
1,973,210,620,343,563,500
32.804878
109
0.599567
false
rmsr/misc
coursera/algorithmic-toolbox/week5/primitive_calculator.py
1
2044
#!/bin/python3 """ Primitive calculator Given ops *3, *2, +1, what is the fewest ops to reach n from 1? """ import os import sys def main(): sequence = optimal_sequence_linear(int(input())) print(len(sequence) - 1) print(*sequence) def optimal_sequence_linear(n): """ Solve by calculating min-st...
isc
2,066,986,643,733,704,700
22.767442
78
0.481409
false
zhimin711/nova
nova/cells/manager.py
9
26574
# Copyright (c) 2012 Rackspace Hosting # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
apache-2.0
-4,933,174,173,451,697,000
44.348123
79
0.592233
false
zahodi/ansible
lib/ansible/modules/web_infrastructure/htpasswd.py
47
9177
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Nimbis Services, 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,800,002,749,589,770,000
31.427562
110
0.62297
false
argentumproject/electrum-arg
lib/plugins.py
1
18775
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # 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...
mit
4,130,488,833,845,085,000
34.424528
118
0.586525
false
ajhager/copycat
lib/pyglet/extlibs/future/py2_3/future/builtins/newnext.py
70
2014
''' This module provides a newnext() function in Python 2 that mimics the behaviour of ``next()`` in Python 3, falling back to Python 2's behaviour for compatibility if this fails. ``newnext(iterator)`` calls the iterator's ``__next__()`` method if it exists. If this doesn't exist, it falls back to calling a ``next()`...
gpl-2.0
7,034,006,716,525,028,000
27.366197
86
0.576961
false
miguelparaiso/OdooAccessible
addons/base_iban/__init__.py
447
1073
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
1,813,156,434,355,767,800
41.92
79
0.608574
false
jk1/intellij-community
python/helpers/pydev/_pydevd_bundle/pydevd_xml.py
2
12915
from _pydev_bundle import pydev_log import traceback from _pydevd_bundle import pydevd_extension_utils from _pydevd_bundle import pydevd_resolver import sys from _pydevd_bundle.pydevd_constants import dict_iter_items, dict_keys, IS_PY3K, \ BUILTINS_MODULE_NAME, MAXIMUM_VARIABLE_REPRESENTATION_SIZE, RETURN_VALUES_DI...
apache-2.0
374,344,632,871,337,500
33.905405
137
0.569415
false
dubourg/openturns
python/test/t_MonteCarlo_draw.py
2
1515
#! /usr/bin/env python from __future__ import print_function from openturns import * TESTPREAMBLE() RandomGenerator.SetSeed(0) try: # We create a numerical math function myFunction = NumericalMathFunction( ('E', 'F', 'L', 'I'), ('y',), ('-F*L^3/(3.*E*I)',)) dim = myFunction.getInputDimension() ...
gpl-3.0
1,299,170,789,310,023,400
24.25
71
0.658086
false
googleapis/googleapis-gen
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/campaign_bid_modifier_service/client.py
1
23610
# -*- 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
-2,511,613,774,935,711,000
45.023392
176
0.630241
false
linuxdeepin/deepin-media-player
src/format_conv/new_progressbar.py
2
1350
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 ~ 2012 Deepin, Inc. # 2011 ~ 2012 Hai longqiu. # # Author: Hai longqiu <qiuhailong@linuxdeepin.com> # Maintainer: Hai longqiu <qiuhailong@linuxdeepin.com> # # This program is free software: you can redistribute it and/or modify # i...
gpl-3.0
-4,210,008,023,754,567,000
32.75
71
0.654074
false
dllsf/odootest
addons/account/wizard/account_open_closed_fiscalyear.py
104
2341
# -*- 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
-3,672,095,084,057,197,000
47.770833
202
0.631781
false
seanwestfall/django
setup.py
123
3257
import os import sys from distutils.sysconfig import get_python_lib from setuptools import find_packages, setup # Warn if we are installing over top of an existing installation. This can # cause issues where files that were deleted from a more recent Django are # still present in site-packages. See #18115. overlay_wa...
bsd-3-clause
8,603,937,055,261,306,000
33.648936
79
0.645379
false
Tejal011089/digitales_frappe
frappe/core/report/permitted_documents_for_user/permitted_documents_for_user.py
32
1678
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _, throw import frappe.utils.user from frappe.permissions import check_admin_or_system_manager from frappe.model.db_schema import type_map def...
mit
-3,770,965,199,946,452,500
30.074074
115
0.719905
false
Bysmyyr/chromium-crosswalk
third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py
26
7929
# Copyright (C) 2011 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 ...
bsd-3-clause
2,401,511,062,771,278,000
38.252475
122
0.63892
false
open-craft/opencraft
instance/migrations/0079_openstack_settings_per_appserver.py
1
2903
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-03-09 16:05 from __future__ import unicode_literals from django.db import migrations, models import django_extensions.db.fields.json import functools import instance.models.utils class Migration(migrations.Migration): dependencies = [ ('instan...
agpl-3.0
603,314,857,934,972,900
59.479167
345
0.680675
false
b0ttl3z/SickRage
SickBeard.py
5
21755
#!/usr/bin/env python2.7 # -*- coding: utf-8 -* # Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # Rewrite Author: miigotu <miigotu@gmail.com> # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it ...
gpl-3.0
8,958,149,800,963,504,000
38.698905
179
0.608274
false
hynnet/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib64/scons-2.1.0/SCons/Tool/suncc.py
21
1986
"""SCons.Tool.suncc Tool-specific initialization for Sun Solaris (Forte) CC and cc. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010...
gpl-2.0
-4,929,714,859,460,265,000
33.241379
101
0.729607
false
bjzhang/xen
tools/xm-test/tests/sched-credit/01_sched_credit_weight_cap_pos.py
42
1858
#!/usr/bin/python # # Sched-credit tests modified from SEDF tests # import re from XmTestLib import * paramsRE = re.compile(r'^[^ ]* *[^ ]* *([^ ]*) *([^ ]*)$') def get_sched_credit_params(domain): status, output = traceCommand("xm sched-credit -d %s | tail -1" % domain.getName...
gpl-2.0
-7,891,554,440,454,696,000
24.805556
92
0.630786
false
AEHO/collect
collect/src/endpoints_proto_datastore/utils_test.py
26
2058
# Copyright 2013 Google Inc. All Rights Reserved. """Tests for utils.py.""" import unittest from protorpc import messages from . import utils class UtilsTests(unittest.TestCase): """Comprehensive test for the endpoints_proto_datastore.utils module.""" def testIsSubclass(self): """Tests the utils.IsSubcl...
mit
3,405,711,284,635,772,000
29.716418
79
0.689504
false
TheProjecter/kassie
src/primaires/log/message.py
1
2331
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # 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 # l...
bsd-3-clause
284,648,126,157,134,140
42.830189
79
0.722772
false
ntt-sic/python-cinderclient
cinderclient/exceptions.py
1
4571
# Copyright 2010 Jacob Kaplan-Moss # # 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 writ...
apache-2.0
-5,495,294,784,421,334,000
25.12
79
0.641435
false
rahulunair/nova
nova/virt/powervm/media.py
4
9988
# Copyright 2015, 2017 IBM Corp. # # 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...
apache-2.0
-1,073,849,169,044,178,800
41.14346
79
0.606828
false
consulo/consulo-python
plugin/src/main/dist/helpers/coveragepy/coverage/backunittest.py
95
1515
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Implementations of unittest features from the future.""" # Use unittest2 if it's available, otherwise unittest. This gives us # back-ported features for 2.6. t...
apache-2.0
6,714,390,108,251,803,000
35.071429
79
0.70099
false
kanaka/spacewar
python/txt.py
1
4781
"""text and font classes, helps everyone to text""" import pygame, pygame.font, gfx #old versions of SysFont were buggy if pygame.ver <= '1.6.1': from mysysfont import SysFont else: SysFont = pygame.font.SysFont FontPool = {} def initialize(): pygame.font.init() return 1 class Font: def __i...
lgpl-2.1
-4,043,393,360,324,476,400
29.452229
72
0.525413
false
florian-dacosta/OpenUpgrade
addons/website_customer/__openerp__.py
52
1511
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the term...
agpl-3.0
3,818,533,072,111,959,000
32.577778
78
0.563865
false
alextremblay/snmp-cmds
tests/conftest.py
1
1071
""" We're using snmpsim to simulate various target devices for our tests. Before we do anything, we should probably make sure it's actually running """ import pytest from subprocess import run, PIPE SNMP_TEST_SRV_HOST = '127.0.0.1:10000' SYSDESCR_OID = '.1.3.6.1.2.1.1.1.0' @pytest.fixture(scope="session", autouse=...
mit
-6,641,562,274,770,107,000
40.230769
78
0.62465
false
kwailamchan/programming-languages
javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/contrib/sessions/backends/file.py
79
5340
import errno import os import tempfile from django.conf import settings from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured class SessionStore(SessionBase): """ Implements a file based session store. """ ...
mit
-771,869,091,849,873,000
35.326531
78
0.575468
false
spitfire88/upm
examples/python/grovewater.py
7
2028
#!/usr/bin/python # Author: Zion Orent <zorent@ics.com> # Copyright (c) 2015 Intel Corporation. # # 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 limi...
mit
8,577,439,791,083,816,000
36.555556
85
0.722387
false
Distrotech/antlr4
runtime/Python3/src/antlr4/atn/ATNDeserializer.py
17
22901
# [The "BSD license"] # Copyright (c) 2013 Terence Parr # Copyright (c) 2013 Sam Harwell # Copyright (c) 2014 Eric Vergnaud # 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. Redistr...
bsd-3-clause
413,134,295,271,048,800
41.174954
134
0.599886
false
jhawkesworth/ansible
lib/ansible/modules/network/aci/aci_firmware_policy.py
16
6423
#!/usr/bin/python # 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 ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCU...
gpl-3.0
773,021,418,507,066,400
25.216327
141
0.577923
false
pyIMS/pyimzML
pyimzml/metadata.py
2
11625
from warnings import warn from pyimzml.ontology.ontology import lookup_and_convert_cv_param, convert_xml_value, convert_term_name XMLNS_PREFIX = "{http://psi.hupo.org/ms/mzml}" def _deep_pretty(obj): if isinstance(obj, list): return [_deep_pretty(item) for item in obj] if isinstance(obj, dict): ...
apache-2.0
-7,533,158,348,496,504,000
40.517857
115
0.599398
false
caesar2164/edx-platform
common/djangoapps/student/management/commands/manage_group.py
52
4853
""" Management command `manage_group` is used to idempotently create Django groups and set their permissions by name. """ from django.apps import apps from django.contrib.auth.models import Group, Permission from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError f...
agpl-3.0
3,467,941,160,819,245,000
37.515873
102
0.554502
false
nagaozen/my-os-customizations
home/nagaozen/gedit-2.30.4/plugins/externaltools/tools/linkparsing.py
6
7117
# -*- coding: utf-8 -*- # # Copyright (C) 2009-2010 Per Arneng <per.arneng@anyplanet.com> # # 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 # ...
gpl-3.0
882,996,084,928,363,400
29.809524
80
0.614163
false
DCGenomics/multiple_myeloma_rnaseq_drug_response_hackathon_v002
src/reader.py
4
2559
import os import csv class Reader(object): """ This is an abstract class and not to be used as is. Expects the text files start with a header """ INPUT_DELIMITER='\t' OUTPUT_DELIMITER='\t' def __init__(self, filename=None): self._filename=filename self._filehandle=None...
cc0-1.0
-5,478,474,188,310,151,000
26.815217
85
0.597108
false
richjoyce/pandas_vectors
test_pv.py
1
1154
import pandas_vectors as pv import pandas as pd import numpy as np import unittest class PvTest(unittest.TestCase): def test_indexer(self): self.assertListEqual(pv.indexer('a'), ['a_x', 'a_y', 'a_z']) self.assertListEqual(pv.indexer(['a']), ['a_x', 'a_y', 'a_z']) self.assertListEqual(pv.in...
mit
-7,521,872,180,493,051,000
40.214286
111
0.542461
false
eviljeff/olympia
src/olympia/scanners/migrations/0021_auto_20200122_1347.py
6
1152
# Generated by Django 2.2.9 on 2020-01-22 13:47 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('scanners', '0020_auto_20200116_1250'), ] operations = [ migrations.AlterField( model_name='scannerqueryresult', name...
bsd-3-clause
-5,652,623,422,273,425,000
33.909091
117
0.549479
false
whip112/Whip112
kuma/wiki/forms.py
7
20369
import re from tower import ugettext_lazy as _lazy from tower import ugettext as _ from django import forms from django.conf import settings from django.forms.widgets import CheckboxSelectMultiple from kuma.contentflagging.forms import ContentFlagForm import kuma.wiki.content from kuma.core.form_fields import Strip...
mpl-2.0
-4,191,856,128,121,154,600
43.571116
85
0.544111
false
thalamus/Flexget
flexget/utils/search.py
18
1283
""" Common tools used by plugins implementing search plugin api """ from __future__ import unicode_literals, division, absolute_import import re from unicodedata import normalize from flexget.utils.titles.parser import TitleParser def clean_symbols(text): """Replaces common symbols with spaces. Also normalize un...
mit
2,275,909,279,579,662,000
30.292683
98
0.701481
false
mjuric/duplicity
duplicity/globals.py
1
9094
# -*- 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
1,635,331,621,520,923,400
28.525974
100
0.753354
false
efiring/scipy
scipy/io/matlab/tests/test_mio5_utils.py
106
5604
""" Testing mio5_utils Cython module """ from __future__ import division, print_function, absolute_import import sys from io import BytesIO cStringIO = BytesIO import numpy as np from nose.tools import (assert_true, assert_equal, assert_raises) from numpy.testing import (assert_array_equal, run_module_suite) fro...
bsd-3-clause
-3,779,111,058,242,956,000
28.650794
75
0.558351
false
applicationdevm/XlsxWriter
xlsxwriter/test/workbook/test_workbook02.py
8
1742
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...workbook import Workbook class TestAssem...
bsd-2-clause
-3,887,588,911,511,140,400
33.156863
170
0.548794
false
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_binhex.py
96
1508
"""Test script for the binhex C module Uses the mechanism of the python binhex module Based on an original test by Roger E. Masse. """ import binhex import os import unittest from test import support class BinHexTestCase(unittest.TestCase): def setUp(self): self.fname1 = support.TESTFN + "1" ...
gpl-2.0
6,019,688,283,803,326,000
25.928571
121
0.636605
false
patrick91/pycon
backend/pages/migrations/0001_initial.py
1
1619
# Generated by Django 2.2.4 on 2019-08-27 22:02 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): initial = True dependencies = [ ('conferences', '0007_auto_20190811_1953'), ] ...
mit
8,538,459,329,327,216,000
43.972222
173
0.615812
false
claneys/shinken
test/test_satellites.py
18
2982
#!/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
-3,409,638,189,346,022,000
32.886364
126
0.625755
false
bob-the-hamster/kivy
kivy/uix/floatlayout.py
26
3807
''' Float Layout ============ :class:`FloatLayout` honors the :attr:`~kivy.uix.widget.Widget.pos_hint` and the :attr:`~kivy.uix.widget.Widget.size_hint` properties of its children. .. only:: html .. image:: images/floatlayout.gif :align: right .. only:: latex .. image:: images/floatlayout.png ...
mit
-6,322,024,471,509,524,000
29.456
79
0.534279
false
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/plugins/connection/zone.py
21
7937
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com> # and jail.py (c) 2013, Michael Scherer <misc@zarb.org> # (c) 2015, Dagobert Michelsen <dam@baltic-online.de> # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # Copyright (c...
bsd-3-clause
3,949,601,139,637,450,000
38.487562
121
0.600101
false
jblackburne/scikit-learn
sklearn/tree/export.py
12
16020
""" This module defines export functions for decision trees. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Dawe <noel@dawe.me> # Satrajit Gosh <satrajit.ghosh@gmail.com> # Trevor...
bsd-3-clause
8,561,959,931,920,857,000
37.417266
84
0.515356
false
lmazuel/azure-sdk-for-python
azure-mgmt-sql/azure/mgmt/sql/operations/sync_members_operations.py
1
37014
# 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,128,485,347,763,977,000
46.514763
254
0.635678
false
cwq/ijkplayer
tools/copyrighter/CRFile.py
12
4633
#! /usr/bin/env bash # # Copyright (C) 2013-2017 Bilibili # Copyright (C) 2013-2017 Zhang Rui <bbcallen@gmail.com> # # 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.o...
gpl-2.0
-8,082,592,302,667,473,000
36.666667
96
0.57112
false
awatts/boto
boto/ec2/instancetype.py
152
2273
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
mit
-5,446,291,843,618,590,000
37.525424
74
0.66256
false
toastedcornflakes/scikit-learn
sklearn/utils/tests/test_class_weight.py
50
13151
import numpy as np from sklearn.linear_model import LogisticRegression from sklearn.datasets import make_blobs from sklearn.utils.class_weight import compute_class_weight from sklearn.utils.class_weight import compute_sample_weight from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testin...
bsd-3-clause
-4,530,773,189,385,055,000
45.800712
90
0.616151
false
lenw/ansible-modules-core
cloud/amazon/ec2_snapshot.py
67
10167
#!/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
282,382,570,355,734,940
31.691318
139
0.644143
false
proximate/proximate
scheduler.py
1
6380
# # Proximate - Peer-to-peer social networking # # Copyright (c) 2008-2011 Nokia Corporation # # All rights reserved. # # This software is licensed under The Clear BSD license. # See the LICENSE file for more details. # from gobject import timeout_add_seconds from datetime import datetime, timedelta from os import list...
bsd-3-clause
-7,401,930,447,448,590,000
31.222222
78
0.578527
false
dimroc/tensorflow-mnist-tutorial
lib/python3.6/site-packages/tensorflow/python/ops/rnn_cell_impl.py
31
5806
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-7,426,642,114,607,099,000
40.471429
80
0.693076
false
aazen/DayOne
slyd/slyd/resource.py
8
1299
import json, errno from twisted.web.resource import Resource, NoResource, ErrorPage class SlydJsonResource(Resource): """Base Resource for Slyd Resources This sets the content type to JSON and handles errors """ def render(self, request): request.setResponseCode(200) request.setHeade...
bsd-3-clause
2,473,098,072,528,021,000
27.866667
67
0.624326
false
PatKayongo/patkayongo.github.io
node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/manni.py
364
2374
# -*- coding: utf-8 -*- """ pygments.styles.manni ~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by the terminal highlighting style. This is a port of the style used in the `php port`_ of pygments by Manni. The style is called 'default' there. :copyright: Copyright 2006-2013 by the Pygments...
mit
221,224,525,313,256,000
30.653333
70
0.522325
false
shujingke/opencog
opencog/python/pln_old/examples/deduction/deduction_agent.py
32
1303
""" PLN Simple Deduction Agent Example Demonstrates the simplest possible forward inference agent that implements a chainer with one inference rule and one link type For instructions, refer to the README for PLN. """ from opencog.cogserver import MindAgent from opencog.atomspace import types from pln.chainers import...
agpl-3.0
312,629,920,652,980,860
24.54902
74
0.67076
false
wisechengyi/pants
tests/python/pants_test/backend/graph_info/tasks/test_dependees.py
1
9733
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from textwrap import dedent from pants.backend.codegen.thrift.java.java_thrift_library import JavaThriftLibrary from pants.backend.graph_info.tasks.dependees import ReverseDepmap from pan...
apache-2.0
-9,055,479,545,422,068,000
30.396774
99
0.464297
false
playm2mboy/edx-platform
common/test/acceptance/tests/studio/test_studio_with_ora_component.py
87
4074
""" Acceptance tests for Studio related to edit/save peer grading interface. """ from ...fixtures.course import XBlockFixtureDesc from ...pages.studio.import_export import ExportCoursePage from ...pages.studio.component_editor import ComponentEditorView from ...pages.studio.overview import CourseOutlinePage from base_...
agpl-3.0
3,237,633,480,062,564,000
38.941176
118
0.613402
false
Teamxrtc/webrtc-streaming-node
third_party/depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/boto/boto/route53/hostedzone.py
136
1961
# Copyright (c) 2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # 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 restrict...
mit
4,486,745,328,467,981,000
37.45098
74
0.676186
false