content
stringlengths
4
20k
# roughly adapted from http://www.yacpdb.org/xfen/index.php.html # standard import re # 3rd party from PIL import Image, ImageDraw RE_TOKEN = re.compile('^(B?)(!?)([kqrbsnpeaofwdx])([1-7])?$', re.IGNORECASE) baseGlyphs = {\ 'k':((0,0), (0,17)), 'q':((0,2), (0,18)), 'r':((0,4), (0,19)), ...
import sys import numpy from matplotlib import pyplot import weno_coefficients import riemann class Grid1d(object): def __init__(self, nx, ng, xmin=0.0, xmax=1.0, bc="outflow"): self.ng = ng self.nx = nx self.xmin = xmin self.xmax = xmax self.bc = bc # p...
""" Utilities with minimum-depends for use in setup.py """ from __future__ import print_function import email import os import re import subprocess import sys from setuptools.command import sdist def parse_mailmap(mailmap='.mailmap'): mapping = {} if os.path.exists(mailmap): with open(mailmap, 'r')...
from collections import namedtuple from games import (Game) class GameState: def __init__(self, to_move, board, label=None): self.to_move = to_move self.board = board self.label = label def __str__(self): if self.label is None: return super(GameState, self).__str__...
import datetime from rqalpha.data.base_data_source import BaseDataSource from rqalpha.environment import Environment from rqalpha.model.snapshot import SnapshotObject from . import data_board class DataSource(BaseDataSource): def __init__(self, path): super(DataSource, self).__init__(path) self....
"""Steps for bdd-like tests.""" import re import sys import time import json import os.path import logging import collections import textwrap import pytest import pytest_bdd as bdd from qutebrowser.utils import log from helpers import utils @pytest.hookimpl(hookwrapper=True) def pytest_runtest_makereport(item, cal...
import sys import psycopg2 from ModulosDevice.ComunicacionDB import Comunication from ModulosDevice.Cruds import Query #function that evaluate if element exists in list #lista => def ExisteInLista(list_serach, element): #check existence element in list existe =0 for element_shows in list_serach: if element ==...
import importlib import types from common import log ## \defgroup PythonGoals Goal Classes ## \brief Base class for all goals ## \ingroup PythonGoals class Goal: def __init__(self, desc="some goal", fulfilled=None, subgoals=None, validity=None, time=None, debug=0): if subgoals is None: ...
""" Generic code for running the fortran version of Clawpack and sending the results to subdirectory output of the directory from which this is executed. Execute via $ python $CLAW/python/pyclaw/runclaw.py from a directory that contains a claw.data file and a Clawpack executable. """ def runclaw(xclawcmd=None, out...
# -*- coding: utf-8 -*- # Scrapy settings for caoporn 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 rdflib import os import flask_ld as ld import collections np = rdflib.Namespace("http://www.nanopub.org/nschema#") prov = rdflib.Namespace("http://www.w3.org/ns/prov#") class Nanopublication(rdflib.ConjunctiveGraph): _nanopub_resource = None @property def nanopub_resource(self): if se...
"""Generated message classes for replicapoolupdater version v1beta1. The Google Compute Engine Instance Group Updater API provides services for updating groups of Compute Engine Instances. """ from protorpc import messages package = 'replicapoolupdater' class InsertResponse(messages.Message): """Response return...
import sys # ITEM 6 follows this line # ITEM 9 follows this line TAX_RATE = 0.20 timesheet = open("./timesheets.txt", 'r') #ITEM 12 follows this line payroll = open('payroll.txt', 'w') while True: line = timesheet.readline() while '\n' in line or '\r' in line: line = line[:-1] if len...
"""Utility functions for efficiently processing with the job API """ # pytype: skip-file from __future__ import absolute_import import json import logging from google.protobuf import json_format from google.protobuf import struct_pb2 def dict_to_struct(dict_obj): # type: (dict) -> struct_pb2.Struct try: r...
from collections import OrderedDict import os from loguru import logger from .. import veros_method from .diagnostic import VerosDiagnostic from ..core import density from ..variables import Variable, allocate from ..distributed import global_sum SIGMA = Variable( 'Sigma axis', ('sigma',), 'kg/m^3', 'Sigma axis...
import plotly.plotly as py import plotly.graph_objs as go data = open('Real_Final_database_02.csv') alldata = data.readlines() listdata = [] for i in alldata: listdata.append(i.strip().split(',')) type_z = ['Flood', 'Epidemic', 'Drought', 'Earthquake', 'Storm'] fill_colors = ['#00d0f5', '#ff4a2e', 'a36800', '#ad99...
class BaubleError(Exception): def __init__(self, msg=None): self.msg = msg def __str__(self): if self.msg is None: return str(type(self).__name__) else: return '%s: %s' % (type(self).__name__, self.msg) return self.msg class CommitException(Exception): ...
# pyv8_print_fn is actually in pyv8run.py and is added to the Globals def printFunc(objs, newline): JS(""" var s = ""; for(var i=0; i < objs.length; i++) { if(s != "") s += " "; s += objs[i]; } pyv8_print_fn(s); """) def __dynamic_load__(importName):...
from __future__ import with_statement import os import sys import yaml import json import threading class ConfNotFoundError(Exception): def __init__(self, *args): Exception.__init__(self, *args) class ConfFormatError(Exception): def __init__(self, *args): Exception.__init__(self, *args) cl...
from datetime import datetime from logging import getLogger import collections from sqlalchemy.sql.expression import tuple_ from ggrc import db from ggrc import models from ggrc.automapper.rules import rules from ggrc.login import get_current_user from ggrc.models.relationship import Relationship from ggrc.rbac.permi...
#!/usr/bin/python2 -d # coding: utf8 # Created by Lauri Hakko # This code is public domain import pyglet from pyglet.window import key import sys, math, time window = pyglet.window.Window(width=800, height=480) kappale_lista = [] drag_begin = (0.0, 0.0) paused = True class kappale: def __init__(self, paik...
from yatt import BASE_CURRENCY class Ticker(object): r""" Ticker is the base class for any kind of asset. Parameters ---------- symbol: `string`, The ticker symbol. currency: `string`, the asset currency ('EUR', 'USD', 'CHF', 'GBP',...) slippage: `float` or `Price`, slippage in currency. ...
from __future__ import unicode_literals import re from .common import InfoExtractor from .ooyala import OoyalaIE class TeachingChannelIE(InfoExtractor): _VALID_URL = r'https?://www\.teachingchannel\.org/videos/(?P<title>.+)' _TEST = { 'url': 'https://www.teachingchannel.org/videos/teacher-teaming-e...
import floppyforms as forms from django.template.loader import render_to_string from django.conf import settings from django.utils.safestring import mark_safe from .models import PublicBody, Jurisdiction class PublicBodySelect(forms.Widget): initial_jurisdiction = None initial_search = None def set_ini...
''' Christophe Guerrier - 2014 September Kaggle competition Seizure prediction https://www.kaggle.com/c/seizure-prediction/data ''' import scipy.io as sci import numpy as np import matplotlib.pyplot as plt import os import re '''Function to load matlab file in python, return a numpy.array''' def load_matfile(filenam...
__author__ = 'Klemens Fritzsche' import numpy as np import pylab as pl from scipy import integrate from core.Logging import myLogger from core.ConfigHandler import myConfig class TrajectoryHandler(object): def __init__(self, parent): self.mySystem = parent # dictionary for trajectories: first va...
# -*- coding: utf-8 -*- from heapq import heappush, heappop from copy import deepcopy,copy import time import communication import requests import sys import config import tree_L_sprit # グローバル変数の宣言 LIMIT_SELECTION = 0 SELECTON_RATE = 0 EXCHANGE_RATE = 0 distance_table = {} class Node : def __init__ (self, board,...
""" Defines model components to describe local transmission & distribution build-outs for the SWITCH-Pyomo model. SYNOPSIS >>> from switch_mod.utilities import define_AbstractModel >>> model = define_AbstractModel( ... 'timescales', 'financials', 'load_zones', 'local_td') >>> instance = model.load_inputs(inputs_d...
import sys import os import operator from django.apps import apps from django.core.management.base import BaseCommand, CommandError from django.db.migrations import Migration from django.db.migrations.loader import MigrationLoader from django.db.migrations.autodetector import MigrationAutodetector from django.db.migra...
""" Here we set usefull functions used to create dynamic topography files for Badlands inputs. """ import os import math import h5py import errno import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.spatial import cKDTree import xml.etree.ElementTree as ETO import plotly from plotly impor...
#!/usr/bin/env python # coding=utf-8 # code by 92ez.com import scapy.all as scapy import subprocess import threading import socket import signal import struct import fcntl import time import sys import os DN = open(os.devnull, 'w') def get_isc_dhcp_server(): if not os.path.isfile('/usr/sbin/dhcpd'): install = raw...
""" @file mover.py """ def LoadFunctions(clips): #---------------------------------- # It handles to make the right movement for the team #---------------------------------- # Module name mod_name = "MOVER" # Module body mod_body = "(import MAIN deftemplate initial-fact movio-r ficha-r fi...
# coding: utf-8 import json import argparse import logging import os import sys from access.controller import stats, ServerError import thriftpy import thriftpywrap from thriftpy.rpc import make_server from access import utils logger = logging.getLogger(__name__) access_stats_thrift = thriftpy.load( os.path.jo...
import os legalReSTFiles = [ "README.rst", "TODO", "DEPENDENCIES", ] def setup(*args, **kwds): """ Compatibility wrapper. """ try: from setuptools import setup except ImportError: from distutils.core import setup return setup(*args, **kwds) def findPackages(...
from raptiformica.actions.mesh import not_already_known_consul_neighbour from tests.testcase import TestCase class TestNotAlreadyKnownConsulNeighbour(TestCase): def setUp(self): self.log = self.set_up_patch('raptiformica.actions.mesh.log') self.check_nonzero_exit = self.set_up_patch( '...
import os from oslo_config import cfg import testscenarios import testtools from nova.api.openstack import API_V3_CORE_EXTENSIONS # noqa from nova import test from nova.tests.functional import api_samples_test_base from nova.tests.functional.v3 import api_paste_fixture from nova.tests.unit import fake_network from n...
from twisted.trial import unittest from twisted.web2.channel import fastcgi from twisted.python import util class FCGI(unittest.TestCase): def testPacketReceived(self): ''' Test that a packet can be received, and that it will cause 'writePacket' to be called. ''' record = fa...
""" XX. Model inheritance Model inheritance isn't yet supported. """ from django.db import models class Place(models.Model): name = models.CharField(maxlength=50) address = models.CharField(maxlength=80) def __str__(self): return "%s the place" % self.name class Restaurant(Place): serves_ho...
import os NAME = 'ruby19' try: RUBYPATH = os.environ['UWSGICONFIG_RUBYPATH'] except: RUBYPATH = 'ruby' rbconfig = 'Config' version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip() v = version.split('.') GCC_LIST = ['../rack/rack_plugin', '../rack/rack_api'] if v[0] == '1' and v[1] == '9...
rightHand = runtime.createAndStart("rightHand","InMoovHand") readDigitalPin = 8 serAtt = 1 rightHand.connect("COM12") rightHand.startService() rightHand.close() sleep(1) rightHand.open() sleep(1) rightHand.openPinch() sleep(1) rightHand.closePinch() sleep(1) rightHand.rest() ear = runtime.createAndStart("ear","Sphin...
#!/usr/bin/python """Utility to generate the header files for BOOST_METAPARSE_STRING""" # Copyright Abel Sinkovics (<EMAIL>) 2016. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import argparse import...
"""Runtime module for compiled soy templates. This module provides utility functions required by soy templates compiled with the Python compilers. These functions handle the runtime internals necessary to match JS behavior in module and function loading, along with type behavior. """ # Emulate Python 3 style unicode ...
import os import gtk import pango class Breadcrumbs(gtk.HBox): """Widget for displaying paths with clickable segments.""" TYPE_NONE = 0 TYPE_NORMAL = 1 TYPE_SMART = 2 def __init__(self, parent): gtk.HBox.__init__(self) self._parent = parent self._type = self._parent._breadcrumb_type self._path = None...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_memoized_property ---------------------- Tests of the `memoized_property` module. """ import unittest from memoized_property import memoized_property class C(object): """Example class for testing ``@memoized_property``""" load_name_count = 0 @m...
#!/usr/bin/env python3 ''' Copyright (c) 2015 zach wick <<EMAIL>> This file is free software: you may copy, redistribute 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. Th...
# coding: utf-8 from __future__ import unicode_literals import itertools import re import random from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_str, compat_urllib_parse, compat_urllib_parse_urlparse, compat_urllib_request, ) from ..utils import ( ExtractorErro...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest from mock import ANY from ansible.module_utils.network.fortios.fortios import FortiOSHandler try: from ansible.modules.network.fortios import fortios_log_custom_field except ImportError: ...
import argparse import logging import numpy as np from pyhdf.SD import SD, SDC from utilities import lib NDVI = 'ndvi' LST = 'lst' SNOW = 'snow' parser = argparse.ArgumentParser(description='Add mask and masked data to a MODIS hdf file.') parser.add_argument('-i', '--in-file', help='Name of the file containing a lis...
from django.core.management.base import BaseCommand from apps.catastro.models import Ciudad from apps.core.models import Recorrido, Linea from django.conf import settings from optparse import make_option from ghost import Ghost from multiprocessing import Process import os from django.core.files import File from djang...
__author__ = 'kartik' from lxml import etree import sys,re import bz2 import unicodedata # class that parses wikipedia XML dump in .bz2 format and converts it into a file with one line per article with its title and article text separated by tab: # <article_title1>\t<article_text1_with_no_newlines> # <article_title2>...
""" Fantasm: A taskqueue-based Finite State Machine for App Engine Python Docs and examples: http://code.google.com/p/fantasm/ Copyright 2010 VendAsta Technologies 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 ob...
from openerp.osv import orm, fields from tools import ustr from tools.translate import _ class stock_picking(orm.Model): _inherit = "stock.picking" _columns = { 'product_barcode': fields.char('Barcode', readonly=True, states={'draft': [('readonly', False)]}), } def onchange_product_barcode(...
from typing import Optional from airflow.providers.microsoft.azure.hooks.wasb import WasbHook from airflow.sensors.base_sensor_operator import BaseSensorOperator from airflow.utils.decorators import apply_defaults class WasbBlobSensor(BaseSensorOperator): """ Waits for a blob to arrive on Azure Blob Storage....
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import * # noqa from future.utils import native from base64 import b64decode, b64enc...
import sys import mock from neutron.db import migration from neutron.db.migration import cli from neutron.tests import base class TestDbMigration(base.BaseTestCase): def test_should_run_plugin_in_list(self): self.assertTrue(migration.should_run(['foo'], ['foo', 'bar'])) self.assertFalse(migratio...
""" sentry.interfaces.query ~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import __all__ = ('Query', ) from sentry.interfaces.base import Interface, InterfaceValidationError from se...
""" This module contains the code for the main root window of Goat. """ from tkinter import * from tkinter.messagebox import * from bin.initialize_goat import configs from settings import settings_config from gui.settings import settings_form from gui.database import database_gui, db_set_gui from gui.searches import...
""" This module contains essential stuff that should've come with Python itself ;) """ import gc import os import re import inspect import weakref import errno import six from functools import partial, wraps import sys from scrapy.utils.decorators import deprecated def flatten(x): """flatten(sequence) -> list ...
import logging import tempfile import unittest from unittest import mock from cylc.flow import LOG from cylc.flow.loggingutil import TimestampRotatingFileHandler class TestLoggingutil(unittest.TestCase): @mock.patch("cylc.flow.loggingutil.glbl_cfg") def test_value_error_raises_system_exit( self, ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ################################################################################ # Documentation ################################################################################ ANSIBLE_METADATA = {'metadata_version': '1.1', 'statu...
import FreeCAD, Mesh, os, numpy if FreeCAD.GuiUp: from DraftTools import translate else: def translate(context,text): return text __title__="FreeCAD Collada importer" __author__ = "Yorik van Havre" __url__ = "http://www.freecadweb.org" DEBUG = True def checkCollada(): "checks if collada if availa...
from __future__ import unicode_literals import requests import logging import time from datetime import timedelta from django.conf import settings from django.utils import timezone from djcelery_transactions import task from enum import Enum from redis_cache import get_redis_connection from temba.msgs.models import S...
import time from openerp.osv import osv from openerp.report import report_sxw class pos_user_product(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(pos_user_product, self).__init__(cr, uid, name, context) self.localcontext.update({ 'time': time, '...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], 'supported_by': 'core'} DOCUMENTATION = r''' --- module: win_file version_added: "1.9.2" short_description: Creates, touches or removes files or directories description: - Creates (empty) files, u...
"""The terminal 'discard' chain.""" __all__ = [ 'DiscardChain', ] import logging from mailman.chains.base import TerminalChainBase from mailman.core.i18n import _ from mailman.interfaces.chain import DiscardEvent from zope.event import notify log = logging.getLogger('mailman.vette') class DiscardChain...
import proto # type: ignore from google.ads.googleads.v6.enums.types import manager_link_status __protobuf__ = proto.module( package="google.ads.googleads.v6.resources", marshal="google.ads.googleads.v6", manifest={"CustomerManagerLink",}, ) class CustomerManagerLink(proto.Message): r"""Represent...
"""Module housing the bulk of the business objects for the Judge system This module houses the various business objects for the automated Judge. In the future if the judge expands enough new modules may be created to subdivide logical groupings. """ import os import shutil import logging import json import abc import ...
"""Relaxed OneHotCategorical distribution classes.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.contrib.distributions.python.ops import bijectors from tensorflow.python.framework import dtypes from tensorflow.python....
# -*- 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...
import json import warnings from past.builtins import basestring from .template import PYWR_PROTECTED_NODE_KEYS, pywr_template_name from .core import BasePywrHydra, data_type_from_field from pywr.nodes import NodeMeta from hydra_pywr_common import data_type_from_component_type import logging log = logging.getLogger(__n...
from flask import render_template from snakeeyes.extensions import mail def send_template_message(template=None, ctx=None, *args, **kwargs): """ Send a templated e-mail using a similar signature as Flask-Mail: http://pythonhosted.org/Flask-Mail/ Except, it also supports template rendering. If you wa...
from setuptools import setup import os, sys, re os.environ['COPYFILE_DISABLE'] = 'true' # this disables including resource forks in tar files on os x extra = {} if sys.version_info >= (3,0): extra['use_2to3'] = True setup( name="jsmin", version=re.search(r'__version__ = ["\']([^"\']+)', open('jsmin/__...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Exercise', fields=[ ('id', models.AutoField(ser...
""" Converters for XGBoost models. """ import numpy as np from onnxconverter_common.registration import register_converter from . import constants from ._gbdt_commons import convert_gbdt_classifier_common, convert_gbdt_common from ._tree_commons import TreeParameters def _tree_traversal(tree_info, lefts, rights, fe...
from charmhelpers.core import unitdata class FlagManager: ''' FlagManager - A Python class for managing the flags to pass to an application without remembering what's been set previously. This is a blind class assuming the operator knows what they are doing. Each instance of this class should be ...
EVENT_APPLIANCE = 0x1 EVENT_LIBRARY = 0x2 EVENT_WARNING = 0x3 EVENT_TRACE = 0x4 class GuestFS(object): SUPPORT_CLOSE_ON_EXIT = True SUPPORT_RETURN_DICT = True CAN_SET_OWNERSHIP = True def __init__(self, **kwargs): if not self.SUPPORT_CLOSE_ON_EXIT and 'close_on_exit' in kwargs: ra...
"""Tests for sparse_feature_column.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.linear_optimizer.python.ops.sparse_feature_column import SparseFeatureColumn from tensorflow.python.framework import ops from tensorflow.python...
{ 'name': "Inactive Sessions Timeout", 'summary': """ This module disable all inactive sessions since a given delay""", 'author': "ACSONE SA/NV", "Odoo Community Association (OCA)" 'website': "http://acsone.eu", 'category': 'Tools', 'version': '1.0', 'license': 'AGPL-3', 'dep...
# encoding: utf-8 # module pango # from /usr/lib/python2.7/dist-packages/gtk-2.0/pango.so # by generator 1.135 # no doc # imports import gobject as __gobject import gobject._gobject as __gobject__gobject class Script(__gobject.GEnum): # no doc def __init__(self, *args, **kwargs): # real signature unknown ...
# -*- coding: utf-8 -*- from os import path as os_path, walk as os_walk, unlink as os_unlink import operator from Plugins.Plugin import PluginDescriptor from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.config import config, ConfigSelection, ConfigYesNo, getConfigListEntry, C...
import argparse, sys class Parser: dest = 'dest' default = 'default' action = 'action' nargs = 'nargs' metavar = 'metavar' help = 'help' options = { # file names 'indir' : (('-i', '--input'), {dest:'indir', default:'test', help:'directory with input files (defau...
#!/usr/bin/env ipython import roslib roslib.load_manifest('robot_control') import rospy import tf from geometry_msgs.msg import Twist, PoseStamped, PointStamped from visualization_msgs.msg import Marker import message_filters from math import atan2, hypot, pi, cos, sin, pi, fmod, exp from tf.transformations import eul...
# -*- coding: utf-8 -*- """ MediaProvider A device centric multimedia solution ---------------------------------------------------------------------------- (C) direct Netware Group - All rights reserved https://www.direct-netware.de/redirect?mp;core The following license agreement remains valid unless any additions o...
#=========================================================================================================================== # aims : define both 3 hidden layers model and 4 hidden layers model # # input : x : placeholder variable which has as column number the number of features of the training matrix con...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote from ..utils import ( determine_ext, float_or_none, get_element_by_id, int_or_none, parse_iso8601, str_to_int, ) class IzleseneIE(InfoExtractor...
from base import * sys.path.insert(0, "") import os import papyon import papyon.util.string_io as StringIO class MSNObjectClient(TestClient): def __init__(self): opts = [('-a', '--auto', {'action': 'store_true', 'default': False, 'help': 'auto-request new display ...
# -*- coding: utf-8 -*- # File: inference_runner.py import itertools import sys from contextlib import contextmanager import tqdm from tensorflow.python.training.monitored_session import _HookedSession as HookedSession from ..compat import tfv1 as tf from ..dataflow.base import DataFlow from ..input_source import Fe...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import pytest import os import collections from units.utils.amazon_placebo_fixtures import placeboify, maybe_sleep from ansible.modules.cloud.amazon import aws_direct_connect_link_aggregation_group as lag_module from ansible.module...
from abc import abstractmethod from neutron.api import extensions from neutron.api.v2 import base from neutron import manager from neutron import quota # Attribute Map RESOURCE_ATTRIBUTE_MAP = { 'ext_test_resources': { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid...
""" * ******************************************************* * Copyright (c) VMware, Inc. 2016-2018. All Rights Reserved. * SPDX-License-Identifier: MIT * ******************************************************* * * DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, WHET...
"""This module contains two helper function to initialize and get the server state.""" from microproxy.context import ServerContext from microproxy.interceptor import Interceptor from microproxy.interceptor import MsgPublisher from microproxy.interceptor import PluginManager from microproxy.cert import CertStore def...
""" Test the main features of the mysqlbinlogmove utility. """ import os import shutil import rpl_admin from mysql.connector import OperationalError from mysql.utilities.common.tools import delete_directory from mysql.utilities.exception import MUTLibError MYSQL_OPTS_DEFAULT = ('"--log-bin={log_bin} ' ...
#!/usr/bin/env python3 """ Testing dec2flt =============== These are *really* extensive tests. Expect them to run for hours. Due to the nature of the problem (the input is a string of arbitrary length), exhaustive testing is not really possible. Instead, there are exhaustive tests for some classes of inputs for which ...
#!/usr/bin/python # -*- coding: utf-8 -*- import RPi.GPIO as GPIO __author__ = 'otger' class Relay(object): def __init__(self, bcm_out_pin): self._pin = bcm_out_pin self._setup() def _setup(self): GPIO.setmode(GPIO.BCM) GPIO.setup(self._pin, GPIO.OUT) def enable(self): ...
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import copy, os, re from future_builtins import map from urlparse import url...
"""Test configs for softmax.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from ...
#!/usr/bin/env python # -*- coding:utf-8 -*- import os import logging import time import json from config import settings from src.backend import logger CURRENT_USER_INFO = {} def dump_current_user_info(): json.dump(CURRENT_USER_INFO, open(os.path.join(settings.USER_DIR_FOLDER, CURRENT_USER_INFO['card'], "bas...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class UnTrashMessage(Choreography): def __init__(self, temboo_session): """ Create ...
import json from ansible.module_utils._text import to_text from ansible.module_utils.basic import env_fallback, return_values from ansible.module_utils.connection import Connection, ConnectionError _DEVICE_CONFIGS = {} vyos_provider_spec = { 'host': dict(), 'port': dict(type='int'), 'username': dict(fal...
import datetime import json from psycopg2 import ProgrammingError from socorro.external.crashstorage_base import ( CrashStorageBase, CrashIDNotFound ) from configman import ( Namespace, class_converter ) from socorro.external.postgresql.connection_context import ConnectionContext from socorro.lib.datet...