repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
groovehunter/xmlflat2db
watch.py
1
2266
#!/usr/bin/env python import os import sys import subprocess import datetime import time from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler BASEDIR = os.path.abspath(os.path.dirname(__file__)) def get_now(): "Get the current date and time as a string" return datetime...
gpl-2.0
dongwenjuan/project-config
tools/normalize_channels_yaml.py
6
1599
#! /usr/bin/env python # # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # 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
jhg/django
tests/check_framework/test_templates.py
288
1403
from copy import deepcopy from django.core.checks.templates import E001 from django.test import SimpleTestCase from django.test.utils import override_settings class CheckTemplateSettingsAppDirsTest(SimpleTestCase): TEMPLATES_APP_DIRS_AND_LOADERS = [ { 'BACKEND': 'django.template.backends.djan...
bsd-3-clause
GustavoHennig/ansible
lib/ansible/plugins/action/copy.py
18
15234
# (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
petermat/phantomjs
src/qt/qtwebkit/Tools/BuildSlaveSupport/build.webkit.org-config/committer_auth.py
118
4448
# Copyright (C) 2011 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
3dfxsoftware/cbss-addons
mrp_request_return/wizard/mrp_request_return.py
1
10493
# -*- encoding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # # Copyright (c) 2012 Vauxoo - http://www.vauxoo.com # All Rights Reserved. # info@vauxoo.com ###################################################...
gpl-2.0
ArtsiomCh/tensorflow
tensorflow/contrib/learn/python/learn/utils/input_fn_utils_test.py
67
1517
# 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
bschutze/ALTO-framework-sim
pyparsing-2.0.1/examples/holaMundo.py
6
1075
# -*- coding: UTF-8 -*- # escrito por Marco Alfonso, 2004 Noviembre # importamos el modulo from pyparsing import * saludo= Word(alphas) + ',' + Word(alphas) + '!' # Aqui decimos que la gramatica "saludo" DEBE contener # una palabra compuesta de caracteres alfanumericos # (Word(alphas)) mas una ',' ma...
mit
redhat-openstack/trove
trove/extensions/mgmt/host/views.py
13
1423
# Copyright 2011 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 requ...
apache-2.0
joelpinheiro/safebox-smartcard-auth
Client/veclient/lib/python2.7/site-packages/Crypto/Cipher/DES3.py
117
5130
# -*- coding: utf-8 -*- # # Cipher/DES3.py : DES3 # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, #...
gpl-2.0
MarcoQin/water
water/extension/prepare_ext.py
1
2892
#!/usr/bin/env python # encoding: utf-8 from water.extension.base_extension import (BaseExtension, PrepareExt, FinishExt, ParamHandleExt, PostP...
gpl-3.0
pingjiang/jit
webpy/web/template.py
16
43918
""" simple, elegant templating (part of web.py) Template design: Template string is split into tokens and the tokens are combined into nodes. Parse tree is a nodelist. TextNode and ExpressionNode are simple nodes and for-loop, if-loop etc are block nodes, which contain multiple child nodes. Each node can emit som...
mit
kevinr/750book-web
750book-web-env/lib/python2.7/site-packages/kombu/transport/couchdb.py
2
3298
""" kombu.transport.couchdb ======================= CouchDB transport. :copyright: (c) 2010 - 2012 by David Clymer. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from Queue import Empty import socket import couchdb from anyjson import loads, dumps from ..utils import uui...
mit
hamano/pysmbc
nosetests_/test_acl.py
1
1924
import os import smbc import settings import nose from nose.plugins.skip import SkipTest """ Test acl parser """ class SmbAcl(): revision = None owner = None group = None acl = [] def __init__(self, xattr_s=None): """ parse an acl into a SmbAcl object """ if xattr_s: ...
gpl-2.0
ridon/ridon-kernel-mediatek-mt6582
Documentation/target/tcm_mod_builder.py
4981
41422
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
oppo-source/R7f-4.4-kernel-source
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
AlecWallace2001/PBPull
PBRssBatch.py
1
5514
import urllib import urllib2 import os import datetime from easygui import * import re import json #This value currently never changes so that it can run indefinitly. rRepeat = True #This is the opening and closing for the link HTML file. jsonFile = os.path.join(os.getcwd(), "saved feeds.txt") if os...
mit
rsvip/Django
tests/queries/models.py
44
16564
""" Various complex queries that have been problematic in the past. """ from __future__ import unicode_literals import threading from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible class DumbCategory(models.Model): pass class ProxyCategory(Du...
bsd-3-clause
axinging/chromium-crosswalk
tools/code_coverage/croc_scan.py
178
4383
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Crocodile source scanners.""" import re class Scanner(object): """Generic source scanner.""" def __init__(self): """Constructor.""" ...
bsd-3-clause
meilinxiaoxue/diaphora
pygments/styles/xcode.py
50
1501
# -*- coding: utf-8 -*- """ pygments.styles.xcode ~~~~~~~~~~~~~~~~~~~~~ Style similar to the `Xcode` default theme. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, N...
gpl-2.0
carolFrohlich/nipype
nipype/interfaces/freesurfer/registration.py
2
13184
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Provides interfaces to various longitudinal commands provided by freesurfer Change directory to provide relative paths for doctests >>> import os >>> filepath = os.path...
bsd-3-clause
colbyga/pychess
lib/pychess/System/command.py
20
1903
#! /usr/bin/env python from __future__ import print_function import threading import subprocess import traceback import shlex from pychess.compat import basestring class Command(object): """ Enables to run subprocess commands in a different thread with TIMEOUT option. Based on jcollado's solution: h...
gpl-3.0
PredictiveScienceLab/GPy
GPy/testing/observable_tests.py
12
6069
# Copyright (c) 2014, Max Zwiessele # Licensed under the BSD 3-clause license (see LICENSE.txt) import unittest from GPy.core.parameterization.parameterized import Parameterized from GPy.core.parameterization.param import Param import numpy # One trigger in init _trigger_start = -1 class ParamTestParent(Parameterized...
bsd-3-clause
helloiloveit/VkxPhoneProject
submodules/externals/libxml2/python/tests/reader.py
87
12441
#!/usr/bin/python -u # -*- coding: ISO-8859-1 -*- # # this tests the basic APIs of the XmlTextReader interface # import libxml2 import StringIO import sys # Memory debug specific libxml2.debugMemory(1) f = StringIO.StringIO("""<a><b b1="b1"/><c>content of c</c></a>""") input = libxml2.inputBuffer(f) reader = input.ne...
gpl-2.0
claudep/pootle
pootle/apps/pootle_store/utils.py
1
15059
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from collections import OrderedDict from dj...
gpl-3.0
lthurlow/Network-Grapher
proj/external/networkx-1.7/networkx/generators/tests/test_small.py
77
6393
#!/usr/bin/env python from nose.tools import * from networkx import * from networkx.algorithms.isomorphism.isomorph import graph_could_be_isomorphic is_isomorphic=graph_could_be_isomorphic """Generators - Small ===================== Some small graphs """ null=null_graph() class TestGeneratorsSmall(): def test_...
mit
MadCat34/Sick-Beard
sickbeard/searchCurrent.py
61
1190
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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
EPFLMachineLearningTeam01/Project1
src/scripts/plot_histograms.py
1
4107
from matplotlib import pyplot as plt import numpy as np from tqdm import tqdm def savefig(name): kwargs = {'bbox_inches': 'tight', 'transparent': False, 'pad_inches': 0} plt.savefig('./analysis/%s.pdf' % name, **kwargs) plt.savefig('./analysis/%s.png' % name, **kwargs) def do_hist_scatter(X, y_, header, i...
mit
PXke/invenio
invenio/legacy/webbasket/migration_kit.py
4
14889
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 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 ## Licens...
gpl-2.0
SnappleCap/oh-mainline
vendor/packages/django-extensions/django_extensions/db/fields/encrypted.py
24
2888
from django.db import models from django.core.exceptions import ImproperlyConfigured from django import forms from django.conf import settings try: from keyczar import keyczar except ImportError: raise ImportError('Using an encrypted field requires the Keyczar module. ' 'You can obtain Ke...
agpl-3.0
chvrga/outdoor-explorer
java/play-1.4.4/python/Lib/csv.py
8
16165
""" csv.py - read/write/investigate CSV files """ import re from functools import reduce from _csv import Error, __version__, writer, reader, register_dialect, \ unregister_dialect, get_dialect, list_dialects, \ field_size_limit, \ QUOTE_MINIMAL, QUOTE_ALL,...
mit
JordanSilverman/TrainFinder
suds/resolver.py
9
15560
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will b...
bsd-3-clause
alex-ta/Fontinator
NeuralNet/Oli/libs/ProcessingPipeline.py
1
5521
from keras.optimizers import RMSprop from keras.utils import np_utils from numpy.core.multiarray import ndarray from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder import numpy as np from NeuralNet.Oli.libs.TrainingLogger import TrainingLogger from NeuralNet.Oli.libs.Ima...
apache-2.0
FXBitLab-Etp/etp
qa/rpc-tests/httpbasics.py
38
4816
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test rpc http basics # from test_framework.test_framework import BitcoinTestFramework from test_fram...
mit
Gui13/CouchPotatoServer
libs/subliminal/services/__init__.py
93
9269
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 3 of...
gpl-3.0
75651/kbengine_cloud
kbe/src/lib/python/Lib/pyclbr.py
97
13520
"""Parse a Python module and describe its classes and methods. Parse enough of a Python file to recognize imports and class and method definitions, and to find out the superclasses of a class. The interface consists of a single function: readmodule_ex(module [, path]) where module is the name of a Python modu...
lgpl-3.0
aljscott/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server_unittest.py
121
3174
# Copyright (C) 2012 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
SNoiraud/gramps
gramps/gen/merge/mergeplacequery.py
10
3939
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2010 Michiel D. Nauta # # 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; e...
gpl-2.0
jelugbo/hebs_master
common/lib/capa/capa/tests/test_targeted_feedback.py
196
25678
""" Tests the logic of the "targeted-feedback" attribute for MultipleChoice questions, i.e. those with the <multiplechoiceresponse> element """ import unittest import textwrap from . import test_capa_system, new_loncapa_problem, load_fixture class CapaTargetedFeedbackTest(unittest.TestCase): ''' Testing clas...
agpl-3.0
ibm-cds-labs/pixiedust
install/createKernel.py
1
25701
# ------------------------------------------------------------------------------- # Copyright IBM Corp. 2016 # # 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/licens...
apache-2.0
ampax/edx-platform
common/djangoapps/third_party_auth/tests/test_provider.py
87
4949
"""Unit tests for provider.py.""" from mock import Mock, patch from third_party_auth import provider from third_party_auth.tests import testutil import unittest @unittest.skipUnless(testutil.AUTH_FEATURE_ENABLED, 'third_party_auth not enabled') class RegistryTest(testutil.TestCase): """Tests registry discovery a...
agpl-3.0
shhui/horizon
openstack_dashboard/openstack/common/rpc/matchmaker.py
3
9864
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Cloudscaling Group, 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/LI...
apache-2.0
cyb0/volatility
volatility/plugins/mac/pstree.py
58
1876
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
gpl-2.0
asm-products/movie-database-service
ani/lib/python2.7/site-packages/Crypto/SelfTest/Cipher/test_pkcs1_oaep.py
113
17292
# -*- coding: utf-8 -*- # # SelfTest/Cipher/test_pkcs1_oaep.py: Self-test for PKCS#1 OAEP encryption # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone...
agpl-3.0
xxsergzzxx/python-for-android
python3-alpha/python3-src/Lib/encodings/iso2022_jp_1.py
816
1061
# # iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_1') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class Incrementa...
apache-2.0
reyoung/Paddle
python/paddle/fluid/tests/unittests/test_sequence_pad_op.py
2
4160
# Copyright (c) 2018 PaddlePaddle 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 appli...
apache-2.0
3EleVen/kernel_common
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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 i...
gpl-2.0
yashsharan/sympy
sympy/logic/utilities/dimacs.py
100
1722
"""For reading in DIMACS file format www.cs.ubc.ca/~hoos/SATLIB/Benchmarks/SAT/satformat.ps """ from __future__ import print_function, division from sympy.core import Symbol from sympy.logic.boolalg import And, Or import re def load(s): """Loads a boolean expression from a string. Examples ======== ...
bsd-3-clause
ujenmr/ansible
lib/ansible/modules/packaging/os/macports.py
59
8916
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Jimmy Tang <jcftang@gmail.com> # Based on okpg (Patrick Pelletier <pp.pelletier@gmail.com>), pacman # (Afterburn) and pkgin (Shaun Zinck) modules # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import ...
gpl-3.0
MayankGo/ec2-api
ec2api/tests/functional/api/test_security_groups.py
1
7072
# Copyright 2014 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 requ...
apache-2.0
SUSE/azure-sdk-for-python
azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/user.py
2
2898
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
daftscienceLLC/pifile
database.py
1
8889
import os from tinydb import TinyDB, where import inspect from tinyrecord import transaction from time import time, mktime, strftime, localtime import datetime from global_variables import DATABASE_SETTINGS, ROWS from pprintpp import pprint from sqlitedict import SqliteDict from prettytable import PrettyTable ...
gpl-3.0
frreiss/tensorflow-fred
tensorflow/tools/compatibility/module_deprecations_v2.py
21
2751
# Copyright 2019 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
nmercier/linux-cross-gcc
linux/lib/python2.7/dist-packages/gi/docstring.py
9
6688
# -*- Mode: Python; py-indent-offset: 4 -*- # vim: tabstop=4 shiftwidth=4 expandtab # # Copyright (C) 2013 Simon Feltman <sfeltman@gnome.org> # # docstring.py: documentation string generator for gi. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General...
bsd-3-clause
googleapis/googleapis-gen
google/cloud/contactcenterinsights/v1/contactcenterinsights-v1-py/google/cloud/contact_center_insights_v1/types/__init__.py
1
4275
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
maewna/food-sawasdee
test/python/test.py
13
1403
# Copyright 1999-2014. Parallels IP Holdings GmbH. All Rights Reserved. import sys import os import re def print_environ(environ=os.environ): """Dump the shell environment as HTML.""" keys = environ.keys() keys.sort() i = 0 for key in keys: if not re.search("^HTTP_|^REQUEST_", key): cont...
gpl-2.0
dfolch/pysal
pysal/contrib/network/weights.py
20
2184
""" A library of spatial network functions. Not to be used without permission. Contact: Andrew Winslow GeoDa Center for Geospatial Analysis Arizona State University Tempe, AZ Andrew.Winslow@asu.edu """ import csv import numpy as np from pysal import W import unittest import test def dist_weights(distfile, weight_t...
bsd-3-clause
KEHANG/RMG-Py
rmgpy/statmech/translationTest.py
11
5964
#!/usr/bin/env python # encoding: utf-8 ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2009 Prof. William H. Green (whgreen@mit.edu) and the # RMG Team (rmg_dev@mit.edu) # # Permission is hereby granted, free of cha...
mit
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/openmdao.main-0.13.0-py2.7.egg/openmdao/main/datatypes/int.py
1
3874
""" Trait for integer variables, with optional high and low. """ #public symbols __all__ = ["Int"] from sys import maxint # pylint: disable=E0611,F0401 from traits.api import Range from openmdao.main.variable import Variable class Int(Variable): """A variable wrapper for an integer valid within a specif...
gpl-2.0
tiagofrepereira2012/tensorflow
tensorflow/contrib/keras/python/keras/preprocessing/text_test.py
17
2522
# 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
bokeh/bokeh
bokeh/document/json.py
1
3507
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
google-research/leaf-audio
leaf_audio/convolution_test.py
1
1641
# coding=utf-8 # Copyright 2021 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
sozoStudio/sozoStudio.github.io
FoguangTemple_chromeApp/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py
1534
3426
# 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. import collections import os import gyp import gyp.common import gyp.msvs_emulation import json import sys generator_supports_multiple_toolsets = True generator_...
apache-2.0
BjoernT/python-openstackclient
openstackclient/tests/identity/v3/test_service_provider.py
2
14009
# Copyright 2014 CERN. # # 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
stuartarchibald/numba
numba/tests/test_indexing.py
5
39577
import decimal import itertools import numpy as np import unittest from numba.core.compiler import compile_isolated, Flags from numba import njit, typeof from numba.core import utils, types, errors from numba.tests.support import TestCase, tag from numba.core.typing import arraydecl from numba.core.types import intp,...
bsd-2-clause
hanhailong/watchman
python/tests/tests.py
11
2769
#!/usr/bin/env python # vim:ts=4:sw=4:et: import unittest import pywatchman import os from pywatchman import bser, SocketTimeout, WatchmanError class TestSocketTimeout(unittest.TestCase): def test_exception_handling(self): try: raise SocketTimeout('should not raise') except WatchmanErr...
apache-2.0
sgargan/ansible
v2/ansible/utils/display.py
11
4075
# (c) 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) any lat...
gpl-3.0
syncloud/lib
syncloudlib/application/connection.py
1
1565
import requests_unixsocket import json import os socket_file = '/var/snap/platform/common/api.socket' socket = 'http+unix://{0}'.format(socket_file.replace('/', '%2F')) def api_post(url, data): session = requests_unixsocket.Session() try: response = session.post('{0}{1}'.format(socket, url), data=dat...
gpl-3.0
ric2b/Vivaldi-browser
chromium/chrome/credential_provider/build/make_setup.py
3
5672
#!/usr/bin/env python # Copyright 2018 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 script builds the credential provider installer that is used to install # all required components of the Google Credential Prov...
bsd-3-clause
webhamster/pidart
gamemanager/isat/rules.py
1
11536
''' Define rules & strings that the Text-To-Speech engine outputs. ''' from isat.tools import fieldtexts from darttools import * from operator import or_ '''Texts that are prepared and can be used later are stored in ``texts''. The key in this dictionary is an identifier that can be used as a file name. The value-pa...
gpl-3.0
noxora/flask-base
flask/lib/python3.4/site-packages/pip/cmdoptions.py
327
16474
""" shared options and groups The principle here is to define options once, but *not* instantiate them globally. One reason being that options with action='append' can carry state between parses. pip parses general options twice internally, and shouldn't pass on state. To be consistent, all options will follow this de...
mit
omni5cience/django-inlineformfield
.tox/py27/lib/python2.7/site-packages/IPython/utils/generics.py
17
1453
# encoding: utf-8 """Generic functions for extending IPython. See http://cheeseshop.python.org/pypi/simplegeneric. """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full ...
mit
schinke/solid-fortnight-ba
flask/migrations/versions/b88775493739_.py
1
3653
"""empty message Revision ID: b88775493739 Revises: 33ed43950ff0 Create Date: 2016-08-09 23:04:18.695070 """ # revision identifiers, used by Alembic. revision = 'b88775493739' down_revision = '33ed43950ff0' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - ...
mit
brunogamacatao/portalsaladeaula
mediagenerator/filters/yuicompressor.py
1
1622
import settings from django.utils.encoding import smart_str from mediagenerator.generators.bundles.base import Filter class YUICompressor(Filter): def __init__(self, **kwargs): super(YUICompressor, self).__init__(**kwargs) assert self.filetype in ('css', 'js'), ( 'YUICompressor ...
bsd-3-clause
abadger/ansible
test/units/modules/test_hostname.py
11
1343
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat.mock import patch, MagicMock, mock_open from ansible.module_utils import basic from ansible.module_utils.common._utils import get_all_subclasses from ansible.modules import hostname from units.modules.utils import...
gpl-3.0
timgraham/django-cms
cms/tests/test_forms.py
7
11626
# -*- coding: utf-8 -*- from django.contrib.auth import get_user_model from django.contrib.sites.models import Site from django.core.cache import cache from cms.admin import forms from cms.admin.forms import (PagePermissionInlineAdminForm, ViewRestrictionInlineAdminForm, GlobalPagePermissi...
bsd-3-clause
lrq3000/pyFileFixity
pyFileFixity/lib/profilers/visual/pympler/refgraph.py
7
11959
""" This module exposes utilities to illustrate objects and their references as (directed) graphs. The current implementation requires 'graphviz' to be installed. """ from pympler.asizeof import Asizer, named_refs from pympler.util.stringutils import safe_repr, trunc from pympler.util.compat import encode4pipe from gc...
mit
cytec/SickRage
sickbeard/notifiers/emailnotify.py
5
15798
# coding=utf-8 # Authors: # Derek Battams <derek@battams.ca> # Pedro Jose Pereira Vieito (@pvieito) <pvieito@gmail.com> # # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as p...
gpl-3.0
SamHames/scikit-image
skimage/util/unique.py
51
1506
import numpy as np def unique_rows(ar): """Remove repeated rows from a 2D array. In particular, if given an array of coordinates of shape (Npoints, Ndim), it will remove repeated points. Parameters ---------- ar : 2-D ndarray The input array. Returns ------- ar_out : 2-D...
bsd-3-clause
MartinHjelmare/home-assistant
homeassistant/components/raspihats/__init__.py
7
8557
"""Support for controlling raspihats boards.""" import logging import threading import time from homeassistant.const import ( EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP) _LOGGER = logging.getLogger(__name__) DOMAIN = 'raspihats' CONF_I2C_HATS = 'i2c_hats' CONF_BOARD = 'board' CONF_CHANNELS = 'channels'...
apache-2.0
sumedhasingla/VTK
Common/Transforms/Testing/Python/cylindrical.py
20
1931
#!/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
Scalr/libcloud
demos/compute_demo.py
18
3642
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Lic...
apache-2.0
dynaryu/rmtk
rmtk/vulnerability/model_generator/point_dispersion/__init__.py
67
1875
# -*- coding: utf-8 -*- # # LICENSE # # Copyright © 2014-2015, GEM Foundation, Chiara Casotto, Anirudh Rao, # Vitor Silva. # # The Risk Modeller's Toolkit 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,...
agpl-3.0
NewAcropolis/api
tests/app/authentication/test_rest.py
1
7547
import pytest from flask import json, url_for, Blueprint, Flask from flask_jwt_extended import ( JWTManager, jwt_required ) from freezegun import freeze_time from app.errors import register_errors from tests.conftest import create_authorization_header, create_refresh_header class WhenDoingLogin(object): ...
mit
minorua/QGIS
tests/src/python/test_qgsserver_wms_getmap_size_project.py
27
2535
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer MaxHeight and MaxWidth Override Options. From build dir, run: ctest -R PyQgsServerGetMapSize -V .. note:: This test needs env vars to be set before the server is configured for the first time, for this reason it cannot run as a test case of ...
gpl-2.0
cuongnv23/ansible
test/units/modules/network/netscaler/test_netscaler_server.py
47
23309
# Copyright (c) 2017 Citrix Systems # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
gpl-3.0
Ichag/odoo
addons/point_of_sale/__openerp__.py
261
3612
# -*- 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
zhangpf/vbox
src/VBox/ValidationKit/testmanager/core/failurecategory.py
4
9139
# -*- coding: utf-8 -*- # $Id$ """ Test Manager - Failure Categories. """ __copyright__ = \ """ Copyright (C) 2012-2014 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute it and/or modify it under...
gpl-2.0
ChenJunor/hue
desktop/core/ext-py/Django-1.6.10/tests/model_formsets_regress/models.py
40
1137
from django.db import models from django.utils.encoding import python_2_unicode_compatible class User(models.Model): username = models.CharField(max_length=12, unique=True) serial = models.IntegerField() class UserSite(models.Model): user = models.ForeignKey(User, to_field="username") data = models.I...
apache-2.0
patrickstocklin/chattR
lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py
1010
4507
""" NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 """ try: from http.client import HTTPSConnection except ImportError: from httplib import HTTPSConnection from logging import getLogger from ntlm import ntlm from urllib3 import HTT...
gpl-2.0
geraldoandradee/mysql-5.6
mysql-test/suite/innodb/t/innodb_optimistic_insert_race.py
16
3004
import cStringIO import hashlib import MySQLdb import os import random import signal import sys import threading import time import string CHARS = string.letters + string.digits def sha1(x): return hashlib.sha1(str(x)).hexdigest() def get_msg(): blob_length = random.randint(1, 255) if random.randint(1, 2) == 1...
gpl-2.0
darktears/chromium-crosswalk
tools/telemetry/third_party/modulegraph/modulegraph_tests/test_basic.py
23
1296
import unittest import os, shutil from modulegraph import modulegraph class DummyModule(object): packagepath = None def __init__(self, ppath): self.packagepath = ppath class FindAllSubmodulesTestCase(unittest.TestCase): def testNone(self): mg = modulegraph.ModuleGraph() # empty p...
bsd-3-clause
dbmi-pitt/DIKB-Micropublication
scripts/mp-scripts/Bio/GA/Crossover/General.py
2
2135
"""General functionality for crossover that doesn't apply. This collects Crossover stuff that doesn't deal with any specific type of crossover. """ # standard library import random # local stuff from Bio.GA.Organism import Organism class SafeFitnessCrossover: """Perform crossovers, but do not allow decreases in ...
apache-2.0
erkanay/django
tests/multiple_database/tests.py
17
92537
from __future__ import unicode_literals import datetime import pickle from operator import attrgetter from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.core import management from django.db import connections, router, DEFAULT_DB_ALIAS, transaction from ...
bsd-3-clause
artur-shaik/qutebrowser
qutebrowser/mainwindow/statusbar/prompt.py
8
2935
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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
johndpope/tensorflow
tensorflow/contrib/distributions/python/ops/distribution_util.py
30
7951
# 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
AdaptiveApplications/carnegie
tarc_bus_locator_client/protobuf-2.5.0/pb_python_tutorial/addressbook_pb2.py
1
5859
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: addressbook.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(import...
mit
DEVSENSE/PTVS
Python/Product/Profiling/proflaun.py
7
1623
""" Starts profiling, expected to start with normal program to start as first argument and directory to run from as the second argument. """ import sys if sys.platform == 'cli': print('Python profiling is not supported on IronPython, press enter to exit...') raw_input() sys.exit(1) import vspyprof import...
apache-2.0
DGrady/pandas
pandas/tests/io/parser/compression.py
6
5431
# -*- coding: utf-8 -*- """ Tests compressed data parsing functionality for all of the parsers defined in parsers.py """ import pytest import pandas.util.testing as tm class CompressionTests(object): def test_zip(self): import zipfile with open(self.csv1, 'rb') as data_file: data ...
bsd-3-clause
blademainer/intellij-community
python/helpers/epydoc/markup/javadoc.py
100
10031
# # javadoc.py: javadoc docstring parsing # Edward Loper # # Created [07/03/03 12:37 PM] # $Id: javadoc.py 1574 2007-03-07 02:55:14Z dvarrazzo $ # """ Epydoc parser for U{Javadoc<http://java.sun.com/j2se/javadoc/>} docstrings. Javadoc is an HTML-based markup language that was developed for documenting Java APIs with ...
apache-2.0