input
stringlengths
2.65k
237k
output
stringclasses
1 value
s=2, label='pathogenic missense (ClinVar)') plt.scatter(lof_clin_var_poses, lof_pathogenic_ys, color=COLOR_PALETTE['V'], s=2, label='pathogenic stop gained, frameshift (ClinVar)') create_legend = False else: plt.scatter(control_missense, control_ys, color=COLOR_PALETTE['B'], s=2) plt.scatter(miss_clin_var...
# load the grain map if available if use_dct_path: grain_map_path = os.path.join(data_dir, '5_reconstruction', vol_file) else: grain_map_path = os.path.join(data_dir, vol_file) if os.path.exists(grain_map_path): with h5py.File(grain_map_path, 'r') as f: # because how matlab writes the data, we need to swap X an...
2.63141], [1562500, 2, 0, 8, 0, 2.898], [1568000, 8, 0, 3, 2, 2.24168], [1572864, 19, 1, 0, 0, 2.00201], [1574640, 4, 9, 1, 0, 2.48954], [1575000, 3, 2, 5, 1, 2.846], [1580544, 9, 2, 0, 3, 2.65], [1587600, 4, 4, 2, 2, 2.40683], [1594323, 0, 13, 0, 0, 20.2312], [1600000, 9, 0, 5, 0, 2.39023], [1605632, 15, 0, 0, 2, 1.95...
# # Random snippet # { 'CGC_SENSOR_RELATED': 0x00, 'CGC_AIR_CONDITIONER_RELATED': 0x01, 'CGC_HOUSING_RELATED': 0x02, 'CGC_COOKING_RELATED': 0x03, 'CGC_HEALTH_RELATED': 0x04, 'CGC_MANAGEMENT_RELATED': 0x05, 'CGC_AV_RELATED': 0x06, 'CGC_PROFILE_CLASS': 0x0E, 'CGC_USER_DEFINITION_CLASS': 0x0F, } CGC_SENSOR_RELA...
element_only_enabled_disabled = False explicit_enable_disable_value_setting = True if _checkValueItemParent( policy_element=admx_policy, policy_name=this_policy_name, policy_key=this_key, policy_valueName=this_value_name, xpath_object=DISABLED_VALUE_XPATH, policy_file_data=policy_file_data, ): log.trace( "%s...
<filename>pset9/finance/application.py<gh_stars>0 import os from cs50 import SQL from flask import Flask, flash, redirect, render_template, request, session from flask_session import Session from tempfile import mkdtemp from werkzeug.exceptions import default_exceptions, HTTPException, InternalServerError from werkzeu...
<reponame>seifer08ms/docker-xx-net # -*- coding: utf-8 -*- """ hyper/http20/connection ~~~~~~~~~~~~~~~~~~~~~~~ Objects that build hyper's connection-level HTTP/2 abstraction. """ from ..tls import wrap_socket, H2_NPN_PROTOCOLS, H2C_PROTOCOL from ..common.exceptions import ConnectionResetError from ..common.bufsocket i...
# Copyright (c) 2009, 2010, 2011 Google Inc. All rights reserved. # Copyright (c) 2009 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain t...
# schedule dates don't make sense, and should be set to execution date for # consistency with how execution_date is set for manually triggered tasks, i.e. # triggered_date == execution_date. if dag_run and dag_run.external_trigger: prev_execution_date = self.execution_date next_execution_date = self.execution_date...
<reponame>sedlakovi/mafTools ################################################## # Copyright (C) 2013 by # <NAME> (<EMAIL>, <EMAIL>) # ... and other members of the Reconstruction Team of <NAME>'s # lab (BME Dept. UCSC). # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this softwar...
= task_df.apply(compute_surprise_bits, axis=1) if len(surprise_series) == 0: surprise_series[(task_group_models[0].group_def,)] = [numpy.NaN] * len(task_df) return pandas.DataFrame(surprise_series) def impute_missing_cols(features_df, value=0.0): features_df = features_df.copy() for col in features_df: if fea...
bins, where each marginal bin contains the same number of samples. Then the marginal entropies have equal probable distributions H_x = H_y = log(bins) The calculation ranges are shown below:: (-------------------------total_time--------------------------) (---tau_max---)(---------corr_range------------)(---tau_m...
'''Chats. ''' from utils import * from user import * from errors import ISkypeError class IChat(Cached): '''Represents a Skype chat. ''' def __repr__(self): return '<%s with Name=%s>' % (Cached.__repr__(self)[1:-1], repr(self.Name)) def _Alter(self, AlterName, Args=None): return self._Skype._Alter('CHAT', se...
is None: ec2 = module.client('ec2') spec = dict( ClientToken=uuid.uuid4().hex, MaxCount=1, MinCount=1, ) # network parameters spec['NetworkInterfaces'] = build_network_spec(params, ec2) spec['BlockDeviceMappings'] = build_volume_spec(params) spec.update(**build_top_level_options(params)) spec['TagSpecificat...
neighbors {neighbor}', 'show ip bgp {address_family} all neighbors', 'show ip bgp {address_family} all neighbors {neighbor}', ] exclude = ['current_time', 'last_read', 'last_write', 'up_time', 'ackhold' , 'retrans', 'keepalives', 'total', 'total_data', 'value', 'with_data', 'delrcvwnd', 'rcvnxt', 'rcvwnd', 'rece...
""" =========== classify.py =========== This module contains functionality for classifying nanopore captures. """ import os import re from abc import ABC, abstractmethod from dataclasses import dataclass from pathlib import PosixPath from typing import * # I know people don't like import *, but I think it has benefit...
getCurrentSBML(aHandle = None): if aHandle is None: aHandle = gHandle return rrLib.getCurrentSBML(aHandle) ##\brief Retrieve the last SBML model that was loaded #\return Returns False if it fails or no model is loaded, otherwise returns the SBML string def getSBML(aHandle = None): if aHandle is None: aHandle = gH...
# by <EMAIL> at Thu Nov 28 22:09:47 CET 2019 """GPG-compatible symmetric key encryption and decryption code. Imports PyCrypto.Cipher._* or tinygpgs.cipher lazily. Imports hashlib or tinygpgs.hash lazily. """ import binascii import struct from tinygpgs.pyx import iteritems, buffer, binary_type, xrange, to_hex_str, ...
from operator import attrgetter import numpy as np from neupy.utils import format_data from neupy.exceptions import StopTraining from neupy.algorithms.base import BaseNetwork from neupy.core.properties import (NumberProperty, ProperFractionProperty, IntProperty) __all__ = ('GrowingNeuralGas', 'NeuralGasGraph', 'Ne...
**custom_properties): # Add agent as normal self.add_agent(location, agent, name, customizable_properties, sense_capability, is_traversable, team, possible_actions, is_movable, visualize_size, visualize_shape, visualize_colour, visualize_depth, visualize_opacity, **custom_properties) # Get the last settings (wh...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Last edited 2021-02-10 Anisotropic polycrystal multiphase field: model problem formulation, adapted from phase_field_composites by <NAME>, https://zenodo.org/record/1188970 This file is part of phase_field_polycrystals based on FEniCS project (https://fenicsproject....
0) mid_sparse_xy1 = (mid_sparse_xy0[0] + ori_input_length, mid_sparse_xy0[1] + ori_output_length) mid_times_xy = (mid_width + 1, mid_height / 2) mid_equal_xy = (mid_width + 4, mid_height / 2) right_input_xy0 = (0, 0) right_input_xy1 = (1, min(total_height if total_height % 2 == 1 else total_height - 1, right_input...
superclass = None def __init__(self, sphere_radius=None, central_meridian=None, false_easting=None, false_northing=None): self.sphere_radius = sphere_radius self.central_meridian = central_meridian self.false_easting = false_easting self.false_northing = false_northing def factory(*args_, **kwargs_): if sin_proj...
'iso-8601'}, } def __init__( self, *, delivery_info: "ExportDeliveryInfo", definition: "ExportDefinition", format: Optional[Union[str, "FormatType"]] = None, run_history: Optional["ExportExecutionListResult"] = None, **kwargs ): super(CommonExportProperties, self).__init__(**kwargs) self.format = format s...
<reponame>kashaiahyah85/MichelAI # -*- coding: utf-8 -*- ''' MichelAI, designed by <NAME> for Bend the Future first album ''' from PyQt5 import QtCore, QtGui, QtWidgets import os import random import sys import time import wave import threading import cv2 from moviepy.video.io.VideoFileClip import VideoFi...
(inv_s, p)) def test_genpolicy_policygroups_multiple(self): '''Test genpolicy (multiple policygroups)''' test_policygroup2 = "test-policygroup2" contents = ''' # %s #include <abstractions/kde> #include <abstractions/openssl> ''' % (self.test_policygroup) open(os.path.join(self.tmpdir, 'policygroups', test_poli...
<gh_stars>1-10 import random import glob import re import string from matplotlib import pyplot as plt import matplotlib import matplotlib.animation from .utils import * from .transform_data import * from .parse_files import * import seaborn as sns def heat_map(grid, name, **kwargs): """ Generic function for making ...
can be seen as outgoing edges on a graph. if self._is_identity: self._inverse = self else: self._inverse = None def _del_derived(self): r""" Delete the derived quantities of ``self``. TESTS:: sage: M = Manifold(2, 'M', structure='topological') sage: X.<x,y> = M.chart() sage: f = M.homeomorphism(M, [x+y, ...
<reponame>psi-rking/optking import logging from copy import deepcopy from itertools import combinations, permutations import numpy as np import qcelemental as qcel from . import bend, cart, dimerfrag, oofp from . import optparams as op from . import stre, tors, v3d from .exceptions import AlgError, OptError from .v3d...
there is no Sigmaf, and no U+03A2 character either --> <!ENTITY Sigma "&#931;" ><!-- greek capital letter sigma, U+03A3 ISOgrk3 --> <!ENTITY Tau "&#932;" ><!-- greek capital letter tau, U+03A4 --> <!ENTITY Upsilon "&#933;" ><!-- greek capital letter upsilon, U+03A5 ISOgrk3 --> <!ENTITY Phi "&#934;" ><!-- greek capital...
}, ) z: Optional["Sensor.Magnetometer.Z"] = field( default=None, metadata={ "type": "Element", "namespace": "", }, ) @dataclass class X: """ Parameters related to the body-frame X axis of the magnetometer. Parameters ---------- noise: The properties of a sensor noise model. """ noise: Optional["Sens...
'type': '[str]'}, 'txt_records': {'key': 'properties.txtRecords', 'type': '[str]'}, 'a_records': {'key': 'properties.aRecords', 'type': '[str]'}, 'alternate_cname_records': {'key': 'properties.alternateCNameRecords', 'type': '[str]'}, 'alternate_txt_records': {'key': 'properties.alternateTxtRecords', 'type': '[str]...
<filename>src/dc_federated/backend/dcf_server.py<gh_stars>1-10 """ Defines the core server class for the federated learning. Abstracts away the lower level server logic from the federated machine learning logic. """ import gevent from gevent import monkey; monkey.patch_all() from gevent import Greenlet, queue, pool im...
hint is *NOT* a metahint. # ..............{ FORWARDREF }.............. # If this hint is a forward reference... elif hint_curr_sign is HintSignForwardRef: # Possibly unqualified classname referred to by this hint. hint_curr_forwardref_classname = get_hint_forwardref_classname( hint_curr) # If this classname co...
"""Utilities for interacting with GitHub""" import os import json import webbrowser import stat import sys from git import Repo from .context import Context event_dict = { "added_to_project": ( lambda event: "{} added the issue to a project.".format(event["actor"]["login"]) ), "assigned": ( lambda event: "{} ass...
# # Autogenerated by Thrift Compiler (0.9.3) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException, TApplicationException import logging from ttypes import * from thrift.Thrift import TProcessor from thrift.transport impo...
<gh_stars>1-10 __author__ = 'saeedamen' # <NAME> / <EMAIL> # # Copyright 2015 Thalesians Ltd. - http//www.thalesians.com / @thalesians # # 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://ww...
= fgu['TILES'] # tilesu = fu['TILES'] # tlids = fgu['TILELOCIDS'] # tlidsu = fu['TILELOCIDS'] # # for ii in range(0,len(tidsu)): #this takes a long time and something more efficient will be necessary # tid = tidsu[ii]#fu[ii]['TARGETID'] # wt = tids == tid # ot = tilesu[ii] # otl = tlidsu[ii] # tt = tiles[wt] # tti = t...
>= 0) m.c5677 = Constraint(expr= m.x6650 - 5*m.b7082 >= 0) m.c5678 = Constraint(expr= m.x6651 - 25*m.b7086 >= 0) m.c5679 = Constraint(expr= m.x6652 - 5*m.b7085 >= 0) m.c5680 = Constraint(expr= m.x6653 - 25*m.b7086 >= 0) m.c5681 = Constraint(expr= m.x6654 - 30*m.b7090 >= 0) m.c5682 = Constraint(expr= m.x6655 - 25*...
None: kid = self._api_account_headers["Location"] try: _signed_payload = sign_payload( url=url, payload=payload, accountKeyData=self.accountKeyData, kid=kid, nonce=nonce, ) except IOError as exc: self._next_nonce = None raise try: result = url_request( url, post_data=_signed_payload.encode("utf8"), err...
<gh_stars>0 ''' Created on May 29, 2017 @author: husensofteng ''' import matplotlib from numpy.lib.function_base import average import math matplotlib.use('TkAgg') from matplotlib.pyplot import tight_layout import seaborn as sns import matplotlib.pyplot as plt plt.style.use('seaborn-ticks') import matplotlib.patches a...
struct.pack(str(record) + "f", *dg['beamAngleReRx_deg']) buffer += struct.pack(str(record) + "f", *dg['beamAngleCorrection_deg']) buffer += struct.pack(str(record) + "f", *dg['twoWayTravelTime_sec']) buffer += struct.pack(str(record) + "f", *dg['twoWayTravelTimeCorrection_sec']) buffer += struct.pack(str(record) + ...
'tr': lambda v: dh_centuryAD(v, u'%d. yüzyıl'), 'tt': lambda v: dh_centuryAD(v, u'%d. yöz'), 'uk': lambda v: dh_centuryAD(v, u'%d століття'), 'ur': lambda v: dh_centuryAD(v, u'%2d00صبم'), 'vi': lambda v: dh_centuryAD(v, u'Thế kỷ %d'), 'wa': lambda v: dh_centuryAD(v, u'%dinme sieke'), 'zh': lambda v: dh_centuryAD(...
<reponame>yinquan529/platform-external-chromium-trace #!/usr/bin/env python # # Copyright 2011 The Closure Linter 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...
# -*- coding: utf-8 -*- import functools import json from datetime import datetime from typing import Any, List from base64 import b64encode import jwt import requests.exceptions import urllib3 from requests import Response, Session from requests.utils import quote from requests.adapters import HTTPAdapter from yapco...
stopping behaviour.") early_stopping_kwargs = { "early_stopping_metric": "elbo", "save_best_state_metric": "elbo", "patience": 50, "threshold": 0, "reduce_lr_on_plateau": True, "lr_patience": 25, "lr_factor": 0.2, } trainer_specific_kwargs["early_stopping_kwargs"] = early_stopping_kwargs # add elbo to metric...
message # Input # msg (unicode): string that contains the message for the calculation # fontpkg (fontpkg): the font to use for the calculation # varwidth (bool): Should the font be fixed or variable width maxw = 0 maxh = 0 cx = 0 (fx,fy) = fontpkg['size'] for c in msg: if c == u'\n': maxh = ...
{'компенсировать': 1}, {'испытание': 1}, {'надёжность': 1}, {'неизбежно': 1}, {'потребоваться': 1}, {'импульс': 2}, {'европеиским': 1}, {'россиискои': 1}, {'способствовать': 1}, {'кв': 1}, {'каковы': 1}, {'исполнение': 1}, {'федерация': 1}, {'оборудование': 3}, {'разобраться': 1}, {'аттестация': 1}, {'б...
fixtures in this request""" result = list(self._pyfuncitem._fixtureinfo.names_closure) result.extend(set(self._fixture_defs).difference(result)) return result @property def node(self): """ underlying collection node (depends on current request scope)""" return self._getscopeitem(self.scope) def _getnextfixtur...
): histOutFile = os.path.join( Ddata, 'hist', scenDir, AddFileSfx( ReplaceFileExt( os.path.basename( outFile ), '.tsv' ), snpStat, replicaCondSfx, snpCondSfx, scenSfx, sfx ) ) rule = pr.addInvokeRule( invokeFn = histogramSnpStatistic, invokeArgs = dict( outFile = histOutFile, **Dict( 'Ddata thinSfx replicaTa...
smaller than the first, the LSTs are treated as having phase-wrapped around LST = 2*pi = 0, and the LSTs kept on the object will run from the larger value, through 0, and end at the smaller value. polarizations : array_like of int, optional The polarizations numbers to include when reading data into the object, ea...
0.0, -1, -1]) self.assertEqual(self.DUT.lst_p_tpu, [200.0, 300.0, 625.0, 500.0, 1000.0]) self.assertEqual(self.DUT.lst_p_tpupw, [19.17808219178082, 35.0, 56.81818181818182, 57.37704918032787, 58.333333333333336]) @attr(all=True, unit=True) def test16c_assess_plan_feasibility_no_test_units(self): """ (TestGrow...
str(e)) return dialog = findReplaceCopyDialog(uniquecategoriesfrom, uniquecategoriesto) dialog.exec() dialog.show() if str(dialog.result()) == '1': replacelist = dialog.getresults() logger.info(replacelist) if len(replacelist) > 0: newcontents = [] for content in contents: for entry in replacelist: content...
a range of files specified by a glob-style expression using a single wildcard character '*'. dims: tuple of positive int Dimensions of input image data, ordered with the fastest-changing dimension first. dtype: dtype or dtype specifier, optional, default 'int16' Numpy dtype of input stack data newDtype: floati...
<reponame>SamKaiYang/ros_modbus_nex<gh_stars>0 ########################################################################### # This software is graciously provided by HumaRobotics # under the BSD License on # github: https://github.com/Humarobotics/modbus_wrapper # HumaRobotics is a trademark of Generation Robots. # w...
return tuple(result) TIFF_PHOTOMETRICS = { 0: 'miniswhite', 1: 'minisblack', 2: 'rgb', 3: 'palette', 4: 'mask', 5: 'separated', 6: 'cielab', 7: 'icclab', 8: 'itulab', 32844: 'logl', 32845: 'logluv', } TIFF_COMPESSIONS = { 1: None, 2: 'ccittrle', 3: 'ccittfax3', 4: 'ccittfax4', 5...
<reponame>alextselegidis/easyappointments-sdk # coding: utf-8 """ Easy!Appointments API These are the OpenAPI specs that describe the REST API of Easy!Appointments. # noqa: E501 OpenAPI spec version: 1.0.0 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ imp...
in this course with this role. """ # If there is an existing registration for the course&person, modify it. # Also enroll this person in the site couse if they aren't already # and if this isn't the site course itself. # Optionally create their work folder (if it doesn't already exist) # # add tutors by using stu...
with all the TimeSeries tseries_dict = {} sort_indeces = {} for name, s_as_dict in series_as_dicts.items(): if "tstamp" in s_as_dict: if sort: sort_indeces[name] = np.argsort(s_as_dict["data"]) s_as_dict["data"] = s_as_dict["data"][sort_indeces[name]] tseries_dict[name] = TimeSeries.from_dict(s_as_dict) # And ...
0, 2)), Perm((0, 1, 4, 2, 3))] ) assert InsertionEncodablePerms.is_insertion_encodable_maximum( [ Perm((0, 1, 2)), Perm((0, 2, 1)), Perm((2, 0, 1)), Perm((2, 1, 0)), Perm((1, 3, 2, 0)), Perm((1, 4, 3, 2, 0)), Perm((1, 2, 4, 0, 3, 6, 5)), Perm((1, 7, 0, 3, 4, 5, 6, 2)), ] ) assert InsertionEncodablePerms.i...
<filename>nexxT/tests/core/test_FilterExceptions.py # SPDX-License-Identifier: Apache-2.0 # Copyright (C) 2020 ifm electronic gmbh # # THE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. # import json import logging from pathlib import Path import pytest import pytestqt from PySide2.QtCore import QCoreApplic...
+ '\n' + \ '#define padding_const2 1' + '\n' + \ '#define pooling_radius_const2 1' + '\n' + \ '#define pooling_stride_const2 1' + '\n' + \ '#define Y_const2 1' + '\n' + \ '#define X_const2 1' + '\n' \ '#define output_H_const2 1' + '\n' \ '#define output_W_const2 1' + '\n' \ '#define pooled_H_const2 1' + '\n' \ ...
= model.latent_model.gc.get_proba().cpu().numpy() fig = plot_01_matrix(gc_prob, title="GC mask", row_label="Z", col_label="C", row_to_mark=indices) logger.log_figure("GC_mask", fig, step=engine.state.iteration) plt.close(fig) ## ---- Logging ---- ## @trainer.on(Events.ITERATION_COMPLETED(every=opt.fast_log_peri...
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (c) Honda Research Institute Europe GmbH # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain th...
import numpy from numba import jit, prange from numpy.typing import ArrayLike from scipy.ndimage import correlate as scipy_ndimage_correlate __fastmath = {'contract', 'afn', 'reassoc'} __error_model = 'numpy' def numba_cpu_correlate(image: ArrayLike, kernel: ArrayLike, output=None): # Kernel must have odd dimenions...
<reponame>mailemccann/cmtb<filename>frontback/frontBackCSHORE.py import math from scipy.interpolate import griddata from prepdata import inputOutput, prepDataLib import os import datetime as DT import netCDF4 as nc import numpy as np from getdatatestbed.getDataFRF import getObs, getDataTestBed from testbedutils.geoproc...
import os import torch import torch.nn as nn import torch.optim as optim import torch.backends.cudnn as cudnn import torch.nn.init as init import argparse from torch.autograd import Variable import torch.utils.data as data #from data import v2, v1, AnnotationTransform, VOCDetection, detection_collate, VOCroot, VOC_CLAS...
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.281063, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic':...
<reponame>caub/wpt from six.moves import BaseHTTPServer import errno import os import socket from six.moves.socketserver import ThreadingMixIn import ssl import sys import threading import time import traceback from six import binary_type, text_type import uuid from collections import OrderedDict from six.moves.queue ...
1 elif chroma == 6: if 55 < ASTM_hue < 80: interpolation_method = 2 else: interpolation_method = 1 elif chroma == 8: if 67.5 < ASTM_hue < 77.5: interpolation_method = 2 else: interpolation_method = 1 elif chroma >= 10: if 72.5 < ASTM_hue < 77.5: interpolation_method = 2 else: interpolation_method = 1 el...
# -*- coding: utf-8 -*- '''Text block objects based on PDF raw dict extracted with ``PyMuPDF``. Data structure based on this `link <https://pymupdf.readthedocs.io/en/latest/textpage.html>`_:: { # raw dict # -------------------------------- 'type': 0, 'bbox': (x0,y0,x1,y1), 'lines': [ lines ] # introduced dic...
<filename>src/frr/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py<gh_stars>0 #!/usr/bin/python # # Copyright (c) 2020 by VMware, Inc. ("VMware") # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. # ("NetDEF") in this file. # # Permission to use, copy, modify, and/or distribute this s...
) else: self.update_record(obj_a=obj_surrogate.item(), obj_c=obj_critic.item(), m_kl_c=100 * kl_c.mean().item(), m_kl_d=100 * kl_d.mean().item(), # a_std=self.act.a_std_log.exp().mean().item(), entropy=(-obj_entropy.item()), a0_avg=buf_action[:, 0].mean().item(), a1_avg=buf_action[:, 1].mean().item(), a0_std=...
ip_geolocation) if minifies is not None: pulumi.set(__self__, "minifies", minifies) if mirage is not None: pulumi.set(__self__, "mirage", mirage) if opportunistic_encryption is not None: pulumi.set(__self__, "opportunistic_encryption", opportunistic_encryption) if origin_error_page_pass_thru is not None: pulumi...
debug myPrint("D", "In ", inspect.currentframe().f_code.co_name, "()") # force_change_account_currency.py ask=MyPopUpDialogBox(toolbox_frame_, theStatus="Are you sure you want to FORCE change an Account's Currency?", theTitle="FORCE CHANGE CURRENCY", theMessage="This is normally a BAD idea, unless you know you ...
""" path = to_bytes_or_null(path) plaintext = to_bytes_or_null(plaintext) ciphertext = ffi.new("uint8_t **") ciphertext_size = ffi.new("size_t *") ret = lib.Fapi_Encrypt( self.ctx, path, plaintext, len(plaintext), ciphertext, ciphertext_size ) if ret == lib.TPM2_RC_SUCCESS: result = bytes(ffi.unpack(ciphertext...
of pre-segmentation of RMieS-corrected spectra and pathologist annotation. With regard to the learning behaviour of the deep neuronal networks, it could be shown that no new classifier has to be built but that the existing networks in transfer learning can be used for a variety of applications, while the false posit...
import torch from torch import nn from model.BaseModules import TransformerDecoderLayer from model.Encoder import BaseEncoder, AutoEncoder, TemporalConvNet class Seq2SeqLSTM(BaseEncoder): def __init__(self, source_size, target_size, hidden_size, **kwargs): super(Seq2SeqLSTM, self).__init__() self.encoder = nn.LST...
<filename>grid_set.py # here is the class that holds all the data days/months # it has all the gridding scripts needed # it will save load all the data/days/months as needed # rewriting so all grids and in i-j coords import numpy as np import pandas as pd import datetime import copy from netCDF4 import Dataset from nu...
":scale"), (store_mul, ":green", 3 * 145, ":scale"), (store_mul, ":blue", 3 * 45, ":scale"), (val_div, ":red", 100), (val_div, ":green", 100), (val_div, ":blue", 100), (set_current_color,":red", ":green", ":blue"), (set_position_delta,0,0,0), (add_point_light_to_entity, 10, 30), ]), ]), ("light_re...
#!/usr/bin/env python3 __version__ = "0.1.4" import argparse import operator import logging import gzip import sys from stringmeup import taxonomy from dataclasses import dataclass from os import path logging.basicConfig( format='%(asctime)s %(levelname)-8s %(message)s', level=logging.INFO, datefmt='%Y-%m-%d [%H:...
import csv import glob import hashlib import io import json import logging import os import random import sys import time from collections import defaultdict, Counter from datetime import datetime, timedelta from uuid import uuid4 from web.logger import WebLogger from web.mturk import MTurkClient from web.utils import...
>>> >>> # creating 5 unique variables for the following strings >>> for i in range(5): ... print(vpool.id('v{0}'.format(i + 1))) 1 2 11 19 20 In some cases, it makes sense to create an external function for accessing IDPool, e.g.: .. code-block:: python >>> # continuing the previous example >>> var = la...
= [sr_comp.settlements[s].pos[0] for s in ss] # Calculate the distances ds = np.sqrt(np.array([((pos_series[pos][0] - self_pos[0]) ** 2 + (pos_series[pos][1] - self_pos[1]) ** 2) for pos in pos_ids])) * self.model.cellSize xtent_dst = CAgentUtilityFunctions.xtent_distribution(ws, ds, IEComponent.b, IEComponent.m) ...
import datetime # import os, subprocess import copy from typing import List, Deque, Dict from collections import deque def join(self, DQ2): DQ2_Li = list(DQ2) for i in DQ2_Li: self.append(i) return self def posixTime(self, date, time): date_li = date.split('-') time_li = time.split(':') DT_args = [ int(...
import copy import json import os from unittest.mock import Mock, patch from app.common import client, datasets, path from app.common.test import BaseApiTest class Response(object): def __init__(self, content, status_code=200): self.content = content self.status_code = status_code def json(self): return json.l...
<gh_stars>1-10 # %% import itertools from datetime import datetime, timezone from pathlib import Path from typing import List, Optional, Tuple, Union import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from IPython.display import display # noqa F401 from matpl...
parser: GraphiteParser, time_range: TimeRange, cache_raw: bool, sparseness_disabled: bool) -> \ Dict[str, TimeSeriesGroup]: """ :param parser: Single graphite target :param time_range: TimeRange over which the query should be executed :return: """ if parser.trace: logger.info('[Trace: %s]: GraphiteApi.execut...
# branchmap.py - logic to computes, maintain and stores branchmap for local repo # # Copyright 2005-2007 <NAME> <<EMAIL>> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import import struct from ...
out, mxdepth, mxargs, adsize, indent, curdepth) return # Check list if isinstance(expr, list): _pretty_print_children('[', ']', expr, out, mxdepth, mxargs, adsize, indent, curdepth) return # Check if expression is not CpoExpr if not isinstance(expr, CpoExpr): out.write(str(expr)) return # Check if expressi...
'name', 'pretty', 'export', 'exact'] all_params.append('callback') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method read_namespaced_limit_range" % key ) params[key] = val del params['kwargs'] # ve...
:meth:`~bgp_peerings` and :meth:`~netlinks` for obtaining other routing element types :rtype: tuple(Routing) """ return gateway_by_type(self, 'ospfv2_area') def add_traffic_handler(self, netlink, netlink_gw=None, network=None): """ Add a traffic handler to a routing node. A traffic handler can be either a s...
<gh_stars>0 from delphi_utils.geomap import GeoMapper import pytest import pandas as pd import numpy as np class TestGeoMapper: fips_data = pd.DataFrame( { "fips": ["01123", "02340", "98633", "18181"], "date": [pd.Timestamp("2018-01-01")] * 4, "count": [2, 0, 20, 10021], "total": [4, 0, 400, 100001], } ) f...
'field_goal_attempts': 1533, 'free_throw_attempt_rate': 0.575, 'effective_field_goal_percentage': 0.525, 'total_rebounds': 659, 'center_percentage': 0, 'power_forward_percentage': 0, 'nationality': 'United States of America', 'offensive_win_shares': 11.5, 'defensive_rebounds': 564, 'total_rebound_percentage': ...
out.close() pyrax.http.request = sav_req ident.http_log_debug = sav_debug sys.stdout = sav_stdout def test_call_without_slash(self): ident = self.base_identity_class() ident._get_auth_endpoint = Mock() ident._get_auth_endpoint.return_value = "http://example.com/v2.0" ident.verify_ssl = False pyrax.http.reques...
<filename>aea/helpers/dialogue/base.py # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. ...
open('articles.txt', 'wb') as ap: pickle.dump(X, ap) # Converting a collection of stemmed tweets to a matrix of token counts # (Konwersja kolekcji tweetów na macierz liczby tokenow) X = [' '.join(a) for a in tweets['stem']] c = CountVectorizer(token_pattern='(?u)\\<KEY>',min_df=3,max_df=0.5) # min_df=3...
<gh_stars>1-10 from __future__ import absolute_import, unicode_literals from six import iteritems, string_types from past.builtins import unicode import types import copy from datetime import date, datetime from uuid import uuid4 import json from elasticsearch import Elasticsearch, NotFoundError, helpers, client fro...
<gh_stars>10-100 # Copyright 2015 Internap. # # 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 i...
# -*- coding: utf-8 -*- """ Created on Tue Dec 14 07:48:19 2021 @author: <NAME> """ import pandas as pd import numpy as np # Helper functions from preprocessing import process_text, convert_to_int, lda_preprocess from genre_processing import clean_genre, group_genre from pprint import pprint # BERTopic from sentence...