text
stringlengths
8.04k
46.5k
""" stscan ~~~~~~ Implements the "prospective" space-time permutation scan statistic algorithm. This was originally described in (1) in reference to disease outbreak detection. The algorithm is implemented in the software package (2). We apply it to crime predication as in (3). We look at events which have occurred...
# # Copyright (c) 2018 ISP RAS (http://www.ispras.ru) # Ivannikov Institute for System Programming of the Russian Academy of Sciences # # 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 # # h...
""" Copyright (c) Microsoft Corporation. Licensed under the MIT license. run evaluation of VCMR or infenrece of TVR for submission """ import argparse import os from os.path import exists from time import time import torch from torch.utils.data import DataLoader from torch.nn import functional as F import numpy as np...
""" Contains methods responsible for running and interacting with LightSweeper games """ import copy #import json import os import random import shelve import threading import time from collections import defaultdict from collections import OrderedDict from datetime import timedelta from lightsweeper.lsdisplay impor...
import paddlehub as hub import cv2 import numpy as np import time import random import os import math import copy import glob from ffpyplayer.player import MediaPlayer from PIL import Image, ImageDraw, ImageFont import argparse import _thread import asyncio from playsound import playsound os.environ['CUDA_VISIBLE_DEVI...
# -*- coding: utf-8 -*- # This script converts text files from tStudio to USFM Resource Container format. # Parses manifest.json to get the book ID. # Outputs list of contributors gleaned from all manifest.json files. # Finds and parses title.txt to get the book title. # Populates the USFM headers. # Sta...
""" Build microwave pulse sequences for an arbitrary waveform generator in order to perform diamond NV-center experiments. This module constructs waveforms for use with an arbitrary waveform generator (hereafter referred to as an AWG) in performing microwave manipulation of electronic state populations in negatively-c...
from utils.Agent import * from matplotlib import pyplot as plt from keras import backend as K class CVAE(tf.keras.Model): """Convolutional variational autoencoder.""" def __init__(self, latent_dim): super(CVAE, self).__init__() # self.encoder.compile(optimizer=tf.keras.optimizers.Adam(learnin...
import random as rd class Nucleic_Base: adenine = {'char':'a', 'dna':'a','match':'t','rna':'a'} guanine = {'char':'g', 'dna':'g','match':'c','rna':'g'} cytosine = {'char':'c', 'dna':'c','match':'g','rna':'c'} thymine = {'char':'t', 'dna':'t','match':'a','rna':'u'} uracil = {'char':'u', 'dna':'t','...
#shape update shape import sys # set the input file path, you have to change this path mod_path = '/Users/Simo//Documents/energyanalytics/energyanalytics/disaggregation' if not (mod_path in sys.path): sys.path.insert(0, mod_path) mod_path = '/Users/Simo//Documents/energyanalytics/energyanalytics/disaggregation...
import pygame from pygame.locals import * import time import constants import functions import cell_class import board_class import piece_class import button_class import soundSettings_class """Pygame + mixer initialization to delete the sound delay in the pygame.mixer""" pygame.mixer.pre_init(44100, -16, 2, 1024) p...
import sys import os import unittest import shutil import copy from io import StringIO sys.path.append(".") from mock_gff3 import Create_generator from mock_helper import import_data, gen_file import annogesiclib.sORF_detection as sd from mock_args_container import MockClass get_coverage = copy.deepcopy(sd.get_covera...
# pytombo - Python library for processing plain text + encrypted notes. # Copyright (C) 2007 <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, either version 3 of the License, or # (at yo...
import abc import logging from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from wildlifecompliance.components.returns.models import ( Return, ReturnTable, ReturnRow, ) from wildlifecompliance.components.returns.utils_schema import Sc...
#! /usr/bin/env python3 # Copyright 2021 OVHCloud # # 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 app...
import collections import datetime import random import re import StringIO import sys import bio import features import vcf DELETE_BASE = '-' class ProbabilisticFasta(object): ''' generate fasta with probabilities attached from mapped fragments ''' def __init__( self, log=None ): self.genome = {} #...
import numpy as np from PDE_find import Diff, Diff2, FiniteDiff import Data_generator as Data_generator import scipy.io as scio from requests import get from inspect import isfunction import math import pdb import random import matplotlib.pyplot as plt import torch.nn as nn import torch from torch.nn import...
# Copyright (c) FULIUCANSHENG. # Licensed under the MIT License. import os import torch import time import json import logging import numpy as np import torch.distributed as dist import torch.nn as nn import torch.nn.functional as F from PIL import Image from copy import deepcopy from itertools import chain from colle...
# -*- coding: utf-8 -*- """ BasicWorm, WormPartition, JSON_Serializer Credit to <NAME> at http://robotfantastic.org/serializing-python-data-to-json-some-edge-cases.html for the following six functions: isnamedtuple serialize restore data_to_json json_to_data nested_equal """ import numpy as np import warnings import...
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 et: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ### ...
#!/usr/bin/env python3 # Copyright (c) 2019 The EROS developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # -*- coding: utf-8 -*- from io import BytesIO from struct import pack import time from test_framework.address import...
from __future__ import division from scitbx.graph.utils import \ construct_edge_sets, extract_edge_list, sub_edge_list, tree_marking from libtbx import slots_getstate_setstate import math class cluster_manager(slots_getstate_setstate): __slots__ = [ "fixed_vertex_lists", "cluster_indices", "clusters",...
""" TODO: Suggestion, rewrite the methods get_parameter_3d(), get_parameter_vector(), set_parameter_vector() to make use of newer code """ import os from os import path import matplotlib import matplotlib.pyplot as plt import numpy as np from numpy import random import compound_poisson from compound_poisson impo...
# coding=utf-8 # Copyright 2020 The TF-Agents Authors. # # 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 la...
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ ConfigurationAdmin implementation :author: <NAME> :copyright: Copyright 2016, <NAME> :license: Apache License 2.0 :version: 0.6.4 .. Copyright 2016 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file e...
''' Command line interface to the HELM data processing pipeline ''' import sys import logging import argparse import timeit import os import os.path as op import yaml import glob from datetime import datetime import json import errno from pathlib import Path import string import copy from utils ...
# -*- coding: utf-8 -*- # Copyright 2014 - 2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, <NAME> and <NAME>. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistribut...
#!/usr/bin/python3 import clang.cindex from clang.cindex import CursorKind from clang.cindex import TypeKind from clang.cindex import TranslationUnit import sys from dataclasses import dataclass, field import subprocess import logging logger = logging.getLogger() logger.setLevel(logging.WARNING) @dataclass class TypeD...
#!/usr/bin/env python3 import os import time import torch import numpy as np import pickle as pkl import concurrent.futures from common import Config from utils.basic_utils import Basic_Utils from utils.meanshift_pytorch import MeanShiftTorch try: from neupeak.utils.webcv2 import imshow, waitKey except Exception: ...
""" Implements some example neural networks. We will mostly use them to instantiate the chains in GA and/or Simulated annealing. -- <EMAIL> """ # pylint: disable=no-member # pylint: disable=invalid-name # pylint: disable=abstract-class-not-used # pylint: disable=no-name-in-module import numpy as np from scipy.s...
from collections import defaultdict from functools import lru_cache import torch import monet.lm_ops as lm_ops from monet.meminfo import meminfo, computeinfo from monet.graph import * import numpy as np import sys MEMORY_MULTIPLIER = 4 # TODO: Remove this and instead use dtype class SolverNode: def __init__(self)...
""" These type objects do not have a fixed machine representation. It is up to the targets to choose their representation. """ from __future__ import print_function, division, absolute_import import itertools import struct import weakref import numpy from .six import add_metaclass from . import npdatetime, utils ...
# -*- coding: utf-8 -*- import re import os import csv import sys import time import random import torch import numpy as np from tqdm import tqdm import tensorflow as tf from torch.distributions.categorical import Categorical from torch.optim import Adam import torch.multiprocessing as mp import fire from . import u...
# Copyright (c) MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
# -*- coding: utf-8 -*- """ Created on Sun Mar 29 14:18:42 2020 @author: geraldod """ from Gear import GearSet from components import Material from scipy import array, interpolate from numpy import pi, sin, cos, tan, radians, ones, mean, sqrt, log, asscalar ############################################################...
# This is all extremely WIP, and not in working state. from salmon_lib.parsers import * import os import os.path import tempfile import subprocess import shutil import glob import json import time import statistics """ ## .bse: - Name - Abbreviation - Index (just by the order stocks are specified in) - Production para...
# -*- coding: utf-8 -*- from pineboolib.utils import aqtt from pineboolib.fllegacy.FLRelationMetaData import FLRelationMetaData class FLFieldMetaData(object): """ @param n Nombre del campo @param a Alias del campo, utilizado en etiquetas de los formularios @param aN TRUE si permite nulos (NULL), FALSE si lo...
import numpy as np from scipy.optimize import minimize import warnings import properties from ....utils.code_utils import deprecate_class from ....utils import mkvc, sdiag, Zero from ...base import BaseEMSimulation from ....data import Data from .survey import Survey from .fields_2d import Fields2D, Fields2DCellCente...
# -*- coding: utf-8 -*- ''' loadFromExcel.py is an example of a plug-in that will load an extension taxonomy from Excel input and optionally save an (extension) DTS. (c) Copyright 2013 Mark V Systems Limited, All rights reserved. ''' import os, io, time, re from arelle import XbrlConst importColumnHeaders = { "名...
#!/usr/bin/env python """ Copyright 2022 Open STEMware Foundation All Rights Reserved. This program is free software; you can modify and/or redistribute it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; version 3 with attribution addendums as ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Project U-Ray Authors # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file. # # SPDX-License-Identifier: ISC import csv import copy import itertools from utils.util import create_xy_fun # Use fewer IOST...
import os from os.path import join import re import numpy as np import time as time from scipy.io import FortranFile import ctypes as c import struct class ReadTreebrick_lowp: #low precision Treebricks (mostly HAGN) def __init__(self,file_path=None): """ Make a treebricks dictionar...
"""Support for interfacing with the XBMC/Kodi JSON-RPC API.""" from __future__ import annotations from datetime import timedelta from functools import wraps import logging import re from typing import Any import urllib.parse import jsonrpc_base from jsonrpc_base.jsonrpc import ProtocolError, TransportError from pykod...
""" An implementation of the OpenAI Transformer Language Model. Mostly just a slightly modified version of https://github.com/huggingface/pytorch-openai-transformer-lm so thanks to them! Some of these modules duplicate code elsewhere in AllenNLP, but the serialized weights depend on the exact parameter setup here, so...
from ..parser import ast from .definitions import GenericType from .generics import TypeVisitor from .generics import add_generic_class from .generics import fix_chosen_types from .generics import replace_generic_types from .utils import BUILTIN_CALLS from .utils import BUILTIN_ERRORS from .utils import BYTES_METHODS f...
# Copyright 2017-2019 EPAM Systems, Inc. (https://www.epam.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 by appli...
import re import StringIO import csv import datetime import time import logging import utils from vote_info import output_vote def run(options): congress = options.get("congress", None) congress = int(congress) if congress else utils.current_congress() chamber = options.get('chamber', None) # we're...
import time import numpy as np import collections class PrettyTable(): ''' For format output the simplex table ''' def __init__(self): # all element is str self.table = [] return None def add_row(self, row): self.table.append(row) return...
import os import time import datetime import random import pygame import io import sys import builtins import traceback import subprocess import configparser from subprocess import check_output, call from kivy.app import App from kivy.clock import Clock from kivy.properties import NumericProperty, StringProperty, Objec...
from flask_login import current_user, LoginManager import logging import json import jwt from sqlalchemy.ext.declarative import declared_attr from flask_babel import lazy_gettext import time import hashlib from typing import List import requests from flask import current_app,redirect, g, flash, request, session, abort,...
# Copyright The IETF Trust 2012-2020, All Rights Reserved # -*- coding: utf-8 -*- import base64 import datetime import re import requests from urllib.parse import urlencode from xml.dom import pulldom, Node from django.conf import settings from django.utils.encoding import smart_bytes, force_str, force_text import...
# packets.py -- OpenChange RPC-over-HTTP implementation # # Copyright (C) 2012 <NAME> <<EMAIL>> # # 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; either version 3 of the License, or # (at your ...
#!/usr/bin/env python3 ''' lib/ycmd/server.py Server abstraction layer. Defines a server class that represents a connection to a ycmd server process. Information about the actual server process is available via the properties. The ycmd server handlers are exposed as methods on this class. To send a request to the se...
import os import sys import re import json import math from difflib import SequenceMatcher import plotly.graph_objects as go import requests import networkx as nx import pandas as pd import numpy as np import scipy import matplotlib import matplotlib.pyplot as plt from ipywidgets import interactive, HBox, VBox import i...
# Copyright 2020 The Oppia 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 ...
""" Commonly used utils: evaluation metrics e.g. similarity, AUC, AP@k, MAP@k graph related operation testing data generator file I/O visualization etc... """ import time import numpy as np from scipy import sparse import pickle import networkx as nx # ----------------------------------------------------------------...
from functools import partial from collections import Sequence import os from pathlib import Path import random from ..utils import _norm_path from menpo.base import menpo_src_dir_path, LazyList from menpo.visualize import print_progress def data_dir_path(): r"""A path to the Menpo built in ./data folder on this ...
# Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
# clize -- A command-line argument parser for Python # Copyright (C) 2011-2016 by <NAME> and contributors. See AUTHORS and # COPYING for details. from sigtools import support, modifiers, specifiers from clize import parser, errors, util from clize.tests.util import Fixtures try: import pathlib pathlib_name =...
import os import itertools import torch import torch.nn as nn import torch.nn.parallel import torch.utils as tutils import torch.nn.functional as F import numpy as np import cv2 from tqdm import tqdm from fsgan.utils.obj_factory import obj_factory from fsgan.utils.tensorboard_logger import TensorBoardLogger from fsgan....
import os from rpython.jit.codewriter.effectinfo import EffectInfo from rpython.jit.metainterp.optimizeopt.util import args_dict from rpython.jit.metainterp.history import Const, ConstInt from rpython.jit.metainterp.jitexc import JitException from rpython.jit.metainterp.optimizeopt.optimizer import Optimization,\ ...
############################################################################## # This file is part of argparseui. # # # # argparseui is free software: you can redistribute it and/or modify # # ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # RDB Info # Author: <NAME> # Date: 2018-02-19 # # A python script to read Rigid Disk Block (RDB) from file or disk device. # # Examples: # --------- # Read RDB from hdf file on Windows platform # python rdbinfo.py "c:\temp\4gb.hdf" # # Read RDB from drive l...
""" An implementation of Viper's tokenizer. Check `compiler/lexer/lexer.grammar` for the language's lexer grammar specification. NOTE: May turn lex function into a generator in the future to support generating tokens on demand. As noted¹ by some, certain lexer errors may be caused by invalid syntax, but the ...
# This file is a part of OMPC (http://ompc.juricap.com/) # # for testing: # import ompclib_numpy; reload(ompclib_numpy); from ompclib_numpy import * # TODO # - remove all references to array, use "ompc_base._init_data" instead import sys from itertools import izip as _izip, cycle as _cycle, repeat as _...
#!/usr/bin/env python # -*- coding: utf-8 -*- #=========================================================================== # interpolate_compare.py # # Interactive Jitter modulation of audio files and generated waveforms # # See http://stackoverflow.com/questions/6783194/background-thread-with-qthread-in-pyqt # # Gener...
import os from pathlib import Path from abc import ABCMeta import json from json import JSONEncoder import datetime import numpy as np from osgeo import ogr, osr from pyflowline.classes.mpas import pympas from pyflowline.classes.hexagon import pyhexagon from pyflowline.classes.latlon import pylatlon from pyflowline.cla...
# -*- coding: utf-8 -*- """ Created on Tue Apr 25 11:30:35 2017 @author: Bartek """ # from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import scipy.signal as dsp import scipy.stats as stats import os import pandas as pd from numpy.core.multiarray import ndarray from sklearn.d...
#! /usr/bin/env python3 """ diskimgr, automated reading of optical media Graphical user interface Author: <NAME> Research department, KB / National Library of the Netherlands """ import sys import os import io import time import threading import logging import queue import uuid import json from shutil import move fr...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import math import random from dataset import START, PAD device = torch.device("cuda" if torch.cuda.is_available() else "cpu") class BottleneckBlock(nn.Module): """ Dense Bottleneck Block It contains two convolutional...
#!/usr/bin/python """ Copyright 2013 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. HTTP server for our HTML rebaseline viewer. """ # System-level imports import argparse import BaseHTTPServer import json import logging import os import posixpath import...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from __future__ import print_function """ Created on Fri Feb 17 12:38:44 2017 @author: ahefny, zmarinho """ from collections import defaultdict import numpy as np import theano import theano.printing import theano.tensor as T import theano.tensor.slinalg from theano.te...
#!/usr/bin/env python import argparse import rospkg import cv2 import numpy as np from utils import Utils import math import sys import os from cameras import CamerasParams from map import Map from shelf import Shelf from tsp import Tsp #a Point of interest is a point in map with a shelf inside the store to which it...
# -*- coding: utf-8 -*- from __future__ import division import pickle from PyQt4 import QtCore, QtGui import numpy as np import weakref import acq4.pyqtgraph as pg from acq4 import getManager from acq4.devices.Device import Device from acq4.devices.OptomechDevice import OptomechDevice from acq4.devices.Stage import S...
import numpy as np import numpy.ma as ma from numpy import linalg as LA import tsstats #from numba import jit from wormtracker import Logger class WormTrajectoryPostProcessor: ## static properties! # bad frame settings filterByWidth = True filterByLength = True widthThreshold = (0.7, 1.3) leng...
import itertools import logging import sys import time import random import weakref from contextlib import contextmanager import functools import shlex from ..core.plugin import Plugin from ..core.smtlib import Expression from ..core.state import StateBase from ..core.workspace import ManticoreOutput from ..exceptio...
import re from typing import List, Tuple, Optional, Set import sqlparse import time import os import json import logging from tqdm.notebook import tqdm as tq from sqlparse.tokens import Keyword, DML, Token, Wildcard, Literal, Punctuation, Whitespace, Newline, Comment, Operator from sqlparse.sql import Identifier, Ident...
# This file is Copyright 2019 Volatility Foundation and licensed under the Volatility Software License 1.0 # which is available at https://www.volatilityfoundation.org/license/vsl-v1.0 # """The configuration module contains classes and functions for interacting with the configuration and requirement trees. Volatility ...
#!/usr/bin/env python # (C) 2017 OpenEye Scientific Software Inc. All rights reserved. # # TERMS FOR USE OF SAMPLE CODE The software below ("Sample Code") is # provided to current licensees or subscribers of OpenEye products or # SaaS offerings (each a "Customer"). # Customer is hereby permitted to use, copy, and modif...
import random import sys from collections import defaultdict from typing import Optional, Dict, Tuple from uuid import uuid4 import numpy as np from scipy.special import softmax from hmtl.utils import K MAX_PERTURB_ATTEMPTS = ( 10 # maximum number of attempts to apply the same perturbation if it fails ) class...
#!/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, including # without limitation the rights to use, copy, modify, merg...
#!/usr/bin/env python # coding: utf-8 # In[61]: import os import sys import pandas as pd import numpy as np import string from operator import itemgetter from collections import Counter, OrderedDict from nltk.tokenize import word_tokenize, sent_tokenize from nltk.stem import SnowballStemmer from nltk.corpus import ...
# Copyright 2020 Toyota Research Institute. All rights reserved. import cv2 import numpy as np import torch import torch.nn.functional as F from matplotlib.cm import get_cmap from kp2d.networks.inlier_net import InlierNet from kp2d.networks.keypoint_net import KeypointNet from kp2d.networks.keypoint_resnet import Ke...
#!/usr/bin/env python3 # @author <NAME> <<EMAIL>> """Dockerfile template injector and pipeline trigger.""" # # !! IMPORTANT !! # # Editors of this file should use https://github.com/python/black for auto formatting. # import re import os import pathlib import logging import logging.config import shutil import glob ...
import logging from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union from uuid import uuid4 import pandas as pd import pyarrow as pa import pyspark.sql as ps from fugue.collections.partition import ( EMPTY_PARTITION_SPEC, PartitionCursor, PartitionSpec, parse_presort_exp, ) fro...
import numpy as np import pandas as pd import logging logger = logging.getLogger(__name__) class SqFtProFormaConfig(object): """ This class encapsulates the configuration options for the square foot based pro forma. parcel_sizes : list A list of parcel sizes to test. Interestingly, right n...
from django.db import models from django.core.mail import EmailMultiAlternatives from business_calendar import Calendar from django.contrib.auth.models import User from django.urls import reverse import datetime from django.utils.safestring import mark_safe from django.contrib.sites.models import Site class MyUser(Use...
import ast import itertools import os import numpy as np from scipy.stats import gamma import mapel.elections.models.mallows as mallows from mapel.elections._glossary import * from mapel.elections.models.group_separable import get_gs_caterpillar_vectors from mapel.elections.models.mallows import get_mallows_vectors f...
# Python-wrapped REST API utilities for AppResponse 11 from typing import Any, IO import yaml import os import glob import sys import requests import time import argparse import json import getpass from datetime import datetime from requests.packages.urllib3.exceptions import InsecureRequestWarning # Avoid warnings f...
# hh.py version 0.4 bete of HaHa-reader # second upload 22/02/2022 import os import argparse import re import webbrowser __version__ = '0.4 beta' class Element(): def __init__(self, document, open_tag="", parent=None): self.document = document self.parent = parent s...
import json import os import torch import torch.nn as nn from utils import get_latest_timestamp def create_embedding(size): return nn.Embedding(*size, _weight=torch.zeros(*size).normal_(0, 0.01)) def create_embeddings(embedding_meta_dict): embedding_dict = dict() for key, value in embedding_meta_dict....
from copy import deepcopy from itertools import chain import torch from torch.optim import Adam, RMSprop import torch.nn as nn from .transformer import PrototypeTransformationNetwork as Transformer, N_HIDDEN_UNITS, N_LAYERS from .tools import (copy_with_noise, generate_data, create_gaussian_weights, get_clamp_func, ...
""" Creates a shapefile with a given root name using data from given X, Y, and value arrays (curvilinear-type data). The shapes are quadrilaterals in the X,Y-plane derived from the X and Y arrays; i.e., vertices are the (i,j), (i,j+1), (i+1,j+1), and (i+1,j) elements of the X and Y coordinates. The value associated w...
""" LSPEAS proximal ring pulsatility and expansion module Module for obtaining node to node pulsatility in ECG gated CT of Anaconda Button interaction: ENTER: calculate distances and pulsatility between selected nodes ESCAPE: FINISH MODEL, GET MAX PULSATILITY OVERALL, STORE TO EXCEL """ import os import visvis as v...
#!/usr/bin/env python3 # See: https://github.com/pr3d4t0r/COVIDvu/blob/master/LICENSE # vim: set fileencoding=utf-8: import json import os import sys import pandas as pd import re from covidvu import utils # *** initializations *** pd.options.mode.chained_assignment = None # *** constants *** JH_CSSE_DATA_HO...
import opentimelineio as otio import re from PyQt5.QtCore import QRectF import subprocess import os def clips_overlap(clipA, timeClipAStart, clipB, timeClipBStart): clipA_dur = clipA.source_range.duration clipB_dur = clipB.source_range.duration timeClipAEnd = timeClipAStart + clipA_dur timeClipBEnd = timeClipBSta...
import matplotlib.pyplot as plt import numpy as np from scipy.optimize import curve_fit from astropy.io import ascii from uncertainties import ufloat import uncertainties.unumpy as unp # bisher: Berechnung der Schallgeschwindigkeit über unsere Messung mit v_0 und bestimmten lambda # zudem: Import der ganzen daten mitte...
"""RDF datasets Datasets from "A Collection of Benchmark Datasets for Systematic Evaluations of Machine Learning on the Semantic Web" """ import os from collections import OrderedDict import itertools import rdflib as rdf import abc import re import networkx as nx import numpy as np import dgl import dgl.backend as ...
import numpy as np from scipy.special import erfinv, gammainc from scipy.stats import gamma from scipy.linalg import lstsq from copy import deepcopy from obspy.geodetics.base import calc_vincenty_inverse """ Contains the auxilliary functions called by fast_lts_array.py Many of these codes are Python3 translations of...