input
stringlengths
2.65k
237k
output
stringclasses
1 value
1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0], [1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0], [1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0...
#!/usr/bin/env python3 import argparse import requests import urllib3 import sys import json import re import time # The purpose of this script is to facilitate backup/restore of settings in RP4VMs # The script exclusively uses the new RESTful API in RP4VMs 5.3 # Author - <NAME> <<EMAIL>> # Version 1 - A...
import json import pathlib import urllib3 import dash from dash.dependencies import Input, Output, State, ALL, ClientsideFunction from dash.exceptions import PreventUpdate from dash.dash import no_update import dash_html_components as html import dash_bootstrap_components as dbc from flask import flash, get_flashed_m...
<filename>lectures/Python/9_Data_structures/PiRaP-2020-lecture-9.py # auxiliary function for cleaning the workspace def clear_all(): gl = globals().copy() for var in gl: if var[0] == '_': continue if 'func' in str(globals()[var]): continue if 'module' in str(globals()[var]): continue del globals()[var] ...
<reponame>ace-ecosystem/ace2-core # vim: ts=4:sw=4:et:cc=120 # import asyncio import os import os.path import tempfile import shutil import ace.analysis from ace.analysis import RootAnalysis, Observable, AnalysisModuleType, Analysis from ace.logging import get_logger from ace.constants import EVENT_ANALYSIS_ROOT_COM...
<reponame>Nicholas-7/cuml # # Copyright (c) 2020-2021, NVIDIA 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 b...
<filename>test/test_scrambling.py # # SPDX-FileCopyrightText: Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # try: import sionna except ImportError as e: import sys sys.path.append("../") import unittest import numpy as np import tensorflow as tf...
__init__(self): super(Pce.TopologySummary.StatsTopologyUpdate, self).__init__() self.yang_name = "stats-topology-update" self.yang_parent_name = "topology-summary" self.is_top_level_class = False self.has_list_ancestor = False self.ylist_key_names = [] self._child_container_classes = OrderedDict([]) self._chil...
'1f236': {'canonical_name': 'X', 'aliases': ['u6709']}, # '1f21a': {'canonical_name': 'X', 'aliases': ['u7121']}, # '1f238': {'canonical_name': 'X', 'aliases': ['u7533']}, # '1f23a': {'canonical_name': 'X', 'aliases': ['u55b6']}, # '1f237': {'canonical_name': 'X', 'aliases': ['u6708']}, '2734': {'canonical_name': ...
<gh_stars>0 import json import numpy as np from PIL import Image from django.http import JsonResponse from apps.face_element_swapping import get_faces_landmarks from apps.face_element_swapping.change_faces import ChangeFaceElement from ..db_func import DBFunc from ..helpers import convert_img_to_base64, \ convert_ba...
import codecs import json import os from typing import Dict, Tuple, List from nltk.tokenize import word_tokenize def load_tokens_from_factrueval2016_by_paragraphs(text_file_name: str, tokens_file_name: str) -> \ Tuple[Dict[int, Tuple[int, int, str]], str, tuple]: source_text = '' start_pos = 0 tokens_and_their_b...
oranges_r(self): cname = "oranges_r" if cname in matplotlib.cm._cmap_registry: return matplotlib.cm.get_cmap(cname) cmap_file = os.path.join(CMAPSFILE_DIR, "colorbrewer", "oranges.rgb") cmap = Colormap(self._coltbl(cmap_file)[::-1], name=cname) matplotlib.cm.register_cmap(name=cname, cmap=cmap) return cmap @pr...
<gh_stars>10-100 """Base destructors and destructor mixins.""" from __future__ import division, print_function import logging import warnings from abc import abstractmethod from builtins import super from copy import deepcopy from functools import wraps import numpy as np from sklearn.base import BaseEstimator, Trans...
Only attributes that are assignable to this type are returned. inherit: Specifies whether to search this member's inheritance chain to find the attributes. Returns: An array of custom attributes applied to this member, or an array with zero (0) elements if no attributes have been applied. ""...
""" Implementation of the method proposed in the paper: 'Adversarial Attacks on Graph Neural Networks via Meta Learning' by <NAME>, <NAME> Published at ICLR 2019 in New Orleans, USA. Copyright (C) 2019 <NAME> Technical University of Munich """ import tensorflow.compat.v1 as tf import numpy as np from metattack import ...
# SPDX-FileCopyrightText: 2021 <NAME> # SPDX-License-Identifier: MIT """ LED glasses mappings """ # Maps to link IS31FL3741 LEDs to pixels # Full LED glasses 18 x 5 matrix glassesmatrix_ledmap = ( 65535, 65535, 65535, # (0,0) (clipped, corner) 10, 8, 9, # (0,1) / right ring pixel 20 13, 11, 12, # (0,2) / 19 ...
# -*- coding: utf-8 -*- """ Q02 from First assignment letter (c) Backpropagation, Stochastic with Delta Rule and Momentum Term Class Deep Learning UFPB Mar, 31 2018. <NAME> GitHub @rafaelmm """ #################################### # IMPORTANT THINGS HERE # # #################################### ...
<gh_stars>0 import sys import os import json import re # --- re_pattern_package_fullname = r"([A-Za-z0-9_-]+)::([A-Za-z0-9_-]+)" re_pattern_account_id = r"([0-9]+)" re_pattern_stock_package_name = r"(abstract_rtsp_media_source|hdmi_data_sink)" re_pattern_interface_fullname = r"([A-Za-z0-9_-]+)::([A-Za-z0-9_...
# Copyright 2016 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Instalog plugin base. Defines plugin classes (buffer, input, output), and a PluginAPI interface for plugins to access. """ import inspect import logg...
service @property def id(self) -> int: return self._id @id.setter def id(self, id): self._id = id class Command: def __init__(self, needs_admin: bool = None, help_cmd: str = None, description: str = None, cmd: str = None, payload_type: Union[PayloadType, str] = None, operator: Union[Operator, str] = None...
a rank-3 tensor (3D array) with a vector using tensor product and tensor contraction. Parameters ---------- T: sp.Array of dimensions n x m x k v: sp.Array of dimensions k x 1 Returns ------- A: sp.Array of dimensions n x m Example ------- >>>T = sp.Array([[[1, 4, 7, 10], [2, 5, 8, 11], [3, 6, 9, 12]]...
in enumerate(integer_coords)] sc = (sample_coords_minus1, sample_coords, sample_coords_plus1, sample_coords_plus2) quaternary_codes = [quaternary(n, n_dim) for n in range(4 ** n_dim)] sz = integer_coords[0].get_shape().as_list() batch_coords = tf.tile(tf.reshape(tf.range(sz[0]), [sz[0]] + [1] * (len(sz) - 1))...
grounding[GroundingIndex(2,0,"paragraphs of #REF")] = GroundingKey.make_table_grounding("Paragraphs") sparql_query = create_sparql_query_from_qdmr(qdmr, schema, rdf_graph, grounding) result_correct = QueryResult.execute_query_sql(sql_query, schema) result = QueryResult.execute_query_to_rdf(sparql_query, rdf_graph,...
<reponame>denisgolius/aws-syndicate """ Copyright 2018 EPAM Systems, 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 applic...
dst_mean_vec - dst_mean_vec.dot(normal) * normal cos_dihedral = src_mean_projection.dot(dst_mean_projection) / ( np.linalg.norm(src_mean_projection) * np.linalg.norm(dst_mean_projection)) dihedral_angle = np.arccos(cos_dihedral) edges.append([src_idx, dst_idx]) mask.append(1) distances.append(np.linalg.norm(src_t...
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
# stacking.py # module: vespy.stacking # Functions for applying various stacking methods to seismic data from vespy.utils import get_station_coordinates import numpy as np import scipy.signal as sig import cmath def degrees_to_radians(theta): return theta * np.pi / 180 def resolve_slowness_vector(s, baz): ''' Res...
<reponame>highmore9501/fretDance<filename>chordToFinger.py from calculate import arrangeNotesInChord def copyNewDancer(dancer): """ 复制原来的dancer,并且把手指都抬起来 :param dancer: :return: """ import copy newDancer = copy.deepcopy(dancer) newDancer.releaseFingers() return newDancer def getChordList(chordPosition): "...
self.blockSignals(False) return except Exception as e: log.debug(str(e)) self.app.inform.emit('[success] %s' % _("Tool(s) deleted from Tool Table.")) self.blockSignals(False) self.build_ui() def on_generate_buffer(self): self.app.inform.emit('[WARNING_NOTCL] %s...' % _("Buffering solid geometry")) self.obj_...
""" Morgan. authors: <NAME> and <NAME> contact: dangeles at caltech edu """ import pandas as pd import warnings as wng import numpy as np import pymc3 as pm # import theano ############################################################################### # ----------------------------------------------------------------...
timeout How long to wait for the output to exist before raising a :class:`htmap.exceptions.TimeoutError`. If ``None``, wait forever. """ return self._load_output(component, timeout=timeout) def __getitem__(self, item: int) -> Any: """Return the output associated with the input index. Does not block.""" return s...
<gh_stars>1-10 ## kClassification.py ## K-label classification cadres with cross-entropy loss ## NOTE: This file needs to be tested and should get an example analysis notebook. from __future__ import division, print_function, absolute_import import time import numpy as np import tensorflow as tf import utility as u ...
783.0 5.580 0 784.0 5.578 0 785.0 5.578 0 786.0 5.576 0 787.0 5.552 0 788.0 5.534 0 789.0 5.534 0 790.0 5.534 0 791.0 5.539 0 792.0 5.542 0 793.0 5.531 0 794.0 5.524 0 795.0 5.520 0 796.0 5.533 0 797.0 5.562 0 798.0 5.566 0 799.0 .000 1 800.0 .000 1 801.0 .000 1 802.0 .000 1 803.0 .000 1 804.0 .000...
].AdjointGradientJacobi( v.tVector[ i ][ 0 ], j.tVector[ i ][ 0 ], dj.tVector[ i ][ 0 ] ) jOutput.tVector[ i ][ 1 ], jOutputDash.tVector[ i ][ 1 ] = self.pt[ i ][ 1 ].AdjointGradientJacobi( v.tVector[ i ][ 1 ], j.tVector[ i ][ 1 ], dj.tVector[ i ][ 1 ] ) return jOutput, jOutputDash def Write( self, filePath ): ...
from pliers import config from pliers.filters import FrameSamplingFilter from pliers.extractors import (GoogleVisionAPIFaceExtractor, GoogleVisionAPILabelExtractor, GoogleVisionAPIPropertyExtractor, GoogleVisionAPISafeSearchExtractor, GoogleVisionAPIWebEntitiesExtractor, GoogleVideoIntelligenceAPIExtractor, Googl...
<filename>ufora/cumulus/test/CheckpointingTest_test.py<gh_stars>100-1000 # Copyright 2015 Ufora 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...
import re import time from selenium.webdriver.common.by import By from selenium.webdriver.support.select import Select from helpers import auditchecker from view_models import sidebar as sidebar_constants, clients_table_vm, members_table, \ keys_and_certificates_table as keyscertificates_constants, popups as popups,...
# -*- coding: utf-8 -*- # Copyright 2020 The TensorFlowTTS Team and <NAME> (@kan-bayashi) # # 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 # # Un...
is None: return u.one return u.Unit(unit) @property def wavelength(self): """Wavelength of the observation.""" return u.Quantity(self.meta.get('wavelnth', 0), self.waveunit) @property def observatory(self): """Observatory or Telescope name.""" return self.meta.get('obsrvtry', self.meta.get('telescop', "")...
when on a loop self.size = 0 # Residue size (0:1) 0:ignor size, 1:Large residue self.SpecialRes = {0:0} # Special characteristic of residue self.n1 = 0 self.n2 = 0 self.ResVol = 162.9 self.SideChainVol = 162.9-54.1 class Pro(AminoAcid): def __init__(self): AminoAcid.__init__(self,'P') # Proline # ***...
# -*- coding: utf-8 -*- # encoding=utf8 import sys if sys.version_info >= (3,0,0): long = int import elasticsearch_dsl es_dsl_version = elasticsearch_dsl.__version__ from six import iteritems from elasticsearch import Elasticsearch, helpers from elasticsearch_dsl import * from elasticsearch_dsl.connections import conn...
<reponame>team-aisaac/aisaac-strategy #!/usr/bin/env python # coding:utf-8 import math import rospy import numpy as np from world.objects import Objects from aisaac.msg import Ball_sub_params, Def_pos from statistics import variance import config from common import functions WORLD_LOOP_RATE = config.WORLD_LOOP_RATE "...
<filename>qtgui/panels/face.py """ File: face.py Author: <NAME> Email: <EMAIL> Graphical interface for face detection and recognition. """ # pylint --method-naming-style=camelCase --attr-naming-style=camelCase qtgui.panels.face # standard imports import logging # third party imports import numpy as np # Qt imports ...
the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text fro...
<reponame>anshul96go/toolbox from qnt.data.common import * from qnt.data.secgov import load_facts import itertools import pandas as pd import datetime as dt from qnt.log import log_info, log_err def load_indicators( assets, time_coord, standard_indicators=None, builders = None, start_date_offset = datetime.timed...
nitems = m_%s.receive(data, minReturned, maxReturned);\n" % xactor_name) f_out.write (" if (nitems == 0)\n") f_out.write (" return nitems;\n\n") f_out.write ("%s\n" % resizeparams) f_out.write (" for (int i=0; i<nitems; i++) {\n") for verilog_name in xactor.verilog_names: f_out.write (" %s[i] = data[i].m_field_%s...
in the database. :param str messageid: Id of the message to search. Note that messageid is a string with the format msg-\d{1,3}. :return: True if the message is in the database. False otherwise. ''' return self.get_message(messageid) is not None def get_message_time(self, messageid): ''' Get the time when th...
import sys, inspect, copy import numpy as np from collections import OrderedDict from ..data.mfstructure import DatumType from ..data import mfstructure, mfdatautil, mfdata from ..data.mfdatautil import MultiList from ..mfbase import ExtFileAction, MFDataException from ..utils.mfenums import DiscretizationType ...
self.params.train_dir is None: print('note that train_dir is not specified') # raise ValueError('Trained model directory not specified') try: global_step, checkpoint_path = load_checkpoint(saver, sess, self.my_params.load_ckpt) self.last_weights_file = checkpoint_path print('got global_step={} in checkpoint {}'.f...
quarters, the search result will list 15 different files. If we want to download a `~lightkurve.collections.LightCurveFileCollection` object containing all 15 observations, use:: >>> search_result.download_all() # doctest: +SKIP or we can specify the downloaded products by limiting our search:: >>> lcf = searc...
LETTER AU 0A15 GURMUKHI LETTER KA 0A16 GURMUKHI LETTER KHA 0A17 GURMUKHI LETTER GA 0A18 GURMUKHI LETTER GHA 0A19 GURMUKHI LETTER NGA 0A1A GURMUKHI LETTER CA 0A1B GURMUKHI LETTER CHA 0A1C GURMUKHI LETTER JA 0A1D GURMUKHI LETTER JHA 0A1E GURMUKHI LETTER NYA 0A1F GURMUKHI LETTER TTA 0A20 GURMUKHI LETTER TTHA 0A21 GURMUKHI...
<filename>UserCode/John/ReWriteAcousticT0.py<gh_stars>1-10 from __future__ import division import copy import re import numpy as np import scipy.signal from scipy import optimize import matplotlib.pyplot as plt def my_rms(arr): #return np.sqrt(arr.dot(arr)/arr.size) return np.std(arr) def extend_window(w, r): # ...
* sin(δ) where: ϕ - latitude [rad] δ - solar declination [rad] ω - solar time angle [rad] Parameters ---------- dt : numpy.datetime64 Moment. lat : float Decimal latitude in degrees. lon : float Decimal longitude in degrees. Returns ------- float Solar zenith angle in radians. ...
>= 2: print('build_schedule(): Adding input variable hook: ', in_var_hook) print('For input variable: ', ar) # Create post-run hooks for any arrays that are dynamically # allocated inside the schedule. if unique_array_index in self.dynamically_allocated_unique_index: if key in self.array_id_to_param_map: param_...
0.1*m.x4976 - 0.1*m.x4977 - 0.1*m.x4978 - 0.1*m.x4979 - 0.1*m.x4980 - 0.1*m.x4981 - 0.1*m.x4982 - 0.1*m.x4983 - 0.1*m.x4984 - 0.1*m.x4985 - 0.1*m.x4986 - 0.1*m.x4987 - 0.1*m.x4988 - 0.1*m.x4989 - 0.1*m.x4990 - 0.1*m.x4991 - 0.1*m.x4992 - 0.1*m.x4993 - 0.1*m.x4994 - 0.1*m.x4995 - 0.1*m.x4996 - 0.1*m.x4997 - 0.1*m.x4...
""" peak, center_x, center_y, radius, focus, width_x, width_y = theta if 7. < center_x < 14. and 7. < center_y < 14. and 0. < width_x < 0.25 and 0. < width_y < 0.3 and \ peakrange[0] < peak < peakrange[1] and 0.4 < radius < 2. and 0.3 < focus < 2.: return 0. else: return -np.inf def log_likelihood(theta, x, y, ...
v)) pass # # load polygons face # vIndex = 0 model = Character(modelName) model.setPythonTag('path', pmx_model.path) model.setPythonTag('version', str(pmx_model.version)) model.setPythonTag('name', modelName) model.setPythonTag('english_name', pmx_model.english_name) model.setPythonTag('comment', pmx_model....
import typing from .._block_utils import _load_btype, BlockParam, _load_btypes from ..actions import EntityAction from ..ifs import IfEntity from ...classes import Arguments, Tag, DFNumber from ...enums import EntityTarget, EntityActionType, IfEntityType, \ BlockType, Hand, EffectParticleMode, HorseVariant, HorseColo...
import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torchtext.legacy.datasets import Multi30k from torchtext.legacy.data import Field, BucketIterator import matplotlib.pyplot as plt import matplotlib.ticker as ticker import spacy import numpy as np import random impor...
**MaintenanceTrackName** *(string) --* The name of the maintenance track that the cluster will change to during the next maintenance window. - **EncryptionType** *(string) --* The encryption type for a cluster. Possible values are: KMS and None. For the China region the possible values are None, and Legacy. - **...
<reponame>hu120051/cybercafe_management from flask import Flask from flask import render_template from flask import request import pymysql import datetime app = Flask(__name__) app.config['SECRET_KEY'] = '123456' @app.route('/') # 进入首页 def index(): return render_template('index.html') # ########管理员端######## # @app...
default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.portals_id_designs_nk_tags_rel_fk_put_with_http_info(id, nk, fk, callback=callback_function) :param callbac...
# MIT License # # Copyright (c) 2019 TU Delft Embedded and Networked Systems Group/ # Sustainable Systems Laboratory. # # 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, in...
will be sampled per image (again, used for both x- and y-axis). * If a dictionary, then it is expected to have the keys "x" and/or "y". Each of these keys can have the same values as described before for this whole parameter (`scale`). Using a dictionary allows to set different values for the axis. If they are set...
== 0 return_node = expand_func(game, parent) assert len(botbowl.D6.FixedRolls) == 0 game.revert(parent.step_nbr) return return_node try: with only_fixed_rolls(game): game.step() except AttributeError as e: raise e action_node = ActionNode(game, parent) game.revert(parent.step_nbr) assert parent.step_nbr ==...
'Hexacom'}, '9173008':{'en': 'Hexacom'}, '55839932':{'en': 'Claro BR'}, '65913':{'en': 'SingTel'}, '55839930':{'en': 'Claro BR'}, '55839931':{'en': 'Claro BR'}, '65916':{'en': 'StarHub'}, '65917':{'en': 'SingTel'}, '65914':{'en': 'StarHub'}, '65915':{'en': 'SingTel'}, '558799639':{'en': 'TIM'}, '5...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright 2016-2018 by I3py Authors, see AUTHORS for more details. # # Distributed under the terms of the BSD license. # # The full license is in the file LICENCE, distributed with this software. # ----------------...
<gh_stars>0 # -*- coding: utf-8 -*- # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
<reponame>Guts/feedparser # Support for the GeoRSS format # Copyright 2010-2020 <NAME> <<EMAIL>> # Copyright 2002-2008 <NAME> # All rights reserved. # # This file is a part of feedparser. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following con...
<reponame>mfeed/PySwitchLib<filename>pyswitchlib/asset.py import requests import weakref import re import os import sys import threading import xml.etree.ElementTree as ElementTree import xmltodict import json import atexit import Pyro4 import Pyro4.util import Pyro4.errors from distutils.sysconfig import get_python_li...
- 2""" self.create_clean_ou("OU=ou1," + self.base_dn) mod = "(A;CI;LC;;;%s)(A;CI;LC;;;%s)" % (str(self.user_sid), str(self.group_sid)) self.sd_utils.dacl_add_ace("OU=ou1," + self.base_dn, mod) tmp_desc = security.descriptor.from_sddl("D:(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;DA)" + mod, self.domain_sid) self.ldb_admin....
# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (BSD-3-Clause) """ """ import yaml from . import util # The tree of c and fortran statements. cf_tree = {} fc_dict = {} # dictionary...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2021 <NAME> # # 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...
#!/usr/bin/python from p4_hlir.main import HLIR from p4_hlir.hlir.p4_parser import p4_parse_state import p4_hlir from p4_hlir.hlir.p4_tables import p4_table from compiler import HP4Compiler, CodeRepresentation import argparse import itertools import code from inspect import currentframe, getframeinfo import sys import...
is # behaving as a mailing list if shared.safeConfigGetBoolean(toAddress, 'mailinglist') and messageEncodingType != 0: try: mailingListName = shared.config.get( toAddress, 'mailinglistname') except: mailingListName = '' # Let us send out this message as a broadcast subject = self.addMailingListNameToSubject( ...
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild from pkg_resources import parse_version import kaitaistruct from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO from enum import Enum import collections if parse_version(kaitaistruct.__version__) < parse_versi...
get_row(self, idx: int) -> List[float]: """ TODO: Method docstring """ return self._A[idx] def get_col(self, idx: int) -> List[float]: """ TODO: Method docstring """ return [row[idx] for row in self._A] def transpose(self) -> 'Matrix': """ Returns the transpose of the calling matrix. """ M = Matrix.zeros(s...
<filename>vis_utils/animation/skeleton_animation_controller.py #!/usr/bin/env python # # Copyright 2019 DFKI GmbH. # # 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, inclu...
# Save the official application info. They will be # persisted in the next status update app.regenerate_application_info(name, version, patches) if not cutils.verify_checksum(app.inst_path): _handle_extract_failure('checksum validation failed.') mname, mfile = self._utils._find_manifest_file(app.inst_path) # Sav...
u0 {3,D} 7 C u0 {4,D} """, thermo = u'Cds-(Cdd-O2d)(Cds-Cds)Cb', shortDesc = u"""""", longDesc = u""" """, ) entry( index = -1, label = "Cds-(Cdd-S2d)(Cds-Cd)Cb", group = """ 1 * Cd u0 {2,D} {3,S} {4,S} 2 Cdd u0 {1,D} {5,D} 3 Cd u0 {1,S} {6,D} 4 Cb u0 {1,S} 5 S2d u0 {2,D} 6 C u0 {3,D} """, thermo = None, sh...
import os import logging import functools from typing import Dict, List from sqlalchemy import create_engine, inspect, Table from sqlalchemy.schema import CreateSchema from snowflake.sqlalchemy import URL, TIMESTAMP_NTZ from snowflake.connector.errors import ProgrammingError from snowflake.connector.network import Rea...
1.0, 3.0, 2.0], [21.0, 0.0, 1.0, 33.0], ] ) expected = array( [ [1.0, 10.0, 4.0, 3.0], [9.0, 18.0, 5.0, 6.0], [4.0, 1.0, 3.0, 2.0], [21.0, 0.0, 1.0, 33.0], ] ) filter_exclude_positions(aln, m) assert_allclose(m, expected) # filter zero positions (max_exclude_percentage = percent exclude) aln = make_align...
to ensure that the initial # incrementation of this index by the _enqueue_hint_child() directly called # below initializes index 0 of the "hints_meta" fixed list. hints_meta_index_last = -1 # ..................{ FUNC ~ code }.................. # Python code snippet type-checking the current pith against the curre...
# %% from functools import partial import logging import numpy as np import torch import colorsys from torchvtk.utils import make_5d, tex_from_pts # Persistent Homology peak extraction class Peak: def __init__(self, startidx): self.born = self.left = self.right = startidx self.died = None def get_persistence(s...
# streamclone.py - producing and consuming streaming repository data # # Copyright 2015 <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 import time from .i18n...
] for slackrtm in _slackrtms: segments.append(hangups.ChatMessageSegment('%s' % slackrtm.name)) segments.append(hangups.ChatMessageSegment('\n', hangups.SegmentType.LINE_BREAK)) bot.send_message_segments(event.conv, segments) def slack_channels(bot, event, *args): """list all slack channels available in specif...
import unittest from src.preprocess.pattern import NumberOfHoles, DefineLanguage_HoleReachabilitySolver, NtGraphBuilder from src.model.pattern import PatSequence, BuiltInPat, Nt, Repeat, Lit, LitKind, BuiltInPatKind, RepeatMatchMode, InHole, PatternAttribute from src.model.tlform import DefineLanguage, Module from src....
import datetime from django.db import models from django.db.models import Q, QuerySet from .base import OCDBase, LinkBase, OCDIDField, RelatedBase, IdentifierBase from .division import Division from .jurisdiction import Jurisdiction from ... import common # abstract models class ContactDetailBase(RelatedBase): """ ...
number. :type i: int :returns: subsample satisfying the testing condition. :rtype: pandas.DataFrame ''' return smp[self._true_cond(smp, i)] def train_sample( self, smp, i, weights = None ): ''' :param smp: input sample. :type smp: pandas.DataFrame :param i: fold number. :type i: int :param weights: possibl...
<reponame>kitteltom/probabilistic-energy-forecasting<filename>models/deep_ar.py import numpy as np import datetime as dt import time from tqdm import tqdm import os import torch from torch import nn from torch.utils.data import TensorDataset, DataLoader from models.forecast_model import ForecastModel from distributio...
<filename>root/filter/image_filter.py #!/usr/bin/python import imageio import matplotlib.pyplot as plt import numpy as np from root.util import ImageUtil as util from PIL import Image _MIN_PIXEL = 0 _MAX_PIXEL = 255 class ImageFilter(): @staticmethod def isGrayScale(img): if len(img.shape) == 2: return True re...
"""Functions to calculate the quidel sensor statistic.""" import numpy as np import pandas as pd def _prop_var(p, n): """ Calculate variance of proportion. var(X/n) = 1/(n^2)var(X) = (npq)/(n^2) = pq/n """ return p * (1 - p) / n def fill_dates(y_data, first_date, last_date): """ Ensure all dates are listed i...
determined from the relation `counts_total = counts_signal + counts_background` Note that if `background_variance=0`, it makes more sense to use `GammaUpperLimit`, which is equivalent but analytical rather than numerical. """ self.limit = limit self.confidence_level = confidence_level _d_unscaled = GeneralGam...
<gh_stars>1-10 # !/usr/bin/env python # -*- coding:utf-8 _*- # @Author: swang # @Contact: <EMAIL> # @Project Name: keyword_spotting_system # @File: test.py # @Time: 2021/11/11/21:51 # @Software: PyCharm import os, sys CRT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(CRT_DIR) # print('sys.path:', sy...
types.CodeType = compile(code, f.__code__.co_filename, "exec") for const in compiled.co_consts: if ( isinstance(const, types.CodeType) and const.co_name == f.__code__.co_name ): f.__code__ = const break @functools.wraps(f) def instrumented_f(*args, **kwargs): with self.tracing_enabled(tracing_enabled_file=f_...
# -*- coding: utf-8 -*- from applications.opentree.modules.opentreewebapputil import( get_opentree_services_method_urls, extract_nexson_from_http_call, fetch_github_app_auth_token, get_maintenance_info) # N.B. This module is shared with tree-browser app, which is aliased as # 'opentree'. Any name changes will be ne...
''' ## NAME: ProteinAnalysis.py ## LANGUAGE & VERSION: python 3.8.5 ## AUTHORS: <NAME> <<EMAIL>> <NAME> <<EMAIL>> ## DATE: November, 2021. ## DESCRIPTION & LOGIC: This script uses BioPython tools numpy, pandas, seaborn, matplotlib and argparse to run a functional protein analysis between a protein query...
Disconnected_Boiler_BG_capacity_heating_W = 0 Disconnected_Boiler_NG_share_heating = 0 Disconnected_Boiler_NG_capacity_heating_W = 0 Disconnected_FC_share_heating = 0 Disconnected_FC_capacity_heating_W = 0 Disconnected_GHP_share_heating = 0 Disconnected_GHP_capacity_heating_W = 0 Disconnected_VCC_to_AHU_share_c...
<reponame>NieR1711/Fire import discord from discord.ext import commands from discord.ext.commands import has_permissions, bot_has_permissions #from moviepy.editor import VideoFileClip, TextClip, CompositeVideoClip from fire.converters import Member, Role, TextChannel import aiosqlite3 import functools import dat...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from os.path import join, basename, exists import six import numpy as np import utool as ut print, rrr, profile = ut.inject2(__name__) @six.add_metaclass(ut.ReloadingMetaclass) class DataSet(ut.NiceRepr): """ ...