content
string
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Passport', fields=[ ('id', models.AutoField(ser...
import itertools import random import re import urllib import uuid from tempest import exceptions def rand_uuid(): return str(uuid.uuid4()) def rand_uuid_hex(): return uuid.uuid4().hex def rand_name(name=''): randbits = str(random.randint(1, 0x7fffffff)) if name: return name + '-' + randb...
from tota import actions from tota import settings from tota.utils import distance, closest, sort_by_distance, possible_moves class Thing: """Something in the world.""" ICON = '?' ICON_BASIC = '?' def __init__(self, name, life, team, acts, position=None): if team not in (settings.TEAM_DIRE, ...
from __future__ import absolute_import from socket import gethostbyname, gethostname from pychron.extraction_line.switch_manager import SwitchManager from pychron.globals import globalv import six class ClientSwitchManager(SwitchManager): def get_state_checksum(self, vkeys): if self.actuators: ...
"""This module contains tools for handling tick marks in cartopy.""" import numpy as np from matplotlib.ticker import Formatter, MaxNLocator import cartopy.crs as ccrs from cartopy.mpl.geoaxes import GeoAxes class _PlateCarreeFormatter(Formatter): """ Base class for formatting ticks on geographical axes usi...
#!/usr/bin/env python import StringIO from InventoryFilter import InventoryFilter class DuffyInventory(InventoryFilter): def get_hostnames(self, topo): hostnames = [] for group in topo['duffy_res']: for host in group['hosts']: hostnames.append(host) return ho...
import module as mojom # This module provides a mechanism for determining the packed order and offsets # of a mojom.Struct. # # ps = pack.PackedStruct(struct) # ps.packed_fields will access a list of PackedField objects, each of which # will have an offset, a size and a bit (for mojom.BOOLs). class PackedField(object...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
# coding=utf-8 from __future__ import absolute_import, unicode_literals from gs.group.privacy.visibility import GroupVisibility from edem.skin.interfaces import IEDemGroupProperties from gs.group.properties.change import ChangePropertiesForm from gs.content.form.base.utils import enforce_schema from gs.content.form.bas...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): dependencies = [ ('oef', '0009_auto_20180131_0938'), ] def insert_instructions(apps, schema_edit...
"""Base test class SSDFeatureExtractors.""" from abc import abstractmethod import itertools import numpy as np import tensorflow as tf from google.protobuf import text_format from object_detection.builders import hyperparams_builder from object_detection.protos import hyperparams_pb2 from object_detection.utils impo...
"""Interface to the Gerrit REST API.""" import json import logging import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry from .auth import HTTPBasicAuthFromNetrc, Anonymous logger = logging.getLogger("pygerrit2") fmt = "%(asctime)s-[%(name)s-%(levelname)s] %...
import unittest import ossie.utils.testing import os from omniORB import any class ComponentTests(ossie.utils.testing.ScaComponentTestCase): """Test for all component implementations in fs_checker_ff_2i2o""" def testScaBasicBehavior(self): ##############################################################...
# coding: utf-8 import os import sys sys.path.append(os.path.abspath(os.path.join(os.path.pardir, 'shared'))) # noinspection PyPep8,PyUnresolvedReferences import config # noinspection PyPep8,PyUnresolvedReferences import hub class Broker: def __init__(self): super().__init__() self.hub = hub.H...
import pandas as pd class ResponseParameters: """Container for time series data for a gene in a condition Which may be used to determine the response value for that gene in the condition. """ def __init__(self, gene_name, condition, gene_level_before, gene_level, time_interval): s...
from unittest import TestCase from mediawords.db import connect_to_db from mediawords.dbi.downloads.store import store_content from mediawords.test.db.create import ( create_test_medium, create_test_feed, create_download_for_feed, create_test_story, create_download_for_story, ) class TestDownload...
"""Sphinx configuration.""" from __future__ import print_function import os import sphinx.environment # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Do not warn on external images. suppress_...
from PyQt4.QtCore import Qt, QAbstractTableModel, SIGNAL from PyQt4.QtGui import QStyledItemDelegate, QColor, QHeaderView, QFont, \ QColorDialog, QTableView, qRgb, QImage import numpy as np import Orange from Orange.widgets import widget, settings, gui from Orange.widgets.utils.colorpalette import \ Continuous...
import random as rnd import string import translation import molecules as mol import re import pandas as pd import numpy class ModelData: """ class to process data sources for usage in the model """ code = dict([('UCA', 'S'), ('UCG', 'S'), ('UCC', 'S'), ('UCU', 'S'), ('UUU', 'F'), ('UUC',...
""" This module contains functions to assist in the construction of URIs for views. """ from __future__ import unicode_literals from __future__ import absolute_import, division, print_function __author__ = "Graham Klyne (<EMAIL>)" __copyright__ = "Copyright 2014, G. Klyne" __license__ = "MIT (http://openso...
""" Vanishing point and line marker estimation from a single camera image. """ import os import time import numpy as np import cv2 from mvq import stereo_path from matplotlib import pyplot as plt from mvq.filters.lane_marker import lane_marker_filter from mvq.detectors.ransac_vanishing_point import ransac_vanishing_...
"""Simple image classification with Inception. Run image classification with Inception trained on ImageNet 2012 Challenge data set. This program creates a graph from a saved GraphDef protocol buffer, and runs inference on an input JPEG image. It outputs human readable strings of the top 5 predictions along with their...
import sys from ..base_request import BaseRequest from ..settings import Settings def _normalize_device_type(dev_type): if dev_type['state'] == 'PREVIEW': dev_type['state'] = 'ALPHA' dev_type['name'] = dev_type['name'].replace('(PREVIEW)', '(ALPHA)') if dev_type['state'] == 'EXPERIMENTAL': ...
import time from zmq.eventloop import ioloop from core.connectors import CommandConnector loop = ioloop.IOLoop().instance() class MyCommandConnector(CommandConnector): def __init__(self, name, end_point): CommandConnector.__init__(self, name, end_point) self._stream.on_recv_stream(self._on_recv...
# Import Python Modules import es, re, md5, playerlib, repeat import gamethread import threading import playerlib import urllib, httplib, time, hashlib, hmac import threading ## This is now loaded via the site-packages folder instead of via the egg method try: import simplejson as json except ImportError: print ("Json...
"""Tests for srgb.""" from absl.testing import flagsaver from absl.testing import parameterized import numpy as np from tensorflow_graphics.image.color_space import linear_rgb from tensorflow_graphics.image.color_space import srgb from tensorflow_graphics.util import test_case class LinearRGBTest(test_case.TestCase...
import json from six.moves import urllib, xmlrpc_client from .util import CaseInsensitiveDict, read_body import logging log = logging.getLogger(__name__) def method(r1, r2): return r1.method == r2.method def uri(r1, r2): return r1.uri == r2.uri def host(r1, r2): return r1.host == r2.host def schem...
from django import forms from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ from captcha.fields import CaptchaField from commons import happyforms from models import UserProfile class UserForm(happyforms.ModelForm): class Meta: model = User fields =...
''' TODO - check to make sure protein -> rna indexing conversions are correct add support for signalP and tmhmm add support for secondary files as appropriate find more efficient way to join sorted DataFrames ''' import argparse import pandas as pd import csv import os from itertools import count imp...
import sys import datetime import time import subprocess # call like this: python startTime.py $PID pid = sys.argv[1] proc = subprocess.Popen(['ps','-eo','pid,etime'], stdout=subprocess.PIPE) # get data from stdout #proc.wait() #results = proc.stdout.readlines() out, err = proc.communicate() results = out.decode().st...
from sympy.external import import_module from sympy.utilities.pytest import warns # fixes issue that arose in addressing issue 6533 def test_no_stdlib_collections(): ''' make sure we get the right collections when it is not part of a larger list ''' import collections matplotlib = import_module...
"""Generic linux scsi subsystem and Multipath utilities. Note, this is not iSCSI. """ import os import re from oslo_concurrency import processutils as putils from oslo_log import log as logging from os_brick import exception from os_brick import executor from os_brick.i18n import _LW from os_brick import utils L...
""" Support for Radio Thermostat wifi-enabled home thermostats. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/thermostat.radiotherm/ """ import datetime import logging from urllib.error import URLError from blumate.components.thermostat import ( ST...
import base64 from nose.tools import assert_equal, assert_true from sheepdog import serialisation class TestSerialisation: def test_serialises_functions(self): def myfunc(a, b): return a + b fs = serialisation.serialise_function(myfunc) assert_equal(type(fs), bytes) f =...
try: import curses except ImportError: pass colors = [ 'COLOR_BLACK', 'COLOR_BLUE', 'COLOR_CYAN', 'COLOR_GREEN', 'COLOR_MAGENTA', 'COLOR_RED', 'COLOR_WHITE', 'COLOR_YELLOW' ] # {(fg, bg): pair_number, ...} color_pairs = { ("white", "black"): 0 # Special case, can't be chang...
import logging import os from abc import ABC, abstractmethod from pathlib import Path from gensim.corpora import Dictionary class FolderAggregatedCorporaABC(ABC): """ Groups multiple news documents by folder """ def __init__(self, directory, temp_directory, dictionary: Dictionary, language=None): ...
""" Utilities for printing ElementTree instances to file-like objects in a manner agnostic to the actual ElementTree implementation used, e.g. standard Python's xml.etree.ElementTree.ElementTree vs. lxml's lxml.etree. see https://docs.python.org/3/library/xml.etree.elementtree.html """ __author__ = "Todd Shore <<EMAI...
# -*- coding: utf-8 -*- import ttk import Tkinter as tk import datetime import time import thread from CMGlobal import * from CMConfig import * from CMUtil import * # dialog import from ui.MovieDialog import * from ui.HallDialog import * from ui.PlayDialog import * from ui.PlayListView import * from ui.MovieListView...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'XSSAlert/ui/update.ui' # # by: PyQt4 UI code generator 4.8.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = ...
import os from gslab_builder import GSLabBuilder def build_latex(target, source, env): ''' Compile a pdf from a LaTeX file This function is a SCons builder that compiles a .tex file as a pdf and places it at the path specified by target. Parameters ---------- target: string or list ...
###################################################### ## SEISMON RfAmp Prediction Code ## ## ## Uses PYTHON package robustLocklossPredictionPkg3 & MATLAB 2016b shared libraries, ## Make sure to run the script set_shared_library_paths.sh prior to running this script. ## To re-install the package go through readme.tx...
import os.path import shutil import string import tempfile from cinder.brick.iscsi import iscsi from cinder import test from cinder.volume import driver class TargetAdminTestCase(object): def setUp(self): self.cmds = [] self.tid = 1 self.target_name = 'iqn.2011-09.org.foo.bar:volume-bla...
import fixtures from neutron_lib import constants from neutronclient.common import exceptions as nc_exc from oslo_config import cfg from neutron.agent.linux import ip_lib from neutron.agent.linux import utils from neutron.common import utils as common_utils from neutron.plugins.ml2.drivers.linuxbridge.agent import \ ...
#!/usr/bin/env python """Automatically install required tools and data to run bcbio-nextgen pipelines. This automates the steps required for installation and setup to make it easier to get started with bcbio-nextgen. The defaults provide data files for human variant calling. Requires: git, Python 3.x, Python 2.7 or a...
""" Unit tests for :func:`iris.analysis.geometry._extract_relevant_cube_slice`. """ from __future__ import (absolute_import, division, print_function) # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests import iris.tests.stock as stock impor...
"""Superdesk Users""" from settings import LDAP_SERVER from superdesk.resource import Resource class RolesResource(Resource): schema = { 'name': { 'type': 'string', 'iunique': True, 'required': True, }, 'description': { 'type': 'string' ...
import functools from . import test_utils from collections import defaultdict from infi.pyutils.lazy import CacheData, TimerCacheData, cached_property, \ cached_method, populate_cache, cached_function, clear_cache, clear_cached_entry, \ cached_method_with_custom_cache import time class Subject(object): def...
''' Point Clouds ============ Contains PointCloud class. Given a number of points and their relative distances, this class aims at reconstructing their relative coordinates. ''' from __future__ import division, print_function # Provided by LCAV import numpy as np from scipy import linalg as la class PointCloud: ...
import os import sys import argparse import logging import configparser from lib.search.request import Request from lib.downloader import Downloader from lib.api import API from lib.clipboard import Clipboard from lib.bulkconverter import BulkConverter # MAIN VERSION OF THIS PROGRAM __version_info__ = (0, 1, 2) __ver...
import unittest import pytest from httpretty import HTTPretty, httprettified, Response from ntlm3 import HTTPNtlmAuthHandler from ..fixtures import * # noqa from ..utils import MockRawServerResponse from six.moves import urllib class Test_NTLMAuthHandler_Issues(unittest.TestCase): @httprettified def test...
# -*- coding: utf-8 -*- """ Transform clusters into TextRegions and populate them with TextLines Created on August 2019 Copyright NAVER LABS Europe 2019 @author: Hervé Déjean """ import sys, os, glob from optparse import OptionParser from copy import deepcopy from collections import Counter from collections import ...
""" Select only a part of the instances .. todo: group instance selectors """ import random import logging from collections import defaultdict from pySPACE.missions.nodes.base_node import BaseNode from pySPACE.tools.memoize_generator import MemoizeGenerator class InstanceSelectionNode(BaseNode): """Retain only...
# -*- coding: utf-8 -*- import numpy as np from scipy import sparse from pygsp import utils _logger = utils.build_logger(__name__) @utils.filterbank_handler def compute_cheby_coeff(f, m=30, N=None, *args, **kwargs): r""" Compute Chebyshev coefficients for a Filterbank. Parameters ---------- f...
from __future__ import unicode_literals from frappe import _ def get_data(): return { 'heatmap': True, 'heatmap_message': _('This is based on the attendance of this Employee'), 'fieldname': 'employee', 'transactions': [ { 'label': _('Leave and Attendance'), 'items': ['Attendance', 'Attendance Reque...
# -*- 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 field 'TextWrapper.classes' db.add_column('cmsplugin_text', 'classes', self.g...
import sys import logging from ginga.gtk3w.ImageViewGtk import CanvasView, ScrolledView from ginga.gtk3w import GtkHelp from ginga.util.loader import load_data from gi.repository import Gtk STD_FORMAT = '%(asctime)s | %(levelname)1.1s | %(filename)s:%(lineno)d (%(funcName)s) | %(message)s' class FitsViewer(object...
import base64 import re from types import ListType from googleapiclient.errors import HttpError from .. import GoogleApiClient from .errors import AcknowledgeError from .errors import AlreadyExistsError from .errors import NotFoundError class PubSub(GoogleApiClient): MAX_MESSAGES = 100000 def __init__(sel...
#!/usr/bin/env python """libPoMo.seqbase ================== This module provides basic functions and classes needed to work with sequence data. Objects ------- Classes: - :class:`Seq`, stores a single sequence - :class:`Region`, region in a genome Exception Classes: - :class:`SequenceDataError` - :class:`No...
import sys from rally.common.i18n import _ from rally.common.i18n import _LE from rally.common.plugin import discover from rally.common.plugin import info from rally.common.plugin import meta from rally import exceptions def base(): """Mark Plugin as a base. Base Plugins are used to have better organization...
import numpy as np from nose.tools import raises import simpleml.helpers as helpers class TestNPPrintOptions: def test_print(self): with helpers.np_print_options(precision=2): print(np.array([1.234234, 2.200003])) def test_precision(self): with helpers.np_print_options(precision=...
""" This code has been borrowed from the BlackBox application """ import os, ConfigParser import sys # the configuration key used in the INI file CONFIG_KEY = "DEFAULT" __all__ = ['configinit', 'config', 'print_config', 'set_config'] # locate the home dir of the package homedir = os.path.abspath(os.path.dirname(__n...
import os import sys import argparse from pyhammer.builder import Builder from pyhammer.tasks.git.gitcheckouttask import GitCheckoutTask from pyhammer.tasks.git.gitcommitandpushtask import GitCommitAndPushTask from pyhammer.tasks.helpers.commandtask import CommandTask from pyhammer.tasks.io.copytask import CopyTask fr...
from django.shortcuts import render_to_response from django.template import RequestContext from django.contrib.auth.decorators import login_required from accounts.forms import UserProfileForm from accounts.models import UserProfile @login_required def change_user_profile(request): """ View for display and pr...
# -*- coding: utf-8 -*- from content import ContentObject import copy class aid: def __init__(self, name=None, addresses=None, resolvers=None, userDefinedProperties=None, co=None): """ Agent Identifier Class Optional parameters: String name String[] addresse...
import datetime, time, sys, csv, os.path import contextlib inputPath = os.path.dirname(os.path.abspath(__file__)) + "/" try: inputFilePath = sys.argv[1] outputPath = sys.argv[2] except IndexError: print ("Usage: python %s infilename.csv path/to/output/folder/" % sys.argv[0]) exit() if not os.path...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function import logging from gitlab import Gitlab from gitlab.exceptions import GitlabGetError, GitlabCreateError from ..errors import BranchExistsError, RepoDoesNotExistError from base64 import b64encode logger = logging.getLogger(__name__) class...
import sys import time import numpy from gnuradio import gr import sciscipy import scipy.signal as signal import matplotlib.pyplot as plt from matplotlib import patches from matplotlib.pyplot import axvline, axhline class plzr_plot(gr.sync_block): """ docstring for block add_python """ def __init__(s...
"""abydos.tests.distance.test_distance_kulczynski_ii. This module contains unit tests for abydos.distance.KulczynskiII """ import unittest from abydos.distance import KulczynskiII class KulczynskiIITestCases(unittest.TestCase): """Test KulczynskiII functions. abydos.distance.KulczynskiII """ cmp ...
"""Tests for feedback-related services.""" from core.domain import feedback_services from core.platform import models from core.tests import test_utils (feedback_models,) = models.Registry.import_models([models.NAMES.feedback]) class FeedbackServicesUnitTests(test_utils.GenericTestBase): """Test functions in fe...
from os import environ from pybuilder.core import task, init from ddadevops import * import logging name = 'dda-user-crate' MODULE = 'docker-as-sudoer' PROJECT_ROOT_PATH = '../..' class MyBuild(DevopsDockerBuild): pass @init def initialize(project): project.build_depends_on('ddadevops>=0.6.0') stage = 'd...
################################################### ######## Programmable filter script ######## ################################################### Name = 'QuaternionToOrientation' Label = 'Convert Quaternion to Orientation Frame' Help = 'This converts the orientation from a quaternion to an orientation matrix' # O...
# -*- coding: utf-8 -*- from collections import defaultdict from hackarena.player import Player from hackarena.spell import Spell from hackarena.team import Team from hackarena.messages import AllMainBroadcast from hackarena.messages import FEMessages from hackarena.messages import WelcomeBroadcast from hackarena.messa...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'PageHit.extra_info' db.add_column('pagehit_pagehit', 'extra_info', self.gf('django.db.mode...
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import nltk.tokenize import MySQLdb import pandas as pd import sys def checkCNN(doc_id = 0, candidate = 4, dimensions = 200, samples = 300, iterations = 180, dropout = 0.2, test = 'Error', port = 3306): ...
from os.path import dirname, join from urlparse import urlparse, parse_qsl from csv import DictReader from io import StringIO import unittest from httmock import response, HTTMock from . import check_file from .api import hash_host_records, format_csv_row, check_upstream, push_upstream class TestFile (unittest.TestC...
from maya import cmds as m from fxpt.fx_utils.utils_maya import getShape, getParent, parentAPI # noinspection PyAttributeOutsideInit class TransformHandle(object): def __init__(self, transform=None, shape=None): self.initHandle(transform, shape) def __str__(self): return 'transform={}, shape=...
# 复用image图像. import tensorflow as tf image_filename = "../test_images/test-input-image.jpg" # 获得文件名列表 filename_queue = tf.train.string_input_producer(tf.train.match_filenames_once(image_filename)) # 生成文件名队列 image_reader = tf.WholeFileReader() _, image_file = image_reader.read(filename_queue) # 通过阅读器返回一个键值对,其中value表示图像...
#!/usr/bin/env python # Intro to Robotics - EE5900 - Spring 2017 # Final Project # Philip (Team Lead) # Ian # Akhil # # Revision: v1.1 # imports import rospy import actionlib import random import sys import time import roslaunch import os import math import cv_bridge imp...
# -*- coding: utf-8 -*- """ *************************************************************************** BasicStatisticsNumbers.py --------------------- Date : September 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *************...
# -*- coding: utf-8 -*- import time import pytz from datetime import datetime from contextlib import closing from minerva.storage import datatype from minerva.directory.datasource import DataSource from minerva.directory.entitytype import EntityType from minerva.test import clear_database from minerva.storage.attrib...
# __ File: stickylink.py ______________________________________________________________________________________________ # Implements : class stickylink # Description : Type generated by ATOM3 for joints. # Modified : 26 Oct 2001 # - 15 Jan 2002: the invalid() function was missing! # ______________________...
#!/usr/bin/python ''' Author: Alexander Godlewski Year: 2011 A script to step through the leaderboards for SOCOM 4 Gather the results and dump to a CSV file There are issues with the implementation of the leaderboards that causes the time played for a player to often be syn...
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" from setuptools import find_packages, setup with open("README.md") as readme_file: readme = readme_file.read() setup_requirements = [ "pytest-runner>=5.2", "wheel>=0.35.1", ] test_requirements = [ "black>=19.10b0", "codecov>=...
# Verbose, notice, and spam log levels for Python's logging module. # # Last Change: August 7, 2017 # URL: https://verboselogs.readthedocs.io """ Pylint_ plugin to fix invalid errors about the :mod:`logging` module. .. _Pylint: https://pypi.python.org/pypi/pylint """ from astroid import MANAGER, scoped_nodes, nodes ...
# Import turtle package import turtle # Creating a turtle object(pen) pen = turtle.Turtle() # Defining a method to draw curve def curve(): for i in range(200): # Defining step by step curve motion pen.right(1) pen.forward(1) # Defining method to draw a full heart def h...
from abc import ABCMeta, abstractmethod from datetime import datetime from typing import Tuple, List, Dict, Union, Optional import validators from bs4 import BeautifulSoup from flask import current_app as app from sqlalchemy.orm import joinedload from sqlalchemy.orm.exc import NoResultFound from yarl import URL from ...
from OCC.BRepBuilderAPI import BRepBuilderAPI_Transform, BRepBuilderAPI_MakeEdge from math import pi from slice_elements import * from analysis_slices import * class SliceAnalyzer(object): def __init__(self): self.slice_list = [] self._visualizer = None self.slice_axis = None sel...
"""Stubouts, mocks and fixtures for the test suite.""" import copy import datetime from nova import db from nova import exception class FakeModel(object): """Stubs out for model.""" def __init__(self, values): self.values = values def __getattr__(self, name): return self.values[name] ...
""" Product tests for SSH authentication for presto-admin commands """ import os import subprocess import re from nose.plugins.attrib import attr from tests.no_hadoop_bare_image_provider import NoHadoopBareImageProvider from tests.product.base_product_case import BaseProductTestCase, docker_only from tests.product.c...
import os import datetime import re import subprocess import time import requests from decouple import config OWNER = 'mozilla-services' REPO = 'buildhub' GITHUB_API_KEY = config('GITHUB_API_KEY', default='') def get_current_version(): with open("jobs/setup.py", "r") as fp: lines = fp.readlines() ...
from seamless.highlevel import Context, Cell from seamless.highlevel import set_resource executor_file = "executor.py" # 1: Setup ctx = Context() ctx.executor_code = set_resource(executor_file) ctx.executor_code._get_hcell()["language"] = "python" ctx.executor_code._get_hcell()["transformer"] = True ctx.executor_cod...
"""A connector for reading from and writing to Google Cloud Datastore""" import logging # Protect against environments where datastore library is not available. # pylint: disable=wrong-import-order, wrong-import-position try: from google.cloud.proto.datastore.v1 import datastore_pb2 from googledatastore import he...
import abc ################################################################################################# # COMPOSITE # ################################################################################################# class ComputerComponent(metaclass=abc.ABCMeta): @abc.abstractmethod de...
""" Class to manage connections for the Message Queue resources. Also, set of 'private' helper functions to access and modify the message queue connection storage. They are ment to be used only internally by the MQConnectionManager, which should assure thread-safe access to it and standard S_OK/S_ERROR erro...
"""Test fee estimation code.""" from decimal import Decimal import random from test_framework.messages import CTransaction, CTxIn, CTxOut, COutPoint, ToHex, COIN from test_framework.script import CScript, OP_1, OP_DROP, OP_2, OP_HASH160, OP_EQUAL, hash160, OP_TRUE from test_framework.test_framework import BitcoinTestF...
"""Image plotting from 2d datasets.""" import numpy as N from .. import qtall as qt from .. import setting from .. import document from .. import utils from ..helpers import qtloops from . import plotters def _(text, disambiguation=None, context='Image'): """Translate text.""" return qt.QCoreApplication.tran...
""" .. module: cloudaux.tests.openstack.test-conn :platform: Unix :copyright: Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. See AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Michael Stair <<EMAIL>> """ import os import unittest import mock from clo...
def remove_adjacent(nums): newList = [] if len(nums) > 0: newList.append(nums[0]) for n in nums: if n != newList[-1]: newList.append(n) return newList # E. Given two lists sorted in increasing order, create and return a merged # list of all the elements in sorted order. You may modify the passed in ...
#!/usr/bin/env python3 """ Created on 25 Sep 2016 @author: Bruno Beloff (<EMAIL>) """ import subprocess as sp from scs_core.sys.eeprom_image import EEPROMImage from scs_dfe.interface.component.cat24c32 import CAT24C32 from scs_host.bus.i2c import I2C # -----------------------------------------------------------...
#!/usr/bin/env python # This program is used to verify the FS history code. # # The basic gist is this: given a repository, a path in that # repository, and a revision at which to begin plowing through history # (towards revision 1), verify that each history object returned by # the svn_fs_history_prev() interface -- ...