input
stringlengths
2.65k
237k
output
stringclasses
1 value
deprecated; use max_time instead", FutureWarning, ) # See tree.draw() for documentation on these arguments. fmt = check_format(format) if fmt == "svg": if width is None: width = 200 if height is None: height = 200 def remap_style(original_map, new_key, none_value): if original_map is None: return None ne...
get by using a better stabilization method. Also, this uses the ('b', 0, 1, 'c') format. """ batch_size, zr, zc, ch = z.shape r, c = pool_shape zpart = [] for i in xrange(r): zpart.append([]) for j in xrange(c): zpart[i].append(z[:, i:zr:r, j:zc:c, :]) pt = [] for i in xrange(r): pt.append([T.exp(z_ij...
import numpy as np import sklearn import logging from sklearn.cluster import KMeans from alsim.classification import vectorize_docs from alsim.data import get_labels import alsim.lcbal MIN_SEARCH_RETURN_THRESHOLD = 5 def get_batch_sample( config, batch_size, curr_batch, n_batches, selected_training_docs, trai...
<filename>schedule/table.py<gh_stars>1-10 """The schedule tabulator.""" import datetime import functools import operator import lass.common.time ############################################################################### # Internal constants # Common timedeltas HOUR = datetime.timedelta(hours=1) DAY = datetime....
<reponame>int-brain-lab/tmp_analysis_matlab #!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Created on Mon Jun 1 09:11:26 2020 Probe Geometry Data Collection Functions to gather data on probe geometry from IBL servers Following functions are defined: * download_ : downloads the current data from IBL servers * ...
deepcopy(item["input"]) if item.get("id") is not None: record["id"] = item["id"] for name, value in item["output"].items(): record[name] = self._prettify(value) record["annotator"] = _get_annotator(item, int_id=True) record["annotation_id"] = item["annotation_id"] record["created_at"] = item["created_at"] recor...
<reponame>russells-crockpot/roll-with-it # This file was generated from grammar.peg # See http://canopy.jcoglan.com/ for documentation. from collections import defaultdict import re class TreeNode(object): def __init__(self, text, offset, elements): self.text = text self.offset = offset self.elements = elements ...
q_odd assert p_odd / q_odd <= m_odd / (ZZ_1 << N) if rnd == 'RNDN': # round to the nearest # in order to find the nearest approximation we possibly need to # augment our precision on convergents. while True: assert not(p_odd << (N+1) <= (2*m_odd-1) * q_odd) or not(p_even << (N+1) >= (2*m_even+1) * q_even) if p_...
fazer download. Zero significa que a primeira página carrega mais rápido, números maiores que zero significam que as paginas seguintes são mais rápida.', 'The person at the location who is reporting this incident (optional)': 'A pessoa no local que está relatando este incidenten (opcional)', 'The person reporting the...
n, p, x): k = Denominator(m) return Dist( k / c, Subst( Int( x ** (k * (m + S(1)) + S(-1)) * (a1 + b1 * c ** (-n) * x ** (k * n)) ** p * (a2 + b2 * c ** (-n) * x ** (k * n)) ** p, x, ), x, (c * x) ** (S(1) / k), ), x, ) def replacement822(a, b, m, n, p, x): return Dist( a ** (p + (m + S(1)) / n), Su...
<gh_stars>1-10 import logging import sys from collections import Counter from itertools import chain import ogr import osmium import pyproj import rtree import shapely.geometry as sg from numpy import argmax from numpy import argsort from numpy import cumsum from numpy import zeros from shapely import wkt from shapely...
""" Various classes and functions to model automated planning. Based on code from: - https://github.com/aimacode/aima-python/blob/c587f2c429b9dec199f190c3453cd269b6b6bbd1/planning.py - https://github.com/aimacode/aima-python/blob/c587f2c429b9dec199f190c3453cd269b6b6bbd1/utils.py - https://github.com/aimacode/aima-pyth...
floor function behavior.""" dep_vector = np.array([10.41, 1.98, 1.0]) strict_compare_waves(dep_vector, peng.floor, "floor", "Volts", np.floor) @pytest.mark.wave_functions def test_funcs_exceptions(): """Test argument wave not valid exception.""" items = [ peng.acos, peng.acosh, peng.asin, peng.asinh, peng.at...
<filename>src/MainWindowFrontEnd.py<gh_stars>0 # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'C:/Users/royal state/PycharmProjects/Arduino-Oscilloscope/src/MainWindowFrontEnd.ui' # # Created by: PyQt5 UI code generator 5.13.0 # # WARNING! All changes made in this file will be lost! fro...
configuration files may contain the 'config' to include other # settings to the main configuration # class ReadConfigFile(argparse.Action): def __init__(self, option_strings, dest, nargs=None, **kwargs): super(ConfigParser.ReadConfigFile, self).__init__(option_strings, dest, **kwargs) def __call__(self, parser, ...
possibly interval coefficients, but no rounding. Parameters ---------- texpr : ElinaTexpr0Ptr Pointer to the ElinaTexpr0 that needs to be tested. Returns ------- result : c_bool Result of the test. """ result = None try: elina_texpr0_is_interval_polynomial_c = elina_auxiliary_api.elina_texpr0_is_interva...
# Copyright 2015 The Shaderc 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 law...
<filename>tickettool/embassytool.py import discord import datetime import typing from redbot.core import Config, commands, modlog from redbot.core.bot import Red from copy import copy import io import chat_exporter from dislash import ActionRow, Button, ButtonStyle from .settings import settings from .utils i...
# -*- coding: utf-8 -*- from SkinningTools.UI.qt_util import * from SkinningTools.UI.utils import * from SkinningTools.Maya import interface, api from SkinningTools.py23 import * #@todo: make sure all cmds modules are moved over to interface/api from maya import cmds from maya.api import OpenMaya from colle...
+ m.b24 - m.b25 <= 0) m.c377 = Constraint(expr= - m.b1 + m.b4 - m.b26 <= 0) m.c378 = Constraint(expr= - m.b1 + m.b6 - m.b27 <= 0) m.c379 = Constraint(expr= - m.b1 + m.b8 - m.b28 <= 0) m.c380 = Constraint(expr= - m.b1 + m.b10 - m.b29 <= 0) m.c381 = Constraint(expr= - m.b1 + m.b12 - m.b30 <= 0) m.c382 = Constraint(...
None, None, True ), ( "Mixing types: DictView of dict and OrDict (not a dict)", dict( obj1=DictView(dict({'Dog': 'Cat'})), obj2=OrDict({'Dog': 'Cat'}), exp_obj_equal=True, ), None, None, True ), ( "Mixing types: dict and DictView of OrDict (not a dict)", dict( obj1=dict({'Dog': 'Cat'}), obj2=DictView(OrD...
'description': 'Number of 48 cell types in chromHMM state E22_repressed', 'copy': 'chmm_e2' }, 'chmm_e23': { 'description': 'Number of 48 cell types in chromHMM state E23_weak', 'copy': 'chmm_e2' }, 'chmm_e24': { 'description': 'Number of 48 cell types in chromHMM state E24_distal', 'copy': 'chmm_e2' }, 'chmm_e...
/ ybar ylag = np.array([pysal.lag_spatial(w, yt) for yt in y]) rlag = ylag / ybar rc = r < 1. rlagc = rlag < 1. markov_y = pysal.Markov(rc) markov_ylag = pysal.Markov(rlagc) A = np.matrix([[1, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1], [0, 1, 0, 0]]) kp = A * np.kron(markov_y.p, markov_ylag.p) * A.T trans = sel...
# Copyright 2021 The FedLearner 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 ...
store_data_ref=True). :: default = None fold : int, optional The corresponding fold of the trained estimator to use. subjects : 'tr', 'val' or :ref:`Subjects`, optional The subjects data in which to return. As either special strings 'tr' for train subjects in the corresponding fold. Special str 'val' for ...
<reponame>jkrueger1/nicos<gh_stars>10-100 description = 'setup for the HTML status monitor' group = 'special' _expcolumn = Column( Block('Experiment', [ BlockRow( Field(name='Current status', key='exp/action', width=90, istext=True, maxlen=90), Field(name='Last file', key='exp/lastpoint'), Field(name='Current Sa...
import numpy as np from geosoup.common import Handler, Opt, Sublist from geosoup.exceptions import ImageProcessingError, ObjectNotFound import warnings import random import time import json from osgeo import gdal, gdal_array, ogr, osr, gdalconst np.set_printoptions(suppress=True) # Tell GDAL to throw Python exceptions...
np.array([[np.cos(omegar), -np.sin(omegar), 0], [np.sin(omegar), np.cos(omegar), 0], [0, 0, 1]]) if include_direct_beam: # add the direct beam part by computing the radiograph of the sample without the diffracting grains data_abs = np.where(grain_ids > 0, 1, 0) for (gid, (h, k, l)) in dif_grains: mask_dif = (grai...
import logging import multiprocessing from multiprocessing import Lock, Pool multiprocessing.set_start_method("spawn", True) # ! must be at top for VScode debugging import argparse import glob import json import math import multiprocessing as mp import os import pathlib import pickle import re import sys import warnin...
is Shutdown, ipv4 protocol is Down Vrf is default (vrfid 0x60000000) Internet protocol processing disabled GigabitEthernet0/0/0/0 is Up, ipv4 protocol is Up Vrf is default (vrfid 0x60000000) Internet address is 10.1.3.1/24 MTU is 1514 (1500 is available to IP) Helper address is not set Multicast reserved groups...
############################ # 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 ...
info thread", self._instance) break info = await self._api.system.info() self._info[DOCKER_INFO_VERSION] = info.get("ServerVersion") self._info[DOCKER_INFO_CONTAINER_RUNNING] = info.get( "ContainersRunning" ) self._info[DOCKER_INFO_CONTAINER_PAUSED] = info.get("ContainersPaused") self._info[DOCKER_INFO_CONTAIN...
<gh_stars>0 import psycopg2 import os import io import sys import json import datetime import decimal import time import base64 class pg_encoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, datetime.time) or isinstance(obj, datetime.datetime) or isinstance(obj, datetime.date) or isinstance(obj, deci...
""" .. PYTEST_DONT_REWRITE saltfactories.factories.base ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Factories base classes """ import atexit import contextlib import json import logging import os import pprint import subprocess import sys import tempfile import attr import psutil import pytest import salt.utils.files import salt...
unspecified, the width is [determined by the range step, paddings, and the cardinality of the field mapped to x-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.ht...
= 3 self.position[i][1] = 2 * (-self.length + 1) - self.position[i][1] else: # stop at intersection self.position[i][1] = -(self.length - 1) self.position[i][3] = self.position[i][3] + 2 / 0.1 # 20 is average stop time/interval # head SOUTH with intersection at x = self.length - 1 axis elif self.position[i][2] =...
<filename>twodspec/thar.py<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Tue May 30 13:27:58 2017 @author: cham @SONG: RMS = 0.00270124312246 delta_rv = 299792458/5500*0.00270124312246 = 147.23860278870518 m/s LAMOST: R~1800, 299792.458/6000*3A = 150km/s WCALIB: 10km/s delta_rv = 5km/s MMT: R~2500, 299792.458/R ...
<reponame>tokusanya/seacas # Copyright(C) 1999-2020 National Technology & Engineering Solutions # of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with # NTESS, the U.S. Government retains certain rights in this software. # # Redistribution and use in source and binary forms, with or without # modificat...
# -- coding: utf-8 -- from __future__ import absolute_import from logging import getLogger Logger = getLogger('chime.views') from os.path import join, isdir, exists from re import compile, MULTILINE, sub from requests import post from datetime import datetime from urlparse import urlparse from flask import current_ap...
<filename>Capture the Flag/FirstRound.py from tkinter import * from firebase import firebase from PIL import Image, ImageTk fbconn = firebase.FirebaseApplication('https://samplefbtest-266bd.firebaseio.com/',None) global crtans crtans = 0 class FirstRound: print("Done") def __init__(self, master): g...
if self.lineAdvance == 1: funcDraw.emit_op("addr", "u,x", "", 4, 4, 3) elif self.lineAdvance > 1: funcDraw.gen_loadeffaddr_offset(regX, 256*self.lineAdvance, regX, "") self.lineAdvance = 0 else: if self.lineAdvance > 0 and not bSingleWriteOp: funcDraw.gen_loadeffaddr_offset(regX, 256*self.lineAdvance, regX, "") ...
then it is the end of the # current report, and possibly the start of another. return separator_line, diffs return "", diffs def build_file_read_output(self, filename): # Make sure the filename is relative to top if possible as the build # may be using relative paths as the target. rel_filename = filename.remo...
<filename>building_boundary/core/segment.py # -*- coding: utf-8 -*- """ @author: <NAME> """ import math import numpy as np from .. import utils def PCA(points): """ Does a Principle Component Analysis (PCA) for a set of 3D points (the structure tensor) by computing the eigenvalues and eigenvect...
== "inactive" env = env.activateservices() env = client.wait_success(env, SERVICE_WAIT_TIMEOUT) for service in services: service = client.wait_success(service, SERVICE_WAIT_TIMEOUT) assert service.state == "active" lb_service = client.wait_success(lb_service, SERVICE_WAIT_TIMEOUT) assert lb_service.state == "...
(@zikalino)" ''' EXAMPLES = ''' - name: Create instance of Application Gateway azure_rm_appgateway: resource_group: myResourceGroup name: myappgateway sku: name: standard_small tier: standard capacity: 2 gateway_ip_configurations: - subnet: id: "{{ subnet_id }}" name: app_gateway_ip_config frontend_ip_con...
""" This generic method gives a trigger to the FLM for each VNF that needs a FSM csss life cycle event. Can be used for start, stop and config triggers. """ functions = self.services[serv_id]['function'] self.services[serv_id]['act_corr_id'] = [] # Counting the number of vnfs that you need a response from vnfs...
<gh_stars>1-10 """Module for permafrost metrics.""" import os import cartopy.crs as ccrs import matplotlib.pyplot as plt import numpy as np import iris import iris.coord_categorisation import iris.quickplot as qplt import iris.util as ut from esmvaltool.diag_scripts.autoassess.loaddata import load_run_ss from esmva...
#!/bin/python3 """ Script to perform hyperparameter optimization on a reservoir computer with the specified options. Run as: python3 opt_then_test.py SYSTEM MAP_INITIAL PREDICTION_TYPE METHOD [Results directory] [options...] ### Script arguments ### Choose SYSTEM from ["lorenz", "rossler", "thomas", "softrobot"] Choo...
<filename>flag/__init__.py # -*- coding: utf-8 -*- """ Converts flag emoji to ascii and back https://github.com/cvzi/flag Based on http://schinckel.net/2015/10/29/unicode-flags-in-python/ Unicode country code emoji flags for Python ~~~~~~~~~~~~~~~~ >>> import flag >>> flag.flag("IL") '🇮🇱' >>> flag.fla...
return _pysmile_impl.DSL_nodeValue_SetPropagatedEvidence(self, *args) def GetVirtualEvidence(self, *args): return _pysmile_impl.DSL_nodeValue_GetVirtualEvidence(self, *args) def SetVirtualEvidence(self, *args): return _pysmile_impl.DSL_nodeValue_SetVirtualEvidence(self, *args) def IsEvidence(self): return _pysmile_i...
<reponame>VilledeMontreal/mds-provider<filename>mds/files.py """ Work with MDS Provider data in JSON files. """ import csv import datetime import hashlib import json import os import pathlib import urllib import requests import pandas as pd from .encoding import JsonEncoder from .providers import Provider from .sche...
concepts that pertain to 'unspecified eye.' """ OID = '2.16.840.1.113883.3.526.3.1475' VALUE_SET_NAME = 'Prior Penetrating Keratoplasty' EXPANSION_VERSION = 'eCQM Update 2020-05-07' ICD10CM = { 'H18601', 'H18602', 'H18603', 'H18611', 'H18612', 'H18613', 'H18621', 'H18622', 'H18623' } SNOMEDCT = { '1...
!= subnetMasks[0]: raise Exception(ErrorCode.GAUSS_506["GAUSS_50606"]) # start setting virtual IP backIp = g_nodeInfo.backIps[0] # get network startup file # On SuSE12.X there is no /etc/init.d/network. so skip it distname, version = g_Platform.dist()[0:2] if not (distname == "SuSE" and version == "12"): networ...
the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.get_file_metadata_with_http_info(file_id, location_id, user_id, **kwargs) # noqa: E501 else: (data) = self.get_file_metadata_with_http_info(file_id, location_id, us...
outputs decoder_inputs: torch.Tensor Decoder inputs for teacher forcing. i.e. mel-specs memory_lengths: torch.Tensor Encoder output lengths for attention masking. Returns ------- mel_outputs: torch.Tensor mel outputs from the decoder gate_outputs: torch.Tensor gate outputs from the decoder alignments: torch...
None') evt = api.async_call(self, self.sessionUuid) self.out = evt return self.out class CreateRootVolumeTemplateFromRootVolumeAction(inventory.APICreateRootVolumeTemplateFromRootVolumeMsg): def __init__(self): super(CreateRootVolumeTemplateFromRootVolumeAction, self).__init__() self.sessionUuid = None self.out...
= new_rule_id print("new rule id", generalized_rule.name) print("before adding unique hash:", my_vars.unique_rules) # new_hash = compute_hashable_key(generalized_rule) is_added = True if rule_hash not in my_vars.unique_rules: my_vars.unique_rules[rule_hash] = {new_rule_id} else: generalized_rule.name = my_vars...
import sys import os #nopep8 sys.path.append(os.path.dirname(os.path.abspath(__file__))) sys.path.append(os.getcwd()) import wget import zipfile import collections import torch import torchaudio import deepdish as dd from pathlib import Path import matplotlib.pyplot as plt import numpy as np from src.datasets.data...
#!/usr/bin/env python3 """Converts otu tables from diatom analysis into a suitable format for uploading to BIOSYS. Additionally it will create a "otus_all.xlsx" for community analysis. If extraction sheets are provided in an appropriate format then it will also calculate the most similar sample and provide the Baron...
<filename>msgraph/cli/command_modules/sites/azext_sites/vendored_sdks/sites/aio/_sites.py # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for lice...
return gp = grid_mgr.get_grid_pattern(gp_id) if event.modifiers() == Qt.NoModifier: if event.key() == Qt.Key_Up: gp.select_prev_line() self._updater.signal_update('signal_grid_pattern_line_selection') elif event.key() == Qt.Key_Down: gp.select_next_line() self._updater.signal_update('signal_grid_pattern_line_...
Group') ) class DeleteGroup(MethodView): decorators = [ allows.requires( IsAdmin, on_fail=FlashAndRedirect( message=_("You are not allowed to modify groups."), level="danger", endpoint="management.overview" ) ) ] def post(self, group_id=None): if request.is_xhr: ids = request.get_json()["ids"] # TODO:...
# -*- coding: utf-8 -*- # # Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
<gh_stars>100-1000 # This file is generated automatically by `build_database.py`. Change it there. from sqf.expressions import BinaryExpression, UnaryExpression, NullExpression from sqf.types import Keyword, Type, Nothing, Anything, String, Code, Array, Number, Boolean, Namespace, \ Object, Config, Script, Control, Gr...
ZERO: self.totals.assets[asset] = Balance() for asset, balance in balances.liabilities.items(): self.totals.liabilities[asset] -= balance if self.totals.liabilities[asset].amount <= ZERO: self.totals.assets[asset] = Balance() self.balances.eth.pop(account, None) else: raise AssertionError('Programmer error: Sh...
<gh_stars>0 """The definition of the base geometrical entity with attributes common to all derived geometrical entities. Contains ======== GeometryEntity GeometricSet Notes ===== A GeometryEntity is any object that has special geometric properties. A GeometrySet is a superclass of any GeometryEntity that can also b...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @Author: <NAME>, <NAME>, and <NAME> # @Date: 2017-03-20 # @Filename: conftest.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) # # @Last modified by: <NAME> # @Last modified time: 2018-07-21 21:51:06 import copy import itertools import os i...
<gh_stars>1-10 from weld.weldobject import WeldObject from weld.encoders import NumpyArrayEncoder, NumpyArrayDecoder from weldnumpy import * import weldnumpy as wn import numpy as np class weldarray(np.ndarray): ''' A new weldarray can be created in three ways: - Explicit constructor. This is dealt with in __new__ ...
πλερωμή πλερωτής πλερωτικά πλευρίς πλευρίτης πλευρίτιδα πλευρίτις πλευρεκτομία πλευροδεσία πλευροδυνία πλευροκόπηση πλευροκόπησις πλευρονήκτης πλευροτομή πλευροτομία πλευρό πλευρόν πλευστότης πλευστότητα πλεχτήριο πλεχτική πλεχτό πλεόνασμα πλεύριση πλεύρισις πλεύση πλεύσις πληβεία πληβείος πληγή πληθάριθμος πληθοπα...
# -*- coding: utf-8 -*- """ Created on Thu Mar 17 11:02:24 2022 @author: rossgra """ import numpy as np from numpy.core.fromnumeric import std import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import scipy from scipy.stats import mannwhitneyu import statistics as stat metric = input('SAE or N...
alert = f'''The "on_update" and/or "on_delete" parameters are invalid!\n''' alert += f'Valid characters are: {valid_rel}' # Developer mode if self.debug: # Raise error raise TypeError(alert) # Production mode else: print(alert) return False # Everything is OK # Foreign key symbol if not fk_symbol: fk_s...
for the given data by looking up references in the already-parsed long values table""" try: # For some reason the ID is stored big endian data_be = data[::-1] long_data = cursor['LongValues'].get(data_be) # The initial long entry contains an unknown value and total long data size _, long_data_size = unpack("<II",...
Node const& root = traversal_.back(); root: PyTreeDef.Node = self.traversal_[-1] # children.resize(root.arity); resize(children, root.arity) # int pos = traversal_.size() - 1; pos = len(self.traversal_) - 1 # for (int i = root.arity - 1; i >= 0; --i) { for i in range(root.arity - 1, -1, -1): # children[i] = abs...
VARCHAR2(7)) FLASH_CACHE,\ CAST(NULL AS VARCHAR2(7)) CELL_FLASH_CACHE,\ CAST(NULL AS VARCHAR2(3)) GLOBAL_STATS,\ CAST(NULL AS VARCHAR2(3)) USER_STATS,\ CAST(NULL AS VARCHAR2(3)) IS_NESTED,\ CAST(NULL AS VARCHAR2(30)) PARENT_TABLE_PARTITION,\ CAST(NULL AS VARCHAR2(3)) "INTERVAL",\ CAST(NULL AS VARCHAR2(4)) SEGMEN...
from PySide2.QtWidgets import * from PySide2.QtGui import * from PySide2.QtCore import * import numpy as np from .funcs import sort_clockwise from .paint import * class GeoBase(object): def __init__(self): self._isShow = False @property def isShow(self): return self._isShow def show(self): self._isShow = Tr...
Field Name Type Field Description 0 Symbol String Ticker symbol in upper case. 1 Level2 Time int Level2 time in milliseconds since epoch 2 Bid Book list List of Bid prices and theirs volumes 3 Ask Book list List of Ask prices and theirs volumes TYPE: String EXAMPLES: SessionObject.data_request_...
# # Autogenerated by Thrift Compiler (0.9.3) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:new_style # from thrift.Thrift import TType, TMessageType, TException, TApplicationException import impala._thrift_gen.Status.ttypes import impala._thrift_gen.Types.ttypes from thr...
# -*- coding: utf-8 -*- """ Created on Mon Feb 4 12:26:21 2019 @author: <NAME> This file contains scripts used to download GOES-16 Geostationary Lightning Mapper (GLM) & Advanced Baseline Imager (ABI) data files from NOAA's Amazon Web Service (AWS) bucket. Code that deals with AWS buckt adapted from <NAME>...
matrix=1, worldSpace=1) or [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0] @classmethod def isDefaultMatrix(cls, nodepathString): return cls.getNodeWorldMatrix(nodepathString) == cls.DEF_mya_default_matrix @staticmethod def setNodeWorldMatrix(nodepathString, worldMatrix): cmds.xfo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # """Evohome RF - payload processors.""" import logging import re from datetime import datetime as dt from datetime import timedelta as td from typing import Optional, Union from .command import Command from .const import ( ATTR_DHW_VALVE, ATTR_DHW_VALVE_HTG, ATTR_HTG...
range(int(main.numCtrls)): main.log.info( "Checking intents on CLI %s" % (e+1) ) intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\ intentState if not intentState: main.log.warn( "Not all intents installed" ) if intentState: break else: #Dumping intent summary main.log.info( "**** ...
colisão com um automóvel [carro], "pick up" ou caminhonete - motociclista não especificado traumatizado em acidente não-de-trânsito'), ('V23.3', 'Motociclista traumatizado em colisão com um automóvel [carro], "pick up" ou caminhonete - pessoa traumatizado ao subir ou descer do veículo'), ('V23.4', 'Motociclista traum...
import json import logging import re import urlparse import ckanext.hdx_package.helpers.custom_validator as vd from ckanext.hdx_package.exceptions import NoOrganization from ckanext.hdx_package.helpers.caching import cached_group_iso_to_title from ckanext.hdx_package.helpers.constants import UPDATE_FREQ_LIVE from ckan...
def crasher(): raise KeyError async def main(): _core.spawn_system_task(crasher) await sleep_forever() with pytest.raises(_core.TrioInternalError): _core.run(main) def test_system_task_crash_MultiError(): async def crasher1(): raise KeyError async def crasher2(): raise ValueError async def system_task(...
torch.abs(emb1-emb2).pow(2) # Softmax calculation softmax = torch.exp(distances)/torch.exp(torch.sum(distances,dim=-1)).unsqueeze(-1) # Soft nearest neighbour calculator (all frames) soft_nn = torch.sum(softmax*emb2,dim=-1) # Permute [frames x batch x channels] --> [frames x batch x channels x 1] soft_nn = sof...
game. Examples of the key and value pairs given to this method can be found in your game's settings ini files. These are usually in <userpath>/settings/game-settings.ini or <userpath>/settings/cloud/game-settings-cloud.ini. Args: key (str): The key of the setting that is to be changed value (str): The desired va...
= root_token.astOperand1 lhs_name = root_token.astOperand1.str if lhs_name == '.' or lhs_name == '[' or lhs_name == '(': (lhs_var_token, lhs_name) = \ self.my_symbol_helper.find_compound_variable_and_name_for_dot_operand(lhs_var_token) if (not lhs_var_token) or (not lhs_var_token.variable): return if not (self...
description_btn = Button(description='initial concentration of inactive NLRP3', disabled=True, layout=desc_button_layout) description_btn.style.button_color = 'lightgreen' row = [name_btn, self.float776, units_btn, description_btn] box832 = Box(children=row, layout=box_layout) name_btn = Button(description='activ...
import argparse import re import csv from math import floor, fabs from lotto import times2int, german_price2float, month_day parser = argparse.ArgumentParser(description='Read Lotto Numbers from year') # parser.add_argument('year', help='The year of the data') args = parser.parse_args() cardinal_pattern = re.compi...
"name": "traffic-light--exclamation" }, { "url": "/images/status/traffic-light--minus.png", "name": "traffic-light--minus" }, { "url": "/images/status/traffic-light--pencil.png", "name": "traffic-light--pencil" }, { "url": "/images/status/traffic-light--plus.png", "name": "traffic-light--plus" }, ...
is expected to be small, as all the data is loaded into the driver’s memory. Examples: >>> ds.head(5) """ return self._data.head(n=n) def intersect(self, other): """ Return a new DataFrame containing rows only in both this frame and another frame. This is equivalent to INTERSECT in SQL. Args: other (int): D...
with "DeadlineExceededError". # Returning 429 for the bot to retry. # Approaches to avoid ignoring the errors would be to # - Move the assert_bot task to background rather than waiting at polling. # - Execute assert_bot_async here (before bot_reap_task), and get_result() # after reaping task. # See discussion: #...
self.expression = build_expression_tree(probability ** 2) def evaluate(self, x, y): return sawtooth_wave(self.expression.evaluate(x, y)) class MultiplyOp: def __init__(self, probability): self.left = build_expression_tree(probability ** 2) self.right = build_expression_tree(probability ** 2) def evaluate(self,...
coverage of test patches for each for zone in test_zones: print('Processing {} zone...'.format(zone)) # Save a filtered version of the patch SHP, containing only those in the appropriate zone patches_zone_shp = '{}/patches/SHP/patches_target_split_{}.shp'.format(folder_logs, zone) filter_query = "zone = '{}' an...
<filename>reckoner/cli.py #!/usr/bin/env python # -- coding: utf-8 -- # Copyright 2017 FairwindsOps Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
remote main contract at contract_address, matches the solidity contract obtained by running zkay on the local zkay file using the configuration stored in the local manifest * the pki contract referenced in the remote main contract matches the correct zkay pki contract * the verification contracts referenced in the r...
import unittest from problems.sorting import merge_sort1 class Test_MergeSort1(unittest.TestCase): def setUp(self): pass def test_case1(self): values = [5, 4, 1, 8, 7, 2, 6, 3, 9] actual = merge_sort1(values) expected = sorted(values) assert actual == expected def test_case2(self): values = [23, 44...
time() sw = "" # used in format to swap bytes if necessary self.filename = filename # open file to read in binary mode f = open(filename, 'rb') # determine if the file is of type BRIX or DSN6 by looking # at the beginning of the header O_format = f.read(3) if O_format == ':-)': O_format = 'BRIX' else: O_fo...
<reponame>fmi-basel/zinneretal-methods import os import luigi import numpy as np import matplotlib.pyplot as plt from scipy.ndimage.morphology import distance_transform_edt from skimage.segmentation import watershed from skimage.measure import find_contours from scipy.spatial.distance import cdist from scipy.interpola...
self -ScriptableSpectrum(ba.fitBackground(det, self.wrapped, c)) def setFWHMatMnKa(self, fwhm): """s.setFWHMatMnKa(fwhm) Set the FWHM at Mn Ka to the specified value in eV.""" p = self.getProperties() p.setNumericProperty(epq.SpectrumProperties.Resolution, fwhm) p.getNumericWithDefault(epq.SpectrumProperties.Res...