input
stringlengths
2.65k
237k
output
stringclasses
1 value
**kwargs): requires_backends(self, ["torch"]) CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None class CamembertForCausalLM(metaclass=DummyObject): _backends = ["torch"] def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) class CamembertForMaskedLM(metaclass=DummyObject): _backends = ["torch...
#!/usr/bin/env python ''' SPARTA - Network Infrastructure Penetration Testing Tool (http://sparta.secforce.com) Copyright (c) 2015 SECFORCE (<NAME> and <NAME>) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software F...
<gh_stars>1-10 # Copyright 2013-2021 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 glob import os from argparse import Namespace import pytest from six import StringIO import llnl.ut...
p4.p4_parse_state): next_parse_state = ("parse_state", next_state.name) elif isinstance(next_state, p4.p4_conditional_node): next_parse_state = ("conditional_table", get_conditional_node_name(next_state)) elif isinstance(next_state, p4.p4_table): next_parse_state = ("table", get_table_name(next_state)) else: a...
class SkyUnits(): #{{{ ''' Transform units in the sky for a given cosmology ''' from astropy.cosmology import Planck15 as cosmodel from astropy import units as u def __init__(self, theta=0, z=0., distance=0., glxsize=0.): self.theta = theta self.z = z self.distance = distance self.glxsize = glxsize def a...
<reponame>cjsteel/python3-venv-ansible-2.10.5 #!/usr/bin/python # (c) 2020, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = """ --- module: na_santricity_host...
<gh_stars>0 # -*- coding: utf-8 -*- # @Time : 2021/5/30 # @Author : <NAME> import numpy as np from scipy.sparse import csc_matrix, dok_matrix from scipy.sparse.linalg import splu, cg from sksparse.cholmod import cholesky # from scipy.sparse import save_npz, load_npz # import line_profiler class Edge(obje...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # <NAME> (<EMAIL>) import py_trees as pt import py_trees_ros as ptr import time import numpy as np import rospy import tf import actionlib # from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal from smarc_msgs.msg import GotoWaypointAction, Goto...
'Parameter' , 'theta' , 'theta_boot' , 'bias/sigma [%]' , 'error [%]' ) table = [] n = 0 for name in sorted ( stats ) : if name in fitresult : p = fitresult [ name ] theta = p * 1.0 if not isinstance ( theta , VE ) or theta.cov2() <= 0 : logger.warning ('print_bootstrap: parameter "%s" is invalid in ``fitr...
<reponame>jrStaff/pixiedust # ------------------------------------------------------------------------------- # Copyright IBM Corp. 2017 # # 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 # # ...
# -*- coding: utf-8 -*- """ Various dependencies that are required for file-metadata which need some special handling. """ from __future__ import (division, absolute_import, unicode_literals, print_function) import ctypes.util import hashlib import os import subprocess import sys from distutils import sysconfig from...
<gh_stars>0 from keras import initializers, regularizers, activations from keras.engine.topology import Layer from keras import backend as K import tensorflow as tf class GraphEmbed(Layer): def __init__(self, **kwargs): super(GraphEmbed, self).__init__(**kwargs) def build(self, input_shape): super(GraphEmbed, se...
if(periodic): frame = reflection_pad2D(frame, int(kernel_size / 2), device) frame = F.conv2d(frame, gaussian_kernel, groups=frame.shape[1]) frame = F.interpolate(frame, size = list(s), mode='bilinear', align_corners=False) del gaussian_kernel return frame def laplace_pyramid_downscale3D(frame, level, downscale_...
#!/usr/bin/python # -*- coding: utf-8 -*- """ This module implements functions used to produce evolution charts and other plots based on the output of estrangement confinement :mod:`estrangement.estrangement.ECA` .""" __all__ = ['GetDeltas','plot_by_param','plot_function','ChoosingDelta','preprocess_temporal_communit...
already_processed): value = find_attr_value_('LANG_REF', node) if value is not None and 'LANG_REF' not in already_processed: already_processed.add('LANG_REF') self.LANG_REF = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class descMultiLangType class propType(Generateds...
"""This module contains wrappers around the ISIS campt and mappt that are specific to understanding the relationship between pixels and projected coordinates.""" # This is free and unencumbered software released into the public domain. # # The authors of autocnet do not claim copyright on the contents of this file. # ...
#!/usr/bin/python # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # """Base Contrail Provisioning module.""" import os import re import sys import shutil import socket import argparse import tempfile import platform import ConfigParser from fabric.api import * from contrail_provisioning.common.temp...
SET EntityBridgeId=0 WHERE (EntityBridgeId = '%s') " % tmp[ "tblEntities"]) if ent["entitytype"] == "acl_group": pass # remove all old entities order = 0 if "entities" in ent: if not isinstance(ent["entities"], list): LOG.critical(_("update attached_entities entities item for dbid %s is not a list: %s" % ( db...
""" Pod API This document refers to Symphony API calls that do not need encryption or decryption of content. - sessionToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - Actions are defined to be ...
<reponame>jdnc/SimpleCV ''' SimpleCV Detection Library This library includes classes for finding things in images FYI - All angles shalt be described in degrees with zero pointing east in the plane of the image with all positive rotations going counter-clockwise. Therefore a rotation from the x-axis to to the y-axis ...
[ "thisisntaparam=somevalue", "thisisntaparam", ] @pytest.mark.parametrize("arg", SETTINGS_FAILURE) def test_do_set_fail(arg): itm = tm.InteractiveTomcatManager() itm.do_set(arg) assert itm.exit_code == itm.EXIT_ERROR PREFIXES = [ ("--", "--"), ("*", "*"), (">>>", ">>>"), # with no prefix, we should see th...
indices, shape, summed, linked_lengths): assert isinstance(indices, str) self.ast = tuple(ast) self.indices = indices self.shape = tuple(shape) self.summed = frozenset(summed) self.linked_lengths = frozenset(linked_lengths) self.ndim = len(self.indices) def _join_shapes(self, other): '''Verify ``self + othe...
str): func_name = utils.get_value_by_insensitive_key_or_value( param, self.components._namespace) or param if hasattr(self.components, func_name): func = getattr(self.components, func_name) else: NameError( "\n'%s' is not recognized as a model component." % param) else: func = param if not self.get_args(f...
<gh_stars>10-100 import argparse import os import numpy as np import scipy import cv2 from functools import partial from shapely.geometry import Polygon import torch import torch.optim as optim import torch.utils.data as data from torch import distributed import grasp_det_seg.models as models from grasp_det_seg.algos...
is_FreeModule(gens): gens = gens.gens() return FreeModule_submodule_field(self.ambient_vector_space(), gens, check=check) def vector_space_span_of_basis(self, basis, check=True): """ Create the vector subspace of the ambient vector space with given basis. INPUT: - ``basis`` - a list of linearly independent ...
0xA4A7A4, "Stepping Stones": 0xB2A18C, "Sterling": 0xD1D4D1, "Sterling Blue": 0xA2B9C2, "Sterling Shadow": 0xE9EBDE, "Sterling Silver": 0x9EAFC2, "Stetson": 0x9E7A58, "Steveareno Beige": 0xC5B5A4, "Sticks & Stones": 0xBAA482, "Sticky Black Tarmac": 0x112111, "Sticky Toffee": 0xCC8149, "Stieglitz Silver": 0x8...
<gh_stars>0 import os import sys from configobj import ConfigObj, ConfigObjError from logging import (getLevelName, getLogger, FileHandler, StreamHandler, Formatter) from optparse import OptionParser, SUPPRESS_HELP from landscape import VERSION from landscape.lib.persist import Persist from landscape.upgraders im...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ OptExp (c) University of Manchester 2018 OptExp is licensed under the MIT License. To view a copy of this license, visit <http://opensource.org/licenses/MIT/> Created on Tue Nov 27 16:01:46 2018 @author: pablo """ import numpy as np import pandas as pd import itert...
external databases. Notes ------ None Returns ------- flowdata : data-type obtained streamflow observation dataframe between Startyear and EndYear. obtaindata : bool True indicate successfully obtain data, False indicate no data are founded for this gauge obs_DA : float The drainage area of this gauge re...
[100, 120], [180, 230], [255, 255]]) >>> lc = ColorCurve([[0,0], [90, 120], [180, 230], [255, 255]]) >>> sc = ColorCurve([[0,0], [70, 110], [180, 230], [240, 255]]) >>> img2 = img.applyHLSCurve(hc,lc,sc) **SEE ALSO** :py:class:`ColorCurve` :py:meth:`applyRGBCurve` """ #TODO CHECK ROI #TODO CHECK CURVE SI...
# script that controls the computation procedure # first create the file params_gcc.txt and params.txt, which contain the preprocessor definitions and relevant parameters included in the Python script # then create pre-processed interpretable source files in the given subdir # then execute the Python program import os...
= Upgrade(args.ip, args.port) tarver = ugObj.get_target_version() if (tarver and 'target_version' in tarver): viprver = tarver['target_version'] viprver = viprver[viprver.find("vipr-")+5:] cliver = common.get_viprcli_version() cliver = cliver[cliver.find("storageos-cli-")+14:] if ( viprver != cliver): print "Vi...
<gh_stars>1-10 #!/usr/bin/env python3 #============================================================ # IMSNG Pipeline # => Processing # Data Monitoring => Processing => Transient Search #============================================================ #%% # Library #----------------------------------------------------------...
<reponame>cvtower/Sparse-Winograd-CNN #!/usr/bin/env python # -*- coding: UTF-8 -*- # File: imagenet-resnet.py import cv2 import sys import argparse import numpy as np import os import multiprocessing import glob import pickle import tensorflow as tf from tensorflow.contrib.layers import variance_scaling_initializer ...
from __future__ import absolute_import, print_function from unittest import TestCase import pytest from conda import text_type from conda.base.context import context from conda.cli.common import arg2spec, spec_from_line from conda.common.path import expand from conda.common.url import path_to_url from conda.exceptio...
running this a few times. # In[17]: numberOfKittens = numberOfKittens + 10 numberOfKittens # #### Floating points or floats # Floats are similar to integers, but with more precision. # Float comes from a Floating point or a number with a decimal point. # # This example starts at 0, but note that this is .0 # A...
<reponame>admariner/centimani """Google Cloud function that uploads chunk of products to the Content API.""" # 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 # # h...
# ---------------------------*-python-*----------------------------------------# # file interactive_utils.py # author <NAME> # date February 2019 # note Copyright (C) 2019, Los Alamos National Security, LLC. # All rights reserved. # -----------------------------------------------------------------------------# ''' Inte...
<filename>src/aaindex_encoding_ResLikeCNN.py<gh_stars>10-100 import os import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers,regularizers import pandas as pd from sklearn.metrics import roc_curve, auc, precision_recall_curve, confusion_matrix, f1_score,accuracy_score import matplotlib...
<reponame>broadinstitute/celligner2 import inspect from lib2to3.pgen2.token import OP import os import anndata from numpy.lib.function_base import _percentile_dispatcher import torch import pickle import numpy as np import pandas as pd from anndata import AnnData from typing import Optional, Union from .celligner2 ...
import os import unittest import uuid import ast import time import threading from wsgiref import simple_server import urllib import json import requests from server.gateway import app from server.verbs import Visit from server.doctor import register_doctor, get_doctor, edit_doctor from server.patient import registe...
import torch import torch.nn as nn import os import torch.nn.functional as F class LDS(nn.Module): def __init__(self,): super(LDS, self).__init__() self.pool1 = nn.MaxPool2d(kernel_size=(2, 2), stride=2, padding=0) self.pool2 = nn.MaxPool2d(kernel_size=(2, 2), stride=2, padding=0) self.pool3 = nn.MaxPool2d(kerne...
"66e5a32f04cfcf9826296b3c053c22caa745fd890ccc6ea9199c34529507524a", ), "rest-types": struct( version = "1.14.1.1", sha256 = "b7e08e65bbae20bd891f0905c9c785184182172094673ab13e66499e4fe3969a", ), "rest-wai": struct( version = "0.2.0.1", sha256 = "38205eb7b85a4e052f11db099dd65e9d952b8533d1a35001f0b1958b443c0d...
request.get('episodes', []) num_photos = 0 for ep_dict in ep_dicts: yield Episode.VerifyEpisodeId(client, user_id, device_id, ep_dict['new_episode_id']) num_photos += len(ep_dict['photo_ids']) yield gen.Task(Operation.CreateAndExecute, client, user_id, device_id, 'SavePhotosOperation.Execute', request) log...
[ 2.0, 0.0, 0.0, -2.0, 1.0, 0.0004, 0.0, -0.0002, 0.0 ], [ 0.0, 1.0, 2.0, -2.0, 1.0, 0.0004, 0.0, -0.0002, 0.0 ], [ 1.0, 1.0, 0.0, 0.0, 0.0, -0.0003, 0.0, 0.0, 0.0 ], [ 1.0, -1.0, 0.0, -1.0, 0.0, -0.0003, 0.0, 0.0, 0.0 ], [ -1.0, -1.0, 2.0, 2.0, 2.0, -0.0003, 0.0, 0.0001, 0.0 ], [ 0.0, -1.0, 2.0, 2.0, 2.0, -0.0003...
= self self.mpls_static_labels = L2Vpn.Database.XconnectGroups.XconnectGroup.P2PXconnects.P2PXconnect.Pseudowires.Pseudowire.PseudowireAddress.MplsStaticLabels() self.mpls_static_labels.parent = self self.source_address = None self.tag_impose = None class MplsStaticLabels(object): """ MPLS static labels .. ...
22, 23, 24, 25, 27, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 84, 85, 86, 87, 88, 89, 90 ] self._classes = { ind + 1: cat_id for ind, cat_id in enumerate(self._c...
<gh_stars>100-1000 import emoji import datetime import itertools from collections import Counter from dateutil.relativedelta import relativedelta MAX_MSG_LEN = 4096 def count_months(msgs): """Returns the number of months between first and last messages (calendar months).""" r = relativedelta(msgs[-1].date, msgs[0]...
<gh_stars>0 """Objects representing API interface to Wikibase site.""" # # (C) Pywikibot team, 2012-2022 # # Distributed under the terms of the MIT license. # import datetime import json import uuid from contextlib import suppress from typing import Optional from warnings import warn import pywikibot from pywikibot.da...
from rpython.flowspace.model import FunctionGraph, Constant, Variable, c_last_exception from rpython.rlib.rarithmetic import intmask, r_uint, ovfcheck, r_longlong, r_longlonglong from rpython.rlib.rarithmetic import r_ulonglong, is_valid_int from rpython.rtyper.lltypesystem import lltype, llmemory, lloperation, llheap ...
['Image'], 'ENCAPSULATED CDA IOD': ['Encapsulated Document'], 'ENHANCED SR IOD': ['Document'], 'VL PHOTOGRAPHIC IMAGE IOD': ['Image'], 'GENERAL AUDIO WAVEFORM IOD': ['Waveform'], 'MR IMAGE IOD': ['Image'], 'BASIC IMAGE BOX IOD': ['Basic Image Box'], 'VIDEO ENDOSCOPIC IMAGE IOD': ['Image'], 'ARTERIAL PULSE WAVEF...
= menu(header, options, INVENTORY_WIDTH) #if an item was chosen, return it if index is None or len(inventory) == 0: return None return inventory[index].item def msgbox(text, width=50): menu(text, [], width) #use menu() as a sort of "message box" def handle_keys(): global key if key.vk == libtc...
<gh_stars>1-10 # Copyright 2015 <NAME> # # 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 wri...
<filename>source/MulensModel/magnificationcurve.py import numpy as np import math import warnings from MulensModel.trajectory import Trajectory from MulensModel.pointlens import PointLens, get_pspl_magnification from MulensModel.binarylens import BinaryLens from MulensModel.modelparameters import ModelParameters cla...
max(ret, cand) print 'Case #%d: %.10lf' % (cc + 1, ret) if lowest + can_replicate not in seen: seen.add(lowest + can_replicate) queue.append(lowest + can_replicate) if lowest + can_replicate - 1 not in seen: seen.add(lowest + can_replicate - 1) queue.append(lowest + can_replicate - 1) return p def func_32f92d...
<filename>manabi/apps/flashcards/models/cardmanager.py from datetime import datetime, timedelta from itertools import chain from django.db import models from django.db.models.query import QuerySet from django.db.models import Min, Count, Q from manabi.apps.flashcards.models.constants import GRADE_NONE, MATURE_INTERVA...
import urllib,urllib2,re,xbmcplugin,xbmcgui,urlresolver,xbmc,xbmcaddon,os from addon.common.addon import Addon from addon.common.net import Net import silent #www.movie25.so - by The_Silencer 2013 v0.10 addon_id = 'plugin.video.moviestwentyfive' local = xbmcaddon.Addon(id=addon_id) movie25path = local.ge...
"""Generated message classes for datamigration version v1alpha2. Manage Cloud Database Migration Service resources on Google Cloud Platform. """ # NOTE: This file is autogenerated and should not be edited by hand. from __future__ import absolute_import from apitools.base.protorpclite import messages as _messages fro...
and `std()` work on entire columns. We can run our own functions across all values in a column (or row) using `apply()`. # # To give you an idea of how this works, let's consider the "date" column in our DataFrame (formally "EDT"). # In[29]: data.date.head() # We can use the `values` property of the column to get ...
which the item could not be unshared. """ path = 'content/items/' + item_id + '/unshare' postdata = self._postdata() postdata['groups'] = groups resp = self.con.post(path, postdata) if resp: return resp def share_item(self, item_id, owner, folder=None, everyone=False, org=False, groups="", allow_members_to_...
<reponame>jjon/rdflib import collections import datetime import itertools import typing as t from typing import Any, Container, Dict, Iterable, List, Optional, Tuple, Union import isodate import rdflib.plugins.sparql from rdflib.compat import Mapping, MutableMapping from rdflib.graph import ConjunctiveGraph, Graph fr...
"optional", "mandatory")) obj.add_property(Property(0xB0, "Detection threshold level", "unsigned char", 1, "optional", "optional", "-")) obj.add_property(Property(0xB1, "Gas detection status", "unsigned char", 1, "optional", "-", "mandatory")) obj.add_property(Property(0xE0, "Measured value of gas concentration", "unsi...
<reponame>illicitonion/buck from __future__ import with_statement import __builtin__ import __future__ import contextlib from collections import namedtuple from pathlib import _Accessor, Path, PureWindowsPath, PurePath, PosixPath from pywatchman import bser from contextlib import contextmanager, nested import copy i...
- """ self.__merge__(source, True) def empty_copy(self): """ Performs copy of instance of Yang :param: - :return: instance copy (of Yang) """ return self.__class__(self._tag) def full_copy(self): """ Performs deepcopy of instance of Yang :param: - :return: instance copy (of Yang) """ return copy.deepc...
# 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...
"monistic", "monition", "monitive", "monitory", "monkeyed", "monkhood", "monoacid", "monocarp", "monocled", "monocles", "monocots", "monocrat", "monodies", "monodist", "monofils", "monofuel", "monogeny", "monogerm", "monoglot", "monogyny", "monohull", "monokine", "monologs", "monology", "monopod...
<filename>rsqueakvm/test/test_squeakimage.py # -*- coding: utf-8 -*- import pytest import py import StringIO from struct import pack from rsqueakvm import squeakimage, error from rsqueakvm.model.character import W_Character from rsqueakvm.model.compiled_methods import W_CompiledMethod from rsqueakvm.model.numeric impo...
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import from __future__ import print_function import copy import errno import fnmatch import hashlib import logging import multiprocessing import os import re import salt import signal import sys import threa...
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
Workplane object with the current point unchanged """ diff = stop - start allPoints = self._toVectors( (func(start + diff * t / N) for t in range(N + 1)), False ) e = Edge.makeSplineApprox( allPoints, tol=tol, smoothing=smoothing, minDeg=minDeg, maxDeg=maxDeg ) if makeWire: rv_w = Wire.assembleEdges([e]) ...
= _libsumo.poi_getAllSubscriptionResults def poi_getSubscriptionResults(objID): return _libsumo.poi_getSubscriptionResults(objID) poi_getSubscriptionResults = _libsumo.poi_getSubscriptionResults def poi_getAllContextSubscriptionResults(): return _libsumo.poi_getAllContextSubscriptionResults() poi_getAllContextSubsc...
# main.py COPYRIGHT Fujitsu Limited 2022 from argparse import ArgumentParser from collections import OrderedDict import copy import os import torch from torchvision import transforms import torchvision.datasets as datasets from tqdm import tqdm import sys sys.path.append('../../') from auto_prune_cifar10 import auto_...
#!/usr/bin/python # -*- coding: utf-8 -*- """Commonly used utility functions.""" # mainly backports from future numpy here from __future__ import absolute_import, division, print_function from copy import deepcopy import numpy as np import networkx as nx from scipy.stats import spearmanr from .utilities import tril_...
import abc from collections import OrderedDict from functools import reduce from operator import mul from cached_property import cached_property from sympy import Expr from devito.ir.support.vector import Vector, vmin, vmax from devito.tools import (PartialOrderTuple, as_list, as_tuple, filter_ordered, frozendict, t...
) runcmd("brew", "config") runcmd("brew", "doctor") raise ### TODO: Handle variations in this path (Is it "$(brew --prefix)/bin"?) log.debug("Installed program directory: /usr/local/bin") return Path("/usr/local/bin") def assert_supported_system(self) -> None: if shutil.which("brew") is None: raise MethodNotS...
klustakwik) or as a result of manual sorting"), "const": True}}, "times": { "description": ("Times of clustered events, in seconds. This may be a link to " "times field in associated FeatureExtraction module."), "dimensions": ["num_events"], "data_type": "float64!"}, "num": { "description": "Cluster number of e...
+ CONSTANT_TYPE+ABSOLUTE_) assert_equal(myDisasm.Argument3.ArgSize, 8) assert_equal(myDisasm.Argument3.AccessMode, READ) assert_equal(myDisasm.CompleteInstr, 'cmpnltsd xmm0, qword ptr [rax]') Buffer = b'\xF2\x0F\xC2\x00\x06\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11' myDisasm = DISASM() myDisasm.Archi = 64 Target ...
(required) :return: SyncSyncJob If the method is called asynchronously, returns the request thread. """ all_params = ['id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() f...
return [self._space] return [action._space for action in self._actions] @property def space(self): """ Get the corresponding space. """ if self.has_space(): # return gym.spaces.Tuple([self._space]) return self._space # return [action._space for action in self._actions] return gym.spaces.Tuple([action._space...
<filename>functions.py """ """ import copy import numpy as np from joblib import Parallel, delayed from tqdm import tqdm import argparse import random import warnings from ast import literal_eval import tez from tez import enums from tez.callbacks import Callback import torch import torch.nn as nn from sklearn impor...
#!/usr/bin/env python import datetime import glob import gzip import hashlib import json import os import subprocess import requests from logzero import logger #BASEURL = 'http://localhost:5000' ERROR_TIMER = 0 TOKENS = { 'AAA': '<PASSWORD>' } ANSIBLE_PROJECT_ID = u'573f79d02a8192902e20e34b' SHIPPABLE_URL = u'h...
### Team6 main.py ### ### author: tanahashi, kurita, ito ### import os import eel import csv import datetime from datetime import datetime as dt import numpy import random import matplotlib.pyplot as plt import japanize_matplotlib # グラフの日本語表示に必要 from typing import Counter # import importer # import exporter # P000の初...
last layer b_fc2 shape _variables = tf.get_default_graph().get_collection_ref(tf.GraphKeys.VARIABLES) print(_variables) bias_before_output_layer_name = 'model/fc/b_fc2/b_fc2:0' b_fc2 = tf.get_default_graph().get_tensor_by_name(bias_before_output_layer_name) # Reset the graph to restore after model construction t...
# -*- coding: utf-8 -*- # Copyright 2017-2019 ControlScan, Inc. # # This file is part of Cyphon Engine. # # Cyphon Engine is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # # Cyphon En...
import errno import json import logging import os import shutil import uuid import zipfile import re import subprocess import pandas as pd from kb_Amplicon.Utils.DataUtil import DataUtil from installed_clients.DataFileUtilClient import DataFileUtil from installed_clients.KBaseReportClient import KBaseReport class ...
to do if type(steps) == str: steps = [steps] do_merge = "merge" in steps do_post_merge = "post" in steps self.merge_stats = {} self.stats = {} self.mapping = {} # try to identify root document sources amongst the list to first # process them (if any) defined_root_sources = self.get_root_document_sources() ro...
for item in items] for items in [self._lc_comb_created,self._comp_comb_created,self._manual_created, self._info_created]] self._lc_comb_created, self._comp_comb_created, self._manual_created, self._info_created= [], [], [], [] if self._line_to_struc[self._active_line][0].get_structure_type() == '': self._info_crea...
import numpy as np from random import shuffle import multiprocessing as mp import itertools from astrodash.helpers import temp_list, div0 from astrodash.sn_processing import PreProcessing from astrodash.combine_sn_and_host import training_template_data from astrodash.preprocessing import ProcessingTools from astrodash...
'svn:needs-lock' set ## wc->wc copied file svntest.main.run_svn(None, 'copy', mu_path, mu2_path) is_writable(mu2_path) sbox.simple_commit('A/mu2') is_readonly(mu2_path) ## URL->wc copied file svntest.main.run_svn(None, 'copy', mu_URL, mu3_path) is_writable(mu3_path) sbox.simple_commit('A/mu3') is_readonly(m...
32, 3) assert np.allclose(observed.arr_0to1, expected) def test_segmaps__pad_mode_should_be_ignored(self): # basic segmaps test # pad_mode should be ignored for segmaps aug = iaa.PadToFixedSize( height=3, width=3, pad_mode="edge", position="center") segmaps_arr = np.ones((1, 1, 1), dtype=np.int32) segmaps = Se...
Optional[Dict[Text, Any]] = None, ignore_action_unlikely_intent: bool = False, ) -> List[List[Dict[Text, List[Features]]]]: """Creates state features for prediction. Args: trackers: A list of state trackers domain: The domain precomputations: Contains precomputed features and attributes. use_text_for_last_user...
. You can't create a new ``SettingId`` , but you can overwrite the default value if you have the ``ssm:UpdateServiceSetting`` permission for the setting. Use the UpdateServiceSetting API action to change the default setting. Or use the ResetServiceSetting to change the value back to the original value defined by the AW...
# Copyright 2022 The jax3d Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] if NrScenario == "6400c": if nrtimebucketstochastic == 3: stochasticparttreestructure = [20, 20, 16] if nrtimebucketstochastic == 4: stochasticparttreestructure = [10, 10, 8, 8] if nrtimebucketstochastic == 5: stochasticparttreestructure = [10, 10, 8, 8, 1] if nrtimebucke...
import torch from torch import nn from torch.nn import functional as F from torch.nn import init as nninit from torchvision.transforms import Resize, Grayscale _ARCH_REGISTRY = {} def architecture(name, sample_shape): """ Decorator to register an architecture; Use like so: >>> @architecture('my_architecture', ...
#!/usr/bin/env python """ Represent connectivity pattern using pandas DataFrame. """ from collections import OrderedDict import itertools import re from future.utils import iteritems from past.builtins import basestring import networkx as nx import numpy as np import pandas as pd from .plsel import Selector, Select...
1, f"Pearson:{pearson:0.3f} r^2:{r2:0.3f} R^2:{big_r2:0.3f}", verticalalignment="bottom", transform=axes[row, col].transAxes, ) row += 1 if row == rows: row = 0 col += 1 if col >= cols: break figure_path = os.path.join(plot_path, f"scatters_together_{data_split}{image_ext}") if not os.path.exists(os.path....
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import shutil import queue import threading import subprocess import datetime import time import codecs #print(os.path.dirname(__file__)) #print(os.path.basename(__file__)) #print(sys.version_info) qApiCV = 'google' qApiOCR = qApiCV qApiTrn = qAp...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Implementation of elliptic curves, for cryptographic applications. # # This module doesn't provide any way to choose a random elliptic # curve, nor to verify that an elliptic curve was chosen randomly, # because one can simply use NIST's standard curves. # # Notes from...
be defined """ return pulumi.get(self, "optional") def _translate_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop @pulumi.output_type class SeldonDeploymentSpecPredictorsExplainerContainerSpecEnvFromSecretRef(dict): """ The Secret to select from """ def __init__(__self__, *, ...