text
stringlengths
3.07k
22.1k
import logging import os import re from collections import Counter import numpy as np from data.data_iterator import ids2seq def load_file(path): """Load file formated with one sentence per line and tokens separated by spaces.""" with open(path, "r", encoding="utf8") as file: outputs = [line.strip()...
''' Linear Decoder for RGB images Author: <NAME> Courtesy: UFLDL stanford, <NAME> mail: <EMAIL> ''' from settings import * import h5py class SparseAutoencoder(object): def __init__(self, input_size, hidden_size, lambdaa, rho, beta): """ initialize the parameters of the Autoencoder""" self.input_size = input_...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from numpy.testing import assert_allclose import astropy.units as u from astropy.units import Unit from astropy.coordinates import SkyCoord from ...irf import PSF3D, EffectiveAreaTable2D from ...maps import MapAxis, WcsGeom from ...cube ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from collections.abc import Iterable from datetime import datetime from time import sleep import regex as re import requests from bs4 import BeautifulSoup, Tag from peewee import * from .utils import parse_argv, replace_tokens from .core import cfg, DataFile, ...
# modified from Pix2Pose https://github.com/kirumang/Pix2Pose import numpy as np import json import os,sys sys.path.append("..") sys.path.append("../bop_toolkit") from bop_toolkit_lib import inout def get_target_list(target_path): # get the test list for the bop test targets = inout.load_json(target_path) ...
"""A simple spell checker program""" import numpy as np import sys import re import string import bigram from collections import Counter def init_matrix(): """only take care of lower letters #: empty char """ chars = 'abcdefghijklmnopqrstuvwxyz' o = {} for char1 in chars: o['#'+char1] = 0 for ch...
import sys import time from aip import AipOcr from PyQt5.QtWidgets import QApplication, QMainWindow from PyQt5.QtWidgets import QWidget, QLabel, QPushButton, QLineEdit, QFileDialog from PyQt5.QtWidgets import QStackedLayout, QGridLayout from PyQt5.QtGui import QPixmap, QCursor, QPainter, QBrush from PyQt5.QtCore impo...
#!/usr/bin/env python3 """ Data-transformer-app. 1. Grub CSV files located in ./data/original_data folder with SaveEcoBot structure (device_id,phenomenon,value,logged_at,value_text). 2. Separate CSV files per device_id and sensor type (phenomenon) and write result to ./data/csv/*.csv files. 3. Transform data f...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #======================================================================= # # sha1.py # --------- # Simple, pure Python model of the SHA-1 function. Used as a # reference for the HW implementation. The code follows the structure # of the HW implementation as much as possibl...
# Copyright 2021 The TensorFlow Ranking 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 ag...
# -*- coding: UTF-8 -*- # 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 (t...
import torch import torch.nn as nn import math from argparse import ArgumentParser import sys import time import os import copy import numpy as np from parameters import * from replay_memory import * from env import Environment from agent import Agent from epsilon_greedy import EpsilonGreedy from q_values import QValue...
import numpy as np import logging import math import pylab as plt import scipy.signal as sp import scipy.optimize import sys import json def find_extremes(voltages): """Finds the max and min values in a list Finds the voltage 'extremes' of the ECG dataset :param voltages: list of ECG voltage readings ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Diagnostic script to create simple multi-dataset barplots. Description ----------- Create barplot for different datasets of a single variable. This diagnostic needs preprocessed 1D cubes with single dimension ``dataset``. Author ------ <NAME> (DLR, Germany) Project --...
# -------------------------------------------------------- # Tensorflow Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # -------------------------------------------------------- from __future__ import absolute_import from __future__ import division from __future__ import pri...
import sys import os import pathlib from typing import * import torch import numpy as np import pandas as pd import anndata as an import warnings from functools import cached_property import pytorch_lightning as pl from pytorch_lightning.loggers import WandbLogger from pytorch_lightning.callbacks.early_stopping i...
""" MusicBot Searches and plays music from youtube. """ import time import asyncio import youtube_dl.YoutubeDL import discord from discord.ext import commands token = input("Enter bot token: ") ytdl = youtube_dl.YoutubeDL intents = discord.Intents.default() intents.members = True bot = comman...
from __future__ import division as __division__ import numpy as __np__ import matplotlib.pyplot as __plt__ from matplotlib import cm as __cm__ from . import zernike as __zernike__ from . import tools as __tools__ from .phaseunwrap import unwrap2D as __unwrap2D__ def twyman_green(coefficients, lambda_1 = 632, PR = 1)...
#!/usr/bin/env python3 from pyln.client import Plugin from collections import namedtuple from pyln.client import Millisatoshi from cachetools import cached, TTLCache from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry import requests import statistics plugin = Plugin() Sou...
import pandas as pd import time from preprocessing import dbpedia_utils as from_dbpedia from preprocessing import wikidata_utils as from_wikidata from caserec.utils.split_database import SplitDatabase ml_small_path = "./datasets/ml-latest-small/interactions.csv" original_ml_small_path = "./datasets/ml-latest-small/rat...
# # Define some helper functions which provide text such as build options # and library lists to be used in SConstruct. Also there are a few functions # that perform little tasks - put here to keep SConstruct more readable. # from glob import glob import os, re, string import sys import subprocess # Check that some...
import os import json from datetime import datetime, timedelta, timezone from django.core.management.base import BaseCommand from elasticsearch import Elasticsearch from multiprocessing import Process, Queue from time import perf_counter from time import sleep from usaspending_api import settings from usaspending_api...
# -*- coding: cp1252 -*- from builtins import range import os import numpy as np import librosa import scipy RANDOM = np.random.RandomState(1337) CACHE = {} def openAudioFile(path, sample_rate=48000, offset=0.0, duration=None): # Open file with librosa (uses ffmpeg or libav) sig, rate = ...
############################################################## # Copyright (c) 2018-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. ############################################################## fro...
import torch import torch.nn as nn OPS = { 'mbconv_k3_t1': lambda C_in, C_out, stride, affine, track_running_stats: MBConv(C_in, C_out, 3, stride, 1, t=1, affine=affine, track_running_stats=track_running_stats), 'mbconv_k3_t3': lambda C_in, C_out, stride, affine, track_running_stats: MBConv(C_in, C_out, 3, str...
import asyncio import dataclasses import logging from dataclasses import dataclass, field from enum import Enum from multiprocessing import Process, set_start_method from os import system from os.path import isfile, exists from typing import Optional, Dict, List import msgpack try: import psutil as psutil except ...
"""Module for general matrix class and related unit tests.""" import random import unittest import exceptions as exc __version__ = "0.1" class Matrix: """A class to represent a general matrix.""" def __init__(self, m, n, init=True): """Initalise matrix dimensions and contents.""" # initial...
"""Component to integrate with garbage_colection.""" import logging from datetime import timedelta import homeassistant.helpers.config_validation as cv import homeassistant.util.dt as dt_util import voluptuous as vol from dateutil.relativedelta import relativedelta from homeassistant import config_entries from homeas...
""" Creates The Tutorial - while testing its functions. """ import subprocess as sp import pytest import pytest_to_md as ptm import devapps import os import appdirs import time from ast import literal_eval as ev breakpoint = ptm.breakpoint bash_run = ptm.bash_run md = ptm.md ptm.setup(__file__) markdown = ptm.markdo...
# -*- coding: utf-8 -*- __author__ = "<NAME>" __date__ = "22 Apr 2021" # !!! SEE CODERULES.TXT !!! import os from silx.gui import qt from ..core import singletons as csi from ..core import commons as cco ftypes = 'HDF5', 'pickle', 'json (for 1D)', 'column text (for 1D)' fexts = 'h5', 'pickle', 'json', 'txt' class S...
import pandas as pd import xlsxwriter from selenium import webdriver from selenium.webdriver.chrome.options import Options chrome_options = Options() chrome_options.add_argument('--headless') chrome_path = r".\chromedriver.exe" driver = webdriver.Chrome(options=chrome_options) # get the list of products to search ...
import json import os from functools import wraps import pandas as pd from ..phones import Phone from ...url.functions import extract_domain filedir = os.path.abspath(os.path.dirname(__file__)) class Frame: def __init__( self, data: pd.DataFrame, name: str, index='id', ...
#!/usr/bin/env python3 """ Runs for a long time, looking for an http query from a recently initialized computer. When it gets the packet, it tries to clear away the PXE boot configuration for that computer, so that it will boot from its disk from then on. It expects to receive html GET requests on pillar['pxe_clearing...
from __future__ import division import sys import matplotlib.pyplot as plt import numpy as np import scipy.signal as signal import scipy.stats as stats import scipy.interpolate as intr import deriv class SplinedBinConverter(object): def __init__(self, low, high, bins): self.low, self.high, self.bins = low...
#! /usr/bin/env python #This script is an example for a simulator for the asprilo visualizer. #The simulator uses a given instance to produce the problems. The simulator uses the networking #interface from the visualizer and is written to work along with it. import argparse import select import socket import clingo V...
from typing import Dict, Set, Type import pytest from visions import StandardSet, VisionsBaseType from visions.backends.python.sequences import get_sequences from visions.test.utils import ( cast, contains, convert, get_cast_cases, get_contains_cases, get_convert_cases, get_inference_cases...
""" Created on Fri Sep 15 17:18:38 2017 @author: <NAME> """ from __future__ import division, print_function from collections import defaultdict import os, pickle, sys import shutil from functools import partial #from itertools import izip import cv2 from keras.optimizers import Adam, SGD from keras.ca...
import numpy as np import torch as th import torch.utils.model_zoo as model_zoo import copyreg import types import multiprocessing # def _pickle_method(m): # if m.im_self is None: # return getattr, (m.im_class, m.im_func.func_name) # else: # return getattr, (m.im_self, m.im_func.func_name) # ...
''' Urban-PLUMBER processing code Associated with the manuscript: Harmonized, gap-filled dataset from 20 urban flux tower sites Copyright (c) 2021 <NAME> Licensed under the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 ''' __title__ =...
# MIT license # <EMAIL> '''rigid-body kinematics''' from __future__ import absolute_import import numpy as np import math import sys from contextlib import contextmanager from numpy.linalg import norm # a few helpers def vec(*coords): return np.array(coords, dtype=float) deg = math.pi / 180.0 ex = vec(1, 0, 0)...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function import tensorflow as tf import numpy as np from niftynet.layer.convolution import ConvolutionalLayer from niftynet.layer.deconvolution import DeconvolutionalLayer from niftynet.layer.gan_blocks import GANImageBlock, BaseGenerator, BaseDisc...
"""Preprocessing functions to resample, extract gfp peaks, ect.""" import numpy as np from mne import BaseEpochs from mne.io import BaseRaw, RawArray from mne.preprocessing.ica import _check_start_stop from scipy.signal import find_peaks from ..utils._checks import _check_type from ..utils._docs import fill_doc from ...
from typing import AbstractSet, Any, Dict, List, Mapping, Optional, Sequence, Tuple, Union, cast from dagster import check from dagster.core.definitions.config import ConfigMapping from dagster.core.definitions.decorators.op import op from dagster.core.definitions.dependency import ( DependencyDefinition, IDep...
import enum from sqlalchemy.ext.declarative import declarative_base, declared_attr from sqlalchemy.dialects import postgresql from sqlalchemy.dialects.postgresql import JSONB from sqlalchemy import ( Column, Integer, String, Boolean, DateTime, ForeignKey, Text, Enum, PrimaryKeyConstr...
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
__authors__ = ['<NAME>'] import logging import yaml import os import pygame # For counting instances of output classes from itertools import count from VisualisationPlugin import VisualisationPlugin from GamePlugin import GamePlugin # from DDRPi import FloorCanvas class PluginModel(object): logger = logging.ge...
# ============================================================== # G r i d . p y # ============================================================== # Author: <NAME> # Created: 23 August 2011 # Purpose: Reimplementation of the Q-learning perturbation # testbed for multiple metacog...
# -*- coding:utf-8 -*- import logging import sqlparse from django.forms import model_to_dict from sqlparse.tokens import Keyword import pandas as pd from sql.engines.goinception import GoInceptionEngine from sql.models import DataMaskingRules, DataMaskingColumns import re import traceback logger = logging.getLogger(...
import numpy as np import pandas as pd import copy def agent_add_liq(params, substep, state_history, prev_state, policy_input): """ This function updates agent local states when liquidity is added in one asset. If symmetric liquidity add is enabled additional calculations are made. """ asset_id = ...
""" Vendorized from https://github.com/renmengye/np-conv2d MIT License 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...
# -*- coding: utf-8 -*- from numpy import * import pyximport ; pyximport.install() from munkres_step4 import step1_cython, step2_cython, step3_cython from munkres_step4 import step4_cython, step5_cython, step6_cython from munkres_step4 import compute_cost class Munkres2: starred = array([]) primed = array(...
# 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 (t...
import torch import torchvision import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torchvision.transforms as tt from torchvision.datasets.utils import download_url from torch.utils.data.dataloader import DataLoader from torchvision.datas...
# # Copyright (C) 2020 Intel Corporation # # SPDX-License-Identifier: BSD-3-Clause # import logging import pkg_resources from typing import List, Dict, Optional, Tuple, Union, TYPE_CHECKING from copy import deepcopy import torch import numpy as np from art.estimators.object_detection.object_detector import ObjectDet...
"""Collection for the Biosource object.""" from snovault import ( calculated_property, collection, load_schema, ) from snovault.validators import ( validate_item_content_post, validate_item_content_put, validate_item_content_patch, validate_item_content_in_place, no_validate_item_content...
import hashlib import os import pickle from urllib.request import urlretrieve import random import numpy as np from PIL import Image from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelBinarizer from sklearn.utils import resample from zipfile import ZipFile print('All modules ...
from io import ( DEFAULT_BUFFER_SIZE, SEEK_CUR, SEEK_END, SEEK_SET, IOBase, UnsupportedOperation, ) from typing import BinaryIO, Generic, Optional, TypeVar, Union, cast from xz.utils import FloorDict # # Typing note # # The consensus seems to favour IO instead of IOBase for typing. # However w...
#region Information #endregion #region Module Imports import bpy import bmesh import random from mathutils import Vector, Matrix from math import sqrt from bpy.props import * from bpy.types import (Panel,Menu,Operator,PropertyGroup) from .. modules.spatial import measure #endregion #region Operators class BYGEN_OT_Scat...
import json import logging import os import requests import dotenv import pandas as pd import xmltodict from census import Census from us import states dotenv.load_dotenv() CENSUS_API_KEY = os.environ.get("CENSUS_API_KEY") CENSUS_POPULATION_CODE = "B01003_001E" def flatten(current: dict, key: str = None, result: ...
import argparse import datetime import os import sys from materials_commons.api import File as MC_File from materials_commons.api import get_all_projects from materials_commons.etl.common.meta_data_verify import MetadataVerification from materials_commons.etl.common.metadata import Metadata from materials_commons.etl....
# -*- coding: utf-8 -*- """ lantz.feat ~~~~~~~~~~ Implements Feat and DictFeat property-like classes with data handling, logging, timing, cache and notification. :copyright: 2012 by Lantz Authors, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import time impor...
import argparse import dworp import dworp.plot import logging import numpy as np import sys try: import pygame except ImportError: # vis will be turned off pass class Household(dworp.Agent): """Household agent for Schelling Segregation model""" def __init__(self, agent_id, color, x, y, similarity)...
import numpy as np from scipy.io import loadmat from scipy import signal from scipy.optimize import curve_fit import pandas as pd import os from GISMCA import plot from GISMCA import __version__ def loadData(filename): ''' Function to import data in .mat format exported by Biopac's Acknowledge software. ...
import numpy as np from enum import Enum from random import randint MAX_GENERATION = 1000 POPULATION_SIZE = 20 CHROMOSOME_LENGTH = 20 NUMBER_OF_SELECTED_CHROMOSOME = 3 INCREMENT_RANGE_FOR_CHROMOSOME_LENGTH = 50 INCREMENT_SIZE_FOR_CHROMOSOME_LENGTH = 5 goal = np.array([[1, 2, 3], [8, 9, 4], [7, 6, 5]]) initial = np.a...
# -*- coding: utf-8 -*- """ Creator: <NAME>. Created on: 26 Sep. 2020 """ # Import Libraries import numpy as np from sklearn import svm from scipy.io import loadmat import matplotlib.pyplot as plt # Ignore overflow and divide by zero of np.log() and np.exp() # np.seterr(divide = 'ignore') # np.seterr(over = 'ignore')...
import csv import xmltodict as xml import urllib.request import json from termcolor import colored in_file = './in.csv' store_ids = [215, 211] store_names = [] country_code = 'us' language_code = 'en' availability_base_url = 'https://www.ikea.com/' + country_code + '/' + language_code +'/iows/catalog/availability/' ...
"""Module which handles the data on isotope systems.""" import csv import numpy as np import pkg_resources # Fundamental constants elementarycharge = 1.60217646e-19 # coulombs k = 1.3806504e-23 # m^2 kg s^-2 K^-1, Boltzmann constant def loadrawdata(filename=None): """Read in isotope system datafile and return ...
""" Cleft ID mapping IO for processing tasks """ import os from sqlalchemy import select import pandas as pd from ... import io from .. import colnames as cn from . import filenames as fn ID_MAP_COLUMNS = [cn.src_id, cn.dst_id] UNIQUE_ID_MAP_COLUMNS = ["id", cn.seg_id] CHUNKED_ID_MAP_COLUMNS = [cn.seg_id, cn.dst_...
from typing import Any, Callable, Dict, Iterator, List, Mapping, Optional, Sequence import numpy as np import torch from torch.utils.data import DataLoader, Dataset, Sampler from torch.utils.data._utils.collate import default_collate from math import ceil from health_ml.utils.common_utils import _create_generator c...
import tensorflow as tf import numpy as np import tflearn import argparse import pprint as pp import sys from replay_buffer import ReplayBuffer from AandC import * from noise import * from gym_torcs import TorcsEnv mu = np.array([0.0, 0.5, 0.01]) # theta = np.array([0.15, 0.15, 0.15]) theta = np.array([...
import random from typing import Any from abc import ABC, abstractmethod from utils import clamp, without_keys import copy class BaseAttr(ABC): _config_items = {} def __init__(self, name: str, **default_dict): self.name = name self._config_items = copy.deepcopy(self.__class__._config_items) ...
import os.path import pandas import numpy import traceback import logging from decisionengine.framework.modules import Transform from decisionengine.framework.modules.Transform import Parameter from decisionengine_modules.glideinwms import glide_frontend_element from decisionengine_modules.glideinwms.resource_dist_pl...
from itertools import product import nose.tools as nt import numpy as np from scipy.stats import t as tdist from scipy.stats import laplace, logistic, norm as ndist from ..convenience import lasso, step, threshold from ..query import optimization_sampler from ...tests.instance import (gaussian_instance, ...
import os import cv2 from scipy.interpolate import UnivariateSpline from matplotlib import gridspec from matplotlib import pyplot as plt import matplotlib.pylab as plt import numpy as np import random import time def gen_rand_lut(): a = 64; b = 128; c = 200; d = random.randint(0,50); ...
import os import sys import json import datetime import numpy as np import skimage.draw import skimage.color import skimage.io import skimage.transform as skit # Root directory of the project ROOT_DIR = os.path.abspath("../../") # Import Mask RCNN sys.path.append(ROOT_DIR) # To find local version of the library from...
""" """ from django.db import models from django.contrib.sites.models import Site from django.contrib.auth.models import User # next four lines are for sending the payment email from django.template import Context, loader from django.utils.translation import ugettext as _ from django.core.mail import send_mail from ...
# Copyright (c) 2020 Software AG, # Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, # and/or its subsidiaries and/or its affiliates and/or their licensors. # Use, reproduction, transfer, publication or disclosure is prohibited except # as specifically provided for in your License Agreement with Softwar...
#/************************************************************************************************************************ # Copyright (c) 2016, Imagination Technologies Limited and/or its affiliated group companies. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modificat...
from typing import Tuple import numpy as np from scipy import spatial def hill_sphere_radius( planet_radius: float, planet_mass: float, stellar_mass: float, eccentricity: float = None, ) -> float: """Calculate the Hill sphere radius. Parameters ---------- planet_radius The or...
#!/usr/bin/env python3 """ An example extension/customization of the Dac-Man HDF5 plugin for a specialized use case. Datasets to compare are tomography frames from an ALS beamline, saved in HDF5 file as .edf datasets. Reference files are: - A: 20140905_191647_YL1031_.h5 - B: 20160903_221332_FACS_140deg2_.h5 Extr...
import os import time import logging import urllib3 from behave import given, when, then from datetime import date from pyshould import should from kubernetes import config, client from smoke.features.steps.openshift import Openshift from smoke.features.steps.project import Project ''' If we need to install an operato...
#!/usr/bin/env python3 """ Infrablue image processing library for monatoring plant health. Based in infragram from Public Lab. """ ___license___ = """This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, ei...
from __future__ import print_function import os, pdb, sys, time import numpy as np import pandexo.engine.justdoit as jdi import pandexo.engine.justplotit as jpi import matplotlib.pyplot as plt def main( planetdict, sat_level=80, sat_unit='%', noise_floor_ppm=20, \ useFirstOrbit=False, inst_modes=['WFC3 G14...
import datetime from django.contrib import admin from django.contrib.sites.models import Site from mezzanine.pages.models import Page from mezzanine.utils.sites import current_site_id from .models import get_content_model, SmartlingTranslation from mezzanine_smartling import manager as page_translations_manager, get_re...
# -*- coding: utf-8 -*- """ Common function used by different parts of the application """ from __future__ import print_function, unicode_literals import argparse import logging import os import socket import subprocess import sys import time import traceback from datetime import datetime from string import Template ...
""" Glossary: The //transfer buffer// is the buffer that contains the data transported from the guest. This may be either a pointer into shared memory or a local buffer filled from a socket. In some cases, the transfer buffer is also used as the local buffer. The //local buffer// is the callee local buffer containing...
import numpy as np from numpy.testing import assert_almost_equal, assert_equal from scipy.io import loadmat from sklearn.cross_decomposition import CCA from meegkit.cca import cca_crossvalidate, nt_cca, mcca from meegkit.utils import multishift, tscov def test_cca(): """Test CCA.""" # Compare results with Ma...
"""Grain fitting functions""" import numpy as np from scipy import optimize from hexrd import matrixutil as mutil from hexrd.transforms import xfcapi from hexrd.xrdutil import extract_detector_transformation return_value_flag = None epsf = np.finfo(float).eps # ~2.2e-16 sqrt_epsf = np.sqrt(epsf) # ~1.5e-8 bVe...
"""Thermometer/hygrometer BLE advertisement parser, supports Moat and Govee devices.""" import logging from typing import Optional from bleson.core.hci.constants import ( GAP_FLAGS, GAP_NAME_COMPLETE, GAP_SERVICE_DATA, GAP_MFG_DATA, ) from bleson.core.hci.type_converters import ( rssi_from_byte, ...
import numpy as np from tqdm import trange import json import os import sys import tensorflow as tf from tensorflow.contrib import rnn utils_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) utils_dir = os.path.join(utils_dir, 'utils') sys.path.append(utils_dir) from model_utils i...
#!/usr/bin/env python3 import struct import sys import re import numpy as np import math import io matrix = np.eye(3, 3) matrix_inv = np.eye(3, 3) matrix_det = 1 def cross_matrix(x, y, z): return np.array([ [ 0, -z, y ], [ z, 0, -x ], [-y, x, 0 ] ]) def rot_matrix(axis, theta): ...
# Regression test of shearing box and orbital advection with 2d hydro shwave. # Modules import logging import cmath import math import mpmath as mp import scripts.utils.athena as athena import sys sys.path.insert(0, '../../vis/python') import athena_read # noqa athena_read.check_nan_flag = True logger = logging.getLo...
from tkinter import messagebox from threading import Thread import cv2.cv2 as cv2 import numpy as np import pyautogui import requests import tkinter import pygubu import atexit import rgbxy import json import time import os class LinkButtonNotPressed(Exception): pass def get_bridge_ip(number=0): return requ...
import glob import os import cv2 import numpy as np from scipy import ndimage from skimage.io import imread, imsave from skimage.measure import label, regionprops from skimage.transform import resize def get_percentile_intensity_in_mask_img(img, mask, percentile, max_intensity=220): values = img[np.nonzero(mask)]...
# -*- coding: utf-8 -*- import numpy as np from mrsimulator.spin_system.tensors import SymmetricTensor from .utils import get_Haeberlen_components from .utils import get_principal_components from .utils import x_y_from_zeta_eta __author__ = "<NAME>" __email__ = "<EMAIL>" def _czjzek_random_distribution_tensors(sigm...
""" Sphinx config.py =========================================== .. module:: conf.py :Synopsis: Sphinx config file. :Description: This is an early version of a Sphinx RTD theme boilerplate `config.py` file. Future versions will be better organized and will, eventually, be configurable from yaml. Rea...
""" Map CEMS CC generators to EIA CC units """ import logging import numpy as np import pandas as pd logger = logging.getLogger(__name__) def method_1(boilers, eia_plants): """ Method 1 to map boilers to eia plants """ # Create boiler-specific unit (Method 1) no_eia_plant = boilers.loc[~np.in1d(b...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
"""Implementation of the package""" # MIT License # Copyright (c) 2018 s-ball import os.path import glob import datetime import piexif import sys import collections import io import logging import os.path import shutil _ = lambda x: x class PyimgrenException(Exception): """Base for pyimgren exceptions""" clas...
import sys import opacus from pymarlin.core.module_interface import ModuleInterface from pymarlin.core.trainer import Trainer, TrainerArguments, WriterInitArguments, DistributedTrainingArguments, DefaultCheckpointerArguments, DifferentialPrivacyArguments from pymarlin.utils.stats.basic_stats import StatInitArguments f...