text
stringlengths
3.07k
22.1k
import numpy as np import matplotlib.pyplot as plt from scipy import signal import csv import os from statistics import mode import time import matplotlib.pyplot as plt import numpy as np import scipy.io as sio import tensorflow as tf import tensorflow.keras as keras from ecgdetectors import Detectors from sklearn.mode...
''' Copyright 2022 Airbus SAS Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dis...
import os import time from collections import defaultdict from functools import reduce from multiprocessing.pool import ThreadPool import bs4 import requests from bgmi.config import MAX_PAGE from bgmi.website.base import BaseWebsite from bs4 import BeautifulSoup week = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"...
#!/usr/bin/env python3 from pathlib import Path import os from functools import cmp_to_key from v2x import vlog_to_model from v2x import vlog_to_pbtype from v2x.xmlinc import xmlinc from v2x.mux_gen import mux_gen from vtr_xml_utils import convert from distutils.dir_util import copy_tree TEST_TMP_SUFFIX = 'build/'...
import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor import math class NN_SC_Weight_Clipper(object): """ This is a clipper for weights and bias of neural networks """ def __init__(self, frequency=1, mode="bipolar", method="clip", bitwidth=8): self.frequenc...
from functools import partial from hummingbird.parameters.constants import ActuatorEnum, PhysicalConstants as pc, StateEnum from hummingbird.physics.dynamics_base import * from hummingbird.physics.kinematics import compute_kinematics_from_quat import numpy as np from hummingbird.message_types.msg_state import MsgStat...
#!/home/depado/3.3/bin/python3.3 # -*- coding: utf8 -*- # External Libs import irc.bot # Internal Libs # TODO: Using requests instead of urllib import pickle import sys import random import urllib.request import urllib.parse import time import re from datetime import datetime from settings import * from constants im...
from __future__ import print_function import keras from keras.datasets import mnist from keras.layers import * from keras.models import Sequential, load_model from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Conv2D, MaxPooling2D from keras.callbacks import ModelCheckpoint import n...
from os import link import flask from flask.globals import request from flask import Flask, render_template # library used for prediction import numpy as np import pandas as pd import pickle # library used for insights import json import plotly import plotly.express as px app = Flask(__name__, template_folder = 'templ...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2018 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...
from contextlib import contextmanager from os import environ from pathlib import Path from tempfile import TemporaryDirectory from textwrap import dedent import pytest from sanic import Sanic from sanic.config import DEFAULT_CONFIG, Config from sanic.exceptions import PyFileError @contextmanager def temp_path(): ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Script used to analyze the ellipsometry data recorded on the Picometer Light ellipsometer available at the Partneship for soft condensed matter at the Institut Laue-Langevin, Grenoble. The script uses the tmm package developed by <NAME> (see https://pypi.org/project/t...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @author:mjx """ import torch import torch.nn as nn import torch.nn.functional as F from torchsummary import summary class encode_block(nn.Module): def __init__(self, in_channels, out_channels, kernel_size=3, padding=0, stride=1, dilation=1, batch_norm=True, ...
"""Miscellaneous functions to analyze the simulation results. Index ----- .. currentmodule:: nanoqm.analysis.tools .. autosummary:: API --- """ import os from typing import List, Tuple import numpy as np import pyparsing as pa from scipy.optimize import curve_fit from ..common import fs_to_cm, h2ev, hbar, r2meV ...
import json import os import sqlite3 from enum import Enum from typing import List from psd_tools.api.psd_image import PSDImage class TemplateFileEnum(Enum): START = "START.txt" END = "END.txt" END_WITHMACRO = "END_WITHMACRO.txt" MACROSTART = "MACROSTART.txt" MACROSTART_INPUT = "MACROST...
import numpy as np import os import yaml import girder_client import socket import yt def get_nice_size(my_size, fmt="%.2f"): prefs = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'] exp = int(np.log(max(my_size, 1)) / np.log(1024)) num = fmt % (my_size / 1024**exp) return "%s %sB" % (num, pre...
# -*- coding: utf-8 -*- """ The Royal Thai General System of Transcription (RTGS) is the official system for rendering Thai words in the Latin alphabet. It was published by the Royal Institute of Thailand. #https://en.wikipedia.org/wiki/Royal_Thai_General_System_of_Transcription """ import re from pythainlp import tha...
# Copyright (c) 2014 Evalf # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, s...
## @file # Hardware feature class definition. # # Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license m...
#!/usr/bin/env python3 import argparse import sys import os import numpy as np import glob from collections import defaultdict from scipy.spatial import distance import pdb parser = argparse.ArgumentParser(description = '''Fetch the plDDT and calculate several metrics across each chain, both chains and the interface.'...
import torch # import sys # sys.path.insert(0, '/n/scratch2/xz204/Dr37/lib/python3.7/site-packages') from deeprobust.graph.targeted_attack import Nettack from deeprobust.graph.utils import * from deeprobust.graph.data import Dataset import argparse from deeprobust.graph.defense import * # GCN, GAT, GIN, JK, GCN_attack,...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# fizzbuzz with no ifs, no modulo??? should still be easily readable code????? # for high performance, modulo with ints should be fine # questions to ask (solution depending on answers): # is this code going to be run many times a day/hour/second? (performance) # is this code going to be run on different numbers? (sca...
""" .. See the NOTICE file distributed with this work for additional information regarding copyright ownership. 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.or...
""" Validators for ProtoFeeds. Designed along the lines of gtfs_kit.validators.py. """ import numbers import pandas as pd import shapely.geometry as sg import gtfs_kit as gk from . import constants as cs def valid_speed(x): """ Return ``True`` if ``x`` is a positive number; otherwise return ``False``. ...
#! /usr/bin/env python """ singleSession.py =================== This program is used to generate the subject- and session-specific workflows for BRAINSTool processing Usage: singleSession.py [--rewrite-datasinks] [--wfrun PLUGIN] [--use-sentinal] [--dry-run] --workphase WORKPHASE --pe ENV --ExperimentConfig FILE SES...
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list of...
# Author: <NAME> <www.nicovandenhooff.com> # License: MIT License """ Scrapes the following data from a search query on Github: - The top n repos (max is 1000) as it relates to the search query, where "top" is calculated by total number of stars or forks that a repo has. - The data for the owners of the ab...
#!/usr/bin/env python3 # Developed by <NAME> and <NAME> # This file is covered by the LICENSE file in the root of this project. # Brief: This script generates virtual scans for map grids using a voxelized point cloud map import os import sys import yaml import numpy as np import open3d as o3d from tqdm import tqdm im...
import pygame import random # randomness on apple positions # game over sound available in https://freesound.org/people/EVRetro/sounds/533034/ # snake death sound available in https://freesound.org/people/jeckkech/sounds/391653/ # eating apple sound available in # https://freesound.org/people/lulyc/sounds/346116/down...
import random import json import nltk import torch import transformers from gtts import gTTS import speech_recognition as sr import os import playsound import config import pyjokes from nltk.stem.porter import PorterStemmer import numpy as np from torch.utils.data import Dataset, DataLoader import torch.nn as nn clas...
import matplotlib #matplotlib.use("qt4agg") import matplotlib.pyplot as plt import numpy as np import pandas as pd from matplotlib.patches import Ellipse import seaborn as sns from matplotlib.path import Path import os #plt.ion() #plt.show(block=False) ''' SMALL_SIZE = 8 MEDIUM_SIZE = 10 BIGGER_SIZE = 12 plt.rc('fon...
import pandas as pd import numpy as np def min_fee(dataframe, para_fee): fee_array = np.array(dataframe[para_fee]) fee_min = np.min(fee_array, axis=1) dataframe["fee_min"] = fee_min return dataframe def traffic_current_month(dataframe): month_traffic = dataframe["month_traffic"].tolist() las...
""" DotKnot: software for RNA pseudoknot prediction Copyright (C) 2010-2011 <NAME> 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 2 of the License, or ...
import random import math import time import sc2 from buildOrder import buildtreeNode from buildOrder import buildOrder from lateGameFSM import lateGameFSM from sc2 import Race, Difficulty from sc2.constants import * from sc2.player import Bot, Computer from sc2.position import Point2, Point3 from buildOrder import b...
import bs from bsUI import SettingsWindow, gSmallUI, gMedUI, gTitleColor, gDoAndroidNav, gWindowStates try: from ui_wrappers import TextWidget, ButtonWidget, ImageWidget except ImportError: bs.screenMessage("ui_wrappers missing", color=(1, 0, 0)) raise class SettingsButton: def __init__(self, id, tex...
#!/usr/bin/env python3 import logging from functools import partial from ipaddress import IPv4Address, IPv6Address, ip_address from itertools import chain from pathlib import Path from random import randint from typing import NamedTuple, List, Union import docker import argparse import shutil import signal import sys ...
import theano import theano.tensor as T import numpy from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams from theano.sandbox.cuda.dnn import dnn_conv from generic_utils import * srng = RandomStreams(seed=3732) T.nnet.relu = lambda x: T.switch(x > floatX(0.), x, floatX(0.00001)*x) #this helps avoid Na...
#!/usr/bin/python import random import json import time from threading import Thread from multiprocessing import shared_memory from beacontools import BeaconScanner from beacontools import IBeaconFilter from log import error, warn, info, debug from config import config_write, lowercase_dict_keys from config import MI...
#!/bin/env python # -*- coding: utf-8 -*- """ Copyright 2020-present Works Mobile Corp. 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 requir...
import collections from types import SimpleNamespace RawResult = collections.namedtuple("RawResult", ["start_logits", "end_logits"]) from model_utils.tokenization import (BasicTokenizer, BertTokenizer, whitespace_tokenize) import math def get_final_text(pred_text, orig_text, do_lower_case): """Project the tokenize...
# # Copyright © 2019 VMware, Inc. All Rights Reserved. # # SPDX-License-Identifier: BSD-2-Clause # import time from time import sleep import argparse import os import logging import threading import sys import signal from string import Template import datetime import paho.mqtt.client as mqtt import json import socket f...
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.misc import sstruct from fontTools.misc.textTools import safeEval from fontTools.misc.encodingTools import getEncoding from . import DefaultTable import struct import logging log = logging.getLogger(__nam...
# coding=utf-8 # Copyright 2021 The Trax 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 a...
""" This file implements analog plugin for werid view. """ from PyQt5 import QtWidgets from PyQt5.Qt import QWidget, QTimer, QDoubleValidator, QThread from PyQt5.QtCore import pyqtSignal, QMutex, QWaitCondition from socket import socket, AF_INET, SOCK_DGRAM, SOL_SOCKET, SO_REUSEADDR from weird_view import WV_UPDATE, WV...
import numpy as np from tqdm import tqdm import os, pickle import sys relu = np.vectorize(lambda x: max(x, 0)) #Count stuff in v in [lb, ub) or [lb, ub] def count_occ(v, lb, ub, r_include=False): g = v >= lb s = v <= ub if r_include else v < ub return (g & s).sum() EMPTY_SPACE = "|_" FULL_SPACE = "|X" Y...
"""Creates the Flask and Flask-Socketio endpoints for the optimisation backend. """ from flask import Flask, request from flask_cors import CORS from flask_socketio import SocketIO, emit import rq from rq.job import Job from worker import conn, queue from spineq.utils import make_job_dict, make_age_range from confi...
from __future__ import unicode_literals import hashlib from django.apps import apps from django.conf import settings from django.db import models from django.template import loader from django.template.response import TemplateResponse from django.urls import reverse from django.utils.encoding import force_text, pytho...
'''Parser for esoteric language Unsuspected Hangeul.''' import unicodedata from pbhhg_py.abstract_syntax import * # TABLES # note all ㅇ and ㅎ has a preceding space in following tables U1100 = ['ㄱ', 'ㄱ', 'ㄴ', 'ㄷ', 'ㄷ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅂ', 'ㅅ', 'ㅅ', ' ㅇ', 'ㅈ', 'ㅈ', 'ㅈ', 'ㄱ', 'ㄷ', 'ㅂ', ' ㅎ', 'ㄴㄱ', 'ㄴ', 'ㄴㄷ', '...
# Copyright (c) 2013 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to t...
import numpy as np from scipy import stats from itertools import product import ZODB from boolsi.attractor_analysis import find_node_correlations, compute_frequency_pearsonr, \ assign_frequency_ranks, compute_frequency_spearmanrho from boolsi.testing_tools import construct_aggregated_attractor, generate_test_descr...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2020 The SymbiFlow Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC import os import subprocess import time impor...
import logging import random import numpy as np from ray.rllib.agents import with_common_config from ray.rllib.agents.dreamer.dreamer_torch_policy import DreamerTorchPolicy from ray.rllib.agents.trainer_template import build_trainer from ray.rllib.execution.common import STEPS_SAMPLED_COUNTER, \ LEARNER_INFO, _ge...
import os, shutil, uuid, yaml, logging, aiohttp, json, urllib, hashlib, datetime, asyncio, base64, re, zipfile, tempfile, time from urllib.parse import urlparse _LOGGER = logging.getLogger(__name__) ''' ---------------------- 文件操作 --------------------------- ''' # 获取当前路径 def get_current_path(file_path): return os...
# -*- coding: utf-8 -*- """Parameter Value Language decoder. The definition of PVL used in this module is based on the Consultive Committee for Space Data Systems, and their Parameter Value Language Specification (CCSD0006 and CCSD0008), CCSDS 6441.0-B-2, referred to as the Blue Book with a date of June 2000. A decod...
import numpy as np import re, os, sys from pmesh.pm import ParticleMesh from nbodykit.lab import BigFileCatalog, BigFileMesh, MultipleSpeciesCatalog, FFTPower from nbodykit import setup_logging from mpi4py import MPI import HImodels # enable logging, we have some clue what's going on. setup_logging('info...
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import numpy as np import time from layers import SpGraphAttentionLayer, ConvKB, ConvE from torch_scatter import scatter_add, scatter_mean CUDA = torch.cuda.is_available() # checking cuda availability class MergeL...
# Copyright 2016 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
print(f'Loading {__file__}') # area_dets = [pilatus100k] # all_area_dets = [pilatus100k, tetramm] area_dets = [lambda_det] all_area_dets = [lambda_det, quadem] @bpp.stage_decorator(all_area_dets) def reflection_scan(alpha_start, alpha_stop, num, detector='lambda_det', precount_time=1, exp_time=1, default_att=1e-7, ...
from django.shortcuts import render from django.views import View from django import http from meiduo_mall.utils.login import LoginRequiredMixin from users.models import Address from django_redis import get_redis_connection from goods.models import SKU from users.models import Address import json from meiduo_mall.utils...
from datetime import datetime import logging from typing import List import time import hashlib from scrapydd.models import session_scope, ProjectPackage, Project, Spider, \ Trigger, SpiderExecutionQueue, \ SpiderParameter, Session, User from scrapydd.storage import ProjectStorage from scrapydd.excepti...
import time import warnings from typing import Callable, Iterable, Optional, Tuple, Union, cast import torch from torch import nn, optim from torch.optim.lbfgs import LBFGS from torch.optim.lr_scheduler import _LRScheduler as LRScheduler from torch.optim.optimizer import Optimizer from torch.utils.data import DataLoad...
""" Base class for all Services. """ import inspect import platform from .json import ( deserialize, serialize ) from .constants import ( PORT, SHUTDOWN_SERVICE, DISCONNECT_REQUEST, NOTIFICATION_UUID, ) from .utils import logger from .network import Device class Service(Device): def __in...
import os import argparse import numpy as np import pandas as pd from scipy import sparse from collections import defaultdict from sklearn.preprocessing import OneHotEncoder import warnings warnings.filterwarnings("ignore", category=DeprecationWarning) from utils.queue import TimeWindowQueue def phi(x): return ...
# Copyright 2019 The Magenta Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
####################################################################################### # Author: <NAME> # Username: hea # Date: 3/18/16 # Purpose: # Lab 2 # Learn about an important application of computer science, the UPC code # Work on the design of a larger problem # Use lists in an application pro...
"""Forex Controller.""" __docformat__ = "numpy" import argparse import difflib from datetime import timedelta, datetime from typing import List, Union import pandas as pd from colorama import Style from prompt_toolkit.completion import NestedCompleter from gamestonk_terminal import feature_flags as gtff from gamesto...
#!/usr/bin/env python # -*- coding:UTF-8 -*- # Copyright (c) 2014 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to us...
""" Copyright 2019 <NAME>. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distribut...
# Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
"""An implementation of the OpenID Provider Authentication Policy Extension 1.0 @see: http://openid.net/developers/specs/ @since: 2.1.0 """ __all__ = [ 'Request', 'Response', 'ns_uri', 'AUTH_PHISHING_RESISTANT', 'AUTH_MULTI_FACTOR', 'AUTH_MULTI_FACTOR_PHYSICAL', ] from openid.extension i...
''' NOTE 2020-02-11 - This script is "frozen" and archived as part of Ross Winans's masters thesis work. This script was forked from https://github.com/svpino/tf_object_detection_cm/blob/master/confusion_matrix.py in mid-2020 and minor modifications were made to create the "pretty" confusion matricies seen in Ross's t...
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Evaluation on phantoms """ from __future__ import print_function, division, absolute_import, unicode_literals import nipype.pipeline.engine as pe # pipeline engine ...
from __future__ import print_function from orphics import maps,io,cosmology,stats from pixell import enmap,curvedsky as cs import numpy as np import os,sys from tilec import utils as tutils import healpy as hp #Port of healpix module coord_v_convert.f90 to python by JLS #Feb 28, 2017 from numpy import sin,cos from nu...
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import ntpath import os import sys import xml.etree.ElementTree as ElementTree import autosar dvg_xml = """<?xml version="1.0" encoding="utf-8"?> <DVG> <Version>1.0</Version> <Contents> </Contents> </DVG>""" class XMLWriterSimple: def __init__(self): self.indentChar='\t' def mak...
from dataclasses import dataclass from typing import List, Dict, Callable, Any, Optional from pydantic import ( BaseModel, BaseSettings, Field, ) from datetime import datetime, timedelta from mytrading.utils import dbfilter as dbf from myutils.dashutilities import interface as comp from . import formatters ...
# This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for license information # See https://swift.org/CONTRIBUTORS.txt for the list o...
""" Helper functions for working with EM data cubes. """ __author__ = "<NAME>" __copyright__ = "Copyright 2014, JHU/APL" __license__ = "Apache 2.0" import os, sys, re import pdb import numpy as np from PIL import Image from scipy.signal import convolve2d from scipy.io import loadmat import h5py def load_cube(da...
# Copyright 2016 Google Inc. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
from django.db import models from paypalrestsdk import payments as paypal_models from .. import enums from ..fields import CurrencyAmountField, JSONField from .base import PaypalObject class Payment(PaypalObject): intent = models.CharField(max_length=9, choices=enums.PaymentIntent.choices) cart = models.CharField(...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import os sys.path.append('./') import shapely from shapely.geometry import Polygon,MultiPoint import numpy as np import editdistance from weighted_editdistance import weighted_edit_distance from tqdm import tqdm try: import pickle except ImportError: im...
import os.path import re from typing import Any, List, Optional, Tuple from demisto_sdk.commands.common.constants import ( CONTEXT_OUTPUT_README_TABLE_HEADER, DOCS_COMMAND_SECTION_REGEX) from demisto_sdk.commands.common.tools import (LOG_COLORS, get_yaml, print_color,...
import netCDF4 as nc import os import db import sys from shapely.geometry.point import Point from geoalchemy.base import WKTSpatialElement from shapely.geometry.polygon import Polygon import warnings class NcModelImporter(object): """ Load a climate model with URIs pointing to model output datasets. ...
# Source: https://github.com/sdujump/DifNet import math import torch import torch.nn as nn from torch.nn.parameter import Parameter import torch.nn.functional as F affine_par = True __all__ = ['DifNet', 'DifNet101', 'DifNet152'] def conv3x3(in_planes, out_planes, stride=1, padding=1, dilation=1): "3x3 convolut...
import os,sys,shutil import protac_lib as pl import rosetta as rs import utils import glob import pymol_utils sys.path.append(utils.SCRIPTS_FOL) import cluster as cl def main(name, argv): if not len(argv) == 1: print_usage(name) return log = open('log.txt', 'w', bufferi...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Dec 28 18:57:38 2020 @author: rebecca """ import os import gpxpy import gpxpy.gpx import os.path import sys import geopy.distance #install it! coordinates distance calculator package (height?) import math current_dir = os.path.dirname(os.path...
import numpy as np from functools import reduce from operator import mul from sparse import SparseArray from sparse.coo.common import linear_loc from sparse.utils import normalize_axis, equivalent, check_zero_fill_value, _zero_of_dtype import sparse import scipy.sparse as ss from .convert import compress_dimens...
# # Verified # from manimlib.imports import * # Helpers def get_shadow(mobject, opacity=0.5): result = mobject.deepcopy() result.apply_function(lambda p: [p[0], p[1], 0]) color = interpolate_color( mobject.get_fill_color(), BLACK, mobject.get_fill_opacity() ) # color = BLACK re...
''' To render 3d scenes (or even high dimensional), the first thing we need is the ability to rotate the objects we render and view them from different angles. This can be done with rotation matrices or quaternions. We favor the rotation matrix since they are simpler and can be used in spaces of arbitrary dimensionalit...
"""ReportLab Graphics -> Matplotlib helpers""" #linear, dotplot and dendrogram were originally written to target ReportLab Graphics rather #than Matplotlib. This module can be slowly boiled away as they become more matplotlib native. from __future__ import division from matplotlib.path import Path from matplotlib.li...
"""Crop/Split optical RSIs and save as .npy format Author: Cheney Email: <EMAIL> Date: 20190416 """ import os import shutil # import concurrent.futures import sys import gdal import numpy as np sys.path.append(os.path.expanduser('~/code/BasicSR/codes/data/')) from util import imresize_np # print(sys.argv[0]) # pr...
# ------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # ----------------------------------------------------------------------...
"""Combine demand, hydro, wind, and solar traces into a single DataFrame""" import os import time import pandas as pd import matplotlib.pyplot as plt def _pad_column(col, direction): """Pad values forwards or backwards to a specified date""" # Drop missing values df = col.dropna() # C...
import sys from typing import Container sys.path.append('../') import gi import configparser gi.require_version('Gst', '1.0') from gi.repository import GObject, Gst from common.is_aarch_64 import is_aarch64 from common.bus_call import bus_call import cv2 import numpy as np import os.path from os import path import pyds...
#import ROOT,sys,time,os,signal from larcv import larcv import ROOT as rt import sys,time,os,signal import numpy as np import threading def threadio_func(storage, proc): storage._threaded = True while storage._threaded: time.sleep(0.000005) if storage._filled: continue storage._read_start_time ...
#from #https://github.com/zh794390558/IEMOCAP-Emotion-Detection import os import csv import wave import sys import numpy as np import pandas as pd import glob from tensorflow.keras.preprocessing.text import text_to_word_sequence def split_wav(wav, emotions): (nchannels, sampwidth, framerate, nframes, comptype, c...
#!/usr/bin/env python3 # This file is a part of toml++ and is subject to the the terms of the MIT license. # Copyright (c) 2019-2020 <NAME> <<EMAIL>> # See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text. import sys import re import os import os.path as path import traceback de...
from collections import namedtuple from cacofonisk.callerid import CallerId class MissingUniqueid(KeyError): pass class Channel(object): """ A Channel holds Asterisk channel state. It can be dialed, bridge, and updated with new data. All of the above is typical low level Asterisk channel behav...
"""Detection visualizing. This file helps visualize 3D detection result in 2D image format """ import csv import time import argparse import os import sys import numpy as np import os.path import cv2 import math as m import torch from model.utils import kitti_utils def Space2Image(P0, pts3): pts2_norm = P0.dot(...