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
nthiep/global-ssh-server
lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py
103
9642
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import logging import sys from django.db import utils from django.db.backends import * from django.db.backends.signals import connection_created from django.db.backends.postgresql_psycopg2.operations import Database...
agpl-3.0
163gal/Time-Line
libs_arm/wx/py/shell.py
4
57340
"""Shell is an interactive text control in which a user types in commands to be sent to the interpreter. This particular shell is based on wxPython's wxStyledTextCtrl. Sponsored by Orbtech - Your source for Python programming expertise.""" __author__ = "Patrick K. O'Brien <pobrien@orbtech.com>" __cvsid__ = "$Id$" __...
gpl-3.0
waytai/networkx
doc/gh-pages.py
34
4346
#!/usr/bin/env python """Script to commit the doc build outputs into the github-pages repo. Use: gh-pages.py [tag] If no tag is given, the current output of 'git describe' is used. If given, that is how the resulting directory will be named. In practice, you should use either actual clean tags from a current bui...
bsd-3-clause
moomou/heron
heron/common/src/python/utils/metrics/py_metrics.py
1
5091
# copyright 2016 twitter. 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 applicable law or agree...
apache-2.0
peterlauri/django
tests/sites_framework/tests.py
117
2693
from django.conf import settings from django.contrib.sites.managers import CurrentSiteManager from django.contrib.sites.models import Site from django.core import checks from django.db import models from django.test import SimpleTestCase, TestCase from django.test.utils import isolate_apps from .models import CustomAr...
bsd-3-clause
CityPulse/CP_Resourcemanagement
wrapper_dev/deploy_mgt.py
1
4726
#!/usr/bin/env python # -*- coding: utf-8 -*- # import os, curses, curses.ascii, subprocess import glob from time import sleep class Wrapper(object): deploy_dir = os.path.join("..", "virtualisation", "autodeploy") def __init__(self, deploy_json): self.dir = os.path.dirname(deploy_json) self....
mit
sinperwolf/shadowsocks
shadowsocks/crypto/sodium.py
1032
3778
#!/usr/bin/env python # # 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 by applicable law or ...
apache-2.0
mitodl/open-discussions
course_catalog/etl/mitpe.py
1
6740
"""MIT Professional course catalog ETL""" import logging import re from datetime import datetime from decimal import Decimal from urllib.parse import urljoin import requests from bs4 import BeautifulSoup as bs from django.conf import settings from course_catalog.constants import OfferedBy, PlatformType, mitpe_edx_map...
bsd-3-clause
nojhan/weboob-devel
modules/boursorama/pages/__init__.py
3
1450
# -*- coding: utf-8 -*- # Copyright(C) 2011 Gabriel Kerneis # Copyright(C) 2010-2011 Jocelyn Jaubert # # This file is part of weboob. # # weboob 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, eit...
agpl-3.0
lamblin/pylearn2
pylearn2/datasets/vector_spaces_dataset.py
41
6009
"""TODO: module-level docstring.""" __authors__ = "Pascal Lamblin and Razvan Pascanu" __copyright__ = "Copyright 2010-2013, Universite de Montreal" __credits__ = ["Pascal Lamblin", "Razvan Pascanu", "Ian Goodfellow", "Mehdi Mirza"] __license__ = "3-clause BSD" __maintainer__ = "Pascal Lamblin" __email__ ...
bsd-3-clause
lento/cortex
python/IECoreMaya/GenericParameterUI.py
12
7845
########################################################################## # # Copyright (c) 2010, Image Engine Design 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: # # * Redistribu...
bsd-3-clause
anfieldinc/ntp
docs/node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py
2214
1347
#!/usr/bin/env python import re import json # http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae # http://stackoverflow.com/a/13436167/96656 def unisymbol(codePoint): if codePoint >= 0x0000 and codePoint <= 0xFFFF: return unichr(codePoint) elif codePoint >= 0x010000 and codePoint <= 0x10FFFF: ...
mit
infobloxopen/infoblox-netmri
infoblox_netmri/api/broker/v3_2_0/wireless_subordinate_broker.py
17
83365
from ..broker import Broker class WirelessSubordinateBroker(Broker): controller = "wireless_subordinates" def index(self, **kwargs): """Lists the available wireless subordinates. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lis...
apache-2.0
potash/scikit-learn
sklearn/feature_selection/from_model.py
7
9546
# Authors: Gilles Louppe, Mathieu Blondel, Maheshakya Wijewardena # License: BSD 3 clause import numpy as np from .base import SelectorMixin from ..base import TransformerMixin, BaseEstimator, clone from ..externals import six from ..utils import safe_mask, check_array, deprecated from ..utils.validation import chec...
bsd-3-clause
IV-GII/SocialCookies
ENV1/lib/python2.7/site-packages/django/contrib/comments/views/utils.py
176
1980
""" A few bits of helper functions for comment views. """ import textwrap from django.http import HttpResponseRedirect from django.shortcuts import render_to_response, resolve_url from django.template import RequestContext from django.core.exceptions import ObjectDoesNotExist from django.contrib import comments from ...
gpl-2.0
zikifer/node-gyp
legacy/tools/gyp/pylib/gyp/MSVSSettings_test.py
42
65827
#!/usr/bin/env python # Copyright (c) 2011 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. """Unit tests for the MSVSSettings.py file.""" import StringIO import unittest import gyp.MSVSSettings as MSVSSettings class TestSequence...
mit
tensorflow/probability
tensorflow_probability/python/internal/backend/numpy/gen/linear_operator_util.py
1
23768
# Copyright 2020 The TensorFlow Probability Authors. All Rights Reserved. # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ # THIS FILE IS AUTO-GENERATED BY `gen_linear_operators.py`. # DO NOT MODIFY DIRECTLY. # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@...
apache-2.0
lotan/rhythmbox-ampache
AmpacheConfigDialog.py
1
2578
# vim: expandtab shiftwidth=8 softtabstop=8 tabstop=8 # # (c) 2010 # envyseapets@gmail.com # grindlay@gmail.com # langdalepl@gmail.com # massimo.mund@googlemail.com # bethebunny@gmail.com, # 2012-2015 lotan_rm@gmx.de # # This file is part of the Rhythmbox Ampache plugin. # # The Rhythmbox ...
gpl-2.0
henry-ajere/rad2py
psp2py/controllers/appadmin.py
14
13329
# -*- coding: utf-8 -*- # ########################################################## # ## make sure administrator is on localhost # ########################################################### import os import socket import datetime import copy import gluon.contenttype import gluon.fileutils # ## critical --- make a ...
gpl-3.0
xubenben/scikit-learn
sklearn/gaussian_process/regression_models.py
259
2166
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Licence: BSD 3 clause """ The built-in regression models submodule for the gaussian_process module. """ import numpy as np def constant(x): """ Zero order polynomial (...
bsd-3-clause
navotsil/Open-Knesset
events/migrations/0002_event_add_when_done.py
14
12023
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Event.when_over' db.add_column('events_event', 'when_over', self.gf('django.db.models.fiel...
bsd-3-clause
robobrobro/ballin-octo-shame
lib/Python-3.4.3/Lib/encodings/cp775.py
272
34476
""" Python Character Mapping Codec cp775 generated from 'VENDORS/MICSFT/PC/CP775.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict...
mit
hkawasaki/kawasaki-aio8-0
common/djangoapps/config_models/__init__.py
220
2002
""" Model-Based Configuration ========================= This app allows other apps to easily define a configuration model that can be hooked into the admin site to allow configuration management with auditing. Installation ------------ Add ``config_models`` to your ``INSTALLED_APPS`` list. Usage ----- Create a sub...
agpl-3.0
AMICI-developer/AMICI
python/tests/test_parameter_mapping.py
3
1869
"""Test for ``amici.parameter_mapping``""" from amici.parameter_mapping import ( ParameterMappingForCondition, ParameterMapping) def test_parameter_mapping_for_condition_default_args(): """Check we can initialize the mapping with default arguments.""" par_map_for_condition = ParameterMappingForCondition...
bsd-2-clause
serverdensity/sd-agent-core-plugins
hdfs_namenode/test_hdfs_namenode.py
6
3525
# stdlib import os # Project from tests.checks.common import AgentCheckTest, Fixtures # 3rd Party import mock import json # Namenode URI NAMENODE_JMX_URI = 'http://localhost:50070/jmx' # Namesystem state URL NAME_SYSTEM_STATE_URL = NAMENODE_JMX_URI + '?qry=Hadoop:service=NameNode,name=FSNamesystemState' # Namesyst...
bsd-3-clause
valentin-krasontovitsch/ansible
lib/ansible/modules/storage/zfs/zfs.py
55
9554
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Johan Wiren <johan.wiren.se@gmail.com> # 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__ = t...
gpl-3.0
zerotk/terraformer
zerotk/fifo.py
1
1072
from __future__ import unicode_literals from collections import OrderedDict class FIFO(OrderedDict): """ This is a First in, First out cache, so, when the maximum size is reached, the first item added is removed. """ def __init__(self, maxsize): """ :param int maxsize: ...
mit
Dm47021/Holo-a200
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
antgonza/qiime
qiime/denoiser/preprocess.py
15
11459
#!/usr/bin/env python """Preprocess 454 sequencing data.""" __author__ = "Jens Reeder" __copyright__ = "Copyright 2011, The QIIME Project" # remember to add yourself if you make changes __credits__ = ["Jens Reeder", "Rob Knight", "Jai Ram Rideout"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Jens ...
gpl-2.0
MrTheodor/espressopp
contrib/mpi4py/mpi4py-2.0.0/conf/mpiconfig.py
8
17349
import sys, os, platform from distutils.util import split_quoted from distutils.spawn import find_executable from distutils import log as dulog try: from collections import OrderedDict except ImportError: OrderedDict = dict try: from configparser import ConfigParser from configparser import Error as...
gpl-3.0
hmcmooc/muddx-platform
lms/djangoapps/courseware/courses.py
3
12810
from collections import defaultdict from fs.errors import ResourceNotFoundError import logging import inspect from path import path from django.http import Http404 from django.conf import settings from edxmako.shortcuts import render_to_string from xmodule.modulestore import XML_MODULESTORE_TYPE from xmodule.modulest...
agpl-3.0
timopulkkinen/BubbleFish
tools/json_schema_compiler/h_generator.py
3
14191
# 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. from code import Code from model import PropertyType, Type import cpp_util import schema_util class HGenerator(object): def __init__(self, type_genera...
bsd-3-clause
quantmind/pulsar-cloud
setup.py
2
1891
import sys import os from setuptools import setup, find_packages import cloud def read(name): filename = os.path.join(os.path.dirname(__file__), name) with open(filename) as fp: return fp.read() def requirements(name): install_requires = [] dependency_links = [] for line in read(name)...
bsd-3-clause
mvj3/leetcode
206-reverse-linked-list.py
1
1626
""" Question: Reverse Linked List Reverse a singly linked list. click to show more hints. Hint: A linked list can be reversed either iteratively or recursively. Could you implement both? Performance: 1. Total Accepted: 48424 Total Submissions: 141893 Difficulty: Easy 2. Your runtime beat...
mit
ruguevara/neon
neon/experiments/experiment.py
13
1600
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems 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.o...
apache-2.0
jdemaeyer/scrapy
tests/test_webclient.py
20
14435
""" from twisted.internet import defer Tests borrowed from the twisted.web.client tests. """ import os import six from six.moves.urllib.parse import urlparse from twisted.trial import unittest from twisted.web import server, static, util, resource from twisted.internet import reactor, defer from twisted.test.proto_hel...
bsd-3-clause
hwu25/AppPkg
Applications/Python/Python-2.7.2/Tools/scripts/diff.py
9
2051
""" Command line interface to difflib.py providing diffs in four formats: * ndiff: lists every line and highlights interline changes. * context: highlights clusters of changes in a before/after format. * unified: highlights clusters of changes in an inline format. * html: generates side by side compariso...
bsd-2-clause
stenix71/izpack
src/doc-reST/confluencize.py
14
3562
#!/usr/bin/env python import string from glob import glob from xml.etree.ElementTree import ElementTree, tostring def warn_missing(element): if element.tag not in action: print '============( %s )============' % element.tag pass action = { 'title': lambda element, context: ('\nh%s. %s\n\n' % (context['h...
apache-2.0
mtconley/turntable
test/lib/python2.7/site-packages/numpy/distutils/mingw32ccompiler.py
57
22435
""" Support code for building Python extensions on Windows. # NT stuff # 1. Make sure libpython<version>.a exists for gcc. If not, build it. # 2. Force windows to use gcc (we're struggling with MSVC and g77 support) # 3. Force windows to use g77 """ from __future__ import division, absolute_import, p...
mit
andrewor14/iolap
examples/src/main/python/hbase_outputformat.py
8
2885
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
jmcarp/django
tests/m2m_signals/tests.py
271
15982
""" Testing signals emitted on changing m2m relations. """ from django.db import models from django.test import TestCase from .models import Car, Part, Person, SportsCar class ManyToManySignalsTest(TestCase): def m2m_changed_signal_receiver(self, signal, sender, **kwargs): message = { 'insta...
bsd-3-clause
ShanghaiTimes/Audacity2015
lib-src/lv2/lv2/plugins/eg-sampler.lv2/waflib/extras/autowaf.py
176
22430
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import glob import os import subprocess import sys from waflib import Configure,Context,Logs,Node,Options,Task,Utils from waflib.TaskGen import feature,before,after global g_i...
gpl-2.0
miurahr/translate
translate/tools/pocount.py
24
12909
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2003-2009 Zuza Software Foundation # # This file is part of the Translate Toolkit. # # 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
chenjiancan/FeelUOwn
src/base/player.py
2
7398
# -*- coding:utf8 -*- from PyQt5.QtMultimedia import * from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from base.common import singleton from base.logger import LOG @singleton class Player(QMediaPlayer): """allows the playing of a media source The Ui intera...
mit
OsirisSPS/osiris-sps
client/share/plugins/AF9A4C281070FDB0F34CF417CDB168AB38C8A388/lib/plat-os2emx/IN.py
77
1875
# Generated by h2py from f:/emx/include/netinet/in.h # Included from sys/param.h PAGE_SIZE = 0x1000 HZ = 100 MAXNAMLEN = 260 MAXPATHLEN = 260 def htonl(X): return _swapl(X) def ntohl(X): return _swapl(X) def htons(X): return _swaps(X) def ntohs(X): return _swaps(X) IPPROTO_IP = 0 IPPROTO_ICMP = 1 IPPROTO_IGMP = 2 ...
gpl-3.0
joshuajan/odoo
addons/account/installer.py
381
8404
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
apple/llvm-project
llvm/utils/lit/tests/selecting.py
4
6440
# RUN: %{lit} %{inputs}/discovery | FileCheck --check-prefix=CHECK-BASIC %s # CHECK-BASIC: Testing: 5 tests # Check that we exit with an error if we do not discover any tests, even with --allow-empty-runs. # # RUN: not %{lit} %{inputs}/nonexistent 2>&1 | FileCheck --check-prefix=CHECK-BAD-PATH %s #...
apache-2.0
VShangxiao/v2ex
html5lib/serializer/htmlserializer.py
97
12663
try: frozenset except NameError: # Import from the sets module for python 2.3 from sets import ImmutableSet as frozenset import gettext _ = gettext.gettext from html5lib.constants import voidElements, booleanAttributes, spaceCharacters from html5lib.constants import rcdataElements, entities, xmlEntities f...
bsd-3-clause
GarySparrow/mFlaskWeb
venv/Lib/site-packages/markdown/extensions/admonition.py
110
3158
""" Admonition extension for Python-Markdown ======================================== Adds rST-style admonitions. Inspired by [rST][] feature with the same name. [rST]: http://docutils.sourceforge.net/docs/ref/rst/directives.html#specific-admonitions # noqa See <https://pythonhosted.org/Markdown/extensions/admoniti...
mit
Thermi/ocfs2-tools
ocfs2console/ocfs2interface/terminal.py
8
1913
# OCFS2Console - GUI frontend for OCFS2 management and debugging # Copyright (C) 2005 Oracle. All rights reserved. # # 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 Lice...
gpl-2.0
Lujeni/ansible
lib/ansible/plugins/cache/memory.py
159
1272
# (c) 2014, Brian Coca, Josh Drake, et al # (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 DOCUMENTATION = ''' cache: memory short_description: RAM ba...
gpl-3.0
iivic/BoiseStateX
lms/djangoapps/certificates/tests/factories.py
8
3016
# Factories are self documenting # pylint: disable=missing-docstring import factory from django.core.files.base import ContentFile from factory.django import DjangoModelFactory, ImageField from student.models import LinkedInAddToProfileConfiguration from certificates.models import ( GeneratedCertificate, Certific...
agpl-3.0
elit3ge/SickRage
lib/github/GitCommit.py
74
5226
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
JConwayAWT/PGSS14CC
lib/python/multimetallics/ase/io/castep.py
3
23945
# -*- coding: utf-8 -*- """This module defines I/O routines with CASTEP files. The key idea is that all function accept or return atoms objects. CASTEP specific parameters will be returned through the <atoms>.calc attribute. """ from numpy import sqrt, radians, sin, cos, matrix, array, cross, float32, dot import ase ...
gpl-2.0
ijon/elliptics
bindings/python/routes.py
1
2414
#!/usr/bin/python # -*- coding: utf-8 -*- # ============================================================================= # 2013+ Copyright (c) Kirill Smorodinnikov <shaitkir@gmail.com> # All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Gener...
lgpl-3.0
Unidata/MetPy
v0.11/startingguide-1.py
4
1432
import matplotlib.pyplot as plt import numpy as np import metpy.calc as mpcalc from metpy.plots import SkewT from metpy.units import units fig = plt.figure(figsize=(9, 9)) skew = SkewT(fig) # Create arrays of pressure, temperature, dewpoint, and wind components p = [902, 897, 893, 889, 883, 874, 866, 857, 849, 841, 8...
bsd-3-clause
sdiazpier/nest-simulator
pynest/nest/tests/test_rate_instantaneous_and_delayed.py
20
3690
# -*- coding: utf-8 -*- # # test_rate_instantaneous_and_delayed.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 vers...
gpl-2.0
ity/pants
src/python/pants/core_tasks/deferred_sources_mapper.py
3
3049
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging from...
apache-2.0
gf53520/kafka
tests/kafkatest/tests/tools/log4j_appender_test.py
5
3986
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
Kazade/NeHe-Website
google_appengine/lib/django_1_2/django/contrib/localflavor/pl/pl_administrativeunits.py
433
13194
# -*- coding: utf-8 -*- """ Polish administrative units as in http://pl.wikipedia.org/wiki/Podzia%C5%82_administracyjny_Polski """ ADMINISTRATIVE_UNIT_CHOICES = ( ('wroclaw', u'Wrocław'), ('jeleniagora', u'Jelenia Góra'), ('legnica', u'Legnica'), ('boleslawiecki', u'bolesławiecki'), ('dzierzoniows...
bsd-3-clause
zstackorg/zstack-woodpecker
integrationtest/vm/virtualrouter/snapshot/test_create_snapshot.py
4
3055
''' Test create/restore snapshot functions. In this test, the snapshot was created on unattached data volume. @author: Youyk ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import zstackwoodpecker.zstack_test....
apache-2.0
imsparsh/python-for-android
python3-alpha/python3-src/Lib/copy.py
51
10331
"""Generic (shallow and deep) copying operations. Interface summary: import copy x = copy.copy(y) # make a shallow copy of y x = copy.deepcopy(y) # make a deep copy of y For module specific errors, copy.Error is raised. The difference between shallow and deep copying is only relev...
apache-2.0
hglkrijger/azure-linux-automation
remote-scripts/start-server-without-stopping.py
8
1488
#!/usr/bin/python ########################################## #THIS SCRIPT ACCETPS SOME SERVER PARAMETERS. #PLEASE RUN THE SCRIPT WITH -h OR -help FOR MORE DETAILS. ########################################## from azuremodules import * import argparse import sys #for error checking parser = argparse.ArgumentParser...
apache-2.0
cvegaj/ElectriCERT
venv3/lib/python3.6/site-packages/py/_error.py
5
2928
""" create errno-specific classes for IO or os calls. """ import sys, os, errno class Error(EnvironmentError): def __repr__(self): return "%s.%s %r: %s " %(self.__class__.__module__, self.__class__.__name__, self.__class__.__doc__, ...
gpl-3.0
yhoogstrate/tools-iuc
tools/progressivemauve/xmfa2gff3.py
4
5559
#!/usr/bin/env python import argparse import logging import sys from BCBio import GFF from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqFeature import ( FeatureLocation, SeqFeature ) from Bio.SeqRecord import SeqRecord logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) def par...
mit
susansalkeld/discsongs
discsongs/lib/python2.7/site-packages/pip/_vendor/requests/utils.py
303
19973
# -*- coding: utf-8 -*- """ requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. """ import cgi import codecs import collections import io import os import platform import re import sys import socket import struct from . i...
mit
pratikmallya/hue
desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/Util/asn1.py
122
12727
# -*- coding: ascii -*- # # Util/asn1.py : Minimal support for ASN.1 DER binary encoding. # # =================================================================== # 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...
apache-2.0
mnlipp/mbed
workspace_tools/make.py
35
11383
#! /usr/bin/env python2 """ mbed SDK Copyright (c) 2011-2013 ARM Limited 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 applicabl...
apache-2.0
DazWorrall/ansible
lib/ansible/modules/storage/netapp/netapp_e_amg_sync.py
56
10121
#!/usr/bin/python # (c) 2016, 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
invisiblek/python-for-android
python3-alpha/extra_modules/gdata/analytics/service.py
47
13331
#!/usr/bin/python # # Copyright (C) 2006 Google Inc. # Refactored in 2009 to work for Google Analytics by Sal Uryasev at Juice 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 # # ht...
apache-2.0
aonotas/chainer
chainer/functions/util/forget.py
1
4646
from chainer.backends import cuda from chainer import function from chainer import variable class _DummyFunction(function.Function): def __init__(self, grads): self.grads = grads def forward(self, inputs): xp = cuda.get_array_module(*inputs) return xp.array(0), def backward(self...
mit
wolfier/incubator-airflow
airflow/contrib/hooks/gcp_dataflow_hook.py
2
10241
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
hiteshwadekar/ns-3-dev-ndnSIM
src/uan/bindings/callbacks_list.py
150
1150
callback_classes = [ ['void', 'int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ptr<ns3...
gpl-2.0
shiora/The-Perfect-Pokemon-Team-Balancer
libs/env/Lib/site-packages/whoosh/automata/nfa.py
95
10498
# 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...
gpl-2.0
aglne/lenskit
lenskit-integration-tests/src/it/eval/external-algorithms/item-mean.py
9
2714
import sys class ItemMeanData(object): def __init__(self): self.global_sum = 0 self.global_count = 0 self.item_sums = {} self.item_counts = {} def train(self, trainfile): with open(trainfile) as f: for line in f: user, item, rating = line.st...
lgpl-2.1
gerv/bedrock
tests/functional/contribute/test_tasks.py
11
2578
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import pytest from pages.contribute.tasks import ContributeSignUpPage @pytest.mark.smoke @pytest.mark.nondestructive ...
mpl-2.0
tkstman/lab5
main/lib/werkzeug/debug/tbtools.py
311
16785
# -*- coding: utf-8 -*- """ werkzeug.debug.tbtools ~~~~~~~~~~~~~~~~~~~~~~ This module provides various traceback related utility functions. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import re import os import sys import json import inspect import ...
mit
pienkowb/omelette
omelette/compiler/test/test_validator.py
1
1773
import unittest from omelette.compiler.uml import UMLObject from omelette.compiler.validator import Validator from omelette.compiler import logging class ValidatorTest(unittest.TestCase): def setUp(self): self.uml_object = UMLObject(name="association") self.uml_object.required = {"source-object": ...
gpl-3.0
blab/stability
augur/mutator/mutate_everything_2YP7/foldx_essentials/mutation_stability.py
2
2540
class mutation_stability(object): ''' check mutation and format it so that it's compatible with foldx structure 1HA0 and 2YP7 ''' def __init__(self, mut, structure): self.mut = mut # list of mutations self.mut_set = set(mut) # set of mutations self.mut_chain_info_set = set(...
agpl-3.0
elkingtonmcb/sympy
sympy/stats/rv_interface.py
88
5205
from __future__ import print_function, division from .rv import (probability, expectation, density, where, given, pspace, cdf, sample, sample_iter, random_symbols, independent, dependent, sampling_density) from sympy import sqrt __all__ = ['P', 'E', 'density', 'where', 'given', 'sample', 'cdf', 'pspac...
bsd-3-clause
chitr/neutron
neutron/tests/unit/plugins/ml2/drivers/linuxbridge/mech_driver/test_mech_linuxbridge.py
34
2980
# 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
BorisJeremic/Real-ESSI-Examples
analytic_solution/test_cases/Contact/Coupled_Contact/Steady_State_Single_Foundation_Sysytem_Under_Tension/CoupledSoftContact/n_0.3/compare_txt.py
637
2094
#!/usr/bin/python import h5py import sys import numpy as np import os import re import random # find the path to my own python function: cur_dir=os.getcwd() sep='test_cases' test_DIR=cur_dir.split(sep,1)[0] scriptDIR=test_DIR+'compare_function' sys.path.append(scriptDIR) # import my own function for color and comparat...
cc0-1.0
MrReN/django-oscar
oscar/apps/dashboard/vouchers/forms.py
1
2964
from django import forms from oscar.core.loading import get_model from django.utils.translation import ugettext_lazy as _ Voucher = get_model('voucher', 'Voucher') Benefit = get_model('offer', 'Benefit') Range = get_model('offer', 'Range') class VoucherForm(forms.Form): """ A specialised form for creating a ...
bsd-3-clause
elancom/kafka
system_test/offset_management_testsuite/offset_management_test.py
70
16827
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
beni55/sympy
sympy/core/logic.py
7
9362
"""Logic expressions handling NOTE ---- at present this is mainly needed for facts.py , feel free however to improve this stuff for general purpose. """ from __future__ import print_function, division from sympy.core.compatibility import iterable def _fuzzy_group(args, quick_exit=False): """Return True if all ...
bsd-3-clause
zhaochao/fuel-web
nailgun/nailgun/test/integration/test_public_api.py
1
3000
# -*- coding: utf-8 -*- # Copyright 2014 Mirantis, 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 requi...
apache-2.0
louietsai/python-for-android
python3-alpha/python3-src/Lib/lib2to3/fixes/fix_idioms.py
203
4876
"""Adjust some old Python 2 idioms to their modern counterparts. * Change some type comparisons to isinstance() calls: type(x) == T -> isinstance(x, T) type(x) is T -> isinstance(x, T) type(x) != T -> not isinstance(x, T) type(x) is not T -> not isinstance(x, T) * Change "while 1:" into "while True:"....
apache-2.0
seem-sky/kbengine
kbe/src/lib/python/Lib/posixpath.py
92
13448
"""Common operations on Posix pathnames. Instead of importing this module directly, import os and refer to this module as os.path. The "os.path" name is an alias for this module on Posix systems; on other systems (e.g. Mac, Windows), os.path provides the same operations in a manner specific to that platform, and is a...
lgpl-3.0
tizianasellitto/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_tmpdir.py
173
6017
import sys import py import pytest from _pytest.tmpdir import tmpdir def test_funcarg(testdir): testdir.makepyfile(""" def pytest_generate_tests(metafunc): metafunc.addcall(id='a') metafunc.addcall(id='b') def test_func(tmpdir): pass """) from _pytes...
mpl-2.0
PowerShellEmpire/Empire
lib/modules/powershell/situational_awareness/host/get_proxy.py
10
3067
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Get-Proxy', 'Author': ['@harmj0y'], 'Description': ("Enumerates the proxy server and WPAD conents for the current user. Part of PowerView."), 'Ba...
bsd-3-clause
Qalthos/ansible
lib/ansible/modules/cloud/azure/azure_rm_mysqlfirewallrule_facts.py
12
5867
#!/usr/bin/python # # Copyright (c) 2018 Zim Kalinowski, <zikalino@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
dsfsdgsbngfggb/odoo
addons/hr_payroll/__openerp__.py
260
2421
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
agpl-3.0
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/music21/alpha/trecento/findTrecentoFragments.py
1
11333
#!/usr/bin/python # -*- coding: utf-8 -*- '''Runs a series of tests against the database to see if any of the following unidentified fragments are in there...''' from music21 import metadata from music21 import interval from music21 import note from music21 import stream from music21.alpha.trecento import cadencebo...
mit
orgito/ansible
lib/ansible/modules/packaging/os/rpm_key.py
100
6840
#!/usr/bin/python # -*- coding: utf-8 -*- # Ansible module to import third party repo keys to your rpm db # Copyright: (c) 2013, Héctor Acosta <hector.acosta@gazzang.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, pri...
gpl-3.0
ksmit799/Toontown-Source
toontown/coghq/DistributedInGameEditor.py
1
29740
from pandac.PandaModules import * from direct.interval.IntervalGlobal import * from direct.showbase.PythonUtil import lineInfo, Functor from direct.directnotify import DirectNotifyGlobal from direct.distributed import DistributedObject from otp.level import Level from otp.level import LevelConstants from otp.level impo...
mit
larsks/cloud-init-patches
cloudinit/config/cc_rh_subscription.py
1
15746
# vi: ts=4 expandtab # # Copyright (C) 2015 Red Hat, Inc. # # Author: Brent Baude <bbaude@redhat.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3, as # published by the Free Software Foundation. # # This prog...
gpl-3.0
johnchronis/exareme
exareme-tools/madis/src/functions/aggregate/mining.py
4
13491
import re import itertools import setpath import functions import lib.jopts as jopts from operator import itemgetter import random __docformat__ = 'reStructuredText en' re_params=re.compile('(\w*):(.*)') def consumer(func): """A decorator, advances func to its first yield point when called. """ from fun...
mit
chudaol/edx-platform
pavelib/acceptance_test.py
54
1985
""" Acceptance test tasks """ from paver.easy import task, cmdopts, needs from pavelib.utils.test.suites import AcceptanceTestSuite from optparse import make_option try: from pygments.console import colorize except ImportError: colorize = lambda color, text: text # pylint: disable=invalid-name __test__ = Fal...
agpl-3.0
KublaikhanGeek/fastsocket
kernel/tools/perf/tests/attr.py
19
9247
#! /usr/bin/python import os import sys import glob import optparse import tempfile import logging import shutil import ConfigParser class Fail(Exception): def __init__(self, test, msg): self.msg = msg self.test = test def getMsg(self): return '\'%s\' - %s' % (self.test.path, self.msg)...
gpl-2.0
lintzc/gpdb
src/test/tinc/ext/suds/umx/__init__.py
203
1811
# 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 ...
apache-2.0