input
stringlengths
2.65k
237k
output
stringclasses
1 value
copy(self, site_properties=None, sanitize=False): """ Convenience method to get a copy of the structure, with options to add site properties. Args: site_properties (dict): Properties to add or override. The properties are specified in the same way as the constructor, i.e., as a dict of the form {property: [valu...
# pylint: disable=line-too-long,too-many-lines,missing-docstring """Something-something-v2 action classification dataset.""" import os import numpy as np from mxnet import nd from mxnet.gluon.data import dataset __all__ = ['SomethingSomethingV2'] class SomethingSomethingV2(dataset.Dataset): """Load the something-som...
import os from numpy import array,zeros from generic import obj from simulation import Simulation,SimulationAnalyzer from vasp_input import VaspInput from developer import DevBase from debug import * # vasp xml reader classes/functions class VXML(DevBase): basic_types = set('i v dimension field set time'.split()) ...
#! /usr/bin/env python # -*- coding: utf-8 -*- # # author: <NAME> # contact: <EMAIL> import torch import SimpleITK as sitk import numpy as np import nibabel as nib from torch.autograd import Variable from skimage.transform import resize from torchvision import transforms from time import gmtime, strftime from tqdm im...
<gh_stars>0 # coding: utf-8 """ Metal API This is the API for Equinix Metal. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. The official API docs are hosted at <https://metal.equinix.co...
we'll create a leave event locally, but that's only really # for the benefit of the invited user - we don't have enough # information to send it out over federation). # # (2a) rescinded knocks. These are identical to rejected invites. # # (3) knock events which we have sent over federation. As with # invite reje...
#!/usr/bin/env python ''' PEXPECT LICENSE This license is approved by the OSI and FSF as GPL-compatible. http://opensource.org/licenses/isc-license.txt Copyright (c) 2012, <NAME> <<EMAIL>> PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROV...
<gh_stars>1-10 # coding: utf-8 # In[2]: # errorCorrection_PatchDS_3D(Sim_posmod, Ti_primod, wel_obs_data, i_dim, j_dim, k_dim, run_smooth) # Authors: <NAME>, <NAME> # Contact: <EMAIL> # Date: Oct 22, 2018 # This is the function to correct the posterior residual errors at mismatched wells using "MPS Direct Sampling...
X = np.stack(X_arrays, axis = 0) Y = np.stack(Y_arrays, axis = 0) # Generate data return X, Y class generator_df_LSTM(keras.utils.all_utils.Sequence): """ Class that generates batches of data ready for training an LSTM model. The data is expected to come from a dataframe and to follow event style (cue and ouct...
import numpy as np import pandas as pd from pprint import pprint import argparse from pytorch_pretrained_bert.tokenization import (BasicTokenizer, BertTokenizer, whitespace_tokenize) import collections import torch from torch.utils.data import TensorDataset from pytorch_pretrained_bert.modeling import BertForQuestionA...
<gh_stars>1-10 from index import db, bcrypt import datetime import decimal import json from sqlalchemy.orm import relationship from flask import jsonify from sqlalchemy.dialects.mysql import LONGTEXT from sqlalchemy import JSON user_rule_association = db.Table( 'user_rule_association', db.Model.metadata, db.Column('...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import time from collections import defaultdict, deque from typing import Any, Dict, List, Optional import tim...
bit too complicated right now cursor_result, _ = search_fn({ 'limit': 1000, 'paginator_options': {'max_limit': 1000}, }) except ValidationError as exc: return Response({'detail': six.text_type(exc)}, status=400) group_list = list(cursor_result) group_ids = [g.id for g in group_list] is_bulk = len(group_ids) ...
= [french,finir_conjug], line = dict(color = 'black'), fill = dict(color = 'rgb(95,102,161)'), align = ['center', 'center'], font = dict(color = 'white', size = 14), height = 30 ) ) layout = dict(width=500, height=450) data = [trace0] fig = dict(data = data, layout = layout) iplot(fig) This can be taken as the...
import collections import importlib import logging from stdlib_list import stdlib_list from ..code_fixing.code_fixer import CodeFixer from ..code_fixing.static import standard_python_functions LOGGER = logging.getLogger() class PythonCodeFixer(CodeFixer): def __init__(self, code, indents, poss_lines): self.code ...
weighted by the deriv of the error fct by the output layer. We don't use Lemma 3 dircetly here, we just apply the definition of delta_error err_errorsignals = [0]*self.layercount if error_function is 0: errorbyyzero = -targ/out[:-1] #Kullback-Leibler divergence derivative else: if error_function is 1: errorbyyzer...
<reponame>tharvik/nessus """ sub modules for everything about the scans """ from enum import Enum from uuid import uuid4 from typing import Iterable, Mapping, Union, Optional, MutableMapping from nessus.base import LibNessusBase from nessus.editor import NessusTemplate from nessus.model import lying_exist, lying_typ...
constant string, - a parameter value defined as ``$parameter_name``, - an original parameter value defined as ``$parameter_name.original``, - a parameter value from some context defined as ``#context_name.parameter_name``. default_value (str): Optional. The default value to use when the ``value`` yields an empt...
# real_meta_fmt = [('rmsval', 'f')] # self.grid_meta_int = self._buffer.read_struct(NamedStruct(integer_meta_fmt, # self.prefmt, # 'GridMetaInt')) # self.grid_meta_real = self._buffer.read_struct(NamedStruct(real_meta_fmt, # self.prefmt, # 'GridMetaReal')) # grid_start = self._buffer.set_mark() else: raise Not...
<filename>entmoot/optimizer/optimizer.py """ Copyright (c) 2016-2020 The scikit-optimize developers. 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 abo...
= set(indices).intersection(set(data['subset'])) if float(len(indices)) != 0.0: pre = float(len(xx)) / float(len(indices)) else: pre = 0.0 rec = float(len(xx)) / float(len(data['subset'])) item = (trial_id, fold_id, k_fold, num_passes, num_tr, mu, posi_ratio, s) results[item] = {'algo_para': [trial_id, fold_id, ...
result: listaSemanticos.append(Error.ErrorS("Error Semantico", "Error de tipos: tipo " + col.tipo.dato + " columna " + col.nombre + " valor a insertar " + str( val.tipo))) flag = False break else: bas1 = validaCheck( col, val, columnas, nodo.listValores) if (bas1 == 0): if validarUnique(col, val.valor, tabl...
<gh_stars>1-10 #!/usr/bin/env python # -*- coding:utf-8 -*- """ Copyright 2020, <NAME>, PKU. """ import queue import sys import math import tensorflow as tf import numpy as np from tools.common import Notify from loss import mvsnet_regression_loss sys.path.append("../") from cnn_wrapper.mvsnet import * from homography...
np.sum(np.multiply(Q_tilde[link], self.zeta_gamma[link])) vv21 = self.nu_tilde[link[0]] * self.nu_prime_tilde[link[1]] * self.theta_tilde[link[0]] vv22 = np.multiply(self.T - self.A[link], np.exp(-self.theta_tilde[link[0]] * self.theta_prime_tilde[link[1]] * (self.T - self.A[link]))) vv2 = vv21 * n...
<reponame>morepath/dectate import abc import logging import sys import inspect from .error import ( ConflictError, ConfigError, DirectiveError, DirectiveReportError, ) from .toposort import topological_sort from .sentinel import NOT_FOUND order_count = 0 class Configurable: """Object to which configuration act...
input variables must be non-zero \(0\) " r"for the SwapFreq, MEMC_1Freq, MEMC_2Freq, and MEMC_3Freq. " r"The SwapFreq, MEMC_1Freq, MEMC_2Freq, and MEMC_3Freq need to be zero " r'\(0\) for the "NVT" and "NPT" ensembles.', ): gomc_control.write_gomc_control_file( charmm_NPT_NVT, "test_save_NVT_bad_variables_part_8...
<gh_stars>1-10 # -*- coding: utf-8 -*- import random import hashlib import base64 import json import urllib import traceback import sys import time import calendar import re # 这段代码是用于解决中文报错的问题 reload(sys) sys.setdefaultencoding("utf8") from datetime import date import datetime from lxml import etree from dateutil.rel...
clsend airecv; requestAnimEcho(string) broadcast; removeBeans(int8 []) clsend airecv; removeBeansEcho(int8 []) broadcast; }; dclass DistributedPartyValentineTrampolineActivity : DistributedPartyTrampolineActivity { }; dclass DistributedPartyVictoryTrampolineActivity : DistributedPartyTrampolineActivity { }; dclas...
<reponame>Xiaoyang-Lu/sst-elements<filename>src/sst/elements/memHierarchy/tests/testKingsley.py import os import sst quiet = True memCapacity = 4 # In GB memPageSize = 4 # in KB memNumPages = memCapacity * 1024 * 1024 / memPageSize mesh_stops_x = 3 mesh_stops_y = 3 mesh_clock = 2200 ctrl_mesh_flit = 8 data_mesh_fli...
<filename>astylo/iolib.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ Input & Output library """ import sys, logging logging.disable(sys.maxsize) import subprocess as SP import numpy as np from astropy.io import fits import h5py as H5 import csv global fitsext, h5ext, ascext, csvext fitsext = '.fits' h5ext ...
list_of_elem = cls(list_of_elem) return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in...
# Copyright (c) 2009, Motorola, 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 the above copyright notice, # this list of conditions and t...
<reponame>apaszke/jax<filename>jax/experimental/general_map.py<gh_stars>1-10 # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LI...
'b'], ['solare', 'noun', 'b'], ['solco', 'noun', 'b'], ['soldato', 'noun', 'a'], ['soldo', 'noun', 'a'], ['sole', 'noun', 'a'], ['solenne', 'adjective', 'b'], ['solidarietà', 'noun', 'b'], ['solido', 'adjective', 'b'], ['solido', 'noun', 'b'], ['solitamente', 'adverb', 'b'], ['solitario', 'adjective', 'b'], ['solitario...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2021 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
<filename>support/parse_data.py<gh_stars>0 import support.classes as classes import os import pickle import numpy as np import csv import math DATA_PATH = os.path.join(os.path.expanduser('~'), "learnml/data") def prep(s, skipread=False): ''' Takes a string with data set name, and runs the proper setup. ''' pri...
<filename>tests/transports/test_urllib3.py # BSD 3-Clause License # # Copyright (c) 2019, Elasticsearch BV # 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...
<filename>frameworks/pycellchem-2.0/src/RD/ReactionDiffusion.py #--------------------------------------------------------------------------- # # ReactionDiffusion.py: implementation of reaction-diffusion chemical systems # # originally based on the breve Hypercycle.[tz/py] demo by <NAME> # <<EMAIL>>, www.spiderland.org...
as described above. Indices correspond to the indices of `tensor` that aren't in `row_labels`. Has one index labelled `svd_label`+"out" which connects to S. S : Tensor Tensor with data consisting of a diagonal matrix of singular values. Has two indices labelled `svd_label`+"out" and `svd_label`+"in" which are ...
<gh_stars>1-10 # -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you...
Import a headless ResNet50 resnet = ResNet50(input_shape = (None, None, 3), include_top=False) # Attached U-net from second last layer - activation_49 res_out = resnet.layers[-2].output # Standard U-Net upsampling 512 -> 256 -> 128 -> 64 # Upsampling 1 up1 = UpSampling2D(size=(2,2))(res_out) up1_conv = Conv2D...
at DLPy example folder. Returns ------- :class:`MomentumSolver` ''' def __init__(self, momentum=0.9, learning_rate=0.001, learning_rate_policy='fixed', gamma=0.1, step_size=10, power=0.75, use_locking=True, clip_grad_max=None, clip_grad_min=None, steps=None, fcmp_learning_rate=None, lr_scheduler=None): Solver...
+ e + d) data.write('\n') data.write(f + e + e) data.write('\n') data.write(f + e + f) data.write('\n') data.write(f + e + g) data.write('\n') data.write(f + e + h) data.write('\n') data.write(f + e + i) data.write('\n') data.write(f + e + j) data.write('\n') data.write(f + f + a) data.wri...
*= pi * radius / tex_size_main[1] v_start = v else: v = 0. for i in range(segs_h + 1): angle_h = delta_angle_h * i + (0. if inverted else slice_radians) x = radius_h * cos(angle_h) y = radius_h * sin(angle_h) * (-1. if inverted else 1.) if smooth: normal = Vec3(x, y, z).normalized() * (-1. if in...
<reponame>hashnfv/hashnfv-sdnvpn #!/usr/bin/python # # Copyright (c) 2017 All rights reserved # This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
then everything that applies to Term B also applies to Term A. """ __slots__ = () names = ["negatively_regulates"] class Ontology(object): """This abstract class specifies the interface that all the ontology classes should satisfy. """ def add_term(self, term): """Adds the given `term` to this ontology. ...
var_list[5].units = 'S/m' elif platform_name == 'CP01CNSM' and node == 'MFN' and instrument_class == 'CTD' and method == 'RecoveredInst': uframe_dataset_name = 'CP01CNSM/MFD37/03-CTDBPD000/recovered_inst/ctdbp_cdef_instrument_recovered' var_list[0].name = 'time' var_list[1].name = 'ctdbp_seawater_temperature' ...
<gh_stars>1-10 import torch.nn as nn import torch import torch.functional as F from graphs.models.attention_models.seq_base_models.mLSTM import LSTM from graphs.models.attention_models.seq_base_models.mTransformerEncoder import Transformer_Encoder, myTransformerEncoderLayer from graphs.models.attention_models.utils.pos...
-> int""" return _libsedml.SedCurve_setXDataReference(self, *args) def unsetXDataReference(self): """unsetXDataReference(SedCurve self) -> int""" return _libsedml.SedCurve_unsetXDataReference(self) def getYDataReference(self): """getYDataReference(SedCurve self) -> string""" return _libsedml.SedCurve_getYDataR...
this raises, don't use 'vFvvvvvv' as a signature... self.redirected = FunctionType(string, filespec) assert(not self.redirected.redirect and not self.redirected.usestruct) def getchar(self, c: str) -> int: return self._bare.getchar(c) def getcharidx(self, i: int) -> int: return self._bare.getcharidx(i) ...
New Algorithms for Simulating Dynamical Friction <NAME>, <NAME>, <NAME> — RadiaSoft, LLC This notebook describes—and documents in code—algorithms for simulating the dynamical friction experienced by ions in the presence of magnetized electrons. The $\LaTeX$ preamble is here. $$ %% math text \newcommand{\hmhsp}{\mspa...
#AUTOGENERATED! DO NOT EDIT! File to edit: dev/09_full_svd_surrogate_script.ipynb (unless otherwise specified). __all__ = ['main', 'invPreprocess', 'test_model_rel_err', 'reconFrameOnly', 'predictLatentVectors', 'get_lin_and_svd_rel_err', 'MLP', 'trainEpoch', 'validEpoch', 'build_latents', 'LatentVectors', 'arg_parse...
# Copyright (c) 2018 Sony Pictures Imageworks 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.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
will be ignored. - In kwargs, tau value cannot be included. """ if self.TAU in kwargs: raise ValueError( "@tau must be specified when scenario = Scenario(), and cannot be specified here.") self.tau, self[name] = self._tracker(name).estimate( model=model, phases=phases, n_jobs=n_jobs, **kwargs) def phase_estima...
# coding: utf-8 """ MailMojo API v1 of the MailMojo API # noqa: E501 OpenAPI spec version: 1.1.0 Contact: <EMAIL> 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 ...
import aerosandbox.numpy as np from aerosandbox.optimization.opti import Opti from typing import Union, Dict, Callable, List from aerosandbox.modeling.surrogate_model import SurrogateModel import copy import warnings class FittedModel(SurrogateModel): """ A model that is fitted to data. Maps from R^N -> R^1. You ...
# These requirements were auto generated # from software requirements specification (SRS) # document by TestFlows v1.6.201216.1172002. # Do not edit by hand but re-generate instead # using 'tfs requirements generate' command. from testflows.core import Specification from testflows.core import Requirement Heading = Spe...
<reponame>NaomiatLibrary/OpenNMT-kpg-release import argparse import datetime import json import os from functools import partial import tqdm import numpy as np import string import sys sys.path.append("/home/yingyi/Documents/OpenNMT-kpg") print("python path",sys.path) from onmt.utils.logging import init_logger from on...
rolled back on :meth:`.Transaction.close`:: with session.begin_transaction() as tx: pass """ #: When set, the transaction will be committed on close, otherwise it #: will be rolled back. This attribute can be set in user code #: multiple times before a transaction completes, with only the final #: value takin...
<gh_stars>0 """ CANNR TM analytics container building tool build functions. Module that generates Web service code from source files. Copyright 2020 <NAME> <EMAIL> All rights reserved Maintainer <NAME> <EMAIL> """ import cannrcore as cc import os import json from pathlib import Path from datetime import datetime impor...
<gh_stars>0 r""" Clifford Algebras AUTHORS: - <NAME> (2013-09-06): Initial version """ #***************************************************************************** # Copyright (C) 2013 <NAME> <tscrim at ucdavis.edu> # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
""" @author: <NAME> <<EMAIL>> Copyright 2013 IBM 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 agree...
#!/usr/bin/env python # # base.py - The Action and ToggleAction classes. # # Author: <NAME> <<EMAIL>> # """This module provides the :class:`Action`, :class:`NeedOverlayAction`, and :class:`ToggleAction` classes. See the :mod:`.actions` package documentation for more details. """ import logging import fsl.data.image ...
#!/bin/env python # # File: RDKitPerformMinimization.py # Author: <NAME> <<EMAIL>> # # Copyright (C) 2020 <NAME>. All rights reserved. # # The functionality available in this script is implemented using RDKit, an # open source toolkit for cheminformatics developed by <NAME>. # # This file is part of MayaChemTools. # # ...
# -*- coding: utf-8 -*- #--------------------------------------------------------------------------- # Copyright 2020 VMware, Inc. All rights reserved. # AUTO GENERATED FILE -- DO NOT MODIFY! # # vAPI stub file for package com.vmware.nsx.node.services. #-----------------------------------------------------------------...
import torch import utility import logging import os import torch.nn as nn from torch import Tensor from typing import Type, Any, Callable, Union, List, Optional from torch.utils.data import DataLoader from models import CoarseNet, RefineNet from argparse import Namespace from checkpoint import CheckPoint import torch....
import numpy as np import os from abc import ABC, abstractmethod import matplotlib.pyplot as plt from argparse import ArgumentParser import astropy.constants as const import astropy.units as units # i don't understand how to make this work correctly... # from . import utils # from . import transformation as transform ...
from typing import Union, Any, List, Set, Dict, Tuple, Optional import json import math from prosto.utils import * from prosto.resolve import * import prosto as pr # To resolve circular imports from prosto.Prosto import * from prosto.Table import * from prosto.Column import * from prosto.Operation import * class Co...
DataLoader(val_dataset, batch_size=self.batch_size, shuffle=False, num_workers=num_loader_workers, pin_memory=True, drop_last=False, collate_fn=self._batch_collate_fn) # Prepare tensorboard writer tb_writer = self._prepare_tensorboard_writer() # if user wants to train the model for more epochs, ignore the n_...
DFA.unpack( u"\1\130\11\uffff" ) DFA24_accept = DFA.unpack( u"\1\uffff\1\1\1\2\7\uffff" ) DFA24_special = DFA.unpack( u"\12\uffff" ) DFA24_transition = [ DFA.unpack(u"\4\2\1\uffff\1\2\2\uffff\3\2\15\uffff\1\2\36\uffff" u"\2\2\6\uffff\1\1\22\uffff\1\2"), DFA.unpack(u""), DFA.unpack(u""), DFA.unpack(u"...
import os import sys import cv2 from core.bbreg.bbreg_nn_klloss import BBRegNN from net.loss.ghmseloss import GHMSE_Loss from net.loss.mmd import mmd from tracking.options import opts import numpy as np sys.path.append(os.path.abspath('../')) from torch.autograd import Variable from core.trackers.tracker_base import t...
- 10*x**2 + 1, x, domain='QQ')) assert Poly(x**2-3, extension=sqrt(2)).sqf_norm() == \ (1, Poly(x**2 - 2*sqrt(2)*x - 1, x, extension=sqrt(2)), Poly(x**4 - 10*x**2 + 1, x, domain='QQ')) def test_sqf(): f = x**5 - x**3 - x**2 + 1 g = x**3 + 2*x**2 + 2*x + 1 h = x - 1 p = x**4 + x**3 - x - 1 F, G, H, P = map(P...
# -*- coding: utf-8 -*- # $Id: btresolver.py 70517 2018-01-10 14:14:45Z vboxsync $ # pylint: disable=C0302 """ Backtrace resolver using external debugging symbols and RTLdrFlt. """ __copyright__ = \ """ Copyright (C) 2016-2017 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available...
import numpy as np import cv2 import os from tqdm import tqdm import random import matplotlib.pyplot as plt import matplotlib.image as mpimg import matplotlib.patches as patches import pickle from glob import glob import imgaug as ia from imgaug import augmenters as iaa from shapely.geometry import Polygon cardW=63 c...
from graphics import * import random # # CS 177 - milestone2.py # <NAME> 0029855549 # Following the Coding Standards and Guidelines # This program will create a trivia quiz. First there will be a control window # asking the user to play or exit. If play, they will take a quiz with 5 # questions. The # correct will be ...
# -*- coding: utf-8 -*- # Copyright 2014 <NAME> - c01db33f (at) gmail.com # # 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 b...
8, 'efConstruction': 100, 'post' : 0}, query_time_params = {'efSearch': 100}, verbose = False, ): super().__init__( #jaccard init params nmslib_method='hnsw', nmslib_space='l2', nmslib_data_type=nmslib.DataType.DENSE_VECTOR, nmslib_dtype = nmslib.DistType.FLOAT, nmslib_space_params = {}, #other params X_pr...
= [stacked_heads[base_id][i] for i in range(len(stacked_heads[base_id]))] new_stacked_heads[cc].pop() if self.grandPar: new_grand_parents[cc] = [grand_parents[base_id][i] for i in range(len(grand_parents[base_id]))] new_grand_parents[cc].pop() if self.sibling: new_siblings[cc] = [siblings[base_id][i] for i in r...
ctx.notify_all(f'[Server]: GO') async def missing(ctx: Context, client: Client, locations: list): await ctx.send_msgs(client, [['Missing', { 'locations': json.dumps(locations) }]]) def get_players_string(ctx: Context): auth_clients = {(c.team, c.slot) for c in ctx.endpoints if c.auth} player_names = sorted(ctx...
"""! @brief Neural Network: Self-Organized Feature Map @details Implementation based on paper @cite article::nnet::som::1, @cite article::nnet::som::2. @authors <NAME> (<EMAIL>) @date 2014-2020 @copyright BSD-3-Clause """ import math import random import matplotlib.pyplot as plt import pyclusterin...
# Classes Similar to functions where we introduced functions like `len()` and `type()` before discussing how to define your own functions, there are many available object types (either in the standard library or that can be imported - like `date`-type objects) *and* you can define your own objects and their associate...
#!/usr/bin/env python # encoding: utf-8 # # bpt.py # # Created by <NAME> on 19 Jan 2017. from __future__ import division from __future__ import print_function from __future__ import absolute_import from packaging.version import parse import warnings import matplotlib import matplotlib.pyplot as plt import numpy as ...
<filename>tests/test_fields.py import re from datetime import datetime from decimal import Decimal import pytest from bson import ObjectId, Decimal128 from aiomongodel import Document, EmbeddedDocument from aiomongodel.errors import ValidationError from aiomongodel.fields import ( AnyField, StrField, IntField, Float...
if buf: blocks.append(Block(buf)) buf = [] j = i if j + 1 >= len(tokens): raise BadExpectedToken("### BAD TOKEN at %s" % (t.location)) directive = tokens[j+1].id if directive == 'define': if i+2 >= len(tokens): raise BadExpectedToken("### BAD TOKEN at %s" % (tokens[i].location)) # Skip '#' and 'define'. ...
<reponame>SmartPhoenix/Persistent-Kingdoms<gh_stars>1-10 from module_constants import * from header_items import * from header_operations import * from header_triggers import * import header_debug as dbg import header_lazy_evaluation as lazy ######################################################################...
<gh_stars>100-1000 #!/usr/bin/env python3 # Collection of utility functions import os import sys import logging import fcntl import subprocess import shutil import requests import time import apprise import random import re import psutil from arm.config.config import cfg from arm.ripper import apprise_bulk from arm.ui...
import random import platform if platform.system() == 'Darwin': import matplotlib matplotlib.use('MacOSX') import matplotlib.pyplot as plt import networkx import plotly.graph_objects as go from matplotlib.collections import LineCollection from plotly import graph_objects from plotly.offline import iplot, plot from...
import asyncio import logging import disnake from disnake.ext import commands from cogs.mixins import AceMixin from utils.configtable import ConfigTable from utils.context import can_prompt from utils.converters import EmojiConverter, MaxLengthConverter from utils.string import po, shorten log = logging.getLogger(__...
import os from datetime import datetime, timedelta from shutil import copy from unittest.mock import Mock, patch import numpy as np import pandas as pd from lighthouse.constants.fields import ( FIELD_COORDINATE, FIELD_PLATE_BARCODE, FIELD_RESULT, FIELD_ROOT_SAMPLE_ID, FIELD_SOURCE, ) from lighthouse.helpers.repo...
define output pulses only in ticks of the timebase. """ val = ctypes.c_double() cfunc = lib_importer.windll.DAQmxGetCOCtrTimebaseRate if cfunc.argtypes is None: with cfunc.arglock: if cfunc.argtypes is None: cfunc.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.POINTER(ctypes.c_double)] erro...
parameter is None. If the session # option isn't set, then use the core's default reset type. if reset_type is None: if self.session.options.get('reset_type') is None: reset_type = self.default_reset_type else: try: # Convert session option value to enum. resetOption = self.session.options.get('reset_type') re...
python index +1 # return -1 for invalid: if model_list is None: return -1 # return 1 if only one choice: if len(model_list) == 1: return 0 + 1 # model list is assumed to be in order simple -> complex. # philosophy: prefer simpler models. aic = vget_aic(model_list, error=np.nan) # if all nans, then return -1...
self.invertImage) _count = 0 for i in range(0, len(self.logic.imagePoints)): _count = _count + len(self.logic.imagePoints[i]) self.labelPointsCollected.text = _count elif self.intrinsicArucoButton.checked: ret = self.logic.findAruco(im, self.invertImage) _count = 0 for i in range(0, len(self.logic.arucoCorners)...
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # Created by HazzaCheng on 2019-09-26 import librosa import numpy as np import random import keras.backend as K from tensorflow.python.keras import Input from tensorflow.python.keras.engine import InputLayer from tensorflow.python.keras.engine import InputSp...
# -*- coding: utf-8 -*- """ Created on Thu Jun 25 11:33:55 2020 @author: User """ import sys from pathlib import Path import functools # import collections from collections import Counter import pickle # import types # import post_helper # import plotting import matplotlib.pyplot as plt import matp...
Threshold level for logging. Available levels: TRACE, DEBUG, INFO (default), WARN, NONE (no logging). Use syntax `LOGLEVEL:DEFAULT` to define the default visible log level in log files. Examples: --loglevel DEBUG --loglevel DEBUG:INFO --suitestatlevel level How many levels to show in `Statistics by Suite` in log...
'2017-08-24' def __init__(self): super(PceTopology.TopologyNodes.TopologyNode.NodeProtocolIdentifier, self).__init__() self.yang_name = "node-protocol-identifier" self.yang_parent_name = "topology-node" self.is_top_level_class = False self.has_list_ancestor = True self.ylist_key_names = [] self._child_contain...
import regex as re from urllib.parse import urljoin, urlparse import glob import os import json def biography_rename(name): map = { "Abu'l-Wafa": "Abul-Wafa", "D'Adhemar": "DAdhemar", "D'Alembert": "DAlembert", "D'Ocagne": "DOcagne", "D'Ovidio": "DOvidio", "De_L'Hopital": "De_LHopital", "Krasnosel'skii": "Kras...
) offsetFile = fileName with open(offsetFile, 'w') as f: f.write(offsetsPlain) def meanOffset(offsets): rangeOffset = 0.0 azimuthOffset = 0.0 i = 0 for offsetx in offsets: i += 1 rangeOffset += offsetx.dx azimuthOffset += offsetx.dy rangeOffset /= i azimuthOffset /= i return [rangeOffset, azimuthOff...
<reponame>oddlama/autokernel<gh_stars>10-100 import autokernel.kconfig import autokernel.config import autokernel.lkddb import autokernel.node_detector import autokernel.symbol_tracking from autokernel import __version__ from autokernel import log from autokernel import util from autokernel.symbol_tracking import set_v...