input
stringlengths
2.65k
237k
output
stringclasses
1 value
# Copyright 2014 Cloudbase Solutions Srl # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
pkt, addr = netc.recvfrom(2048) idx = addr[-1] i = len(pkt) if i < 64: continue rqv = memoryview(pkt) rq = bytearray(rqv[:2]) if rq[0] in (1, 3): # dhcpv6 solicit process_dhcp6req(handler, rqv, addr, netc, cfg, nodeguess) except Exception as e: tracelog.log(traceback.format_exc(), ltype=log.DataTypes.event, ...
<reponame>lento234/pyJHTDB<gh_stars>0 ######################################################################## # # Copyright 2014 Johns Hopkins University # # 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...
i], (self.B, 1))) denom = np.tile(denom, (1, 1+self.B)) gradient += delta/denom gradient -= Delta # gradient -= 1. # Prior return gradient[0] if len(gradient) == 1 else gradient def loglik_hess(self, gamma, xi): """ Compute the Hessian matrix evaluated at gamma, xi. """ if not self.suff_stats_cached: sel...
index in range(len(structure)): i = structure[index] rotation = 0 if (i[0] in (3,7,9,11,13)): rotation = 90 f.write('<Block type="%s" material="wood" x="%s" y="%s" rotation="%s" />\n' % (block_names[str(i[0])], str(i[1]), str(i[2]), str(rotation))) for index in range(len(others)): i = others[index] rotation = ...
""" Copyright (c) Microsoft Corporation. Licensed under the MIT license. VCR dataset """ import copy import json import torch from torch.nn.utils.rnn import pad_sequence from toolz.sandbox import unzip from cytoolz import concat from .data import (DetectFeatTxtTokDataset, TxtTokLmdb, DetectFeatLmdb, TxtLmdb, get_ids_...
-4] harmed -2.1 0.83066 [-1, -4, -2, -2, -2, -2, -1, -2, -3, -2] harmfully -2.6 0.91652 [-3, -4, -3, -1, -3, -3, -3, -3, -1, -2] harmfulness -2.6 0.8 [-3, -1, -3, -3, -3, -2, -4, -2, -2, -3] harming -2.6 0.66332 [-3, -3, -2, -2, -3, -3, -2, -2, -2, -4] harmless 1.0 0.7746 [2, 1, 1, 1, 1, 0, 0, 2, 0, 2] harmlessly 1.4 1...
import tensorflow as tf from . import custom_layers class Discriminator(object): """Discriminator that takes image input and outputs logits. Attributes: name: str, name of `Discriminator`. kernel_regularizer: `l1_l2_regularizer` object, regularizar for kernel variables. bias_regularizer: `l1_l2_regularizer` o...
purpose, it does not exist in bytes @staticmethod def process(data, process_kwargs=None): """ Adapted from: https://github.com/OSGeo/gdal/blob/2.0/gdal/apps/gdaldem.cpp#L481 Edges are not implemented, result clips one pixel from array. """ if process_kwargs is None: return data array = data["values"].copy(...
0.00435488, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.356445, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic':...
self.state = 408 self._errHandler.sync(self) _la = self._input.LA(1) while _la==visualgParser.VIRGULA: self.state = 401 self.match(visualgParser.VIRGULA) self.state = 404 self._errHandler.sync(self) token = self._input.LA(1) if token in [visualgParser.MATRIZ, visualgParser.INTEIRO, visualgParser.REAL, visualgP...
<reponame>idevopscloud/python-kubernetes<gh_stars>0 #!/usr/bin/env python # # Copyright 2014 tigmi # # 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...
ratio of the disk polling time to memory polling time. disk_to_memory_ratio = int(repy_constants.DISK_POLLING_HDD / memory_check_interval) # Which cycle number we're on counter = 0 # Elevate our priority, above normal is higher than the usercode, and is enough for disk/mem windows_api.set_current_thread_prior...
<filename>python/opscore/RO/TkUtil.py #!/usr/bin/env python """Tkinter utilities History: 2004-10-08 ROwen 2004-10-12 ROwen Modified getWindowingSystem to handle versions of Tk < ~8.4 2005-06-17 ROwen Added getButtonNumbers. 2005-07-07 ROwen Added TclFunc 2005-08-24 ROwen Expanded the docstring for TclFunc and made t...
labels[i].name + ' - The columns: ' + el + 'is missing. The columns allowed are: label, usecase.' return message if len(list_db_col) != len(cols): message = 'LABELS FILE - ' + labels[i].name + ' - The columns allowed are: label, usecase. If you inserted more (less) columns please, remove (add) them.' return messag...
0.0, px_amt) return True def kp_pan_px_center(self, viewer, event, data_x, data_y, msg=True): """This pans so that the cursor is over the center of the current pixel.""" if not self.canpan: return False self.pan_center_px(viewer) return True def kp_center(self, viewer, event, data_x, data_y): if self.canpan...
from pandac.PandaModules import loadPrcFileData loadPrcFileData('', 'win-size 640 480') # Window size loadPrcFileData('', 'win-fixed-size #t') # Window is a fixed size loadPrcFileData('', 'textures-auto-power-2 1') loadPrcFileData('', 'textures-power-2 up') loadPrcFileData('', 'load-file-type p3assimp') from direct.sh...
<reponame>Dusk-Argentum/TomeSeeker-BETA<filename>bot.py """ Written by @zhu.exe#4211 (187421759484592128). """ import asyncio import os import aiohttp from discord.ext import commands from discord.ext.commands import CommandInvokeError from funcs import * OWNER_ID = "97153790897045504" PREFIX = "," # This is the pr...
self.fit_history['score'].append(score) self.fit_history['dep_params'].append( self.cov_struct.dep_params) # Don't exit until the association parameters have been # updated at least once. if del_params < ctol and num_assoc_updates > 0: break if self._do_cov_update and (itr % params_niter) == 0\ and (itr >= fi...
asn_descriptions.description, ' 'asn_assignments.start_hex, asn_assignments.next_start_hex ' 'FROM asn_descriptions JOIN asn_assignments ON ' 'asn_assignments.as_num = asn_descriptions.as_num ' 'WHERE num_type = ? AND start_hex >= ? AND next_start_hex <= ?') self.cursor.execute(sql, (num_type, lookup_start_hex, lo...
data['buff']['3']['second_shell'], second_img='./base/other/etc_2.png', third_img='./base/other/etc_3.png', cutoff=8) # click back to mission board # open daily mission board self.make_sure_loaded('./base/other/daily.png', device, data['daily']['dms'], data['daily']['second_shell'], cutoff=8, shell_first=True, slee...
''' TIEGCM Kamodo reader, adapted to new structure for satellite flythrough software Initial version - <NAME> (?) Initial version of model_varnames contributed by <NAME> New code: <NAME> (June 2021 and on) NOTE: The current logic for variables that depend on imlev slices off self._imlev coordinate This only works bec...
None, 4, None, None, "StorageQuotaLimit"), 0x3ff6: (0x0003, None, None, 4, None, None, "ExcessStorageUsed"), 0x3ff7: (0x001f, None, None, 4, None, None, "SvrGeneratingQuotaMsg"), 0x3fc2: (0x000b, None, None, 4, None, None, "PrimaryMbxOverQuota"), 0x65c6: (0x0003, None, None, 4, None, None, "SecureSubmitFlags"), 0x...
'loss {:5.2f} | ppl {:8.2f}' .format(model_id, epoch, internal_epoch, batch,train_data.size(0) // helper.params['bptt'], helper.params['lr'], elapsed * 1000 / helper.params['log_interval'], cur_loss, math.exp(cur_loss) if cur_loss < 30 else -1.)) total_loss = 0 start_time = time.time() # logger.info(f'model {m...
the normalized representations of the given embeddings. :returns: normalized :raises: :py:exc:`ValueError` if :math:`mean\left(\frac{n_j}{|n_j|}\right)` of the scaled normal vectors :math:`n_j` is 0 """ # Value checks: # Check embeddings length cls._validate_embedding_list(embeddings) # Get normalized versio...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
<gh_stars>10-100 #!/usr/bin/env python from themis.utils import isvalidtype from themis import ( FEATURES_CUSTOM_CALLBACK, METADATA_CUSTOM_CALLBACK, Features, ThemisMetaData, AI, Policy, RateLimiter ) from traceback import format_exc from netaddr import IPNetwork, IPAddress from datetime import datetime, timed...
'Zn1nuBos3cdJLNAxpbEYYvaDH187eW01': 'No ba, nie widzę specjalnej różnicy, z napojem czy bez.', 'fB3TcaVCh61x8X6a4TVAtRzWK9VHgJIR': 'Obeliks?', 'yR0P3o5c7TrdCpzBE5JpmFuEMdfMhSKu': 'Panoramiks?', '6SaT6C5Qnff5ZkXkxWtexrf6mFpCElQc': 'Taak?', 'FPMj95dYFbe9l9ElZdYru5nRDJgduwpm': 'Panoramiks?', 'pFJR67zhzmwlVZFSqDLUYls...
<filename>babelscan/hdf.py """ Subclass data holder for .hdf and .nxs files """ import os import re import datetime import numpy as np import h5py from . import functions as fn from .babelscan import Scan from .volume import ImageVolume, DatasetVolume "----------------------------LOAD FUNCTIONS---------------------...
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.forms.models import model_to_dict from appconf.models import Project, Product, Supply import ast import enum import datetime ASSET_STATUS = ( (-3, u"库存"), (-2, u"待确认"), (-1, u"离线"), (1,...
# SPDX-License-Identifier: Apache-2.0 # -*- coding: utf-8 -*- """ Code used to update legacy files for naming / organization Material Names old: {asset_name}_Mat new: {texture_name} """ import bpy import os from pathlib import Path import xrs.log import xrs.convert import xrs.collection import xrs.filename import xrs.o...
<reponame>ClementJ18/ModDB import re import bs4 import sys import datetime import requests from ..utils import ( BASE_URL, concat_docs, get_date, get_page, raise_for_status, join, get_views, prepare_request, ) from .base import BaseMetaClass from ..enums import FileCategory, AddonCategory, ThumbnailType, Media...
"""The tests for Z-Wave JS device actions.""" from unittest.mock import patch import pytest import voluptuous_serialize from zwave_js_server.client import Client from zwave_js_server.const import CommandClass from zwave_js_server.model.node import Node from homeassistant.components import automation from homeassistan...
# -*- coding: utf-8 -*- """Chemical Engineering Design Library (ChEDL). Utilities for process modeling. Copyright (C) 2016, 2017, 2018, 2019, 2020 <NAME> <<EMAIL>> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal ...
h1 qc = -area_from_left x = (-qb + (qb ** 2 - 4 * qa * qc) ** 0.5) / (2 * qa) cuts.append(x1 + x) if len(cuts) == npieces - 1: return cuts segment_remaining -= needed needed = size needed -= segment_remaining return areas def func_b47aad6298b542cbb925e3c9067dde17(npieces, upper, lower): li = ui = 0 areas =...
reverse zone."]) # zone discovery failures assert_failed_change_in_error_response(response[3], input_name=f"no.subzone.{parent_zone_name}", record_type="AAAA", record_data="fc00:db20:35b:7399::5", error_messages=[f'Zone Discovery Failed: zone for \"no.subzone.{parent_zone_name}\" does not exist in VinylDNS. ' f'I...
from __future__ import absolute_import from __future__ import unicode_literals from corehq.apps.tzmigration.timezonemigration import is_datetime_string, FormJsonDiff, json_diff PARTIAL_DIFFS = { 'XFormInstance*': [ {'path': ('_rev',)}, # couch only {'path': ('migrating_blobs_from_couch',)}, # couch only {'path': (...
<reponame>mdkrol/dask-geomodeling """ Module containing raster blocks that combine rasters. """ import itertools from datetime import timedelta as Timedelta import numpy as np from dask_geomodeling.utils import get_dtype_max, get_index, GeoTransform from .base import RasterBlock __all__ = ["Group"] def filter_none...
import struct from .base import STATUSCODES from .state import State from .utils import parse_number from .base import connection_timeout class BaseCommand: """ Represents one command. A command needs a prefix and `command` (meaning the second byte to identify the command). The `command_dict` is the configuration...
# 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 from . import ...
<filename>hddcoin/cmds/wallet_funcs.py<gh_stars>1-10 import asyncio import sys import time from datetime import datetime from decimal import Decimal from typing import Callable, List, Optional, Tuple, Dict import aiohttp from hddcoin.cmds.units import units from hddcoin.rpc.wallet_rpc_client import WalletRpcClient fr...
"""AWS Higher Level Abstractions This module contains higher-level AWS abstractions to make working with AWS instances and collections of instances easier and less error-prone. :class:`EC2Instance` is responsible for maintaining information about itself and updating its state when asked to. The executer passed in mus...
{"inbytes": 0, "outbytes": 0}, 17: {"inbytes": 8, "outbytes": 0, "buffers": [9]}, }, 'nn::sf::hipc::detail::IHipcManager': { 0: {"inbytes": 0, "outbytes": 4}, 1: {"inbytes": 4, "outbytes": 0, "outhandles": [2]}, 2: {"inbytes": 0, "outbytes": 0, "outhandles": [2]}, 3: {"inbytes": 0, "outbytes": 2}, 4: {"inbytes"...
<filename>lib/googlecloudsdk/command_lib/util/concepts/info_holders.py # -*- coding: utf-8 -*- # # Copyright 2018 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...
<gh_stars>100-1000 import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import tensorflow as tf2 import pickle, time, os import numpy as np class BasicModel: def __init__(self): self.tf_session = None self.deserializing_var_placeholder = {} self.deserializing_assign_op = [] def serializing_with_session...
""" Module: softacq.py Description: Interface for the software device acquisition emulation Copyright (c) 2010 JDSU. All rights reserved. $Log: softacq.py $ Revision 83 2013/03/28 00:55:13 +0800 phi58351 /MassTransit/MT1.20.100_Tip/NickReviewed/PendingReview/instrument_list Fixed issue with thread never stopping fo...
<reponame>HyeonseoJUNG/DB2_TermPJT # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'recommand_page2.ui' # # Created by: PyQt5 UI code generator 5.15.6 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you a...
from parse import Lexer, Parser, Token, State, NFA, Handler, HandlerTree, NFATreeNode from random import randrange import numpy as np from functools import reduce import os import re bio_graph = "alibaba.graph.txt" samplegraph = "papergraph.txt" sampleq = "testqueriespaper.txt" sampleMS = "testMSqueries.txt" randomque...
""" Author: <NAME> Modified from https://github.com/gurkirt/realtime-action-detection Licensed under The MIT License [see LICENSE for details] """ import os import torch import torch.nn as nn import torch.optim as optim import torch.nn.init as init import argparse from torch.autograd import Variable import torch.u...
dialog.SetAutoLayout()') def mock_setsize(self, *args): print('called dialog.SetSize()') def mock_Layout(self, *args): print('called dialog.Layout()') def mock_create_actions(self, *args): print('called dialog.create_actions()') mockbase = types.SimpleNamespace(app_title='title', opts={'Keywords': ['x', 'y']}) ...
= 4 #************************# #----------------------------------------------------------------------------------- #----------------------------------------------------------------------------------- # # ERROR_MESSAGE = "" try: project = FormProject.objects.get(pk=kwargs['project_pk']) formtype = FormTy...
[], None code = item[2][:4] for entry in Sandhi_Convt.antas: if code[0] == entry[0]: krdDetail.anta = AmaraKosha_Database_Queries.iscii_unicode(entry[2] + '³ÚÏÚÆè£', requested_script) break # print('krdGener Sufcode: qry %s code %s'%(qry,code)) cols, dataSufcode = AmaraKosha_Database_Queries.sqlQuery(qry, code,...
<filename>py2df/utils.py import json import typing import collections import nbtlib as nbt from array import array if typing.TYPE_CHECKING: # avoid cyclic import from .typings import Numeric Docable = typing.Union[typing.Callable, type] IterOrSingleDocable = typing.Union[Docable, typing.Iterable[Docable]] def remo...
its output. It compute mentions scores. Args: mention_emb: tf.float64, [num_mentions, emb], a tensor that contains of embeddings of specific mentions Returns: [num_mentions, 1] Output of the fully-connected network, that compute the mentions scores. """ with tf.variable_scope("mention_scores"): return utils.ff...
<filename>src/ama/validator.py<gh_stars>1-10 # Copyright 2013-2014, <NAME>, <EMAIL> # pylint: disable=unused-argument """Provides access to a registry of validation functions. Functions are returned via the :func:`get_validator` function and can be refined by passing a specification which alters what passes the valid...
# -*- coding: utf-8 -*- # Copyright (c) 2004-2015 Alterra, Wageningen-UR # <NAME> (<EMAIL>), Juli 2015 # from __future__ import print_function """Implementation of AgroManager and related classes for agromanagement actions in PCSE. Available classes: * CropCalendar: A class for handling cropping calendars * TimedEv...
is None: self.method = [] else: self.method = method self.baseMethod = baseMethod def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PayWidget) if subclass is not None: return subclass(*args_, **kwargs_) if PayWidget.subclass: re...
<gh_stars>1-10 # -*- coding: utf-8-*- # Encoding cookie added by Mu Editor """Board -- an n-dimensional board with support for iteration, containership and slicing Boards can have any number of dimensions, any of which can be infinite. Boards can be sliced [:1, :2], returning a linked-copy, or copied (.copy), re...
<filename>source/py4dlib/objects.py # -*- coding: utf-8 -*- # # objects.py # py4dlib # # Created by <NAME> on 2012-09-26. # Copyright 2012 Berg Media. All rights reserved. # # <EMAIL> # # pylint: disable-msg=F0401 '''py4dlib.objects -- components for working with CINEMA 4D's objects.''' import os import re __vers...
for i in ts] mm = 3 out = [] feature_list.extend(['SampleEn_'+str(i) for i in range(mm + 1)]) if len(ts) >= (mm+1)*2: res = sampen2(ts, mm=mm, normalize=True) for ii in res: if ii[1] is None: out.append(100) else: out.append(ii[1]) return out else: return [0] * (mm + 1) def CDF(ts): ''' analysis of ...
) : Ooooo00 = lisp_db_for_lookups . lookup_cache ( map_request . target_eid , False ) else : Ooooo00 = lisp_db_for_lookups . lookup_cache ( map_request . target_group , False ) if ( Ooooo00 ) : Ooooo00 = Ooooo00 . lookup_source_cache ( map_request . target_eid , False ) if 91 - 91: OoOoOO00 + OoOoOO00 I11i11i1 = ...
<reponame>robertmacdavid/up4-abstract<gh_stars>1-10 # Copyright 2020-2021 Open Networking Foundation # Copyright 2021-present Princeton University # # 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...
<gh_stars>1-10 """Rules for describing impingement. Impingement is when something obstructs a region or a clear line of sight between two points. For example, suppose we have two entities that we think are a label/value pair. We may ask that the space between them be unimpinged, meaning that there are no other entitie...
#!/usr/bin/python # postProcessVels.py # Author: <NAME> # All rights reserved def postProcessVels(east_vels_list_path, ice_gmt_path, rock_gmt_path, dem_grd_path): import datetime; import os; import re; import subprocess; import sys; sys.path.append("/data/akm/Python"); from season import *; assert os.pa...
Value is scaled with factor 10: NOx Index = value / 10 *Note: If this value is unknown, 0x7FFF is returned. During the first 10..11 seconds after power-on or device reset, this value will be 0x7FFF as well.* :rtype: tuple :raise ~sensirion_i2c_driver.errors.I2cChecksumError: If a received CRC was wrong. """ # ...
<gh_stars>0 import logging import os import random from PIL import Image, ImageDraw import PIL import PIL.ImageFont import PIL.ImageColor from pdfminer.converter import PDFPageAggregator from pdfminer.layout import LAParams from pdfminer.layout import LTTextBoxHorizontal from pdfminer.layout import LTRect, LTChar fro...
<gh_stars>1-10 r""" Contains two main base classes (for naming and sub/superSys) and their helper classes, functions, decorators. .. currentmodule:: quanguru.classes.base .. autosummary:: named qBase .. autosummary:: aliasClass keySearch aliasDict .. autosummary:: _auxiliaryClass _recurseIfList addDeco...
no candidate found. The image cutout will be taken from this central area and so the "Image" tab will still have content. It will also be marked with a central red "X". The contour plot will still be produced from the cutout. .. figure:: figures/pick-contour-no-candidate.png :width: 400px :align: center :alt: Con...
in channels])[sel] digital_min = np.array([float(fid.read(8).decode()) for ch in channels])[sel] digital_max = np.array([float(fid.read(8).decode()) for ch in channels])[sel] prefiltering = [fid.read(80).decode().strip(' \x00') for ch in channels][:-1] highpass = np.ravel([re.findall(r'HP:\s+(\w+)', filt) for f...
maximum number of bytes to read :return: The string read. """ if self._from_ssl is None: raise TypeError("Connection sock was not None") if not isinstance(bufsiz, int): raise TypeError("bufsiz must be an integer") buf = _no_zero_allocator("char[]", bufsiz) result = _lib.BIO_read(self._from_ssl, buf, bufsiz) ...
return self._columns def _get_attrs_simple(self): return ['title'] def _get_attrs_complex_list(self): return ['columns'] def get_column_by_id(self, id_): for col in self.columns: if col.id == id_: return col return None def add_column(self, column): """ Add a column to the table :param column: (Colu...
""" This is a python client implementation of the STOMP protocol. It aims to be transport layer neutral. This module provides functions to create and parse STOMP messages in a programmatic fashion. The examples package contains two examples using twisted as the transport framework. Other frameworks can be used and I ...
<gh_stars>0 # # Copyright (C) EMC Corporation. All rights reserved. # # Module Name: # # create_dir_open_additional.py # # Abstract: # # Directory open tests: Directories which are created on the share have to be deleted before test execution otherwise # it will result in STATUS_OBJECT_NAME_COLLISION. # # A...
return sage_aven, sage_aven, @card("Syphon Mind") def syphon_mind(card, abilities): def syphon_mind(): return AbilityNotImplemented return syphon_mind, @card("Mistform Mutant") def mistform_mutant(card, abilities): def mistform_mutant(): return AbilityNotImplemented return mistform_mutant, @card("Gravel...
params['booking_id'] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_p...
# PEDA - Python Exploit Development Assistance for GDB # # Copyright (C) 2012 <NAME> <longld at vnsecurity.net> # # License: see LICENSE file for details # from __future__ import absolute_import from __future__ import division from __future__ import print_function import re import os import sys import shlex import st...
name is not None and value is not None: named_values[name] = value return named_values def _load_line(self, line: str) -> Tuple[str, str]: """Attempts to split the name and value for dictionary loading. Args: line: a record in a .value file Returns: The name/value pair that will be loaded into a dictionary. ...
import numpy as np from .. import util from ..element import Element from ..ndmapping import NdMapping, item_check, sorted_context from .dictionary import DictInterface from .interface import Interface, DataError class MultiInterface(Interface): """ MultiInterface allows wrapping around a list of tabular datasets ...
Cross-Lingual Transfer and Beyond}, author={<NAME> and <NAME>,}, journal={arXiv:1812.10464v2}, year={2018} }""" ), "bucc18": textwrap.dedent(""""""), "udpos": textwrap.dedent(""""""), "SQuAD": textwrap.dedent( """\ @article{2016arXiv160605250R, author = {{Rajpurkar}, Pranav and {Zhang}, Jian and {Lopyrev}, ...
<gh_stars>0 # -*- coding: utf-8 -*- """ (c) 2014-2016 - Copyright Red Hat Inc Authors: <NAME> <<EMAIL>> """ # pylint: disable=too-few-public-methods # pylint: disable=no-init # pylint: disable=super-on-old-class from __future__ import unicode_literals, absolute_import import datetime import re import flask im...
<gh_stars>1-10 #!/usr/bin/env python """ @package ion_functions.data.ph_functions @file ion_functions/data/ph_functions.py @author <NAME> @brief Module containing pH family instrument related functions """ # imports import numpy as np import numexpr as ne import scipy as sp # functions to extract L0 parameters from ...
* cos(q2) * N.y + sin(q2) * N.z ) assert express(B.z, N) == ( sin(q1) * sin(q2) * N.x - sin(q2) * cos(q1) * N.y + cos(q2) * N.z ) assert express(B.x, A) == A.x assert express(B.y, A) == (cos(q2) * A.y + sin(q2) * A.z) assert express(B.z, A) == (-sin(q2) * A.y + cos(q2) * A.z) assert express(B.x, B) == B.x asse...
None self.resourceUuid = None self.session = None self.timeout = None self.systemTags = OptionalList() self.userTags = OptionalList() APIDELETEALIYUNSNAPSHOTFROMLOCALMSG_FULL_NAME = 'org.zstack.header.aliyun.storage.snapshot.APIDeleteAliyunSnapshotFromLocalMsg' class APIDeleteAliyunSnapshotFromLocalMsg(object): ...
Juai" def __unicode__(self): return "%s" % (self.id_atl) class SKPDAsalATLDisdikSMPN1Juai(SKPDAsalATL): class Meta: proxy = True verbose_name = "07 SKPD Asal ATL Disdik SMPN 1 Juai" verbose_name_plural = "07 SKPD Asal ATL Disdik SMPN 1 Juai" def __unicode__(self): return "%s" % (self.id) class FotoATLDi...
= redoTimeoutMax or self.RedoTimeoutMax self.redoTimeoutMin = redoTimeoutMin or self.RedoTimeoutMin self.redoTimer = StoreTimer(self.stack.store, duration=self.redoTimeoutMin) self.burst = max(0, int(burst)) # BurstSize self.misseds = oset() # ordered set of currently missed segments self.acked = False # Have re...
""" Transformer model helper methods """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import os import re import string import unicodedata import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim _NEG_INF = -1e9 d...
""" Define the actor process for exploration of the environment in reinforcement learning. """ import json import os from copy import deepcopy from time import time from collections import namedtuple import logging import numpy as np # pylint: disable=not-callable import torch from torch.utils.tensorboard import Summa...
b = bias.broadcast(y.shape, [0,2,3]) y = y + b return y else: N,C,H,W = x.shape Kh, Kw = weight.shape[-2:] G = groups CpG = C // G # channels per group oc = out_channels oh = (H+padding[0]*2-Kh*dilation[0]+dilation[0]-1)//stride[0]+1 ow = (W+padding[1]*2-Kw*dilation[1]+dilation[1]-1)//stride[1]+1 xx = x.rein...
import math import numpy as np import tensorflow as tf from tensorflow.keras import layers as tfkl from tensorflow_probability import distributions as tfd from tensorflow.keras.mixed_precision import experimental as prec import common class RSSM(common.Module): def __init__( self, stoch=30, deter=200, hidden=200,...
#!/usr/bin/python # coding=utf-8 # 公众号:testerzhang __author__ = 'testerzhang' import os import time import traceback from appium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.common.exceptions import NoSuchElementException, TimeoutEx...
# working again. self.client_communicator.LoadServerCertificate( server_certificate=server_certificate, ca_certificate=config.CONFIG["CA.certificate"]) self.assertLen(list(self.ClientServerCommunicate()), 10) class HTTPClientTests(client_action_test_lib.WithAllClientActionsMixin, test_lib.GRRBaseTest): """Test...
<reponame>Gael-de-Sailly/flopy<filename>flopy/mf6/modflow/mfgwfmaw.py # DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY # mf6/utils/createpackages.py # FILE created on March 19, 2021 03:08:37 UTC from .. import mfpackage from ..data.mfdatautil import ListTemplateGenerator class ModflowGwfmaw(mfpackage....
it is known updating a ``Catalog`` will result in a ``PermissionDenied``. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users. :return: ``false`` if ``Catalog`` modification is not authorized, ``true`` otherwise :rtype: ``boolean`` *compliance: mandat...
# -*- coding: latin-1 -*- # ----------------------------------------------------------------------------- # Copyright 2014, 2017 <NAME> <<EMAIL>> # # Licensed under the EUPL, Version 1.1 or - as soon they # will be approved by the European Commission - subsequent # versions of the EUPL (the "Licence"); # You may not us...
<filename>xoa_driver/internals/core/commands/pr_commands.py #: L23 Port RX Statistics Commands from dataclasses import dataclass import typing from ..protocol.command_builders import ( build_get_request, build_set_request ) from .. import interfaces from ..transporter.token import Token from ..protocol.fields.data_...
height=59, bordermode='ignore') self.mult_strike_scale.configure(activebackground="#86bad8") self.mult_strike_scale.configure(background="#86bad8") self.mult_strike_scale.configure(font="TkTextFont") self.mult_strike_scale.configure(foreground="#000000") self.mult_strike_scale.configure(highlightbackground="#...
no conversion is possible, an exception will be raised. """ if (value not in State.values): if (not convert): raise ValueError ("{0} is not valid for State.".format (value)) if (value.upper () in {"UP", "ON", "PRESENT", "ENABLED", "OK", "POWER LIMIT ACTIVE"}): value = "Enabled" elif (value.upper () in {"DOWN...
# 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 from . import ...
[1]*(num_blocks-1) layers = nn.ModuleList() shortcuts = nn.ModuleList() cur_fig_size = int(fm * fm / self.down_rate) rnn_input_size = block.expansion * planes * cur_fig_size rnn_memory_size = int(self.args.rnn_ratio * block.expansion * planes * cur_fig_size) if self.memory_type == 'rnn': rnn = torch.nn.RNNCell(r...
self.read_row_group_file(rg, columns, categories, index, assign=views) yield df def _get_index(self, index=None): if index is None: index = [i for i in self.pandas_metadata.get('index_columns', []) if isinstance(i, str)] if isinstance(index, str): index = [index] return index def to_pandas(self, columns=Non...