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
darktears/chromium-crosswalk
chrome/test/data/nacl/debug_stub_browser_tests.py
42
3536
# 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 re import sys import xml.etree.ElementTree import gdb_rsp def AssertRaises(exc_class, func): try: func() except exc_class: pass e...
bsd-3-clause
3,253,282,263,647,829,000
32.046729
78
0.691459
false
encima/NeuroSocket
pysocket.py
1
5179
import socket import sys import platform import json import pprint from datetime import datetime import time import subprocess import couchdb from multiprocessing import Process import re import config import argparse import time pp = pprint.PrettyPrinter(indent=4) parser = argparse.ArgumentParser(description='Log all...
mit
-5,380,683,288,818,071,000
35.216783
118
0.594709
false
zainabg/NOX
src/nox/lib/registries.py
11
5332
import types class ObjectRegistry: """Registry for any type of objects named by a string-type name. This class is for handling common registries of objects where it is desirable to be able to lookup the object by a string name. It assumes it is not desirable to overwrite an existing registered object...
gpl-3.0
2,151,211,466,366,355,000
37.085714
107
0.637097
false
dohoangkhiem/ansible-modules-extras
cloud/vmware/vca_fw.py
14
9993
#!/usr/bin/python # Copyright (c) 2015 VMware, Inc. All Rights Reserved. # # 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 ...
gpl-3.0
664,948,173,919,228,000
32.089404
118
0.604123
false
Atlas-Sailed-Co/oppia
core/storage/email/gae_models_test.py
14
1370
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
7,304,047,927,620,110,000
35.052632
74
0.710219
false
Gavitron/pipulator
udp_handshake.py
1
2233
# udp listener # # Run this in the background, and you will appear to the pipboy app as an instance of Fallout4 import socket import struct import sys import time import json # debouncer magic number min_delta=100 #return current millis def now(): return time.time()*1000000 #return millis since 'then' def dif(the...
bsd-3-clause
-1,806,999,393,512,739,800
29.175676
145
0.709807
false
devlin85/p2pool
p2pool/bitcoin/networks/pesetacoin.py
10
1200
import os import platform from twisted.internet import defer from .. import data, helper from p2pool.util import pack P2P_PREFIX = 'c0c0c0c0'.decode('hex') P2P_PORT = 16639 ADDRESS_VERSION = 47 RPC_PORT = 26640 RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue( 'pesetacoinaddress' in ...
gpl-3.0
3,915,778,949,687,180,000
41.857143
284
0.71
false
philsch/ansible
lib/ansible/modules/network/fortios/fortios_config.py
50
5677
#!/usr/bin/python # # Ansible module to manage configuration on fortios devices # (c) 2016, Benjamin Jolivot <bjolivot@gmail.com> # # 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 Softwar...
gpl-3.0
5,116,967,008,172,259,000
27.385
119
0.657389
false
apporc/cinder
cinder/volume/drivers/emc/scaleio.py
1
42051
# Copyright (c) 2013 - 2015 EMC Corporation. # 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 # # Unle...
apache-2.0
-9,009,026,377,441,604,000
40.800199
79
0.545052
false
pbchou/trafficserver
tests/gold_tests/tls/tls_client_cert2.test.py
6
8900
''' Test offering client cert to origin ''' # 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 Lice...
apache-2.0
-6,574,854,273,037,307,000
43.059406
120
0.710674
false
admcrae/tensorflow
tensorflow/python/training/saver_large_partitioned_variable_test.py
141
2261
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
3,085,634,138,532,122,600
39.375
79
0.706325
false
kumarkrishna/sympy
sympy/physics/quantum/shor.py
98
5800
"""Shor's algorithm and helper functions. Todo: * Get the CMod gate working again using the new Gate API. * Fix everything. * Update docstrings and reformat. * Remove print statements. We may want to think about a better API for this. """ from __future__ import print_function, division import math import random fro...
bsd-3-clause
-8,453,706,120,985,651,000
30.693989
114
0.626034
false
belokop/indico_bare
indico/modules/events/util.py
1
22021
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
-3,502,893,165,326,147,600
42.69246
120
0.652877
false
ActiveState/code
recipes/Python/578776_A_Simple_Timing_Function/recipe-578776.py
1
1205
''' Simple Timing Function. This function prints out a message with the elapsed time from the previous call. It works with most Python 2.x platforms. The function uses a simple trick to store a persistent variable (clock) without using a global variable. ''' import time def dur( op=None, clock=[time.time()] ): if...
mit
-963,504,860,243,956,100
29.125
69
0.637344
false
pschmitt/home-assistant
tests/components/media_player/test_reproduce_state.py
6
6353
"""The tests for reproduction of state.""" import pytest from homeassistant.components.media_player.const import ( ATTR_INPUT_SOURCE, ATTR_MEDIA_CONTENT_ID, ATTR_MEDIA_CONTENT_TYPE, ATTR_MEDIA_ENQUEUE, ATTR_MEDIA_SEEK_POSITION, ATTR_MEDIA_VOLUME_LEVEL, ATTR_MEDIA_VOLUME_MUTED, ATTR_SOU...
apache-2.0
-4,981,924,887,553,901,000
28.009132
88
0.62742
false
dex4er/django
tests/context_processors/tests.py
63
1328
""" Tests for Django's bundled context processors. """ from django.test import TestCase class RequestContextProcessorTests(TestCase): """ Tests for the ``django.core.context_processors.request`` processor. """ urls = 'context_processors.urls' def test_request_attributes(self): """ ...
bsd-3-clause
2,578,067,497,171,241,000
34.891892
78
0.63253
false
Lyleo/nupic
nupic/frameworks/opf/previousvaluemodel.py
15
5794
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
gpl-3.0
-3,662,135,439,523,797,500
35.2125
82
0.674663
false
kooditiimi/linkedevents
events/attic/api.py
3
1863
class OrganizationOrPersonRelatedField(serializers.RelatedField): def __init__(self, hide_ld_context=False): self.hide_ld_context = hide_ld_context super(OrganizationOrPersonRelatedField, self).__init__( queryset=Organization.objects, read_only=False) def to_native(self, value): ...
bsd-3-clause
-1,168,847,851,317,103,600
34.826923
79
0.654858
false
mrquim/repository.mrquim
repo/script.module.youtube.dl/lib/youtube_dl/extractor/minoto.py
66
2177
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import int_or_none class MinotoIE(InfoExtractor): _VALID_URL = r'(?:minoto:|https?://(?:play|iframe|embed)\.minoto-video\.com/(?P<player_id>[0-9]+)/)(?P<id>[a-zA-Z0-9]+)' def _real_extract(self,...
gpl-2.0
-9,219,184,665,029,333,000
37.875
124
0.473128
false
Enether/algos
shell_sort/shell_sort.py
7
1158
def shell_sort(array): """ Sorts the given array of integers using the Shell Sort algorithm Time Complexity : O((len(array))^2) Space Complexity : O(len(array)) :param array: A List of integers. :return: returns the array sorted """ # calculate the gap using Knuth's formula gap = 1 ...
mit
-1,488,156,922,846,560,000
27.243902
89
0.564767
false
bowlofstew/zulip
tools/deprecated/finbot/money.py
114
7730
#!/usr/bin/python import datetime import monthdelta def parse_date(date_str): return datetime.datetime.strptime(date_str, "%Y-%m-%d") def unparse_date(date_obj): return date_obj.strftime("%Y-%m-%d") class Company(object): def __init__(self, name): self.name = name self.flows = [] ...
apache-2.0
6,258,614,601,234,549,000
35.462264
90
0.598318
false
zj8487/godot
platform/winrt/detect.py
32
8382
import os import sys import string def is_active(): return True def get_name(): return "WinRT" def can_build(): if (os.name=="nt"): #building natively on windows! if (os.getenv("VSINSTALLDIR")): return True return False def get_opts(): return [] def get_flags(...
mit
-8,759,128,710,837,608,000
51.730769
846
0.669649
false
40223137/cdag7test37
static/Brython3.1.1-20150328-091302/Lib/xml/sax/_exceptions.py
625
4885
"""Different kinds of SAX Exceptions""" #in brython the 4 lines below causes an $globals['Exception'] error #import sys #if sys.platform[:4] == "java": # from java.lang import Exception #del sys # ===== SAXEXCEPTION ===== class SAXException(Exception): """Encapsulate an XML error or warning. This class can con...
gpl-3.0
1,394,051,835,317,057,500
34.919118
79
0.679427
false
amitsaha/compose
tests/integration/cli_test.py
7
29305
from __future__ import absolute_import import os import shlex import sys from operator import attrgetter from six import StringIO from .. import mock from .testcases import DockerClientTestCase from compose.cli.command import get_project from compose.cli.errors import UserError from compose.cli.main import TopLevelC...
apache-2.0
1,169,825,286,028,701,000
40.804565
127
0.627333
false
koobonil/Boss2D
Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/python/kernel_tests/conv2d_backprop_filter_grad_test.py
101
2774
# 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...
mit
1,800,757,541,954,069,500
41.676923
80
0.608868
false
aioue/ansible
lib/ansible/modules/windows/win_iis_virtualdirectory.py
78
2485
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Henrik Wallström <henrik@wallstroms.nu> # # 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 t...
gpl-3.0
148,951,107,959,117,820
28.559524
127
0.704793
false
Johnzero/OE7
openerp/addons-modules/crm/wizard/__init__.py
60
1205
# -*- 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,125,514,867,706,067,000
42.035714
78
0.643154
false
mihailignatenko/erp
addons/gamification/models/challenge.py
91
43642
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
agpl-3.0
3,823,946,090,034,659,300
47.762011
187
0.568466
false
gemmellr/qpid-proton
python/tests/proton_tests/codec.py
3
19278
# # 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
-6,255,625,649,937,494,000
35.101124
119
0.546841
false
maellak/invenio
modules/websubmit/lib/functions/Send_APP_Mail.py
24
12215
## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at...
gpl-2.0
6,361,958,145,456,214,000
42.938849
109
0.584937
false
piffey/ansible
lib/ansible/utils/module_docs_fragments/shell_common.py
21
1782
# Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # common shelldocumentation fragment DOCUMENTATION = """ options: remote_tmp: description: - Temporary directory to use on targets whe...
gpl-3.0
-3,162,962,476,235,590,700
28.7
128
0.642536
false
Pal3love/otRebuilder
Package/otRebuilder/Dep/fontTools/ttLib/tables/C_O_L_R_.py
3
5304
# Copyright 2013 Google, Inc. All Rights Reserved. # # Google Author(s): Behdad Esfahbod from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.misc.textTools import safeEval from . import DefaultTable import operator import struct class table_C_O_L_R_(Defau...
mit
2,209,445,214,758,816,500
32.358491
131
0.715498
false
hendradarwin/VTK
IO/Image/Testing/Python/dem.py
20
3326
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Create the RenderWindow, Renderer and both Actors # ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) iren = vtk.vtkRenderWindowInteractor() iren.SetR...
bsd-3-clause
-96,855,226,402,334,400
31.930693
79
0.687613
false
lehins/python-surveymonkey
surveymonkey/calls/batch.py
1
1109
from surveymonkey.calls.base import Call class Batch(Call): def __create_flow(self, survey, collector, email_message, **kwargs): params = { 'survey': survey, 'collector': collector, 'email_message': email_message } assert collector.get('type') == 'email...
mit
-6,408,821,891,557,262,000
32.606061
73
0.574391
false
DanielNeugebauer/adhocracy
src/adhocracy/migration/versions/046_fix_text_parent_child_column_naming.py
6
2255
from datetime import datetime from sqlalchemy import Column, ForeignKey, MetaData, Table from sqlalchemy import Boolean, DateTime, Integer, Unicode, UnicodeText metadata = MetaData() user_table = Table('user', metadata, Column('id', Integer, primary_key=True), Column('user_name', Unicode(255), nullable=False,...
agpl-3.0
1,588,460,459,063,501,800
41.54717
79
0.677605
false
Nazanin84/python-buildpack
vendor/pip-pop/docopt.py
283
19784
"""Pythonic command-line interface parser that will make you smile. * http://docopt.org * Repository and issue-tracker: https://github.com/docopt/docopt * Licensed under terms of MIT license (see LICENSE-MIT) * Copyright (c) 2013 Vladimir Keleshev, vladimir@keleshev.com """ import sys import re __all__ = ['doco...
mit
7,763,206,288,706,075,000
33.051635
79
0.55368
false
cbertinato/pandas
pandas/core/indexes/datetimelike.py
1
26175
""" Base and utility classes for tseries type pandas objects. """ import operator from typing import Set import warnings import numpy as np from pandas._libs import NaT, iNaT, lib from pandas._libs.algos import unique_deltas from pandas.compat.numpy import function as nv from pandas.errors import AbstractMethodError ...
bsd-3-clause
-352,390,605,143,302,400
32.049242
79
0.562942
false
tszym/ansible
lib/ansible/modules/cloud/centurylink/clc_firewall_policy.py
8
21465
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # 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.0', 'status': ['previe...
gpl-3.0
2,266,218,663,320,486,000
35.258446
119
0.59413
false
KyleJamesWalker/ansible
lib/ansible/module_utils/junos.py
16
6193
# # (c) 2017 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is ...
gpl-3.0
-4,797,991,373,635,834,000
35.216374
97
0.655579
false
aneeshusa/servo
tests/wpt/css-tests/tools/webdriver/webdriver/webelement.py
251
1846
"""Element-level WebDriver operations.""" import searchcontext class WebElement(searchcontext.SearchContext): """Corresponds to a DOM element in the current page.""" def __init__(self, driver, id): self._driver = driver self._id = id # Set value of mode used by SearchContext s...
mpl-2.0
5,367,122,255,993,439,000
31.964286
81
0.594258
false
xuyuhan/depot_tools
third_party/logilab/common/modutils.py
64
23589
# -*- coding: utf-8 -*- # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser Genera...
bsd-3-clause
-1,352,260,142,928,434,700
32.602564
97
0.616601
false
kthordarson/youtube-dl-ruv
test/helper.py
1
6495
from __future__ import unicode_literals import errno import io import hashlib import json import os.path import re import types import sys import youtube_dl.extractor from youtube_dl import YoutubeDL from youtube_dl.utils import ( compat_str, preferredencoding, write_string, ) def get_params(override=No...
unlicense
-4,118,610,588,946,411,500
34.491803
120
0.577059
false
arnfred/heroku-buildpack-python-hdf5-blas-lapack
vendor/pip-1.5.4/pip/_vendor/requests/packages/chardet/chardetect.py
743
1141
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from ...
mit
3,608,652,622,907,311,000
23.804348
71
0.585451
false
jamesls/boto
boto/ec2/securitygroup.py
13
13788
# Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011, Eucalyptus Systems, Inc. # # 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 # w...
mit
352,771,047,532,649,150
37.621849
100
0.532347
false
bmya/odoo_addons
smile_account_voucher_group/models/tools.py
3
1202
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Smile (<http://www.smile.fr>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
3,718,367,347,578,061,000
41.928571
98
0.627288
false
avanzosc/hr-addons
hr_timesheet_sheet_fix_analytic/tests/test_hr_timesheet_sheet_fix_analytic.py
1
2027
# Copyright 2021 Alfredo de la Fuente - AvanzOSC # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo.tests import common from odoo import fields @common.at_install(False) @common.post_install(True) class TestHrTimesheetSheetFixAnalytic(common.SavepointCase): @classmethod def setUp...
agpl-3.0
3,044,034,934,571,344,000
44.044444
71
0.613222
false
zhouhaibing089/kubernetes
cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py
67
71563
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 appli...
apache-2.0
-652,276,050,456,975,600
36.60536
79
0.647262
false
jmighion/ansible
lib/ansible/modules/cloud/amazon/ec2_vpc_route_table.py
7
25742
#!/usr/bin/python # # This is a 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. # # This Ansible library is distributed in the hope that i...
gpl-3.0
5,140,501,836,998,920,000
35.721826
149
0.605353
false
marcioreyes/bgui
bgui/text_input.py
6
15841
""" This module defines the following constants: *InputText options* * BGUI_INPUT_NONE = 0 * BGUI_INPUT_SELECT_ALL = 1 * BGUI_INPUT_DEFAULT = BGUI_INPUT_NONE """ from .widget import Widget, WeakMethod, BGUI_DEFAULT, BGUI_CENTERY, \ BGUI_NO_FOCUS, BGUI_MOUSE_ACTIVE, BGUI_MOUSE_CLICK, BGUI_MOUSE_RELEASE, \ BGUI_...
mit
154,883,202,945,003,600
30
163
0.639669
false
jrha/aquilon
lib/python2.6/aquilon/worker/commands/del_room.py
4
1168
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor # # 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...
apache-2.0
-122,462,412,068,436,780
37.933333
74
0.721747
false
hongzhouye/frankenstein
pyscf_be/pysd_atom.py
1
33331
""" PySCF-based Schmidt decomposition for Atom-based fragments """ import os import time import numpy as np import scipy.linalg as slg import h5py import multiprocessing as mtproc from pyscf import scf from frankenstein.pyscf_be.fragpart import PART from frankenstein.pyscf_be.pysd import (schmidt_decomposition_pyrh...
bsd-3-clause
4,580,412,976,564,243,000
33.865063
161
0.521917
false
vipmike007/tp-qemu
qemu/tests/rv_video.py
9
3710
""" rv_video.py - Starts video player Video is played in a loop, usually kill_app test should be called later to close totem. Requires: binaries Xorg, totem, gnome-session Test starts video player """ import logging import os import time import re from autotest.client.shared import error from virttest impo...
gpl-2.0
-6,327,869,515,297,191,000
28.919355
77
0.598113
false
yukchou/linux-sunxi-1
modules/wifi/ar6003/AR6kSDK.build_3.1_RC.514/host/tools/athbtfilter/bluez/testscripts/bthstereoheadset.py
185
1575
#!/usr/bin/python import dbus import os import sys def printusage(): print 'bthstereoheadset.py <options>' print ' create - create a stereo headset' print ' start - connect sink' print ' stop - disconnect sink' return headsetAddress = os.getenv("BTSTEREO_HEADSET") print 'BT Stereo Headset Is : =>...
gpl-2.0
538,701,764,831,347,900
31.142857
93
0.694603
false
timduru/platform-external-chromium_org
third_party/bintrees/bintrees/avltree.py
156
10803
#!/usr/bin/env python #coding:utf-8 # Author: mozman (python version) # Purpose: avl tree module (Julienne Walker's unbounded none recursive algorithm) # source: http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_avl.aspx # Created: 01.05.2010 # Copyright (c) 2010-2013 by Manfred Moitzi # License: MIT License ...
bsd-3-clause
-75,786,313,139,064,670
34.771523
95
0.535777
false
nidy86/rpy
Raspbian/sensors/ObservedDistanceSensor.py
1
2113
#Bibliotheken einbinden import sys sys.path += ['../util'] from Observer import Observer, Observable import RPi.GPIO as GPIO import time class ObservedDistanceSensor: def measure(self): # setze Trigger auf HIGH GPIO.output(self.GPIO_TRIGGER, True) # setze Trigger nach 0.01ms aus LOW time....
gpl-3.0
-5,664,428,688,548,342,000
27.554054
81
0.624704
false
alsrgv/tensorflow
tensorflow/contrib/slim/python/slim/data/parallel_reader.py
2
11673
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
5,361,549,806,258,835,000
35.823344
80
0.67549
false
Pikecillo/genna
external/PyXML-0.8.4/xml/sax/writer.py
10
18860
"""SAX document handlers that support output generation of XML, SGML, and XHTML. This module provides three different groups of objects: the actual SAX document handlers that drive the output, DTD information containers, and syntax descriptors (of limited public use in most cases). Output Drivers -------------- The...
gpl-2.0
-6,557,766,931,021,840,000
33.35337
84
0.512089
false
EdLogan18/logan-repository
plugin.video.SportsDevil/lib/utils/pyDes.py
54
32294
############################################################################# # Documentation # ############################################################################# # Author: Todd Whiteman # Date: 16th March, 2009 # Verion: 2.0.0 # License: Public Domain - free to d...
gpl-2.0
-5,865,539,242,076,980,000
36.85932
164
0.525887
false
dfc/beets
test/test_datequery.py
25
4999
# This file is part of beets. # Copyright 2015, Adrian Sampson. # # 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, ...
mit
-8,443,417,437,521,334,000
37.160305
77
0.661132
false
xyuanmu/XX-Net
python3.8.2/Lib/site-packages/pip/_internal/utils/setuptools_build.py
9
1239
import sys from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from typing import List # Shim to wrap setup.py invocation with setuptools # # We set sys.argv[0] to the path to the underlying setup.py file so # setuptools / distutils don't take the path to the setup.py to be "-c" when...
bsd-2-clause
-2,132,223,853,340,215,000
33.416667
77
0.664245
false
Akrog/cinder
cinder/tests/api/v1/test_volumes.py
1
48969
# Copyright 2013 Josh Durgin # 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 a...
apache-2.0
7,327,276,716,545,857,000
43.195848
79
0.473565
false
MaralAfris/wasp-summer-school-team6
drone/bebop_controller/src/drone_goal_publisher.py
2
4226
#! /usr/bin/env python import roslib import rospy from controller import Controller, ActionStatus from geometry_msgs.msg import PoseStamped from bebop_controller.msg import * from actionlib import SimpleActionClient from BebopActionServer import BebopActionServer from actionlib_msgs.msg import GoalStatus from geomet...
gpl-3.0
7,416,386,388,653,948,000
30.303704
89
0.660435
false
gitcoinco/web
app/kudos/router.py
1
4159
# -*- coding: utf-8 -*- """Define dashboard specific DRF API routes. Copyright (C) 2021 Gitcoin Core This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at yo...
agpl-3.0
-7,168,927,637,258,337,000
37.155963
118
0.680452
false
silvermagic/jhbuild
jhbuild/buildbot/scheduler.py
8
6235
# jhbuild - a tool to ease building collections of source packages # Copyright (C) 2008 Igalia S.L., John Carr, Frederic Peters # # scheduler.py: jhbuild jobs scheduler # # 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 # t...
gpl-2.0
4,046,943,192,214,382,000
35.040462
83
0.673937
false
jgraham/treeherder
tests/model/derived/sample_data_generator.py
5
3570
""" Functions for flexible generation of sample input job JSON. """ import json import os import time from datetime import timedelta def ref_data_json(): """Return reference data json structure""" filename = os.path.join( os.path.abspath(os.path.dirname(__file__)), "ref_data.json", ) ...
mpl-2.0
-4,947,558,363,537,895,000
21.45283
84
0.559104
false
nttks/jenkins-test
cms/djangoapps/contentstore/features/video_handout.py
116
1458
# -*- coding: utf-8 -*- # disable missing docstring # pylint: disable=missing-docstring from lettuce import world, step from nose.tools import assert_true # pylint: disable=no-name-in-module from video_editor import RequestHandlerWithSessionId, success_upload_file @step('I (?:upload|replace) handout file(?: by)? "(...
agpl-3.0
-6,746,711,688,057,167,000
35.45
75
0.696159
false
ironbox360/django
tests/absolute_url_overrides/tests.py
284
2007
from django.db import models from django.test import SimpleTestCase class AbsoluteUrlOverrideTests(SimpleTestCase): def test_get_absolute_url(self): """ get_absolute_url() functions as a normal method. """ get_absolute_url = lambda o: '/test-a/%s/' % o.pk TestA = self._cre...
bsd-3-clause
-1,941,860,541,104,460,500
36.166667
90
0.567514
false
RenaudParis/servo
tests/wpt/harness/wptrunner/browsers/__init__.py
134
1535
# 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/. """Subpackage where each product is defined. Each product is created by adding a a .py file containing a __wptrunner__ v...
mpl-2.0
-8,446,964,623,240,388,000
45.515152
81
0.674267
false
grazcoin/mastercoin-tools
msc_utils_general.py
1
6299
#!/usr/bin/python ####################################################### # # # Copyright Masterchain Grazcoin Grimentz 2013-2014 # # https://github.com/grazcoin/mastercoin-tools # # https://masterchain.info # # masterchain@@bitme...
agpl-3.0
-701,855,206,196,115,800
30.813131
107
0.576282
false
nwjs/chromium.src
chrome/test/data/nacl/gdb_rsp.py
42
2542
# 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. # This file is based on gdb_rsp.py file from NaCl repository. import re import socket import time def RspChecksum(data): checksum = 0 for char in ...
bsd-3-clause
4,385,175,717,224,698,000
28.55814
78
0.625098
false
robbiet480/home-assistant
homeassistant/components/slide/cover.py
16
3736
"""Support for Slide slides.""" import logging from homeassistant.components.cover import ( ATTR_POSITION, DEVICE_CLASS_CURTAIN, STATE_CLOSED, STATE_CLOSING, STATE_OPENING, CoverEntity, ) from homeassistant.const import ATTR_ID from .const import API, DEFAULT_OFFSET, DOMAIN, SLIDES _LOGGER =...
apache-2.0
-1,554,938,917,921,540,600
27.30303
86
0.585385
false
rschuitema/misra
src/misra/violation.py
1
1633
""" This module represents a violation against a MISRA guideline """ class Violation: """ Represents a violation against a MISRA guideline """ def __init__(self, file, line, column, guideline, entity): """ Construct a violation """ self.file = file self.line = line self.colum...
mit
4,806,067,160,347,858,000
24.515625
80
0.604409
false
wangshijin/cappuccino
Tools/XcodeCapp/XcodeCapp/Scripts/mod_pbxproj.py
18
43282
# Copyright 2012 Calvin Rien # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
lgpl-2.1
3,161,194,704,625,556,000
31.616428
165
0.516173
false
jskrzypek/flask-video-streaming
video_deque.py
1
2258
# video_deque.py from PIL import Image from fs.memoryfs import MemoryFS import fs.path import PIL import io import numpy as np import cv2 import collections import datetime import tempfile import string import random def id_generator(size=6, chars=string.ascii_uppercase + string.digits): return ''.join(random.choi...
mit
-2,061,917,987,864,352,300
37.288136
146
0.604517
false
diofeher/django-nfa
build/lib/django/utils/decorators.py
38
2464
"Functions that help with dynamically creating decorators for views." import types try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. def decorator_from_middleware(middleware_class): """ Given a middleware class (not an instance)...
bsd-3-clause
-7,271,748,172,839,885,000
39.393443
82
0.571834
false
sauloal/pycluster
pypy-1.9_64/lib-python/2.7/hashlib.py
110
5013
# $Id$ # # Copyright (C) 2005 Gregory P. Smith (greg@krypto.org) # Licensed to PSF under a Contributor Agreement. # __doc__ = """hashlib module - A common interface to many hash functions. new(name, string='') - returns a new hash object implementing the given hash function; initializing th...
mit
8,534,195,089,688,646,000
33.335616
84
0.63076
false
PermutaTriangle/PermStruct
scratch/test_avoiders_of_short_patterns.py
1
2398
import permstruct import permstruct.dag # Since we usually don't want overlays: overlays = False #------------------------------------------------# # Avoidance of one classical pattern of length 1 # As is expected the first dag suffices # perm_prop = lambda p: p.avoids([1]) # perm_bound = 6 # inp_dag ...
bsd-3-clause
-7,171,175,179,532,999,000
30.552632
63
0.466639
false
imsparsh/python-for-android
python3-alpha/python3-src/Lib/doctest.py
45
99902
# Module doctest. # Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org). # Major enhancements and refactoring by: # Jim Fulton # Edward Loper # Provided as-is; use at your own risk; no warranty; no promises; enjoy! r"""Module doctest -- a framework for running examples in docstrings. In...
apache-2.0
-9,036,667,427,432,604,000
36.444528
79
0.569468
false
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/boto/dynamodb/schema.py
185
3978
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011 Amazon.com, Inc. or its affiliates. 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 ...
agpl-3.0
7,755,349,026,253,261,000
34.517857
77
0.624937
false
elitak/catalyst
catalyst/base/stagebase.py
1
61101
import os import imp import shutil import sys from stat import ST_UID, ST_GID, ST_MODE # for convienience pjoin = os.path.join from snakeoil import fileutils from DeComp.compress import CompressMap from catalyst import log from catalyst.defaults import (SOURCE_MOUNT_DEFAULTS, TARGET_MOUNT_DEFAULTS, PORT_LOGDIR_CL...
gpl-2.0
-7,382,797,089,213,937,000
35.521817
99
0.673606
false
translate/virtaal
virtaal/views/widgets/label_expander.py
6
2409
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008-2009 Zuza Software Foundation # # This file is part of Virtaal. # # 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 ...
gpl-2.0
-3,162,978,372,954,564,000
30.285714
115
0.648402
false
arbrandes/edx-platform
lms/djangoapps/ccx/migrations/0001_initial.py
4
1564
from django.conf import settings from django.db import migrations, models from opaque_keys.edx.django.models import CourseKeyField, UsageKeyField class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations...
agpl-3.0
-5,991,413,903,069,181,000
38.1
114
0.588235
false
brchiu/tensorflow
tensorflow/contrib/util/loader.py
41
2063
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
5,972,312,178,912,752,000
34.568966
80
0.697043
false
user-none/calibre
src/calibre/devices/mtp/filesystem_cache.py
14
8300
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
gpl-3.0
1,260,070,799,171,838,000
32.067729
97
0.552892
false
Foxboron/stem
test/integ/socket/control_message.py
4
7048
""" Integration tests for the stem.response.ControlMessage class. """ import re import unittest import stem.socket import stem.version import test.runner class TestControlMessage(unittest.TestCase): def test_unestablished_socket(self): """ Checks message parsing when we have a valid but unauthenticated so...
lgpl-3.0
6,126,344,353,729,385,000
39.274286
120
0.68672
false
UK992/servo
tests/wpt/web-platform-tests/tools/third_party/pywebsocket3/example/echo_wsh.py
21
2214
# Copyright 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...
mpl-2.0
8,823,437,605,972,575,000
39.254545
79
0.736224
false
satyarth934/root
interpreter/llvm/src/tools/clang/docs/analyzer/conf.py
20
8070
# -*- coding: utf-8 -*- # # Clang Static Analyzer documentation build configuration file, created by # sphinx-quickstart on Wed Jan 2 15:54:28 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated...
lgpl-2.1
-6,442,979,816,429,362,000
31.672065
80
0.708426
false
rvalyi/geraldo
site/newsite/site-geraldo/appengine_django/management/commands/testserver.py
15
2414
#!/usr/bin/python2.4 # # Copyright 2008 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...
lgpl-3.0
-1,528,324,384,557,000,200
33
79
0.713753
false
annarev/tensorflow
tensorflow/python/ops/linalg/inverse_registrations.py
18
9206
# Copyright 2018 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
8,180,400,820,280,875,000
39.915556
80
0.728003
false
lucidbard/curveship
fiction/artmaking.py
3
2031
'Artmaking, a tiny demonstration game for Curveship.' __author__ = 'Nick Montfort' __copyright__ = 'Copyright 2011 Nick Montfort' __license__ = 'ISC' __version__ = '0.5.0.0' from item_model import Actor, Room, Thing from action_model import Modify, Sense import can import when discourse = { 'metadata': { ...
isc
-7,257,453,192,477,348,000
29.772727
80
0.567208
false
timsavage/denim
tests/service/supervisor.py
1
1880
from denim.constants import RootUser from tests._utils import ApiTestCase from denim.service import supervisor class TestServiceSupervisor(ApiTestCase): def test_manager_start(self): supervisor.manager_start() self.assertSudo('/etc/init.d/supervisor start', user=RootUser) def test_manager_st...
bsd-2-clause
-1,645,217,928,680,244,500
27.484848
76
0.689894
false
jrossyra/adaptivemd
adaptivemd/engine/openmm/openmm.py
1
10478
############################################################################## # adaptiveMD: A Python Framework to Run Adaptive Molecular Dynamics (MD) # Simulations on HPC Resources # Copyright 2017 FU Berlin and the Authors # # Authors: Jan-Hendrik Prinz # Contributors: # # `adaptiveMD` is free software: ...
lgpl-2.1
8,730,990,321,945,351,000
33.354098
122
0.56967
false
robotframework/mabot
lib/robot/result/executionresult.py
3
2450
# Copyright 2008-2012 Nokia Siemens Networks Oyj # # 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...
apache-2.0
7,935,160,737,780,701,000
32.108108
75
0.682041
false
Fedik/gramps
gramps/gen/filters/rules/person/_nevermarried.py
5
1744
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # 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 you...
gpl-2.0
-2,088,388,899,893,549,800
36.106383
79
0.540711
false
jetskijoe/headphones
lib/beetsplug/embyupdate.py
1
4090
# -*- coding: utf-8 -*- """Updates the Emby Library whenever the beets library is changed. emby: host: localhost port: 8096 username: user password: password """ from __future__ import division, absolute_import, print_function from beets import config from beets.plugins import Bee...
gpl-3.0
-8,300,819,592,050,336,000
28.854015
79
0.594377
false
emop/task-worker
src/python/Sailing/src/sailing/webrobot/captcha/http_client.py
4
4971
# -*- coding: utf-8 -*- import urllib2, httplib, cookielib import StringIO import gzip from urlparse import urlparse import logging import socket import os import urllib import time import re # timeout in seconds timeout = 10 socket.setdefaulttimeout(timeout) class HTTPClient(object): def __init__(self, ww...
bsd-2-clause
7,528,645,298,778,845,000
31.064516
100
0.486013
false
shanthanpalle/myRIOTEx
tests/nativenet/tests/01-tests.py
28
1196
#! /usr/bin/env python import sys from pexpect import spawn if __name__ == "__main__": try: if len(sys.argv) > 1: expected_received = int(sys.argv[1]) else: expected_received = 5 except TypeError: sys.stderr.write("Usage: "+str(sys.argv[0])+" [<expected 'receive...
lgpl-2.1
5,424,143,591,594,447,000
30.473684
81
0.635452
false
colpain/NeuralDecoding
config/global_config.py
1
1910
import os, json cur_dir = os.path.dirname(__file__) project_root = os.path.join(cur_dir, '..') CONFIG_PATH = os.path.join(project_root, 'config') PIPELINE_CONFIG_PATH = os.path.join(CONFIG_PATH, 'experiment_config.json') class _pipeline_config(object): def __init__(self): self._config = json.load(open(...
apache-2.0
21,341,941,576,494,864
27.954545
77
0.635079
false
OLAPLINE/TM1py
Tests/Hierarchy.py
1
15829
import configparser from pathlib import Path import unittest from TM1py import Element from TM1py.Objects import Dimension, Hierarchy, Subset from TM1py.Services import TM1Service config = configparser.ConfigParser() config.read(Path(__file__).parent.joinpath('config.ini')) DIMENSION_PREFIX = 'TM1py_Tests_Hierarchy_...
mit
1,857,865,051,518,007,000
41.665768
113
0.655253
false
opoplawski/fedmsg_meta_fedora_infrastructure
fedmsg_meta_fedora_infrastructure/tests/mm2.py
5
8036
# This file is part of fedmsg. # Copyright (C) 2012 Red Hat, Inc. # # fedmsg 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 option) any later version. #...
lgpl-2.1
-2,828,545,168,942,682,000
36.203704
79
0.599428
false