text
stringlengths
6.04k
39.5k
from RDS import User, Token, LoginToken, OAuth2Token, BaseService, LoginService, OAuth2Service, Util from typing import Union from RDS.ServiceException import ( ServiceExistsAlreadyError, ServiceNotExistsError, ) import logging import requests import os import json logger = logging.getLogger() def append(se...
from abc import ABC,abstractmethod from enum import Enum from math import isclose import numpy as np from scipy.optimize import fmin_bfgs, minimize import pdb __all__ = ['DP_fair_logloss_classifier','EODD_fair_logloss_classifier','EOPP_fair_logloss_classifier'] def _log_logistic(X): """ This function is used from ...
""" Reader for the Lexical Markup Framework (LMF) format. """ from typing import ( TypeVar, Type, Container, List, Tuple, Dict, Set, NamedTuple, Optional, ) from pathlib import Path import warnings import xml.etree.ElementTree as ET # for general XML parsing import xml.parsers.exp...
""" Content Provider: Wikimedia Commons ETL Process: Use the API to identify all CC-licensed images. Output: TSV file containing the image, the respective meta-data. Notes: https://commons.wikimedia.org/wiki/API:Main_page ...
# Copyright 2017-2018 Amazon.com, Inc. or 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fil...
from scipy import optimize import numpy as np import sympy import math import matplotlib.pyplot as plt import pandas as pd from scipy.stats import norm import cvxpy as cp def maxProfit( prices: list[int]) -> int: n = len(prices) dp = [[0, -prices[0]]] + [[0, 0] for _ in range(n)] for i in range(1, n): ...
import os import stat import datetime import errno import pathlib import collections import trio import pyfuse3 from metaindex import query from metaindex import logger from metaindex.cache import Cache # OpenFileHandle is a filehandle for this inode (flags are optional) OpenFileHandle = collections.namedtuple('Ope...
import os import re import networkx as nx import numpy as np import scipy.sparse as sp import torch as th from dgl import DGLGraph from sklearn.model_selection import ShuffleSplit import pickle as pkl import sys from training_procedure.load_data.load_citation import remove_reverse_edges """splits中存储的是已经分配好的十折交叉验证对应的m...
###################################################################################################### ########################## MINESWEEPER ############################################ ###################################################################################################### ######...
from tkinter import * from tkinter import filedialog from tkinter import messagebox from openpyxl import load_workbook import os from os import path from os import system import math import copy import msvcrt title = "Grade Management" system("title " + title) system("mode con cols=115 lines=45") system("chcp 949") ...
''' CFG Format ---------- An experimental parser for the `Consortium for Functional Glycomics <http://www.functionalglycomics.org/>`_ (CFG) glycan line format. ''' import re import warnings from collections import deque, namedtuple from functools import partial from glypy.structure import ( Monosaccharide, Glyc...
#!/usr/bin/env python3 import sys import json from elftools.elf.elffile import ELFFile # Increase this if a change is made in the format VERSION_NBR = 4 POINTER_SIZE = 8 def create_json_file(die_data, base_name): """Write data pack to JSON file Keyword arguments: die_data -- data pack to write base...
import os import pickle import torch import matplotlib.pyplot as plt import numpy as np from scipy.stats import kendalltau from scipy.stats import wilcoxon from utils.CellOverlaps import CellOverlaps from utils.utils_plot import make_single_iter_pos_and_neg_gates_plot FMT_STR = '%.4f' """ File containing just the out...
# # Copyright (c) 2021, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
# -*- coding: utf-8 -*- import random import numpy as np import torch as th import itertools import gym_selfx.selfx.selfx as selfx from affordable.affordable import Affordable from gym_selfx.render.draw import OpencvDrawFuncs from Box2D.Box2D import (b2CircleShape as circleShape, b2World) from collections import deq...
# -*- coding: utf8 -*- ######################################################################################## # This file is part of exhale. Copyright (c) 2017-2018, <NAME>. # # Full BSD 3-Clause license available here: # # ...
from flask import Flask, flash, request, redirect, render_template, url_for, jsonify from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, FileField import os import urllib.request import sqlite3 import random from search_preprocess import Indexer, Search from werkzeug.utils import secure_filen...
import logging from rest_framework import serializers from kive.serializers import AccessControlSerializer from method.models import CodeResourceRevision, Method from method.serializers import CodeResourceRevisionSerializer, MethodSerializer from pipeline.models import PipelineFamily, Pipeline, CustomCableWire,\ P...
# -*- coding: utf-8 -*- from enum import Enum from typing import List, Union, Optional, Type import numpy as np import pandas as pd from zvt.contract import EntityMixin from zvt.contract import IntervalLevel, AdjustType from zvt.contract.drawer import Rect from zvt.contract.factor import Transformer, Accumulator from...
# -*- coding: utf-8 -*- """ Torch version of hyperparams TODO: [ ] - need to extract relavent params from loaders [ ] - need to extract relavent params from datasets [ ] - ensure monitor is handled gracefully [ ] - prevent non-relevant params from being used in the hash CommandLine: python ~/code/...
import os import os.path as osp import copy from tqdm import tqdm from typing import Tuple, Union from pathlib import Path from collections import defaultdict import numpy as np from pyquaternion import Quaternion from scipy.spatial.transform import Rotation as R from nuscenes.nuscenes import NuScenes from nuscenes.u...
#from rtergpy.waveforms import etime2name #from rtergpy.waveforms import tacerstats,trstat2pd,e2Me,process_waves,eventdir,iterate #from rtergpy.plotting import tacerplot,Edistplot,Ehistogram,Eazplot,stationEmapBasemap, stationEmapPygmt from obspy import UTCDateTime from tqdm import tqdm import numpy as np import pandas...
""" The MIT License Copyright (c) 2018-2020 <NAME> """ from typing import Optional, Any, List, Tuple, Callable, Iterator from collections import defaultdict from functools import lru_cache from numpy import ndarray from pandas import DataFrame from scipy.sparse import coo_matrix, csr_matrix from sklearn.utils import...
import numpy as np # import pdb def PMTphea(ev, t_windows=np.float64([[0, 99], [100, 200]]), phe_width=np.float64(1.8), base_samples=np.intp(80), single_pe_thresh=np.float64(6e-3), single_pe_max=np.float64(1e-3), stop_hunting_thresh=np....
# -*- coding: utf-8 -*- # Copyright 2016 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module containing the config stages.""" from __future__ import print_function import errno import os import re import textwra...
import pathlib import numpy as np import nibabel as nib import matplotlib.pyplot as plt from tqdm.notebook import tqdm def get_hgg_paths(): """ This will only work if imported in a file that lives inside the S20-team0-project directory Abbreviated expected directory setup for path to work: ./so...
import numpy as np from itertools import combinations_with_replacement import time from random import choice class CouldNotClassifyClusterError(Exception): pass class GaussianClusterTracker(object): def __init__(self, atoms=None, threshold=0.001, cluster_elements=[], num_clusters=1, init_cen...
# -*- coding: utf-8 -*- import os from decimal import Decimal as D from io import BytesIO from django.core.files.storage import default_storage from wildlifecompliance.settings import STATIC_ROOT from oscar.templatetags.currency_filters import currency from reportlab.lib import enums from reportlab.lib.colors import ...
import json import logging import time import vanilla from urllib.parse import urlparse from Foundation import NSObject, NSString, NSUTF8StringEncoding from AppKit import NSToolbarFlexibleSpaceItemIdentifier, NSPredicate from AppKit import NSEvent, NSAlternateKeyMask from mojo.events import addObserver, removeObserv...
"""Utility functions pertaining to archive metadata import.""" from collections import defaultdict from datetime import date as Date, datetime as DateTime from django.db import transaction from vesper.django.app.models import ( AnnotationConstraint, AnnotationInfo, Device, DeviceConnection, DeviceInput, Dev...
import datetime as dt import numpy as np import pandas as pd from flowmeterAnalysis import readFiles from flowmeterAnalysis import rainEvents from flowmeterAnalysis import basicMath from flowmeterAnalysis import conversions ### DRY WEATHER ANALYSIS ## ''' For the dry weather analysis, days are considered "rainy" i...
# TODO, implement SAC from https://github.com/1nadequacy/pytorch_simple_sac import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import copy import math import utils LOG_FREQ = 10000 OUT_SIZE = 29 def soft_update_params(net, target_net, tau): for param, target_param in zip(net.p...
# -*- coding: utf-8 -*- """ Created on Wed Mar 1 11:50 2017 Description: This script processes a number of input spatial feature classes to combine them with a source dataset via the ArcPy update_analysis method. This method effectively clips from the dataset to be updated the geometry extent of the inp...
# coding=utf-8 """Blender rendering automation script.""" import bpy import os import random import string import signal import sys import math import time import pickle from enum import Enum class TextureType(Enum): """The texture type of the head and the background/world.""" Gray = 1 Noise = 2 Te...
# Copyright 2015 <NAME>-Sanfratello # # 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 w...
import sys, os, time import tensorflow as tf import numpy as np import networkx as nx # Add the parent folder path to the sys.path list for importing sys.path.insert(1, os.path.join(sys.path[0], '..')) # Import model builder from graphnn import GraphNN from mlp import Mlp # Import tools from util import timestamp, memo...
# hgweb/hgwebdir_mod.py - Web interface for a directory of repositories. # # Copyright 21 May 2005 - (c) 2005 <NAME> <<EMAIL>> # Copyright 2005, 2006 <NAME> <<EMAIL>> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__...
""" Module for parsing intermediate and output XFaster files. """ import sys import numpy as np from warnings import warn from collections import OrderedDict __all__ = [ "dict_to_arr", "arr_to_dict", "unique_tags", "tag_pairs", "dict_to_index", "spec_index", "spec_mask", "dict_to_dmat",...
""" Artist for matplotlib to display a colorbar as an artist, instead of an axis as it is the default in matplotlib. Example:: >>> fig = plt.figure() >>> ax = fig.add_axes([0.0, 0.0, 1.0, 1.0]) >>> mappable = ax.imshow(...) >>> colorbar = Colorbar(mappable) >>> ax.add_artist(scalebar) >>> plt.show()...
# -*- coding: utf-8 -*- """scripts used to automatically explore login path""" import codecs import os import json import unittest from time import sleep from ConfigParser import ConfigParser from urllib2 import URLError from pygments import highlight, lexers, formatters from appium import webdriver from selenium.comm...
# // Copyright 2017-2020, # // # // 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 ...
# Copyright (C) 2016 <NAME> (ghcollin) # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. import tensorflow as tf import multitables as mtb import numpy as np import threading import contextlib __author__ = "<NAME>" __version__ = "1.1.2" def...
import sys import json import os from os.path import isfile, join, exists import pandas as pd import subprocess import numpy as np from time import sleep sys.path.append("/usr/local/syna/lib/python") from touchcomm import TouchComm PT_ROOT = "/usr/local/syna/lib/python/production_tests/" PT_RUN = PT_ROOT + "run/" PT_...
#-*- coding:utf-8 -*- # &Author AnFany # 也适用于多维输出 from BPNN_DATA_Reg import model_data as R_data import numpy as np '''第一部分:数据准备''' train_x_data = R_data[0] # 训练输入 train_y_data = R_data[1] # 训练输出 predict_x_data = R_data[2] # 测试输入 predict_y_data = R_data[3] # 测试输出 '''第二部分:函数''' # 隐层的激活函数 # 注意:...
# coding: UTF-8 import os from posixpath import join import torch import torch.nn as nn from torch.nn import * import torch.nn.functional as F import numpy as np import torch.optim as optim from settings import * import torch.utils.data as Data from loader.DBP15KRawNeighbors import DBP15KRawNeighbors from script.prepro...
import scipy.ndimage import numpy as np from PIL import Image from PIL import ImageOps from PIL import ImageFilter from cardiachelpers import importhelper from cardiachelpers import mathhelper from skimage import io import skimage.filters import skimage.measure import skimage.morphology import skimage.feature import ma...
# -*- coding: utf-8 -*- """ Alll related to json dynamic parsing """ import os import re import fnmatch import pandas as pd import json import importlib import time # import toml from pathlib import Path #from jsoncomment import JsonComment ; json = JsonComment() import fire from inspect import getmembers ########...
import datetime from datetime import datetime from odoo import models, fields, api, _ from odoo.exceptions import UserError class InternalPurchase(models.Model): _inherit = "purchase.order" @api.model def _default_picking_type(self): return self._get_picking_type(self.env.context.get('comp...
# coding: utf-8 """ tree-graph-labeling ~~~~~~~~~~~~~~~~~~~ Generates all labelings of a given free tree with the specified alphabet. :copyright: 2017, <NAME> :license: MIT, see LICENSE for more details :version: 1.0.2 :email: <EMAIL> :maintainer: <NAME> """ ...
# Models import tensorflow as tf import numpy as np from tensorflow.python.framework.convert_to_constants import convert_variables_to_constants_v2_as_graph import time import pickle import os import sklearn from sklearn.ensemble import RandomForestRegressor os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import warnings war...
#!/usr/bin/python # # Copyright (c) 2020 Cisco and/or its affiliates. # # 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...
# Copyright 2021 United States Government as represented by the Administrator of the National Aeronautics and Space # Administration. No copyright is claimed in the United States under Title 17, U.S. Code. All Other Rights Reserved. """ Generate sample images and camera meta-data for doing the examples included thro...
import os import numpy as np import torch import torch.nn as nn import torch.cuda as cuda from utils.data_loader import dataloader_cifar10, dataloader_cifar100 from utils.data_loader import dataloader_imagenet from utils.lsq_train import LogHelper from utils.lsq_train import get_arguments from utils.lsq_train import ge...
from glob import glob from albumentations import HorizontalFlip, VerticalFlip, RandomBrightnessContrast, Normalize, Compose from albumentations.augmentations.geometric.transforms import Affine from albumentations.augmentations.transforms import GaussNoise from tifffile import tifffile from torch.utils import data from...
import os import requests import datetime from xml.dom import minidom from qgis.PyQt.uic import loadUiType from qgis.PyQt.QtWidgets import QAction, QDialog, QDialogButtonBox, QMessageBox from qgis.PyQt.QtGui import QIcon, QColor from qgis.core import ( QgsVectorLayer, QgsWkbTypes, QgsVectorFileWriter, ...
""" Cloned MRF - linear messages""" from __future__ import print_function from builtins import range import numba as nb import numpy as np import torch torch.autograd.set_detect_anomaly(True) class CMRF(object): def __init__( self, input_train, output_train, p_contour, ...
# -*- coding: utf-8 -*- """Implementation of triples splitting functions.""" import logging import typing from abc import abstractmethod from typing import Collection, Optional, Sequence, Set, Tuple, Type, Union import numpy import pandas import torch from class_resolver.api import ClassResolver, HintOrType from .....
#!/usr/bin/python3 """ Shows an input box. """ import math import os import sys import cairo import yutani import text_region import toaru_fonts import fswait from button import Button import yutani_mainloop def rounded_rectangle(ctx,x,y,w,h,r): degrees = math.pi / 180 ctx.new_sub_path() ctx.arc(x + w...
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, String, Integer, Text, Float, DateTime, ForeignKey, create_engine, Boolean from werkzeug.security import generate_password_hash, check_password_hash from app.db import create_session, redisn from app import basic import atexit ...
"""Core data-science utilities.""" import csv import math import os import warnings from io import BytesIO from pathlib import Path from typing import Any, Dict, Iterable, List, Optional, Tuple, Union import matplotlib import numpy as np import pandas as pd from matplotlib import pyplot as plt from PIL import Image, I...
from datetime import timedelta import logging from multiprocessing.pool import ThreadPool from pathlib import Path import re import json from typing import ( Callable, Deque, Dict, Generator, Iterable, List, Optional, Tuple, Union, ) import zipfile import cftime import netCDF4 impor...
""" The :mod:`mlshells.model_selection.search` includes utilities to optimize hyper-parameters. :class:`mlshell.model_selection.Optimizer` class proposes unified interface to arbitrary optimizer. Intended to be used in :class:`mlshell.Workflow` . For new optimizer formats no need to edit `Workflow` class, just adapt i...
# Copyright (c) 2021 Graphcore Ltd. All rights reserved. from typing import List, Tuple import math import numpy as np import torch from PIL import Image from utils.tools import ioa, normalize_labels, standardize_labels, xywh_to_xyxy, xyxy_to_xywh """ Torch transformations for the YOLOv4 dataset """ class PadNump...
from __future__ import print_function import argparse import os import shutil import time import numpy as np import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim import torch.utils.data import torchvision.transforms as transforms import torchvision.datas...
################################################################################################################## # JOB MANAGER # - query lc server for build and release jobs # - manage the job queue # - execute the jobs ##################################################################################################...
import tensorflow as tf import random from tqdm import tqdm import spacy import ujson as json from collections import Counter import numpy as np from codecs import open ''' This file is taken and modified from R-Net by HKUST-KnowComp https://github.com/HKUST-KnowComp/R-Net ''' # Loads nlp for english language. nlp = ...
""" Utility function having to do with GP. """ from __future__ import division from argparse import Namespace import numpy as np from scipy.stats import norm as normal_distro from copy import copy, deepcopy import itertools from dragonfly.exd.exd_utils import maximise_with_method from dragonfly.exd.domains import Eu...
""" Code to draw boxes and frames with Unicode box-drawing characters. See also https://github.com/Robpol86/terminaltables. """ #------------------------------------------------------------------------------- import itertools from fixfmt import string_length #-----------------------------------------------------...
# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2020 Ericsson AB from collections import deque from enum import Enum import errno import json import random import select import time import os import paf.xcm as xcm import paf.proto as proto MATCH_TYPE_APPEARED = proto.MATCH_TYPE_APPEARED MATCH_TYPE_MODIFIED = ...
"""Creates a smart alarm system that can gather news, weather and covid-19 levels as well as allowing for ALARMS to be created This project required PIP install uk-covid19 to gather information on Covid levels within the UK The priority for ALARMS / NOTIFICATIONS is (1 most important, 3 least important): 1. Da...
#!/usr/bin/python3 import re import os import os.path import time import datetime import threading import requests import sys from bs4 import BeautifulSoup def download_member_blog(member_name, page, day): """下载博客的函数,分为下载图片和下载正文两部分""" create_dir(member_name.get('zh')) page_link = 'http://blog.nogizaka46.c...
from __future__ import division, print_function import numpy as np from astropy import wcs from astropy.table import Table import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib import rcParams from matplotlib.ticker import NullFormatter, MaxNLocator, FormatStrFormatter from matplotli...
import hashlib import hmac import json import logging # lgtm [py/import-and-import-from] # https://github.com/github/codeql/issues/6088 import time from collections import OrderedDict from json.decoder import JSONDecodeError from typing import TYPE_CHECKING, Any, Dict, List, Literal, Optional, Tuple import gevent im...
""" Evaluates the estimated results of the Segmentation dataset against the ground truth (human annotated data). """ from joblib import Parallel, delayed import logging import mir_eval import numpy as np import os import pandas as pd import six import sys # Local stuff import msaf import msaf.input_output as io impor...
import csv import glob import hashlib import multiprocessing import operator import os import shelve import signal import sys from functools import reduce from time import time import six from six.moves import queue from datarobot_batch_scoring.consts import SENTINEL, \ WriterQueueMsg, ProgressQueueMsg, REPORT_IN...
# This file contains general helper functions for any CPLEX MIP Object import numpy as np from functools import reduce from cplex import Cplex, SparsePair from cplex.exceptions import CplexError # Convenience Functions when working with MIP def copy_cplex(cpx): cpx_copy = Cplex(cpx) cpx_parameters =...
#xml as input, returns an xml with gct harmonic analysis and comments (for any double gcts for the same chord) from music21 import * # import itertools from itertools import combinations import numpy as np class GCT: #id as a static variable maybe? def __init__(self, root, chType, chExtentions, chordFo...
""" This module handles sending auto email. It also converts dockets into an email friendly text file. """ # load email modules import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase from email import encoders from datetime import datetim...
# -*- coding: utf-8 -*- # This Class & Blender Addon implimentation is written by <NAME> of VLT Media LLC # Contact: Github VLTMedia # Copyright©2021 <NAME> # Original non class code license copright below. Original Code was derived from ROMP's (https://github.com/Arthur151/ROMP/blob/master/LICENSE) usage and thus ...
#!/usr/bin/env python """ Script for obtaining AUC per annotated TE Between sample1 and sample2 """ import logging import argparse import os import numpy as np import pandas as pd import pickle __author__ = "<NAME>" __date__ = "2020-11-19" __license__ = "Apache" __version__ = "0.0.1" __maintainer__ = "<NAME>" __emai...
""" Instruction: In this section, you are asked to train a NN with different hyperparameters. To start with training, you need to fill in the incomplete code. There are 3 places that you need to complete: a) Backward pass equations for an affine layer (linear transformation + bias). b) Backward pass equations f...
# -*- coding: utf-8 -*- # @__ramraj__ # Nuclei Detection without Dask - GPU version from __future__ import absolute_import, division, print_function from luminoth.utils.config import get_config from luminoth.utils.predicting import PredictorNetwork from luminoth.models import get_model from luminoth.datasets impo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import click import collections import os import pathlib import subprocess import webbrowser import re import sys import requests import toml from gidgethub import sansio from . import __version__ CREATE_PR_URL_TEMPLATE = ("https://api.github.com/repos/" ...
import copy import glob import logging import os from itertools import product, starmap import scipy import json import h5py import numpy as np from scipy.sparse.csgraph import csgraph_from_dense, connected_components import neuroglancer logger = logging.getLogger(__name__) try: import navis except ImportError: ...
from pathlib import Path import sys from PyQt5 import QtWidgets from PyQt5.QtCore import QSize, Qt, QRegExp, QRect, QPoint from PyQt5.QtGui import QColor, QPalette, QPixmap, QFont, QIntValidator as IV, QDoubleValidator as DV, \ QRegExpValidator as RV, QIcon, QTextItem, QPainter, QImage from PyQt5.QtPrintSupport im...
# -*- coding: utf-8 -*- """Radiotap""" from __future__ import print_function from __future__ import absolute_import from . import dpkt from . import ieee80211 from .compat import compat_ord # Ref: http://www.radiotap.org # Fields Ref: http://www.radiotap.org/defined-fields/all # Present flags _TSFT_SHIFT = 0 _FLAGS_...
"""Fuzz a neural network for local robustness.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import onnx import os import random import tensorflow as tf from onnx import numpy_helper from tensorfuzz.fuzz_utils import build_fetch_fun...
# -*- coding: utf-8 -*- import json import webbrowser from datetime import datetime, timedelta from dateutil import tz from dateutil.relativedelta import relativedelta from Google import create_service from googleapiclient.errors import HttpError from isodate import parse_duration from os import listdir, remove from ...
""" General calculation functions for video analysis. """ import collections import bisect import math import re import typing import utm class XY(collections.namedtuple('XY', 'x, y')): """For x/y position in any units.""" __slots__ = () def __eq__(self, other): if self.__class__ == other.__clas...
import io import logging import os import tarfile from _signal import SIGTERM from datetime import datetime from os.path import expanduser from typing import Any, List, Dict, Tuple, Optional, Union from urllib.parse import ParseResult, urlparse from dataclasses import field, dataclass from docker import DockerClient f...
import json import os import time import uuid from distutils.util import strtobool from typing import ClassVar from azure.kusto.data import KustoClient, KustoConnectionStringBuilder, ClientRequestProperties from azure.kusto.data.data_format import DataFormat from azure.kusto.data.exceptions import KustoClient...
import decimal from dt_db_base import get_test_doc, get_args_in_src, dbfile import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk def create_list_store(list_obj, sort_list=False, text_scale=1): if not len(list_obj.get_columns()): store_list = Gtk.ListStore(str, object) list_o...
data_dir = '/mnt/lareaulab/cfbuenabadn/SingleCell/data/' ###################### # load_data_short.py # ###################### print('loading data') import numpy as np import pandas as pd import os import matplotlib.cm as cm from matplotlib import pyplot as plt from scipy import stats as st import seaborn as sns imp...
from tkinter import * from tkinter import ttk from tkinter import messagebox from tkinter import filedialog from json_manager import * from pygame import mixer from pytube import YouTube from moviepy.video.io.VideoFileClip import VideoFileClip import threading as thr root = Tk() root.title('MuPlay [vs1]') ...
import dicom, lmdb, cv2, re, sys, math, copy import os, fnmatch, shutil, subprocess from IPython.utils import io import numpy as np np.random.seed(1234) import matplotlib.pyplot as plt import warnings import operator import pickle import json with open('SETTINGS.json', 'r') as f: settings = json.load...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ghostscript._gsprint - A low-lewel interface to the Ghostscript C-API using ctypes """ # # Copyright 2010-2018 by <NAME> <<EMAIL>> # # Display_callback Structure by <NAME> <<EMAIL>> in 2013 # # This program is free software: you can redistribute it and/or modify # it un...
import math import functools import torch import torch.nn.functional as F import torch.distributions as D from .metrics import calculate_mssim def nll_activation(logits, nll_type, **kwargs): """ Helper to activate logits based on the NLL NOTE: ignores variance here! :param logits: the unactivated lo...
import pandas as pd import inspect import os import click import json import glob import coconnect import coconnect.tools as tools @click.group(help="Commands for mapping data to the OMOP CommonDataModel (CDM).") def map(): pass @click.command(help="Generate a python class from the OMOP mapping json") @click.o...
"""Construct App.""" import os from os import path from typing import Any, List, Optional, Union from config import StackSettings from aws_cdk.core import Stage, Stack from aws_cdk import ( core, aws_ec2 as ec2, aws_ecs as ecs, aws_rds as rds, aws_ecs_patterns as ecs_patterns, aws_ecr_assets ...
"""Core functionality of daemonocle""" import errno import os import resource import signal import socket import subprocess import sys import time import psutil from .exceptions import DaemonError def expose_action(func): """This decorator makes a method into an action.""" func.__daemonocle_exposed__ = Tru...