content
stringlengths
4
20k
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json from units.compat.mock import patch from ansible.modules.network.enos import enos_config from .enos_module import TestEnosModule, load_fixture from units.modules.utils import set_module_args class TestEnosConfigModu...
import mock import webob from nova.api.openstack.compute.contrib import flavorextraspecs \ as flavorextraspecs_v2 from nova.api.openstack.compute.plugins.v3 import flavors_extraspecs \ as flavorextraspecs_v21 import nova.db from nova import exception from nova import test from nova.tests.api.openstack import fakes f...
""" Python 'utf-8-sig' Codec This work similar to UTF-8 with the following changes: * On encoding/writing a UTF-8 encoded BOM will be prepended/written as the first three bytes. * On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these bytes will be skipped. """ import codecs ### Codec APIs ...
""" Management command to find all students that need certificates for courses that have finished, and put their cert requests on the queue. """ import logging import datetime from pytz import UTC from django.core.management.base import BaseCommand, CommandError from certificates.models import certificate_status_for_st...
import sys, os import socket import threading import traceback import logging import time # Library imports import numpy as np import zmq import netifaces # Application imports from global_defs import * from defs import * from ports import * import logger from events import * import broker import i...
"""Helpers for the data entry flow.""" import voluptuous as vol from homeassistant import data_entry_flow, config_entries from homeassistant.components.http import HomeAssistantView from homeassistant.components.http.data_validator import RequestDataValidator class _BaseFlowManagerView(HomeAssistantView): """Fo...
#! /usr/bin/env python """Mimification and unmimification of mail messages. Decode quoted-printable parts of a mail message or encode using quoted-printable. Usage: mimify(input, output) unmimify(input, output, decode_base64 = 0) to encode and decode respectively. Input and output may be the name of...
from selenium.webdriver import Ie from selenium.webdriver.ie.options import Options from selenium.webdriver.common.desired_capabilities import DesiredCapabilities def test_launch_and_close_browser(): driver = Ie() driver.quit() def test_we_can_launch_multiple_ie_instances(): driver1 = Ie() driver2 =...
"""Convert caffe model """ from __future__ import print_function import argparse import sys import re import caffe_parser import mxnet as mx import numpy as np from convert_symbol import convert_symbol def prob_label(arg_names): candidates = [arg for arg in arg_names if not arg.endswith('data') a...
import fixtures IDENTITY_URL = 'http://identityserver:5000/v2.0' VOLUME_URL = 'http://volume.host' class Fixture(fixtures.Fixture): base_url = None json_headers = {'Content-Type': 'application/json'} def __init__(self, requests, volume_url=VOLUME_URL, identity_url=IDEN...
"""automatically manage newlines in repository files This extension allows you to manage the type of line endings (CRLF or LF) that are used in the repository and in the local working directory. That way you can get CRLF line endings on Windows and LF on Unix/Mac, thereby letting everybody use their OS native line end...
"""Use command-line tools to check for audio file corruption. """ from __future__ import division, absolute_import, print_function from beets.plugins import BeetsPlugin from beets.ui import Subcommand from beets.util import displayable_path, confit from beets import ui from subprocess import check_output, CalledProce...
from __future__ import absolute_import, unicode_literals from django.template import Template, Context from django.test import TestCase from django.utils.encoding import force_text, force_bytes from django.utils.functional import lazy from django.utils.safestring import mark_safe, mark_for_escaping, SafeData, EscapeD...
__author__ = 'daniel.dinu' # Architectures ARCHITECTURE_AVR = 'AVR' ARCHITECTURE_MSP = 'MSP' ARCHITECTURE_ARM = 'ARM' # FOM 1 weights # AVR FOM1_AVR_CODE_SIZE_WEIGHT = 1 FOM1_AVR_RAM_WEIGHT = 1 FOM1_AVR_EXECUTION_TIME_WEIGHT = 1 # MSP FOM1_MSP_CODE_SIZE_WEIGHT = 1 FOM1_MSP_RAM_WEIGHT = 1 FOM1_MSP_EXECUTION_TIME_WE...
import getpass # some fun to match michal's use of green in his messaging in ec2_cmd.py # generalize like http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python class bcolors: PURPLE = '' BLUE = '' GREEN = '' YELLOW = '' RED = '' ENDC = '' def enable(self): ...
from mantid import AnalysisDataService from mantid.api import AlgorithmPropertyWithValue from mantid.simpleapi import SumSpectra, ConvertAxesToRealSpace from sans.algorithm_detail.batch_execution import provide_loaded_data, create_unmanaged_algorithm, add_to_group from sans.algorithm_detail.crop_helper import get_compo...
import sys from eventlet import event from eventlet import greenthread from nova.openstack.common.gettextutils import _ from nova.openstack.common import log as logging from nova.openstack.common import timeutils LOG = logging.getLogger(__name__) class LoopingCallDone(Exception): """Exception to break out and ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'usrp_display_qtgui.ui' # # by: PyQt4 UI code generator 4.4.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.s...
#!/usr/bin/env python """ MultiQC module to parse output from Salmon """ from __future__ import print_function from collections import OrderedDict import json import logging import os from multiqc import config from multiqc.plots import linegraph from multiqc.modules.base_module import BaseMultiqcModule # Initialis...
""" This file was automatically generated. """ import six class search(object): def __init__(self, zap): self.zap = zap def urls_by_url_regex(self, regex, baseurl=None, start=None, count=None): """ Returns the URLs of the HTTP messages that match the given regular expression in the ...
#! /usr/bin/python # # See README for usage instructions. # We must use setuptools, not distutils, because we need to use the # namespace_packages option for the "google" package. from ez_setup import use_setuptools use_setuptools() from setuptools import setup, Extension from distutils.spawn import find_executable i...
import time from openerp.tools.translate import _ from openerp.report import report_sxw from common_report_header import common_report_header class partner_balance(report_sxw.rml_parse, common_report_header): def __init__(self, cr, uid, name, context=None): super(partner_balance, self).__init__(cr, uid, ...
from __future__ import unicode_literals from decimal import Decimal from django.conf import settings from django.utils import six from django.utils.safestring import mark_safe def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='', force_grouping=False): """ Gets a number (...
from statsmodels.compat.python import zip import warnings def _est_regression_summary(): #little luck getting this test to pass (It should?), can be used for #visual testing of the regression.summary table #fixed, might fail at minute changes from statsmodels.regression.tests.test_regression import Te...
""" Commonly used utilities """ import os import re import sys import platform import pkgutil import inspect from re import escape from path import path #----------------------------------------------- # Pymel Internals #----------------------------------------------- def inMaya(): """ Returns True if called...
""" Use serial protocol of Acer projector to obtain state of the projector. For more details about this component, please refer to the documentation at https://home-assistant.io/components/switch.acer_projector/ """ import logging import re import voluptuous as vol from homeassistant.components.switch import (Switch...
#!/usr/bin/python # This is a simple example showing how you can send mouse movement # events to XBMC. # NOTE: Read the comments in 'example_button1.py' for a more detailed # explanation. import sys sys.path.append("../../lib/python") from xbmcclient import * from socket import * def main(): import time im...
from operator import itemgetter import time from openerp.osv import fields, osv from openerp import api class account_fiscal_position(osv.osv): _name = 'account.fiscal.position' _description = 'Fiscal Position' _order = 'sequence' _columns = { 'sequence': fields.integer('Sequence'), 'n...
import time import ConfigParser import subprocess import threading import random jobs = [] username = "user" connections = 10 failmonDir = "" maxFiles = 100 # This class represents a thread that connects to a set of cluster # nodes to locally execute monitoring jobs. These jobs are specified # as a shell command in t...
from django import template from collections import OrderedDict from sectors.models import Sector from outcomes.models import PriorityOutcome from indicators.models import Indicator from measures.models import CoreMeasure from home.models import HomePageTopStories register = template.Library() @register.inclusion_t...
"""sharedlinks URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-b...
""" Copied from Chrome's src/tools/valgrind/drmemory/PRESUBMIT.py See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details on the presubmit API built into gcl. """ import os def CheckChange(input_api, output_api): """Checks the DrMemory suppression files for bad suppressions.""...
import responses import pytest from plugins.fishbans import fishbans, bancount test_user = "notch" test_api = """ {"success":true,"stats":{"username":"notch","uuid":"069a79f444e94726a5befca90e38aaf5","totalbans":11,"service":{"mcbans":0,"mcbouncer":11,"mcblockit":0,"minebans":0,"glizer":0}}} """ test_api_single = ""...
# 関数名ルール # # FOO_i1_i2_w1_w2_o1_o1 .. # # 順番は # ・入力データ (prefix i) # ・重みデータ (prefix w) # ・出力データ (prefix o) # # 重みデータが引数に含まれる場合は、重みデータは存在しない # # u usigned # i integer # f flaot # q quantize # # 数字がビット幅 # # 例 # Convolution2D_3x3_iui8_of() # 3x3のConvolution2D # 入力 8bit unsigned integer # 重み 引数に含まれる # 出力 flo...
# -*- coding: utf-8 -*- """ This plugin is 3rd party and not part of p2p-streams addon Livefootballvideo.com """ import sys,os current_dir = os.path.dirname(os.path.realpath(__file__)) basename = os.path.basename(current_dir) core_dir = current_dir.replace(basename,'').replace('parsers','') sys.path.append(core_dir...
class IndexedList(list): """ List with optimised access by value Based on Alex Martelli's recipe http://code.activestate.com/recipes/52303-the-auxiliary-dictionary-idiom-for-sequences-with-/ """ def __init__(self, iterable=None): self.clean = True self._dict = {} if ite...
class IntegrationHelper: def __init__(self, username=None, password=None, sharedKey=None, certChain=None, privateKey=None, cryptoID=None, protocol=None, x509Fingerprint=None, x509TrustList=None, x509CommonName=None, setting...
# -*- coding: utf-8 -*- # intente algo como import os numero_a_letra = local_import("numero_a_letra") WSDESC = {"wsmtxca": u"Factura electrónica MTXCA", "wsfev1": "Mercado interno", "wsfex": u"Exportación", "wsbfe": "Bonos fiscales"} def utftolatin(text): try: return unicode(text, "utf-8").encode("latin-...
import time import sys import struct import math import binascii from bluetooth import set_l2cap_mtu SX_SELECT = 1 << 0 SX_L3 = 1 << 1 SX_R3 = 1 << 2 SX_START = 1 << 3 SX_DUP = 1 << 4 SX_DRIGHT = 1 << 5 SX_DDOWN = 1 << 6 SX_DLEFT = 1 << 7 SX_L2 = 1 << 8 SX_R2 = 1 << 9 SX_L1 ...
# -*- coding: utf-8 -*- from xml.etree import ElementTree from openerp.addons.web.controllers.main import load_actions_from_ir_values from openerp.http import Controller, route, request class Board(Controller): @route('/board/add_to_dashboard', type='json', auth='user') def add_to_dashboard(self, menu_id, act...
"""Some handy font-like objects. <p>please note that this file is alpha, and is subject to modification in future versions of pgu!</p> """ print 'pgu.fonts','This module is alpha, and is subject to change.' import pygame from pygame.locals import * class TileFont: """Creates an instance of the TileFont class. ...
from __future__ import print_function # THIS IS A TEST import cPickle as pickle # import pickle class Param(object): """ Class that allows you to store values when training and retrieve values when testing as either a function result, or a value. """ class ParamStore(object): def __init__(s...
from __future__ import absolute_import import logging from django.contrib import messages from django.core.context_processors import csrf from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.utils.decorators import method_decorator from django.utils.translation import ...
chapter_content = '''<?xml version="1.0" encoding="UTF-8" standalone="no" ?><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Chapter 1</title> <meta content="http://www.w3.org/1999/xhtml; charset=utf-8" http-equiv="Content-Type"/> <link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css"/> </head...
#!/usr/bin/env python3 """Script to generate words and their corresponding ids post-load""" import json import os import sys from philologic.DB import DB def main(db_path): """Grab words from words table and dump to file""" philo_db = DB(db_path) words_and_ids_path = os.path.join(db_path, "words_and_phi...
"""Django template library for Rietveld.""" import cgi import logging from google.appengine.api import memcache from google.appengine.api import users import django.template import django.utils.safestring from django.core.urlresolvers import reverse import models register = django.template.Library() user_cache = ...
"""TensorFlow 2.0 Profiler for both Eager Mode and Graph Mode. The profiler has two mode: - Programmatic Mode: start(), stop() and Profiler class. It will perform when calling start() or create Profiler class and will stop when calling stop() or destroying Profiler class. - On-d...
#!/usr/bin/env python # # Use the raw transactions API to spend monetas received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a monetad or Monet...
# -*- coding: utf-8 -*- """ jinja2 ~~~~~~ Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment. Nutshell -------- Here a small example of a Jinja2 template:: {% ...
"""Tests for gmm_ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import time import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.contrib.factorization.python.ops import gmm_ops from tensorflow.pytho...
import sys from timeuuid import TimeUUID from kronos.conf.constants import ResultOrder from kronos.utils.uuid import uuid_from_kronos_time from kronos.utils.uuid import uuid_to_kronos_time from kronos.utils.uuid import UUIDType class BaseStorage(object): # All subclasses must define `SETTINGS_VALIDATORS` mapping ...
from flask import request, session from werkzeug.exceptions import Forbidden from indico.modules.events.papers.controllers.base import RHPaperBase, RHPapersBase from indico.modules.events.papers.forms import PaperSubmissionForm from indico.modules.events.papers.models.files import PaperFile from indico.modules.events....
# -*- coding: utf-8 -*-) """ eve.render ~~~~~~~~~~ Implements proper, automated rendering for Eve responses. :copyright: (c) 2015 by Nicola Iarocci. :license: BSD, see LICENSE for more details. """ import time import datetime import simplejson as json from werkzeug import utils from functools im...
#!/usr/bin/env python # -*- coding:utf-8 -*- import sys import urllib import hashlib from bs4 import BeautifulSoup as _beautifulsoup reload(sys) sys.setdefaultencoding("utf-8") try: __import__('lxml') BeautifulSoup = lambda markup, from_encoding=None: _beautifulsoup(markup, 'lxml', from_encoding=from_encodin...
# -*- coding: utf-8 -*- """ *************************************************************************** i_colors_enhance.py ------------------- Date : March 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ***********************...
#! /usr/bin/env python """An RFC 2821 smtp proxy. Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]] Options: --nosetuid -n This program generally tries to setuid `nobody', unless this flag is set. The setuid call will fail if this program is not run as root (in ...
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.ansible_tower import tower_argument_spec, tower_auth_config, towe...
""" Generic query support ===================== The goal of this module is to provide a simplified environment for performing complex queries in the KB. The idea is that one invokes: .. code-block:: bash ${KB_QUERY} --ofile foo_junk.tsv -P romeo --operator aen \\ query --code-file foo.py --group BSTUDY whe...
{ 'name': 'Warehouse Management', 'version': '1.1', 'author': 'OpenERP SA', 'summary': 'Inventory, Logistic, Storage', 'description': """ Manage multi-warehouses, multi- and structured stock locations ============================================================== The warehouse and inventory managem...
# -*- 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): # Adding model 'Site' db.create_table('site', ( ('id', self.gf('django.db.models.fields.AutoFiel...
from openerp.osv import fields, osv from openerp.tools.translate import _ class survey_survey(osv.osv): _inherit = 'survey.survey' _columns = { 'template_id' : fields.many2one('xml.template', "Template"), } def survey_export_xml(self, cr, uid, ids, context=None): """ ...
from unittest import TestCase from opencog.atomspace import AtomSpace, TruthValue, Atom, Handle from opencog.atomspace import types, is_a, get_type, get_type_name from opencog.scheme_wrapper import load_scm, scheme_eval, scheme_eval_h, __init__ # We are poking atoms into this from the scm files, so we want # them to...
import os import shutil import subprocess import sys import tarfile import tempfile import urllib import zipfile def get_dependencies(): """ Downloads and installs external package dependencies. 1. Ensure user account has write permission to the install path of this package. 2. Run get_dependencies() ...
import sys sys.path.append('../') import unittest from suds.sax.date import Timezone as Tz from suds.xsd.sxbuiltin import * from unittest import TestCase from tests import * setup_logging() class Date(XDate): def __init__(self): pass class Time(XTime): def __init__(self): pass class DateTime(...
#!/usr/bin/env python import datetime import os from openpyxl import Workbook from openpyxl.cell import get_column_letter from openpyxl.comments import Comment from openpyxl.styles import PatternFill, Border, Side, Alignment, Protection, Font import xlsxwriter import django django.setup() from django.db.models impo...
"""Wrapper script for running ncval. """ import optparse import os import subprocess import sys import getos SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) NACL_SDK_ROOT = os.path.dirname(SCRIPT_DIR) if sys.version_info < (2, 6, 0): sys.stderr.write("python 2.6 or later is required run this script\n") ...
from selenium import webdriver import win32api import win32con import subprocess import time import re import os from shutil import rmtree def save_web_page(urls): # 另外一种配置方式 start # UA = 'Mozilla/5.0 (Linux; Android 4.1.1; GT-N7100 Build/JRO03C) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/35.0.1...
""" Bibcheck plugin add the DOIs (from crossref) """ from invenio.legacy.bibrecord import record_add_field from invenio.utils.crossref import get_doi_for_records from invenio.legacy.bibupload.engine import find_record_from_doi def check_records(records, doi_field="0247_a", extra_subfields=(("2", "DOI"), ("9", "bibch...
# -*- coding: utf-8 -*- def d_inesprg(arg, cart): cart.set_iNES_prg(arg) def d_ineschr(arg, cart): cart.set_iNES_chr(arg) def d_inesmap(arg, cart): cart.set_iNES_map(arg) def d_inesmir(arg, cart): cart.set_iNES_mir(arg) def d_bank(arg, cart): cart.set_bank_id(arg) def d_org(arg, cart): ...
import sys import re data = sys.stdin.readlines() errs = [] for line in data: # if we care about the line if re.search(r'error.cc', line): # str manip to cut off left part of log line line = line.partition('error.cc:')[-1] line = re.sub(r'\d+] ', r'', line) line = line.strip()....
import unittest from decimal import Decimal from datetime import date from pony.orm import * from pony.orm.serialization import to_dict from pony.orm.tests.testutils import * from pony.orm.tests import setup_database, teardown_database class TestObjectToDict(unittest.TestCase): @classmethod def setUpClass(cl...
from .robotis_def import * class GroupSyncWrite: def __init__(self, port, ph, start_address, data_length): self.port = port self.ph = ph self.start_address = start_address self.data_length = data_length self.is_param_changed = False self.param = [] self.dat...
#!/usr/bin/env python # coding: utf-8 # # 応答生成モジュール # 基本的には # - 入力と応答の対応リスト(argv[1]) # - 話者認識結果ID (argv[2]) # - 音声認識結果 (argv[3]) # を受け取って応答文および音声を生成する # # 前の応答への依存性を持たせたい場合は引数を追加すれば良い import sys, os #import goslate import talkey import time from recognize import music_recognize from record import record from microsoftt...
import collections import mock from neutron.plugins.ml2.drivers.l2pop import rpc as l2pop_rpc from neutron.plugins.ml2.drivers.l2pop.rpc_manager import l2population_rpc from neutron.plugins.ml2.drivers.openvswitch.agent import ovs_neutron_agent from neutron.tests import base class FakeNeutronAgent(l2population_rpc.L...
i = [] for i[0] in xrange(5): for <weak_warning descr="Variable 'i[0]' already declared in 'for' loop or 'with' statement above">i[0]</weak_warning> in xrange(20, 25): print("Inner", i) for <weak_warning descr="Variable 'i' already declared in 'for' loop or 'with' statement above">i</weak_warning> i...
from __future__ import unicode_literals import re import json from .common import InfoExtractor class DefenseGouvFrIE(InfoExtractor): IE_NAME = 'defense.gouv.fr' _VALID_URL = (r'http://.*?\.defense\.gouv\.fr/layout/set/' r'ligthboxvideo/base-de-medias/webtv/(.*)') _TEST = { 'url': 'http...
#! /cygdrive/d/cocos2dx32/Python2732/python # encoding=utf-8 ## /usr/bin/python ## python v2.7 # # capture.py # Usage: capture.py instance_id # instance_id, see the xml file # # exit code: # 0 正常退出 # 1 因instance获取出错而致程序退出 # 2 因不支持的系统平台而致程序退出 # 3 当curl命令执行出错时, 重试的次数达到上限而致程序退出 # import sys import re import os impo...
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 GetArtistTracks(Choreography): def __init__(self, temboo_session): """ Create...
#!/usr/bin/python2.6 # -*- coding: utf8 -*- from __future__ import with_statement """ """ __author__ = "Jerome Samson" __copyright__ = "Copyright 2013, Mikros Image" from fabric.api import * from fabric.colors import green, blue env.timeout = 5 env.disable_known_hosts = True env.source_path = '' env.target_path = ''...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ReportRun' db.create_table(u'ilsgateway_reportrun', ( (u'id', self.gf('django....
""" Process validation data retrieved using fetch_validation_data.py. Two types of data are expected. A file at `validations/unlisted-addons.txt` that contains the guid of each unlisted addon and input on STDIN which has the validation JSON data for each validation to check. See fetch_validation_data.py for how this da...
import os from flask import Flask, url_for, redirect, render_template, request, abort from flask_sqlalchemy import SQLAlchemy from flask_security import Security, SQLAlchemyUserDatastore, \ UserMixin, RoleMixin, login_required, current_user from flask_security.utils import encrypt_password import flask_admin from f...
#!/usr/bin/python # -*- coding: utf-8 -*- import sys sys.path = ['../'] + sys.path import unittest import mingus.core.progressions as progressions class test_progressions(unittest.TestCase): def setUp(self): pass def test_to_chords(self): self.assertEqual([['C', 'E', 'G'], ['G', 'B', 'D']], ...
from net.grinder.script.Grinder import grinder from net.grinder.script import Test from net.grinder.plugin.http import HTTPRequest from HTTPClient import NVPair from java.util import Random newCellTest = Test(1, "Make a new Cell") evaluationTest = Test(2, "Evaluate") updateTest = Test(3, "Poll until evaluated") delete...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from re import compile as re_compile, IGNORECASE from ansible.errors import AnsibleError from ansible.parsing.splitter import parse_kv from ansible.plugins.lookup import LookupBase # shortcut format NUM = "(0?x?[0-9a-f]+)" SHORTC...
import unittest import sys, os import json import psycopg2 sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # Insanity for getting parent folder in path from shapefile2postgis import shapefile2postgis class TestPostgis2Geojson(unittest.TestCase): def test_shapefile2postgis_nofile(self...
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import datetime import unittest from django.utils import six from django.utils.encoding import ( escape_uri_path, filepath_to_uri, force_bytes, force_text, iri_to_uri, smart_text, uri_to_iri, ) from django.utils.functional import SimpleLazyObje...
"""Module provides target monitoring metrics collector - influxdata's `telegraf` - https://github.com/influxdata/telegraf/ backward compatibility with yandextank's Monitoring module configuration and tools. """ import datetime import fnmatch import json import logging import os import time import sys from copy import...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} import re try: import requests.exceptions from influxdb import InfluxDBClient from influxdb import exceptions HAS_INFLUXDB = True except ImportError: HAS_INFLU...
"""\ ================== 3D Transform class ================== A class containing a transformation matrix and providing several methods to use/alter it. Transform uses Vector objects for most of its methods arguments. """ from math import * from Vector import Vector # ============================= # Transform: for ge...
import os, os.path, re, socket, sys from os import environ as env, listdir from os.path import basename, isdir, isfile, islink, join as joinpath, normpath from filecmp import cmp as filecmp from shutil import copy def nfspath(dir): if dir.startswith('/.automount/'): dir = '/n/%s' % dir[12:] elif not di...
import argparse import csv import json import os import sys from datetime import datetime import requests from six import text_type # Keys for the CSV and JSON interpretation PAGINATION_KEY = 'pagination' NUM_PAGES_KEY = 'num_pages' NEXT_PAGE_URL_KEY = 'next' RESULTS_KEY = 'results' BLOCKS_URL_KEY = 'blocks_url' BLOC...
"""Tests for distutils.command.bdist_dumb.""" import os import sys import zipfile import unittest from test.test_support import run_unittest # zlib is not used here, but if it's not available # test_simple_built will fail try: import zlib except ImportError: zlib = None from distutils.core import Distributio...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['stableinterface'], 'supported_by': 'core' } DOCUMENTATION = r''' --- author: Ansible Core Team (@ansible) module: include_role short_description: Load and execu...
import os import logging from twisted.python.failure import Failure SCRAPEDMSG = u"Scraped from %(src)s" + os.linesep + "%(item)s" DROPPEDMSG = u"Dropped: %(exception)s" + os.linesep + "%(item)s" CRAWLEDMSG = u"Crawled (%(status)s) %(request)s (referer: %(referer)s)%(flags)s" class LogFormatter(object): """Cla...
import os import pipes from ansible.utils import template from ansible import utils from ansible import errors from ansible.runner.return_data import ReturnData import base64 class ActionModule(object): TRANSFERS_FILES = True def __init__(self, runner): self.runner = runner def get_checksum(self...
import github.GithubObject class GitBlob(github.GithubObject.CompletableGithubObject): """ This class represents GitBlobs as returned for example by http://developer.github.com/v3/todo """ def __repr__(self): return self.get__repr__({"sha": self._sha.value}) @property def content(sel...
"""Information about the encoding of errors over HTTP.""" from u1db import ( errors, ) # error wire descriptions mapping to HTTP status codes wire_description_to_status = dict([ (errors.InvalidDocId.wire_description, 400), (errors.MissingDocIds.wire_description, 400), (errors.Unauthorized.wire_de...
"""The FilterScheduler is for creating volumes. You can customize this scheduler by specifying your own volume Filters and Weighing Functions. """ from oslo_config import cfg from oslo_log import log as logging from cinder import exception from cinder.i18n import _, _LE, _LW from cinder.scheduler import driver from ...
import phe as paillier import numpy as np import json import syft from .basic import Float, PaillierTensor from ...tensor import TensorBase from ..abstract.keys import AbstractSecretKey, AbstractPublicKey from ..abstract.keys import AbstractKeyPair class SecretKey(AbstractSecretKey): def __init__(self, sk): ...