input
stringlengths
2.65k
237k
output
stringclasses
1 value
''' Classes and methods for the pseudocluster sampling method ''' ## pseudocluster.py ## author: <NAME> ## email: <EMAIL> from __future__ import division, absolute_import, print_function import rasterio import numpy as np import math import warnings from collections import OrderedDict try: from mul...
<reponame>dchaplinsky/pep.org.ua # coding: utf-8 from __future__ import unicode_literals from itertools import chain from copy import deepcopy from urlparse import urlparse import datetime from collections import defaultdict, OrderedDict from django.db import models from django.core.urlresolvers import reverse from d...
import datetime from datetime import date from datetime import datetime import requests import pymysql import json import math import skfuzzy as fuzz from skfuzzy import control as ctrl import numpy as np import matplotlib from apscheduler.schedulers.blocking import BlockingScheduler import config ''' Developed by <NA...
<filename>pvfactors/geometry/pvarray.py """Module containing PV array classes, which will use PV rows and ground geometries.""" import numpy as np from pvfactors.config import X_ORIGIN_PVROWS, VIEW_DICT, DISTANCE_TOLERANCE from pvfactors.geometry.base import \ _get_solar_2d_vectors, BasePVArray, _get_rotation_from_ti...
<filename>ASur.py #!/usr/bin/env python # -*- coding: UTF-8 -*- #************************************************************************ # --- Copyright (c) INRS 2016 # --- Institut National de la Recherche Scientifique (INRS) # --- Copyright (c) <NAME> 2018 # --- # --- Licensed under the Apache License, Version 2.0 (...
<reponame>marcelm/dnaio import os import shutil import subprocess import sys from io import BytesIO from tempfile import mkdtemp from textwrap import dedent from pytest import raises, mark import dnaio from dnaio import ( FileFormatError, FastaFormatError, FastqFormatError, FastaReader, FastqReader, InterleavedPair...
q.W[m]['prodT'] = np.dot(q.W[m]['mean'].T, q.W[m]['mean']) + self.d[m]*q.W[m]['cov'] else: print ('Cov W' + str(m) + ' is not invertible, not updated') del w_cov def update_b(self,m): """Updates the variable b. This function uses the variables of the learnt model to update b of the specified view. Param...
:param async_req bool :param str fields: :param int size: :param int offset: :param str filter: :return: UnmonitoredDevicePaginationResponse If the method is called asynchronously, returns the request thread. """ all_params = ['fields', 'size', 'offset', 'filter'] # noqa: E501 all_params.append('async_req') ...
<filename>lambda_proxy/proxy.py<gh_stars>10-100 """Translate request from AWS api-gateway. Freely adapted from https://github.com/aws/chalice """ from typing import Any, Callable, Dict, List, Optional, Tuple, Sequence, Union import inspect import os import re import sys import json import zlib import base64 import ...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use...
sure this doesn't happen again! #dict_astrom_after = {} #for i in xrange(len(results[0])): dict_astrom_after[keys[i]] = results[0][i] #stuck_test=dict_astrom_after==dict_astrom_before #print 'get_astrom_run_sextract| dict_astrom_after==dict_astrom_before=',stuck_test #if stuck_test: # raise Exception(...
yoffset, width, height, format, type, pixels): pass @params(api='gl', prms=['program', 'programInterface', 'name']) def glGetProgramResourceLocation(program, programInterface, name): pass @params(api='gl', prms=['index', 'v']) def glViewportIndexedfv(index, v): pass @params(api='gl', prms=['mode', 'count', 'ty...
from typing import Dict from code.front_end.our_ast import * import itertools as itl from collections import OrderedDict class SemanticAnalysisError(Exception): #Esception que voy a utilizar para detectar los errores semanticos, recive una lista de strings con los problemas y en su __str__ los imprime de...
<reponame>s911415/CheckSum-Tool # The MIT License # # Copyright (c) 2008 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation ...
list_properties = [ 'name', 'state', 'time', 'checkpointOf', 'fileSystemSize', 'baseline', 'writeable', 'readOnly', ] self._copy_properties(item[1], check_point, list_properties) check_point['id'] = item[1].get('checkpoint', '') break if check_point['id'] == '': status = constants.STATUS_ERROR return ...
<filename>ARQ/arq_tools.py #!/usr/bin/python # Script: .py # Author: <NAME>' """ Description: ARQ: Assessment and Comparison of RNA-seq Quantification Methods Usage: Source: Reference: """ import sys import os from arq_debug import printDebug ##################################################################...
(tmp7465 if depth3 else tmp6988) tmp7472 = (tmp6954 if depth7 else tmp6976) tmp7471 = (tmp7472 if depth6 else tmp6988) tmp7470 = (tmp7471 if depth5 else tmp6988) tmp7469 = (tmp7470 if depth4 else tmp6988) tmp7468 = (tmp7469 if depth3 else tmp6988) tmp7463 = (tmp7464 if depth2 else tmp7468) tmp7478 = (tmp6954 if ...
vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(hbox, 0, wx.ALL | wx.EXPAND, 7) self.vbox = vbox self.SetSizer(vbox) self.Layout() ok.SetDefault() def set_component(self, c, border=7, line=False): self.vbox.Insert(0, c, 1, wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, border) if line: self.vbox.Insert(1, wx.StaticLine(...
np.array(y_true) y_probas = np.array(y_probas) classes = np.unique(y_true) if len(classes) != 2: raise ValueError('Cannot calculate KS statistic for data with ' '{} category/ies'.format(len(classes))) probas = y_probas # Compute KS Statistic curves thresholds, pct1, pct2, ks_statistic, \ max_distance_at, cla...
# # Copyright 2020 Nebulon, Inc. # All Rights Reserved. # # DISCLAIMER: THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO # EVENT SHALL THE AUTHORS OR COPYRIG...
:type HighlightsInfo: list of HighlightsInfomation :param Message: 状态描述 :type Message: str :param Status: 任务状态 :type Status: str """ self.HighlightsInfo = None self.Message = None self.Status = None def _deserialize(self, params): if params.get("HighlightsInfo") is not None: self.HighlightsInfo = [] for i...
= kwargs.pop('port_priority') callback = kwargs.pop('callback', self._callback) return callback(config) def get_stp_brief_info_output_spanning_tree_info_spanning_tree_mode_stp_stp_port_designated_bridge_id(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") get_stp_brief_info = ET.Elemen...
<reponame>dudaspm/LDA_Bias_Data<gh_stars>0 #!/usr/bin/env python # coding: utf-8 # # Workshop Notebook # ## Notebook Introduction # ### How to Use this Notebook # ### References # I know it tradition to have the refences at the end of books, but when you are standing on the shoulders of giants. You thank them fir...
<reponame>ryanfarr01/blue """Define the Group class.""" from __future__ import division from collections import Iterable, Counter, OrderedDict, defaultdict from itertools import product, chain import warnings from six import iteritems, string_types, itervalues from six.moves import range import numpy as np from ope...
<reponame>account-login/arggen import argparse import enum from functools import partial import json import re import os import sys from typing import Set, Sequence, Tuple, Dict, List __version__ = '0.0.1.dev0' class ArgError(Exception): pass class ArgType(enum.Enum): BOOL = object() COUNT = object() ONE = ob...
<gh_stars>10-100 # #!/usr/bin/env python # -*- coding: utf-8 -*- # # Electrum - lightweight Bitcoin client # # Copyright (C) 2014 <NAME> # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation,...
# vol_std = np.zeros((img_batch_size, num_passes)) ax = torch.distributions.Normal(torch.tensor(0.0).to(device=torch.device("cuda:0")), torch.tensor(1.0).to(device=torch.device("cuda:0"))) for fpass in range(num_passes): # if uncertainty_flag and dropout_level != 0.0: # print('You must have hetero. + DO on!') # n...
<filename>pyvision3/image.py """ Created on Dec 18, 2015 @author: <NAME> This module defines the pyvision image class, which wraps the image data (array) in a class with convenient methods. One very useful aspect of the image class is that annotations (such as bounding boxes that might be drawn around detection regio...
# rwk misc module import scipy, numpy import time import os, glob, re, sys from numpy import * import copy #from IPython.core.debugger import Pdb #mytrace=Pdb().set_trace import cPickle def get_date_str(): date_str = time.strftime('%m_%d_%y') return date_str def clean_list(listin): """Remove blank entries from...
and not self.stateful: return [] updates = self._unfiltered_updates # `updates` might contain irrelevant updates, so it needs to be filtered # with respect to inputs the model has been called on. relevant_inputs = [] for i in range(0, len(self._inbound_nodes)): inputs = self.get_input_at(i) if isinstance(inpu...
<reponame>grzracz/MindWave-Sorting-Hat import socket import threading import pygame import random import winsound import math import datetime import os from queue import Queue from ctypes import pointer, POINTER, cast, c_int, c_float TCP_IP = '127.0.0.1' TCP_PORT = 13854 BUFFER_SIZE = 1024 INSTANCES_NUMBER = 4 WIDTH ...
import pytest from graphql_relay import to_global_id from ...core.relay import extract_global_id from ...core.tests import extract_serializer_input_fields from ...form.models import Answer, Document, Question from .. import serializers @pytest.mark.parametrize( "question__type,question__data_source,answer__value,an...
<reponame>khushhallchandra/CS-7641 import copy import logging import pandas as pd import numpy as np from collections import Counter from sklearn import preprocessing, utils import sklearn.model_selection as ms from scipy.sparse import isspmatrix from sklearn.pipeline import Pipeline from sklearn.preprocessing import...
import json import os import pymzml import pandas as pd import numpy as np from tqdm import tqdm from matchms.importing import load_from_mgf from pyteomics import mzxml, mzml import logging logger = logging.getLogger('msql_fileloading') def load_data(input_filename, cache=False): """ Loading data generically Arg...
# can extract only required terms.. # -- but has to handle terms like E(eps D^beta eps) which should not be replace and in tre.. rhs = rhs.subs(closed_subs_tree) # -3- Closure rhs = rhs.subs(self.internal_closure) return rhs @property def unclosed_terms(self): unclosed_terms = set() # -1- Search in variance...
import pytest import sqlparse from typing import Tuple, List, Optional from unittest.mock import patch, MagicMock from sql_translate.engine import global_translation from sql_translate import utils GHTP = global_translation.GlobalHiveToPresto() def test_create_parent() -> None: _GlobalHiveToPresto = global_translat...
as expected. method_chains = pika.spec.Basic.Deliver( routing_key=self.chains_routing_key) method_general = pika.spec.Basic.Deliver( routing_key=self.general_routing_key) body_chain_initial = json.dumps( self.sent_configs_example_chain) body_general_initial = json.dumps( self.sent_configs_example_general) body...
the VisTrails workflow (containing a list of .tif raster files) as an input to the raster converter. All of the files listed in the MDS will be converted to the raster format specified in the "Format" dialogue box. ''' #configuration = [] _input_ports = [("inputMDS", "(gov.usgs.sahm:MergedDataSet:Other)"), ('in...
tiebreak from game; create view if not exists heat_game_divided as select * from game_divided where game_type = 'P'; create view if not exists player_wins as select p.id, sum(case when g.p_id is null then 0 when g.p_score is null or g.opp_score is null then 0 when g.p_score == 0 and g.opp_score == 0 and g.tiebreak ...
# 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/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
<filename>qiskit/algorithms/optimizers/spsa.py # This code is part of Qiskit. # # (C) Copyright IBM 2018, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/license...
log in acc.logs: if log["timestamp"] == timestamp: return Log(**log) return None async def get_member_logs(self, member: discord.Member) -> Union[List[Log], list]: """Renvoie tous les logs (sous forme d'objets Log) d'un membre Renvoie une liste vide si aucun log n'est présent""" acc = await self.get_account(me...
want to make sure that if we have a quarter with an event date that gets pushed back, we don't start overwriting for the next quarter early. Likewise, if we have a quarter with an event date that gets pushed forward, we want to make sure that we start applying adjustments at the appropriate, earlier date, rather t...
<reponame>Leonardo-Maciel/PSO_Maciel<gh_stars>10-100 """ `matplotlib.figure` implements the following classes: `Figure` Top level `~matplotlib.artist.Artist`, which holds all plot elements. `SubplotParams` Control the default spacing between subplots. """ import inspect import logging from numbers import Integral ...
0], K0) assert_allclose(res.predicted_state[:, 1], [y11, y21 - theta * y11]) P2 = np.array([[1 + sigma2_mu, -theta], [-theta, 1 + theta**2]]) assert_allclose(res.predicted_state_cov[..., 1], P2) assert_allclose(res.predicted_diffuse_state_cov[..., 1], np.zeros((2, 2))) # Miscellaneous assert_equal(res.nobs_diff...
import tensorflow as tf import numpy as np import random from sklearn.preprocessing import MinMaxScaler from sklearn.model_selection import TimeSeriesSplit from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import accuracy_score, f1_score, pre...
<reponame>leith-bartrich/fiellc import typing from fiepipelib.assetaspect.routines.autoconf import AutoConfigurationResult from fiepipelib.assetstructure.routines.structure import AbstractSubPath, AbstractAssetBasePath, \ GenericAssetBasePathsSubDir, AbstractRootBasePath, AutoManageResults, StaticSubDir, AutoCreateRe...
<filename>models/new/fanogan.py import tensorflow as tf from base.base_model import BaseModel from utils.alad_utils import get_getter class FAnogan(BaseModel): def __init__(self, config): super(FAnogan, self).__init__(config) self.build_model() self.init_saver() def build_model(self): # Kernel initialization ...
import torch import torch.nn as nn import torch.nn.functional as F import math import pdb, time from torch.autograd import Variable torch.manual_seed(12) SIGMA = 1 EPSILON = 1e-5 class GatedConv1d(nn.Module): def __init__(self, input_channels, output_channels, kernel_size, stride, padding=0, dilation=1,...
<gh_stars>1-10 import pandas as pd import numpy as np import scipy.stats import scipy.special import pysam import h5py import multiprocessing as mp import statsmodels.stats.multitest from DIGDriver.sequence_model import sequence_tools from DIGDriver.sequence_model import gp_tools def tabix_to_dataframe(tbx, chrom, st...
# -*- coding: UTF-8 -*- # generated by wxGlade 0.4 on Thu Jul 13 10:46:35 2006 import wx from wx.lib.floatcanvas import NavCanvas, FloatCanvas import os, types, sys, traceback from lxml import etree from document import Document from config import Config from deco import DecoImage # begin wxGlade: dependencies # en...
power = {'BUSES': {'Area': 1.33155, 'Bus/Area': 1.33155, 'Bus/Gate Leakage': 0.00662954, 'Bus/Peak Dynamic': 0.0, 'Bus/Runtime Dynamic': 0.0, 'Bus/Subthreshold Leakage': 0.0691322, 'Bus/Subthreshold Leakage with power gating': 0.0259246, 'Gate Leakage': 0.00662954, 'Peak Dynamic': 0.0, 'Runtime Dynamic': 0.0, ...
-0.342929519602), (0.279196853654, -0.342990041745), (0.273185849664, -0.343049210031), (0.267171726877, -0.343107029136), (0.261154558848, -0.34316350371), (0.255134418626, -0.343218638375), (0.249111378777, -0.343272437724), (0.2430855114, -0.343324906316), (0.237056888143, -0.343376048676), (0.23102558023, ...
Returns: The help text. """ pass def GetHostRawElementProviderCore(self, *args): #cannot find CLR method """ GetHostRawElementProviderCore(self: AutomationPeer) -> HostedWindowWrapper Tells UI Automation where in the UI Automation tree to place the hwnd being hosted by a Windows Presentation Foun...
isinstance(task.importer_spec.artifact_uri, str): importer_spec.artifact_uri.constant.string_value = task.importer_spec.artifact_uri return importer_spec def build_container_spec_for_task( task: pipeline_task.PipelineTask ) -> pipeline_spec_pb2.PipelineDeploymentConfig.PipelineContainerSpec: """Builds PipelineCo...
<filename>lib/models/mask.py import math import torch import torch.nn as nn import torch.nn.functional as F from lib.models.connect import xcorr_depthwise class ARN(nn.Module): """ Attention Retrieval Network in Ocean+ """ def __init__(self, inchannels=256, outchannels=256): super(ARN, self).__init__() self.s_em...
= 0. # This is the default reaction.upper_bound = 1000. # This is the default reaction.add_metabolites({hpta_EEOc: -1.0, h_EEOc: -1.0, hpta_EEOe: 1.0, h_EEOe: 1.0}) model.add_reactions([reaction]) print(reaction.name + ": " + str(reaction.check_mass_balance())) #Octanoate Transport #octa_EEOe <-> octa_e ...
a hub. new_state(bool): New autoremoteness state to set for hub. True means remote will be automanaged. Defaults to None when only the current value will be returned. Returns: bool: True for a hub with autoremote enabled. """ if new_state is not None: _setAttr(hub_id, 'autoremote', new_state) return _getAttr(hu...
from PyQt5 import QtWidgets, QtCore, QtPrintSupport from PyQt5.QtCore import QDate, QTime, Qt, QTimer, QRectF from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtPrintSupport import QPrinter from database import MyCursor from PyQt5 import QtGui from datetime import datetime, timedelta from annulation i...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use...
up and don't annotate anything. # Our line numbers are not reliable enough to be asserting on. if start_indent is None: return cur_line = start_line + 1 end_line = cur_line # After this loop, function body will be lines [start_line, end_line) while cur_line < len(self.source): cur_indent = self.indentation_lev...
#coding:utf-8 from __future__ import division import os import sys import readline import time import yaml import re import platform import threading for path in sys.path: if re.search('\/myssh.+?.egg', path) : sys.path.append(path+'/myssh') break import tab import config import data import ssh import sftp im...
number extname = None # name of extension filename = None # filename of image numaxis = 2 # number of image planes, this is NAXIS # tuple of each image plane, defaulted to 1 image plane naxis = (0) # data has more than 2 dimensions and loads in cube/slice frame iscube = False mef_file = False # used to check mi...
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 """Lambda function that provides real-time personalization API functionality between public endpoints and recommenders This file contains the logic that performs and delegates the core processing for real-time recomm...
<reponame>amulyan7/sonic-mgmt import logging import json from tests.common.helpers.constants import DEFAULT_NAMESPACE from tests.common.devices.sonic_asic import SonicAsic logger = logging.getLogger(__name__) class RedisCli(object): """Base class for interface to RedisDb using redis-cli command. Attributes: host...
self . group . is_null ( ) else ", group {}" . format ( self . group . print_prefix ( ) ) if 72 - 72: i11iIiiIii * OoOoOO00 % oO0o / I1Ii111 lprint ( "{}eid {}{}, uptime {}, {} rlocs:" . format ( eid_indent , green ( self . eid . print_prefix ( ) , False ) , Oo000o0o0 , III11I1 , len ( self . rloc_set ) ) ) for i1...
# encoding: utf-8 # module _sqlite3 # from (pre-generated) # by generator 1.147 # no doc # imports import sqlite3 as __sqlite3 # Variables with simple values PARSE_COLNAMES = 2 PARSE_DECLTYPES = 1 SQLITE_ALTER_TABLE = 26 SQLITE_ANALYZE = 28 SQLITE_ATTACH = 24 SQLITE_CREATE_INDEX = 1 SQLITE_CREATE_TABLE = 2 SQLI...
<reponame>nicholasburden/pymarl import datetime import os import pprint import time import threading import torch as th import dill import numpy as np from types import SimpleNamespace as SN from utils.logging import Logger from utils.timehelper import time_left, time_str from os.path import dirname, abspath from lear...
<filename>web/addons/report/models/report.py # -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it an...
(224, 224, 3),classes=200) temp_feature10=fake_base_model10.output in10=fake_base_model10.input outs =Average()([temp_feature1, temp_feature2,temp_feature3, temp_feature4,temp_feature5,temp_feature6,temp_feature7, temp_feature8,temp_feature9, temp_feature10]) model = Model(inputs=[in1,in2,in3,in4,in5,in6,in7,in...
position vectors for solar system objects. Args: currentTime (astropy Time array): Current absolute mission time in MJD bodyname (string): Solar system object name eclip (boolean): Boolean used to switch to heliocentric ecliptic frame. Defaults to False, corresponding to heliocentric equatorial fram...
j = 0; j != cols; ++j) o[i][j] = parse_SerAr(blob); return o; } /* 172.16.58.3 */ function parse_PtgName(blob, length) { var type = (blob.read_shift(1) >>> 5) & 0x03; var nameindex = blob.read_shift(4); return [type, 0, nameindex]; } /* 172.16.17.32 */ function parse_PtgNameX(blob, length) { var type = (blob.rea...
# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
thread = api.new_ldap_domain(system_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str system_id: The unique identifier of the storage-system. This may be the id or the WWN. (required) :param LdapDomain body: :param bool skip_...
<reponame>samson0v/python_tb_rest_client<gh_stars>10-100 # coding: utf-8 """ ThingsBoard REST API ThingsBoard Professional Edition IoT platform REST API documentation. # noqa: E501 OpenAPI spec version: 3.3.3PAAS-RC1 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __f...
# pylint: disable=redefined-outer-name, comparison-with-callable """Test helper functions.""" import gzip import importlib import logging import os import pickle import sys from typing import Any, Dict, List, Optional, Tuple, Union import numpy as np import pytest from _pytest.outcomes import Skipped from...
""" This module contain the Vec2d class that is used in all of easymunk when a vector is needed. The Vec2d class is used almost everywhere in easymunk for 2d coordinates and vectors, for example to define position vector in a Body. However, easymunk is smart enough to convert tuples to Vec2ds so you usually do not nee...
<gh_stars>0 ######################################################################## ######################################################################## # Ready for experiments # Update 2020.07.14 ######################################################################## #############################################...
ef = dflux[chunk[i]:chunk[i+1]] crow = crowd[chunk[i]:chunk[i+1]] maf = rsky(e, period, t0, 1e-8, t) npts=len(maf) #use this version for full lightcurve treatment... r = a*(1.-e**2) / (1.+e*np.cos(maf)) zcomp = np.sin(omega+maf) * np.sin(inc) #z = r*np.sqrt(1.-zcomp**2) pe = ((r*zcomp>0.))# & (z <= 1.05*(r1+r2...
import glob import itertools from collections import defaultdict import os from configparser import ConfigParser, MissingSectionHeaderError, NoSectionError, NoOptionError from datetime import datetime import numpy as np import pandas as pd from shapely import geometry from shapely.geometry import Point from s...
''' Author: <NAME> Date: 2021-11-28 20:44:31 LastEditTime: 2021-12-15 10:21:31 LastEditors: <NAME> Description: FilePath: /UGA_INF/INF101/TP/Projet Final/main.py ''' from operator import truediv import random import time import distutils.core import multiprocessing as mp import pyqtgraph as pg import numpy as np def...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Created by <NAME> 25/06/2010 The package contains functions to analyse all sentence of a utterance Functions: dispatching : to distribute the sentence separ_sentence : to process the beginning of the sentence exclama_sentence : to process exclamatively sentenc...
<reponame>ketyi/dgl import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import init import random import numpy as np import torch.multiprocessing as mp from torch.multiprocessing import Queue def init_emb2neg_index(negative, batch_size): '''select embedding of negative nodes from a batch ...
import copy, StringIO import ete3 import warnings from Bio import Phylo from Bio.Phylo.TreeConstruction import DistanceTreeConstructor from Bio.Phylo.TreeConstruction import _DistanceMatrix import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import haplotools as hap def newick_to_node_name...
None: self.tags_initialized = false_tags return false if false is None: self.tags_initialized = true_tags return true # we need to merge tags final_tags = {} for tag in set(list(true_tags.keys()) + list(false_tags.keys())): true_val = true_tags.get(tag, False) false_val = false_tags.get(tag, False) if tru...
#! /usr/bin/env python """Module providing GUI capability to prune any directory. The code presented in this module is for the purposes of: (1) ascertaining the space taken up by a directory, its files, its sub-directories, and its sub-files; (2) allowing for the removal of the sub-files, sub-directories, files, and ...
<filename>tests/conftest.py import enum import math from collections import OrderedDict, UserString from datetime import datetime from typing import Any, Dict, List, Optional, Tuple, Type, Union from ruamel import yaml import pytest # type: ignore import yatiml from yatiml.recognizer import Recognizer @pytest.fixtu...
from __future__ import annotations from math import ceil, floor from random import uniform from typing import TYPE_CHECKING, Dict, List from components.starship_system import StarshipSystem from data_globals import PRECISION_SCANNING_VALUES from get_config import CONFIG_OBJECT import colors from global_functions impor...
expression false doesn't run step.""" step = Step({ 'name': 'step1', # key5 will evaluate False because it's a bool and it's False 'run': '{key5}'}, None) context = get_test_context() original_len = len(context) with patch_logger('pypyr.dsl', logging.INFO) as mock_logger_info: step.run_step(context) mock_l...
created_collection.create_item(body=document_definition) self.assertEqual(created_document.get('id'), document_definition.get('id')) self.assertEqual(created_document.get('key'), document_definition.get('key')) # read document read_document = await created_collection.read_item( item=created_document.get('id'), ...
from arkouda.client import generic_msg, verbose from arkouda.pdarrayclass import pdarray, create_pdarray from arkouda.pdarraycreation import zeros, array from arkouda.sorting import argsort from arkouda.strings import Strings global verbose __all__ = ["unique", "in1d", "concatenate", "union1d", "intersect1d", "setdi...
# # Copyright (c) Contributors to the Open 3D Engine Project. # For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # # import typing import json import azlmbr.scene as sceneApi from enum import IntEnum # Wraps the AZ.SceneAPI...
therefore merge this into @task once it gets fixed. actor_name = inspect.stack()[1].frame.f_code.co_name profile_actor = gluetool.utils.normalize_bool_option(actor_control_value(actor_name, 'PROFILE', False)) if profile_actor: profiler = Profiler() profiler.start() db = db or get_root_db() cancel = cancel or t...
HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['basicAuth'] # noqa: E501 return self.api_client.call_api( '/lists/{list_id}/segments', 'POST', path_params, query_pa...
(unnormalized) Returns ------- CESS: float conditional effective sample size """ prev_weights_normalization = np.exp(logsumexp(-works_prev)) prev_weights_normalized = np.exp(-works_prev) / prev_weights_normalization #_logger.debug(f"\t\tnormalized weights: {prev_weights_normalized}") incremental_weights_unnor...
# *********************************************************************** # This file defines some common feedforward Neural Network # arquitectures: # - ConvNet: convolutional neural network # - MlpNet: multilayer perceptron # # Wrote by: <NAME> (<EMAIL>) # Modern Heuristics Research Group (MHRG) # Virginia Commonweal...
min_order_width,\ threshold_abs, num_orders, plot) #------------------------ # TRACE THE ORDER RIDGES: #------------------------ ridge_pos_cross, ridge_pos_disp = self.find_order_ridges(data, smooth_win, exclude_border,\ min_order_width, threshold_abs, num_peaks) #------------------------------------ # FILL...
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.8 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (2, 6, 0): def swig_import_helper(): from os.path import dirnam...
<filename>downscale_/downscale/test/test_micro_met.py import numpy as np from numpy.testing import * import os import warnings import pytest warnings.filterwarnings("ignore", category=DeprecationWarning) from downscale.operators.micro_met import MicroMet @pytest.fixture def mnt(): directory = os.getcwd() try: mn...
import os import math import copy import numpy as np import astropy.io.fits as pf from astropy.time import Time, TimeDelta from astropy.stats import biweight_midvariance, mad_std from sklearn.cluster import DBSCAN from collections import OrderedDict from utils import (baselines_2_ants, index_of, get_uv_correlations, f...