text
stringlengths
3.07k
22.1k
# Copyright (c) 2017-2019 Datasud. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
import torch import torch.nn as nn import torch.nn.functional as func from torchsupport.modules.separable import DepthWiseSeparableConv2d class WNet(nn.Module): def __init__(self, down_block=None, up_block=None, n_classes=2, in_channels=1, depth=5, first_filters=6, up_mode='upconv'): """ Templ...
#!/bin/python """ @author: <NAME>, <NAME>, <NAME>, <NAME> """ #------------------------------------------------------------------------------- # Library Imports from pymodbus.version import version from pymodbus.server.asynchronous import StartTcpServer from pymodbus.device import ModbusDeviceIdentification from pymo...
#!/usr/bin/python3 # -*- coding: utf8 -*- # Copyright (c) 2021 Baidu, Inc. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
import os import re import sys import time import config import logging import humanfriendly from enum import Enum from utils import download_file, log, sanitize_file_name, prepare_url, \ get_file_id_and_name, get_file_extension, expiration_to_date, \ log_file, get_logged_files from selenium import webdriver ...
import json import os from interfaces import InventoryManagementSystemInterface from shelf import Shelf from typing import List, Union, Dict from datetime import datetime from pysondb import db from pysondb.db import JsonDatabase from json.decoder import JSONDecodeError import matplotlib.pyplot as plt import socket imp...
from DbConnector_MySQL import DbConnector_MySQL from decouple import config from tabulate import tabulate import datetime import numpy as np import pandas as pd import json import os from os import listdir from os.path import isfile, join from tqdm import tqdm # for progressbar on importing Trackpoint data class Pro...
# Copyright 2019 by Raytheon BBN Technologies Corp. # All Rights Reserved. import os, sys, logging, copy import pickle logger = logging.getLogger(__name__) current_script_path = __file__ project_root = os.path.realpath(os.path.join(current_script_path, os.path.pardir, os.path.pardir, os.path.pardir)) sys.path.append(p...
################################################################################# # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # # # Licensed under the Apache License, Version 2.0 (the "License"). ...
# Copyright 2019 DeepMind Technologies Ltd. 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 appl...
import logging import datetime import pytz import re from django.conf import settings from django.utils import timezone from collections import defaultdict from slack_sdk import WebClient from creator.studies.models import Study logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) def post_pin(client, ...
""" Non-PyBullet implementation of Pendulum """ import jax import jax.numpy as np import jax.random as random import os import tigercontrol from tigercontrol.utils import generate_key, get_tigercontrol_dir from tigercontrol.environments import Environment # necessary for rendering from gym.envs.classic_control import...
from numpy import * def motor(inputs, outputs=1): Lwa = 14.12 # armature wire length (m) Lwf = 309.45 # field wire length (m) ds = 0.612 # slot depth (cm) ## Coupling Variables b, shared with control problem n = 122 # rota...
import numpy import pandas import sklearn.feature_extraction.text import sklearn.feature_selection import sklearn.model_selection import sklearn.naive_bayes import sklearn.preprocessing def df_from_csv(filepath: str) -> pandas.DataFrame: # import csv data, do some simple cleanup steps dataframe = pandas.read_...
from functools import partial from collections import OrderedDict, namedtuple from os import name from typing import Optional, Union, Dict, NamedTuple import torch from torch import nn try: from typing_extensions import Final except: from torch.jit import Final from comvex.utils import EfficientNetBase, MBCon...
# coding=utf-8 """ Functions for converting between properties. """ from __future__ import absolute_import, division, print_function import logging import datetime import rasterio.warp from dateutil import tz from datacube import compat from datacube.model import Range from datacube.index import index_connect from d...
import sys import time from Quartz import CoreGraphics def mouse_event(event_type, posx, posy): event = CoreGraphics.CGEventCreateMouseEvent( None, event_type, (posx, posy), CoreGraphics.kCGMouseButtonLeft, ) CoreGraphics.CGEventPost(CoreGraphics.kCGHIDEventTap, event) de...
from pyhpp.node import Node from pyhpp.model import Model from pyhpp.tools import Tools scenario = { "dimension": {"x": 10, "y": 10, "z": 10}, "empty_data": {}, "no_data": {"size": 0, "x": [], "y": [], "z": []}, "data": { "size": 16, "x": [4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7]...
from decimal import * import random def keySearch(L, k): for elem in L: if elem[0] == k: return elem[1] return None EtoF = {'bread': 'du pain', 'wine': 'du vin',\ 'eats': 'mange', 'drinks': 'bois',\ 'likes': 'aime', 1: 'un',\ '6.00':'6.00'} def translateWord(word, dictionary): ...
import bpy from .BlenderObjects import * from .BlenderShapes import * from .BlenderLamps import BlenderPoint from ..RandomLib import random_render as rnd class BlenderRoom(object): def __init__(self, radius): self.walls = [] self.walls.append( BlenderPlane(location=(-radius, 0, 0), sc...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Nov 28 09:24:51 2020 @author: felipe """ import sys import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.path import Path import matplotlib.patches as patches import glob from scipy.interpolate import griddata imp...
from __future__ import division import copy import itertools import math import numpy as np import torch from mmcv.runner import get_dist_info from mmdet.datasets import ConcatDataset from torch.utils.data import Sampler, WeightedRandomSampler from ssod.utils import get_root_logger from ..builder import SAMPLERS ...
import re from flask import Blueprint, render_template, request, url_for, redirect, jsonify from models import * from collections import defaultdict import json import random import requests from haversine import haversine bp = Blueprint('main', __name__, url_prefix='/api') # 지역별로 위생등급을 받은 전체가게 수와 프랜차이점의 수를 반환하는 API ...
import copy import random import numpy as np import requests import theano.tensor as T from project3.module6.game2048.gui import * from project3.module6.deeplearning.ann import ANN class AiWindow(GameWindow): # Initializes gui and board class def __init__(self, player, control): super(AiWindow, self...
# import os # import matplotlib as mpl import matplotlib.pyplot as plt # import matplotlib.colorbar as colorbar # import sunpy.cm.cm as cm ## to bootstrap sdoaia color map # import matplotlib.cm as cm # import matplotlib.colors as colors import astropy.units as u # from astropy.io import fits # import matplotlib.dates...
import os # import numpy as np # import matplotlib.pyplot as plt from journal_figure import * from collections import OrderedDict from ssmtoybox.mtran import UnscentedTransform, SphericalRadialTransform, MonteCarloTransform from ssmtoybox.bq.bqmtran import BayesSardTransform, GaussianProcessTransform from ssmtoybox.ut...
""" --- Day 8: Seven Segment Search --- You barely reach the safety of the cave when the whale smashes into the cave mouth, collapsing it. Sensors indicate another exit to this cave at a much greater depth, so you have no choice but to press on. As your submarine slowly makes its way through the cave system, you noti...
import os import sys import webbrowser from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtPrintSupport import * from uis.help import Ui_Help from uis.orientation import Ui_Orientation from uis.about_authors import Ui_AboutAuthors from uis.compiler_COOL import Ui_COOLCompil...
import pyb import struct import crc16 import os class SDNotFoundError(Exception): pass def get_temperature(port, i2c): raw = [] port.init(9600, timeout=100) for i in range(10): raw.append(pyb.ADC('PA4').read()) pyb.udelay(1) volt = (sum(raw) / len(raw)) / 4096 * 3.18 temp_cp...
#!/usr/bin/python3 ################################################################################# # MG-Lite # # Copyright (C) 2020, <NAME> # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: #...
from part import make_dataset import pandas as pd import matplotlib.pyplot as plt import os import numpy as np import copy def inspect_birthday(path) : # 추가변수 후보 1 : 나이에 따른 더미변수 추가 >> 더 생각해볼 것 : 365를 기준으로 몫만 취하는 것이 맞는가 ?? > 몫만 취하게 되면 364일은 아무것도 아니게 되니까 # 그리고 20, 30, 40 대 등으로 나누는 것이 맞는가 ?? >> 기준이 어디인지 모르니까 다르게 나눠보...
""" Algorithms and data structures for constructing, determinizing, and minimizing finite state machines. These make no attempt at clever internal storage: they follow the maxim "When in doubt, use brute force." """ import operator from typing import NamedTuple from ..support import foundation, pretty, interfaces from...
""" Copyright (C) 2021 Adobe. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it w...
# GUI Application automation and testing library # Copyright (C) 2006 <NAME> # Copyright (C) 2015 <NAME> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 # of the Lice...
import os import sys import argparse import glob from collections import defaultdict import numpy as np OFFSET = "offset" REAL_OFFSET = "real_offset" SIMILARITY = "similarity" DELTA = "delta" transformed_prefix = 'tombo/transformed/' minimap_prefix = 'minimap/' wavelet = 'cgau5' def parse_args(): parser = argp...
from abc import ABC, abstractmethod from typing import Deque from collections import namedtuple, deque from collections.abc import Iterable import random import numpy as np from src.utils.sumTree import SumTree class ReplayBuffer(ABC): def __init__(self,mem_size,obs_shape = None): self.mem_size = mem_si...
# -*- coding: utf-8 -*- """ Created on Thu Jun 18 10:30:22 2015 Last updated on Tue Jul 30 02:321 2015 @author: <NAME> @email: <EMAIL> """ import numpy as np import matplotlib.pyplot as plt import shlex ############################################################################### content = [] # list for all d...
import json import os import glob import http.client import mysql.connector def updateDocumentsHTTP(index, filename, body): # client conn = http.client.HTTPSConnection(os.environ.get("oss_url")) headers = { 'Authorization': 'Basic ' + os.environ.get("oss_auth_basictoken"), 'Content-Type': ...
# Solution to question 1, this assumes the neo4j network has already been populated with the relevant data import numpy as np np.warnings.filterwarnings('ignore') from collections import namedtuple #from neo4j.v1 import GraphDatabase, basic_auth import os import Q1Utils import argparse import sys import json # Connect...
"""Tensorflow implementation of metrics for Multi-label Classification. Metrics: Subset Accuracy, Hamming accuracy, example-based f1, and label-based micro/macro f1. Definitions from: https://papers.nips.cc/paper/7125-maximizing-subset-accuracy-with-recurrent-neural-networks-in-multi-label-classification.pdf...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function ''' think to /srv/makina-states/venv/bin/pip install ruamel.yaml ''' import ruamel.yaml as _y import re import os import logging import json from salt.utils impo...
import sys from collections import deque import matplotlib as mpl import numpy as np from PyQt5 import QtCore, QtWidgets import Runge_Kutta as Rk from ui import Ui # Constants rc0 = 0.6 m = 1 a = 4.3 t0 = 0 t = t0 dt = 0.025 tmaxn = 200 ti = 0 r0 = 1 Pr0 = 1 r = r0 Pr = Pr0 r_range = (-6, 6) Pr_range = (-6, 6) V_...
import matplotlib matplotlib.use('Agg') import numpy as np from matplotlib import pyplot as plt from matplotlib.ticker import FormatStrFormatter import random random.seed(0) np.random.seed(0) import os.path as osp def plot_clusters_vs_lambda(X_org,l,filename,dataset, lmbda, fairness_error): K = max(l) +1 ...
""" Simple backport of the Component logic from OMTK2. """ import pymel.core as pymel from omtk.libs import libRigging # taken from xlib def to_camel_case(snake_str): components = snake_str.split('_') return components[0] + "".join(x.title() for x in components[1:]) def camel_case_join(*tokens): result ...
# (C) Datadog, Inc. 2018 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import requests import simplejson as json from six.moves.urllib.parse import urljoin from .settings import (DEFAULT_API_REQUEST_TIMEOUT, DEFAULT_KEYSTONE_API_VERSION, DEFAULT_NEUTRON_API_VERSION, ...
# usr/bin/env python # -*- coding: utf-8 -*- import os import json from requests.compat import json as complexjson from PIL import Image from io import BytesIO from django.conf import settings from django.core.cache import cache from . import BaseRequestClient, res2json class WXAppRequestClient(BaseRequestClient): ...
#!/usr/bin/env python """Wrapper for EffectiveT3 v1.0.1 for use in Galaxy. This script takes exactly five command line arguments: * model name (e.g. TTSS_STD-1.0.1.jar) * threshold (selective or sensitive) * an input protein FASTA filename * output tabular filename It then calls the standalone Effective T3 v1.0.1...
''' Trabalho Interdisciplinar Sistemas Operacionais e Organização de Computadores Docentes: <NAME> e <NAME> Autores: <NAME> <NAME> <NAME> <NAME> ''' import platform import multiprocessing import psutil import pandas as pd import time import datetime from datetime import date from concurrent....
import datetime from django.contrib import messages from django.db.models import Sum from django.shortcuts import render from django.views.generic import ListView, DetailView from lojas.models import Loja, Departamento, Area from produtos.forms import PlanilhaForm from produtos.models import Produto, Lista, Tipo, Con...
import numpy as np from numpy.lib.utils import source import pandas as pd import torch import librosa import soundfile from utils import check_type, extract_audio, mono_load from config import InferenceConfig as IC from csrc.configurations import DatasetConfig as DC from csrc.configurations import ModelConfig as MC f...
"""FTP Utility module that sync a local folder and remote FTP server path. Copyright (c) to Pandiarajan Licensed under the MIT License Purpose: This utility can be used as a export module or a script to sync a local folder and remote FTP path It is assumed that the remote FTP path directly lands into t...
# Copyright 2021 ABSA Group Limited # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
"""Conformer. Reference: https://arxiv.org/pdf/2005.08100.pdf https://github.com/TensorSpeech/TensorFlowASR/blob/main/tensorflow_asr/models/encoders/conformer.py """ from functools import partial from typing import Any, Callable import numpy as np import flax from flax import linen as nn, optim from flax.training i...
# # Copyright (C) 2021 <NAME> <<EMAIL>>. # SPDX-License-Identifier: MIT # r"""Very experimental loader parse FIT data files based on fitdecode.cmd.fitjson. - Format to support: FIT data files - Requirements: fitdecode - Development Status :: 4 - Beta - Limitations: - Load function only and it doesn't support dump f...
from argparse import ArgumentParser from typing import Tuple, List, Optional from numpy.random import RandomState from rlai.actions import Action from rlai.agents import Agent, Human from rlai.agents.mdp import StochasticMdpAgent, MdpAgent from rlai.environments import Environment from rlai.environments.mdp import Md...
import getpass import os import random import socket from uuid import getnode as get_mac import time try: import colorama from colorama import Fore except: print("Colorama package not found, installing Colorama") os.system("pip install colorama") print('Termithon restart required') print('closin...
# pylint: disable=invalid-name # pylint: disable=too-many-instance-attributes # pylint: disable=too-many-arguments """ Class for managing integrating spheres. import iadpython.sphere s = iadpython.sphere.Sphere(250,20) print(s) """ import numpy as np class Sphere(): """Container class for an integ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Oct 5 13:39:02 2018 modified Wed Dec 12 2018 (Issue #5) Modified on 02/25/2019 for version 0.1.0 Modified 01/20/2021 to relocate power control to PVUtilities to allow for inverter control @author: <NAME> ---------------------------------------------...
""" Modified from SparseConvNet data preparation: https://github.com/facebookresearch/SparseConvNet/blob/master/examples/ScanNet/prepare_data.py """ import os import os.path as osp import json import argparse import multiprocessing as mp import torch import plyfile import numpy as np import gorilla G_LABEL_NAMES = [...
# Copyright (c) ASAPP Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math from dataclasses import dataclass, field from omegaconf import II import numpy as np import torch import torch.nn as nn import torch.nn.functional as F f...
from typing import Any, Callable, List, Tuple, Union import sys import os import sqlite3 import time import coinrpc from decimal import Decimal, ROUND_DOWN from config import WALLETDBPATH, MINCONF # decorator def sql_decorator(sql_func: Callable) -> Callable: def new_sql_func(*args: Any, **kwargs: Any) -> Any: ...
from pathlib import Path import urllib from dataclasses import dataclass import functools import inspect import re import logging import requests from toolz import ( pipe, curry, partial, concat, concatv, compose, ) from toolz.curried import ( map, filter, first, last, merge, do, ) from pyrsistent import pmap ...
import re import os import sys import argparse import math import heapq from gensim.models import Word2Vec # arguments config parser = argparse.ArgumentParser( description="This is a document indexing engine using bayesian network.\nFor more information see https://github.com/ethanmiles/Bayesian-Network-for-NLP") ...
import torch import torch.nn as nn import matplotlib.pyplot as plt import matplotlib.animation as animation class HamiltonianDynamics(nn.Module): """ Defines the dynamics given a hamiltonian. If wgrad=True, the dynamics can be backproped.""" def __init__(self,H,wgrad=False): super().__init__() ...
import os import numpy as np import matplotlib.pyplot as plt import math import sys import cv2 import torch from PIL import Image # import model sys.path.append(".") import pclpyd as pcl # import pyzed.sl as sl sys.path.append("..") import pclpyd as pcl def convertply2numpy( src): res = np.zero...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Mar 25 16:16:07 2021 @author: <NAME> (<EMAIL>) at USTC This script: 1) function read_GFs_json is preprocess of function build_GFs_pyfk. Modify history: 1) Mar 25 16:16:07 2021 || Fu Yin at USTC || The initial release. 2) ... ...
from blockchain import Blockchain,Block from wallet import Wallet from transaction import Transaction from flask import Flask, jsonify, request, render_template, flash, redirect, url_for, send_file, session from uuid import uuid4 import json import sys import forms import requests import pickle from functools...
#!/usr/bin/python3 """ Version : 0.0 (Beta-release) Author : <NAME> <<EMAIL>> Source : http://rpoernama.wordpress.com This is a Python script to generate intial configuration for INE CCIE R&S v5 Lab. It's distributed for free to help CCIE hunter during their study. No fee and specific permission is required to use th...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import numpy as np from ._segmentation import _ve_step, _interaction_energy TINY = 1e-300 NITERS = 20 BETA = 0.2 VERBOSE = True def print_(s): if VERBOSE: print(s) def gauss_dist(x, mu, s...
from mycv.utils.general import disable_multithreads disable_multithreads() import os from pathlib import Path import argparse from tqdm import tqdm from collections import defaultdict import cv2 import torch import torch.nn.functional as tnf from torch.optim.lr_scheduler import LambdaLR import wandb from mycv.utils.ge...
# -*- coding: utf-8 -*- # Make sure you rename config.py.example to config.py and fill it out before trying to run this! # Also, if you're running this on scp-wiki, please have authorization from the Technical Team Captain. import config # Used to be a nice API user. Max 240 req/min. from time import sleep # Used to co...
""" test_QuerySet """ from AzureODM.QuerySet import ( QuerySet, obj_to_query_value, Q, QCombination, AndOperator, OrOperator) from AzureODM.Entity import Entity from AzureODM.Fields import GenericField, FloatField, KeyField import pytest import re from datetime import datetime, timezone regex = re.compile(Query...
from dataclasses import dataclass from typing import List, Tuple from math import ceil from json import dumps import aiohttp def max_min_query(oid_field: str) -> str: """ Helper query postfix to get max and min Oid values. Given an Oid field name, can be added to the end of a base url """ return f...
"""Main module.""" import logging from io import TextIOWrapper import pandas as pd from Bio import SeqIO from Bio.SeqRecord import SeqRecord from Bio.Seq import MutableSeq from intervaltree import Interval, IntervalTree from vcf_consensus_builder.vcf_io import read_vcf from typing import List import re logger = lo...
# Name: # Course: CPE 202 # Instructor: <NAME> # Assignment: Problem Set VI # Term: Spring 2021 from typing import List, Optional class Entry: def __init__(self, key: Optional[int], val: Optional[str], ref: Optional["Entry"]) -> None: self.key: Optional[int] =...
import itertools import numpy as np from nengo.exceptions import ValidationError from nengo.transforms import ChannelShape, Convolution from nengo_loihi.compat import is_transform_type class ImageSlice: """Represents a slice of a larger image across rows/columns/channels. Parameters ---------- full...
# -*- coding: utf-8 -*- from collections import OrderedDict import torch import torch.nn as nn # https://arxiv.org/pdf/1606.06650.pdf # https://github.com/wolny/pytorch-3dunet/blob/master/pytorch3dunet/unet3d/model.py class UNet3D(nn.Module): # acdc 112x112x112x3 def __init__(self, in_channels=32, out_chan...
################################################################################## # AST evaluator ################################################################################## # FixMe: evaluations should always result in an instance of Node, never # a python int, str, etc. This way, we won't have to worry about ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import json import os import os.path as osp from pathlib import Path import sys from math import pi import numpy as np import pybullet import pybullet_data import skrobot import six import xml.etree.ElementTree as ET from eos import make_fancy_output_dir ...
#!/usr/bin/env python #coding=utf-8 import numpy as np import extract, cluster import warnings def deprecation(message): warnings.warn(message, DeprecationWarning, stacklevel=2) def snr_spike(spike_waves, scale=5.): """Estimate signal-to-noise ratio (SNR) as a ratio of peak-to-peak amplitude of an averag...
from datetime import datetime import protocol from threading import Event from collections import namedtuple from lifx.color import modify_color import color import time DEFAULT_DURATION = 200 DEFAULT_TIMEOUT = 2.0 DEFAULT_RETRANSMITS = 10 StatsTuple = namedtuple('StatsTuple', ['dropped_packets', 'sent_packets']) cl...
""" Functions for decoding EBML elements and their values. Note: this module does not decode `Document`, `BinaryElement`, or `MasterElement` objects; these are handled entirely in `core.py`. `Document` and `MasterElement` objects are special cases, and `BinaryElement` objects do not require special decoding. """ __au...
import abc import glfw from gym import error from gym.utils import seeding import numpy as np from os import path import gym from . import module try: import mujoco_py except ImportError as e: raise error.DependencyNotInstalled("{}. (HINT: you need to install mujoco_py, and also perform the setup instructions...
import numpy as np import pandas as pd from sklearn.model_selection import cross_val_score, train_test_split, GridSearchCV from sklearn.preprocessing import MinMaxScaler from datetime import datetime import matplotlib.pyplot as plt import seaborn as sns from scipy import stats import wrangle as wr def get_model_df...
import numpy as np from scipy import linalg from ..processing import knee import warnings warnings.filterwarnings("ignore") def wgr_regress(y, X): n, ncolX = X.shape Q,R,perm = linalg.qr(X, mode='economic', pivoting=True) if R.ndim == 0: p = 0 elif R.ndim == 1: p = int(abs(R[0])...
import numpy as np from scipy.ndimage import gaussian_filter import sys from scipy.spatial import Delaunay import os import subprocess #from matplotlib import image as mpimg from PIL import Image, ImageDraw import shutil GAUSS = 2 OUTDIR = 'dm/temp/' PERSISTENCE_THRESHOLD = 512 l = 512 w = 512 def...
import numpy as np import eolearn from eolearn.core import FeatureType, EOTask from pathlib import Path from osgeo import gdal import os import shutil import subprocess import rasterio from eolearn.io.local_io import ExportToTiffTask, ImportFromTiffTask class MultitempSpeckleFiltering(EOTask): ...
import pandas as pd import numpy as np import matplotlib.pyplot as plt import csv as csv from sklearn.ensemble import GradientBoostingRegressor from sklearn.ensemble import RandomForestRegressor from sklearn.cross_validation import train_test_split from math import * from datetime import datetime import sklear...
#!/usr/bin/env python3 """Scan recursively directory and get information on clusters. Module with function to scan the directories and obtain existing cluster info, by reading or creating .cluster.ini files. Usage: ./update_clusters.py -f -l tests/zdjecia -f force recalculation of inin file -l path to librar...
import asyncio import base64 import binascii import gc import re import time from aiohttp import web import json from jsonrpcserver.aio import methods from jsonrpcserver import config, status from jsonrpcserver.exceptions import JsonRpcServerError from spruned.application import exceptions from spruned.application.e...
import torch import torch.nn as nn import h5py from h5mapper import * from .utils import * def test_feature_class(): f = Array() with pytest.raises(RuntimeError): f.load(None) class NotDB(object): f = Array() o = NotDB() with pytest.raises(RuntimeError): getattr(o, "f") ...
#!/usr/bin/env python3 # Inspired from https://towardsdatascience.com/today-im-going-to-talk-about-a-small-practical-example-of-using-neural-networks-training-one-to-6b2cbd6efdb3 """ Snake proceedes randomly. For every step, it observes if the neighbour cells are either free or occupied, and also observers th...
import numpy as np import torch def box2delta(proposals, gt, means=[0, 0, 0, 0, 0, 0], stds=[1, 1, 1, 1, 1, 1]): assert proposals.size() == gt.size() proposals = proposals.float() gt = gt.float() px = (proposals[..., 0] + proposals[..., 3]) * 0.5 py = (proposals[..., 1] + proposals[..., 4]) * 0.5...
import logging import voluptuous as vol import homeassistant.helpers.config_validation as cv from datetime import timedelta from homeassistant.helpers import discovery from obdtracker import api, location, device_status from homeassistant.util import Throttle from homeassistant.util.dt import utcnow from homeassistant...
import json from datetime import datetime, timedelta from django.contrib.auth.decorators import login_required from django.db.models import Q from django.http import HttpResponse from django.utils.decorators import method_decorator from django.views.generic import TemplateView from Auth.models import VisitationIp from...
#!/usr/bin/env python import os import sys import numpy as np import scipy.stats import matplotlib.pyplot as plt from domain_counter import compute_domain_sizes class UnknownQuantityError(Exception): '''Thrown when a Runner is queried for a non-existing quantiy''' def __init__(self, quantity): super(...
# -*- coding: utf-8 -*- # Copyright (c) 2017 <NAME> <<EMAIL>> # Author: <NAME> <<EMAIL>> # # 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 t...
from cerberus import Validator import phonenumbers from phonenumbers import carrier from phonenumbers.phonenumberutil import number_type import pdb import re # class SmartBiogasValidator(Validator): # def _validate_what3words(self, what3words, field, value): # if what3words: # pattern = re.compi...
import argparse import numpy as np import torch import torch.nn as nn import torchvision import pytorch_lightning as pl import vdvae.train as vdvae_train import vdvae.hps as hps import vdvae.vae as vdvae import pygenbrix_layer as pygl import PyGenBrix.dist_layers.common_layers as dl import PyGenBrix.dist_layers.spatial...
import random import torch import torch.nn as nn import torch.optim as optim import numpy as np import spacy from utils import translate_sentence, bleu, save_checkpoint, load_checkpoint from torch.utils.tensorboard import SummaryWriter # to print to tensorboard # from torchtext.datasets import Multi30k from torchtext....