input
stringlengths
2.65k
237k
output
stringclasses
1 value
<reponame>jverce/tensorflow # 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 # # Un...
work with this Op. """ if workmem is not None: if algo is not None: raise ValueError("You can't use both algo and workmem") warnings.warn("workmem is deprecated, use algo instead", stacklevel=2) algo = workmem fgraph = getattr(img, 'fgraph', None) or getattr(kerns, 'fgraph', None) ctx_name = infer_context_name...
c_1.astype(int) x11,y11,x12,y12=get_average_line(c_0,img) x21,y21,x22,y22=get_average_line(c_1,img) final_avg_lanes = np.zeros_like(img) cv2.line(final_avg_lanes,(int(x11),int(y11)),(int(x12),int(y12)),(255,255,255),1) cv2.line(final_avg_lanes,(int(x21),int(y21)),(int(x22),int(y22)),(255,255,255),1) ...
json=_json, ) request.url = self._client.format_url(request.url) pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_cod...
Requires our :ref:`mypy plugin <mypy-plugins>`. Read more about async and sync functions: https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/ """ @wraps(function) async def decorator(*args, **kwargs): return function(*args, **kwargs) return decorator # FutureResult # ============ @fin...
from bisect import bisect_right, bisect_left from collections import OrderedDict from enum import IntEnum, Enum import math from math import log10, floor _MINIMUM_R_VALUE = 1e-200 class RenardSeriesKey(Enum): """An enumeration of possible Renard series identifiers. """ R5 = (5, 0.01) R10 = (10, 0.01) R20 = (20...
import os from copy import copy, deepcopy import dateutil.parser import pystac from pystac import (STACError, STACObjectType) from pystac.link import Link, LinkType from pystac.stac_object import STACObject from pystac.utils import (is_absolute_href, make_absolute_href, make_relative_href, datetime_to_str, str_to_da...
padding otherwise. Static padding is necessary for ONNX exporting of models. """ if image_size is None: return Conv2dDynamicSamePadding else: return partial(Conv2dStaticSamePadding, image_size=image_size) class Conv2dDynamicSamePadding(nn.Conv2d): """ 2D Convolutions like TensorFlow, for a dynamic imag...
null=True, max_digits=5, decimal_places=3) fuel_price = models.DecimalField(_('price'), null=True, max_digits=15, decimal_places=2) #-------------- Part --------------- part_chg_km = models.IntegerField(_('replacement interval, km'), null=True) part_chg_mo = models.IntegerField(_('replacement interval, months'), nu...
# End to end happy path to test the minimum set of Reefer Container Shipment reference application components ################### ##### IMPORTS ##### ################### import unittest, os, json, time, requests, random from kafka.KcProducer import KafkaProducer from kafka.KcConsumer import KafkaConsumer ############...
<filename>viroconcom/plot.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Plots datasets, model fits and contour coordinates. """ import numpy as np import matplotlib.pyplot as plt from scipy import stats __all__ = ["plot_sample", "plot_marginal_fit", "plot_dependence_functions", "plot_contour", "Sa...
"LetterSpace": "\uF754", "LibraSign": "\u264E", "LightBulb": "\uF723", "Limit": "\uF438", "LineSeparator": "\u2028", "LongDash": "\u2014", "LongEqual": "\uF7D9", "LongLeftArrow": "\u27F5", "LongLeftRightArrow": "\u27F7", "LongRightArrow": "\u27F6", "LowerLeftArrow": "\u2199", "LowerRightArrow": "\u2198", "M...
#!/usr/bin/env python # coding: utf-8 # # Regularization # # Welcome to the second assignment of this week. Deep Learning models have so much flexibility and capacity that **overfitting can be a serious problem**, if the training dataset is not big enough. Sure it does well on the training set, but the learned networ...
# Copyright (C) 2020 GreenWaves Technologies, SAS # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # This progra...
# Center crop image width, height = img.size startx = width // 2 - (224 // 2) starty = height // 2 - (224 // 2) img = np.asarray(img).reshape(height, width, 3) img = img[starty:starty + 224, startx:startx + 224] assert img.shape[0] == 224 and img.shape[1] == 224, (img.shape, height, width) # Save im...
<gh_stars>0 # coding: utf-8 """ App Center Client Microsoft Visual Studio App Center API # noqa: E501 OpenAPI spec version: preview Contact: <EMAIL> Project Repository: https://github.com/b3nab/appcenter-sdks """ import pprint import re # noqa: F401 import six class ReasonStackFrame(object): """NOTE: This ...
#!/usr/bin/env python from __future__ import print_function import os from os.path import splitext, join, isfile, isdir, basename import argparse import numpy as np # from scipy import misc, ndimage import tensorflow.keras.backend as K from tensorflow.keras.models import model_from_json, load_model import tensorflow as...
<gh_stars>0 from flask_restplus import Namespace, fields import socket import time from datetime import datetime, date, time, timedelta from flask import jsonify, request from database import DB from bson import json_util, ObjectId from apis.utils.common import * from apis.libraries.send_mail import Send_mail import re...
del rule_schema['rule']['sources'] # Mandatory values of a source ( NB: source is an optional value ) elif rule_source_value != '': rule_schema['rule']['sources']['source']['value'] = rule_source_value rule_schema['rule']['sources']['source']['type'] = API_TYPES[rule_source_type] # Optional values of a source ( if...
<gh_stars>1-10 # epydoc -- Command line interface # # Copyright (C) 2005 <NAME> # Author: <NAME> <<EMAIL>> # URL: <http://epydoc.sf.net> # # $Id: cli.py 1196 2006-04-09 18:15:55Z edloper $ """ Command-line interface for epydoc. Abbreviated Usage:: epydoc [options] NAMES... NAMES... The Python modules to document....
signature(self._predictor) model_param, *_ = predictor_sig.parameters.values() model_param = model_param.replace(name="model_object") # assume that reader_return_type is a dict with only a single entry [(_, data_arg_type)] = self._dataset.reader_return_type.items() data_param = Parameter("features", kind=Paramete...
<filename>plot.py<gh_stars>0 import itertools import os import matplotlib import matplotlib.pyplot as plt import numpy as np from matplotlib import pyplot as plt from constants import (LV, Darzacq2007, L, Tantale2016, colors_additivity, figures_folder, gene_long, l, markers_additivity) from support import (J_over_k_...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the PyMVPA package for the # copyright and license terms. # ### ### ### ### ### ###...
from ...torch_core import * from ...layers import * from .awd_lstm import RNNDropout, LinearDecoder, SequentialRNN __all__ = ['Activation', 'PositionalEncoding', 'GeLU', 'Swish', 'feed_forward', 'MultiHeadAttention', 'MultiHeadRelativeAttention', 'DecoderLayer', 'Transformer', 'TransformerXL', 'tfmer_lm_config', 'tfm...
import logging from collections import defaultdict, namedtuple from datetime import datetime from threading import RLock from typing import TYPE_CHECKING from networkx import DiGraph, single_source_shortest_path from sqlalchemy import or_ from sqlalchemy.orm import aliased from sqlalchemy.sql import label, literal fr...
rhs def test_setitem_listlike_indexer_duplicate_columns(self): # GH#38604 df = DataFrame([[1, 2, 3]], columns=["a", "b", "b"]) rhs = DataFrame([[10, 11, 12]], columns=["a", "b", "b"]) df[["a", "b"]] = rhs expected = DataFrame([[10, 11, 12]], columns=["a", "b", "b"]) tm.assert_frame_equal(df, expected) df[["c"...
<filename>src/covid19sim/plotting/extract_tracker_metrics.py """ Extracts metrics from tracker """ import numpy as np import datetime from covid19sim.utils.constants import POSITIVE_TEST_RESULT, NEGATIVE_TEST_RESULT def SEIR_Map(state): """ Encodes the literal SEIR state to an integer. Args: (str): State of the ...
result) -> bool: return isinstance(result, DataFrame) and result.columns.equals( self._obj_with_exclusions.columns ) def _define_paths(self, func, *args, **kwargs): if isinstance(func, str): fast_path = lambda group: getattr(group, func)(*args, **kwargs) slow_path = lambda group: group.apply( lambda x: getattr...
<filename>scripts/tf_cnn_benchmarks/benchmark_cnn_test.py # 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.o...
import configparser import os import random import json import aiohttp import wikipedia as wiki import urbandictionary as ud import guilded import pymongo from pymongo import MongoClient import wikipediahelper import lowerutils config = configparser.ConfigParser() config.read('config.ini') pre = config['GUILDED']...
# 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 the Li...
<reponame>vishalbelsare/epymetheus-1 import abc import json from functools import partial from time import time from typing import TypeVar import numpy as np import pandas as pd from .. import ts from .._utils import print_if_verbose from .._utils import to_json from ..exceptions import NoTradeWarning from ..exceptio...
for the polyline # folium takes coords in lat,lon but geopandas provides them in lon,lat # so we have to flip them around locations = list([(lat, lon) for lon, lat in edge['geometry'].coords]) # if popup_attribute is None, then create no pop-up if popup_attribute is None: popup = None else: # folium doesn't in...
str(signalDict['dimensions'])+'\n' gamText += ' NumberOfElements = ' + \ str(signalDict['elements'])+'\n' gamText += ' Type = '+signalDict['type']+'\n' gamText += ' }\n' gamText += ' }\n' gamText += ' OutputSignals = {\n' for signalDict in inputSignals: gamText += ' '+signalDict['name']+' = {\n' gamText += ' D...
split_oris is not False # set to boolean if (exp_v_unexp + (len(quantpar.qu_idx) > 1) + ("half" in class_var) + split_oris) > 1: raise ValueError("Cannot combine any of the following: separating " "quartiles, exp_v_unexp, half comparisons, multiple Gabor frame " "orientation comparisons.") elif len(quantpar.qu_i...
<reponame>LittleBitProgrammer/myUniversity<filename>my_university_api/application/api/secretary/database_functions.py # This file contain all database functions of the secretary #################################################################### # import ###############################################################...
str(i))(transformation_params) if i == 0 or i == 1 or i == 2: y_max, y_min = 0.201, -0.201 Pasta_Para = Lambda( lambda x: tf.expand_dims( (y_max - y_min) * x + y_min, 1 ), name = 'Mapping_' + str(i))(out) branch_outputs.append(Pasta_Para) elif i == 3 or i == 4 or i == 5: y_max, y_min = 20.00 * 0.01745, -20.00...
"total": {"type": "string"}, "limit": {"type": "string"}, "offset": {"type": "string"}, "order_by": {"type": "string"}, }, } @property def post_schema_output(self): """ JSON Schema to validate POST request body. Abstract. Every schema must be a dict. :return: dict """ return {} @property def post_sch...
''' TODO: make dragging cursor correct ''' import collections import random from common import * from Draggable import * from Area import * from Deck import * from TokenBank import * from CardsTileView import * from DeckManipulator import * from ThreatDial import * from SetupDialog import * from JourneyLogger import * ...
<gh_stars>10-100 from __future__ import generators from time import localtime, sleep import os, Essbase, wmi,sys from optparse import OptionParser import win32serviceutil import random import zlib from win32wnet import WNetAddConnection2, WNetCancelConnection2, error import wmi listTemp=[] listComplete=...
# Copyright 2018 German Aerospace Center (DLR) # # 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 t...
<reponame>Orionisxoxo/Integracja_aplikacji_2 #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013-2017 <NAME> <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, e...
the last layer has a Parabola activation use_area_heuristic: c_bool whether to use area heuristic Returns ------- None """ try: ffn_handle_last_parabola_layer_no_alloc_c = fppoly_api.ffn_handle_last_parabola_layer_no_alloc ffn_handle_last_parabola_layer_no_alloc_c.restype = None ffn_handle_last_parabola_l...
<reponame>jochenparm/moler # -*- coding: utf-8 -*- """ asyncio_in_thread_runner_with_raw_functions.py ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A fully-functional connection-observer using configured concurrency variant. This is Layer_3 example: - shows configuration phase and usage phase - configure named conn...
# Enter a parse tree produced by SystemVerilogParser#specparam_declaration. def enterSpecparam_declaration(self, ctx:SystemVerilogParser.Specparam_declarationContext): pass # Exit a parse tree produced by SystemVerilogParser#specparam_declaration. def exitSpecparam_declaration(self, ctx:SystemVerilogParser.Sp...
<reponame>newbooks/SAMPL7<gh_stars>10-100 #!/usr/bin/env python # Credit: # This adapted by <NAME> from <NAME>'s file of the same name which he wrote for SAMPL6 # at https://github.com/samplchallenges/SAMPL6/blob/master/host_guest/Analysis/ExperimentalMeasurements/generate_tables.py # He gets credit for anything good ...
''' ''' import os import sys import h5py import numpy as np from scipy.stats import chi2 np.seterr(divide='ignore', invalid='ignore') # -- abcpmc -- import abcpmc from abcpmc import mpi_util # -- galpopfm -- from . import dustfm as dustFM from . import measure_obs as measureObs dat_dir = os.environ['GALPOPFM_...
|= ww for tt in ff: vv -= und(tt) return vv def fund(ff): und = transformsUnderlying vv = set() for tt in ff: vv |= und(tt) for (aa,ww) in ff: vv -= ww return vv def depends(ff,vv): und = transformsUnderlying dd = dict([(v,(xx,ww)) for (xx,ww) in ff for v in ww]) yy = set(dd.keys()) def ...
# coding: utf-8 """ Jamf Pro API ## Overview This is a sample Jamf Pro server which allows for usage without any authentication. The Jamf Pro environment which supports the Try it Out functionality does not run the current beta version of Jamf Pro, thus any newly added endpoints will result in an error and should b...
<gh_stars>0 print(""" ▄████▄ ▄▄▄ ██▒ █▓█████ ██▀███ ███▄ █ ▄▄▄ ▒██▀ ▀█ ▒████▄▓██░ █▓█ ▀▓██ ▒ ██▒██ ▀█ █▒████▄ ▒▓█ ▄▒██ ▀█▓██ █▒▒███ ▓██ ░▄█ ▓██ ▀█ ██▒██ ▀█▄ ▒▓▓▄ ▄██░██▄▄▄▄█▒██ █░▒▓█ ▄▒██▀▀█▄ ▓██▒ ▐▌██░██▄▄▄▄██ ▒ ▓███▀ ░▓█ ▓██▒▀█░ ░▒████░██▓ ▒██▒██░ ▓██░▓█ ▓██▒ ░ ░▒ ▒ ░▒▒ ▓▒█░ ▐░ ░░ ▒░ ░ ▒▓ ░▒▓░ ▒░ ▒ ▒ ▒▒ ▓▒█░ ...
""" Common utility functions and classes adpated from https://github.com/matterport/Mask_RCNN/blob/master/mrcnn/utils.py Mask R-CNN The MIT License (MIT) Copyright (c) 2017 Matterport, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files...
<filename>crates/iks-to-fks/convert-ik-to-fk.py # The goal of this script is to convert an IK rig into an FK rig. # We do this by creating a copy of your mesh and new FK rig for that mesh # # We do this by first duplicating our original rig and removing # all of the IKs and constraints from our duplicate. # # We then b...
<filename>mindfirl/mindfirl.py import flask from flask import Flask, render_template, redirect, url_for, session, jsonify, request, send_from_directory from flask_login import LoginManager, login_user, logout_user, login_required, current_user import redis from wtforms.fields import SelectField, FileField, FloatField, ...
it out. self.assertEqual(egress_message_annotations['work'], 'hard') self.assertEqual(egress_message_annotations['x-opt-qd.trace'], ['0/QDR.1', '0/QDR']) M1.stop() M2.stop() # Dont send any pre-existing ingress or trace annotations. Make sure that there are no outgoing message annotations # stripAnnotations pro...
""" s = """<?xml version="1.0"?> <Map> <Stylesheet> Map { map-bgcolor: #fff; } Layer { polygon-fill: #999; line-color: #fff; line-width: 1; outline-color: #000; outline-width: 1; } Layer name { text-face-name: 'Comic Sans'; text-size: 14; text-fill: #f90; } </Stylesheet> <Datasource name="templa...
the second dimension of logits. Returns: Routing probabilities for each pair of capsules. Same shape as logits. """ # leak is a zero matrix with same shape as logits except dim(2) = 1 because # of the reduce_sum. leak = tf.zeros_like(logits, optimize=True) leak = tf.reduce_sum(leak, axis=2, keep_dims=True) le...
# coding: utf-8 """ Galaxy 3.2 API (wip) Galaxy 3.2 API (wip) # noqa: E501 The version of the OpenAPI document: 1.2.0 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six class Namespace(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: h...
<filename>paraschut/executor.py # -*- coding: utf-8 -*- """ PARASCHUT: parallel job scheduling utils. see also: README.md, example.ipynb this submodule handles via a unified API the execution of jobs on different systems, such as: PBS cluster, local multi-CPU machine, or submission to a script file . @author: <NAME...
= _io self._parent = _parent self._root = _root if _root else self self._debug = collections.defaultdict(dict) self._read() def _read(self): self._debug['sound_id']['start'] = self._io.pos() self.sound_id = self._io.read_u2be() self._debug['sound_id']['end'] = self._io.pos() self._debug['volume']['start'] = s...
import numpy as np import random import json import h5py from patch_library import PatchLibrary from glob import glob import matplotlib.pyplot as plt from skimage import io, color, img_as_float from skimage.exposure import adjust_gamma from skimage.segmentation import mark_boundaries from sklearn.feature_extraction.ima...
import pytest import salt.modules.useradd as useradd from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch @pytest.fixture def configure_loader_modules(): return { useradd: { "__grains__": { "kernel": "Linux", "osarch": "x86_64", "os": "CentOS", "os_family": "RedHat"...
# -*- coding: iso-8859-15 -*- # # This software was written by <NAME> (<NAME>) # Copyright <NAME> # All rights reserved # This software is licenced under a 3-clause BSD style license # #Redistribution and use in source and binary forms, with or without #modification, are permitted provided that the following condit...
<gh_stars>1-10 # type: ignore from copy import deepcopy from typing import Any, Dict, List, Optional, Tuple from urllib.parse import urljoin import urllib3 import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * # disable insecure warnings urllib3.disable_warnings() DEFAU...
. delegation_set ) oooO0oOOOO0 = oo0ooo . is_ms_peer_entry ( ) oo0ooo . map_referrals_sent += 1 if 25 - 25: o0oOOo0O0Ooo % o0oOOo0O0Ooo - OoooooooOO . i1IIi if 10 - 10: OoO0O00 % iIii1I11I1II1 * OoOoOO00 / i11iIiiIii - I1IiiI . O0 if 2 - 2: II111iiii if 13 - 13: Ii1I % i11iIiiIii if 3 - 3: ooOoO0o % OoOoOO00 * I...
perform leiden clustering on the pretrained z to get clusters mu : np.array, optional \([d,k]\) The value of initial \(\\mu\). log_pi : np.array, optional \([1,K]\) The value of initial \(\\log(\\pi)\). res: The resolution of leiden clustering, which is a parameter value controlling the coarseness of the c...
33-67. E = (Pk * np.log(1 / Pk)).sum() MIT = np.nansum(ti[:, None] * pik * np.log(pik / Pk)) / (T * E) return MIT, core_data, groups class MultiInformationTheory: """ Calculation of Multigroup Information Theory index Parameters ---------- data : a pandas DataFrame groups : list of strings. The variab...
<filename>openlis/model/recursive_model_index_simple.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import time import os import math import numpy as np import tensorflow as tf from six.moves import xrange class RMI_simple(object): """ Implements t...
################################################################################################# # Visual object tracking in panoramic video # Master thesis at Brno University of Technology - Faculty of Information Technology # Author: <NAME> (<EMAIL>) # Supervisor: Doc. Ing. <NAME>, Ph.D. # Module: evaluation.py # De...
__author__ = "<NAME> <<EMAIL>>" __svnid__ = "$Id: calc.py 850 2009-05-01 00:24:27Z CodyPrecord $" __revision__ = "$Revision: 850 $" #--------------------------------------------------------------------------# # Dependancies import tkinter as tk from tkinter import ttk,messagebox,filedialog from noval import ...
of warnings produced by the last statement execution. ATTENTION: This function will be removed in a future release, use the get_warnings_count function instead. get_warnings() Retrieves the warnings generated by the executed operation. get_warnings_count() The number of warnings produced by the last statement ...
generated will satisfy the property, but there will be some missing. - ``size`` -- (default: ``None``) the size of the graph to be generated. - ``degree_sequence`` -- (default: ``None``) a sequence of non-negative integers, or ``None``. If specified, the generated graphs will have these integers for degrees. In ...
from process_pf import * from process_ez import * from process_full import * import pandas as pd from numpy import random import logging import dask import dask.dataframe as dd dask.set_options(get=dask.multiprocessing.get) #switch from default multithreading to multiprocessing # Code by <NAME> (<EMAIL>), 2016-2017 ...
<gh_stars>0 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload fr...
<reponame>jg-rp/liquid """Test cases for string filters.""" # pylint: disable=too-many-public-methods,too-many-lines,missing-class-docstring import unittest from functools import partial from inspect import isclass from typing import NamedTuple from typing import Any from typing import List from typing import Dict f...
"Wishy-Washy Blue": 0xC6E0E1, "Wishy-Washy Brown": 0xD1C2C2, "Wishy-Washy Green": 0xDFEAE1, "Wishy-Washy Lichen": 0xDEEDE4, "Wishy-Washy Lilies": 0xF5DFE7, "Wishy-Washy Lime": 0xEEF5DB, "Wishy-Washy Mauve": 0xEDDDE4, "Wishy-Washy Mint": 0xDDE2D9, "Wishy-Washy Pink": 0xF0DEE7, "Wishy-Washy Red": 0xE1DADD, "Wis...
<gh_stars>0 """Return the different representations of the probabilistic program. Transformations are performed on the graphical model, which is then compiled to the CST by the (universal) compiler. """ import copy from collections import defaultdict from functools import partial import libcst as cst from mcx.core....
request: :class:`tencentcloud.bmlb.v20180625.models.DescribeL7BackendsRequest` :rtype: :class:`tencentcloud.bmlb.v20180625.models.DescribeL7BackendsResponse` """ try: params = request._serialize() body = self.call("DescribeL7Backends", params) response = json.loads(body) if "Error" not in response["Response"]: ...
ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(ResourceListOfWorkflow, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals...
import logging import numpy as np import scipy import numba import opt_einsum import pyfftw import mathx from .. import bvar from . import sa logger = logging.getLogger(__name__) fft = lambda Ar, axis=-1:pyfftw.interfaces.numpy_fft.fft(Ar, norm='ortho', axis=axis) ifft = lambda Ak, axis=-1:pyfftw.interfaces.numpy_fft...
3.1217e-01, 1318.0: 3.3328e-01, 1319.0: 2.6855e-01, 1320.0: 2.5872e-01, 1321.0: 2.9866e-01, 1322.0: 3.0217e-01, 1323.0: 2.3279e-01, 1324.0: 2.6249e-01, 1325.0: 3.2224e-01, 1326.0: 2.8051e-01, 1327.0: 2.6625e-01, 1328.0: 2.3450e-01, 1329.0: 1.7759e-01, 1330.0: 2.2923e-01, 1331.0: 1.4480e-01, 1332.0: 1.457...
import logging from datetime import timedelta as td import numpy as np from dateutil.parser import parse import dateutil.tz import gevent from volttron.platform.agent.math_utils import mean, stdev from volttron.platform.agent.base_market_agent import MarketAgent from volttron.platform.agent.base_market_agent.poly_line...
(detection_all[3][0], detection_all[3][1]) #self.target_height = target_height self.target_height = detection_all[4][3] target_width = detection_all[4][2] target = (detection_all[4][0], detection_all[4][1]) ref_x = int(w/2) ref_y = int(h*0.35) self.axis_speed = self.cmd_axis_speed.copy() #Is there a Pic...
<gh_stars>1-10 import pandas as pd from glob import glob from os.path import join from .derived import * from pvlib.solarposition import get_solarposition import datetime def process_cabauw_data(csv_path, out_file, nan_column=("soil_water", "TH03"), cabauw_lat=51.971, cabauw_lon=4.926, elevation=-0.7, reflect_counte...
# noqa: D100 from typing import Optional import numpy as np import xarray from xclim.core.calendar import resample_doy from xclim.core.units import ( convert_units_to, declare_units, pint2cfunits, rate2amount, str2pint, to_agg_units, ) from . import run_length as rl from ._conversion import rain_approximation,...
CJK # Unified Ideographs area, followed by U+3051 HIRAGANA LETTER KE) self.assertGdbRepr(u'\u6587\u5b57\u5316\u3051') # Test a character outside the BMP: # U+1D121 MUSICAL SYMBOL C CLEF # This is: # UTF-8: 0xF0 0x9D 0x84 0xA1 # UTF-16: 0xD834 0xDD21 # This will only work on wide-unicode builds: self.assertGdb...
# Copyright (c) 2020 @ FBK - Fondazione B<NAME> # Author: <NAME> # Project: LUCID: A Practical, Lightweight Deep Learning Solution for DDoS Attack Detection # # 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 t...
'UserProfile' db.create_table('auth_user_profile', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True)), ('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, null=True...
<reponame>symbooglix/boogie-runner #!/usr/bin/env python # vim: set sw=2 ts=2 softtabstop=2 expandtab: import argparse import logging import os import pprint import sys import yaml from br_util import FinalResultType, classifyResult, validateMappingFile import matplotlib.pyplot as plt try: # Try to use libyaml which ...
# -*- coding: utf-8 -*- ############################################################################# # SRWLIB Example: Virtual Beamline: a set of utilities and functions allowing to simulate # operation of an SR Beamline. # The standard use of this script is from command line, with some optional arguments, # e.g. for ...
1, 0)]), ((2, 3), [(1, 2, 1), (0, 1, 0)]), ((2,), [(1, 2, 0)]), ((1, 2), [(1, 2, 0), (3, 4, 0)]), ((1, 2), [(0, 0, 0), (0, 0, 0)]), ((2,), [(1, 2, 3),]), ((3, 2), [(1, 2, 1), (3, 4, 2)]), ((2,), [(-1, 2, 0),]), ((4, 2), [(-1, -2, 0), (1, 2, 0)]), ((4, 2), [(-1, 2, 0), (1, 2, 2)]), ((5,), [(-1, -2, 2),]), ((4...
plume has reached a maximum rise height yet if np.sign(q0_local.Jz) != np.sign(q1_local.Jz): top_counter += 1 # Check if the plume is at neutral buoyancy in an intrusion layer # (e.g., after the top of the plume) if top_counter > 0: if np.sign(q0_local.rho_a - q0_local.rho) != \ np.sign(q1_local.rho_a - q1_loc...
29 ) plt.gca().locator_params(axis='x', tight = True, nbins=4) # plt.gca().locator_params(axis='y', tight = True, nbins=5) plt.xlabel('Translation rate [1/min]') plt.ylabel('Period [min]') plt.ylim(0,700) my_figure.add_subplot(6,3,14) plt.plot(translation_rate_results[:,0], translation_rate_results[:,2], color ...
<reponame>sfu-arch/TensorBricks import math from tqdm import tqdm def calculate_mac_utilization(self, num_h_convs, num_w_convs, num_cin, num_f, num_macs_w, hw_params): cin_util, cin_fold = self.get_mac_utilization(num_cin, hw_params.mac_cxx) w_util, w_fold = self.get_mac_utilization(num_w_convs, num_macs_w) f_util...
""" Train the model. Use generators for data preparation and model_handler for access. Generators have to be set in constructor of subclasses. :param hparams: Hyper-parameter container. :return: A tuple of (all test loss, all training loss, the model_handler object). """ self.sanity_check_train(hparams) self.lo...
<filename>client/bot.py # -*- coding:utf-8 -*- import os import sys import json import hashlib import requests import platform import configparser # Prevent CLI output pollution requests.packages.urllib3.disable_warnings() import subprocess import client class Bot(object): def __init__(self, logger, ra_url, path, v...
from __future__ import print_function print(__doc__) import os import sys import numpy as np #import matplotlib #matplotlib.use('AGG') # Do this BEFORE importing matplotlib.pyplot import matplotlib.pyplot as plt #from matplotlib.colors import Normalize import matplotlib.colors as colors import matplotlib.cm as cm ...
"page{}".format(num) # TODO delete me self.image_path = None class UVVertex: """Vertex in 2D""" __slots__ = ('co', 'tup') def __init__(self, vector): self.co = vector.xy self.tup = tuple(self.co) class UVEdge: """Edge in 2D""" # Every UVEdge is attached to only one UVFace # UVEdges are doubled as needed b...
AtaSolutionProperties # type: ignore from ._models import AuthenticationDetailsProperties # type: ignore from ._models import AutoProvisioningSetting # type: ignore from ._models import AutoProvisioningSettingList # type: ignore from ._models import Automation # type: ignore from ._models import AutomationAction #...
import os import sys import glob import random import math import datetime import itertools import json import re import logging # from collections import OrderedDict import numpy as np from scipy.stats import multivariate_normal # import scipy.misc import tensorflow as tf # import keras import keras.backend as KB impo...
<filename>toolbox/ui.py import matplotlib.pyplot as plt from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure from PyQt5.QtCore import Qt, QStringListModel from PyQt5.QtWidgets import * from encoder.inference import plot_embedding_as_heatmap from toolbox.u...