text
stringlengths
6.04k
39.5k
import pandas as pd import numpy as np from collections import defaultdict from sklearn.preprocessing import scale from sklearn.decomposition import PCA from sklearn.cluster import KMeans from sklearn.mixture import GaussianMixture, BayesianGaussianMixture from sklearn import metrics import hdbscan from scipy.cluster...
import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import numpy as np from scipy import stats import statsmodels.api as sm from sklearn.metrics import accuracy_score from sklearn.metrics import precision_recall_fscore_support as score from sklearn.metrics import confusion_matrix from sklearn.util...
# coding=utf-8 # Copyright 2019 The Google NoisyStudent Team 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...
import cv2, pickle import numpy as np import tensorflow as tf from cnn_tf import cnn_model_fn import os import sqlite3, pyttsx3 from keras.models import load_model from threading import Thread engine = pyttsx3.init() engine.setProperty('rate', 150) os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' model = load_model('cnn_model...
# standard imports import numpy as np import matplotlib.pyplot as plt import time # custom imports import apt_fileio import m2q_calib import plotting_stuff import initElements_P3 import peak_param_determination as ppd from histogram_functions import bin_dat from voltage_and_bowl import do_voltage_and_bowl import v...
# -*- coding: utf-8 -*- import sys import traceback from typing import ( Tuple, List, Optional ) from cadnano import util from cadnano.proxies.cnobject import CNObject from cadnano.proxies.cnproxy import ( ProxySignal, UndoCommand ) from cadnano.proxies.cnenum import ( ModEnum, EnumType ) f...
import unittest, time, pickle from overcooked_ai_py.planning.planners import MediumLevelPlanner, Heuristic, HighLevelActionManager, HighLevelPlanner from overcooked_ai_py.mdp.actions import Direction, Action from overcooked_ai_py.mdp.overcooked_mdp import OvercookedGridworld, PlayerState, ObjectState, OvercookedState f...
################################################## # Copyright (c) <NAME> [GitHub D-X-Y], 2020 # ######################################################## # DARTS: Differentiable Architecture Search, ICLR 2019 # ######################################################## import argparse import click import os import random...
""" HEXAPAWN A machine learning game, an interpretation of HEXAPAWN game as presented in <NAME>'s "The Unexpected Hanging and Other Mathematical Diversions", Chapter Eight: A Matchbox Game-Learning Machine. Original version for H-P timeshare system by <NAME> 5/5/76 Instructions by <NAME> Conversion to MITS BASIC by <...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import logging import os import re from importlib.machinery import SourceFileLoader import numpy as np import torch import torch.nn as nn from core.metrics import Metrics from utils import \ get_lr, \ get_lr_all, \ make_optimizer, \...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 <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 limitati...
import logging import inspect import os from django.db import models from django.urls import reverse from django.apps import apps from django.db import transaction from django.utils.translation import ugettext_lazy as _ from polymorphic_tree.managers import PolymorphicMPTTModelManager from mglib import step from mgl...
# Copyright Amazon Web Services and its Affiliates. 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...
from __future__ import print_function, division, absolute_import import subprocess import numpy as np import pandas as pd import hashlib import argparse import sys from classification import metadata import six remapping = { # 'seismic_vessel' : 'research' } def read_ids(gcs_path): id_text = subprocess.check_o...
"""Defines the items related to player injuries.""" from enum import Enum, auto import scrapy class InjuryType(Enum): """The different reasons a player may appear on an injury report.""" ABDOMEN = auto() ACHILLES = auto() ANKLE = auto() APPENDIX = auto() ARM = auto() ARRHYTHMIA = auto() ...
# python 3 import matplotlib # matplotlib.use('pgf') # pgf_with_pdflatex = { # "pgf.texsystem": "pdflatex", # "pgf.preamble": [ # r"\usepackage[utf8x]{inputenc}", # r"\usepackage[T1]{fontenc}", # r"\usepackage{cmbright}", # ] # } # matplotlib.rcParams.update(pgf_with_pdflate...
# Downstream: crime prediction (also applicable to Fire calls prediction) # two modes: # --- No exogenous data # --- Oracle network # The model consists of a 3d cnn network that uses # historical ST data to predict next time step # users can choose not to use any features, or # to use arbitrary number of 1D or 2D feat...
# BEGIN_COPYRIGHT # # Copyright 2009-2018 CRS4. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
import utility import dictionaries import mysql.connector from mysql.connector import errorcode #import database #assume all strings all lower #elongate all abbreviaions (rd to road, CA to california, M to male) #remove all special chars #lowercase all #remove trailing and leading whitespace def start(): try: ...
from collections.abc import Callable, Iterable, Mapping from neuwon.database import memory_spaces from neuwon.database.database import DB_Class, DB_Object, Database from neuwon.database.doc import Documentation from neuwon.database.dtypes import * import cupy import numpy as np class DataComponent(Documentation): ...
# coding=utf-8 from __future__ import absolute_import import threading import octoprint.plugin from octoprint.events import Events import re import numpy as np import logging import flask import json class bedlevelvisualizer( octoprint.plugin.StartupPlugin, octoprint.plugin.TemplatePlugin, octoprint.plu...
"""Utilities to be used mainly by the Index class.""" import math import numpy as np # Hints for chunk/slice/block/superblock computations: # - The slicesize should not exceed 2**32 elements (because of # implementation reasons). Such an extreme case would make the # sorting algorithms to consume up to 64 GB of mem...
import requests import glob import os import json import zipfile import shutil import pandas as pd import time BASE_DIR = os.path.abspath(os.path.dirname(__file__)) DATA_DIR = os.path.join(BASE_DIR, 'datasets') api_adress = 'http://18.180.27.178:5050' # api_adress = 'http://54.249.71.234:5050' address_test_file = '/a...
import numpy as np import torch import argparse import utils from datetime import datetime import TD3 import OurDDPG import DDPG import multiprocessing from sac import SAC from models.mlp import MLP, FourierMLP, LogUniformFourierMLP, Siren, D2RL, VariableInitMLP, ConcatMLP, DropoutMLP, \ SpectralMLP import os.path ...
import win32api,win32gui,win32con, win32ui import win32clipboard as wc import time import math from Request_deal import request_deal from PIL import Image, ImageGrab from findpoints import findpoint_c, screenshort_new # In[2]: # Set the mouse def Click(position_x, position_y): win32api.SetCursorPos([position_x,...
# *************************************************************** # Copyright (c) 2020 Jittor. Authors: # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>>. # # All Rights Reserved. # This file is subject to the terms and conditions defined in # file 'LICENSE.txt', which is part ...
import pandas as pd import category_encoders as ce from sklearn.metrics import mean_absolute_error import plotly.express as px import eli5 from eli5.sklearn import PermutationImportance from joblib import load from dill import dump # Load in all 8 pickled models linear_unrealistic_all = load('assets/linear_unrealistic...
import math import time from typing import Tuple import numpy as np import torch import torch_sparse from tqdm.auto import tqdm from grb.attack.base import ModificationAttack, EarlyStop from grb.evaluator import metric from grb.utils import utils from grb.utils.normalize import SPARSEAdjNorm def tanh_margin_loss(lo...
""" This file contains functions related to the annual report """ import pandas as _pd # import numpy as _np # import altair as _alt ####################################################################################################################### def fields_summary_table( points, artifacts, fid...
# coding: utf-8 import numpy as np from numpy import matrix as mat import cv2 import os import math def undistort(img, # image data fx, fy, cx, cy, # camera intrinsics k1, k2, # radial distortion parameters p1=None, p2=None, # ta...
# # Process message body, applying preprocessor {{ }} transformations to the html / text # from enum import Enum, auto import time, sys, json from requests import request # # Preprocessor transform request preProcessorRequest = 'x-url' class Tok(Enum): # raw lexer token types STRING = auto() WHITESPACE = a...
import torch from torch import nn from torch.nn import CrossEntropyLoss from torch.nn import functional as F from .bert_utils import cached_path, WEIGHTS_NAME, CONFIG_NAME from vit_pytorch import sparsemax, entmax15 from .guided_filter import SelfGuidedFilter import numbers def gaussian_kernel_2d(mean, std_inv, size...
from keras.models import load_model import glob import os from skimage.io import imread, imsave from skimage.transform import resize import cv2 import matplotlib.pyplot as plt from create_individual_lettuce_train_data import construct_ground_truth, fix_noise from skimage.color import rgb2grey, grey2rgb from skimage.dr...
# This file is part of the Indico plugins. # Copyright (C) 2002 - 2022 CERN # # The Indico plugins are free software; you can redistribute # them and/or modify them under the terms of the MIT License; # see the LICENSE file for more details. import re import time from functools import cached_property from operator imp...
# https://docs.opensource.microsoft.com/content/releasing/copyright-headers.html import torch import functools import torch.nn as nn import torch.nn.functional as F class AdaptiveInstanceNorm2d(nn.Module): def __init__(self, num_features, eps=1e-5, momentum=0.1): super(AdaptiveInstanceNorm2d, self).__in...
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2018 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal #...
""" Generate AST node definitions from an ASDL description. """ import sys import os import asdl products = [] sums = [] class ASDLVisitor(asdl.VisitorBase): def __init__(self, stream, data): super(ASDLVisitor, self).__init__() self.stream = stream self.data = data def visitModule(s...
# -*- coding: UTF-8; indent-tabs-mode:nil; tab-width:4 -*- # This file is part of DITA DTD Generator. # # Copyright 2012 <NAME> <http://www.elovirta.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...
from collections import defaultdict from numpy import amax, amin, mean, array, sqrt #, sum from numpy.linalg import eigvalsh # type: ignore def vonMises3D(o1, o2, o3): ovm = sqrt(0.5 * (o1-o2)**2 + (o2-o3)**2 + (o1-o3)**2) return ovm def vonMises2D(o1, o2): return sqrt(0.5 * o1**2 + o2**3 - o1*o2) def ...
import os os.environ["CUDA_VISIBLE_DEVICES"] = "5" import logging import random import sys from tqdm import tqdm import torch.optim as optim import torch.nn.functional as F from torch.utils.data import DataLoader from torchnet.meter import ConfusionMeter from man_models import * from data_prep.msda_preprocessed_amazon_...
from math import sin, cos, sqrt, atan2, radians import copy import matplotlib.pyplot as plt import rospy from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import Pose2D from swarm_search.msg import sip_goal2 from nav_msgs.msg import Odometry from mavros_msgs.msg import State from mavros_msgs.msg import...
# %% [markdown] # # THE MIND OF A MAGGOT # %% [markdown] # ## Imports import os import time import warnings from itertools import chain import colorcet as cc import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.transforms as transforms import networkx as nx import numpy as np import pandas as pd...
#! /usr/local/bin/python -*- coding: UTF-8 -*- import random from datatables import ColumnDT, DataTables from flask import Blueprint, request, render_template, flash, redirect, url_for, Response, jsonify from app import db, models, q, client, login_manager from flask.ext.api.decorators import set_renderers from flask....
import cv2 import os import math import numpy as np import time import shutil from tqdm import tqdm import imagesize from numba import njit from torch import nn import warnings import torch import pandas as pd def label_category_find(): # calculate all the categories of label gt_path = "../dataset/semantic_se...
# Bi-mar-u → Marke der Rätsel Agent<NAME> (→ schiffli versänke) # (..) # 8x8 grid, position all ships (o,o,o,o,<>,<>,<>,<=>,<=>,<==>) such that each ship has no immediate neighbour # . → ?, o → single ship, m → middle section of ship, l → corner pointing left, r → corner pointing right, # u → corner pointing up, d → ...
import os from collections import defaultdict from io import IOBase from itertools import groupby from typing import Dict, List, Tuple, Union, Optional, AnyStr from uuid import uuid4 from zipfile import ZipFile import msgpack import networkx as nx from typing.io import IO from charge.babel import convert_from, IOType...
#!/usr/bin/env python3 # Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Runs bcanalyzer to extract data from LLVM Bitcode (BC) files. IsBitcodeFile(): Reads the magic header of a file to quickly decid...
# Copyright (c) 2011 - 2017, Intel Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
import urllib import logging import os import csv import numpy as np import pandas as pd from copy import deepcopy from collections import defaultdict from deep_disfluency.utils.tools import convert_from_eval_tags_to_inc_disfluency_tags from deep_disfluency.utils.tools import add_word_continuation_tags from deep_disfl...
##################################################### Import system libraries ###################################################### import matplotlib as mpl mpl.rcdefaults() mpl.rcParams.update(mpl.rc_params_from_file('meine-matplotlibrc')) import matplotlib.pyplot as plt import numpy as np import scipy.constants as c...
"""Provides simple type aliases used in SweetPea Core.""" # Allow type annotations to refer to not-yet-declared types. # flake8 doesn't know about this so we have to #noqa it. from __future__ import annotations # noqa import math from itertools import chain from typing import Iterable, List, Optional, Sequence, Tup...
''' This function function used for training and cross-validating model using. The database is not included in this repo, please download the CinC Challenge database and truncate/pad data into a NxM matrix array, being N the number of recordings and M the window accepted by the network (i.e. 30 seconds). For more...
import igraph import numpy as np import pandas as pd import geopandas from shapely.geometry import LineString from skimage.graph import MCP_Geometric, MCP from skimage import graph from pyproj import Transformer from scipy import stats def cost_tobler_hiking_function(S,symmetric=True): """ Applies Tobler's Hik...
# mechanism_dvs.py # # Copyright 2014 Cybercom Finland Oy # 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....
""" Copyright 2019 <NAME>. 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 distribut...
#!/usr/bin/python # # Copyright 2020 <NAME> # # 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...
import numpy as np import matplotlib.pyplot as plt import GPy from gosafeopt import linearly_spaced_combinations from gosafeopt import GoSafeOptPractical import matplotlib.pyplot as plt import matplotlib.cm as cm import pandas as pd import os import time ''' own example ''' plt.rcParams.update({'font.size': 16}) import...
import numpy as np from pyqmc import pbc def sherman_morrison_row(e, inv, vec): ratio = np.einsum("ij,ij->i", vec, inv[:, :, e]) tmp = np.einsum("ek,ekj->ej", vec, inv) invnew = ( inv - np.einsum("ki,kj->kij", inv[:, :, e], tmp) / ratio[:, np.newaxis, np.newaxis] ) invne...
import asyncio import json import random import time from datetime import datetime import discord from discord.ext import commands from discord.ext.commands import BucketType from cogs.trivia_category import FuturamaTrivia from cogs.trivia_category import SimpsonsTrivia TRIVIA_ROLE = 'Trivia Moderator' # If guild ...
"""This file contains functions to: - compute the parameters used to generate simulated data, - generate simulated data using these parameters, - compute the Bayes rate of the pattern mixture model (both exact analytic expression and Monte Carlo approximation). """ import numpy as np from sklearn.utils ...
# Training the whole Full World Model # Importing the libraries from mpi4py import MPI import numpy as np import json import os import subprocess import sys from model import make_model, simulate from es import CMAES, SimpleGA, OpenES, PEPG import argparse import time # Setting the Hyperparameters num_episode = 1 e...
import os,fnmatch,sys import shutil,re import numpy as np from natsort import natsorted import cv2 import numpy as np import tifffile as TIF import skimage from skimage import io from skimage import feature from skimage import exposure from skimage import morphology from scipy import ndimage from skimage import measure...
# -*- coding: utf-8 -*- # Copyright (c) 2019-2021 <NAME>. # All rights reserved. # Licensed under BSD-3-Clause-Clear. See LICENSE file for details. from django.conf import settings from django.urls import reverse from django.http import HttpResponseRedirect, Http404 from django.db.models import Q from django.views...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """A miscellaneous collection of basic functions.""" from __future__ import (absolute_import, unicode_literals, division, print_function) import numpy as np import logging import sys def r_in(td, r_0): """Calculate incident ...
""" End Device session information. """ ################################################################################# # MIT License # # Copyright (c) 2018, <NAME>, Universitat Oberta de Catalunya (UOC), # Universidad de la Republica Oriental del Uruguay (UdelaR). # # Permission is hereby granted, free of charge, to...
# This file is part of Hypothesis, which may be found at # https://github.com/HypothesisWorks/hypothesis/ # # Most of this work is copyright (C) 2013-2021 <NAME> # (<EMAIL>), but it contains contributions by others. See # CONTRIBUTING.rst for a full list of people who may hold copyright, and # consult the git log if yo...
# =============================================================================== # # Copyright (c) 2013-2016 Qualcomm Technologies, Inc. # All Rights Reserved. # Confidential and Proprietary - Qualcomm Technologies, Inc. # # =============================================================================== """ Create...
import tensorflow as tf import numpy as np import datetime import pickle from music_parser import * def get_time(): return datetime.datetime.now().strftime("%m-%d--%H-%M") def get_batch(songs_parsed, one_hot_length, num_keys, batch_size, num_timesteps): # create test data # loop = np.array([ # [0...
"""This module implements sampling from the entity model. """ import argparse import gzip import json import enum import multiprocessing as mp import os import pickle import torch import numpy as np import tqdm from sketchgraphs.data import sketch as datalib from sketchgraphs.data.sequence import NodeOp, EdgeOp from...
# -*- coding: utf-8 -*- import logging import itertools import typing import semver import copy as py_copy from typing import List, Set, Dict, Tuple, Optional from enzi import config from enzi.config import DependencyRef from enzi.config import Config as EnziConfig from enzi.config import DependencyVersion from enzi....
#!/usr/bin/env python # coding: utf-8 # ## Tool for simulating 1D Conservative Transport (Laboratory Column) ## # ### Info on the tool ### # # The worksheet addresses **1D conservative transport** of a solute through a porous medium, e.g. in a laboratory column. <br> # Water flow through the porous medium is assumed...
# Copyright 2021 Open Source Robotics Foundation, 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...
from __future__ import division import tensorflow as tf import tensorflow.contrib.slim as slim from tensorflow.contrib.layers.python.layers import utils import numpy as np # Range of disparity/inverse depth values DISP_SCALING = 0.3 MIN_DISP = 0.00001 def resize_like(inputs, ref): iH, iW = inputs.get_shape()[1],...
import math import json import numpy as np from django.db import models from imagekit.models import ImageSpecField from imagekit.processors import SmartResize, ResizeToFit from common.models import ResultBase from shapes.models import Shape, MaterialShape, MaterialShapeLabelBase from common.geom import orthogonaliz...
""" https://github.com/openai/gym/wiki/Table-of-environments https://github.com/openai/gym/tree/master/gym/envs - check gym/gym/envs/__init__.py for solved properties (max_episode_steps, reward_threshold, optimum). Solved: avg_score >= reward_threshold, over 100 consecutive trials. "Unsolved environment" -...
""" Install tools for NiftyPET including: * NiftyReg * dcm2niix """ import logging import multiprocessing import os import platform import re import sys from functools import wraps from os import fspath, path from pathlib import Path from shutil import rmtree from subprocess import CalledProcessError, check_output, run...
#!/usr/bin/env python3 from __future__ import print_function from __future__ import division from __future__ import absolute_import import copy import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import torchvision.models as models # rewrite these...
#!/usr/bin/env python import rospy import tf import scipy.linalg as la import scipy.signal as sig import numpy as np from math import * import mavros_msgs.srv from mavros_msgs.msg import AttitudeTarget from nav_msgs.msg import Odometry from std_msgs.msg import * from test.msg import * from geometry_msgs.msg import * fr...
from datetime import date, datetime, timedelta import traceback from colorama import init, Fore, Style from ..utils.misc import group_list init(autoreset=True) def human(obj): if isinstance(obj, timedelta): secs = obj.total_seconds() mins = secs / 60.0 hours = mins / 60.0 if ho...
from __future__ import print_function import os.path import numpy as np import glob import AdaptivePELE.constants class PDBLoadException(Exception): __module__ = Exception.__module__ class PDBManager: """ Class that loads and processes a given pdb file """ # Residue Names that are recognized by ...
import sys, os import copy import pandas as pd import datetime import json import os import shutil import multiprocessing as mp from multiprocessing.pool import ApplyResult import itertools sys.setrecursionlimit(1500) import threading from statslib.utils.log import Logger from statslib.utils.excel ...
import argparse import math import random import os import sys import numpy as np import torch from torch import nn, autograd, optim from torch.nn import functional as F from torch.utils import data import torch.distributed as dist from torchvision import transforms, utils from tqdm import tqdm from copy import deepcop...
from rdflib.namespace import RDF, SKOS, DCTERMS, RDFS, OWL, DC from rdflib import URIRef, Namespace, Literal, Graph import markdown from flask import url_for import requests from config import Config from skos.concept_scheme import ConceptScheme, ConceptSchemeRenderer from skos.concept import Concept, ConceptRenderer ...
# Copyright 2022 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 agreed to in writing, ...
''' data processing for neuron project ''' # built-in import sys import os import shutil import six # third party import nibabel as nib import numpy as np import scipy.ndimage.interpolation from tqdm import tqdm_notebook as tqdm # for verbosity for forloops from PIL import Image import matplotlib.pyplot as plt # n...
from botoy import GroupMsg, FriendMsg from botoy import decorators as deco from module.send import Send as send from module.pixivApi import pixiv from module import config, database from loguru import logger import re import random import requests import time setuPattern = '来(.*?)[点丶份张幅](.*?)的?(|r18)[色瑟涩😍🐍][图圖🤮]' # ...
# Various tools around backups, mostly to get info about them. from __future__ import absolute_import from __future__ import division from __future__ import print_function from flask import current_app, json from os import path, stat, mkdir, makedirs, remove import os import shutil from glob import glob from zipfile i...
"""Context methods dealing with run scanning and selection""" import fnmatch import re import typing as ty from collections import defaultdict import numpy as np import pandas as pd import pytz import datetime import strax # use tqdm as loaded in utils (from tqdm.notebook when in a juypyter env) tqdm = strax.utils.tqdm...
import collections import itertools from numbers import Number from typing import (Iterable, Mapping, NamedTuple, Optional, Tuple) import casadi as ca import numba import numpy as np from numpy import sin, cos, tan, exp, sqrt, arctan, tanh import scipy.interpolate as interpolate import sympy as sym import pycollo.fun...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Read and save event lists from FITS files.""" import warnings import copy import os import numpy as np from astropy import log from stingray.io import load_events_and_gtis from stingray.events import EventList from stingray.gti import cross_two_gtis fr...
import os from itertools import zip_longest, product from functools import partial from os.path import dirname import numpy as np import scipy.sparse from tqdm.autonotebook import tqdm import torch import random import pdb import string import logging from sklearn.cluster import k_means, DBSCAN import matplotlib.pyplo...
#!/usr/bin/env python3 """Unit test for ellipsefits.py""" import unittest import numpy as np from scipy.interpolate import InterpolatedUnivariateSpline as Interp import ellipsefits_copy as ellipsefits # module to be tested # prepare input and reference data efitFileDir = '/Beleriand/data/sdss/n5831/' efitFile_...
import random import numpy as np import datetime import argparse import sys sys.path.append(".") from model.network_params import ModelVariant, TargetType # plotting import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import torch # mnist dataset and metrics from sklearn.datasets import fetch...
"""Provides a way to serialize and deserialize Python class objects to dictionaries. Also allows for minimization of dictionary key fields. """ __author__ = "<NAME>" import json import datetime import types json_date_handler = lambda obj: obj.strftime('%Y-%m-%dT%H:%M:%S') if isinstance(obj, datetime.datetime) else N...
r""" Semistandard Tableaux ===================== This is an implementation of the abstract base class :class:`sage.combinat.path_tableaux.path_tableau.PathTableau`. This implementation is for semistandard tableaux, represented as a chain of partitions (essentially, the Gelfand-Tsetlin pattern). This generalises the j...
""" We try 2 strategies for proving the patch safety of an approximate network: 1. Just use deepzono proof directly (baseline) 2. Create templates for original network and use these templates for the proof of approximate network TODO: Implement your own zonotope analyzer based on pytorch! This will save you lots of ti...
# -*- coding: utf-8 -*- """ Copyright 2021 huhui, Inc. All Rights Reserved. @author: huhui @software: PyCharm @project: keras-yolo3 @file: split_image.py @version: v1.0 @time: 2021/3/3 下午4:32 @setting: ------------------------------------------------- Description : 工程文件说明: """ import os import cv2 import json impor...
# Copyright 2018 The Wallaroo 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 ...
# -*- coding: utf-8 -*- from __future__ import division """ Created on Wed Mar 25 09:36:27 2020 @author: splathottam """ """PV-DER base class.""" import os import math import pdb import numpy as np import scipy from scipy.optimize import fsolve, minimize from pvder.DER_check_and_initialize import PVDER_SetupUtilit...
import sys sys.path.insert(0, "../") import random import os import pandas as pd import numpy as np import pickle import multiprocessing from scipy.stats import hypergeom from statsmodels.sandbox.stats.multicomp import fdrcorrection0 import pcst_fast import networkx as nx from networkx.algorithms.community.quality i...