input
stringlengths
2.65k
237k
output
stringclasses
1 value
_config.items(): if k.startswith('vsd'): ctxt[k.replace('-', '_')] = v for rid in relation_ids('vsd-rest-api'): for unit in related_units(rid): rdata = relation_get(rid=rid, unit=unit) vsd_ip = rdata.get('vsd-ip-address') if cmp_release >= 'kilo': cms_id_value = rdata.get('nuage-cms-id') log('relation data:cms...
<reponame>diCagri/content import demistomock as demisto from CommonServerPython import * import urllib3 import traceback from typing import Any, Dict, Optional, Union import ntpath from dateparser import parse # Disable insecure warnings urllib3.disable_warnings() """ CONSTANTS """ VERSION = 24 MAX_RESULTS = 100 "...
'finished': return finished elif mode == 'canceled': return canceled def _prepare_order_line_procurement(self, cr, uid, order, line, move_id, date_planned, context=None): return { 'name': line.name, 'origin': order.name, 'date_planned': date_planned, 'product_id': line.product_id.id, 'product_qty': line.prod...
[ {"range": {"@timestamp": {"gte": qgte, "lte": qlte, "format": qtformat}}}] cquery.query.filtered.filter.bool.must_not = [] cquery.size = qsize cquery.aggs["34"].date_histogram.field = "@timestamp" cquery.aggs["34"].date_histogram.interval = qinterval cquery.aggs["34"].date_histogram.time_zone = "Europe/Helsink...
self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): super(VoidPickUpResponse, self).buil...
<gh_stars>0 """ Copyright (c) Facebook, Inc. and its affiliates. """ import numpy as np import random from datetime import datetime import sys import argparse import torch import os from inspect import currentframe, getframeinfo GEOSCORER_DIR = os.path.dirname(os.path.realpath(__file__)) CRAFTASSIST_DIR = os.path.joi...
#!/usr/bin/env python from binascii import hexlify from fcntl import ioctl from socket import * from struct import pack, unpack import six from pcappy_port.constants import * from pcappy_port.functions import * # wrap libpcap use ctypes # fork of pcappy_port, fix bugs and make it work for python3 __author__ = '<NA...
<filename>enemigo.py import pygame import random import math random.seed(pygame.time.get_ticks()) ALTO=1000 ANCHO=1000 limites=[10, 8, 11, 10, 8, 6, 9, 4, 12, 8, 8, 10, 9, 4, 7, 5, 2, 8, 9, 9, 9] pygame.mixer.init(44100, -16, 2, 2048) punchE2=pygame.mixer.Sound('punchEnemy.ogg') stepE=pygame.mixer.Sound('pasosJugador....
or not (=0). -'ocg' specifies wether a strict or relaxed occupancy grid is used in the method itself. Use "str" for strict occgrid, "rlx" for relaxed. -'taulow' is the threshold for the values in the relaxed occgrid. If a value is >taulow it is used in the relaxed occgrid and ignored otherwise. This exists to ...
<reponame>albi3ro/pennylane<filename>tests/optimize/test_optimize.py # Copyright 2018-2020 Xanadu Quantum Technologies Inc. # 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...
<filename>mcmc/util_cupy.py # -*- coding: utf-8 -*- """ Created on Thu Dec 13 14:17:09 2018 @author: puat133 """ # import math import h5py import scipy.io as sio import numpy as np import scipy.linalg as sla import numba as nb import cupy as cp import time import gc import mcmc.image_cupy as im import h5py from skimag...
single value, the ``predicate`` attached to this node. """ return (self.predicate,) def __repr__(self): return "{}({})".format(type(self).__name__, self.predicate) def __eq__(self, other): if not isinstance(other, PostFilterNode): return NotImplemented return self is other or self.predicate == other.predicat...
<filename>wp.py<gh_stars>0 import sqlite3 import sys import json import natto import math import numpy import unicodedata import string import re class Document(): """Abstract class representing a document. """ def id(self): """Returns the id for the Document. Should be unique within the Collection. """ raise N...
tf.nn.dropout(A1, dropout_rates[dropout_layers.index(1)]) print("applied dropout on layer 1 with rate of", dropout_rates[dropout_layers.index(1)]) equations["Z1"] = Z1 equations["A1"] = A1 Z_final = tf.add(tf.matmul(parameters['W' + str(2)], equations["A" + str(1)]), parameters['b' + str(2)]) #Z_final = tf...
<gh_stars>0 from __future__ import division, print_function #import matplotlib.pyplot as plt import numpy as np from numpy import log10 from sys import stderr, stdout, exit from dispersion import DR_Solve, init, DR_point, PlotDR2d from scipy.interpolate import InterpolatedUnivariateSpline as US def banner(...
<filename>msatestgroup.py #!/usr/local/bin/python3 # # Do MSA tests from testgroup import Testgroup, TestError import time class MSATestgroup(Testgroup): """ tests for MSA """ def __init__(self, product, config="config.txt", debug=False): super().__init__('MSA', product, config=config, debug=debug) self.msgtim...
# coding=utf-8 # Copyright (c) Microsoft. All rights reserved. import argparse import json import os import random from datetime import datetime from pprint import pprint import numpy as np import torch from torch.utils.data import Dataset, DataLoader, BatchSampler from pretrained_models import * from tensorboardX impo...
<reponame>CMU-cabot/cabot # Copyright (c) 2020 Carnegie Mellon University # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to u...
<reponame>raoulbq/WaveBlocksND """The WaveBlocks Project IOM plugin providing functions for handling linear combinations of general wavepackets. @author: <NAME> @copyright: Copyright (C) 2013, 2016 <NAME> @license: Modified BSD License """ import numpy as np def add_lincombwp(self, parameters, timeslots=None, linc...
#!/usr/bin/env python3 ''' ############################################################################### ############################################################################### ## ## ## _ ___ ___ ___ ___ ___ ## ## | | | __ / \ / __| _ | __| ## ## | |__| __ ( ) | (_ | _|__ \ ## ## |____|___ \___/ \___|_| \___/...
* FROM {table_name}").output assert "1" in output, error() @TestScenario @Requirements(RQ_SRS_006_RBAC_RowPolicy_Alter_Rename("1.0")) def rename(self, node=None): """Check that a row policy altered using RENAME restricts rows as expected.""" table_name = f"table_{getuid()}" pol_name = f"pol_{getuid()}" pol_new_...
│ ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤ │ a ┆ 2021-12-16 01:00:00 ┆ 2021-12-16 02:00:00 ┆ 2021-12-16 01:00:00 ┆ 1 │ ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤ │ a ┆ 2021-12-16 02:00:00 ┆ 2021-12-16 03:00:00 ┆ 2021-12-...
#!/usr/bin/env python3 import os import sys import platform import subprocess from multiprocessing import Process from textwrap import dedent from datetime import datetime,timedelta from python_utils import print_info_msg, print_err_msg_exit, import_vars, cp_vrfy, cd_vrfy,\ rm_vrfy, ln_vrfy, mkdir_vrfy, mv_vrfy, run...
"serverless") @serverless.setter def serverless(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "serverless", value) @property @pulumi.getter(name="webSql") def web_sql(self) -> Optional[pulumi.Input[bool]]: """ Allow access for Web SQL. Can be either `true` or `false`. """ return pulumi.get(se...
import pygef.utils as utils import pandas as pd import io import numpy as np import pygef.plot_utils as plot from pygef import robertson, been_jefferies import logging from pygef.grouping import GroupClassification logger = logging.getLogger(__name__) MAP_QUANTITY_NUMBER_COLUMN_NAME_CPT = { 1: "penetration_length",...
( self.mc and self.mc.network_profile and self.mc.network_profile.load_balancer_profile and self.mc.network_profile.load_balancer_profile.managed_outbound_i_ps and self.mc.network_profile.load_balancer_profile.managed_outbound_i_ps.count is not None ): load_balancer_managed_outbound_ip_count = ( self.mc.network...
distance, to_unit_cell=True): """ Performs a random perturbation of the sites in a structure to break symmetries. Args: distance (float): Distance in angstroms by which to perturb each site. """ def get_rand_vec(): #deals with zero vectors. vector = np.random.randn(3) vnorm = np.linalg.norm(vector) return ...
""" try : self._destip = destip except Exception as e: raise e @property def destipop(self) : """Either the equals (=) or does not equal (!=) logical operator.<br/>Possible values = =, !=, EQ, NEQ.""" try : return self._destipop except Exception as e: raise e @destipop.setter def destipop(self, destip...
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 01 10:00:58 2021 @author: <NAME> """ #------------------------------------------------------------------# # # # # # Imports # # # # # #------------------------------------------------------------------# import numpy as np import pan...
r""" Emperor 3D PCoA viewer (:mod:`emperor.core`) ============================================ This module provides an Object to interact and visualize an Emperor plot from the IPython notebook. .. currentmodule:: emperor.core Classes ------- .. autosummary:: :toctree: generated/ Emperor """ # -------------------...
and error bar pair in `Decimal` to a string. Parameters ---------- mu : Decimal Value of estimate in `Decimal`. Mu must have enough precision to be defined to dot after shifting. Can be inf or nan. EB : Decimal Error bar on estimate in `Decimal`. Must be non-negative. It must be defined to same precision (quan...
<gh_stars>1-10 # Copyright 2017 ZTE Corporation. # # 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...
= position if position is not None else self.cursor if self.number_of_chars < self.limit: self.text_char_list.insert(self.cursor, character) self.cursor += 1 return True return False def print_text_to_screen(self, console:tcod.Console, x:int, y:int, fg:Optional[Tuple[int,int,int]]=None, bg:Optional[Tuple[int,...
import torch import os from datetime import datetime from time import time import numpy as np from mpi4py import MPI from mpi_utils.mpi_utils import sync_networks, sync_grads from rl_modules.replay_buffer import replay_buffer from rl_modules.models import actor, actor_bilinear, critic, critic_bilinear, critic_sum,\ ac...
#!/usr/bin/env python3 import os import glob import logging import ctypes import unittest import ast from time import sleep import threading import multiprocessing as mp from queue import Empty import socket from shutil import which, rmtree, copyfile import numpy as np from astropy.time import Time, TimeDelta import h...
<reponame>maistra-bot/proxy<filename>maistra/vendor/com_googlesource_chromium_v8/wee8/build/locale_tool.py #!/usr/bin/env vpython # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Helper script used to ma...
<reponame>ggirelli/gpseq-img-py # -*- coding: utf-8 -*- """ @author: <NAME> @contact: <EMAIL> @description: contains Condition wrapper, which in turn contains Series. """ # DEPENDENCIES ================================================================= from joblib import Parallel, delayed import multiprocessing impor...
from tensorflow.keras import regularizers from tensorflow.keras.models import Sequential from tensorflow.keras.models import load_model from tensorflow.keras.layers import Dense, Activation, Dropout, Flatten, LSTM, RNN, Bidirectional, Flatten, Activation, \ RepeatVector, Permute, Multiply, Lambda, Concatenate, BatchNo...
<gh_stars>1-10 import pandas as pd ## READ & WRITE # Pickle df = pd.read_pickle('psi.pickle') df.to_pickle('normal.pkl') # CSV df = pd.read_csv('shenzhen_processed.csv', low_memory=False) df = pd.read_csv('olympics.csv', index_col=0, skiprows=1) #take 1st col as index, and remove 1st row df.to_csv('shenzhen...
# Copyright (c) 2020-2021 impersonator.org authors (<NAME> and <NAME>). All rights reserved. import torch from torch.nn import functional as F import numpy as np def rotation_matrix_to_quaternion(rotation_matrix, eps=1e-6): """Convert 3x4 rotation matrix to 4d quaternion vector This algorithm is based on algorith...
value is 5MB. :param pulumi.Input['FirehoseDeliveryStreamElasticsearchConfigurationCloudwatchLoggingOptionsArgs'] cloudwatch_logging_options: The CloudWatch Logging Options for the delivery stream. More details are given below :param pulumi.Input[str] cluster_endpoint: The endpoint to use when communicating with the ...
that if :math:`\hat{y} < 0`, then the exponential term :math:`e^{-\hat{y}}` could become very large. In this case, we can instead observe that .. math:: \begin{align*} \log(1 + e^{-\hat{y}}) &= \log(1 + e^{-\hat{y}}) + \hat{y} - \hat{y} \\ &= \log(1 + e^{-\hat{y}}) + \log(e^{\hat{y}}) - \hat{y} \\ &= \log(1 +...
import copy class NormaMachine: def __init__(self): self.registers = dict( A={"signal": 0, "magnitude": 0}, B={"signal": 0, "magnitude": 0}, C={"signal": 0, "magnitude": 0}, D={"signal": 0, "magnitude": 0}, E={"signal": 0, "magnitude": 0}, F={"signal": 0, "magnitude": 0}, ) self.stack = [] self.stack_poin...
respBuf = self.dispatchCommand(TPM_CC.PolicyAuthorizeNV, req) return self.processResponse(respBuf) # PolicyAuthorizeNV() def CreatePrimary(self, primaryHandle, inSensitive, inPublic, outsideInfo, creationPCR): """ This command is used to create a Primary Object under one of the Primary Seeds or a Temporary Objec...
<filename>synapse/federation/sender/__init__.py # Copyright 2019 New Vector Ltd # # 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 requi...
# Generated from resolver: lts-10.5 core_packages = ( { "array": "0.5.2.0", "base": "4.10.1.0", "binary": "0.8.5.1", "bytestring": "0.10.8.2", "containers": "0.5.10.2", "deepseq": "1.4.3.0", "directory": "1.3.0.2", "filepath": "1.4.1.2", "ghc": "8.2.2", "ghc-boot": "8.2.2", "ghc-boot-th": "8.2.2", "ghc-prim"...
# 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...
from RLTest import Env from sqlalchemy import create_engine from sqlalchemy.sql import text import time import subprocess import signal from threading import Thread MYSQL_DB = 1 ORACLESQL_DB = 2 class Background(object): """ A context manager that fires a TimeExpired exception if it does not return within the spec...
in range(n_traj): traj = all_results[i, :].reshape((N_rib, len(time_vec_fixed))).T I[i, :] = np.sum(pv[0][traj], axis=1)[startindex:].T else: for j in range(pv.shape[0]): for i in range(n_traj): traj = all_results[i, :].reshape((N_rib, len(time_vec_fixed))).T I[j,i, :] = np.sum(pv[j][traj], axis=1)[start...
<reponame>themagicalmammal/wikibot from os import environ from firebase_admin import credentials, db, initialize_app from flask import Flask, request from telebot import TeleBot, types from wikipedia import ( WikipediaPage, geosearch, page, random, search, set_lang, suggest, summary, ) # Firebase connection c...
# AUTOGENERATED! DO NOT EDIT! File to edit: notebooks_dev/neighbors.ipynb (unless otherwise specified). __all__ = ['sparsify', 'hstack', 'vstack', 'stack', 'NMSLibSklearnWrapper', 'FastCosineNN', 'FastJaccardNN', 'FastL2NN', 'FastKLDivNN', 'sparsify', 'hstack', 'vstack', 'stack', 'NMSLibSklearnWrapper', 'FastCosineNN...
if not isinstance(labels, list): labels = [labels] b = np.zeros((input_image.shape[0],input_image.shape[1],4), dtype=np.uint8) b[:,:,0] = input_image[:] b[:,:,1] = input_image[:] b[:,:,2] = input_image[:] b[:,:,3] = 255 c = np.zeros((input_image.shape[0],input_image.shape[1],4), dtype=np.uint8) c[:,:,0] = inp...
<filename>pypyr/utils/filesystem.py """Utility functions for file system operations. Read, format files, write.""" from abc import ABC, abstractmethod import glob from itertools import chain import json import logging import os from pathlib import Path from tempfile import NamedTemporaryFile from pypyr.errors import Er...
** 2 + 4), x) == asinh(x) / 2 assert manualintegrate(1 / sqrt(4 * x ** 2 + 1), x) == asinh(2 * x) / 2 assert manualintegrate(1 / sqrt(a * x ** 2 + 1), x) == Piecewise( (sqrt(-1 / a) * asin(x * sqrt(-a)), a < 0), (sqrt(1 / a) * asinh(sqrt(a) * x), a > 0), ) assert manualintegrate(1 / sqrt(a + x ** 2), x) == Piecew...
<reponame>SubstraFoundation/distributed-learning-contributivity # -*- coding: utf-8 -*- """ This enables to parameterize a desired scenario to mock a multi-partner ML project. """ import datetime import os import re import uuid from pathlib import Path import numpy as np import pandas as pd from loguru import logger ...
# Space Invaders # Created by <NAME> # Adapted by <NAME> # !/usr/bin/env python from pygame import * import pygame.draw from nave import Ship from tiro import Bullet from inimigo import Enemy from barreira import Blocker from ufo import Mystery from explosao import Explosion from vida import Life from texto import Tex...
on an eCommerce platform Categorical These are data that has no inherent numerical meaning, such as man, woman. Or the state of birth of a group of people good ways to denote categorical values is through graphs. Ordinal This is the mixture of numerical and categorical data Ratings given by a customer as in...
lindex = next_line(fin_lines, max_line, cindex=lindex) words = line.split('|') if len(words) <= 1: # End of table, just write and continue file.write(line+'\n') continue # End if entries = [x.strip() for x in words[1:-1]] # Okay, one check if len(entries) != len(header_locs): raise ValueError("Malformed table...
################################################################################ ## Basic Matrices ## ################################################################################ def null(n, m=None): """Creates a null matrix. Args: n (int) Number of rows of the matrix m (int, optional): Number o...
word[3] == "l" : toGuess = toGuess[:3] + "l" + toGuess[4:] if word[4] == "L" or word[4] == "l" : toGuess = toGuess[:4] + "l" + toGuess[5:] if word[5] == "L" or word[5] == "l" : toGuess = toGuess[:5] + "l" + toGuess[6:] if word[6] == "L" or word[6] == "l" : toGuess = toGuess[:6] + "l" + toGuess[...
worker_pool = [worker for worker in self.workers.idle] bases = self.townhalls.ready geysers = self.geysers.ready # list of places that need more workers deficit_mining_places = [] for mining_place in bases | geysers: difference = mining_place.surplus_harvesters # perfect amount of workers, skip mining place i...
calculated in %s seconds" % (geneset_type,time_diff) permute_mapp_inputs=[] return 1, mapp_to_mod_genes def performOntologyORA(ontology_dir): """ Perform over-representation analysis (ORA) on any provided Ontology """ start_time = time.time() ontology_type = getResourceType(ontology_dir) ######...
options_list=['--format'], arg_type=get_enum_type(['default', 'email']), help='', arg_group='Content Info') c.argument('identifier', type=str, help='', arg_group='Content Info') c.argument('metadata', action=AddMetadata, nargs='+', help='', arg_group='Content Info') c.argument('state', arg_type=get_enum_type(['...
A vertex at (-1.0, -0.4, -1.0), A vertex at (-1.0, -1.0, -0.4)) sage: edge_trunc = Cube.face_truncation(Cube.faces(1)[11]) sage: edge_trunc.f_vector() (1, 10, 15, 7, 1) sage: tuple(f.ambient_V_indices() for f in edge_trunc.faces(2)) ((0, 5, 6, 7), (1, 4, 5, 6, 8), (6, 7, 8, 9), (0, 2, 3, 7, 9), (1, 2, 8, 9), ...
# coding: utf-8 """ Masking API Schema for the Masking Engine API # noqa: E501 OpenAPI spec version: 5.1.8 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from dxm.li...
from __future__ import print_function, absolute_import, division # makes KratosMultiphysics backward compatible with python 2.6 and 2.7 from KratosMultiphysics import * try: # test to import the modules for the parallel execution from KratosMultiphysics.mpi import * from KratosMultiphysics.MetisApplication import * ...
<gh_stars>10-100 # coding=utf-8 # Copyright 2021 The Fairseq Authors and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache....
<reponame>ooblog/sensortray #! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division,print_function,absolute_import,unicode_literals import sys import os import subprocess import codecs import ctypes import struct import uuid import datetime import math from LTsv_file import * from LTsv_printf imp...
+ noise pickNum = real_bikes realbikes = 0 return True, endtime, dropNum, pickNum, realbikes, returnLost, realbikes else: minBikes = min(serviceLevel) maxBikes = max(serviceLevel) endtime = t_arrive if minBikes <= real_bikes <= maxBikes: endtime = t_arrive + noise if selectedSta == '127': print(...
"reg-name", expander = exp_regs)], type = ["Registers", "Inspecting Simulated State"], short = "read a register", namespace_copy = ("processor", obj_read_reg_cmd), see_also = ['%', 'write-reg', 'pregs', 'pselect'], doc = """ This command reads a CPU register. For example, to read the <tt>eax</tt> register in an x8...
# Copyright (c) 2017 <NAME> # Copyright (c) 2018 <NAME> # Copyright (c) 2018-2019 <NAME> # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) import re import inspect import numpy as np import ast import phylanx.executi...
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import logging import indra.statements as ist logger = logging.getLogger('english_assembler') class EnglishAssembler(object): """This assembler generates English sentences from INDRA Statements. Parameters ----...
import datetime from unittest import mock from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.models import AnonymousUser, Permission from django.core.cache import cache from django.db import IntegrityError from django.test import TestCase, override_settings from dj...
<gh_stars>1-10 # © 2022 <NAME> <<EMAIL>> # MIT-licensed import time import machine import struct import uctypes from micropython import const # This driver was written from scratch using datasheets and looking at other drivers listed here. # Required copyright notices of those drivers are included below as necessary...
**kwargs) for t in times] for tr in traces } # Return a DataFrame where each column is a trace and time is the index. return pd.DataFrame(trace_data, index=times) def traces_to_table_data(*traces, **kwargs): """ Create table of sample times and values for a set of traces. Args: *traces: A list of traces with...
import threading import time from meerk40t.tools.zinglplotter import ZinglPlotter from ...core.drivers import Driver from ...core.plotplanner import grouped from ...kernel import ( STATE_ACTIVE, STATE_BUSY, STATE_END, STATE_IDLE, STATE_INITIALIZE, STATE_PAUSE, STATE_SUSPEND, STATE_TERMINATE, STATE_UNKNOWN, ...
<gh_stars>1-10 import math import time from random import * from random import shuffle import numpy as np import torch import torch.nn as nn from torch.autograd import Variable from tqdm import tqdm, tqdm_notebook from util import data_utils def prepare_parameters(model, optim_args): """Produce two groups of param...
self._failure: self._failure = self._offset self._expected = [] if self._offset == self._failure: self._expected.append('\'use\'') if address1 is not FAILURE: address2 = FAILURE address2 = self._read__() if address2 is not FAILURE: elements0.append(address2) address3 = FAILURE address3 = self._read_expressio...
grid_points) / 7, vac_pareto*n_vacc, np.repeat(0, len(vac_pareto))*n_vacc, color=col_pareto, alpha = 0.3) ax.plot(np.linspace(0, total_length, grid_points) / 7, np.repeat(0.5, len(vac_pareto))*n_vacc, color="black", linestyle="dashed", label="Population \nallocation") time = np.linspace(0, total_length, grid_poin...
<filename>models/resnet/tensorflow/train_imagenet_resnet_hvd.py #!/usr/bin/env python # Copyright (c) 2018, NVIDIA CORPORATION. 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 ...
import PySimpleGUI as sg import pandas as pd from functools import reduce import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt from math import pi from pylab import * def user_input_GUI(): global stock_share_hash, index_hash, chart_num layout = [ [sg.Text('Please enter Portfolio and its indivi...
from iocbuilder import AutoSubstitution, Device from iocbuilder.arginfo import makeArgInfo, Simple, Ident, Choice from iocbuilder.iocinit import IocDataStream from iocbuilder.modules.asyn import AsynPort from iocbuilder.modules.ADCore import ADCore, ADBaseTemplate, makeTemplateInstance from iocbuilder.modules.restClien...
""" MIT License Copyright (c) 2021 TheHamkerCat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, ...
import json import pickle from copy import deepcopy from pathlib import Path import subprocess import fire import numpy as np from second.data import kitti_common as kitti from second.data.dataset import Dataset, register_dataset from second.utils.eval import get_coco_eval_result, get_official_eval_result from second...
def placeholders(self): return set(self._placeholders) @property def roots(self): return self._roots @property def executable(self): for ph in self._placeholders: if not ph.has_default: return False return True def negate(self): neg = not self._negative return FunctionComparator(self._func,self._pathsig,...
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # region header ''' This module provides classes for dealing with python's way to transport \ strings to any output stream. ''' # # python3.5 # # pass from __future__ import absolute_import, division, print_function, \ unicode_literals # # ''' For conventions see...
# This file is part of ranger, the console file manager. # License: GNU GPL version 3, see the file "AUTHORS" for details. """The Console widget implements a vim-like console""" import curses import re from collections import deque from ranger.gui.widgets import Widget from ranger.ext.direction import Direction from...
the resources for which the user does not have admin permissions and delete the remaining resources """ allowed = [] skipped = [] if not is_truthy(self.request.query_params.get('skip_uneditable', False)): return None for resource in resource_object_list: if resource.has_permission(user, ADMIN): allowed.appen...
# # Copyright (c) 2016 Juniper Networks, Inc. All rights reserved. # """ This file contains implementation of data model for kube manager """ from builtins import str from builtins import range import json from cfgm_common.vnc_db import DBBase from bitstring import BitArray from vnc_api.vnc_api import (KeyValuePair) ...
6 7 8 9 10 11 0.21658738559361795 0.79306527522919623 -0.21658738559361673 -3.4945260899414864e-017 0.79306527522919623 -0.30630081814542448 -0.21658738559361776 0.79306527522919623 -0.21658738559361687 -0.30630081814542537 0.79306527522919623 7.9942010564300995e-016 -0.21658738559361781 0.79306527522919623 0.216...
""" return _Volume.CVolume8_copy(self, *args) def makeRef(self, *args): """ makeRef(self, Volume) -> CVolume8 makeRef(self, Volume, x, y, z, XSize, YSize, ZSize) -> CVolume8 makeRef(self, Volume) -> CVolume8 """ return _Volume.CVolume8_makeRef(self, *args) def getSize(self, *args): """ getSize(self) -> C...
use_global_stats=True, fix_gamma=False, eps = self.eps) scale4b5_branch2a = bn4b5_branch2a res4b5_branch2a_relu = mx.symbol.Activation(name='res4b5_branch2a_relu', data=scale4b5_branch2a, act_type='relu') res4b5_branch2b = mx.symbol.Convolution(name='res4b5_branch2b', data=res4b5_branch2a_relu, num_filter=256, pa...
<gh_stars>1-10 from collections import deque from contextlib import contextmanager from decimal import Decimal from io import BytesIO from unittest import TestCase import json import os import sys import tempfile import unittest from twisted.trial.unittest import SynchronousTestCase import attr from jsonschema import...
# 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. # -----------------------------------------------------...
# Copyright 2011 <NAME>. All rights reserved. # # 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 the above copyright notice, # this list of conditions and the followi...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange import hashlib import math from ccxt.base.errors import ExchangeError from ccxt.base....
<reponame>perellonieto/background_check<filename>cwc/evaluation/rgp.py<gh_stars>1-10 from __future__ import division import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import auc import warnings class RGP: """This class represents a Recall_1-Gain_2-Precision_1 (RGP) curve. An object of class R...
*1.5 D_height = c_height // 16 # Altura de disco D_distancia = (D_max_width - D_min_width) // (2 * max(1, master - 1)) # Distancia entre discos # Coordenadas de disco (rectangulo) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - x1, y1 = ((c_distancia - D_max_width) // 2), (y2 - D_height // 3) x2,...
<filename>treetopper/timber.py from treetopper.log import Log from treetopper._constants import ( math, TAPER_EQ_COEF, TAPER_EQ ) class TimberQuick(object): """TimberQuick is a class that will virtually cruise a tree based on it's species, DBH, total height and plot factor. For fixed-area plots use the negative ...
import torch import torch.nn as nn import torch.nn.functional as F import math import re def get_str(cls): name = cls.actv.__class__.__name__ _str_act = '{}'.format(name) if name == 'LeakyReLU': _str_act += '{}'.format(cls.actv.negative_slope) if hasattr(cls, 'norm1'): try: _str_norm = '{}'.format(cls.norm1._...