input
stringlengths
2.65k
237k
output
stringclasses
1 value
2**(char_digits-1) Etiny = -2**(char_digits-1) + 1 context.__name__ = "Float_%d_%d_%s" % (char_digits, sig_digits, _round_code[rounding]) self.contexts[(char_digits, sig_digits, rounding)] = context return context define_context = context_registry() single = define_context(8, 23) # IEEE 754 32 bit float double...
import numpy as np from PIL import Image import cv2 import io import time import pandas as pd from random import randint import os import selenium from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys import tensorflow as tf from tensorflo...
I1sub,I2sub = make_templates_same_size(I1,I2) S1, S2 = np.fft.fft2(I1sub), np.fft.fft2(I2sub) W2 = np.divide(1, np.sqrt(abs(I1sub))*np.sqrt(abs(I2sub)) ) Q = (S1)*np.conj((W2*S2)) return Q def amplitude_comp_corr(I1, I2, F_0=0.04): """ match two imagery through amplitude compensated phase correlation P...
sub-movie that represents the converted # mkv file, to get information on it's subtitle tracks. convertedFName = self.fileName.replace('.mkv', '--converted.mkv') converted = Movie(self.root, self.subdir, convertedFName) if subDefault: for track in converted.subtitleTracks: vidCommand.extend(['--default-track',...
self.evaluate(layer.trainable_variables())) def test_parallel_sum_with_shared_layers(self): inner_layer = ScalarMultiplicationLayer(2.0) layer = layers.ParallelSum([inner_layer]*5) inputs = tf.constant([1.0, -2.0, 3.0]) output_shape = layer.build(inputs.shape) self.assertLen(layer.trainable_tensors(), 1) out...
# -*- coding: utf-8 -*- import os import mimetypes from io import BytesIO from typing import Iterable from concurrent.futures import ThreadPoolExecutor, as_completed from abeja.common.config import UPLOAD_WORKER_COUNT from abeja.common.logging import logger from abeja.common.file_helpers import generate_path_iter from...
= stats self.init_incomplete = True # Update plot def __call__(self, key, E, P): k, kObs, faus = key stats = self.stats chrono = stats.HMM.t ax0, ax1 = self.axs def update_arrays(lines): for name, ln in lines.items(): stat = deep_getattr(stats, name) t = chrono.tt[k] # == chrono.ttObs[kObs] if isinstance...
# 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 applicabl...
from __future__ import absolute_import from __future__ import print_function import numpy as np from ._lapjv import reduction_transfer from ._lapjv import augmenting_row_reduction from ._lapjv import augment from six.moves import range def lapjv(i, j, costs, wants_dual_variables=False, augmenting_row_reductions=2): ...
the following enumeration values: ['all', 'first', 'last', 'none'] Returns ------- Any """ return self["showexponent"] @showexponent.setter def showexponent(self, val): self["showexponent"] = val # showgrid # -------- @property def showgrid(self): """ Determines whether or not grid lines are drawn. If...
<gh_stars>100-1000 #===----------------------------------------------------------------------===## # # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # #===---------------...
14.94 ? 60 TYR B CZ 1 ATOM 2198 O OH . TYR B 1 59 ? 47.693 -35.035 -11.459 1.00 15.11 ? 60 TYR B OH 1 ATOM 2199 N N . ARG B 1 60 ? 47.291 -39.611 -6.974 1.00 14.87 ? 61 ARG B N 1 ATOM 2200 C CA . ARG B 1 60 ? 48.595 -40.249 -6.761 1.00 12.88 ? 61 ARG B CA 1 ATOM 2201 C C . ARG B 1 60 ? 48.635 -40.774 -5.331 1.00 12...
#!/usr/bin/python # # SPDX-License-Identifier: Apache-2.0 # from __future__ import absolute_import, division, print_function __metaclass__ = type from ansible.module_utils._text import to_native from ..module_utils.module import BlockchainModule from ..module_utils.utils import (get_console, get_identity_by_module,...
+ '/block/vpools' elif resource_type == 'file_vpool': uri = URI_SERVICES_BASE + '/file/vpools' elif resource_type == "varray": uri = URI_VARRAYS elif resource_type == "network_system": uri = URI_NETWORKSYSTEMS elif resource_type == "storage_system": uri = URI_STORAGEDEVICES elif resource_type == "protection_sy...
in result: metric_id = int(row['id']) metric_name = str(row['metric']) metrics.append([metric_id, metric_name]) connection.close() except: trace = traceback.format_exc() logger.error('%s' % trace) fail_msg = 'error :: could not determine metrics from metrics table' logger.error('%s' % fail_msg) # @added 20170...
<filename>com/vmware/appliance/system_client.py # -*- coding: utf-8 -*- #--------------------------------------------------------------------------- # Copyright 2020 VMware, Inc. All rights reserved. # AUTO GENERATED FILE -- DO NOT MODIFY! # # vAPI stub file for package com.vmware.appliance.system. #------------------...
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import functools import os import pytest import llnl.util.filesystem as fs import spack.config import spack.database imp...
charts: subprocess.check_call(['helm-upload', helm_repo, chart], # pylint: disable=not-callable env=env, stdout=fnull, stderr=fnull) LOG.info("Helm chart %s uploaded" % os.path.basename(chart)) # Make sure any helm repo changes are reflected for the users helm_utils.refresh_helm_repo_information() except Except...
not in attributes: columns.append(a_name) attributes[a_name] = {} attributes[a_name][r_id] = a_value values_data = [] for m_id in ordered_ids: values_row = [] for col in columns: if col == 'checkbox': values_row.append({'checkbox': m_id}) continue val = '-' href = None color = None if col in attributes: ...
0x000000FF) + ":" \ + str(( ds_trace[15] >> 8) & 0x00FF| (ds_trace[15] << 8) & 0xFF00) print(vidToIP) print(vidToIp_map[str(vidToIP)]) fix_df_dic = {} pd.set_option("display.precision", 8) fix_df = pd.DataFrame([], columns=trace_field) seq_map_cnt = 0 for vid_seq in vid_seq_map: if len(vid_seq_map[vid_seq])...
<reponame>JoonyoungYi/project-seesae #-*- coding: utf-8 -*- from flask import Flask, g, render_template, redirect, request, session, url_for from db import db_connect, db_insert_favorite, db_insert_hate, db_insert_comment from config import * from models import * import datetime, math, itertools import sys, random # -...
from tqdm import tqdm import network import utils import os import random import argparse import numpy as np from torch.utils import data from datasets import VOCSegmentation, Cityscapes, Oilwell from utils import ext_transforms as et from metrics import StreamSegMetrics import torch import torch.nn as nn from utils....
import os from ctypes import c_int, c_uint, c_long, c_char_p, c_void_p from ctypes import POINTER as _P from .dll import DLL, SDLFunc, AttributeDict from .version import SDL_version, SDL_VERSIONNUM from .rwops import SDL_RWops from .stdinc import Uint16, Uint32, SDL_bool from .pixels import SDL_Color from .surface impo...
(3, 0, None, None) , 0 , )), (( 'StartTime' , 'StartTime' , ), 4105, (4105, (), [ (16391, 10, None, None) , ], 1 , 2 , 4 , 0 , 152 , (3, 0, None, None) , 0 , )), (( 'StartTime' , 'StartTime' , ), 4105, (4105, (), [ (7, 1, None, None) , ], 1 , 4 , 4 , 0 , 156 , (3, 0, None, None) , 0 , )), (( 'GetOccurrence' , 'Start...
#!/usr/bin/python import time, os, errno, argparse, sys, random, string from selenium import webdriver from selenium.common.exceptions import NoSuchElementException, ElementNotVisibleException from selenium.webdriver.common.by import By from datetime import datetime from pyvirtualdisplay import Display from selenium.w...
<reponame>Petr-By/qtpyvis<gh_stars>1-10 """:py:class:`Storable` objects allow to store their state to restore it later. """ # standard imports from typing import BinaryIO, Union from pathlib import Path import os import json import logging # toolbox imports from .prepare import Preparable # logging LOG = logging.ge...
import sys sys.setrecursionlimit(20000) # to allow the e2wrn28_10R model to be exported as a torch.nn.Module import os.path from typing import Tuple import torch.nn.functional as F from e2cnn import nn from e2cnn import gspaces from e2cnn.nn import init import torch import math import numpy as np STORE_PATH = "./mo...
#! /usr/bin/env python """ This python script exercises various aspects of the IBM Cloud Hyper Protect Crypto Services (HPCS) Key Protect service through its REST API. Here is the format of the input file (-f option), with example input shown. This example passes in a null service_host, which tells the script to dy...
snatEntry: Whether to configure SNAT for the network. When a VPC can access the public network environment, set it to false. When an existing VPC cannot access the public network environment: When set to True, SNAT is configured and the public network environment can be accessed at this time. If set to false, it m...
<gh_stars>0 from __future__ import unicode_literals import time import frappe import frappe.client import frappe.handler import jwt from frappe import _ import base64 from passlib.context import CryptContext from mimetypes import guess_type from frappe.utils import add_days, cint @frappe.whitelist(allow_guest=True)...
<filename>ramjet/data_interface/tess_data_interface.py """ Code for a class for common interfacing with TESS data, such as downloading, sorting, and manipulating. """ try: from enum import StrEnum except ImportError: from backports.strenum import StrEnum import math import re import shutil import sys import tempfile...
pc: program counter of the first instruction(optional) :type pc: int :param fork: fork name (optional) :type fork: str :return: An generator of Instruction objects :rtype: generator[Instructions] Example use:: >>> assemble_one('''PUSH1 0x60\n \ PUSH1 0x40\n \ MSTORE\n \ PUSH1 0x2\n \ PUSH2 0x108\n \ PUSH1...
import collections import re import six from six import string_types import warnings from contextlib import contextmanager from copy import deepcopy, copy from pprint import PrettyPrinter from .optional_imports import get_module from . import offline as pyo from _plotly_utils.basevalidators import ( CompoundValidato...
<filename>cogs/webserver.py import logging import asyncio import discord import hikari import aiohttp_cors import ast from typing import List from discord.ext import commands from utils.bot import ModMail from aiohttp import web, ClientSession try: import uvloop uvloop.install() except Exception: pass class Guil...
nsizespec, nstate, nX, nXp, nGX, nGXp = n.nodeargd.argnlist sym = m.get('sym', self.DCSym) process_arg_subscripts = m.get('process_arg_subscripts', False) text = '{' + sym + '}' tX = self.preprocess_contents_latex(nX) tXp = self.preprocess_contents_latex(nXp) if tX and tXp: text += '_{' + tX + r'\to ' + tXp + ...
xS0_E : float (arcsec) Position of the source in RA relative to the geometric center of the lens system at time t0. xS0_N : float (arcsec) Position of the source in Dec relative to the geometric center of the lens system at time t0. beta : float (mas) The closest projected approach between the source and the ge...
protocol. Initialised by a call to the :class:`HttpClient.request` method. """ _has_proxy = False _data_sent = None _cookies = None _raw = None content = None headers = None parser = None version = None status_code = None request_again = None ONE_TIME_EVENTS = ('pre_request', 'on_headers', 'post_request')...
{'error_message': "Subject " + subject_name + " Does Not Exist"} return JsonResponse(response_data, status=status.HTTP_400_BAD_REQUEST) except Div.DoesNotExist: response_data = {'error_message': "Division " + div + " Does Not Exist"} return JsonResponse(response_data, status=status.HTTP_400_BAD_REQUEST) teacher ...
1.63300865e-11, # -2.81558165e-11, -1.84642248e-16, 3.30755613e-16, 9.65096318e-06, # -7.81673553e-07, -3.06700108e-09, 3.63509506e-10], [-2.19201461e-07, -2.42721105e-12, -4.62657860e-15, 2.23721479e-11, # -2.75661325e-11, -1.83185234e-16, 1.73944578e-16, 9.77685398e-06, # -1.04302581e-06, -3.19356387e-09, 4.26767890e...
# --- Do not remove these libs --- from freqtrade.strategy.interface import IStrategy from pandas import DataFrame # -------------------------------- import talib.abstract as ta import logging import pandas_ta as pta from pandas import DataFrame, Series from datetime import datetime, timezone from freqtrade.persistenc...
<filename>greykite/tests/algo/changepoint/adalasso/test_changepoints_utils.py from datetime import datetime as dt import numpy as np import pandas as pd import pytest from greykite.algo.changepoint.adalasso.changepoints_utils import adaptive_lasso_cv from greykite.algo.changepoint.adalasso.changepoints_utils import b...
(InstructionTextTokenType.RegisterToken, 'R15'), (InstructionTextTokenType.TextToken, '+'), (InstructionTextTokenType.OperandSeparatorToken, ', '), (InstructionTextTokenType.RegisterToken, 'R{n}') ], }, { 'opmask': (0x0039, 0xf0ff), 'm': (0x0, 0x0), 'n': (0xf00, 0x8), 'imm': (0x0, 0x0), 'disp': 0x0, 'cmd': ...
data. Exactly one of *source_file* and *source_data* must be given. If *source_file* is given: - If *topdir* is too, ``projects`` is rooted there. - Otherwise, *topdir* is found starting at *source_file*. If *source_data* is given: - If *topdir* is too, ``projects`` is rooted there. - Otherwise, there is ...
## # Copyright (c) 2006-2017 Apple 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 applicable l...
<gh_stars>0 # Princeton University licenses this file to You 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...
"""linear and non-linear dynamic models for different animals""" import numpy import warnings import re DEFAULT_MODEL = "mamarama, units: mm" def _get_decreasing_accel_model(dt=None): """get linear dynamical system matrices A and C dt is the time-step in seconds """ # distance units are in m # time units are ...
cons29, cons5, cons1918, cons1252, cons248, ) rule6518 = ReplacementRule(pattern6518, replacement6518) pattern6519 = Pattern( Integral( (c_ + x_ * WC("d", S(1))) ** WC("p", S(1)) * (x_ * WC("f", S(1)) + WC("e", S(0))) ** WC("m", S(1)) * exp(WC("n", S(1)) * atanh(x_ * WC("a", S(1)))), x_, ), cons2, cons8...
linewidths=b_widths, antialiaseds=(1,), colors=b_colors, transOffset=ax.transData) if b_nums is not None: b_collection.set_array(np.asarray(b_nums)) b_collection.set_cmap(b_cmap) b_collection.autoscale() ax.add_collection(b_collection) b_collection.set_zorder(3) branch_collections.append(b_collection) if b...
<reponame>renovate-bot/python-hpedockerplugin import abc import json import re from collections import OrderedDict from oslo_log import log as logging import hpedockerplugin.exception as exception from hpedockerplugin.hpe import share LOG = logging.getLogger(__name__) class RequestContextBuilderFactory(object): d...
in_args_section = False last_section = None for lineno, line in enumerate(lines[1:], start=2): line_indent_len = len(line) - len(line.lstrip(' ')) margs = { 'offset': lineno, 'line': line, } l = line.strip() # Catch semi-common javadoc style. if l.startswith('@param') or l.startswith('@return'): self.add_me...
import spidev from concurrent import futures import time import math import numpy as np import grpc import quanser_service_pb2_grpc from quanser_service_pb2 import QuanserResponse import random self_servo = None PI = math.pi MOTOR_PROTECTION_VOLTAGE = 500 UNIT_TIME = 1 / 1000 class QubeServo2: ...
for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( "list_o_auth_client_credentials got unknown kwargs: {!r}".format(extra_kwargs)) path_params = { "userId": user_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) ...
<filename>source/menubar.py # encoding: utf-8 # author: <NAME> # email: <EMAIL> import audio import images import io import macroboxstyle import os import threading import time import webbrowser import wx import wx.adv from dialogbox import AboutBox from dialogbox import CheckItemsConsistencyConfirmBox from dialog...
''' from datetime import datetime as dt from datetime import date, timedelta from datetime import datetime import plotly.graph_objs as go from plotly import tools import numpy as np import pandas as pd pd.options.mode.chained_assignment = None # Read in Travel Report Data df = pd.read_csv('data/performanc...
sure we got back to ssh shell def run_set_tunnelling_dev_lan_ip_address(self, ip): """ Run the command set_tunnelling_dev_lan_ip_address on the remote tundev shell \param ip an ipaddr.IPv4Network object or a string containing the IP address and prefix using the CIDR notation, to communicate to the RDV server """ ...
top: path.append(key) if type(top[key]) is OrderedDict: is_leaf = False self.build_cfg_list(key, top[key], path, info) path.pop() if is_leaf: length = self.add_cfg_item(cfg_name, top, info['offset'], path) info['offset'] += length elif cfg_name == '' or (cfg_name and cfg_name[0] != '$'): # check f...
<gh_stars>0 """ Pipes provide a nice way to lazily queue steps for later execution and allow for a nice way to chain together sequential functions. They also provide many other benefits listed below along with their usage information Pipes can accept raw values at their tops but nowhere else in the pipe as that would ...
e f i n i t i o n , r e p r e s e n t e d a s a U R I ( g l o b a l l y u n i q u e ) . Type `str`. """ self.useContext = None """ T h e c o n t e x t t h a t t h e c o n t e n t i s i n t e n d e d t o s u p p o r t . List of...
<reponame>timgates42/sc2reader<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals, division from io import BytesIO import struct import functools try: from collections import OrderedDict except ImportError as e: from ordereddict import OrderedDict class By...
] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.FaceVarying, uvs, uvIndices ) target = GafferScene.ObjectToScene() target[ "name" ].setValue( "target" ) target[ "object" ].setValue( mesh ) cube = GafferScene.Cube() cube[ "name" ].setValue( "cube" ) cubeFilter = GafferScene....
<gh_stars>10-100 import vapoursynth as vs import havsfunc as haf import mvsfunc as mvf import muvsfunc as muvf import nnedi3_resample import nnedi3_resampleCL import resamplehq import xvs import sys, os, re, math, glob, functools, subprocess, shutil, configparser """********************************************* Script...
Constraint(expr=m.x284*m.x2514 + m.x909*m.x2520 + m.x1534*m.x2526 + m.x2159*m.x2532 <= 8) m.c1553 = Constraint(expr=m.x285*m.x2514 + m.x910*m.x2520 + m.x1535*m.x2526 + m.x2160*m.x2532 <= 8) m.c1554 = Constraint(expr=m.x286*m.x2514 + m.x911*m.x2520 + m.x1536*m.x2526 + m.x2161*m.x2532 <= 8) m.c1555 = Constraint(expr=m...
# coding=latin-1 # # natlinkconfigfunctions.py # This module performs the configuration functions. # called from natlinkconfig (a wxPython GUI), # or directly, see below # # <NAME>, January 2008 # """ With the functions in this module NatLink can be configured. This can be done in three ways: -Through the command line...
# -*- coding: utf-8 -*- # # Copyright 2020 Data61, CSIRO # # 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...
"""This file contains the network model and data that holds the results. """ __author__ = '<NAME>' from dataclasses import dataclass, field from typing import List, Callable, Tuple, Any, Union import sys import gc import logging import itertools as it from itertools import chain from io import TextIOBase, StringIO im...
size, field_parts, tmp_list, field_sgmnt_lst) fout_header.write(";\n") if break_point != (end_idx - 1): fout_header.write("#elif (BYTE_ORDER == LITTLE_ENDIAN)\n") fout_header.write(spaces(8) + "%s " + spaces(4) + " " % (predict_type(s[1]))) for k in range(len(field_parts)): segment = field_parts[k] for j in rev...
# Copyright (c) 1996-2015 PSERC. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Power flow data for IEEE 300 bus test case. """ from numpy import array def case300(): """Power flow data for IEEE 300 bus test case. Please see L{caseforma...
self["Back Side Drape Beam-Diffuse Solar Transmittance"] @back_side_drape_beamdiffuse_solar_transmittance.setter def back_side_drape_beamdiffuse_solar_transmittance(self, value=None): """ Corresponds to IDD field `Back Side Drape Beam-Diffuse Solar Transmittance` """ self["Back Side Drape Beam-Diffuse Solar Tran...
""" This module produces the strain versus strain rate populations, with bivariate histograms. Example: > cd ~/sibl/cli/process/exodus > conda activate siblenv > python visualization.py """ import os import numpy as np import matplotlib.pyplot as plt from matplotlib import rc # import pandas as pd import seabor...
= None # type: FolderBase # DOT_META/.cache subfolder cli = None # type: TrackedSettings # Tracks any custom CLI cfg flags given, such as --index, --python or --delivery configs = None # type: list program_path = get_program_path() _pickley_dev_path = None def __init__(self): self.configs = [] self.config_path...
<filename>src/sage/misc/explain_pickle.py """ A tool for inspecting Python pickles AUTHORS: - <NAME> (2009-03) The explain_pickle function takes a pickle and produces Sage code that will evaluate to the contents of the pickle. Ideally, the combination of explain_pickle to produce Sage code and sage_eval to evaluate ...
10, (71, '1'): 10, (71, '2'): 10, (71, '3'): 10, (71, '4'): 10, (71, '5'): 10, (71, '6'): 10, (71, '7'): 10, (71, '8'): 10, (71, '9'): 10, (71, 'A'): 10, (71, 'B'): 10, (71, 'C'): 10, (71, 'D'): 10, (71, 'E'): 10, (71, 'F'): 10, (71, 'G'): 10, (71, 'H'): 10, (71, 'I'): 10, (71, 'J'): 10, (71, 'K'): ...
import tensorflow as tf from tensorflow.python.keras import activations from tensorflow.python.keras import backend as K from tensorflow.python.keras import initializers, regularizers, constraints from tensorflow.python.keras.backend import _preprocess_padding from tensorflow.python.keras.layers import Conv2D, Add from...
# -*- coding: utf-8 -*- # # testfish.py # # Copyright (c) <NAME> 2009-2012 and other authors specified # in the AUTHOR # Licence terms in LICENCE. # import sys import types import unittest import urllib import fishbase import fishlib import cli class TestFluidinfo(unittest.TestCase): def setUp(self): self.db = fish...
t1.x > ?) AS alias1 JOIN t2 ON alias1.x = t2.a) AS alias2""" assert (normalize(str(result)) == normalize(expected1) or normalize(str(result)) == normalize(expected2)) def test_transform_where(): t2 = t[t.id == 1] expr = transform(t2, abs_amt=abs(t2.amount), sine=sin(t2.id)) result = compute(expr, s, return_typ...
stability_value location = (rows[i], columns[i]) return location def parity_player(self, board): """ Parity player uses the parity characteristic of the stones :param board: the current state of the board :return: A tuple representing the location of parity player's move """ valid_moves = self.game.find_vali...
def closeEvent(*args, **kwargs): pass def forceShow(*args, **kwargs): pass def labelText(*args, **kwargs): pass def maximum(*args, **kwargs): pass def minimum(*args, **kwargs): pass def minimumDuration(*args, **kwargs): pass def open(*args, **kwargs): pass def reset(*args, **kw...
""" _validation = { 'limit': {'readonly': True}, 'unit': {'readonly': True}, 'status': {'readonly': True}, } _attribute_map = { 'limit': {'key': 'limit', 'type': 'float'}, 'unit': {'key': 'unit', 'type': 'str'}, 'status': {'key': 'status', 'type': 'str'}, 'reason': {'key': 'reason', 'type': 'str'}, } def...
outfile.write('>') outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='productDescriptionType', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, ...
custom error message for smaller, printable tensors if t.numel() < 10: msg = ("Failed to produce expected results! Input tensor was" " {0}, torch result is {1}, and reference result is" " {2}.").format(t, actual, expected) else: msg = None exact_dtype = True if isinstance(actual, torch.Tensor): _helper_refere...
'DOWN-AND-IN-BARRIER': V_Nt = np.maximum(s - self.strike, 0) * np.where(s >= self.barrier, 1, 0) else: V_Nt = np.maximum(s - self.strike, 0) * np.where(s <= self.barrier, 1, 0) payoff = np.maximum(s - self.strike, 0) elif self.position == 'PUT': if self.option_type == 'DOWN-AND-OUT-BARRIER' or self.option_t...
<reponame>barry-scott/PythonWinAppPackager<filename>win_app_packager/win_app_package_builder.py<gh_stars>1-10 #/usr/bin/python3 # # win_app_package_builder.py # import sys import os import pathlib import uuid import importlib import colour_text import modulefinder from . import win_app_package_win_pe_info from . impo...
<reponame>acorg/dark-matter import bz2 import gzip from six.moves import builtins from unittest import TestCase from unittest.mock import mock_open from six import assertRaisesRegex from collections import Counter try: from unittest.mock import patch except ImportError: from mock import patch from io import BytesIO...
<filename>sdk/turing/generated/api/ensembling_job_api.py """ Turing Minimal Openapi Spec for SDK No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: 0.0.1 Generated by: https://openapi-generator.tech """ imp...
# -*- coding: utf-8 -*- """ @author: sebi PSF_XYZ_Dialog_BF.py Version: 1.5 Date: 2015-11-02 This program can be used to detect beads an measures the FWHM-XYZ of the PSF. The crucial steps are: * Read the z-stack via BioFormats using python-bioformats. * Define detection parameters for the selected channel. * Fin...
<filename>pgbedrock/spec_inspector.py from collections import defaultdict import copy import os import cerberus import jinja2 import yaml from pgbedrock import common from pgbedrock import context from pgbedrock.jinja import add_filters DEPENDENT_OBJECTS_MSG = ('Spec error: Ownership listed for dependent {objkind}: ...
post(self, request, *args, **kwargs): emails = request.POST.get('emails', []).split() balance = Decimal(request.POST.get('customPaymentAmount', 0)) wire_invoice_factory = DomainWireInvoiceFactory(request.domain, contact_emails=emails) try: wire_invoice_factory.create_wire_invoice(balance) except Exception, e: re...
host_source, "options": ["rbind", "nosuid", "noexec", "nodev", mode, ], } self._container_specjson["mounts"].append(mount) def _del_mount_spec(self, host_source, cont_dest): """Remove one mount point""" for (index, mount) in enumerate(self._container_specjson["mounts"]): if (mount["destination"] == cont_dest a...
B: (-1)**(B.size() - len(B)) coeff = lambda B: sign(B) * prod([factorial(sum( 1 for part in B if part.issubset(big) )) for big in A], self.base_ring().one()) return e.sum_of_terms([(B, coeff(B)) for B in A.refinements()], distinct=True) @cached_method def _h_to_p_on_basis(self, A): r""" Return `\mathbf{h}_A` in...
<filename>ipt/ipt_hough_circles_detector.py import os import pickle import logging logger = logging.getLogger(__name__) import cv2 import numpy as np from skimage.transform import hough_circle, hough_circle_peaks import ipso_phen.ipapi.base.ip_common as ipc from ipso_phen.ipapi.base.ipt_abstract import ...
ZZZ(self): """hardcoded/mock instance of the class""" return OutboundOrderLines() instance=ZZZ() """hardcoded/returns an instance of the class""" def Clone(self): """ Clone(self: OutboundOrderLines) -> object """ pass @staticmethod def FromIEnumerable(list): """ FromIEnumerable(list: IEnumerable[Out...
# Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # Copyright 2019 The celery-dyrygent Authors. All rights reserved. import logging import random import time from datetime import ( timedelta, ) from celery_dyrygent.celery import ( entities, inspect, ) from celer...
#!/usr/bin/env python # coding=utf-8 from __future__ import print_function #in case of using json.dumps with ensure_ascii=False import sys reload(sys) sys.setdefaultencoding('utf-8') from pprint import pprint from functools import wraps import os try: from urllib import urlencode, quote_plus except ImportError: f...
<gh_stars>0 # Copyright 2015 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 applicable ...
0, 0, 0, 0], [1764, 10.4855, 0, 9999, -9999, 1.0, 100, 1, 21.994769, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1765, 31.191337, 0, 9999, -9999, 1.0, 100, 1, 112.249863, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1766, 32.779309, 0, 9999, -9999, 1.0, 100, 1, 99.811208, 0.0, 0, 0, 0, 0, 0, ...
= { "result": [ { "acquisition_method": "", "asset_tag": "P1000807", "assigned": "2018-08-07 07:00:00", "assigned_to": { "link": "demisto.com", "value": "admin" }, "beneficiary": "", "checked_in": "", "checked_out": "", "ci": { "link": "demisto.com", "value": "admin" }, "comments": "", "company": { "...
- 59.07*m.x885 - 56.58*m.x900 - 56.58*m.x909 - 56.58*m.x919 - 56.58*m.x937 - 11.22*m.x947 - 11.22*m.x956 - 11.22*m.x974 - 28.61*m.x992 - 28.61*m.x1001 - 28.61*m.x1010 - 61.54*m.x1033 - 61.54*m.x1043 - 61.54*m.x1055 - 1.36*m.x1086 - 57.5*m.x1105 - 15.24*m.x1117 - 30.23*m.x1170 + 5.28*m.x1204 - 56.58*m.x1221 - 11.22*m...
documentation while True: message, attributes, children = self._sendrequest( "GetPPUser", {"seq": self._get_sequence(), "uid": start_uid, "maxRecords": MAX_RECORDS }) if children is None or "user" not in children or not children["user"]: break if not isinstance(children['user'], list): children['user'] = [chi...
dest): ''' Resets the index and working tree to HEAD. Discards any changes to tracked files in working tree since that commit. ''' cmd = "%s reset --hard HEAD" % (git_path,) return module.run_command(cmd, check_rc=True, cwd=dest) def get_remote_head(git_path, module, dest, version, remote, bare): cloning = Fal...
<gh_stars>1-10 #!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2016-2020 CNRS # 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...