content
string
from .config import Configuration import platform class ArchType: UnknownArch = 0 armv7 = 1 armeb = 2 aarch64 = 3 aarch64_be = 4 bpfel = 5 bpfeb = 6 hexagon = 7 mips = 8 mipsel = 9 mips64 = 10 mips64el = 11 msp430 ...
try: from django.conf.urls import include, patterns, url except ImportError: from django.conf.urls.defaults import include, patterns, url from django.conf import settings # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', ...
import logging import re import os import stat from ..base import Antivirus log = logging.getLogger(__name__) class AVGAntiVirusFree(Antivirus): _name = "AVG AntiVirus Free (Linux)" # ================================== # Constructor and destructor stuff # ================================== de...
import logging from portage.util import writemsg_level def create_depgraph_params(myopts, myaction): #configure emerge engine parameters # # self: include _this_ package regardless of if it is merged. # selective: exclude the package if it is merged # recurse: go into the dependencies # deep: go into...
import cx_Oracle import logging import os os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8' class OkSqlHandler(object): @classmethod def setupConn(cls): # dsn = cx_Oracle.makedsn("10.0.44.99", "1521", "ompdb") dsn = cx_Oracle.makedsn("10.0.76.128", "1521", "omp2st") conn = cx_...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :Date: Thu Jun 30 17:17:35 CEST 2011 :Version: 1 :Authors: Einar Uvsløkk <<EMAIL>> :Copyright: (c) 2011 Einar Uvsløkk :License: GNU General Public License (GPL) version 3 or later vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 """ import gettext import locale imp...
""" Microsoft Bitmap picture parser. - file extension: ".bmp" Author: Victor Stinner Creation: 16 december 2005 """ from hachoir_parser import Parser from hachoir_core.field import (FieldSet, UInt8, UInt16, UInt32, Bits, String, RawBytes, Enum, PaddingBytes, NullBytes, createPaddingField) from hachoir_cor...
# -*- coding: utf-8 -*- # # documentation build configuration file, created by # sphinx-quickstart on Sat Sep 27 13:23:22 2008-2009. # # This file is execfile()d with the current directory set to its # containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
# -*- coding: utf-8 -*- # Scrapy settings for zhihu_spider project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/l...
"""Tests for the Area Registry.""" import asyncio import pytest from homeassistant.core import callback from homeassistant.helpers import area_registry import tests.async_mock from tests.common import flush_store, mock_area_registry @pytest.fixture def registry(hass): """Return an empty, loaded, registry.""" ...
"""Tests for protorpc.util.""" import six __author__ = '<EMAIL> (Rafe Kaplan)' import datetime import random import sys import types import unittest from protorpc import test_util from protorpc import util class ModuleInterfaceTest(test_util.ModuleInterfaceTest, test_util.TestCase): M...
from oslo_config import cfg from nova.network import api as network_api from nova.tests.functional.v3 import api_sample_base from nova.tests.unit.api.openstack.compute.contrib import test_networks CONF = cfg.CONF CONF.import_opt('osapi_compute_extension', 'nova.api.openstack.compute.extensions') cla...
import unittest2 as unittest import sys import os from webkitpy.common.system.executive_mock import MockExecutive from webkitpy.common.system.filesystem_mock import MockFileSystem from webkitpy.common.system.outputcapture import OutputCapture from webkitpy.port.gtk import GtkPort from webkitpy.port.pulseaudio_sanitize...
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import sys from django.db.backends import * from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations from django.db.backends.postgresql_psycopg2.client import DatabaseClient from django.db.b...
import sqlalchemy from glance.db.sqlalchemy.migrate_repo import schema def upgrade(migrate_engine): meta = sqlalchemy.schema.MetaData() meta.bind = migrate_engine image_locations_table = sqlalchemy.Table('image_locations', meta, ...
# -*- coding: utf-8 -*- from collections import defaultdict from itertools import combinations from sys import stdout class cached_property(object): """A cached property only computed once """ def __init__(self, func): self.func = func def __get__(self, obj, cls): if obj is None: retu...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'core'} import re from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.iosxr import get_config, load_config from ansible.module_utils.iosxr import iosxr_argument_spe...
# -*- coding: utf-8 -*- """ Flaskr ~~~~~~ A microblog example application written as Flask tutorial with Flask and sqlite3. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os from sqlite3 import dbapi2 as sqlite3 from flask import Flask, request...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch from ansible.modules.network.nxos import nxos_vxlan_vtep from .nxos_module import TestNxosModule, load_fixture, set_module_args class TestNxosVxlanVtepVniModule(TestNxosModule): mo...
#!/usr/bin/env python3 import math import operator import sys def rem(a, b): ret = a % b if ret < 0 and a > 0 and b < 0 or \ ret > 0 and a < 0 and b > 0: ret -= b return ret FUNS = { 'add': operator.add, 'sub': operator.sub, 'mul': operator.mul, 'div': operator.truediv, ...
import instance import openerp.netsvc as netsvc class workflow_service(netsvc.Service): """ Sometimes you might want to fire a signal or re-evaluate the current state of a workflow using the service's API. You can access the workflow services using: >>> import netsvc >>> wf_service = netsvc.Lo...
import os, subprocess import SCons.Builder, SCons.Node, SCons.Errors # Creates the building message # # @param s original message # @param target target name # @param source source name # @param env environment object def __message( s, target, source, env ) : print "building boost from [%s] for ..." % (s...
import errno import roslib roslib.load_manifest('baxter_interface') import rospy from baxter_msgs.msg import ( RobustControllerStatus, ) class RobustController(object): STATE_IDLE = 0 STATE_STARTING = 1 STATE_RUNNING = 2 STATE_STOPPING = 3 def __init__(self, namespace, enable_msg, disable_ms...
from __future__ import unicode_literals from operator import attrgetter from django.test import TestCase from .models import Person class RecursiveM2MTests(TestCase): def setUp(self): self.a, self.b, self.c, self.d = [ Person.objects.create(name=name) for name in ["Anne", "Bill"...
# %codegen(cl_gen) import generate_opencl_structs def main(): plane_defd = [ { 'type': 'vector', 'length': 3, 'name': 'normal', }, { 'type': 'float', 'length': 1, 'name': 'd', } ] sphere_defd = [ ...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} try: from pyVmomi import vim, vmodl HAS_PYVMOMI = True except ImportError: HAS_PYVMOMI = False # https://github.com/vmware/pyvmomi-community-samples/blob/master/samp...
from __future__ import unicode_literals from __future__ import print_function from guessit import u from guessit import slogging, guess_file_info from optparse import OptionParser import logging import sys import os import locale def detect_filename(filename, filetype, info=['filename'], advanced = False): filena...
"""Generates a sysroot tarball for building a specific package. Meant for use after setup_board and build_packages have been run. """ import os from chromite.buildbot import constants from chromite.lib import cros_build_lib from chromite.lib import commandline from chromite.lib import osutils from chromite.lib impor...
import os # File type we know how to handle ftypes = ['cc', 'h', 'py'] c_header ="""/* * @BEGIN LICENSE * * Psi4: an open-source quantum chemistry software package * * Copyright (c) 2007-2021 The Psi4 Developers. * * The copyrights for code used from other parties are included in * the corresponding files. *...
from __future__ import absolute_import, print_function, unicode_literals import os import subprocess from setuptools import Command from setuptools.command.bdist_egg import bdist_egg from setuptools.command.sdist import sdist as base_sdist class assets_mixin(object): def compile_assets(self): try: ...
from openerp.osv import osv,fields class company(osv.osv): _inherit = 'res.company' _columns = { 'manufacturing_lead': fields.float('Manufacturing Lead Time', required=True, help="Security days for each manufacturing operation."), } _defaults = { 'manufacturing_lead': lambda...
# -*- coding: utf-8 -*- import os AWS_ACCESS_KEY_ID = None AWS_SECRET_ACCESS_KEY = None PROJECT_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..') def rel(*x): return os.path.abspath(os.path.join(PROJECT_ROOT, *x)) SETUP_DIR = rel('../../../setup') KEY_DIR = rel('../../../keys') # Stagin...
import struct from pymod.constants import * from pymod.module import * from pymod.util import * class XMNote(Note): """The definition of an note and it's effects in Fast Tracker II""" def __init__(self, note=0, instrument=0, voleffect=0, volparam=0, effect=0, param=0): super(XMNote, self).__init__(note...
""" A script that uses f2py to generate the signature files used to make the Cython BLAS and LAPACK wrappers from the fortran source code for LAPACK and the reference BLAS. To generate the BLAS wrapper signatures call: python _cython_signature_generator.py blas <blas_directory> <out_file> To generate the LAPACK wrapp...
ANSIBLE_METADATA = { 'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community' } import re import time from ansible.module_utils.nxos import get_config, load_config, run_commands from ansible.module_utils.nxos import nxos_argument_spec, check_args from ansible.module_utils.basic import...
import os import unittest import shelve import glob from test import test_support test_support.import_module('anydbm', deprecated=True) class TestCase(unittest.TestCase): fn = "shelftemp" + os.extsep + "db" def test_close(self): d1 = {} s = shelve.Shelf(d1, protocol=2, writeback=False) ...
from __future__ import division import copy from auto_gen import DBAbstraction as _DBAbstraction from auto_gen import DBAbstractionRef, DBModule from id_scope import IdScope class DBAbstraction(_DBAbstraction): def __init__(self, *args, **kwargs): _DBAbstraction.__init__(self, *args, **kwargs) sel...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This program implements the DC power flow as a linear program This version uses the sparse structures and it the problem compilation is blazing fast compared to the full matrix version """ from pulp import * import numpy as np import pandas as pd from matplotlib import ...
import os import sys from appengine_django.db.base import destroy_datastore from appengine_django.db.base import get_test_datastore_paths from django.core.management.base import BaseCommand class Command(BaseCommand): """Overrides the default Django testserver command. Instead of starting the default Django de...
import mock from oslotest import base from oslotest import moxstubout class TestCase(base.BaseTestCase): def setUp(self): super(TestCase, self).setUp() mox_fixture = self.useFixture(moxstubout.MoxStubout()) self.mox = mox_fixture.mox self.stubs = mox_fixture.stubs def patch(s...
# Thanks to Daenyth for help porting this to Arch Linux. import os, platform, re, subprocess _distributor_id_cmdline_re = re.compile("(?:Distributor ID:)\s*(.*)", re.I) _release_cmdline_re = re.compile("(?:Release:)\s*(.*)", re.I) _distributor_id_file_re = re.compile("(?:DISTRIB_ID\s*=)\s*(.*)", re.I) _release_file_r...
from Queue import Empty, Queue import hashlib import sys import threading from couchpotato.core.helpers.variable import natsortKey class Event(object): """ Event object inspired by C# events. Handlers can be registered and unregistered using += and -= operators. Execution and result are influenced by...
from cerbero.config import Platform, Distro, DistroVersion from cerbero.packages import package from cerbero.packages.packagesstore import PackagesStore from test.test_build_common import create_cookbook class Package1(package.Package): name = 'gstreamer-test1' shortdesc = 'GStreamer Test' version = '1.0...
try: import versiondata version = versiondata.version versionString = "%d.%d.%d" % version except ImportError: version = (0, 0, 0) versionString = "[Work In Progress]"
"""module for testing datasets.ocr""" import unittest import numpy as np from pylearn2.datasets.ocr import OCR from pylearn2.space import Conv2DSpace from pylearn2.testing.skip import skip_if_no_data class TestOCR(unittest.TestCase): """ Unit test of OCR dataset Parameters ---------- None """...
## -*- encoding: utf-8 -*- """ Handle Command Line Options """ ############################################################################## # The "git trac ..." command extension for git # Copyright (C) 2013 Volker Braun <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it und...
data = ( 'Shou ', # 0x00 'Yi ', # 0x01 'Zhi ', # 0x02 'Gu ', # 0x03 'Chu ', # 0x04 'Jiang ', # 0x05 'Feng ', # 0x06 'Bei ', # 0x07 'Cay ', # 0x08 'Bian ', # 0x09 'Sui ', # 0x0a 'Qun ', # 0x0b 'Ling ', # 0x0c 'Fu ', # 0x0d 'Zuo ', # 0x0e 'Xia ', # 0x0f 'Xiong ', # 0x10 ...
import json from werkzeug.utils import cached_property from base import db, Base, DB_TEXT_TYPE from cluster import Cluster class ClusterBalancePlan(Base): __tablename__ = 'cluster_balance_plan' cluster_id = db.Column(db.ForeignKey(Cluster.id), unique=True, nullable=False) bala...
# -*- coding: 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): # Changing field 'Guest.notes' db.alter_column(u'rsvp_guest', 'notes', self.gf('django.db.models.fields.Tex...
from __future__ import unicode_literals import frappe, erpnext from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words from frappe.model.naming import make_autoname from frappe import msgprint, _ from erpnext.hr.doctype.process_payroll.process_payroll import get_start_end_dates...
#!/usr/bin/env python3 """ Kernel of Gaussian-transition scalar Markov process? """ import numpy as np from matplotlib import pyplot npr = np.random np.set_printoptions(suppress=True) pyplot.rcParams["font.size"] = 16 pyplot.rcParams["axes.grid"] = True ################################################## SYSTEM def...
from functools import partial from cached_property import cached_property from navmazing import NavigateToSibling, NavigateToAttribute import cfme import cfme.fixtures.pytest_selenium as sel import cfme.web_ui.flash as flash import cfme.web_ui.tabstrip as tabs import cfme.web_ui.toolbar as tb from cfme.web_ui import ...
from flask import Flask, jsonify, render_template, request, url_for app = Flask(__name__) from planout.interpreter import Interpreter import traceback import json import sys def testPlanOutScript(script, inputs={}, overrides=None, assertions=None): payload = {} # make sure experiment runs with the given inputs ...
from openerp.tests.common import TransactionCase from openerp import exceptions class test_contract_hourly_rate(TransactionCase): def setUp(self): super(test_contract_hourly_rate, self).setUp() self.employee_model = self.env['hr.employee'] self.user_model = self.env["res.users"] se...
from spack import * class RAffxparser(RPackage): """Package for parsing Affymetrix files (CDF, CEL, CHP, BPMAP, BAR). It provides methods for fast and memory efficient parsing of Affymetrix files using the Affymetrix' Fusion SDK. Both ASCII- and binary-based files are supported. Currently, there are m...
from __future__ import unicode_literals from django.test import TestCase from .models import Article, Author, Comment, Forum, Post, SystemInfo class NullFkOrderingTests(TestCase): def test_ordering_across_null_fk(self): """ Regression test for #7512 ordering across nullable Foreign Key...
''' @author: Pedram Amini @license: GNU General Public License 2.0 or later @contact: <EMAIL> @organization: www.openrce.org ''' import sys import zlib import cPickle class __crash_bin_struct__: exception_module = None exception_address = 0 write_violation = 0 v...
__reversion__ = "$Revision: 247 $" __author__ = "$Author: holtwick $" __date__ = "$Date: 2008-08-15 13:37:57 +0200 (Fr, 15 Aug 2008) $" __version__ = VERSION = "VERSION{3.0.33}VERSION"[8:-8] __build__ = BUILD = "BUILD{2010-06-16}BUILD"[6:-6] VERSION_STR = """XHTML2PDF/pisa %s (Build %s) http://www.xhtm...
"""myshop URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
from future.moves.urllib.parse import urlencode import github3 import cachecontrol from requests.adapters import HTTPAdapter from requests.exceptions import ConnectionError from addons.github import settings as github_settings from addons.github.exceptions import NotFoundError # Initialize caches https_cache = cach...
import os import shutil import sys import tempfile import unittest from catkin_pkg.cmake import configure_file data = configure_file(os.path.join(os.path.dirname(__file__), '..', '..', 'cmake', 'templates', '_setup_util.py.in'), { 'CATKIN_LIB_ENVIRONMENT_PATHS': "'lib'"...
# -*- coding: utf-8 -*- import gc import sys import unittest from markupsafe import Markup, escape, escape_silent from markupsafe._compat import text_type class MarkupTestCase(unittest.TestCase): def test_adding(self): # adding two strings should escape the unsafe one unsafe = '<script type="appl...
# Base classes class _ScandinavianStemmer(object): """ This subclass encapsulates a method for defining the string region R1. It is used by the Danish, Norwegian, and Swedish stemmer. """ def _r1_scandinavian(self, word, vowels): """ Return the region R1 that is used by the Scan...
""" Regression test for <https://bugs.freedesktop.org/show_bug.cgi?id=32952>, wherein chat states in MUCs were misparsed, and MUC chat states in general. """ from servicetest import assertEquals, assertLength, EventPattern from gabbletest import exec_test, elem, make_muc_presence, sync_stream from mucutil import join_...
# -*- coding: utf-8 -*- # Scrapy settings for mytest project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/latest/...
import datetime import sys from keystoneclient.common import cms from oslo.utils import timeutils import six from keystone.common import controller from keystone.common import dependency from keystone.common import wsgi from keystone import config from keystone import exception from keystone.i18n import _ from keysto...
""" This is a middleware to respect robots.txt policies. To activate it you must enable this middleware and enable the ROBOTSTXT_OBEY setting. """ import robotparser from scrapy import signals, log from scrapy.exceptions import NotConfigured, IgnoreRequest from scrapy.http import Request from scrapy.utils.httpobj im...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.univention_u...
"""Official evaluation script for the MRQA Workshop Shared Task. Adapted fromt the SQuAD v1.1 official evaluation script. Usage: python official_eval.py dataset_file.jsonl.gz prediction_file.json """ from __future__ import absolute_import from __future__ import division from __future__ import print_function impor...
from openerp import fields, models class LabTestResultUrina(models.Model): _name = "myo.lab_test.result.urina" _log_access = False person_code = fields.Char(string='Person Code', required=True) address_code = fields.Char(string='Address Code') lab_test_code = fields.Char(string='Lab Test Code') ...
# -*- coding: utf-8 -*- from plone.jsonapi.routes import add_plone_route # CRUD from plone.jsonapi.routes.api import get_items from plone.jsonapi.routes.api import create_items from plone.jsonapi.routes.api import update_items from plone.jsonapi.routes.api import delete_items from plone.jsonapi.routes.api import url...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} try: from docker import utils except ImportError: # missing docker-py handled in an...
from unittest import mock from neutron_lib.callbacks import events from neutron_lib import exceptions from neutron_lib import fixture from neutron_lib.services.logapi import constants as log_const from neutron.services.logapi.common import exceptions as log_exc from neutron.services.logapi.drivers import base as log_...
""" Helper functions and classes for discussion tests. """ from uuid import uuid4 import json from ...fixtures import LMS_BASE_URL from ...fixtures.course import CourseFixture from ...fixtures.discussion import ( SingleThreadViewFixture, Thread, Response, ) from ...pages.lms.discussion import DiscussionTa...
"""Set up tools for environments for for software construction toolkit. This module is a SCons tool which should be include in all environments. It will automatically be included by the component_setup tool. """ import os import SCons #------------------------------------------------------------------------------...
import libtcodpy as libtcod import sys from time import sleep import os, math, random sys.path.insert(0, os.path.realpath(__file__).replace("TI.py","World")) sys.path.insert(0, os.path.realpath(__file__).replace("TI.py","Engine")) sys.path.insert(0, os.path.realpath(__file__).replace("TI.py","Scripts")) imp...
from m5.params import * from Device import BasicPioDevice class BadDevice(BasicPioDevice): type = 'BadDevice' cxx_header = "dev/baddev.hh" devicename = Param.String("Name of device to error on")
from __future__ import print_function, unicode_literals import sys import subprocess from nltk import compat from nltk.internals import find_binary try: import numpy except ImportError: numpy = None _tadm_bin = None def config_tadm(bin=None): global _tadm_bin _tadm_bin = find_binary( 'tadm', ...
import sys, zipfile, xml.dom.minidom import StringIO class OpenDocumentTextFile : def __init__ (self, filepath): zip = zipfile.ZipFile(filepath) self.content = xml.dom.minidom.parseString(zip.read("content.xml")) def toString (self): """ Converts the document to a string. """ b...
__revision__ = "$Id$" __all__ = ['DevURandomRNG'] import errno import os import stat from rng_base import BaseRNG from Crypto.Util.py3compat import b class DevURandomRNG(BaseRNG): def __init__(self, devname=None): if devname is None: self.name = "/dev/urandom" else: self....
'''A high-level interface to the pycurl extension''' # ** mfx NOTE: the CGI class uses "black magic" using COOKIEFILE in # combination with a non-existant file name. See the libcurl docs # for more info. import sys, pycurl py3 = sys.version_info[0] == 3 # python 2/3 compatibility if py3: import urllib.par...
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) __metaclass__ = type # # Copyright (C) 2017 Lenovo, 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 Licens...
# -*- coding: iso-8859-1 -*- "PDF Template Helper for FPDF.py" __author__ = "Mariano Reingart <<EMAIL>>" __copyright__ = "Copyright (C) 2010 Mariano Reingart" __license__ = "LGPL 3.0" import sys,os,csv from fpdf import FPDF def rgb(col): return (col // 65536), (col // 256 % 256), (col% 256) class Template: ...
__all__ = ['Dependency'] import sys, types from base_app_info import BaseAppInfo class Dependency(object): '''class which handles the texture depedencies in a file or session''' def __init__(my, node_name, file_type, path=""): my.file_type = file_type my.path = path my.info = Base...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} def main(): module = AnsibleModule( argument_spec=dict( name=dict(required=True, type='list'), state=dict( default='present', ...
""" opcode module - potentially shared between dis and other modules which operate on bytecodes (e.g. peephole optimizers). """ __all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs", "haslocal", "hascompare", "hasfree", "opname", "opmap", "HAVE_ARGUMENT", "EXTENDED_ARG", "hasnargs"] #...
from django.conf import settings from django.utils.translation import ugettext_lazy as _ import horizon from openstack_dashboard.dashboards.admin import dashboard class Routers(horizon.Panel): name = _("Routers") slug = 'routers' permissions = ('openstack.services.network',) network_config = getattr(se...
import datetime from sqlalchemy.dialects.postgresql import UUID from ws import db class Artist(db.Model): id = db.Column(db.Integer, primary_key=True) gid = db.Column(UUID, unique=True, nullable=False) name = db.Column(db.UnicodeText, nullable=False) sort_name = db.Column(db.UnicodeText, nullable=Fa...
import os, sys import urlparse from hopper.utils.logger import * import hopper.utils.args import hopper.utils.Proxy import hopper.utils.tasks class CommandHopperBase(hopper.utils.args.CommandBase): threadLimit = hopper.utils.args.ValueOption( None, "threads", default = None, description = "The maximum number...
data = ( 'Ku ', # 0x00 'Ke ', # 0x01 'Tang ', # 0x02 'Kun ', # 0x03 'Ni ', # 0x04 'Jian ', # 0x05 'Dui ', # 0x06 'Jin ', # 0x07 'Gang ', # 0x08 'Yu ', # 0x09 'E ', # 0x0a 'Peng ', # 0x0b 'Gu ', # 0x0c 'Tu ', # 0x0d 'Leng ', # 0x0e '[?] ', # 0x0f 'Ya ', # 0x10 'Qian ', ...
import boto from boto.services.service import Service from boto.services.message import ServiceMessage import os import mimetypes class SonOfMMM(Service): def __init__(self, config_file=None): super(SonOfMMM, self).__init__(config_file) self.log_file = '%s.log' % self.instance_id self.log_...
from msrest.serialization import Model from msrest.exceptions import HttpOperationError class FabricError(Model): """The REST API operations for Service Fabric return standard HTTP status codes. This type defines the additional information returned from the Service Fabric API operations that are not succe...
try: import bigsuds except ImportError: bigsuds_found = False else: bigsuds_found = True TEMPLATE_TYPE = DEFAULT_TEMPLATE_TYPE = 'TTYPE_TCP' TEMPLATE_TYPE_CHOICES = ['tcp', 'tcp_echo', 'tcp_half_open'] DEFAULT_PARENT = DEFAULT_TEMPLATE_TYPE_CHOICE = DEFAULT_TEMPLATE_TYPE.replace('TTYPE_', '').lower() # =...
''' Interface to interact on a database level ''' # Import python libs import os import io import shutil # Import sorbic libs import sorbic.ind.hdht import sorbic.stor.files import sorbic.utils.traverse # Import third party libs import msgpack DB_OPTS = ( 'key_delim', 'hash_limit', 'key_hash', ...
import sys, os import types from twisted.trial import unittest from twisted.python import rebuild import crash_test_dummy f = crash_test_dummy.foo class Foo: pass class Bar(Foo): pass class Baz(object): pass class Buz(Bar, Baz): pass class HashRaisesRuntimeError: """ Things that don't hash (raise an Excepti...
from sos.report.plugins import Plugin, RedHatPlugin class Buildah(Plugin, RedHatPlugin): short_desc = 'Buildah container and image builder' plugin_name = 'buildah' packages = ('buildah',) profiles = ('container',) def setup(self): subcmds = [ 'containers', 'conta...
#!/usr/bin/env python # -*- coding: utf-8 -*- #----------------------- # Name: cache_file.py # Python Library # Purpose: Persistant file-backed cache using /tmp/ to share data # using flock or msvcrt.locking to allow safe concurrent # access. #----------------------- import struct import errno import...
from awxkit.api.mixins import HasCreate, HasInstanceGroups, HasNotifications, DSAdapter from awxkit.utils import random_title, suppress, PseudoNamespace from awxkit.api.resources import resources import awxkit.exceptions as exc from . import base from . import page class Organization(HasCreate, HasInstanceGroups, Has...
import argparse import boto3 def main(): parser = argparse.ArgumentParser( description=("Set the policy of the servo-perf bucket. " "Remember to set your S3 credentials " "https://github.com/boto/boto3")) parser.parse_args() s3 = boto3.resource('s3') ...
""" Archive tools for wheel. """ import os import os.path import time import zipfile from distutils import log def archive_wheelfile(base_name, base_dir): """Archive all files under `base_dir` in a whl file and name it like `base_name`. """ olddir = os.path.abspath(os.curdir) base_name = os.path....