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
frossigneux/blazar
climate/openstack/common/versionutils.py
2
4962
# Copyright (c) 2013 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
kbroughton/ansible-modules-core
cloud/rackspace/rax_keypair.py
157
4957
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
manuelli/director
src/python/tests/testPyDrakeIk.py
2
1053
# import pydrakeik first. This is a workaround for the issue: # https://github.com/RobotLocomotion/director/issues/467 from director import pydrakeik from director import mainwindowapp from director import robotsystem from director import applogic from PythonQt import QtCore def makeRobotSystem(view): factory = ...
bsd-3-clause
rafaelthca/OmniDB
OmniDB/OmniDB_app/include/paramiko/kex_ecdh_nist.py
5
4489
""" Ephemeral Elliptic Curve Diffie-Hellman (ECDH) key exchange RFC 5656, Section 4 """ from hashlib import sha256, sha384, sha512 from paramiko.message import Message from paramiko.py3compat import byte_chr, long from paramiko.ssh_exception import SSHException from cryptography.hazmat.backends import default_backend ...
mit
SteveViss/readthedocs.org
readthedocs/comments/backend.py
34
1098
import json from django.core import serializers from sphinx.websupport.storage import StorageBackend from .models import DocumentNode from readthedocs.comments.models import NodeSnapshot class DjangoStorage(StorageBackend): """ A Sphinx StorageBackend using Django. """ def get_metadata(self, docname...
mit
sanjeevtripurari/hue
desktop/core/ext-py/Django-1.6.10/tests/serializers/tests.py
49
20526
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import json from datetime import datetime from xml.dom import minidom try: import yaml HAS_YAML = True except ImportError: HAS_YAML = False from django.conf import settings from django.core import management, serializers fro...
apache-2.0
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/doc/mpl_examples/widgets/menu.py
10
4936
from __future__ import division, print_function import numpy as np import matplotlib import matplotlib.colors as colors import matplotlib.patches as patches import matplotlib.mathtext as mathtext import matplotlib.pyplot as plt import matplotlib.artist as artist import matplotlib.image as image class ItemProperties: ...
mit
lmjohns3/downhill
examples/rosenbrock.py
1
3383
'''Helper functions for rosenbrock optimization examples.''' import downhill import numpy as np import theano from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams COLORS = ('#d62728 #1f77b4 #2ca02c #9467bd #ff7f0e ' '#e377c2 #8c564b #bcbd22 #7f7f7f #17becf').split() FLOAT = 'df'[theano.co...
mit
CroissanceCommune/autonomie
autonomie/panels/files.py
1
2674
# -*- coding: utf-8 -*- # * Authors: # * TJEBBES Gaston <g.t@majerti.fr> # * Arezki Feth <f.a@majerti.fr>; # * Miotte Julien <j.m@majerti.fr>; from autonomie.utils.widgets import Link from autonomie.models.node import Node def stream_actions(request, item): """ Collect actions available for ...
gpl-3.0
utkbansal/kuma
vendor/packages/jsonpickle/util.py
26
12102
# -*- coding: utf-8 -*- # # Copyright (C) 2008 John Paulett (john -at- paulett.org) # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. """Helper functions for pickling and unpickling. Most functions assist in determinin...
mpl-2.0
pbanaszkiewicz/amy
amy/extrequests/migrations/0012_auto_20190822_1906.py
2
1477
# Generated by Django 2.1.7 on 2019-08-22 19:06 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('extrequests', '0011_auto_20190822_1748'), ] operations = [ migrations.AlterField( model_name='selforganizedsubmission', ...
mit
kellinm/blivet
blivet/devices/storage.py
1
30575
# devices/storage.py # Base class for block device classes. # # Copyright (C) 2009-2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later v...
gpl-2.0
daviddupont69/CouchPotatoServer
libs/pyutil/fileutil.py
122
8863
# Copyright (c) 2002-2010 Zooko Wilcox-O'Hearn # This file is part of pyutil; see README.rst for licensing terms. """ Futz with files like a pro. """ import errno, exceptions, os, stat, tempfile try: import bsddb except ImportError: DBNoSuchFileError = None else: DBNoSuchFileError = bsddb.db.DBNoSuchFi...
gpl-3.0
vsajip/django
django/contrib/gis/db/backends/mysql/operations.py
1
2458
from django.db.backends.mysql.base import DatabaseOperations from django.contrib.gis.db.backends.adapter import WKTAdapter from django.contrib.gis.db.backends.base import BaseSpatialOperations from django.utils import six class MySQLOperations(DatabaseOperations, BaseSpatialOperations): compiler_module = 'django...
bsd-3-clause
binoculars/osf.io
framework/routing/__init__.py
9
19403
# -*- coding: utf-8 -*- import copy import functools import httplib as http import json import logging import os from flask import request, make_response from mako.lookup import TemplateLookup from mako.template import Template import markupsafe from werkzeug.exceptions import NotFound import werkzeug.wrappers from ...
apache-2.0
zhenwendai/DeepGP
deepgp/layers/enclayer.py
1
4321
# Copyright (c) 2015-2016, the authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) from GPy.core import Parameterized from GPy import Param from GPy.core.parameterization.transformations import Logexp from GPy.core.parameterization.variational import VariationalPosterior class Enc...
bsd-3-clause
JioCloud/pbr
pbr/tests/testpackage/pbr_testpackage/_setup_hooks.py
144
2310
# Copyright (c) 2013 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 # # Unless required by applica...
apache-2.0
nyalldawson/QGIS
python/plugins/processing/algs/grass7/ext/r_colors_stddev.py
36
2183
# -*- coding: utf-8 -*- """ *************************************************************************** r_colors_stddev.py ------------------ Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr **********************...
gpl-2.0
rruebner/odoo
openerp/report/pyPdf/xmp.py
123
15723
import re import datetime import decimal from generic import PdfObject from xml.dom import getDOMImplementation from xml.dom.minidom import parseString RDF_NAMESPACE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" DC_NAMESPACE = "http://purl.org/dc/elements/1.1/" XMP_NAMESPACE = "http://ns.adobe.com/xap/1.0/"...
agpl-3.0
eduardostalinho/django-shop
docs/OLD-out-of-date/snippets/modules.py
20
6045
# django_shop/checkout/__init__.py # django_shop/checkout/__init__.py from django_shop.checkout.site import CheckoutSite, checkoutsite def autodiscover(): """ Auto-discover INSTALLED_APPS admin.py modules and fail silently when not present. This forces an import on them to register any admin bits they ...
bsd-3-clause
ftomassetti/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/db/backends/util.py
377
1749
""" A collection of utility routines and classes used by the spatial backends. """ def gqn(val): """ The geographic quote name function; used for quoting tables and geometries (they use single rather than the double quotes of the backend quotename function). """ if isinstance(val, basestring): ...
apache-2.0
jacknjzhou/neutron
neutron/debug/commands.py
46
5232
# Copyright 2012, Nachi Ueno, NTT MCL, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
apache-2.0
feroda/odoo
addons/l10n_be/wizard/l10n_be_account_vat_declaration.py
309
10685
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # Adapted by Noviat to # - enforce correct vat number # - support negative balance # - assign...
agpl-3.0
Nicop06/ansible
lib/ansible/modules/cloud/amazon/data_pipeline.py
14
20661
#!/usr/bin/python # # Copyright (c) 2017 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.1', 'status': ['pr...
gpl-3.0
gptech/ansible
lib/ansible/modules/storage/netapp/na_cdot_qtree.py
69
7429
#!/usr/bin/python # (c) 2017, NetApp, Inc # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
gpl-3.0
kouk/boto
tests/unit/rds/test_connection.py
120
35025
#!/usr/bin/env python # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without ...
mit
RaumZeit/griffith
lib/plugins/movie/PluginMoviePTGate.py
4
5429
# -*- coding: UTF-8 -*- __revision__ = '$Id$' # Copyright (c) 2005-2009 Vasco Nunes, Piotr Ozarowski # # 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...
gpl-2.0
developersociety/django-glitter
glitter/templatetags/glitter.py
2
1593
from django import template register = template.Library() @register.simple_tag(takes_context=True) def glitter_head(context): """ Template tag which renders the glitter CSS and JavaScript. Any resources which need to be loaded should be added here. This is only shown to users with permission to edit ...
bsd-3-clause
supriyantomaftuh/syzygy
third_party/numpy/files/numpy/ma/extras.py
22
55934
""" Masked arrays add-ons. A collection of utilities for `numpy.ma`. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu :version: $Id: extras.py 3473 2007-10-29 15:18:13Z jarrod.millman $ """ __author__ = "Pierre GF Gerard-Marchant ($Author: jarrod.millman $)" __version__ = '1.0' __revision__ = "$Revi...
apache-2.0
dhiltonsmith/suds
suds/wsdl.py
197
31503
# 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 ...
lgpl-3.0
pravisankar/solum
solum/objects/sqlalchemy/plan.py
3
1516
# Copyright 2014 - Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
apache-2.0
kunaltyagi/nsiqcppstyle
rules/RULE_4_5_A_brace_for_namespace_should_be_located_in_seperate_line.py
1
2483
""" Braces for namespace should be located in the seperate line. == Violation == namespace AA { <== ERROR } == Good == namespace { } """ from nsiqunittest.nsiqcppstyle_unittestbase import * from nsiqcppstyle_rulehelper import * from nsiqcppstyle_reporter import * from ns...
gpl-2.0
GNOME/pybliographer
Pyblio/Search.py
2
5442
# -*- coding: utf-8 -*- # This file is part of pybliographer # # Copyright (C) 2018 Germán Poo-Caamaño <gpoo@gnome.org> # Copyright (C) 1998-2004 Frederic GOBRY <gobry@pybliographer.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as ...
gpl-2.0
kamalx/edx-platform
cms/djangoapps/contentstore/management/commands/reindex_library.py
155
2604
""" Management command to update libraries' search index """ from django.core.management import BaseCommand, CommandError from optparse import make_option from textwrap import dedent from contentstore.courseware_index import LibrarySearchIndexer from opaque_keys.edx.keys import CourseKey from opaque_keys import Inval...
agpl-3.0
sinhrks/scikit-learn
sklearn/utils/sparsefuncs.py
85
13505
# Authors: Manoj Kumar # Thomas Unterthiner # Giorgio Patrini # # License: BSD 3 clause import scipy.sparse as sp import numpy as np from .fixes import sparse_min_max, bincount from .sparsefuncs_fast import ( csr_mean_variance_axis0 as _csr_mean_var_axis0, csc_mean_variance_axis0 as _csc_mean...
bsd-3-clause
Basis/webargs
webargs/flaskparser.py
1
3219
# -*- coding: utf-8 -*- """Flask request argument parsing module. Example: :: from flask import Flask from webargs import fields from webargs.flaskparser import use_args app = Flask(__name__) hello_args = { 'name': fields.Str(required=True) } @app.route('/') @use_args(hello...
mit
TimBuckley/effective_django
django/db/backends/utils.py
14
6227
from __future__ import unicode_literals import datetime import decimal import hashlib import logging from time import time from django.conf import settings from django.utils.encoding import force_bytes from django.utils.timezone import utc logger = logging.getLogger('django.db.backends') class CursorWrapper(objec...
bsd-3-clause
Lujeni/ansible
lib/ansible/modules/storage/netapp/na_ontap_export_policy.py
59
8312
#!/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
arg-hya/taxiCab
TraNodeCreator/TrajToNodeConverter.py
1
3399
import numpy as np import pycrs import mpl_toolkits.basemap.pyproj as pyproj # Import the pyproj module import shapefile as shp import matplotlib.pyplot as plt REF_LAT = 900000 REF_LON = 120000 def sortPoints(lat,lon,sorted_lat,sorted_lon) : #Appending 0,0 for unspecified points sorted_lat.append...
gpl-3.0
jonnatas/codeschool
vendor/github.com/fabiommendes/ejudge/src/ejudge/util.py
2
3085
import io import sys import signal from threading import Thread # # Special IO functions for python script interactions # _print_func = print _stdout = sys.stdout def real_print(*args, **kwargs): """Print function for the C's stdout.""" kwargs.setdefault('file', _stdout) _print_func(*args, **kwargs) ...
gpl-3.0
g1franc/lets-encrypt-preview
acme/acme/jose/jws_test.py
45
8718
"""Tests for acme.jose.jws.""" import base64 import unittest import mock import OpenSSL from acme import test_util from acme.jose import errors from acme.jose import json_util from acme.jose import jwa from acme.jose import jwk CERT = test_util.load_cert('cert.pem') KEY = jwk.JWKRSA.load(test_util.load_vector('rsa...
apache-2.0
fargalaxy1/geonode-leaflet
geonode/documents/forms.py
13
6631
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gpl-3.0
porcupinelabs/PiSense
pslog/pslog.py
1
2579
import PiSenseNode import PiSenseDb import PiSenseCSV import PiSenseSerial import PiSenseApi import sys import time import argparse import traceback def PsRun(storetype,simfilename): #open ether the serial port to the hub (simfilename==''), or a simulation file Hub = PiSenseSerial.PiSenseHubMonit...
mit
CartoDB/mapnik
scons/scons-local-3.0.1/SCons/Tool/386asm.py
5
2212
"""SCons.Tool.386asm Tool specification for the 386ASM assembler for the Phar Lap ETS embedded operating system. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Founda...
lgpl-2.1
mollstam/UnrealPy
UnrealPyEmbed/Source/Python/Lib/python27/encodings/base64_codec.py
528
2338
""" Python 'base64_codec' Codec - base64 content transfer encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs, base64 ### Codec APIs def base64_encode(i...
mit
kinwahlai/phantomjs-ghostdriver
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/test_util.py
295
27103
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
Maximilian-Reuter/SickRage-1
lib/rebulk/test/test_loose.py
21
2786
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=no-self-use, pointless-statement, missing-docstring, invalid-name from ..loose import call def test_loose_function(): def func(v1, v2, v3=3, v4=4): return v1 + v2 + v3 + v4 assert call(func, 1, 2) == func(1, 2) assert call(func, 1,...
gpl-3.0
carnal0wnage/Empire
lib/modules/persistence/misc/memssp.py
22
2354
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-Mimikatz memssp', 'Author': ['@JosephBialek', '@gentilkiwi'], 'Description': ("Runs PowerSploit's Invoke-Mimikatz function " ...
bsd-3-clause
PeterMosmans/letsencrypt
letsencrypt/constants.py
3
2749
"""Let's Encrypt constants.""" import os import logging from acme import challenges SETUPTOOLS_PLUGINS_ENTRY_POINT = "letsencrypt.plugins" """Setuptools entry point group name for plugins.""" CLI_DEFAULTS = dict( config_files=[ "/etc/letsencrypt/cli.ini", # http://freedesktop.org/wiki/Software/x...
apache-2.0
kogotko/carburetor
openstack_dashboard/test/integration_tests/tests/test_keypairs.py
15
1700
# Copyright 2014 Hewlett-Packard Development Company, L.P # 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....
apache-2.0
cryptickp/python-neutronclient
neutronclient/tests/functional/test_readonly_neutron.py
4
8539
# 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 # d...
apache-2.0
rvalyi/OpenUpgrade
addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
44
3003
# -*- 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
apark263/tensorflow
tensorflow/contrib/gan/python/train.py
4
54019
# 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
timopulkkinen/BubbleFish
chrome/browser/policy/test/policy_testserver.py
2
34007
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A bare-bones test server for testing cloud policy support. This implements a simple cloud policy test server that can be used to test chrome's device...
bsd-3-clause
SummerLW/Perf-Insight-Report
third_party/gsutil/third_party/boto/boto/ec2/cloudwatch/__init__.py
76
24442
# Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
bsd-3-clause
rspavel/spack
var/spack/repos/builtin/packages/qrupdate/package.py
5
2057
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os import sys from spack import * class Qrupdate(MakefilePackage, SourceforgePackage): """qrupdate is a Fortr...
lgpl-2.1
alienigenahk/openkore
src/scons-local-2.0.1/SCons/Variables/PackageVariable.py
61
3612
"""engine.SCons.Variables.PackageVariable This file defines the option type for SCons implementing 'package activation'. To be used whenever a 'package' may be enabled/disabled and the package path may be specified. Usage example: Examples: x11=no (disables X11 support) x11=yes (will search for the...
gpl-2.0
Garrett-R/gender_bender
gender_bender/pluralize.py
1
16018
# -*- coding: utf-8 -*- # Copyright (c) 2010 University of Antwerp, Belgium # Author: Tom De Smedt <tom@organisms.be> # License: BSD (see LICENSE.txt for details). #### PLURALIZE ##################################################################################### # Based on "An Algorithmic Approach to English Plural...
apache-2.0
enlighter/algorithms
maths/vlnm.py
1
1673
''' Very Large Number Multiplicator based on "Vedic Mathematics" __author__: Suhovan Mandal __license__: "MIT license" __email__: mandal.sushovan92@gmail.com __site__: www.github.com/enlighter ''' import sys ### Pre-processing python version check ### req_version = (3,4) cur_version = sys.version_info if cur_v...
mit
40023154/Finalexam_0627
static/Brython3.1.1-20150328-091302/Lib/colorsys.py
1066
3691
"""Conversion functions between RGB and other color systems. This modules provides two functions for each color system ABC: rgb_to_abc(r, g, b) --> a, b, c abc_to_rgb(a, b, c) --> r, g, b All inputs and outputs are triples of floats in the range [0.0...1.0] (with the exception of I and Q, which covers a slightly...
gpl-3.0
dsoprea/PackageBackupClient
pbclient/prefs.py
1
5726
import json from os import environ, remove, makedirs, utime from os.path import exists, join from fcntl import lockf, LOCK_EX, LOCK_UN from shutil import rmtree from collections import OrderedDict from pbclient.config import PREFS_PATH, PREFS_FILENAME, LOCK_FILEPATH, \ BACKUP_AGENT_MODULE_...
gpl-2.0
robobrobro/ballin-octo-shame
lib/Python-3.4.3/Lib/distutils/tests/test_cygwinccompiler.py
147
5671
"""Tests for distutils.cygwinccompiler.""" import unittest import sys import os from io import BytesIO import subprocess from test.support import run_unittest from distutils import cygwinccompiler from distutils.cygwinccompiler import (CygwinCCompiler, check_config_h, CONFIG_H_OK...
mit
AxelDelmas/ansible
contrib/inventory/nagios_ndo.py
213
3842
#!/usr/bin/env python # (c) 2014, Jonathan Lestrelin <jonathan.lestrelin@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 Licens...
gpl-3.0
StelixROM/android_kernel_lge_hammerhead
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
mdanielwork/intellij-community
python/lib/Lib/site-packages/django/db/backends/oracle/base.py
73
30505
""" Oracle database backend for Django. Requires cx_Oracle: http://cx-oracle.sourceforge.net/ """ import datetime import sys import time from decimal import Decimal def _setup_environment(environ): import platform # Cygwin requires some special voodoo to set the environment variables # properly so that...
apache-2.0
relateiq/dd-agent
utils/process.py
19
1669
# stdlib import errno import os # 3p try: import psutil except ImportError: psutil = None # project from util import Platform def pid_exists(pid): """ Check if a pid exists. Lighter than psutil.pid_exists """ if psutil: return psutil.pid_exists(pid) if Platform.is_windows():...
bsd-3-clause
insionng/shadowsocks
shadowsocks/shell.py
652
12736
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
drawks/ansible
lib/ansible/modules/cloud/azure/azure_rm_rediscachefirewallrule.py
13
10940
#!/usr/bin/python # # Copyright (c) 2019 Yunge Zhu, <yungez@microsoft.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
stefwalter/cockpituous
tests/doc/inkscape-export.py
1
1516
#!/usr/bin/env python import os import codecs from xml.dom import minidom import subprocess import sys INKSCAPE = '/usr/bin/inkscape' def list_layers(svg): layers = [ ] for g in svg.getElementsByTagName("g"): if g.attributes.has_key("inkscape:label"): layers.append(g.attributes["inkscape:...
lgpl-2.1
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/pygments/unistring.py
29
51110
# -*- coding: utf-8 -*- """ pygments.unistring ~~~~~~~~~~~~~~~~~~ Strings of all Unicode characters of a certain category. Used for matching in Unicode-aware languages. Run to regenerate. Inspired by chartypes_create.py from the MoinMoin project. :copyright: Copyright 2006-2014 by the Pygment...
agpl-3.0
apophys/freeipa
ipatests/test_ipalib/test_config.py
4
21468
# Authors: # Martin Nagy <mnagy@redhat.com> # Jason Gerard DeRose <jderose@redhat.com> # # Copyright (C) 2008 Red Hat # see file 'COPYING' for use and warranty information # # 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...
gpl-3.0
CognitionGuidedSurgery/msml-gui
src/msmlgui/helper/model.py
1
1288
import msmlgui __author__ = 'weigl' import json import msml.model from .util import random_position class Annotation(object): def __init__(self, pos=(0, 0), text=""): self.text = text self.pos = pos class UiPersistentData(object): def __init__(self): self.task_positions = {} ...
gpl-3.0
aupasana/aupasana
OSXScripts/dli.py
1
22883
#!/usr/bin/env python import sys # Require python version 2.[7+] major = sys.version_info[0] minor = sys.version_info[1] if (major != 2 or minor < 7): print("This script requires python version 2.7 or higher (2.x)") sys.exit() # Put import in a try block to get a simple error message # if the import isn't found try...
gpl-2.0
kjdev/livereload-c
third_party/jansson/doc/conf.py
11
7029
# -*- coding: utf-8 -*- # # Jansson documentation build configuration file, created by # sphinx-quickstart on Sun Sep 5 21:47:20 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
mit
sumedhasingla/VTK
Imaging/Core/Testing/Python/TestChangeInformation.py
11
1250
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # In this example, an image is centered at (0,0,0) before a # rotation is applied to ensure that the rotation occurs about # the center of the image. reader = vtk.vtkPNGReader() reade...
bsd-3-clause
bl4ckh0l3z/droidtrail
droidtrail/trails/androguard/arscrestablepackage.py
1
2101
# This file is part of DroidTrail. # # bl4ckh0l3 <bl4ckh0l3z at gmail.com> # # DroidTrail is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later...
gpl-2.0
OptiPop/external_chromium_org
content/public/browser/devtools_protocol_constants_generator.py
44
6919
#!/usr/bin/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 sys import string import json package = sys.argv[1] output_cc_path = sys.argv[2] output_h_path = sys.argv[3] blink_protocol_path = ...
bsd-3-clause
jwhitlock/django-allauth
allauth/socialaccount/providers/openid/provider.py
4
3362
try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse from django.core.urlresolvers import reverse from django.utils.http import urlencode from allauth.socialaccount import providers from allauth.socialaccount.providers.base import Provider, ProviderAccount from .utils impor...
mit
raghavrv/scikit-learn
examples/decomposition/plot_sparse_coding.py
60
4016
""" =========================================== Sparse coding with a precomputed dictionary =========================================== Transform a signal as a sparse combination of Ricker wavelets. This example visually compares different sparse coding methods using the :class:`sklearn.decomposition.SparseCoder` esti...
bsd-3-clause
SUSE/teuthology
teuthology/provision/pelagos.py
3
6264
import logging import requests import re import time from teuthology.config import config from teuthology.contextutil import safe_while from teuthology.misc import canonicalize_hostname from teuthology.util.compat import HTTPError log = logging.getLogger(__name__) config_section = 'pelagos' # Provisioner configura...
mit
pobrejuanito/configuration
util/vpc-tools/tag-old-ebs.py
62
7679
""" For a given aws account, go through all un-attached volumes and tag them. """ import boto import boto.utils import argparse import logging import subprocess import time import os from os.path import join, exists, isdir, islink, realpath, basename, dirname import yaml # needs to be pip installed import netaddr LO...
agpl-3.0
mitocw/edx-platform
openedx/core/djangoapps/cors_csrf/authentication.py
4
1543
""" Django Rest Framework Authentication classes for cross-domain end-points. """ from django.middleware.csrf import CsrfViewMiddleware from rest_framework import authentication from .helpers import is_cross_domain_request_allowed, skip_cross_domain_referer_check class SessionAuthenticationCrossDomainCsrf(authenti...
agpl-3.0
CruiseDevice/coala
coalib/bearlib/aspects/decorators.py
10
1847
from functools import wraps from .taste import Taste from .meta import aspectclass from coalib.settings.FunctionMetadata import FunctionMetadata def map_setting_to_aspect(**aspectable_setting): """ Map function arguments with aspect and override it if appropriate. This decorator can be used by ``Bear.r...
agpl-3.0
TrueSkills/django-mongo-rest
tests/server/views.py
1
2389
from copy import deepcopy from django.http.response import HttpResponse from django_mongo_rest import ApiView, PageView, PERMISSION from django_mongo_rest.validation import Param, email_validator from django_mongo_rest.model_view import ModelView from .models import PlaygroundModel class NoneApi(ApiView): permissi...
mit
dudymas/python-openstacksdk
openstack/tests/unit/database/v1/test_user.py
3
2349
# 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 # distributed under t...
apache-2.0
aneeshusa/servo
tests/wpt/web-platform-tests/webdriver/command_contexts/open_and_close_window_test.py
141
2529
import os import sys import random 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 class OpenAndCl...
mpl-2.0
cancan101/tensorflow
tensorflow/contrib/slim/python/slim/nets/resnet_utils.py
36
11490
# 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
40223101/w17test
static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testcallable.py
739
4234
# Copyright (C) 2007-2012 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # http://www.voidspace.org.uk/python/mock/ import unittest from unittest.test.testmock.support import is_instance, X, SomeClass from unittest.mock import ( Mock, MagicMock, NonCallableMagicMock, NonCallableM...
gpl-3.0
geodynamics/burnman
contrib/eos_fitting/eos_fitting.py
2
14905
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences # Copyright (C) 2012 - 2015 by the BurnMan team, released under the GNU # GPL v2 or later. """ """ from __future__ import absolute_import from __future__ import print_function import os import sys import ...
gpl-2.0
perryjohnson/biplaneblade
biplane_blade_lib/prep_stn23_mesh.py
1
31016
"""Write initial TrueGrid files for one biplane blade station. Usage ----- start an IPython (qt)console with the pylab flag: $ ipython qtconsole --pylab or $ ipython --pylab Then, from the prompt, run this script: |> %run biplane_blade_lib/prep_stnXX_mesh.py or |> import biplane_blade_lib/prep_stnXX_mesh ...
gpl-3.0
SDX2000/scons
engine/SCons/Tool/hplink.py
21
2396
"""SCons.Tool.hplink Tool-specific initialization for the HP linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCon...
mit
zhuolinho/linphone
submodules/mswebrtc/webrtc/tools/refactoring/stringmanipulation.py
7
11323
import string # returns tuple, [success,updated_string] where the updated string has # has one less (the first) occurance of match string def removefirstoccurance( remove_string, match_string ): lowercase_string = remove_string.lower() lowercase_match_string = match_string.lower() lowest_index = lowercase_...
gpl-2.0
pigeonflight/strider-plone
docker/appengine/google/appengine/ext/mapreduce/test_support.py
1
6298
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
mit
tinfoil/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer_unittest.py
121
2831
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
sjperkins/tensorflow
tensorflow/python/saved_model/main_op.py
120
1320
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
shujunqiao/cocos2d-python
test/test_menu_top_left.py
6
1229
from __future__ import division, print_function, unicode_literals # This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # testinfo = "s, q" tags = "menu, menu_valign, menu_halign" from pyglet import image from p...
bsd-3-clause
southpawtech/TACTIC-DEV
src/pyasm/biz/notification_test.py
6
5371
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without writte...
epl-1.0
Austin503/pyglet
contrib/layout/tests/layout/INLINE_REPLACED.py
29
2039
#!/usr/bin/env python '''Test inline replaced elements (specifically, images). Text before each image describes the intended result. Use the mouse scroll wheel to view the entire document. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest import sys import os import base_layout filen...
bsd-3-clause
aestrivex/mne-python
mne/gui/_viewer.py
15
11457
"""Mayavi/traits GUI visualization elements""" # Authors: Christian Brodbeck <christianbrodbeck@nyu.edu> # # License: BSD (3-clause) import os import numpy as np # allow import without traits try: from mayavi.mlab import pipeline, text3d from mayavi.modules.glyph import Glyph from mayavi.modules.surface ...
bsd-3-clause
fqxp/nete-gtk
nete/components/focus_manager.py
1
1276
import logging from gi.repository import GObject, Gtk logger = logging.getLogger(__name__) class FocusManager(GObject.Object): focus = GObject.Property(type=str) def __init__(self, window, **kwargs): super().__init__(**kwargs) self.window = window self.connect('notify::focus', sel...
gpl-3.0