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
POFK/utilTool
vim/after/pydiction.py
17
9252
#!/usr/bin/env python # Last modified: July 23rd, 2009 """ pydiction.py 1.2 by Ryan Kulla (rkulla AT gmail DOT com). Description: Creates a Vim dictionary of Python module attributes for Vim's completion feature. The created dictionary file is used by the Vim ftplugin "python_pydiction.vim...
mit
640,958,067,653,099,400
31.577465
79
0.571768
false
MounirMesselmeni/django-highlightjs
highlightjs/settings.py
1
1267
from django.conf import settings HIGHLIGHTJS_DEFAULTS = { "jquery_url": "//code.jquery.com/jquery.min.js", "base_url": "//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js", "css_url": "//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/{0}.min.css", "include_jquery": False, "...
mit
-2,134,859,019,753,320,700
23.365385
86
0.675612
false
shakamunyi/sahara
sahara/tests/integration/tests/gating/test_vanilla_two_gating.py
10
14237
# Copyright (c) 2014 Mirantis 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 writ...
apache-2.0
3,463,652,153,750,110,700
39.446023
79
0.575121
false
bdfoster/blumate
blumate/components/sensor/steam_online.py
1
2169
""" Sensor for Steam account status. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.steam_online/ """ from blumate.helpers.entity import Entity from blumate.const import CONF_API_KEY ICON = 'mdi:steam' REQUIREMENTS = ['steamodd==4.21'] # pylin...
mit
-9,081,001,934,260,060,000
26.1125
74
0.590134
false
rsvip/Django
tests/aggregation/tests.py
12
44227
from __future__ import unicode_literals import datetime import re from decimal import Decimal from django.core.exceptions import FieldError from django.db import connection from django.db.models import ( F, Aggregate, Avg, Count, DecimalField, DurationField, FloatField, Func, IntegerField, Max, Min, Sum, Valu...
bsd-3-clause
-8,134,841,097,336,746,000
38.808281
155
0.541502
false
david4096/ga4gh-server
ga4gh/server/auth/__init__.py
1
11719
""" Helps to implement authentication and authorization using Auth0. Offers functions for generating the view functions needed to implement Auth0, a login screen, callback maker, and a function decorator for protecting endpoints. """ import flask import requests import functools import json import base64 import jwt ...
apache-2.0
8,056,975,853,754,710,000
33.877976
81
0.631624
false
mouton5000/DiscreteEventApplicationEditor
test/testsTriggersExpressions/testRand.py
1
3182
__author__ = 'mouton' from unittest import TestCase from triggerExpressions import Rand, Evaluation from database import Variable from test.testsTriggersExpressions import simpleTests from arithmeticExpressions import ALitteral class TestRand(TestCase): @classmethod def setUpClass(cls): import gramm...
mit
4,963,862,533,033,187,000
35.586207
93
0.672847
false
ESOedX/edx-platform
openedx/core/djangoapps/header_control/decorators.py
2
2011
""" Middleware decorator for removing headers. """ from __future__ import absolute_import from functools import wraps from openedx.core.djangoapps.header_control import force_header_for_response, remove_headers_from_response def remove_headers(*headers): """ Decorator that removes specific headers from the...
agpl-3.0
-6,593,589,985,785,061,000
27.323944
106
0.620587
false
libvirt/autotest
client/virt/ppm_utils.py
1
7287
""" Utility functions to deal with ppm (qemu screendump format) files. @copyright: Red Hat 2008-2009 """ import os, struct, time, re from autotest_lib.client.bin import utils # Some directory/filename utils, for consistency def find_id_for_screendump(md5sum, dir): """ Search dir for a PPM file whose name en...
gpl-2.0
-6,145,387,966,197,348,000
29.746835
76
0.613696
false
shanethehat/skype4py
Skype4Py/lang/pl.py
23
7712
apiAttachAvailable = u'API jest dost\u0119pne' apiAttachNotAvailable = u'Niedost\u0119pny' apiAttachPendingAuthorization = u'Autoryzacja w toku' apiAttachRefused = u'Odmowa' apiAttachSuccess = u'Sukces' apiAttachUnknown = u'Nieznany' budDeletedFriend = u'Usuni\u0119ty z listy znajomych' budFriend = u'Znajomy' budNeverB...
bsd-3-clause
8,922,150,047,343,551,000
40.240642
95
0.810685
false
chrisdickinson/nojs
build/android/pylib/utils/decorators.py
14
1080
# Copyright 2017 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 functools import logging def Memoize(f): """Decorator to cache return values of function.""" memoize_dict = {} @functools.wraps(f) def wrapp...
bsd-3-clause
4,484,480,473,899,403,000
28.189189
76
0.69537
false
MyRobotLab/pyrobotlab
home/kwatters/harry/gestures/stoprockpaperscissors.py
1
1477
def stoprockpaperscissors(): global inmoov global human rest() sleep(5) if inmoov < human: i01.mouth.speak("congratulations you won with" + str(human - inmoov) + "points") sleep(3) i01.mouth.speak(str(human) + "points to you and" + str(inmoov) + "points to me") elif inmoov > human: ...
apache-2.0
7,865,202,142,859,686,000
38.918919
103
0.549763
false
pelson/conda-rpms
conda_rpms/tests/unit/test_build.py
1
1052
import textwrap import unittest from conda_rpms.build import name_version_release class Test_name_version_release(unittest.TestCase): def _check_output(self, spec): expected = {'name': 'foo', 'release':'2', 'version':'1'} actual = name_version_release(textwrap.dedent(spec).split('\n')) se...
bsd-3-clause
-8,408,623,271,833,388,000
24.047619
72
0.479087
false
aisworld/mailmanclient
src/mailmanclient/tests/test_domain.py
1
1531
# Copyright (C) 2015 by the Free Software Foundation, Inc. # # This file is part of mailman.client. # # mailman.client 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, version 3 of the License. # # mailm...
lgpl-3.0
2,082,105,441,953,264,400
31.574468
78
0.693664
false
zerebubuth/mapnik
plugins/input/csv/build.py
2
2790
# # This file is part of Mapnik (c++ mapping toolkit) # # Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your op...
lgpl-2.1
5,826,978,301,830,417,000
34.316456
102
0.619713
false
benjyw/pants
src/python/pants/bin/pants_runner.py
4
4366
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import logging import os import sys import warnings from dataclasses import dataclass from typing import List, Mapping from pants.base.exception_sink import ExceptionSink from pants.base....
apache-2.0
1,419,618,186,921,437,000
42.66
104
0.684837
false
nebulans/testfixtures
testfixtures/tests/test_comparison.py
1
20153
from unittest import TestCase import sys from testfixtures import Comparison as C, TempDirectory, compare, diff from testfixtures.compat import PY2, PY3, exception_module from testfixtures.shouldraise import ShouldAssert from testfixtures.tests.sample1 import SampleClassA, a_function import pytest class AClass: ...
mit
-6,333,670,489,738,240,000
31.039746
78
0.468814
false
pupboss/xndian
deploy/site-packages/pip/cmdoptions.py
361
9507
""" shared options and groups The principle here is to define options once, but *not* instantiate them globally. One reason being that options with action='append' can carry state between parses. pip parse's general options twice internally, and shouldn't pass on state. To be consistent, all options will follow this d...
mit
-636,359,531,239,356,900
24.625337
179
0.626275
false
Justin-Yuan/Image2Music-Generator
library/jython2.5.3/Lib/test/test_sax.py
9
21680
# -*- coding: iso-8859-1 -*- # regression test for SAX 2.0 # $Id: test_sax.py,v 1.13 2004/03/20 07:46:04 fdrake Exp $ import urllib from xml.sax import handler, make_parser, ContentHandler, \ SAXException, SAXReaderNotAvailable, SAXParseException try: make_parser() except SAXReaderNotAvailable:...
gpl-2.0
1,305,884,192,181,632,300
27.753316
111
0.575415
false
basicthinker/THNVM
configs/ruby/MI_example.py
13
7567
# Copyright (c) 2006-2007 The Regents of The University of Michigan # Copyright (c) 2009 Advanced Micro Devices, 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 co...
bsd-3-clause
2,522,105,704,558,653,000
41.511236
82
0.629576
false
gnumdk/eolie
eolie/toolbar.py
1
2783
# Copyright (c) 2017 Cedric Bellegarde <cedric.bellegarde@adishatz.org> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
-2,463,142,965,218,575,400
30.269663
71
0.604024
false
Kongsea/tensorflow
tensorflow/examples/speech_commands/freeze.py
37
6965
# 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
-4,144,194,761,826,119,700
37.694444
80
0.694042
false
ChetnaChaudhari/hadoop
hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/terasort/job_history_summary.py
323
3444
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "...
apache-2.0
-7,955,692,538,774,459,000
33.44
79
0.689895
false
GabrielBrascher/cloudstack
plugins/network-elements/stratosphere-ssp/sspmock/sspmock.py
8
3571
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
4,686,638,657,083,140,000
35.070707
76
0.682442
false
yoer/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/management/commands/ogrinspect.py
104
6065
from optparse import make_option from django.contrib.gis import gdal from django.core.management.base import LabelCommand, CommandError def layer_option(option, opt, value, parser): """ Callback for `make_option` for the `ogrinspect` `layer_key` keyword option which may be an integer or a string. """ ...
apache-2.0
8,240,777,830,863,555,000
50.398305
128
0.584171
false
AyoubZahid/odoo
addons/website_forum/tests/test_forum.py
27
12005
# -*- coding: utf-8 -*- from .common import KARMA, TestForumCommon from ..models.forum import KarmaError from openerp.exceptions import UserError, AccessError from openerp.tools import mute_logger class TestForum(TestForumCommon): @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.models') def test_as...
gpl-3.0
-4,996,169,584,251,833,000
42.028674
157
0.622824
false
sschiau/swift
utils/swift_build_support/tests/test_targets.py
60
1427
# test_targets.py - Unit tests for swift_build_support.targets -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt...
apache-2.0
3,769,951,048,264,712,000
36.552632
78
0.695165
false
nelseric/qmk_firmware
lib/python/qmk/cli/c2json.py
4
2196
"""Generate a keymap.json from a keymap.c file. """ import json from milc import cli import qmk.keymap import qmk.path @cli.argument('--no-cpp', arg_only=True, action='store_false', help='Do not use \'cpp\' on keymap.c') @cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')...
gpl-2.0
-8,886,152,601,718,638,000
38.214286
168
0.651639
false
dulems/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/auth/hashers.py
95
17370
from __future__ import unicode_literals import base64 import binascii import hashlib from django.dispatch import receiver from django.conf import settings from django.test.signals import setting_changed from django.utils import importlib from django.utils.datastructures import SortedDict from django.utils.encoding im...
apache-2.0
-6,357,434,433,733,542,000
32.728155
100
0.640012
false
facelessuser/Pywin32
lib/x32/win32com/demos/connect.py
10
3658
# Implements _both_ a connectable client, and a connectable server. # # Note that we cheat just a little - the Server in this demo is not created # via Normal COM - this means we can avoid registering the server. # However, the server _is_ accessed as a COM object - just the creation # is cheated on - so this is still ...
bsd-3-clause
593,657,091,553,596,200
43.072289
90
0.752597
false
aselle/tensorflow
tensorflow/python/keras/wrappers/scikit_learn.py
26
12799
# 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
-6,237,129,268,860,304,000
34.952247
80
0.644894
false
surgebiswas/poker
PokerBots_2017/Johnny/yaml/representer.py
64
17711
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer', 'RepresenterError'] from error import * from nodes import * import datetime import sys, copy_reg, types class RepresenterError(YAMLError): pass class BaseRepresenter(object): yaml_representers = {} yaml_multi_representers = {} d...
mit
8,360,273,112,787,196,000
35.442387
91
0.594828
false
GunoH/intellij-community
python/helpers/pydev/pydev_tests_runfiles/test_pydevd_property.py
26
3422
''' Created on Aug 22, 2011 @author: hussain.bohra @author: fabioz ''' import os import sys import unittest #======================================================================================================================= # Test #================================================================================...
apache-2.0
2,583,290,038,826,382,300
26.596774
120
0.50263
false
SOKP/external_chromium_org
tools/perf/metrics/timeline_unittest.py
32
7170
# 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 unittest from metrics import test_page_test_results from metrics import timeline from telemetry.timeline import model as model_module from telemetry....
bsd-3-clause
-8,160,486,127,811,027,000
37.967391
79
0.68954
false
XiaosongWei/blink-crosswalk
Tools/Scripts/webkitpy/common/checksvnconfigfile.py
37
2672
# Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged # # 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 lis...
bsd-3-clause
4,381,044,860,875,631,000
40.75
131
0.726422
false
sysadminmatmoz/OCB
addons/account_budget/__openerp__.py
27
2220
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Budgets Management', 'version': '1.0', 'category': 'Accounting & Finance', 'description': """ This module allows accountants to manage analytic and crossovered budgets. ========================...
agpl-3.0
-6,658,898,025,618,611,000
37.947368
82
0.646847
false
rbarlow/pulp_puppet
pulp_puppet_plugins/test/unit/plugins/importer/downloaders/test_web.py
4
5848
import os import mock from nectar.report import DownloadReport import base_downloader from pulp_puppet.common import constants from pulp_puppet.plugins.importers.downloaders import exceptions, web from pulp_puppet.plugins.importers.downloaders.web import HttpDownloader TEST_SOURCE = 'http://forge.puppetlabs.com/' ...
gpl-2.0
-7,957,980,683,545,501,000
39.331034
111
0.68314
false
lociii/googleads-python-lib
examples/adspygoogle/dfp/v201208/create_mobile_line_item.py
4
3764
#!/usr/bin/python # # Copyright 2012 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 b...
apache-2.0
-4,183,164,201,307,544,600
32.607143
80
0.620616
false
hermes-jr/npui
netprofile_entities/netprofile_entities/__init__.py
2
4304
#!/usr/bin/env python # -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t -*- # # NetProfile: Entities module # © Copyright 2013-2014 Alex 'Unik' Unigovsky # # This file is part of NetProfile. # NetProfile is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public #...
agpl-3.0
-335,616,335,122,298,900
21.767196
90
0.685568
false
marissazhou/django
django/contrib/auth/__init__.py
69
7305
import inspect import re from django.apps import apps as django_apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.middleware.csrf import rotate_token from django.utils.crypto import constant_time_compare from django.utils.module_loading import i...
bsd-3-clause
-3,845,114,876,720,374,300
34.120192
105
0.667488
false
SuperTux/flexlay
flexlay/objmap_sprite_object.py
1
2634
# Flexlay - A Generic 2D Game Editor # Copyright (C) 2014 Ingo Ruhnke <grumbel@gmail.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 3 of the License, or # (at your option)...
gpl-3.0
5,786,618,241,252,943,000
31.121951
83
0.605543
false
jiazichenzhan/Server_Manage_Plugin
ironic-plugin-pike/ironic/tests/unit/common/test_cinder.py
4
36754
# Copyright 2016 Hewlett Packard Enterprise Development Company LP. # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
6,251,770,608,130,262,000
47.10733
79
0.596044
false
toshywoshy/ansible
lib/ansible/modules/network/f5/bigip_device_dns.py
23
16644
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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', ...
gpl-3.0
-7,647,549,319,754,465,000
29.097649
91
0.564708
false
stuartbfox/Diamond
src/collectors/sockstat/test/testsockstat.py
31
2201
#!/usr/bin/python # coding=utf-8 ########################################################################## from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch from mock import call from collections import Iterator from diamon...
mit
-4,996,225,587,594,420,000
29.569444
77
0.533848
false
Vogtinator/micropython
tests/pyb/modtime.py
9
1487
import time DAYS_PER_MONTH = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] def is_leap(year): return (year % 4) == 0 def test(): seconds = 0 wday = 5 # Jan 1, 2000 was a Saturday for year in range(2000, 2034): print("Testing %d" % year) yday = 1 for month in range(1, ...
mit
-2,877,694,181,674,564,000
38.131579
117
0.464022
false
barseghyanartur/magic-wormhole
src/wormhole/blocking/transit.py
4
15256
from __future__ import print_function import re, time, threading, socket, SocketServer from binascii import hexlify, unhexlify from nacl.secret import SecretBox from ..util import ipaddrs from ..util.hkdf import HKDF class TransitError(Exception): pass # The beginning of each TCP connection consists of the follow...
mit
6,550,256,074,780,587,000
34.812207
88
0.601009
false
smurfix/gevent-socketio
examples/twitterstream/twitterstream/serve.py
12
2293
from gevent import monkey; monkey.patch_all() import gevent import tweetstream import getpass from socketio import socketio_manage from socketio.server import SocketIOServer from socketio.namespace import BaseNamespace def broadcast_msg(server, ns_name, event, *args): pkt = dict(type="event", name...
bsd-3-clause
-3,506,918,904,139,193,300
29.171053
89
0.599651
false
mahak/cinder
cinder/volume/drivers/remotefs.py
2
91230
# Copyright (c) 2012 NetApp, Inc. # 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...
apache-2.0
-7,495,707,754,152,991,000
39.910314
79
0.551321
false
kantai/passe-framework-prototype
django/contrib/flatpages/tests/forms.py
155
1271
from django.conf import settings from django.contrib.flatpages.admin import FlatpageForm from django.test import TestCase class FlatpageAdminFormTests(TestCase): def setUp(self): self.form_data = { 'title': "A test page", 'content': "This is a test", 'sites': [settings.S...
bsd-3-clause
3,325,964,227,743,864,000
54.26087
115
0.658537
false
insomnia-lab/calibre
src/calibre/ebooks/markdown/blockprocessors.py
47
22371
""" CORE MARKDOWN BLOCKPARSER =========================================================================== This parser handles basic parsing of Markdown blocks. It doesn't concern itself with inline elements such as **bold** or *italics*, but rather just catches blocks, lists, quotes, etc. The BlockParser is made up ...
gpl-3.0
5,249,337,223,593,158,000
39.091398
90
0.565241
false
jmesteve/openerpseda
openerp/addons/sale_stock/__init__.py
64
1123
# -*- 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
9,003,349,910,356,638,000
39.142857
78
0.627783
false
Cal-CS-61A-Staff/ok-client
tests/sources/ok_test/load_test.py
3
1874
from client import exceptions as ex from client.sources import ok_test from client.sources.ok_test import models import mock import unittest class LoadTest(unittest.TestCase): NAME = 'valid' VALID_FILE = 'test/' + NAME + '.py' INVALID_FILE = 'invalid.ext' def setUp(self): self.patcherIsFile = ...
apache-2.0
-2,928,592,511,133,896,000
33.072727
90
0.652615
false
foobnix/foobnix
foobnix/gui/treeview/virtual_tree.py
2
7402
''' Created on Sep 29, 2010 @author: ivan ''' import logging from gi.repository import Gtk from foobnix.gui.state import LoadSave from foobnix.util.mouse_utils import is_double_left_click, is_rigth_click,\ right_click_optimization_for_trees, is_empty_click from foobnix.helpers.menu import Popup from foobnix.help...
gpl-3.0
-8,030,908,461,576,153,000
41.54023
124
0.565793
false
DukeOfHazard/crits
crits/indicators/migrate.py
13
3846
from crits.core.crits_mongoengine import EmbeddedCampaign def migrate_indicator(self): """ Migrate to the latest schema version. """ migrate_2_to_3(self) def migrate_2_to_3(self): """ Migrate from schema 2 to 3. """ if self.schema_version < 2: migrate_1_to_2(self) if sel...
mit
2,630,943,175,587,095,600
34.284404
76
0.444098
false
CRUDNS/CRUDNS
src/accounts/views.py
1
2858
from django.shortcuts import get_object_or_404 from django_rest_logger import log from knox.auth import TokenAuthentication from knox.models import AuthToken from rest_framework import status from rest_framework.authentication import BasicAuthentication from rest_framework.decorators import api_view from rest_framework...
mit
3,303,807,082,877,203,000
33.853659
93
0.716935
false
dipanjanS/text-analytics-with-python
New-Second-Edition/Ch05 - Text Classification/model_evaluation_utils.py
2
9263
# -*- coding: utf-8 -*- """ Created on Mon Jul 31 20:05:23 2017 @author: DIP @Copyright: Dipanjan Sarkar """ from sklearn import metrics import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.preprocessing import LabelEncoder from sklearn.base import clone from sklearn.preprocessing impor...
apache-2.0
3,289,047,808,602,900,000
39.449782
102
0.543344
false
korandabit/dresherMachine
main.py
1
4223
#mainscript from __future__ import print_function from collections import Counter import csv,ast,re, itertools, glob,sys,os,datetime import dresher_LSA as d import main_1inventoryMover as m import main_2inventoryParser2 as k import main_3min_analysis as a1 import main_4efficiency_analysis as a2 """ 2017.0...
mit
5,566,464,341,866,358,000
37.46729
308
0.708975
false
BioGRID/BioGRID-Annotation
QUICK_buildOrganisms.py
2
2630
# Create the quick lookup organism table import Config import sys, string import MySQLdb import Database with Database.db as cursor : # EMPTY EXISTING DATA cursor.execute( "TRUNCATE TABLE " + Config.DB_QUICK + ".quick_organisms" ) cursor.execute( "TRUNCATE TABLE " + Config.DB_QUICK + ".quick_refseq_o...
mit
531,019,430,364,504,100
45
319
0.693916
false
vanpact/scipy
scipy/weave/accelerate_tools.py
97
12946
#**************************************************************************# #* FILE ************** accelerate_tools.py ************************# #**************************************************************************# #* Author: Patrick Miller February 9 2002 *# #***********...
bsd-3-clause
4,145,198,248,276,414,500
28.829493
120
0.512668
false
smarkwell/asuswrt-merlin
release/src/router/samba-3.0.25b/source/stf/smbcontrol.py
137
7998
#!/usr/bin/python # # Test for smbcontrol command line argument handling. # import comfychair class NoArgs(comfychair.TestCase): """Test no arguments produces usage message.""" def runtest(self): out = self.runcmd("smbcontrol", expectedResult = 1) self.assert_re_match("Usage: smbcontrol", out[...
gpl-2.0
4,562,096,673,082,159,600
32.605042
79
0.610653
false
yasn77/whitepy
whitepy/lexer.py
1
2383
from .lexerconstants import CHAR_MAP, HAS_ARGS, IMP_CONST, \ STACK_MANIPULATION_CONST, ARITHMETIC_CONST, HEAP_ACCESS_CONST, \ FLOW_CONTROL_CONST, IO_CONST, NUM_CONST from .ws_token import Tokeniser class IntError(ValueError): '''Exception when invalid integer is found''' class Lexer(object): def __i...
apache-2.0
7,014,887,768,399,848,000
35.106061
72
0.564415
false
gpocentek/python-gitlab
gitlab/client.py
1
35035
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2017 Gauvain Pocentek <gauvain@pocentek.net> # # 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 you...
lgpl-3.0
3,112,840,748,585,115,000
36.310969
88
0.577394
false
UniversalMasterEgg8679/ansible
lib/ansible/module_utils/docker_common.py
21
18341
# # Copyright 2016 Red Hat | Ansible # # 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. # # ...
gpl-3.0
4,761,005,868,632,788,000
39.487859
111
0.532741
false
tjanez/ansible
lib/ansible/modules/cloud/softlayer/sl_vm.py
14
11641
#!/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
1,246,037,081,547,073,800
28.545685
239
0.633966
false
MycChiu/tensorflow
tensorflow/python/framework/file_system_test.py
36
1896
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
1,209,880,145,686,186,000
36.176471
79
0.691983
false
freedomtan/tensorflow
tensorflow/python/keras/engine/deferred_sequential_test.py
4
8673
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
4,327,780,589,538,577,000
38.067568
80
0.678773
false
kxepal/simpleubjson
simpleubjson/tools/inspect.py
4
4487
# -*- coding: utf-8 -*- # # Copyright (C) 2011-2014 Alexander Shorin # All rights reserved. # # This software is licensed as described in the file LICENSE, which # you should have received as part of this distribution. # import sys import simpleubjson from ..draft8 import Draft8Decoder from ..draft9 import Draft9Decod...
bsd-2-clause
5,629,522,425,621,986,000
36.082645
80
0.525964
false
josecanciani/pyparser
lang/php/grammar/pclass.py
1
2429
from pyparser.grammar.pclass import Class as BaseClass, Extractor as BaseExtractor from pyparser.grammar.exception import InvalidSyntax from pyparser.lang.php.grammar.method import Extractor as MethodExtractor from pyparser.lang.php.grammar.classprop import Extractor as PropExtractor keywords = ['abstract', 'class'] ...
gpl-3.0
-951,865,951,277,069,800
36.369231
98
0.575957
false
jinzo27/infoGrabr
lib/cpp/scons/scons-local-2.0.0.final.0/SCons/Conftest.py
118
27708
"""SCons.Conftest Autoconf-like configuration support; low level implementation of tests. """ # # Copyright (c) 2003 Stichting NLnet Labs # Copyright (c) 2001, 2002, 2003 Steven Knight # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation file...
mit
8,733,988,416,171,954,000
33.940731
95
0.605529
false
Fokko/incubator-airflow
airflow/example_dags/example_branch_python_dop_operator_3.py
1
2116
# -*- 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
-4,457,148,350,300,158,500
30.58209
109
0.702741
false
AndrewLvov/django-registration
registration/forms.py
38
4537
""" Forms and validation code for user registration. Note that all of these forms assume Django's bundle default ``User`` model; since it's not possible for a form to anticipate in advance the needs of custom user models, you will need to write your own forms if you're using a custom model. """ from django.contrib....
bsd-3-clause
1,241,793,345,364,352,300
36.808333
141
0.625523
false
ValentineBlacker/TopDownMap
src/sprite.py
2
9275
''' Created on Apr 7, 2012 @author: Demicow ''' import pygame #Tie circle collion to self. leftside etc class customSprite(pygame.sprite.DirtySprite): def __init__(self, scene, image, location): #init the sprite! pygame.sprite.DirtySprite.__init__(self) #info about t...
gpl-2.0
-8,331,468,186,841,472,000
36.1
141
0.510836
false
divio/djangocms-accordion
djangocms_accordion/cms_plugins.py
1
1171
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from cms.plugin_pool import plugin_pool from cms.plugin_base import CMSPluginBase from djangocms_accordion.models import Accordion, AccordionEntry class AccordionPlugin(CMSPluginBase): model = Accordion name = _('Accordion') ...
bsd-3-clause
-5,297,543,407,737,907,000
27.560976
64
0.681469
false
Johnzero/OE7
openerp/addons-modules/account/project/report/account_journal.py
61
2142
# -*- 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
-7,989,675,215,147,219,000
42.714286
165
0.629318
false
hwroitzsch/BikersLifeSaver
lib/python3.5/site-packages/numpy/lib/tests/test_type_check.py
103
10247
from __future__ import division, absolute_import, print_function import numpy as np from numpy.compat import long from numpy.testing import ( TestCase, assert_, assert_equal, assert_array_equal, run_module_suite ) from numpy.lib.type_check import ( common_type, mintypecode, isreal, iscomplex, isposinf, isn...
mit
8,826,223,087,142,873,000
29.864458
73
0.562896
false
criteo/biggraphite
biggraphite/cli/command_stats.py
1
13270
#!/usr/bin/env python # Copyright 2016 Criteo # # 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
-4,925,560,838,164,077,000
31.92804
91
0.571063
false
kaplun/invenio
modules/bibencode/lib/bibencode_utils.py
24
12430
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011, 2013 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your opt...
gpl-2.0
4,545,228,473,487,056,400
35.666667
106
0.637731
false
mgrman/BitportViewer
BitportViewer_Kodi/BitportAPI.py
1
4087
import sys import json import requests import re class BitportAPI: access_token = "" apiBaseUrl = "https://api.bitport.io/v2" isTvShowRegex = re.compile("[Ss]\d{1,2}[Ee]\d{1,2}") getNameRegex = re.compile("(^[a-zA-Z. _\-0-9()'\"]*?)\(?2\d\d\d|(^[a-zA-Z. _\-0-9()'\"]*)([Ss]\d{1,2}[Ee]\d{1,2})") ...
gpl-3.0
-4,573,840,471,894,804,000
26.802721
119
0.547835
false
tangrams/vbo-convert
vbo_to_obj.py
2
2205
from __future__ import division # required for float results when dividing ints import os, sys from glob import glob from os.path import isfile, join from itertools import islice INPUT=sys.argv[1] # zoom=int(sys.argv[3]) def convert(filename): # todo: get zoom from filename zoom=15# current zoom level - sets x & y...
mit
8,842,711,894,455,825,000
25.890244
79
0.664399
false
leeon/annotated-django
django/contrib/messages/tests/urls.py
6
2465
from django.conf.urls import url from django.contrib import messages from django.core.urlresolvers import reverse from django import forms from django.http import HttpResponseRedirect, HttpResponse from django.template import RequestContext, Template from django.template.response import TemplateResponse from django.vie...
bsd-3-clause
-3,533,007,120,341,661,700
31.012987
94
0.703043
false
iradul/phantomjs-clone
src/breakpad/src/tools/gyp/test/variables/gyptest-commands-ignore-env.py
138
1626
#!/usr/bin/env python # Copyright (c) 2009 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. """ Test that environment variables are ignored when --ignore-environment is specified. """ import os import TestGyp os.environ['GYP_DEFI...
bsd-3-clause
-3,431,603,555,018,727,000
30.882353
72
0.712177
false
ojengwa/oh-mainline
vendor/packages/Jinja2/examples/rwbench/rwbench.py
75
3346
# -*- coding: utf-8 -*- """ RealWorldish Benchmark ~~~~~~~~~~~~~~~~~~~~~~ A more real-world benchmark of Jinja2. Like the other benchmark in the Jinja2 repository this has no real-world usefulnes (despite the name). Just go away and ignore it. NOW! :copyright: (c) 2009 by the Jinja Team. ...
agpl-3.0
7,690,954,917,278,036,000
28.875
90
0.642259
false
chenc10/Spark-PAF
dist/ec2/lib/boto-2.34.0/boto/manage/__init__.py
271
1108
# 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...
apache-2.0
-883,838,008,465,999,500
47.173913
74
0.768051
false
varunnaganathan/django
django/contrib/gis/gdal/error.py
535
1996
""" This module houses the GDAL & SRS Exception objects, and the check_err() routine which checks the status code returned by GDAL/OGR methods. """ # #### GDAL & SRS Exceptions #### class GDALException(Exception): pass # Legacy name OGRException = GDALException class SRSException(Exception): pass cla...
bsd-3-clause
-8,734,006,219,048,553,000
25.972973
75
0.658818
false
ssgeejr/mitropm
browser-ext/third_party/firefox-addon-sdk/python-lib/cuddlefish/property_parser.py
37
4241
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import re import codecs class MalformedLocaleFileError(Exception): pass def parse_file(path): return parse(rea...
gpl-3.0
1,214,650,493,237,110,500
37.207207
85
0.557887
false
ivanberry/shadowsocks
shadowsocks/encrypt.py
990
5180
#!/usr/bin/env python # # Copyright 2012-2015 clowwindy # # 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 la...
apache-2.0
8,876,365,886,098,633,000
26.700535
78
0.5861
false
kiyoto/statsmodels
statsmodels/iolib/tests/test_summary.py
31
1535
'''examples to check summary, not converted to tests yet ''' from __future__ import print_function if __name__ == '__main__': from statsmodels.regression.tests.test_regression import TestOLS #def mytest(): aregression = TestOLS() TestOLS.setupClass() results = aregression.res1 r_summary = s...
bsd-3-clause
-274,017,144,135,555,620
22.630769
74
0.66645
false
vim-IDE/python-mode
pymode/libs2/rope/refactor/wildcards.py
22
5833
from rope.base import ast, evaluate, builtins, pyobjects from rope.refactor import patchedast, occurrences class Wildcard(object): def get_name(self): """Return the name of this wildcard""" def matches(self, suspect, arg): """Return `True` if `suspect` matches this wildcard""" class Suspec...
lgpl-3.0
-7,569,263,788,549,288,000
31.769663
77
0.570033
false
rhinstaller/pykickstart
tests/commands/keyboard.py
3
3784
# # Paul W. Frields <pfrields@redhat.com> # # Copyright 2009 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU # General Public License v.2. This program is distributed in the hope that it # will be ...
gpl-2.0
7,533,285,481,046,815,000
42.494253
114
0.623679
false
arunchaganty/obviousli
third-party/stanza/stanza/util/postgres.py
3
2280
""" Utilities to use when interfacing with Postgres. - These utilities support the workflow wherein you store annoated sentences in a database. """ __author__ = 'arunchaganty' import os import stanza import requests import logging def unescape_sql(inp): """ :param inp: an input string to be unescaped :re...
apache-2.0
6,003,129,232,682,144,000
24.909091
65
0.513158
false
camptocamp/ngo-addons-backport
addons/mail/tests/test_mail_gateway.py
10
34792
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
2,754,874,501,584,939,500
56.036066
166
0.618849
false
apache/airflow
tests/providers/amazon/aws/operators/test_sagemaker_transform.py
3
3951
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
5,751,812,206,839,859,000
34.918182
105
0.686409
false
motion2015/a3
cms/lib/xblock/test/test_authoring_mixin.py
48
5161
""" Tests for the Studio authoring XBlock mixin. """ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.partitions.partitions import Group, UserPartition class AuthoringMixinTestCase(ModuleStoreTestCase): ...
agpl-3.0
4,579,745,787,826,373,000
38.396947
108
0.637667
false
tudennis/LeetCode---kamyu104-11-24-2015
Python/russian-doll-envelopes.py
2
1377
# Time: O(nlogn + nlogk) = O(nlogn), k is the length of the result. # Space: O(1) # You have a number of envelopes with widths and heights given # as a pair of integers (w, h). One envelope can fit into another # if and only if both the width and height of one envelope is greater # than the width and height of the ot...
mit
5,353,795,311,257,702,000
31.785714
70
0.525054
false
robbiet480/python-social-auth
social/backends/jawbone.py
70
2794
""" Jawbone OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/jawbone.html """ from social.utils import handle_http_errors from social.backends.oauth import BaseOAuth2 from social.exceptions import AuthCanceled, AuthUnknownError class JawboneOAuth2(BaseOAuth2): name = 'jawbone' AUTHORIZA...
bsd-3-clause
785,765,154,713,509,400
35.285714
76
0.570508
false
pzdeb/SimpleCommander
src/simple_commander/game/check_collision_test.py
1
2494
import asyncio import datetime import math import time import unittest from SimpleCommander.src.simple_commander.game.hero import Hero from SimpleCommander.src.simple_commander.game.invader import Invader class Controller(): game_field = {'height': 1000, 'width': 1000} collisions = {} @asyncio.coroutine...
mit
323,025,725,057,127,550
35.15942
116
0.613873
false
tumf/xen-3.3.1
tools/python/logging/logging-0.4.9.2/test/log_test3.py
42
3360
#!/usr/bin/env python # # Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright n...
gpl-2.0
7,806,389,656,223,164,000
47.014286
86
0.570536
false
martonw/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py
115
25274
# 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
-3,671,443,435,133,907,500
42.426117
149
0.636227
false
ShawnPengxy/Flask-madeBlog
site-packages/werkzeug/_internal.py
148
13713
# -*- coding: utf-8 -*- """ werkzeug._internal ~~~~~~~~~~~~~~~~~~ This module provides internally used helpers and constants. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import string import inspect from weakre...
mit
-1,938,790,364,473,608,400
32.283981
79
0.628455
false
heynemann/whos-on-server
setup.py
1
1506
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of whoson. # https://github.com/heynemann/whos-on-server # Licensed under the MIT license: # http://www.opensource.org/licenses/MIT-license # Copyright (c) 2015, Bernardo Heynemann <heynemann@gmail.com> from setuptools import setup, find_packages from...
mit
7,890,959,522,883,110,000
23.290323
62
0.59429
false