repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
stephane-caron/ijhr-2016
pymanoid/cone.py
1
2305
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 Stephane Caron <stephane.caron@normalesup.org> # # This file is part of pymanoid. # # pymanoid 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 # Foundatio...
gpl-3.0
ininex/geofire-python
resource/lib/python2.7/site-packages/pip/_vendor/lockfile/mkdirlockfile.py
536
3096
from __future__ import absolute_import, division import time import os import sys import errno from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class MkdirLockFile(LockBase): """Lock file by creating a directory.""" def __init__(self, path, threaded=True,...
mit
jteehan/cfme_tests
cfme/tests/control/test_bugs.py
2
10080
# -*- coding: utf-8 -*- from collections import namedtuple import fauxfactory import pytest from cfme import test_requirements from cfme.base import Server from cfme.common.vm import VM from cfme.exceptions import CFMEExceptionOccured from cfme.control.explorer.policy_profiles import PolicyProfile from cfme.control.ex...
gpl-2.0
ychfan/tensorflow
tensorflow/python/keras/applications/xception/__init__.py
74
1142
# 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
yuyu2172/chainercv
chainercv/transforms/image/pca_lighting.py
3
1759
import numpy as np def pca_lighting(img, sigma, eigen_value=None, eigen_vector=None): """AlexNet style color augmentation This method adds a noise vector drawn from a Gaussian. The direction of the Gaussian is same as that of the principal components of the dataset. This method is used in training o...
mit
mrquim/mrquimrepo
plugin.video.neptune-1.2.2/resources/lib/modules/dialogs_list.py
5
9435
from threading import Thread, RLock import xbmc,os import xbmcaddon import xbmcgui from resources.lib.modules import control import time rt_timeout = 500 def select_ext(title, scraped_items): addonPath = xbmcaddon.Addon().getAddonInfo('path').decode('utf-8') dlg = SelectorDialog("DialogSelectList.xml", addo...
gpl-2.0
perdona/titanium_mobile
support/common/markdown/etree_loader.py
136
1287
from markdown import message, CRITICAL import sys ## Import def importETree(): """Import the best implementation of ElementTree, return a module object.""" etree_in_c = None try: # Is it Python 2.5+ with C implemenation of ElementTree installed? import xml.etree.cElementTree as etree_in_c exce...
apache-2.0
ktan2020/legacy-automation
win/Lib/site-packages/nose-1.2.1-py2.7.egg/nose/plugins/logcapture.py
3
9321
""" This plugin captures logging statements issued during test execution. When an error or failure occurs, the captured log messages are attached to the running test in the test.capturedLogging attribute, and displayed with the error failure output. It is enabled by default but can be turned off with the option ``--nol...
mit
matthappens/taskqueue
taskqueue/venv_tq/lib/python2.7/site-packages/pip/vendor/html5lib/trie/datrie.py
80
1177
from __future__ import absolute_import, division, unicode_literals from datrie import Trie as DATrie from pip.vendor.six import text_type from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): chars = set() for key in data.keys(): if not isinstance(key, tex...
mit
thiblahute/meson
mesonbuild/scripts/scanbuild.py
2
2326
# Copyright 2016 The Meson development team # 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 ...
apache-2.0
mrquim/repository.mrquim
repo/script.module.liveresolver/lib/liveresolver/resolvers/streamlive.py
10
4235
# -*- coding: utf-8 -*- import re,urlparse,json,requests,cookielib from liveresolver.modules import client from liveresolver.modules import control from liveresolver.modules import constants from liveresolver.modules.log_utils import log import urllib,sys,os cookieFile = os.path.join(control.dataPath, 'streamlivecoo...
gpl-2.0
freedomtan/tensorflow
tensorflow/python/kernel_tests/svd_op_test.py
5
15745
# 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
Gabriel439/pants
tests/python/pants_test/backend/python/tasks/checkstyle/test_import_order.py
7
4820
# coding=utf-8 # Copyright 2015 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 ast import te...
apache-2.0
cs98jrb/Trinity
mysite/events/forms/booking.py
1
2961
__author__ = 'james' from django.utils.translation import ugettext as _ from django import forms from django.core.exceptions import ValidationError from django.contrib.auth.models import User from django.contrib.auth import login, authenticate from events.models import Booking from orders.models import Order, OrderIt...
gpl-2.0
allmende/synnefo
snf-pithos-backend/pithos/backends/test/snapshots.py
7
8890
# Copyright (C) 2014 GRNET S.A. # # 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. # # This program is distributed in the...
gpl-3.0
upsuper/servo
tests/wpt/web-platform-tests/tools/third_party/py/py/_path/svnwc.py
56
43825
""" svn-Command based Implementation of a Subversion WorkingCopy Path. SvnWCCommandPath is the main class. """ import os, sys, time, re, calendar import py import subprocess from py._path import common #----------------------------------------------------------- # Caching latest repository revision and repo-path...
mpl-2.0
resmo/ansible
lib/ansible/modules/storage/netapp/netapp_e_iscsi_target.py
24
10686
#!/usr/bin/python # (c) 2018, NetApp, 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', 'status': ['preview'], ...
gpl-3.0
pjg101/SickRage
lib/lxml/sax.py
18
8524
""" SAX-based adapter to copy trees from/to the Python standard library. Use the `ElementTreeContentHandler` class to build an ElementTree from SAX events. Use the `ElementTreeProducer` class or the `saxify()` function to fire the SAX events of an ElementTree against a SAX ContentHandler. See http://codespeak.net/lx...
gpl-3.0
Midnighter/pyorganism
setup.py
1
2511
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ================== PyOrganism Package ================== :Authors: Moritz Emanuel Beber :Date: 2012-05-22 :Copyright: Copyright(c) 2012 Jacobs University of Bremen. All rights reserved. :File: setup.py """ import sys from os.path import join from s...
bsd-3-clause
mancoast/CPythonPyc_test
fail/330_test_keywordonlyarg.py
28
6889
#!/usr/bin/env python3 """Unit tests for the keyword only argument specified in PEP 3102.""" __author__ = "Jiwon Seo" __email__ = "seojiwon at gmail dot com" import unittest from test.support import run_unittest def posonly_sum(pos_arg1, *arg, **kwarg): return pos_arg1 + sum(arg) + sum(kwarg.values()) def keywo...
gpl-3.0
abice-sbr/adaptsearch
blastalign.py
1
4394
import string, re # Written by Robert Belshaw (School of Biomedical & Healthcare Sciences, University of Plymouth) & Aris Katzourakis (Department of Zoology, University of Oxford) # For more information and to cite see Belshaw, R & Katzourakis, A (2005) BlastAlign: a program that uses blast to align problematic nucleo...
gpl-3.0
leiyangleon/FSH
scripts_Py3/CROP_ISCE.py
2
1164
# Yang Lei, Jet Propulsion Laboratory # September, 2016 # This script crops the ISCE output files in radar coordinates by eliminating the erroneous edge effects. #!/usr/bin/python import numpy as np import read_rsc_data as rrd import sys import pdb import xml.etree.ElementTree as ET # Extract ISCE parameters xmlfil...
gpl-3.0
chialiang-8/cloudbase-init
cloudbaseinit/tests/utils/windows/test_security.py
7
3713
# Copyright 2014 Cloudbase Solutions Srl # # 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 l...
apache-2.0
stefan-jonasson/home-assistant
tests/components/persistent_notification/test_init.py
10
3064
"""The tests for the persistent notification component.""" from homeassistant.setup import setup_component import homeassistant.components.persistent_notification as pn from tests.common import get_test_home_assistant class TestPersistentNotification: """Test persistent notification component.""" def setup_...
mit
chuncky/nuc970kernel
linux-3.10.x/tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
chrismamil/chowda
test/test_chowda.py
1
2201
import unittest import os import chowda.parsing as parse import datetime import pandas as pd from chowda.load import load_file DATA_DIR = os.path.join(os.path.dirname(__file__), "data") TEST_FILE = "CTL1 wk3 exp1 RAW data.txt" TEST_1 = os.path.join(DATA_DIR, TEST_FILE) class TestChowda(unittest.TestCase): def s...
mit
Tehsmash/nova
nova/console/xvp.py
40
7100
# Copyright (c) 2010 OpenStack Foundation # 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 ...
apache-2.0
dbckz/ansible
test/units/template/test_templar.py
19
20587
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
CDKGlobal/cd-performance-promotion
cd_perf_promotion/engines/comparisonengine.py
1
19434
import json import operator class ComparisonEngine: """ Queries the performance tools' APIs and determines if the build passes the target requirements. """ def check_health_severity(self, violation): """ Fails the build if the defined severity is found in the health rule vi...
mit
cainiaocome/scikit-learn
sklearn/tree/tree.py
113
34767
""" This module gathers tree-based methods, including decision, regression and randomized trees. Single and multi-output problems are both handled. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Da...
bsd-3-clause
Frky/scat
src/shell/memory/addrtable.py
1
1331
#-*- coding: utf-8 -*- class AddrTable(object): TABLE_SIZE = 10000 def __init__(self, dic=False): self.__addr = list() self.__dic = dic for i in xrange(AddrTable.TABLE_SIZE): if self.__dic: self.__addr.append(dict()) else: self._...
mit
tchernomax/ansible
lib/ansible/modules/source_control/bzr.py
73
6088
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, André Paramés <git@andreparames.com> # Based on the Git module by Michael DeHaan <michael.dehaan@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, pr...
gpl-3.0
DANCEcollaborative/forum-xblock
XBlock Integration Files/xdjangobb/xblock/lib/python2.7/site-packages/django/utils/safestring.py
57
3954
""" Functions for working with "safe strings": strings that can be displayed safely without further escaping in HTML. Marking something as a "safe string" means that the producer of the string has already turned characters that should not be interpreted by the HTML engine (e.g. '<') into the appropriate entities. """ f...
mit
BenjaminSchubert/web-polls
backend/errors/http.py
1
1737
""" This module contains a collection of commonly encountered HTTP exceptions. This allows all these http exceptions to be treated in the same way and simplifies the return of errors to the user. """ from errors import ErrorMessage __author__ = "Benjamin Schubert <ben.c.schubert@gmail.com>" class BaseHTTPExceptio...
mit
jwhui/openthread
tests/scripts/thread-cert/Cert_9_2_08_PersistentDatasets.py
3
14867
#!/usr/bin/env python3 # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
bsd-3-clause
EDUlib/edx-platform
openedx/core/lib/django_courseware_routers.py
4
3012
""" Database Routers for use with the coursewarehistoryextended django app. """ class StudentModuleHistoryExtendedRouter: """ A Database Router that separates StudentModuleHistoryExtended into its own database. """ DATABASE_NAME = 'student_module_history' def _is_csm(self, model): """ ...
agpl-3.0
837278709/metro-openerp
metro/ir_cron.py
2
6621
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
moto-timo/ironpython3
Src/StdLib/Lib/test/test_script_helper.py
4
5142
"""Unittests for test.script_helper. Who tests the test helper?""" import subprocess import sys from test import script_helper import unittest from unittest import mock class TestScriptHelper(unittest.TestCase): def test_assert_python_ok(self): t = script_helper.assert_python_ok('-c', 'import sys; sys....
apache-2.0
jbenden/ansible
lib/ansible/modules/packaging/os/apt_rpm.py
7
4883
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # (c) 2013, Evgenii Terechkov # Written by Evgenii Terechkov <evg@altlinux.org> # Based on urpmi module written by Philippe Makowski <philippem@mageia.org> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ impor...
gpl-3.0
nerosketch/djing
traf_stat/models.py
2
4882
from datetime import datetime, timedelta, date, time import math from django.db import models, connection, ProgrammingError from django.utils.timezone import now from .fields import UnixDateTimeField def get_dates(): tables = connection.introspection.table_names() tables = (t.replace('flowstat_', '') for t i...
unlicense
valentin-krasontovitsch/ansible
lib/ansible/modules/remote_management/cobbler/cobbler_sync.py
80
4403
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Dag Wieers (dagwieers) <dag@wieers.com> # 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_ver...
gpl-3.0
mibexsoftware/alfred-bamboo-workflow
workflow/src/lib/requests/structures.py
1160
2977
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import collections class CaseInsensitiveDict(collections.MutableMapping): """ A case-insensitive ``dict``-like object. Implements all methods and operations of ``collections.MutableMapping...
mit
ralbayaty/KaggleRetina
testing/censureHistCalc.py
1
4517
from skimage.feature import CENSURE from skimage.color import rgb2gray import matplotlib.pyplot as plt import numpy as np import cv2 import sys from PIL import Image, ImageDraw def draw_keypoints(img, kp, scale): draw = ImageDraw.Draw(img) # Draw a maximum of 300 keypoints for i in range(min(len(scale),300...
gpl-2.0
qiou/Dev
python/edf.py
1
4511
#========================================================================= # Dependencies / Libraries #========================================================================= import time import serial import MySQLdb import subprocess from time import sleep import datetime #============================================...
gpl-2.0
rithms/hearthstone
xml_to_json.py
1
4835
#!/usr/bin/env python from bs4 import BeautifulSoup import glob import json ############################################# # Convert Hearthstone card data XML to JSON # ############################################# __author__ = "Taylor Caldwell - http://github.com/rithms" __copyright__ = "Copyright 2015, Taylor Caldw...
mit
rhyolight/nupic
scripts/run_nupic_tests.py
15
6601
# ---------------------------------------------------------------------- # 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
bodedev/prospera
plataforma/management/commands/atualizar_saldos.py
1
2085
# -*- coding: utf-8 -*- from django.conf import settings from django.core.management.base import BaseCommand from plataforma.constants import ETHER_DIVISOR from plataforma.models import Saldo import requests def buscar_saldo(carteira): try: r = requests.get("https://api.etherscan.io/api?module=account&a...
mit
dmsimard/ansible
hacking/test-module.py
35
10849
#!/usr/bin/env python # (c) 2012, Michael DeHaan <michael.dehaan@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 Software Foundation, either version 3 of the License, or # (...
gpl-3.0
aburluka/p.haul
phaul/args_parser.py
2
2978
# # p.haul command line arguments parsers # import sys import argparse import htype import images import criu_api import iters def parse_client_args(): """Parse p.haul command line arguments""" parser = argparse.ArgumentParser("Process HAULer") parser.set_defaults(pre_dump=iters.PRE_DUMP_AUTO_DETECT) parser.ad...
lgpl-2.1
rasata/ansible
lib/ansible/plugins/lookup/random_choice.py
253
1226
# (c) 2013, Michael DeHaan <michael.dehaan@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 Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
ShineFan/odoo
openerp/tools/cache.py
226
6865
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
JarbasAI/JarbasAI
mycroft/client/speech/recognizer/snowboy/snowboydetect.py
1
4841
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.12 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info as _swig_python_version_info if _swig_python_version_info >= (2, 7, 0): def swig_im...
gpl-3.0
sbreen94/Zeus_d2spr
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/whoosh/codec/__init__.py
96
1649
# Copyright 2012 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
bsd-3-clause
yanchen036/tensorflow
tensorflow/contrib/keras/api/keras/activations/__init__.py
39
1700
# 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
akumar21NCSU/servo
tests/wpt/web-platform-tests/webdriver/user_input/click_test.py
141
10579
import os import sys import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test repo_root = os.path.abspath(os.path.join(__file__, "../../..")) sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver")) from webdriver import exceptions, wait class ClickTest(base_tes...
mpl-2.0
DaviKaur/LibreHatti
src/librehatti/bills/admin.py
4
1954
from django.contrib import admin from django.contrib.auth.admin import * from librehatti.bills.models import * from librehatti.bills.forms import ItemSelectForm from librehatti.bills.forms import BuyerForm from librehatti.catalog.actions import mark_inactive, mark_active from django.http import HttpResponse,HttpResp...
gpl-2.0
bearstech/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_role.py
9
6384
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # 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...
gpl-3.0
mxOBS/deb-pkg_trusty_chromium-browser
third_party/WebKit/Source/bindings/scripts/v8_types.py
5
38893
# Copyright (C) 2013 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
ixiom/phantomjs
src/qt/qtbase/src/3rdparty/freetype/src/tools/docmaker/content.py
293
17668
# Content (c) 2002, 2004, 2006, 2007, 2008, 2009 # David Turner <david@freetype.org> # # This file contains routines used to parse the content of documentation # comment blocks and build more structured objects out of them. # from sources import * from utils import * import string, re # this regular expression...
bsd-3-clause
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/html5lib/treebuilders/base.py
329
13942
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from ..constants import scopingElements, tableInsertModeElements, namespaces # The scope markers are inserted when entering object elements, # marquees, table cells, and table captions, and are used to prevent for...
gpl-3.0
walac/linux
drivers/staging/comedi/drivers/ni_routing/tools/convert_py_to_csv.py
548
1679
#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0+ # vim: ts=2:sw=2:et:tw=80:nowrap from os import path import os, csv from itertools import chain from csv_collection import CSVCollection from ni_names import value_to_name import ni_values CSV_DIR = 'csv' def iter_src_values(D): return D.items() def iter...
gpl-2.0
se4u/pylearn2
pylearn2/sandbox/cuda_convnet/tests/profile_probabilistic_max_pooling.py
44
2414
from __future__ import print_function import theano.tensor as T import numpy as np from theano.compat.six.moves import xrange from theano import config from theano import function import time from pylearn2.utils import sharedX from pylearn2.sandbox.cuda_convnet.probabilistic_max_pooling import \ prob_max_pool...
bsd-3-clause
xuewei4d/scikit-learn
sklearn/inspection/tests/test_permutation_importance.py
7
17760
import pytest import numpy as np from numpy.testing import assert_allclose from sklearn.compose import ColumnTransformer from sklearn.datasets import load_diabetes from sklearn.datasets import load_iris from sklearn.datasets import make_classification from sklearn.datasets import make_regression from sklearn.dummy im...
bsd-3-clause
hyperized/ansible
lib/ansible/modules/network/illumos/ipadm_if.py
52
5722
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Adam Števko <adam.stevko@gmail.com> # 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
wkubiak/grpc
src/python/src/grpc/framework/face/_test_case.py
8
2690
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
iocoop/beancount
etc/find-missing-tests.py
1
2218
#!/usr/bin/env python3 """ Find missing test coverage in our source code. This program find source code and warns us if associated tests are missing or incomplete. This is used to track progress in test coverage and to ensure that the entire software suite is covered by appropriate testing code. """ import os from os ...
gpl-2.0
jas0n1ee/SonyCameraAPI
takePicture.py
1
1212
#!/usr/bin/env python from sonyAPI2 import API2 import cv2 import urllib2 import numpy as np import time import struct api = API2() api.update_api_list() try: result = api.do('getAvailableCameraFunction') current = result['result'][0] availavle = result['result'][1] if current != "Remote Shooting": ...
apache-2.0
proxysh/Safejumper-for-Desktop
buildlinux/env32/lib/python2.7/site-packages/Crypto/Random/_UserFriendlyRNG.py
111
7629
# -*- coding: utf-8 -*- # # Random/_UserFriendlyRNG.py : A user-friendly random number generator # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that ...
gpl-2.0
Jarsa/addons-jarsa
connector_cva/tests/test_product_template.py
3
1627
# -*- coding: utf-8 -*- # © <2016> <Jarsa Sistemas, S.A. de C.V.> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.tests.common import TransactionCase from mock import MagicMock from lxml import etree import requests class TestProductTemplate(TransactionCase): """ This will t...
agpl-3.0
depboy/p2pool-depboy
p2pool/bitcoin/networks/digibyteSkein.py
1
1236
import os import platform from twisted.internet import defer from .. import data, helper from p2pool.util import pack P2P_PREFIX = 'fac3b6da'.decode('hex') #pchmessagestart P2P_PORT = 12024 ADDRESS_VERSION = 30 #pubkey_address RPC_PORT = 14022 RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue( ...
gpl-3.0
edevil/django
django/contrib/auth/hashers.py
4
17326
from __future__ import unicode_literals import base64 import binascii from collections import OrderedDict import hashlib import importlib from django.dispatch import receiver from django.conf import settings from django.core.signals import setting_changed from django.utils.encoding import force_bytes, force_str, forc...
bsd-3-clause
zhangxq5012/sky_engine
sky/tools/webkitpy/common/checkout/scm/detection.py
21
3598
# Copyright (c) 2009, 2010, 2011 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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 reta...
bsd-3-clause
indictranstech/frappe
frappe/client.py
27
4705
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ import frappe.model import frappe.utils import json, os @frappe.whitelist() def get_list(doctype, fields=None, filters=None, order_by=None, li...
mit
zitouni/gnuradio-3.6.1
gr-video-sdl/src/qa_video_sdl.py
10
1272
#!/usr/bin/env python # # Copyright 2006,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your optio...
gpl-3.0
hanlind/nova
nova/api/openstack/compute/schemas/aggregates.py
18
3699
# Copyright 2014 NEC 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 # # Unless required ...
apache-2.0
qtekfun/kernel_htc_msm8939
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
rosmo/ansible
test/units/modules/storage/netapp/test_na_ontap_interface.py
23
10173
# (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ''' unit test template for ONTAP Ansible module ''' from __future__ import print_function import json import pytest from units.compat import unittest from units.compat.mock import patch, Mock from ans...
gpl-3.0
nikhilprathapani/python-for-android
python3-alpha/python3-src/Lib/test/test_richcmp.py
57
11070
# Tests for rich comparisons import unittest from test import support import operator class Number: def __init__(self, x): self.x = x def __lt__(self, other): return self.x < other def __le__(self, other): return self.x <= other def __eq__(self, other): return self...
apache-2.0
cogeorg/BlackRhino
examples/degroot/networkx/algorithms/dag.py
20
7686
# -*- coding: utf-8 -*- from fractions import gcd import networkx as nx """Algorithms for directed acyclic graphs (DAGs).""" # Copyright (C) 2006-2011 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. __author...
gpl-3.0
junhe/chopper
src/MWpyFS/Monitor.py
1
44187
# Chopper is a diagnostic tool that explores file systems for unexpected # behaviors. For more details, see paper Reducing File System Tail # Latencies With Chopper (http://research.cs.wisc.edu/adsl/Publications/). # # Please send bug reports and questions to jhe@cs.wisc.edu. # # Written by Jun He at University of Wis...
gpl-2.0
looker/sentry
src/sentry/metrics/datadog.py
4
1864
from __future__ import absolute_import __all__ = ['DatadogMetricsBackend'] from datadog import initialize, ThreadStats from datadog.util.hostname import get_hostname from sentry.utils.cache import memoize from .base import MetricsBackend class DatadogMetricsBackend(MetricsBackend): def __init__(self, prefix=N...
bsd-3-clause
tchernomax/ansible
lib/ansible/module_utils/netapp_module.py
31
5878
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
cybernet/rhel7-kernel
kernel/tools/perf/scripts/python/net_dropmonitor.py
2669
1738
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
AssociazionePrometeo/doorkeeper
docker/mosquitto/mosquitto-1.4/test/broker/06-bridge-br2b-disconnect-qos2.py
6
3806
#!/usr/bin/env python # Does a bridge resend a QoS=1 message correctly after a disconnect? import os import subprocess import socket import time import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(...
gpl-2.0
ltilve/ChromiumGStreamerBackend
tools/binary_size/binary_size_utils.py
33
2254
# 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. """Common utilities for tools that deal with binary size information. """ import logging import re def ParseNm(nm_lines): """Parse nm output, returning ...
bsd-3-clause
crdroid-devices/android_kernel_lge_hammerhead
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
SanketDG/coala-bears
tests/LocalBearTestHelper.py
1
8822
import collections import queue import unittest from contextlib import contextmanager import pytest from tests.BearTestHelper import generate_skip_decorator from coalib.bears.LocalBear import LocalBear from coalib.misc.ContextManagers import prepare_file from coalib.settings.Section import Section from coalib.setting...
agpl-3.0
stevekuznetsov/Klampt
Python/control/klampt_catkin/src/klampt/scripts/baxterserialrelay.py
7
4589
#!/usr/bin/env python """Relays messages between ROS controller and simulated Baxter robot in Klamp't OR between Klamp't serial controller and ROS Baxter robot. """ import rosbaxtercontroller from serialcontroller import ControllerClient from klampt import * import asyncore import rospy import argparse def mainKlampt...
bsd-3-clause
revolutionaryG/phantomjs
src/qt/qtbase/src/3rdparty/freetype/builds/mac/ascii2mpw.py
830
1033
#!/usr/bin/env python import sys import string if len( sys.argv ) == 1 : for asc_line in sys.stdin.readlines(): mpw_line = string.replace(asc_line, "\\xA5", "\245") mpw_line = string.replace(mpw_line, "\\xB6", "\266") mpw_line = string.replace(mpw_line, "\\xC4", "\304") mpw_line = string.replace(mpw_...
bsd-3-clause
openplans/shareabouts-phlush
src/sa_web/management/commands/flavormessages.py
36
5762
from django.core.management.base import NoArgsCommand, CommandError from django.core.management.commands.makemessages import process_file, write_po_file import django import optparse from optparse import make_option import sys import os import os.path import re import glob import subprocess import tempfile from sa_web...
gpl-3.0
titimoby/connected
jsserver/node_modules/ponte/node_modules/mosca/node_modules/leveldown/node_modules/prebuild/node_modules/node-ninja/gyp/tools/pretty_gyp.py
2618
4756
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Pretty-prints the contents of a GYP file.""" import sys import re # Regex to remove comments when we're counting braces. COMMENT_RE = ...
mit
watermelo/libcloud
docs/examples/compute/ecs/manage_nodes.py
29
1407
from libcloud.compute.base import NodeAuthPassword from libcloud.compute.providers import get_driver from libcloud.compute.types import Provider ECSDriver = get_driver(Provider.ALIYUN_ECS) region = 'cn-hangzhou' access_key_id = 'CHANGE IT' access_key_secret = 'CHANGE IT' driver = ECSDriver(access_key_id, access_key_...
apache-2.0
drhee/InsightDataScience
src/words_tweeted_utils.py
2
4978
#!/usr/bin/env python import os, sys, string, time, argparse ''' USEAGE: python words_tweeted_utils.py -options <addtional parameters> PURPOSE: For big tweet.txt (~ 500 million tweets), it would be ideal to split the input and use words_tweet.py seperately to generated the output. This utils script can be us...
gpl-3.0
darktears/chromium-crosswalk
PRESUBMIT_test_mocks.py
28
3773
# 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 os import re import subprocess import sys class MockInputApi(object): """Mock class for the InputApi class. This class can be used ...
bsd-3-clause
AunShiLord/sympy
sympy/physics/quantum/tests/test_commutator.py
124
1830
from sympy import symbols, Integer from sympy.physics.quantum.dagger import Dagger from sympy.physics.quantum.commutator import Commutator as Comm from sympy.physics.quantum.operator import Operator a, b, c = symbols('a,b,c') A, B, C, D = symbols('A,B,C,D', commutative=False) def test_commutator(): c = Comm(A,...
bsd-3-clause
commentedit/commented.it
isso/tests/test_db.py
1
3708
# -*- encoding: utf-8 -*- try: import unittest2 as unittest except ImportError: import unittest import os import sqlite3 import tempfile from isso import config from isso.db import SQLite3 from isso.compat import iteritems class TestDBMigration(unittest.TestCase): def setUp(self): fd, self.pa...
mpl-2.0
astaninger/speakout
venv/lib/python3.6/site-packages/pip/_vendor/requests/cookies.py
24
18346
# -*- coding: utf-8 -*- """ requests.cookies ~~~~~~~~~~~~~~~~ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import copy import time import calendar from ._internal_utils import to_native_string from .compat import cookiel...
mit
rgbkrk/binder
binder/indices.py
2
4891
import json import os import tempfile import shutil from binder.utils import make_dir class AppIndex(object): """ Responsible for finding and managing metadata about apps. """ _singleton = None @staticmethod def get_index(*args, **kwargs): if not AppIndex._singleton: App...
apache-2.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/numpy/core/tests/test_indexerrors.py
145
4938
from __future__ import division, absolute_import, print_function import numpy as np from numpy.testing import TestCase, run_module_suite, assert_raises class TestIndexErrors(TestCase): '''Tests to exercise indexerrors not covered by other tests.''' def test_arraytypes_fasttake(self): 'take from a 0-l...
gpl-3.0