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
Hasimir/pyjs
pyjswidgets/pyjamas/ui/DragWidget.py
9
3080
# Copyright (C) 2010 Jim Washington # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
-772,960,283,447,689,900
29.49505
78
0.695779
false
c960657/dd-agent
tests/core/test_wmi.py
1
28021
# pylint: disable=E0401 # stdlib from functools import partial import logging import time import unittest # 3rd from mock import Mock, patch # project from tests.checks.common import Fixtures from utils.timeout import TimeoutException log = logging.getLogger(__name__) WMISampler = None def load_fixture(f, args=N...
bsd-3-clause
1,308,104,610,086,114,800
36.561662
171
0.603048
false
pombredanne/pants
src/python/pants/option/options_bootstrapper.py
13
8660
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import itertools imp...
apache-2.0
-770,891,687,504,048,600
45.06383
113
0.663857
false
barthisrael/OmniDB
OmniDB/OmniDB_app/include/OmniDatabase/Oracle.py
2
69309
''' The MIT License (MIT) Portions Copyright (c) 2015-2019, The OmniDB Team Portions Copyright (c) 2017-2019, 2ndQuadrant Limited 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 restricti...
mit
-7,605,886,198,247,150,000
50.492571
404
0.543508
false
miing/mci_migo_packages_gargoyle
gargoyle/signals.py
9
2918
import django.dispatch #: This signal is sent when a switch is added (similar to Django's post_save, when #: created is True). #: #: Example subscriber:: #: #: def switch_added_callback(sender, request, switch, **extra): #: logging.debug('Switch was added: %r', switch.label) #: #: from gargoyle.sign...
apache-2.0
6,150,923,653,719,783,000
41.289855
108
0.701851
false
SnakeJenny/TensorFlow
tensorflow/contrib/distributions/python/ops/distribution.py
7
37518
# 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
-4,690,143,953,237,497,000
33.771084
80
0.657738
false
oconnor663/fbmessenger
fbmessenger/external.py
1
12462
import webbrowser import json import inspect import time from PyQt4 import QtCore from . import network from . import settings from . import mqtt from . import event from . import windows from . import application # methods on the external object with this decorator are exposed to js def external_decorator(*types, **...
bsd-3-clause
3,648,775,770,253,928,400
30.714286
79
0.646236
false
ProjectSWGCore/NGECore2
scripts/mobiles/generic/faction/rebel/rebel_comm_op_14.py
2
1514
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from resources.datatables import FactionStatus from java.util import Vector def addTemplate(cor...
lgpl-3.0
-2,672,664,742,178,986,500
35.071429
125
0.830251
false
gdestuynder/mozdef_lib
mozdef.py
1
5872
#!/usr/bin/env python # 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/. # Copyright (c) 2014 Mozilla Corporation # Author: gdestuynder@mozilla.com import os import sys i...
mpl-2.0
4,901,658,105,695,021,000
37.12987
187
0.606097
false
juhuntenburg/pipelines
src/lsd_lemon/struct_preproc/mgzconvert.py
2
4856
from nipype.pipeline.engine import Node, Workflow import nipype.interfaces.utility as util import nipype.interfaces.io as nio import nipype.interfaces.freesurfer as fs import nipype.interfaces.fsl as fsl import os ''' Workflow to extract relevant output from freesurfer directory ''' def create_mgzconvert_pipeline(na...
mit
1,885,589,200,310,871,300
41.982301
93
0.474053
false
openstack/networking-mlnx
tools/i18n_cfg.py
3
3451
import compiler import re def is_log_callfunc(n): """LOG.xxx('hello %s' % xyz) and LOG('hello')""" if isinstance(n.parent, compiler.ast.Mod): n = n.parent if isinstance(n.parent, compiler.ast.CallFunc): if isinstance(n.parent.node, compiler.ast.Getattr): if isinstance(n.parent....
apache-2.0
5,156,303,838,976,201,000
34.947917
74
0.587076
false
edulramirez/nova
nova/tests/unit/virt/vmwareapi/test_volumeops.py
11
25449
# 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
1,792,248,067,057,657,600
48.129344
79
0.567724
false
ypwalter/evennia
evennia/contrib/tutorial_world/mob.py
6
15701
""" This module implements a simple mobile object with a very rudimentary AI as well as an aggressive enemy object based on that mobile class. """ import random from evennia import TICKER_HANDLER from evennia import search_object from evennia import Command, CmdSet from evennia import logger from evennia.contrib.tut...
bsd-3-clause
6,176,525,833,461,609,000
36.742788
112
0.596077
false
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/services/librarianserver/tests/test_storage_db.py
1
4704
# Copyright 2009 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). import hashlib import shutil import tempfile import unittest from lp.services.database.sqlbase import flush_database_updates from lp.services.librarian.model import LibraryFileCon...
agpl-3.0
-1,992,719,405,499,964,400
34.908397
79
0.659439
false
chokribr/inveniotest
modules/webcomment/lib/webcomment_templates.py
15
133802
# -*- coding: utf-8 -*- ## Comments and reviews for records. ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 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 ...
gpl-2.0
-5,415,654,279,626,427,000
51.491173
575
0.491009
false
TetraAsh/baruwa2
baruwa/lib/auth/ldapauth.py
1
7566
# -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 # Baruwa - Web 2.0 MailScanner front-end. # Copyright (C) 2010-2012 Andrew Colin Kissa <andrew@topdog.za.net> # # 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 S...
gpl-3.0
-2,175,941,710,540,414,500
38
77
0.52194
false
robertwb/incubator-beam
sdks/python/apache_beam/runners/dataflow/dataflow_metrics.py
5
12979
# # 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 us...
apache-2.0
1,315,063,799,518,377,000
38.570122
80
0.682718
false
Titosoft/ferry-boat
web2py/gluon/tests/test_utils.py
18
1269
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Unit tests for utils.py """ import sys import os import unittest def fix_sys_path(): """ logic to have always the correct sys.path '', web2py/gluon, web2py/site-packages, web2py/ ... """ def add_path_first(path): sys.path = [path] + [p ...
mit
-4,610,418,095,572,131,300
23.403846
66
0.55792
false
cysuncn/python
spark/crm/PROC_A_R_INCOME_TOP.py
1
7897
#coding=UTF-8 from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext from pyspark.sql.types import * from datetime import date, datetime, timedelta import sys, re, os st = datetime.now() conf = SparkConf().setAppName('PROC_A_R_INCOME_TOP').setMaster(sys.argv[2]) sc = SparkContext(conf = conf) sc.set...
gpl-3.0
4,919,568,110,676,388,000
38.871134
172
0.523465
false
romain-dartigues/ansible
lib/ansible/modules/system/service_facts.py
7
9295
#!/usr/bin/python # (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # originally copied from AWX's scan_services module to bring this functionality # into Core from __future__ import absolute_import, division, print_function __metaclass__ = type ...
gpl-3.0
-5,845,405,428,721,974,000
38.892704
150
0.555675
false
jbenden/ansible
lib/ansible/modules/cloud/rackspace/rax_mon_notification_plan.py
8
5674
#!/usr/bin/python # Copyright: Ansible Project # 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': ['preview'], ...
gpl-3.0
-1,263,496,684,988,052,700
31.056497
104
0.61491
false
insiderr/insiderr-app
ios-patches/basemodules/twisted/names/test/test_names.py
4
37675
# -*- test-case-name: twisted.names.test.test_names -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for twisted.names. """ import socket, operator, copy from StringIO import StringIO from functools import partial, reduce from twisted.trial import unittest from twisted.inte...
gpl-3.0
8,037,446,241,315,203,000
35.087165
110
0.593842
false
gamechanger/kafka-python
test/test_client_async.py
1
8085
import time import pytest from kafka.client_async import KafkaClient from kafka.common import BrokerMetadata import kafka.common as Errors from kafka.conn import ConnectionStates from kafka.future import Future from kafka.protocol.metadata import MetadataResponse, MetadataRequest from kafka.protocol.produce import Pr...
apache-2.0
-6,498,337,683,652,845,000
25.95
79
0.671614
false
tadeo/django-localflavor-uy
tests/tests.py
14
2030
from __future__ import unicode_literals from django.contrib.localflavor.uy.forms import UYDepartamentSelect, UYCIField from django.contrib.localflavor.uy.util import get_validation_digit from django.test import SimpleTestCase class UYLocalFlavorTests(SimpleTestCase): def test_UYDepartmentSelect(self): f...
bsd-3-clause
1,419,349,010,218,286,300
37.301887
95
0.648768
false
usc-isi/nova
nova/network/minidns.py
19
6184
# Copyright 2011 Andrew Bogott for the Wikimedia Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
5,953,969,610,956,320,000
33.741573
78
0.560317
false
bdyetton/prettychart
framework/sessions/__init__.py
5
5928
# -*- coding: utf-8 -*- import furl import urllib import urlparse import bson.objectid import httplib as http import itsdangerous from werkzeug.local import LocalProxy from weakref import WeakKeyDictionary from flask import request, make_response from framework.flask import redirect from website import settings fr...
apache-2.0
-9,171,792,291,571,134,000
30.870968
103
0.659413
false
BBN-Q/QGL
QGL/mm.py
1
1200
''' Taken from Guido van Rossum's Five-Minute MultiMethods in Python http://www.artima.com/weblogs/viewpost.jsp?thread=101605 Examples: from mm import multimethod @multimethod(int, int) def foo(a, b): ...code for two ints... @multimethod(float, float): def foo(a, b): ...code for two floats... @multimethod(s...
apache-2.0
-2,178,630,334,399,662,300
22.529412
79
0.611667
false
beav/pulp
server/pulp/server/webservices/serialization/link.py
3
2631
# -*- coding: utf-8 -*- # # Copyright © 2011 Red Hat, Inc. # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or impli...
gpl-2.0
-6,191,462,820,066,760,000
27.27957
80
0.656274
false
vmrob/needy
needy/filesystem.py
3
4963
import os import shutil import signal import tempfile import time import json import hashlib from contextlib import contextmanager O_BINARY = getattr(os, 'O_BINARY', 0) class TempDir: def __enter__(self): self.__path = tempfile.mkdtemp() return self.__path def __exit__(self, etype, value, t...
mit
-5,261,998,540,726,239,000
27.198864
157
0.603869
false
ryanmockabee/golfr
flask/lib/python3.6/site-packages/py/_path/common.py
4
14844
""" """ import os, sys, posixpath import fnmatch import py # Moved from local.py. iswin32 = sys.platform == "win32" or (getattr(os, '_name', False) == 'nt') try: from os import fspath except ImportError: def fspath(path): """ Return the string representation of the path. ...
mit
7,387,646,999,960,025,000
31.357303
82
0.518795
false
rmdort/clipper
integration-tests/deploy_pyspark_pipeline_models.py
2
7133
from __future__ import absolute_import, print_function import os import sys import requests import json import numpy as np cur_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, os.path.abspath("%s/.." % cur_dir)) from clipper_admin import Clipper import time import subprocess32 as subprocess import pp...
apache-2.0
-7,384,065,327,407,390,000
33.795122
93
0.537922
false
pschmitt/home-assistant
tests/components/deconz/test_binary_sensor.py
7
6569
"""deCONZ binary sensor platform tests.""" from copy import deepcopy from homeassistant.components import deconz import homeassistant.components.binary_sensor as binary_sensor from homeassistant.components.binary_sensor import ( DEVICE_CLASS_MOTION, DEVICE_CLASS_VIBRATION, ) from homeassistant.setup import asy...
apache-2.0
9,143,226,111,737,400,000
34.701087
86
0.658091
false
ctogle/chunktagger
model.py
1
10733
import torch import numpy,functools,os,time,pdb import util class MultiTagger(torch.nn.Module): '''Tagger applies an RNN (LSTM or GRU) module and a Linear module in sequence to an embedded sentence. It uses a concatenated hidden layer to perform multiple tagging operations that share some depen...
mit
7,804,109,910,510,477,000
42.453441
82
0.611665
false
Aravinthu/odoo
addons/account_asset/wizard/asset_depreciation_confirmation_wizard.py
16
1186
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ class AssetDepreciationConfirmationWizard(models.TransientModel): _name = "asset.depreciation.confirmation.wizard" _description = "asset.depreciation.confirmation.wizard"...
agpl-3.0
-2,867,502,352,904,528,000
42.925926
196
0.633221
false
Orav/kbengine
kbe/res/scripts/common/Lib/codecs.py
2
37066
""" codecs -- Python Codec Registry, API and helpers. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" import builtins, sys ### Registry and builtin stateless codec functions try: from _codecs import * except ImportError as why: ...
lgpl-3.0
-960,728,129,426,200,400
31.392793
80
0.595991
false
Nexenta/cinder
cinder/db/sqlalchemy/migrate_repo/versions/046_cinder_init.py
2
22266
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
8,879,879,885,424,088,000
37.790941
79
0.579673
false
shadowmint/nwidget
lib/cocos2d-0.5.5/cocos/audio/pygame/__init__.py
1
3182
## pygame - Python Game Library ## Copyright (C) 2000-2001 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License...
apache-2.0
1,151,745,897,005,244,400
32.967033
79
0.662476
false
sunqm/pyscf
pyscf/fci/direct_spin1_symm.py
1
19417
#!/usr/bin/env python # Copyright 2014-2021 The PySCF Developers. 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 # # U...
apache-2.0
-4,856,479,504,770,219,000
39.964135
93
0.600762
false
mercycorps/TolaActivity
scripts/workflow_migration.py
1
2604
from django.apps import apps from django import db from django.db import connection app_models = apps.get_app_config('workflow').get_models() #rename the app tables from the old activitydb to workflow def run(): print "Migration" for app in app_models: name = str(app._meta.db_table) new_app...
apache-2.0
3,096,823,763,160,694,300
35.676056
122
0.596006
false
podemos-info/odoo
addons/warning/warning.py
4
11746
# -*- 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
-4,550,563,518,757,324,000
43.157895
224
0.583773
false
jaruba/chromium.src
chrome/common/extensions/docs/server2/platform_bundle_test.py
34
4427
#!/usr/bin/env python # 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 json import unittest from extensions_paths import CHROME_API, CHROME_EXTENSIONS from mock_file_system import MockFileSystem fro...
bsd-3-clause
-7,554,844,200,217,460,000
27.934641
80
0.567879
false
broferek/ansible
test/units/modules/remote_management/lxca/test_lxca_nodes.py
21
4734
import json import pytest from units.compat import mock from ansible.modules.remote_management.lxca import lxca_nodes from ansible.module_utils.remote_management.lxca.common import setup_conn from ansible.module_utils.remote_management.lxca.common import close_conn @pytest.fixture(scope='module') @mock.patch("ansibl...
gpl-3.0
5,852,063,080,410,095,000
47.306122
98
0.546895
false
mgraupe/acq4
acq4/util/generator/SeqParamSet.py
4
6918
import acq4.util.units as units from acq4.pyqtgraph.parametertree.parameterTypes import SimpleParameter, GroupParameter import acq4.pyqtgraph as pg import numpy as np import acq4.util.functions as fn import sys, collections class SequenceParamSet(GroupParameter): ## top-level parameter in the simple stim generato...
mit
-6,556,013,341,453,065,000
35.797872
109
0.500867
false
kerimlcr/ab2017-dpyo
ornek/lollypop/lollypop-0.9.229/src/loader.py
1
1995
# Copyright (c) 2014-2016 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 vers...
gpl-3.0
-5,487,275,079,339,246,000
34.625
76
0.637093
false
onyb/dune
runapiserver.py
1
2003
from core.api import API from core.exceptions import * from core.utils.Colorize import Colorize from core.utils.check_sanity import * def main(): # Order of checks is important checks = [ ( check_environment, 'Check current shell environment', OPAMConfigurationError...
apache-2.0
1,031,202,060,903,405,700
23.426829
113
0.480779
false
jcoady9/youtube-dl
youtube_dl/extractor/chirbit.py
4
2804
# coding: utf-8 from __future__ import unicode_literals import base64 from .common import InfoExtractor from ..utils import parse_duration class ChirbitIE(InfoExtractor): IE_NAME = 'chirbit' _VALID_URL = r'https?://(?:www\.)?chirb\.it/(?:(?:wp|pl)/|fb_chirbit_player\.swf\?key=)?(?P<id>[\da-zA-Z]+)' _TES...
unlicense
-5,642,764,742,923,788,000
30.155556
112
0.516405
false
sachitanandpandey/sos_spandey
sos/plugins/i18n.py
5
1102
# 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 that it will be useful, # but...
gpl-2.0
-949,272,584,213,583,700
33.4375
72
0.705989
false
ict-felix/stack
ofam/src/src/ext/geni/util/cred_util.py
3
15129
#---------------------------------------------------------------------- # Copyright (c) 2010 Raytheon BBN Technologies # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restriction, including witho...
apache-2.0
-9,199,270,352,480,334,000
44.984802
250
0.63375
false
schoonc/AutobahnPython
examples/twisted/wamp/rpc/slowsquare/frontend.py
8
2561
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with...
mit
-8,066,680,149,916,182,000
33.608108
79
0.639984
false
dargor/python-guess-random-color
Color.py
1
2444
# # Copyright (c) 2016, Gabriel Linder <linder.gabriel@gmail.com> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS"...
isc
-5,656,948,300,875,733,000
32.479452
79
0.550327
false
jgors/duecredit
duecredit/io.py
1
11094
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the duecredit package for the # copyright and license terms. # # ## ### ...
bsd-2-clause
7,645,720,196,949,251,000
35.019481
112
0.570669
false
mlassnig/pilot
HPC/Logger.py
3
1403
import logging import inspect import sys import time loggerMap = {} class Logger: def __init__(self, filename=None): # get logger name frm = inspect.stack()[1] mod = inspect.getmodule(frm[0]) if mod == None or mod.__name__ == '__main__': modName = 'main' else: ...
apache-2.0
2,124,790,224,044,881,700
26.509804
118
0.528154
false
PyCQA/pylint
pylint/utils/pragma_parser.py
1
4771
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE import re from collections import namedtuple from typing import Generator, List # Allow stopping after the first semicolon/hash encountered, # so that an option can be cont...
gpl-2.0
-1,107,622,985,180,464,500
35.060606
102
0.618277
false
pyrocko/pyrocko
src/gf/seismosizer.py
1
122659
# http://pyrocko.org - GPLv3 # # The Pyrocko Developers, 21st Century # ---|P------/S----------~Lg---------- from __future__ import absolute_import, division, print_function from collections import defaultdict from functools import cmp_to_key import time import math import os import re import logging try: import r...
gpl-3.0
-5,835,698,615,705,234,000
30.362567
79
0.553282
false
NuAvatar/clandmark
python_interface/bin/flandmark_demo.py
6
2152
import numpy as np import os from fnmatch import fnmatch from py_flandmark import PyFlandmark from PIL import Image import ImageDraw import matplotlib.pyplot as plt def rgb2gray(rgb): """ converts rgb array to grey scale variant accordingly to fomula taken from wiki (this function is missing in python) """ ret...
gpl-3.0
3,724,801,805,660,801,500
22.659341
74
0.659851
false
drufat/vispy
examples/basics/gloo/gpuimage.py
18
3260
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2015, Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # -------------------------------------------------------------------------...
bsd-3-clause
5,532,328,391,086,270,000
27.596491
79
0.441718
false
robbiet480/home-assistant
homeassistant/components/plum_lightpad/light.py
7
7199
"""Support for Plum Lightpad lights.""" import asyncio import logging from typing import Callable, List from plumlightpad import Plum from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, LightEntity, ) from homeassistant.config_entries imp...
apache-2.0
7,733,603,410,718,055,000
28.747934
82
0.605501
false
ncss-tech/geo-pit
alena_tools/desktop__V_tools/Generate_Regional_Transactional_Region_11_FGDB_old.py
1
50030
# Create_Regional_Transactional_FGDB # # 1/16/2014 # # Adolfo Diaz, Region 10 GIS Specialist # USDA - Natural Resources Conservation Service # Madison, WI 53719 # adolfo.diaz@wi.usda.gov # 608.662.4422 ext. 216 # # # Beginning of Functions ## =================================================================...
gpl-2.0
-6,511,425,020,220,025,000
43.440509
200
0.593824
false
tectronics/hop
src/contrib/hod/hodlib/Hod/hadoop.py
15
27500
#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 use thi...
apache-2.0
4,332,073,597,946,133,500
35.912752
108
0.561164
false
evensonbryan/yocto-autobuilder
lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/steps/source/mercurial.py
4
13211
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
2,912,840,854,916,584,000
38.085799
94
0.550753
false
jianghuaw/nova
nova/policies/extended_availability_zone.py
2
1272
# Copyright 2016 Cloudbase Solutions Srl # 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 r...
apache-2.0
8,420,198,627,852,604,000
28.581395
78
0.636006
false
Lujeni/ansible
lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager.py
16
20913
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
-4,554,732,298,482,910,000
32.676329
138
0.647827
false
111t8e/h2o-2
py/testdir_single_jvm/test_import_file.py
9
2415
import unittest, time, sys sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i import time, random print "This tries to mimic the use of the file pathname with ImportFile like R does" print "Normally the python tests import the folder first, using h2o_import.import_parse(...
apache-2.0
-9,109,593,050,737,356,000
37.951613
102
0.558178
false
caisq/tensorflow
tensorflow/contrib/optimizer_v2/checkpointable_utils_test.py
8
33376
# 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,735,191,202,764,980,000
43.148148
82
0.663651
false
philrosenfield/TPAGB-calib
tpagb_code_in_parallel.py
1
7093
from IPython import parallel import time import matplotlib.pyplot as plt import numpy as np import sfh_tests_multi_proc as sfh_tests import ResolvedStellarPops as rsp import stats import model_plots from data_plots import plot_cum_sum_sfr, plot_cmd_lf def caller(vSFH, vsfh_kws): return vSFH.vary_the_SFH(**vsfh_kws...
bsd-3-clause
2,563,227,966,874,228,700
38.187845
92
0.559707
false
ionelmc/python-stampede
tests/helper.py
1
1491
import logging import os import sys import time from stampede import StampedeWorker try: from pytest_cov.embed import cleanup os._exit = lambda code, original=os._exit: cleanup() or original(code) except ImportError: pass PATH = '/tmp/stampede-tests' class MockedStampedeWorker(StampedeWorker): ala...
bsd-2-clause
-795,992,656,746,797,400
27.673077
89
0.604963
false
rarsan/azure-quickstart-templates
bosh-setup/scripts/setup_env.py
19
11054
#!/usr/bin/env python import json import netaddr import os import random import re import requests import sys import ruamel.yaml import base64 from azure.storage.blob import AppendBlobService from azure.storage.table import TableService import azure.mgmt.network from azure.common.credentials import ServicePrincipalCre...
mit
-7,124,612,768,369,966,000
37.381944
163
0.635697
false
apache/beam
sdks/python/apache_beam/io/gcp/datastore/v1new/query_splitter_test.py
5
9623
# # 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 us...
apache-2.0
3,151,941,264,413,542,400
35.729008
85
0.666736
false
wendlers/usherpa-pysherpa
example-src/uSherpaAnalogRead.py
1
1755
## # This file is part of the uSherpa Python Library project # # Copyright (C) 2012 Stefan Wendler <sw@kaltpost.de> # # The uSherpa Python Library 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; eithe...
lgpl-2.1
-2,108,981,335,989,746,700
24.808824
76
0.702564
false
MSMBA/msmba-workflow
msmba-workflow/srclib/wax/examples/trayicon1.py
1
1923
# trayicon1.py # Based on wxPython example at http://norfolkgraphics.com/python.php from wax import * class MainFrame(Frame): def Body(self): self.tbicon = TaskBarIcon() self.status = 0 self.UpdateIcon() self.tbicon.OnLeftDoubleClick = self.RestoreWindow self.tbicon.OnRig...
gpl-2.0
3,469,310,579,633,343,000
25.708333
75
0.593864
false
x75/smq
smq/utils.py
1
4882
"""smq util functions""" import time import numpy as np from collections import OrderedDict def get_items(items_conf): """generic function creating a list of objects from a config specification objects are: analyses, robots, worlds, tasks, losses, ... """ items = [] for i, item_conf in enumerate(i...
mit
-6,850,227,168,475,064,000
33.380282
121
0.571897
false
pyconau2017/symposion
symposion/proposals/templatetags/proposal_tags.py
8
2220
from django import template from symposion.proposals.models import AdditionalSpeaker register = template.Library() class AssociatedProposalsNode(template.Node): @classmethod def handle_token(cls, parser, token): bits = token.split_contents() if len(bits) == 3 and bits[1] == "as": ...
bsd-3-clause
-7,021,176,226,636,613,000
29.833333
88
0.638739
false
deuscoin-org/deuscoin-core
qa/rpc-tests/proxy_test.py
1
8199
#!/usr/bin/env python2 # Copyright (c) 2015 The Deuscoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import socket from test_framework.socks5 import Socks5Configuration, Socks5Command, Socks5Server, AddressType...
mit
-6,866,753,585,878,837,000
42.152632
146
0.610928
false
arielalmendral/ert
python/python/ert_gui/ide/keywords/ensemble_keywords.py
5
6515
from ert_gui.ide.keywords.definitions import IntegerArgument, KeywordDefinition, ConfigurationLineDefinition, PathArgument, StringArgument class EnsembleKeywords(object): def __init__(self, ert_keywords): super(EnsembleKeywords, self).__init__() self.group = "Ensemble" ert_keywords.addKey...
gpl-3.0
-2,240,770,293,560,839,000
47.259259
138
0.465234
false
alexforencich/python-ivi
ivi/agilent/agilent8593A.py
2
1518
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2013-2017 Alex Forencich 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...
mit
5,837,321,742,123,896,000
35.142857
77
0.758235
false
kaiCu/mapproxy
mapproxy/test/system/test_tms.py
5
10944
# This file is part of the MapProxy project. # Copyright (C) 2010-2012 Omniscale <http://omniscale.de> # # 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/LI...
apache-2.0
8,842,133,026,679,673,000
43.307692
100
0.572186
false
v-samodelkin/TowerDefence
Info.py
1
2772
# -*- coding: utf8 -*- import TowerDefenceController as Tdc def shell(number, target): if number == target: return "[{0}]".format(number) else: return " {0} ".format(number) def get_editor_readme(target): readme = ["Управление\n", shell('1', target) + " - пустая клетка\n", ...
mit
4,161,223,196,234,994,000
30.097561
66
0.379216
false
odoousers2014/LibrERP
sale_bom/sale_mrp.py
1
8598
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (c) 2013-2014 Didotech srl (info at didotech.com) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
4,000,021,663,064,934,400
48.988372
155
0.522796
false
rafirosenberg/pinry
pinry/core/tests/helpers.py
2
2779
from django.conf import settings from django.contrib.auth.models import Permission from django.core.files.images import ImageFile from django.db.models.query import QuerySet from django.test import TestCase from django_images.models import Thumbnail import factory from taggit.models import Tag from ..models import Pi...
bsd-2-clause
-567,018,051,069,702,000
29.877778
102
0.68082
false
a10networks/a10sdk-python
a10sdk/core/cgnv6/cgnv6_lsn_health_check_gateway.py
2
1452
from a10sdk.common.A10BaseClass import A10BaseClass class HealthCheckGateway(A10BaseClass): """Class Description:: Configure LSN health-check gateway. Class health-check-gateway supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.`...
apache-2.0
-3,744,487,415,763,063,300
35.3
168
0.637741
false
schef/schef.github.io
source/16/mc-16-01-06-amajor-1black.py
1
1753
#!/usr/bin/python3 #import time import random import imp modl = imp.load_source('ppFunctions', '../00/ppFunctions.py') logo = imp.load_source('logo', '../00/logo.py') import os from ppFunctions import * from termcolor import colored, cprint os.system('clear') from logo import * #sleep becouse of loading midi modules pr...
mit
9,182,928,115,827,582,000
27.737705
70
0.589276
false
caiofsouza/AddLibrary
AddLibrary.py
1
8436
import sublime, sublime_plugin import os, re import threading import json from .Libraries import Libraries try: from urllib.request import urlopen, Request except ImportError: from urllib2 import urlopen, URLError def downloadLib(folder, lib): settings = sublime.load_settings("AddLibrary.sublime-settings") defa...
mit
-6,707,283,293,623,892,000
31.198473
110
0.69073
false
cryptickp/heat
heat/tests/test_common_context.py
2
13976
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
-5,614,957,604,447,868,000
39.393064
78
0.53091
false
GuessWhoSamFoo/pandas
pandas/tests/util/test_validate_args.py
2
2224
# -*- coding: utf-8 -*- from collections import OrderedDict import pytest from pandas.util._validators import validate_args _fname = "func" def test_bad_min_fname_arg_count(): msg = "'max_fname_arg_count' must be non-negative" with pytest.raises(ValueError, match=msg): validate_args(_fname, (None,...
bsd-3-clause
9,048,335,448,136,567,000
28.263158
69
0.616906
false
nmercier/linux-cross-gcc
linux/lib/python2.7/dist-packages/blueman/plugins/mechanism/Network.py
1
4154
# Copyright (C) 2009 Valmantas Paliksa <walmis at balticum-tv dot lt> # # Licensed under the GNU General Public License Version 3 # # 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...
bsd-3-clause
-5,156,855,811,527,410,000
30.953846
132
0.686326
false
silly-wacky-3-town-toon/SOURCE-COD
toontown/hood/TutorialHood.py
1
1188
from panda3d.core import * from panda3d.direct import * import ToonHood from toontown.town import TutorialTownLoader from toontown.toonbase.ToontownGlobals import * import SkyUtil class TutorialHood(ToonHood.ToonHood): def __init__(self, parentFSM, doneEvent, dnaStore, hoodId): ToonHood.ToonHood.__init__(...
apache-2.0
-3,643,774,705,771,048,400
30.263158
80
0.686027
false
adaptivelogic/django-cms
cms/tests/po.py
16
2695
from __future__ import with_statement from cms.test_utils.util.context_managers import TemporaryDirectory from django.core.management.base import CommandError from django.core.management.commands.compilemessages import (compile_messages, has_bom) from django.test.testcases import TestCase import os import shutil i...
bsd-3-clause
4,796,568,711,538,916,000
44.694915
160
0.596289
false
libo/Enigma2
lib/python/Screens/CopyFiles.py
2
1518
import os import Components.Task from twisted.internet import reactor, threads, task class FailedPostcondition(Components.Task.Condition): def __init__(self, exception): self.exception = exception def getErrorMessage(self, task): return str(self.exception) def check(self, task): return self.exception is None ...
gpl-2.0
1,773,166,990,751,767,600
23.095238
76
0.654809
false
MontmereLimited/django-lean
django_lean/experiments/tests/test_management.py
2
1943
# -*- coding: utf-8 -*- from __future__ import with_statement import logging l = logging.getLogger(__name__) from datetime import timedelta from django.conf import settings from django.core.management.base import CommandError from django_lean.experiments.models import (Experiment, DailyEngagementReport, ...
bsd-3-clause
-5,092,741,849,169,924,000
39.479167
87
0.632012
false
neilmunday/pespad
pespad.py
1
17179
#!/usr/bin/env python2 # # This file is part of PESPad. # # PESPad allows any device that can run a web browser to be used as # control pad for Linux based operating systems. # # Copyright (C) 2014 Neil Munday (neil@mundayweb.com) # # PESPad is free software: you can redistribute it and/or modify # i...
gpl-3.0
-8,410,798,589,090,936,000
28.215986
328
0.656965
false
ianastewart/cwltc-admin
cardless/urls.py
1
2140
# GO CARDLESS URLs from django.urls import path from .views import ( RedirectFlowView, MandateCreateView, MandateSuccessView, PayoutListView, PayoutDetailView, PaymentDetailView, PaymentCreateView, PaymentSuccessView, PaymentFailureView, PaymentProcessView, CardlessImportVi...
mit
280,400,045,023,137,820
26.792208
85
0.606542
false
Ardesco/selenium
py/test/selenium/webdriver/firefox/ff_profile_tests.py
1
5326
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-8,314,822,997,736,182,000
36.77305
106
0.692264
false
liurenqiu520/AutobahnPython
examples/twisted/wamp/basic/rpc/slowsquare/backend.py
3
1552
############################################################################### ## ## Copyright (C) 2014 Tavendo GmbH ## ## 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:/...
apache-2.0
-3,504,484,263,271,957,000
27.218182
79
0.583763
false
sorrison/python-alogger
alogger/parsers/slurm.py
1
4969
import datetime import time # Maybe there is some isomething in datetime that takes a ISO std string but I cannot find it, DRB. def DateTime_from_String(datetimeSt): """Gets a date time string like 2010-09-10T15:54:18 and retuns a datetime object raises a ValueError if it all goes wrong """ DayTime = ...
gpl-3.0
8,470,292,470,819,105,000
47.242718
177
0.593882
false
adityacs/ansible
lib/ansible/modules/network/ios/ios_system.py
12
12484
#!/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 distribut...
gpl-3.0
8,775,157,290,306,269,000
32.026455
98
0.597244
false
abhishekmurthy/Calligra
sheets/plugins/scripting/scripts/csvexport.py
7
4598
#!/usr/bin/env kross """ Sheets python script to export an ISO OpenDocument spreadsheet file to a comma-separated-value file. (C)2007 Sebastian Sauer <mail@dipe.org> http://kross.dipe.org http://www.calligra.org/sheets Dual-licensed under LGPL v2+higher and the BSD license. """ import os, datetime, sys, traceback, c...
gpl-2.0
-4,655,856,934,443,430,000
44.078431
168
0.66007
false
Missuor/StartWithPython
example/django/mysite/polls/urls.py
1
1362
##1 # from django.conf.urls import patterns, include, url # from django.contrib import admin # # urlpatterns = patterns('', # url(r'^polls/', include('polls.urls')), # url(r'^admin/', include(admin.site.urls)), # ) ##2 # from django.conf.urls import patterns, url # # from polls import views # # urlpatterns ...
gpl-2.0
-5,812,133,492,228,304,000
29.954545
80
0.577827
false
lscheinkman/nupic
tests/unit/nupic/algorithms/spatial_pooler_py_api_test.py
9
9808
# ---------------------------------------------------------------------- # 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...
agpl-3.0
3,628,852,379,972,284,400
30.235669
72
0.696676
false
google/grr
grr/server/grr_response_server/databases/mysql_utils_test.py
1
2367
#!/usr/bin/env python # -*- encoding: utf-8 -*- from absl import app from absl.testing import absltest from grr_response_server.databases import mysql_utils from grr.test_lib import test_lib class DocTest(test_lib.DocTest): module = mysql_utils class PlaceholdersTest(absltest.TestCase): def testEmpty(self): ...
apache-2.0
6,338,833,705,529,564,000
23.915789
77
0.598648
false
wujuguang/sentry
src/sentry/api/endpoints/organization_member_team_details.py
22
6846
from __future__ import absolute_import from rest_framework import serializers from rest_framework.response import Response from sentry.api.bases.organization import ( OrganizationEndpoint, OrganizationPermission ) from sentry.api.exceptions import ResourceDoesNotExist from sentry.api.serializers import serialize ...
bsd-3-clause
6,463,097,243,049,706,000
32.558824
83
0.567193
false