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
mirror/vbox
src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Common/VpdInfoFile.py
11
11296
## @file # # This package manage the VPD PCD information file which will be generated # by build tool's autogen. # The VPD PCD information file will be input for third-party BPDG tool which # is pointed by *_*_*_VPD_TOOL_GUID in conf/tools_def.txt # # # Copyright (c) 2010, Intel Corporation. All rights reserved.<BR> ...
gpl-2.0
Drooids/odoo
addons/auth_crypt/auth_crypt.py
49
3999
import logging from passlib.context import CryptContext import openerp from openerp.osv import fields, osv openerp.addons.base.res.res_users.USER_PRIVATE_FIELDS.append('password_crypt') _logger = logging.getLogger(__name__) default_crypt_context = CryptContext( # kdf which can be verified by the context. The d...
agpl-3.0
paolap/cwsl-mas
cwsl/tests/test_scheduler.py
4
2051
""" Authors: Tim Bedin, Tim Erwin Copyright 2014 CSIRO 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 w...
apache-2.0
shakamunyi/neutron-vrrp
neutron/plugins/openvswitch/ovs_models_v2.py
49
3896
# Copyright 2011 VMware, 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 # # Unless required by ...
apache-2.0
linzhaolover/myansible
capi_states/mitaka/gpu_volume.py
2
3009
#!/usr/bin/env python """ a module of share host GPU, created on 2016/05/31 """ import os import re #import shutil from oslo_log import log LOG = log.getLogger(__name__) def search_file(topPath, reValue): print "Jian>>> topPath:%s search:%s" % (topPath, reValue) resultList = [] for rootpath, dirnames, f...
apache-2.0
marcsans/cnn-physics-perception
phy/lib/python2.7/site-packages/sklearn/externals/joblib/__init__.py
23
5101
""" Joblib is a set of tools to provide **lightweight pipelining in Python**. In particular, joblib offers: 1. transparent disk-caching of the output values and lazy re-evaluation (memoize pattern) 2. easy simple parallel computing 3. logging and tracing of the execution Joblib is optimized to be **fast*...
mit
redhat-openstack/rdo-infra
ci-scripts/dlrnapi_promoter/test_registries_client_unit.py
1
10398
import subprocess import yaml try: # Python3 imports from unittest import mock from unittest.mock import patch except ImportError: # Python2 imports from mock import patch import mock from common import PromotionError from dlrn_hash import DlrnCommitDistroHash, DlrnHash from test_unit_fixture...
apache-2.0
alphatwirl/alphatwirl
alphatwirl/summary/Scan.py
1
1209
# Tai Sakuma <tai.sakuma@gmail.com> ##__________________________________________________________________|| import numpy as np import copy ##__________________________________________________________________|| class Scan: def __init__(self, val=None, weight=1, contents=None): if contents is not None: ...
bsd-3-clause
paukenba/youtube-dl
youtube_dl/extractor/xhamster.py
58
6318
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( unified_strdate, str_to_int, int_or_none, parse_duration, ) class XHamsterIE(InfoExtractor): _VALID_URL = r'(?P<proto>https?)://(?:.+?\.)?xhamster\.com/movies/(?P<id>[0-9]+)/(?P<seo>.+?)\.ht...
unlicense
oasis-open/cti-python-stix2
stix2/test/v20/test_kill_chain_phases.py
1
1652
"""Tests for stix.ExternalReference""" import pytest import stix2 LMCO_RECON = """{ "kill_chain_name": "lockheed-martin-cyber-kill-chain", "phase_name": "reconnaissance" }""" def test_lockheed_martin_cyber_kill_chain(): recon = stix2.v20.KillChainPhase( kill_chain_name="lockheed-martin-cyber-ki...
bsd-3-clause
zerebubuth/mapnik
scons/scons-local-2.5.0/SCons/Tool/msvc.py
3
11464
"""engine.SCons.Tool.msvc Tool-specific initialization for Microsoft Visual C/C++. 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 - 2016 The SCons Foundation # # Permission is hereby ...
lgpl-2.1
tvalacarta/tvalacarta
python/main-classic/lib/youtube_dl/extractor/vimple.py
64
1968
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import int_or_none class SprutoBaseIE(InfoExtractor): def _extract_spruto(self, spruto, video_id): playlist = spruto['playlist'][0] title = playlist['title'] video_id = playlist.get('videoId') or video_...
gpl-3.0
guymakam/Kodi-Israel
plugin.video.ilten/resources/m3u8/model.py
3
11066
from collections import namedtuple import os import errno import math import urlparse import re from resources.m3u8 import parser class M3U8(object): ''' Represents a single M3U8 playlist. Should be instantiated with the content as string. Parameters: `content` the m3u8 content as strin...
gpl-2.0
kybriainfotech/iSocioCRM
addons/report/tests/test_reports.py
385
2251
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
direvus/ansible
lib/ansible/modules/network/ios/ios_logging.py
48
12512
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
gpl-3.0
mancoast/CPythonPyc_test
fail/324_test_urllib2net.py
6
13263
#!/usr/bin/env python3 import unittest from test import support from test.test_urllib2 import sanepathname2url import os import socket import urllib.error import urllib.request import sys try: import ssl except ImportError: ssl = None TIMEOUT = 60 # seconds def _retry_thrice(func, exc, *args, **kwargs): ...
gpl-3.0
hbrunn/website
website_event_register_free/__init__.py
71
1029
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2015 Therp BV <http://therp.nl>. # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
Designist/audacity
lib-src/lv2/lv2/plugins/eg-midigate.lv2/waflib/Build.py
265
20971
#! /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 os,sys,errno,re,shutil try: import cPickle except ImportError: import pickle as cPickle from waflib import Runner,TaskGen,Utils,ConfigSet,Task,Logs,Options,Context,Er...
gpl-2.0
kaiyuanl/gem5
src/cpu/kvm/X86KvmCPU.py
54
2012
# Copyright (c) 2013 Andreas Sandberg # 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 fol...
bsd-3-clause
ArcEye/MK-Qt5
nosetests/unittest_instbindings.py
11
1279
#!/usr/bin/env python # verify the cython inst bindings from nose import with_setup from machinekit.nosetests.realtime import setup_module ,teardown_module from machinekit.nosetests.support import fnear from unittest import TestCase import time,os,ConfigParser from machinekit import rtapi,hal class TestIinst(TestCa...
lgpl-2.1
js0701/chromium-crosswalk
tools/telemetry/telemetry/value/list_of_scalar_values.py
9
7147
# Copyright 2013 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 numbers import math from telemetry import value as value_module from telemetry.value import none_values from telemetry.value import summarizable de...
bsd-3-clause
Orav/kbengine
kbe/res/scripts/common/Lib/email/mime/text.py
2
1408
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Class representing text/* type MIME documents.""" __all__ = ['MIMEText'] from email.mime.nonmultipart import MIMENonMultipart class MIMEText(MIMENonMultipart): """Class for generating t...
lgpl-3.0
cc272309126/panda3d
contrib/src/sceneeditor/propertyWindow.py
8
70519
################################################################# # propertyWindow.py # Written by Yi-Hong Lin, yihhongl@andrew.cmu.edu, 2004 ################################################################# from direct.tkwidgets.AppShell import * from direct.showbase.TkGlobal import * from seColorEntry import * from...
bsd-3-clause
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/rsa/_version133.py
82
11764
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Un...
gpl-3.0
Shrhawk/edx-platform
common/lib/xmodule/xmodule/tests/test_editing_module.py
181
2640
""" Tests for editing descriptors""" import unittest import os import logging from mock import Mock from pkg_resources import resource_string from opaque_keys.edx.locations import Location from xmodule.editing_module import TabsEditingDescriptor from xblock.field_data import DictFieldData from xblock.fields import Sco...
agpl-3.0
robertmattmueller/sdac-compiler
sympy/combinatorics/tests/test_subsets.py
120
1918
from sympy.combinatorics import Subset def test_subset(): a = Subset(['c', 'd'], ['a', 'b', 'c', 'd']) assert a.next_binary() == Subset(['b'], ['a', 'b', 'c', 'd']) assert a.prev_binary() == Subset(['c'], ['a', 'b', 'c', 'd']) assert a.next_lexicographic() == Subset(['d'], ['a', 'b', 'c', 'd']) as...
gpl-3.0
michael-lazar/rtv
rtv/packages/praw/helpers.py
2
19086
# This file is part of PRAW. # # PRAW 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. # # PRAW is distributed in the hope that it will ...
mit
rosmo/boto
boto/kinesis/layer1.py
102
40879
# Copyright (c) 2014 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 limitation the rights ...
mit
flyfei/python-for-android
python3-alpha/python3-src/Lib/plat-unixware7/STROPTS.py
106
6524
# Generated by h2py from /usr/include/sys/stropts.h # Included from sys/types.h def quad_low(x): return x.val[0] ADT_EMASKSIZE = 8 SHRT_MIN = -32768 SHRT_MAX = 32767 INT_MIN = (-2147483647-1) INT_MAX = 2147483647 LONG_MIN = (-2147483647-1) LONG_MAX = 2147483647 OFF32_MAX = LONG_MAX ISTAT_ASSERTED = 0 ISTAT_ASSUMED = ...
apache-2.0
yceruto/django
tests/model_fields/tests.py
6
26311
from __future__ import unicode_literals import datetime from decimal import Decimal import unittest import warnings from django import test from django import forms from django.core.exceptions import ValidationError from django.db import connection, models, IntegrityError from django.db.models.fields import ( Aut...
bsd-3-clause
gdooper/scipy
benchmarks/benchmarks/go_benchmark_functions/go_funcs_Z.py
47
6803
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import from numpy import abs, sum, sign, arange from .go_benchmark import Benchmark class Zacharov(Benchmark): r""" Zacharov objective function. This class defines the Zacharov [1]_ global optimization problem. This i...
bsd-3-clause
absperf/wagtailapproval
wagtailapproval/menu.py
1
3637
from __future__ import (absolute_import, division, print_function, unicode_literals) import itertools from django.contrib.auth import get_user from django.core.urlresolvers import reverse, reverse_lazy from django.utils.translation import ugettext_lazy as _ from django.utils.translation import...
bsd-2-clause
40223240/2015cdb_g3_40223240
static/Brython3.1.1-20150328-091302/Lib/logging/config.py
739
35619
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
gpl-3.0
lulivi/debate_bot
bot.py
1
5398
#!/usr/bin/python3 -u # -*- coding: utf-8 -*- import sys import time import telebot # Librería de la API del bot. from telebot import types # Tipos para la API del bot. from priv.__init__ import token as tk bot = telebot.TeleBot(tk()) # Creamos el objeto de nuestro bot. ###############################################...
gpl-2.0
jordancheah/zipline
tests/test_munge.py
34
1794
# # Copyright 2015 Quantopian, 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 wr...
apache-2.0
chugunovyar/factoryForBuild
neuron/SaveClosedPossition.py
1
31069
# -*- coding: utf-8 -*- import logging from neuron.models import DataSet import dateutil.parser as DP loggermsg = logging.getLogger('django') def saveClosedPossition(jsondata): #loggermsg.info(len(jsondata)) # Проверяем есть ли такой ордер в БД ifExistOrdernum = DataSet.objects.filter(open_magicnum=j...
gpl-3.0
rodrigc/buildbot
master/buildbot/test/unit/util/test_state.py
6
2671
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
campbe13/openhatch
vendor/packages/Django/django/http/utils.py
36
1499
""" Functions that modify an HTTP request or response in some way. """ # This group of functions are run as part of the response handling, after # everything else, including all response middleware. Think of them as # "compulsory response middleware". Be careful about what goes here, because # it's a little fiddly to ...
agpl-3.0
dustcloud/dustlink
SmartMeshSDK/IpMgrConnectorMux/IpMgrConnectorMuxInternal.py
4
9593
import threading import socket import select import struct import MuxMsg from SmartMeshSDK import ApiException, \ ApiConnector from SmartMeshSDK.ApiDefinition import IpMgrDefinition class IpMgrConnectorMuxInternal(ApiConnector.ApiConnector ) : ''' ...
bsd-3-clause
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/core/checks/model_checks.py
1
2454
# -*- coding: utf-8 -*- from __future__ import unicode_literals import inspect import types from django.apps import apps from django.core.checks import Error, Tags, register @register(Tags.models) def check_all_models(app_configs=None, **kwargs): errors = [] for model in apps.get_models(): ...
mit
MM1nd/worldengine
worldengine/astar.py
4
6331
#!/usr/bin/env python """ A* works based on cost, the higher the cost the less likely it is to travel that path. There are no hard limits, it works on minus infinity and positive infinity. It will take a starting position and and end position, then find the path between the two with the lowest cost. This is perfect f...
mit
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/ipv4_external_reachability/prefixes/prefixes_/__init__.py
1
42200
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
rohitwaghchaure/erpnext_develop
erpnext/patches/v4_0/create_price_list_if_missing.py
119
1087
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils.nestedset import get_root_of def execute(): # setup not complete if not frappe.db.sql("""select ...
gpl-3.0
mnach/suds-py3k
suds/serviceproxy.py
2
2974
# 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
JaDogg/__py_playground
reference/parsley/ometa/test/test_tube.py
3
3004
from __future__ import absolute_import, unicode_literals import unittest from ometa.grammar import OMeta from ometa.tube import TrampolinedParser def iterbytes(originalBytes): for i in range(len(originalBytes)): yield originalBytes[i:i+1] class TrampolinedReceiver(): """ Receive and store the ...
mit
box/ClusterRunner
app/master/time_based_atom_grouper.py
4
11090
from collections import OrderedDict from app.master.atom_grouper import AtomGrouper class TimeBasedAtomGrouper(object): """ This class implements the algorithm to best split & group atoms based on historic time values. This algorithm is somewhat complicated, so I'm going to give a summary here. ~~~~~...
apache-2.0
bgxavier/nova
nova/tests/unit/virt/hyperv/test_networkutils.py
68
3245
# Copyright 2014 Cloudbase Solutions Srl # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
NeCTAR-RC/nova
nova/tests/unit/api/openstack/compute/test_services.py
9
39890
# Copyright 2012 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
Ujjwal29/ansible
test/units/module_utils/test_database.py
325
5737
import collections import mock import os import re from nose.tools import eq_ try: from nose.tools import assert_raises_regexp except ImportError: # Python < 2.7 def assert_raises_regexp(expected, regexp, callable, *a, **kw): try: callable(*a, **kw) except expected as e: ...
gpl-3.0
ojengwa/osmc
package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x0c5.py
253
4581
data = ( 'sseum', # 0x00 'sseub', # 0x01 'sseubs', # 0x02 'sseus', # 0x03 'sseuss', # 0x04 'sseung', # 0x05 'sseuj', # 0x06 'sseuc', # 0x07 'sseuk', # 0x08 'sseut', # 0x09 'sseup', # 0x0a 'sseuh', # 0x0b 'ssyi', # 0x0c 'ssyig', # 0x0d 'ssyigg', # 0x0e 'ssyigs', # 0x0f 'ss...
gpl-2.0
Kamik423/uni_plan
plan/plan/lib64/python3.4/encodings/iso8859_10.py
272
13589
""" Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.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_table) def decode(self,input,errors...
apache-2.0
Thraxis/pymedusa
sickbeard/server/web/config/notifications.py
1
17493
# coding=utf-8 """ Configure notifications """ from __future__ import unicode_literals import os from tornado.routes import route import sickbeard from sickbeard import ( config, logger, ui, ) from sickrage.helper.common import try_int from sickrage.helper.encoding import ek from sickbeard.server.web.core import...
gpl-3.0
chhao91/QGIS
python/plugins/processing/gui/CommanderWindow.py
12
9065
# -*- coding: utf-8 -*- """ *************************************************************************** CommanderWindow.py --------------------- Date : April 2013 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ************************...
gpl-2.0
poliastro/poliastro
tests/test_bodies.py
1
2126
import pytest from astropy import units as u from astropy.tests.helper import assert_quantity_allclose from poliastro.bodies import Body, Earth, Jupiter, Sun def test_body_has_k_given_in_constructor(): k = 3.98e5 * u.km ** 3 / u.s ** 2 earth = Body(None, k, "") assert earth.k == k def test_body_from_pa...
mit
cyx1231st/nova
nova/objects/build_request.py
6
6724
# 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
eddyb/servo
tests/wpt/web-platform-tests/mathml/tools/stacks.py
92
2243
#!/usr/bin/python from utils import mathfont import fontforge v = 7 * mathfont.em f = mathfont.create("stack-axisheight%d" % v) f.math.AxisHeight = v f.math.StackBottomDisplayStyleShiftDown = 0 f.math.StackBottomShiftDown = 0 f.math.StackDisplayStyleGapMin = 0 f.math.StackGapMin = 0 f.math.StackTopDisplayStyleShiftUp...
mpl-2.0
lferr/charm
charm/test/schemes/dabenc_test.py
1
3191
from charm.schemes.dabe_aw11 import Dabe from charm.adapters.dabenc_adapt_hybrid import HybridABEncMA from charm.toolbox.pairinggroup import PairingGroup, GT import unittest debug = False class DabeTest(unittest.TestCase): def testDabe(self): groupObj = PairingGroup('SS512') dabe = Dabe(groupObj)...
lgpl-3.0
sem-geologist/hyperspy
hyperspy/samfire_utils/goodness_of_fit_tests/test_general.py
6
1052
# -*- coding: utf-8 -*- # Copyright 2007-2016 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
rhdedgar/openshift-tools
openshift/installer/vendored/openshift-ansible-3.4.40/roles/lib_openshift/src/test/unit/test_oadm_manage_node.py
17
10306
''' Unit tests for oadm_manage_node ''' import os import six import sys import unittest import mock # Removing invalid variable names for tests so that I can # keep them brief # pylint: disable=invalid-name,no-name-in-module # Disable import-error b/c our libraries aren't loaded in jenkins # pylint: disable=import-e...
apache-2.0
sankalpg/Essentia_tonicDebug_TEMP
test/src/unittest/sfx/test_aftermaxtobeforemaxenergyratio_streaming.py
10
2179
#!/usr/bin/env python # Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), e...
agpl-3.0
blankenberg/tools-iuc
data_managers/data_manager_diamond_database_builder/data_manager/data_manager_diamond_database_builder.py
9
10627
#!/usr/bin/env python import bz2 import gzip import json import optparse import os import shutil import subprocess import sys import tarfile import tempfile import urllib.error import urllib.parse import urllib.request import zipfile from ftplib import FTP CHUNK_SIZE = 2**20 # 1mb def cleanup_before_exit(tmp_dir): ...
mit
yuewko/neutron
neutron/agent/ovsdb/impl_idl.py
4
7372
# Copyright (c) 2015 Red Hat, 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 ...
apache-2.0
theilmbh/pyoperant
pyoperant/panels.py
3
1654
## Panel classes class BasePanel(object): """Returns a panel instance. This class should be subclassed to define a local panel configuration. To build a panel, do the following in the __init__() method of your local subclass: 1. add instances of the necessary interfaces to the 'interfaces' ...
bsd-3-clause
lattwood/phantomjs
src/breakpad/src/tools/gyp/tools/pretty_vcproj.py
137
9479
#!/usr/bin/python2.5 # Copyright 2009 Google Inc. # All Rights Reserved. """Make the format of a vcproj really pretty. This script normalize and sort an xml. It also fetches all the properties inside linked vsprops and include them explicitly in the vcproj. It outputs the resulting xml to stdout. """ __...
bsd-3-clause
ahmetcemturan/SFACT
skeinforge_application/skeinforge_plugins/craft_plugins/limit.py
1
8282
#! /usr/bin/env python """ This page is in the table of contents. This plugin limits the feed rate of the tool head, so that the stepper motors are not driven too fast and skip steps. The limit manual page is at: http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Limit The maximum z feed rate is defined in speed...
agpl-3.0
staranjeet/fjord
vendor/packages/mock/setup.py
91
2134
#! /usr/bin/env python # 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/ from mock import __version__ import os NAME = 'mock' MODULES = ['mock'] DESCRIPTION = 'A Python Mocking and Patching Library for Testing' URL = "...
bsd-3-clause
K-Constantine/Amaraki
core/deps/gyp/test/mac/gyptest-debuginfo.py
349
1152
#!/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. """ Tests things related to debug information generation. """ import TestGyp import sys if sys.platform == 'darwin': test = TestGyp.Tes...
mit
trankmichael/scikit-learn
examples/cluster/plot_agglomerative_clustering_metrics.py
402
4492
""" Agglomerative clustering with different metrics =============================================== Demonstrates the effect of different metrics on the hierarchical clustering. The example is engineered to show the effect of the choice of different metrics. It is applied to waveforms, which can be seen as high-dimens...
bsd-3-clause
mfnch/pyrtist
old/web/in/examples/create_example.py
1
2754
import sys, os, os.path, commands, re usage = "USAGE: python create_example.py box.example" if len(sys.argv) != 2: raise "Expected one argument.\n" + usage example_file = sys.argv[1] print "Working on '%s'..." % example_file # Default values for variables which may be changed inside example_file in_directory = "....
lgpl-2.1
amir-qayyum-khan/edx-platform
cms/djangoapps/contentstore/management/commands/fix_not_found.py
62
1152
""" Script for fixing the item not found errors in a course """ from django.core.management.base import BaseCommand, CommandError from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.django import modulestore from xmodule.modulestore import ModuleStoreEnum # To run from command line: ./manage.py cms fix...
agpl-3.0
Jgarcia-IAS/Fidelizacion_odoo
openerp/addons/project/res_partner.py
334
1953
# -*- 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
kohnle-lernmodule/exeLearningPlus1_04
twisted/test/test_stateful.py
20
1570
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for twisted.protocols.stateful """ from twisted.test import test_protocols from twisted.protocols.stateful import StatefulProtocol from struct import pack, unpack class MyInt32StringReceiver(StatefulProtocol): MAX_...
gpl-2.0
PythonSanSebastian/epcon
p3/management/commands/attendify_speakers_xlsx.py
2
6861
# -*- coding: utf-8 -*- """ Update an Attendify speakers XLSX file with the current list of speakers. Usage: manage.py attendify_speakers_xlsx ep2016 speakers.xlsx Note that for Attendify you have to download the speakers before running this script, since they add meta data to the downloaded file ...
bsd-2-clause
modulexcite/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/iso8859_5.py
93
13578
""" Python Character Mapping Codec iso8859_5 generated from 'MAPPINGS/ISO8859/8859-5.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_table) def decode(self,i...
apache-2.0
Nitaco/ansible
test/units/modules/network/nxos/test_nxos_portchannel.py
53
2843
# (c) 2016 Red Hat 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. # # Ansible is dis...
gpl-3.0
skidzo/sympy
sympy/physics/quantum/cartesian.py
98
8766
"""Operators and states for 1D cartesian position and momentum. TODO: * Add 3D classes to mappings in operatorset.py """ from __future__ import print_function, division from sympy import DiracDelta, exp, I, Interval, pi, S, sqrt from sympy.core.compatibility import range from sympy.physics.quantum.constants impor...
bsd-3-clause
pelodelfuego/word2vec-toolbox
toolbox/cpLib/test/testConcept.py
1
2049
#!/usr/bin/env python # encoding: utf-8 import unittest import cpLib.concept as cp import cpLib.conceptDB as db import numpy as np class ConceptTest(unittest.TestCase): def setUp(self): self.d = db.DB('../data/voc/npy/googleNews_mini.npy') def test_transform(self): k = self.d.get('king') ...
gpl-3.0
ltilve/ChromiumGStreamerBackend
tools/telemetry/third_party/gsutilz/gslib/tests/test_cp.py
11
93771
# -*- coding: utf-8 -*- # Copyright 2013 Google 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 # # Unless require...
bsd-3-clause
sestrella/ansible
lib/ansible/modules/network/f5/bigip_firewall_log_profile.py
23
28678
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2019, F5 Networks 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', ...
gpl-3.0
Salat-Cx65/python-for-android
python3-alpha/python3-src/Tools/pybench/Dict.py
92
9261
from pybench import Test class DictCreation(Test): version = 2.0 operations = 5*(5 + 5) rounds = 80000 def test(self): for i in range(self.rounds): d1 = {} d2 = {} d3 = {} d4 = {} d5 = {} d1 = {1:2,3:4,5:6} ...
apache-2.0
priyaganti/rockstor-core
src/rockstor/system/iscsi.py
2
2084
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
gpl-3.0
tkwon/dj-stripe
djstripe/migrations/0025_auto_20170322_0428.py
1
3906
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-22 04:28 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('djstripe', '0024_auto_20170308_0757'), ] operations = [ migrations.AlterFie...
mit
eqcorrscan/ci.testing
eqcorrscan/utils/stacking.py
1
6254
""" Utility module of the EQcorrscan package to allow for different methods of \ stacking of seismic signal in one place. :copyright: EQcorrscan developers. :license: GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html) """ from __future__ import absolute_import from __f...
lgpl-3.0
ArtRand/signalAlign
externalTools/lastz-distrib-1.03.54/tools/any_to_qdna.py
6
3214
#!/usr/bin/env python """ Convert any file to a LASTZ quantum dna file, just by appending qdna headers Qdna file format is shown below (omitting "named properties", which we don't use). We simply create all the headers and copy the file as the "data sequence". offset 0x00: C4 B4 71 97 big endian magic number (97...
mit
gspilio/nova
nova/network/quantumv2/api.py
1
41934
# Copyright 2012 OpenStack Foundation # All Rights Reserved # Copyright (c) 2012 NEC Corporation # # 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/lic...
apache-2.0
dsbrown/FreeCAD
src/Mod/Path/PathScripts/PathCompoundExtended.py
16
5492
# -*- coding: utf-8 -*- #*************************************************************************** #* * #* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> * #* ...
lgpl-2.1
kangkot/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/pythonwin/pywin/Demos/dibdemo.py
17
1930
# A demo which creates a view and a frame which displays a PPM format bitmap # # This hasnnt been run in a while, as I dont have many of that format around! import win32ui import win32con import win32api import string class DIBView: def __init__(self, doc, dib): self.dib = dib self.view = win32ui.CreateView(doc)...
apache-2.0
sentient-energy/emsw-oe-mirror
contrib/mtnpatch.py
45
2048
#!/usr/bin/env python import sys, os, string, getopt, re mtncmd = "mtn" def main(argv = None): if argv is None: argv = sys.argv opts, list = getopt.getopt(sys.argv[1:], ':R') if len(list) < 1: print "You must specify a file" return 2 reverse = False for o, a in opts: ...
mit
osvalr/odoo
addons/resource/tests/common.py
305
5016
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
hlt-mt/tensorflow
tensorflow/python/framework/function.py
4
15235
# Copyright 2015 Google 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 # # Unless required by applicable law or a...
apache-2.0
Chealion/yycbike
archive/weatherLoad.py
1
6271
#! /usr/bin/python # :set tabstop=4 shiftwidth=4 expandtab # Downoads Environment Canada data and sends the data to Graphite. Additionally logs the data to a file we can use to import later import csv import time import graphitesend import urllib2 from datetime import date, timedelta import datetime graphitesend.ini...
mit
VirtusLab/ansible-modules-extras
system/kernel_blacklist.py
153
3807
#!/usr/bin/python # encoding: utf-8 -*- # (c) 2013, Matthias Vogelgesang <matthias.vogelgesang@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 ve...
gpl-3.0
gmimano/commcaretest
corehq/apps/api/util.py
2
1330
from django.core.exceptions import ObjectDoesNotExist from django.utils.translation import ugettext as _ from couchdbkit.exceptions import ResourceNotFound def get_object_or_not_exist(cls, doc_id, domain, additional_doc_types=None): """ Given a Document class, id, and domain, get that object or raise an Ob...
bsd-3-clause
Ziqi-Li/bknqgis
bokeh/bokeh/server/server.py
1
10467
''' Provides a Server which instantiates Application instances as clients connect ''' from __future__ import absolute_import, print_function import atexit import logging log = logging.getLogger(__name__) import signal import tornado from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop from tor...
gpl-2.0
raedwulf/linux
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
uwdata/termite-data-server
web2py/applications-original/admin/controllers/mercurial.py
34
2545
from gluon.fileutils import read_file, write_file if DEMO_MODE or MULTI_USER_MODE: session.flash = T('disabled in demo mode') redirect(URL('default', 'site')) if not have_mercurial: session.flash = T("Sorry, could not find mercurial installed") redirect(URL('default', 'design', args=request.args(0))) ...
bsd-3-clause
nikolasjansen/nija
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/_mapping.py
189
38484
# -*- coding: utf-8 -*- """ pygments.lexers._mapping ~~~~~~~~~~~~~~~~~~~~~~~~ Lexer mapping defintions. This file is generated by itself. Everytime you change something on a builtin lexer defintion, run this script from the lexers folder to update it. Do not alter the LEXERS dictionary by hand...
mit
JamesDickenson/aima-python
submissions/Dickenson/vacuum2Runner.py
18
6345
import agents as ag import envgui as gui # change this line ONLY to refer to your project import submissions.Dickenson.vacuum2 as v2 # ______________________________________________________________________________ # Vacuum environment class Dirt(ag.Thing): pass class VacuumEnvironment(ag.XYEnvironment): """...
mit
jelly/calibre
src/calibre/db/cli/cmd_catalog.py
2
3866
#!/usr/bin/env python2 # vim:fileencoding=utf-8 # License: GPLv3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net> from __future__ import absolute_import, division, print_function, unicode_literals import os from calibre.customize.ui import available_catalog_formats, plugin_for_catalog_format from calibre.db.cl...
gpl-3.0
skiselev/upm
examples/python/aeotecsdg2.py
7
3146
#!/usr/bin/python # Author: Jon Trulson <jtrulson@ics.com> # Copyright (c) 2016 Intel Corporation. # # 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 l...
mit