text
stringlengths
6.04k
39.5k
from pbge.dialogue import Offer, ContextTag from . import ghwaypoints import random import pbge import gears from game.content import GHNarrativeRequest,PLOT_LIST from ..ghdialogue import context class AdventureModuleData(object): def __init__(self, name, desc, date, title_card, character_check_fun=None): ...
# coding: utf-8 """ """ import pandas as pd import numpy as np import re import csv import io import time import traceback import logging logging.basicConfig(format="%(asctime)s %(levelname)s: %(message)s", level=logging.DEBUG) def cal_jlr_zengzhanglv(data, col1, col2): kuisun_count = 0 if...
#!/usr/bin/env python3 # misc.py import aiosqlite from typing import Dict, List import re import random import aiohttp import io import cairosvg from PIL import Image, ImageEnhance from datetime import datetime, date import operator import asyncio import pytz class Database: def __init__(self, conn: str): ...
''' * BSD 3-Clause License * @copyright (c) 2019, <NAME>, <NAME>, <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: * * Redistributions of source code must retain the above copyright not...
#!/usr/bin/env python # coding: utf-8 import argparse import datetime import logging import os import pickle import signal import warnings import logzero import numpy as np import torch import torch.nn as nn import torch.backends.cudnn as cudnn import torch.utils.data.distributed from multiprocessing import cpu_coun...
# Leo colorizer control file for rview mode. # This file is in the public domain. # Properties for rview mode. properties = { "commentEnd": "*/", "commentStart": "/*", "indentCloseBrackets": "}", "indentOpenBrackets": "{", "lineComment": "//", "lineUpClosingBracket": "true", } # A...
from .models import * from datetime import datetime def parse_datetime(date): if type(date) == str: date_time_obj = datetime.strptime(date[:19], '%Y-%m-%dT%H:%M:%S') return date_time_obj else: return date def parse_date(date): if type(date) == str: ...
import os import sys import socket import hashlib import json import rsa import argparse import time import logging import enum import tkinter as tk # UI import commands sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from common.unid import UNID import common.messages as messages import common.settin...
#!/usr/bin/env python3 # Copyright 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. impo...
import bpy import bgl,os import json import ctypes import math from bpy_extras import view3d_utils from threading import current_thread import weakref from mathutils import Vector try: from PIL import Image,ImageDraw except: import bpy,subprocess pybin = bpy.app.binary_path_python subprocess.check_call...
""" Provides helper functions used throughout the InvenTree project """ import io import re import json import os.path from PIL import Image from decimal import Decimal, InvalidOperation from wsgiref.util import FileWrapper from django.http import StreamingHttpResponse from django.core.exceptions import ValidationEr...
#!/usr/bin/env python # 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 # "L...
# /usr/bin/env python3.6 # -*- mode: python -*- # ============================================================================= # @@-COPYRIGHT-START-@@ # # Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification,...
# 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 u...
# -*- coding: utf-8 -*- # Copyright 2019 The Matrix.org Foundation C.I.C. # # 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 require...
# 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 u...
""" Services module forms """ from django import forms from django.db.models import Q from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from anaf.core.conf import settings from anaf.identities.models import Contact from anaf.core.decorators import preprocess_form from anaf....
import glob from tqdm import tqdm import glob import xml.etree.ElementTree as ET import os import json import pandas as pd import numpy as np import argparse import random try: from pandas import json_normalize except: from pandas.io.json import json_normalize # def fabric2coco(): # ann_file = '/home/lip...
"""Base class and useful usable-classes for managing computed inputs. Computed inputs are an advanced feature used with complex compile rules, where the dependencies of a rule may change over time. For instance, for foo.min.css, we inline all images in foo.css. So foo.min.css needs to change when foo.css changes, bu...
""" Copyright: Intel Corp. 2018 Author: <NAME> Email: <EMAIL> Created Date: Oct 19th 2018 For ICLR 2019 Reproducibility Challenge """ import numpy as np import tensorflow as tf import tqdm from VSR.Util import Config, to_list from ..Arch import Discriminator from ..Framework.GAN import ( gradient_penalty, inceptio...
# Copyright 2018 The dm_control 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
# BSD 3-Clause License # # Copyright (c) 2019, Elasticsearch BV # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, t...
import json import pathlib import re import requests.exceptions import time import kubernetes import pytest from pytest_bdd import given, parsers, then, when import yaml from tests import kube_utils from tests import utils # Pytest command-line options def pytest_addoption(parser): parser.addoption( "--...
"""Functions for working with features in a raster dataset.""" import logging import warnings import math import os import numpy as np import rasterio from rasterio._features import _shapes, _sieve, _rasterize, _bounds from rasterio.crs import CRS from rasterio.dtypes import validate_dtype, can_cast_dtype, get_mini...
import bisect import collections import torch from .event_handling import find_event from .interp import _interp_evaluate, _interp_fit from .misc import (_compute_error_ratio, _select_initial_step, _optimal_step_size) from .misc import Perturb from .solvers import AdaptiveStepsizeE...
from scipy.sparse import hstack as sphs, vstack as spvs, csc_matrix, csr_matrix from scipy.sparse.linalg import spsolve import numpy as np from numpy import conj, arange def dSbus_dV(Ybus, V): """ :param Ybus: :param V: :return: """ """Computes partial derivatives of power injection w...
import math import torch import torch.nn as nn import torch.nn.init as init from torch.autograd import Variable from utils import * acts = { 'RELU': nn.ReLU, 'ELU': nn.ELU, 'TANH': nn.Tanh, 'NONE': nn.Identity, } def load_MAC(cfg, vocab): kwargs = { 'vocab': vocab, 'num_answers...
# coding=utf-8 # Copyright 2020 The Google Research 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
"""visualization.py: Functions for visualizing MAVE-NN models.""" # Standard imports import numpy as np import pandas as pd import matplotlib.pyplot as plt import re import pdb # Special plotting-related imports #from matplotlib.colors import DivergingNorm, Normalize from matplotlib.colors import TwoSlopeNorm, Normali...
# -*- coding: utf-8 -*- import glob import time import datetime import subprocess import numpy as np import requests import supply import logging import os, sys if sys.platform.lower() == "win32": os.system('color') if not supply.isTest: try: import RPi.GPIO as GPIO except ImportError as e: ...
# Copyright 2019 Cisco 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 applicable law or agreed to in writing...
import re import pytest import numpy as np import warnings from unittest.mock import Mock from sklearn.utils._testing import assert_array_almost_equal from sklearn.utils._testing import assert_array_equal from sklearn.utils._testing import assert_allclose from sklearn.utils._testing import skip_if_32bit from sklearn.u...
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Export a YOLOv5 PyTorch model to TorchScript, ONNX, CoreML, TensorFlow (saved_model, pb, TFLite, TF.js,) formats TensorFlow exports authored by https://github.com/zldrobit Usage: $ python path/to/export.py --weights yolov5s.pt --include torchscript onnx coreml saved_...
#!/usr/bin/env python # @HEADER # ************************************************************************ # # TriBITS: Tribal Build, Integrate, and Test System # Copyright 2013 Sandia Corporation # # Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, # the U.S. Govern...
import numpy as np import pandas as pd import theano.tensor as T from random import shuffle from theano import shared, function from patsy import dmatrix from collections import defaultdict class MainClauseModel(object): def __init__(self, nlatfeats=8, alpha=1., discount=None, beta=0.5, gamma=0.9, ...
# Copyright 2020-2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list o...
"""Base class copy from sklearn.base.""" # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD (3-clause) import numpy as np import time import numbers from ..parallel import parallel_func from ..fixes import BaseEstimator from ..utils import c...
# Be sure to use python2.7 # # Author: <NAME> # Last updated: 12/5/21 import sys import Leap import threading import Queue as queue import time import math from datetime import datetime as dt import numpy as np import serial # library for inverse kinematics #from ikpy.chain import Chain #from ikpy.li...
# 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, software # distributed under the...
import math import time import random import struct import numpy as np from numba import jit from biologicalgraphs.utilities import dataIO from biologicalgraphs.utilities.constants import * from biologicalgraphs.graphs.biological.util import CreateDirectoryStructure, ExtractExample, GenerateExamplesArray, ScaleFeatur...
# + import warnings import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from matplotlib.colors import ListedColormap from matplotlib.gridspec import GridSpec def get_rgb_function(cmap, min_value, max_value): r"""Generate a function to map continous values to RGB values using colormap betw...
import numpy as np import json import os import sys import time from mosaicing_demosaicing_v2 import * import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torchvision.utils from torchvision import models import torchvision.datasets as dsets import torchvision.transforms...
import argparse import contextlib from itertools import product from math import floor import os os.environ.update( OMP_NUM_THREADS = '1', OPENBLAS_NUM_THREADS = '1', NUMEXPR_NUM_THREADS = '1', MKL_NUM_THREADS = '1', ) import numpy as np np.set_printoptions(precision=3) import pandas as pd from joblib ...
import itertools import os import pickle import time import warnings from collections import OrderedDict import matplotlib.pyplot as plt import numpy as np import pytest from six.moves import xrange from artemis.experiments.decorators import experiment_function, experiment_root from artemis.experiments.deprecated imp...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2007-2010 <NAME>, European Environment Agency # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the Licen...
""" This module defines functions to start and stop the sync daemon and retrieve proxy objects for a running daemon. """ from __future__ import annotations # system imports import inspect import sys import os import time import signal import enum import threading import fcntl import struct import argparse import re i...
import logging from inflection import underscore from collections import OrderedDict as _o import gilda from indra.sources import trips from indra.ontology.standardize import \ standardize_agent_name from indra.statements.statements import * from indra.assemblers.english.assembler import _assemble_agent_str, \ ...
#!/usr/bin/env python """A keyword index of client machines. An index of client machines, associating likely identifiers to client IDs. """ from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from future.builtins import map from future.builtins import range ...
import logging import gc from typing import List, Tuple, Dict, Callable from enum import Enum import attr from attr.validators import instance_of import numpy as np import pandas as pd import zarr from tqdm import tqdm from .frame_chunk import FrameChunk, FlimCalc, HistWithIndex from pysight.nd_hist_generator.outputs...
import asyncio import logging import os import random import sys import json sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # noqa from runners.support.agent import DemoAgent, default_genesis_txns from runners.support.utils import log_timer, progress, require_indy LOGGER = logging.get...
"""Classes for migrating repos""" import os import re import dateutil.parser import datetime from itertools import chain import typing import logging from typing import ( List, Any, Optional, Sequence, Set, ) import networkx as nx from conda_forge_tick.path_lengths import cyclic_topological_sort ...
''' Copyright (C) 2010-2021 Alibaba Group Holding Limited. ''' import os, random, math import time import glob import numpy as np import shutil import torch import logging import argparse import traceback import torch.nn as nn import torch.utils import torchvision.datasets as dset import torch.backends.cudnn as cudnn...
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import os from abc import ABC, abstractmethod from dataclasses import dataclass from typing import ClassVar, Iterable, Iterator, cast from pants.base.g...
import string from ometa.runtime import (InputStream, ParseError, EOFError, ArgInput, joinErrors, expected, LeftRecursion) def decomposeGrammar(grammar): rules = {} #XXX remove all these asserts once we have quasiterms assert grammar.tag.name == 'Grammar' for rule in grammar....
import bottle import bottle.ext.sqlite from bottle import Bottle, abort, response, run, static_file, template, debug, redirect, request import json import sys app = Bottle() #install db connection plugin = bottle.ext.sqlite.Plugin(dbfile='./db/dietetika.sqlite') app.install(plugin) app.catchall = False # statične ...
# Copyright (c) 2017 <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 use, copy, modify, merge, publish, distribute, ...
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo # Copyright (C) 2017-2017 German Aerospace Center (DLR) and others. # This program and the accompanying materials # are made available under the terms of the Eclipse Public License v2.0 # which accompanies this distribution, and is available at ...
#!/usr/bin/env python3 # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
from __future__ import annotations import abc import logging import os import os.path as osp import sqlite3 import threading import time import warnings from collections import defaultdict from typing import Any, BinaryIO, Callable, Dict, Iterator, List, Optional, Sequence, TypeVar, Union, overload import sqlalchemy ...
# coding=utf-8 # Copyright 2020 The Uncertainty Baselines 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
import ctypes import logging # # TODO: should probably cleanup / document this file a bit better # import ida_dbg import ida_idaapi import ida_kernwin from tenet.core import TenetCore from tenet.types import BreakpointEvent from tenet.context import TenetContext from tenet.util.misc import register_callback, notify_...
# MIT License # # Copyright (c) 2019 <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 use, copy, modify, merge, pub...
# This is the original version of the project. For the more modern lesson version, see "learn it">final.py import os import random import time import platform version = "0.6" lb = "-----------------------------------------------------------------------------" def lbl(): print(lb) def br(): print(" ") def wai...
import argparse import os, sys import math import time import tabulate import torch import numpy as np from subspace_inference import data, models, utils, losses from subspace_inference.posteriors import SWAG from subspace_inference.posteriors.vi_model import VIModel, ELBO from subspace_inference.posteriors.proj_mod...
""" MIT License Copyright (c) 2020 GamingGeek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, di...
# coding=utf-8 # Copyright 2022 The Google Research 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
# Copyright 2020 DeepMind Technologies Limited. # # 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...
from wordcloud import WordCloud, get_single_color_func, ImageColorGenerator import numpy as np import pytest from random import Random from numpy.testing import assert_array_equal from PIL import Image import xml.etree.ElementTree as ET import matplotlib matplotlib.use('Agg') THIS = """The Zen of Python, by <NAME> ...
import tensorflow as tf import tensorflow.contrib as tf_contrib import numpy as np tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) # Xavier : tf_contrib.layers.xavier_initializer() # He : tf_contrib.layers.variance_scaling_initializer() # Normal : tf.random_normal_initializer(mean=0.0, stddev=0.02) # l...
''' This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Builder class, a minimal prototype class to build more chart types on top of it. ''' from __future__ import absolute_import import numpy as np from six import string_types from bokeh.core.enums i...
# cython: auto_cpdef=True """Python code for writing AVRO files""" # This code is a modified version of the code at # http://svn.apache.org/viewvc/avro/trunk/lang/py/src/avro/ which is under # Apache 2.0 license (http://www.apache.org/licenses/LICENSE-2.0) try: from fastavro._six import utob, MemoryIO, long, is_...
import numpy as np import scipy.stats as stats import matplotlib.pyplot as plt # Definition for Simple Test Case eta_test = 0 p0_test = 1 - 2 ** (-1.5) dist_theta_test = stats.lognorm(s=1, scale=np.exp(0)) sigma_theta_test = 2 * np.log(dist_theta_test.mean()/dist_theta_test.median()) mu_theta_test = np.log(dist_the...
# -*- coding: utf-8 -*- """ Ejercicio nivel 2: Agenda de peliculas. Módulo de cálculos. Temas: * Variables. * Tipos de datos. * Expresiones aritmeticas. * Instrucciones basicas y consola. * Dividir y conquistar: funciones y paso de parametros. * Especificacion y documentacion. * Instrucciones condicionales. * Dicciona...
# Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.log}. """ import os, sys, time, logging, warnings from cStringIO import StringIO from twisted.trial import unittest from twisted.python import log, failure class FakeWarning(Warning): """ A uni...
from collections import namedtuple from babel.numbers import format_decimal from datetime import date from decimal import Decimal from erica.elster_xml.est_validation import is_valid_bufa from erica.pyeric.eric_errors import InvalidBufaNumberError UNKNOWN = 'unknown' _ALL_FIELDS = { 'person_a_dob': 'E0100401', ...
# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import io import os import os.path import sys import stat import tempfile import traceback from co...
# inference and save result to file, report pointwise result import torch from option import Option import argparse import torch.nn as nn import datetime import pc_processor from pc_processor.checkpoint import Recorder import numpy as np import os import time import math from prettytable import PrettyTable import sens...
# /usr/bin/env python3 import datetime import itertools import json import logging import os import os.path import pathlib import sys import click import osxmetadata from ._version import __version__ from .attributes import _LONG_NAME_WIDTH, _SHORT_NAME_WIDTH, ATTRIBUTES from .backup import load_backup_file, write_...
from __future__ import division import json from datetime import datetime import os import data_tools as dt def annotate(input_json, output_csv, data_path, overwrite=False): """ Annotate for RetinaNet https://github.com/fizyr/keras-retinanet Only annotates the object classes (not areas for segmentation) ...
''' The contents of this file are focused on the Data class, which is used for storage of imported data from N-body output files. ''' #TODO: split functions should fix id values? Maybe not, depends on what the behavior is supposed to do # this could probably be added into update #TODO: UNIT TESTS #=================...
from config import cfg from base_utils import PoseTransformer, read_pose, read_pickle, save_pickle import os import numpy as np from transforms3d.quaternions import mat2quat import glob from PIL import Image from scipy import stats import OpenEXR import Imath from multiprocessing.dummy import Pool import struct import ...
import inspect import sys from collections import deque from collections import defaultdict import textwrap from . import version from .cmdparse import CmdOption, CmdParse from .exceptions import InvalidCommand, InvalidDodoFile from .dependency import CHECKERS, DbmDB, JsonDB, SqliteDB, Dependency from .action import C...
from __future__ import annotations from dataclasses import dataclass from enum import Enum, unique from typing import TypeVar from cs.structures.tree.binary_search_tree import BinarySearchTree, BinaryTreeNode from cs.util import Comparable, dfield T = TypeVar("T", bound=Comparable) @unique class Color...
""" All network related thingies """ import socket from abc import ABC, abstractmethod import threading import struct from typing import List, Sequence, Optional, Tuple, Any, Dict from enum import IntEnum, unique from game_state import Pizza, SnakePart from players import Player AddrType = Tuple[str, int] DEFAULT_POR...
""" Classes for streaming tokens/info from files/sparse files etc... """ from collections import Counter from random import shuffle import re from functools import partial import abc import sys import os from scipy import sparse from rosetta.parallel.parallel_easy import imap_easy, parallel_apply from .. import commo...
"""Perform analysis on detections on a dataset.""" # from __future__ import absolute_import # from __future__ import division # from __future__ import print_function # from __future__ import unicode_literals import matplotlib import matplotlib.pyplot as plt import numpy as np import argparse # import cv2 # NOQA (...
# Copyright The IETF Trust 2020, 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 o...
#!/usr/bin/env python from multiprocessing import Pool from sys import breakpointhook import numpy as np import os import matplotlib.pyplot as plt from functools import partial import copy import pandas as pd import pickle import pyapprox from scipy import stats # from scipy.optimize import root from scipy.optimize im...
""" SimNet Task """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time import argparse import multiprocessing import sys sys.path.append("..") import paddle import paddle.fluid as fluid import numpy as np import config import utils impo...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Visualization routines using matplotlib """ import copy import logging import numpy as np from astropy import units as u from matplotlib import pyplot as plt from matplotlib.collections import PatchCollection from matplotlib.colors import Normalize, L...
""" Theta Method ------------ """ import math from typing import Optional, List import numpy as np import statsmodels.tsa.holtwinters as hw from darts.utils.statistics import ( check_seasonality, extract_trend_and_seasonality, remove_from_series, ) from darts.models.forecasting.forecasting_model import F...
import numpy as np from median import compute_median_bandwidth_subset from weights import create_weights from kernel import kernel_matrices, mutate_K def mmdagg( seed, X, Y, alpha, kernel_type, approx_type, weights_type, l_minus, l_plus, B1, B2, B3 ): """ Compute MMDAgg as defined in Algorithm 1 in our pa...
########################################################## # @author: pkc/Vincent # -------------------------------------------------------- # Based on the MATLAB code by <NAME> # modification of python code by sajid # import numpy as np import numpy.fft as fft import matplotlib.pyplot as plt import itertools imp...
#!/usr/bin/env python3 import sys import pysam import argparse import warnings import numpy as np import pandas as pd from pathlib import Path import matplotlib.pyplot as plt from sklearn.metrics import accuracy_score, precision_score from sklearn.metrics import roc_curve def phred(vals): """ apply the phred sca...
#---------------------------- # WALK ALGORITHM CONSTANTS FOR CALIBRATION #---------------------------- TEST = False INCREMENTS = 20 WALK_STEPS = 5 DELAY = 0.5 KNEE_BENTUP = 10 ANKLE_BENTUP = -10 HIP_SIDESTEP = -60 KNEE_SIDESTEP = -30 ANKLE_SIDESTEP = 30 HIP_REACH = 10 KNEE_REACH = -25 ANKLE_REACH = 30 HIP_REST = -...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from captum.attr import IntegratedGradients import matplotlib.pyplot as plt import seaborn as sns from argparse import ArgumentParser import argparse import sys sys.path.append('..') import pandas as pd from cpg_transformer.cpgtransfo...
import cv2 import numpy as np import dlib from image_utils import draw_triangle, draw_square, draw_points, draw_triangles def get_faces(img_gray): detector = dlib.get_frontal_face_detector() faces = detector(img_gray) if len(faces) == 0: print("No faces found") quit() return faces ...
import heapq import networkx as nx import networkx.algorithms.isomorphism as iso import numpy as np from itertools import chain, combinations, permutations from multiprocessing import Pool from progressbar import ProgressBar, SimpleProgress from tqdm import tqdm from evaluation.sequence_matcher import SequenceMatch...
# Copyright 2017 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 a...
""" define some customized layers only loaded by *Net.py files """ import lasagne from lasagne.layers import InputLayer, get_output, Upscale3DLayer, ReshapeLayer from lasagne.layers.dnn import Conv3DDNNLayer from theano.sandbox.cuda.dnn import gpu_contiguous, GpuDnnConvDesc, gpu_alloc_empty, GpuDnnConv3dGradW from la...