gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
"""ZeroconfMessaging is a module to make local multicasted, multithreaded, queued unordered, reliable messaging simpler than you can imagine. Peer discovery happens automatically. Naming conflicts are solved automatically. Forget IGMP and special hardware requirements. Uses zeroconf networking. Message size is limited ...
import fs.utils import fs.path import tempfile import shutil import time from fs.osfs import OSFS from fs.multifs import MultiFS from fs.errors import (ResourceLockedError) from contextlib import contextmanager # HELPER FUNCTIONS def _close(filesys): closed = False for _ in range(5): try: ...
import unittest from random import shuffle from sqlalchemy.orm import defaultload, selectinload from . import models from .util import QueryLogger, TestQueryStringsMixin from .saversion import SA_SINCE, SA_UNTIL from mongosql import selectinquery # Detect SqlAlchemy version # We need to differentiate, because: # in ...
"""receiver. This module defines the receiving part for alarmRetarder. """ import threading import logging from pysnmp.entity import engine, config from pysnmp.carrier.asynsock.dgram import udp from pysnmp.entity.rfc3413 import ntfrcv from .entities import Alert class Receiver(threading.Thread): """ An alarm rec...
# -*- coding: utf-8 -*- """The artifact definitions registry.""" from artifacts import definitions from artifacts import errors from artifacts import source_type class ArtifactDefinitionsRegistry(object): """Artifact definitions registry.""" _source_type_classes = { definitions.TYPE_INDICATOR_ARTIFACT_GRO...
""" test with the .transform """ import pytest import numpy as np import pandas as pd from pandas.util import testing as tm from pandas import Series, DataFrame, Timestamp, MultiIndex, concat, date_range from pandas.core.dtypes.common import ( ensure_platform_int, is_timedelta64_dtype) from pandas.compat import S...
from __future__ import unicode_literals from collections import OrderedDict from distutils.version import LooseVersion import os from github3 import login import hiyapyco import raven import cumulusci from cumulusci.core.config import BaseTaskFlowConfig from cumulusci.core.exceptions import ConfigError from cumulusci...
''' Created on Sep 20, 2011 @author: jlu ''' from django.test import TestCase from django.test.client import Client from django.db import connection from datetime import datetime from django.contrib.auth.models import User import json import base64 from api import setup_func from server.models import UserPoint, UserRe...
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import file_writer as fw import flux_simulator as fs import quantifiers as qs import os.path import parameters import piquant_options as po RUN_SCRIPT = "run_quantification.sh" TRANSCRIPT_COUNTS_SCRIPT = "count_transcripts_for_genes.py" UNIQUE_SEQUENCE_SCRIPT = "calculate_unique_transcript_sequence.py" ASSEMBLE_DATA_...
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generator script for proxy tests. See AndroidProxySelectorTest.java and net/proxy_resolution/proxy_config_service_android_unitt...
# -*- coding: utf-8 -*- import os import csv import numpy as np import dirfiles from confparser import load_config import expyriment from expyriment import design, control, stimuli, io, misc def launch_protocol(protocol_ini, exp, gender, vs): # %% # ======================== LOAD CONFIG.INI FILE ===========...
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of Treeio. # License www.tree.io/license """ Core module views """ from django.contrib.auth import authenticate, login, logout from django.contrib.sessions.models import Session from django.contrib.sites.models import RequestSite # from django.con...
# -*- coding: utf-8 -*- import furl from rest_framework import status as http_status import json from future.moves.urllib.parse import quote from lxml import etree import requests from framework.auth import authenticate, external_first_login_authenticate from framework.auth.core import get_user, generate_verificatio...
from __future__ import (absolute_import, division, print_function) import numpy as np import re import sys import copy from periodictable import formula from qtpy.QtWidgets import QMainWindow, QApplication from addie.utilities import load_ui from qtpy import QtGui from addie.processing.mantid.master_table.table_row_ha...
""" This module contains the default values for all settings used by Scrapy. For more information about these settings you can read the settings documentation in docs/topics/settings.rst Scrapy developers, if you add a setting here remember to: * add it in alphabetical order * group similar settings without leaving ...
""" Module to set up run time parameters for Clawpack -- classic code. The values set in the function setrun are then written out to data files that will be read in by the Fortran code. """ import os import numpy as np #------------------------------ def setrun(claw_pkg='amrclaw'): #--------------------------...
import collections as col import copy import itertools import math import operator import thalesians.tsa.intervals # Based on an answer by Gustavo Bezerra on Stack Overflow # https://stackoverflow.com/questions/15411967/how-can-i-check-if-code-is-executed-in-the-ipython-notebook def is_notebook(): try: sh...
import logging import ast import re import requests from teuthology.util.compat import urljoin, urlencode from collections import OrderedDict from teuthology.util.compat import PY3 if PY3: from io import StringIO else: from io import BytesIO as StringIO from teuthology import repo_utils from teuthology.confi...
import csv import os import shutil import numpy as np from sklearn.cluster import DBSCAN from sklearn.cluster import KMeans from sklearn import metrics from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA from sklearn.neighbors import NearestNeighbors from scipy.spatial import Conve...
"""Binary for decoding from translation models based on tensorflow/models/rnn/translate/translate.py. Note that this decoder is greedy and very basic. For a better decoder, see http://ucam-smt.github.io/sgnmt/html/tutorial.html which supports decoding from tensorflow models. """ from __future__ import absolute_import ...
# Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
# Copyright (C) 2020 NTT DATA # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
from __future__ import absolute_import, print_function, division import unittest from datetime import date from decimal import Decimal from pony.orm.core import * from pony.orm.sqltranslation import IncomparableTypesError from pony.orm.tests.testutils import * from pony.orm.tests import setup_database, teardown_datab...
#!/usr/bin/env python # # Copyright 2014, NICTA # # This software may be distributed and modified according to the terms of # the BSD 2-Clause license. Note that NO WARRANTY is provided. # See "LICENSE_BSD2.txt" for details. # # @TAG(NICTA_BSD) # # # seL4 System Call Stub Generator # =============================== # ...
"""This platform enables the possibility to control a MQTT alarm.""" import logging import re import voluptuous as vol from homeassistant.components import mqtt import homeassistant.components.alarm_control_panel as alarm from homeassistant.components.alarm_control_panel.const import ( SUPPORT_ALARM_ARM_AWAY, ...
# Note: These views are viewable only by people in the analyzers # group. They should all have the analyzer_required decorator. # # Also, because we have this weird thing with new users, # they should also have the check_new_user decorator. # # Thus each view should be structured like this: # # @check_new_user # ...
import ctypes from ctypes import (POINTER, c_char_p, c_size_t, c_int, c_long, c_ulong, c_double, c_void_p) from ctypes.util import find_library class _c_gsl_rng_type(ctypes.Structure): _fields_ = [('name', c_char_p), ('max', c_long), ('min', c_size_t), ...
# -*- coding: utf-8 -*- import os import unittest import mock from nose.tools import * # PEP8 asserts from nose.plugins.attrib import attr import nltk from textblob.tokenizers import WordTokenizer from textblob.classifiers import (NaiveBayesClassifier, DecisionTreeClassifier, basic_extr...
# Copyright (c) 2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
import datetime import tornado.gen from bson.objectid import ObjectId import motor import two.execute from two.playconn import PlayerConnection import twcommon.misc from twcommon.excepts import MessageException, ErrorMessageException from twcommon.excepts import SymbolError, ExecRunawayException DIRTY_WORLD = 0x0...
# # blowfish.py # Copyright (C) 2002 Michael Gilfix <mgilfix@eecs.tufts.edu> # # This module is open source; you can redistribute it and/or # modify it under the terms of the GPL or Artistic License. # These licenses are available at http://www.opensource.org # # This software must be used and distributed in accordance...
''' Backend script for the "E-Mail defer"-Zimlet available at https://github.com/dploeger/zimbra-zimlet-emaildefer @author: Dennis Ploeger <develop@dieploegers.de> ''' # Imports from com.zimbra.client import ZMailbox from com.zimbra.common.account.Key import AccountBy from com.zimbra.client import ZSearchParams fro...
from functools import wraps import json import sys import traceback from copy import deepcopy from flask.ext import restful from flask import make_response, request, Markup, g, current_app from werkzeug.exceptions import HTTPException from hoops.status import library as status_library from hoops.response import APIRes...
# coding: utf-8 from __future__ import unicode_literals import re from .turner import TurnerBaseIE from ..utils import ( ExtractorError, int_or_none, ) class AdultSwimIE(TurnerBaseIE): _VALID_URL = r'https?://(?:www\.)?adultswim\.com/videos/(?P<is_playlist>playlists/)?(?P<show_path>[^/]+)/(?P<episode_pa...
# encoding: utf8 from __future__ import unicode_literals from optparse import make_option from collections import OrderedDict from importlib import import_module import itertools import traceback from django.apps import apps from django.core.management import call_command from django.core.management.base import BaseCo...
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
''' DotDesktop ====================================== Simple app for creating and editing '.desktop' files. ==================== MIT License ==================== Dependencies =================== python 2.7 kivi 1.9.0 Author ==================== 2015 - Alberto Sola ''' from kivy.app impor...
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
#!/usr/bin/env python """ # ============================================================================= Copyright Government of Canada 2015-2016 Written by: Eric Marinier, Public Health Agency of Canada, National Microbiology Laboratory Funded by the National Micriobiology Laboratory and the Genome Canada / A...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from astropy import units as u from astropy.coordinates import galactocentric_frame_defaults from astropy.coordinates.distances import Distance from astropy.coordinates.builtin_frames import ( ...
import os import sys import time import lcm import functools import threading import glob import json import re import select import numpy as np from ddapp import lcmspy as spy VIDEO_LCM_URL = 'udpm://239.255.76.50:7650?ttl=1' class FieldData(object): def __init__(self, **kwargs): self.__dict__.update...
import unittest from test.support import (verbose, refcount_test, run_unittest, strip_python_stderr, cpython_only, start_threads, temp_dir, requires_type_collecting, TESTFN, unlink, import_module) from test.support.script_helper import assert...
# Copyright 2014 Rackspace # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
import warnings import numpy as np import pandas as pd import pandas.util.testing as tm try: from pandas.api.types import union_categoricals except ImportError: try: from pandas.types.concat import union_categoricals except ImportError: pass class Concat(object): goal_time = 0.2 ...
""" pies/overrides.py Overrides Python syntax to conform to the Python3 version as much as possible using a '*' import Copyright (C) 2013 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "...
import pytest from unittest.mock import MagicMock, patch from rota.mass import Mass, MassError from rota.reader import Reader # from rota.exclude import ExcludeError @pytest.fixture() def mass(): return Mass( 'saturday', { 'needed': 2, 'startfrom': 1, 'exclude':...
#!/usr/bin/python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import gyp.input import optparse import os.path import re import shlex import sys # Default debug modes for GYP debug = {} # List ...
# Copyright (c) 2012 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and ...
# License: BSD 3 clause import numpy as np from tick.hawkes.inference.base import LearnerHawkesNoParam from tick.hawkes.inference.build.hawkes_inference import (HawkesBasisKernels as _HawkesBasisKernels) from tick.solver.base.utils import relative_distance c...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable from torch.nn import Parameter from model import ConvInputModel, FCOutputModel, BasicModel, Highway class RFES(BasicModel): def __init__(self, args): supe...
# -*- coding: utf-8-*- """ Author: Marco Dinacci <dev@dinointeractive.com> License: BSD World Editor TODO * to deal with entities I need an Entity Manager (see also multifiles). It's ok to have multiple references but there must be only a single place where to manage them. * (re)code everything to use an Even...
""" neural network stuff, intended to be used with Lasagne """ import numpy as np import theano as th import theano.tensor as T import lasagne from lasagne.layers import dnn from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams # T.nnet.relu has some stability issues, this is better def relu(x): r...
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
#!/usr/bin/env python import re from ..debugging import bacpypes_debugging, ModuleLogger from ..task import OneShotTask from ..primitivedata import Atomic, Null, BitString, CharacterString, \ Date, Integer, Double, Enumerated, OctetString, Real, Time, Unsigned from ..basetypes import PropertyIdentifier, DateTime...
#!/usr/bin/env python # Copyright(C) 2011-2016 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, m...
""" Utililty classes and functions for the polynomial modules. This module provides: error and warning objects; a polynomial base class; and some routines used in both the `polynomial` and `chebyshev` modules. Error objects ------------- .. autosummary:: :toctree: generated/ PolyError base class fo...
# Encoding: UTF-8 """Tools to manage translation files To use, create a ForrinTools object and pass it a Translator class. Then, call the run method. """ from __future__ import print_function, unicode_literals, division import os import argparse import textwrap import six import pkg_resources import polib import ...
#!/usr/bin/env python # coding: utf-8 # pylint: disable=C0111 # pylint: disable=C0103 # pylint: disable=C0330 from __future__ import print_function import os import sys import argparse import traceback import webbrowser import re import json import multiprocessing from multiprocessing.pool import ThreadPool from time ...
from __future__ import print_function import os, sys import unittest import copy import math from rdkit.six.moves import cPickle from rdkit import RDConfig from rdkit import DataStructs from rdkit.Geometry import rdGeometry as geom def feq(v1, v2, tol=1.0e-4): return abs(v1 - v2) < tol class TestCase(unittest.T...
"""Support for RainMachine devices.""" from __future__ import annotations import asyncio from datetime import timedelta from functools import partial from typing import Any, cast from regenmaschine import Client from regenmaschine.controller import Controller from regenmaschine.errors import RainMachineError import v...
## # \namespace cross3d.studiomax.matlib # # \remarks This package contains material editing methods for Studiomax # # \author eric # \author Blur Studio # \date 01/06/11 # from Py3dsMax import mxs def buildMaterialFrom( material, opacityMap = None, displacementMap = None, bumpMap = None ): """ \remarks creates...
#!/usr/bin/env python # Copyright 2016 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import copy import s...
import os import time import inspect import json import traceback from collections import defaultdict import numpy as np from . import test_functions as funcs from . import go_benchmark_functions as gbf from .common import Benchmark, is_xslow, safe_import from .lsq_problems import extract_lsq_problems with safe_impo...
# Copyright 2013-2015 ARM Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
# Source: https://github.com/wolever/nose-parameterized # commit 0da3a2f0325c17858a5f5f1fdf1939520ce85e48, Aug 25, 2013 # Stefan: I removed the dependency on the six module, don't need the portability, now. # # tl;dr: all code code is licensed under simplified BSD, unless stated otherwise. # # Unless stated otherwise...
import datetime from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy import Table, Column, Integer, String, Boolean, Float, DateTime, ForeignKey, Text, Index from sqlalchemy import UniqueConstraint from sqlalchemy.orm import relationship Base = dec...
import re import json import yaml from random import randint from invoker import ReplyObject, Command from data.pokedex import Pokedex from plugins.pasteImporter import PasteImporter from .battle import Battle, Pokemon from .battleLogic import getAction, getSwitch, getLead # This currently only work in singles and not...
# Copyright (c) 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Library handling DevTools websocket interaction. """ import httplib import json import logging import os import sys file_dir = os.path.dirname(__fil...
# Copyright (C) 2014 VA Linux Systems Japan K.K. # Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp> # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License...
''' Created on Sep 19, 2012 @author: steve.a.jarvis@gmail.com A flexible, neat neural network. ''' from __future__ import print_function from random import random import math class NeuralNetwork(object): ''' The public interface is meant to be used like this: nn = NeuralNet(number_in, number_hid, numbe...
# Copyright 2011 Piston Cloud Computing, Inc. # All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
# This file comprises the tests that are internally validated (as # opposed to tests which produce output files that are externally # validated). Primarily they are unittests. # There is a read/write asymmetry: It is fairly easy to # internally validate the results of reading a PNG file because we # can know what pix...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: sw=4:ts=4:si:et:enc=utf-8 # Author: Ivan A-R <ivan@tuxotronic.org> # Project page: http://tuxotronic.org/wiki/projects/stm32loader # # This file is part of stm32loader. # # stm32loader is free software; you can redistribute it and/or modify it under # the terms of ...
#!/usr/bin/python3 from jsonschema import validate schema = { "$schema": "http://json-schema.org/schema#", "description": "Schema for border router information", "title": "Border Router Information", "type": "object", "properties": { "information": { "type": "object", ...
import sys MEM_SIZE = 0xffff BYTE_SIZE = 0xff class SAP2Emulator: def __init__(self): self._pc = 0x0000 self._a = 0x00 self._b = 0x00 self._c = 0x00 self._s = False self._z = False self._mem = bytearray(MEM_SIZE + 1) self._halt = False self....
# Copyright 2013: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
""" A simple workflow engine """ import logging from collections import defaultdict from datetime import datetime from string import Template from .task import Task class ExitWorkflow(Exception): """Exit the execution of a workflow earlier""" # Special exit status to be used by spawned programs to stop work...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
# -*- coding: utf-8 -*- # Supporting only python >= 2.6 from __future__ import unicode_literals from __future__ import print_function from future.builtins import str as text from future.builtins import (range, object) from past.builtins import basestring """ :class:`ExcelTableDirective` implements the ``exceltable`` ...
# -*- coding: utf-8 -*- """The SleuthKit (TSK) file entry implementation.""" import pytsk3 from dfvfs.lib import definitions from dfvfs.lib import errors from dfvfs.path import tsk_path_spec from dfvfs.vfs import file_entry from dfvfs.vfs import vfs_stat class TSKDirectory(file_entry.Directory): """Class that imp...
from __future__ import absolute_import from .consts import * from .utils import * from six.moves import map from six.moves import range class _dumb_repr(object): def __repr__(self): return '<%s %r>' % (self.__class__.__name__, self.__dict__) class SWFRawTag(_dumb_repr): def __init__(self, s=None): ...
from datetime import datetime, timedelta, time from dateutil.parser import parser from django.core.cache import cache import json from casexml.apps.case.models import CommCareCase from corehq.apps.api.es import ReportXFormES, get_report_script_field from corehq.util.dates import iso_string_to_datetime, iso_string_to_da...
#!/usr/bin/python # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
from __future__ import absolute_import, print_function, division import warnings import six from .headers import Headers from .. import encoding, utils CONTENT_MISSING = 0 if six.PY2: # pragma: nocover _native = lambda x: x _always_bytes = lambda x: x else: # While the HTTP head _should_ be ASCII, it'...
''' --- module: openshift_logging_facts version_added: "" short_description: Gather facts about the OpenShift logging stack description: - Determine the current facts about the OpenShift logging stack (e.g. cluster size) options: author: Red Hat, Inc ''' import copy import json # pylint: disable=redefined-builtin, ...
import os def split_path(path): folders = [] while True: path, folder = os.path.split(path) if folder != "": folders.append(folder) else: if path != "": folders.append(path) break folders.reverse() return folders def lex_file(...
import pytest from flex.constants import ( STRING, NULL, NUMBER, INTEGER, OBJECT, ) from flex.error_messages import MESSAGES from flex.exceptions import ValidationError from flex.loading.definitions.schema import schema_validator from tests.utils import ( assert_path_not_in_errors, assert_...
#!/usr/bin/env python import os, sys, subprocess, inspect, shutil, glob, optparse ROOTDIR = os.path.abspath(os.path.dirname(inspect.getframeinfo(inspect.currentframe())[0])) WAFPATH = os.path.join(ROOTDIR, 'var', 'waf') LIBDIR = '' INCLUDEDIR = '' BINDIR = '' PREFIX = ROOTDIR ARCH = '' MSVC = '' def log(msg): sy...
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
"""test sparse matrix construction functions""" from __future__ import division, print_function, absolute_import import numpy as np from numpy import array, matrix from numpy.testing import TestCase, run_module_suite, assert_equal, \ assert_array_equal, assert_raises, assert_array_almost_equal_nulp from scip...
import calendar import datetime import os import sqlite3 from typing import Any, Dict, List, Optional, Tuple, Union DateTimeType = datetime.datetime AnyDateType = Union[DateTimeType, datetime.date] # This type is acts like a Dict[str, Any], but # mypy thinks it is a Tuple[Any, ...]. QueryItemType = Tuple[Any, ...] ...
from __future__ import unicode_literals from django.test import TestCase from django.core.exceptions import FieldError from .models import ( Domain, Kingdom, Phylum, Klass, Order, Family, Genus, Species, HybridSpecies, Pizza, TaggedItem, Bookmark, ) class SelectRelatedTests(TestCase): @classmethod ...
#!/usr/bin/env python # 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 # "Li...
"""Qt widgets to access a :py:class:`Register`. """ # standard imports from typing import Union import logging # Qt imports from PyQt5.QtCore import Qt, pyqtSignal from PyQt5.QtGui import QKeyEvent, QColor, QPalette from PyQt5.QtWidgets import (QWidget, QPushButton, QLabel, QRadioButton, ...
# * coding: utf8 * """Amazon AWS Connection.""" from __future__ import absolute_import, unicode_literals from vine import promise, transform from kombu.asynchronous.aws.ext import AWSRequest, get_response from kombu.asynchronous.http import Headers, Request, get_client from kombu.five import items, python_2_unicode_...