text
stringlengths
8.04k
46.5k
import datetime import io import os import shutil import chardet import regex from chardet.universaldetector import UniversalDetector from natsort import natsort_keygen, natsorted nkey = natsort_keygen() def execute_proper_function(function_number, path, error_file_path): if function_number == 1: move_w...
# Mostly copied from https://github.com/affinelayer/pix2pix-tensorflow (MIT) from __future__ import absolute_import from __future__ import division from __future__ import print_function import logging import collections import tensorflow as tf from sciencebeam_gym.trainer.models.pix2pix.tf_utils import ( blank_...
import numpy as np import torch import torch.nn.functional as F import kornia from typing import Union, Tuple, Sequence from scipy.spatial.transform import Rotation from typing import Optional class Simulator: def __init__(self): fname = "/home/kejie/repository/fast_sdf/dist-model.txt" data = np.l...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import math, copy from torch.autograd import Variable """ #################################################################### #################### Funciones importantes ######################### ###########################...
from pathlib import Path import subprocess import tensorflow as tf import numpy as np from ruamel.yaml import YAML from model.transformer_utils import create_encoder_padding_mask, create_mel_padding_mask, create_look_ahead_mask from utils.losses import weighted_sum_losses, masked_mean_absolute_error, new_scaled_cross...
# -*- coding: utf-8 -*- import os import io import json import sys import shutil from decimal import Decimal from django.db import models from django.conf import settings from django.core.files.base import ContentFile from djangoplus.utils.formatter import to_ascii from djangoplus.ui.components.forms import fields as f...
# # Copyright (c) European Synchrotron Radiation Facility (ESRF) # # 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,...
#---------------------------------------------------------------------------------------# # Name : FLP.py # Author: T.K.R.Arvind # Date : 27th December 2020 # CLI : FLP.py # # This program is for floating point computation and related opeartions and is # mainly written to cross-check the result produced on...
import os from collections import OrderedDict import numpy as np from PIL import Image from io import BytesIO from gcg.envs.env import Env from gcg.envs.env_spec import EnvSpec from gcg.envs.spaces.box import Box from gcg.envs.spaces.discrete import Discrete from gcg.data.logger import logger import matplotlib.pyplot a...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import contextlib import json import logging import os from argparse import Namespace from collections import OrderedDict, defaultdict import...
# -*- coding: utf-8 -*- """ Created on Tue Aug 29 17:57:05 2017 """ from enum import Enum, unique import random import pygame import numpy as np from constant import Color, Const class TrafficSimulation: """ This is the main class for running the simulation """ list_of_roads = [] speed_factor =...
""" Created on Wed Oct 14 @author: M.C.Pali & <NAME> """ import time import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt plt.ioff() import numpy as np from termcolor import colored from sklearn.linear_model import OrthogonalMatchingPursuit from sklearn import preprocessing from ksvd import App...
import cv2 import numpy as np import pycocotools.mask as mask_util import torch from utils.data.structures.bounding_box import BoxList from utils.data.structures.boxlist_ops import cat_boxlist, boxlist_nms, \ boxlist_ml_nms, boxlist_soft_nms, boxlist_box_voting from utils.data.structures.parsing import f...
from adversarials.discriminator import TransDiscriminator from adversarials.attacker import Attacker from adversarials.adversarial_utils import * from src.data.dataset import ZipDataset, TextLineDataset from src.data.data_iterator import DataIterator from src.utils.common_utils import Saver, Collections, should_trigger...
import sys sys.path.append('../') import numpy as np import cv2 import math import os from ObstacleDetectionObjectives import numpy_iou class Obstacle(object): def __init__(self, x, y, w, h, depth_seg=None, obs_stats=None, conf_score=None, iou=None): self.x = int(x) #top self.y = int(y) #left self.w = int(w) ...
from handle import * from ..df.commonj import * from compatibility import * from ..df.blizzardj import bj_MAX_PLAYERS from index import * import math from event import * """ A wrapper for blizzard's units Methods should be self-explanatory """ class UnitRangeEvent(ClassEvent): def __init__(self, unit...
# -*- coding: utf-8 -*- # Copyright (c) 2019, 2020 boringhexi # Copyright (c) 2008-2019 <NAME>, Fastelbja, bnnm, <NAME> """subsong.py - read/write subsong files A "subsong" can be: - "IMC subsong": a PS-ADPCM audio file originating from an IMC audio container file. Has extension .sub.imc - an audio file of a diffe...
# /usr/bin/env python3.5 # -*- mode: python -*- # ============================================================================= # @@-COPYRIGHT-START-@@ # # Copyright (c) 2020, Qualcomm Innovation Center, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification,...
import ctypes from .internal import _SDL from .enum import CEnum # TODO: GetKeyboardFocus - have this return a Window() object _SDL.SDL_GetKeyboardState.restype = ctypes.POINTER(ctypes.c_uint8) _keyboard_state = None def get_keyboard_state(): # index by scancode global _keyboard_state if not _keyboard_sta...
""" Script to measure ring pulsatility by fitting a plane run as script """ import sys import os import visvis as vv from stentseg.utils import _utils_GUI from stentseg.utils.datahandling import select_dir, loadvol, loadmodel from stentseg.utils.visualization import show_ctvolume from stentseg.stentdirect.stentgraph ...
# # vcr.py # - Configures the environment for running the Viral Assembly (viral_assembly_pipeline.py) and VIGOR (VIGOR3.pl) pipelines (creating directory structure and installs software). # from __future__ import print_function import os.path, re, mmap from fabric.api import cd, env, hide, local, run, settings, sudo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import itertools import numpy as np import matplotlib.pyplot as plt import pandas as pd from pathlib import Path import pickle import seaborn as sns from sklearn.linear_model import LogisticRegression from sklearn.preprocessing import MinMaxScaler from sklearn.model_select...
import math import multiprocessing import os import sys from argparse import ArgumentParser, Namespace from multiprocessing import Pool from pathlib import Path from pprint import pprint import time import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import...
import pandas as pd import numpy as np import ntpath import easygui import os import warnings import time import math from openpyxl import load_workbook warnings.filterwarnings("ignore") # array['CO1'][0] = 8 CO_percentage = {'CO1': [], 'CO2': [], 'CO3': [], 'CO4': [], 'CO5': [], 'CO6': [],...
# MouseJoy """MouseJoy - mouse and key to vJoy joystick with lots of features. """ #=============================================================================== __copyright__ = """ Copyright 2020 <NAME> <<EMAIL>> Redistribution and use in source and binary forms, with or without modification, are permitted provid...
# -*- coding: utf-8 -*- """ Created on Fri Dec 6 12:43:49 2019 @author: bdobson """ import constants import initialise import options from tqdm import tqdm import pandas as pd from copy import deepcopy class model: def __init__(self,addresses): """Initialise all state variables and parameters ...
"""Data managers for the collection of auto-reply modules.""" from datetime import datetime, timedelta from typing import Tuple, Optional, List, Generator import math import pymongo from bson import ObjectId from JellyBot.systemconfig import AutoReply, Database, DataQuery, Bot from extutils.utils import enumerate_ran...
#! /usr/bin/python # -*- encoding: utf-8 -*- from __future__ import print_function from collections import OrderedDict import numpy as np import theano from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams import theano.tensor as T from .base import Model from ..utils.basic import p_, fX, slice_ fro...
r"""CV APIs for reference, to be deprecated and removed soon. """ import math import random from typing import * from pathlib import Path import numpy as np import torch as th try: import accimage except Exception as e: accimage = None py_min, py_max = min, max irange = range from ml.av.backend.opencv impor...
"""Utility functions.""" import argparse from dataclasses import dataclass, field import json import logging import math import os import subprocess as sp from typing import List, NamedTuple, Set from frads import radgeom, radmtx, util logger = logging.getLogger("frads.radutil") GEOM_TYPE = ['polygon', 'ring', 'tub...
import numpy as np import scipy as sc import scipy.fftpack from collections import deque import CustomPrincetonSPE_v2 as SPE import matplotlib as mp import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from itertools import islice, tee from numba import jit import datetime as dt import tim...
# -*- coding: utf-8 -*- import pandas as pd import numpy as np import os import itertools from matplotlib import pyplot as plt # import logging def remove_duplicates(values): output = [] seen = set() for value in values: # If value has not been encountered yet, # ... add it to both list a...
import os import subprocess as sp import time import warnings from queue import Queue from threading import Thread from typing import Union import cv2 import h5py import numpy as np import pandas as pd # TODO: refactor videoreader and videowriter to have these different methods be subclasses of a single base class ...
# -*- coding: utf-8 -*- """ Created on Thu Jul 1 12:40:28 2021 @author: USER """ #problem #sebelum login gk bisa ke home, set login sebagai menu utama import streamlit as st import pandas as pd import streamlit as st import os import sys import pandas as pd from io import BytesIO, StringIO import numpy as np import g...
# -*- coding: utf-8 -*- import bpy import math from mathutils import Vector from bpy.types import Operator from .warning_messages_utils import ( warning_messages, c_is_cycles_addon_enabled, c_data_has_materials, collect_report, ) # ----------------------------------------------------------------------...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: <NAME>, ph4r05, 2018 # Bulletproof offloading client import os import time import logging import binascii as ubinascii from monero_serialize.core.message_types import MessageType from monero_serialize.xmrtypes import ECKey, KeyV from monero_glue.hwtoken import m...
# -*- coding: utf-8 -*- """ Created on Mon Jul 24 09:02:16 2017 @author: hp """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.linear_model import Lasso from sklearn.ensemble import RandomForestRegressor from sklearn.ensemble import GradientBoostingRegressor ...
# # VM testing base class # # Copyright 2017-2019 Red Hat Inc. # # Authors: # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # This code is licensed under the GPL version 2 or later. See # the COPYING file in the top-level directory. # import os import re import sys import socket import logging import time import datetime s...
"""Traverses (:mod:`fluidlab.objects.traverse_lxm32`) ===================================================== .. currentmodule:: fluidlab.objects.traverse_lxm32 Provides: .. autoclass:: Traverse :members: :undoc-members: - 192.168.28.11 - Variateur1 - 192.168.28.12 - Variateur2 - 192.168.28.13 - Variateur3 - 19...
import tensorflow as tf from tensorflow.contrib import layers from tensorflow.contrib.legacy_seq2seq import rnn_decoder, embedding_rnn_decoder, sequence_loss, embedding_rnn_seq2seq, embedding_tied_rnn_seq2seq from tensorflow.python.framework import ops from tensorflow.python.layers import core as layers_core from ten...
""" specter.extract.ex2d ==================== 2D Spectroperfectionism extractions """ from __future__ import absolute_import, division, print_function, unicode_literals import sys import numpy as np import scipy.sparse import scipy.linalg from scipy.sparse import spdiags, issparse from scipy.sparse.linalg import spso...
# download_utilities.py # Defines various helper functions to connect to the Ergast API and download relevant historical race data. import requests as rq import pandas as pd from google.cloud import bigquery from google.oauth2 import service_account import os import datetime def create_bigquery_client(key_path): ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 07/09/17 @author: XXX, XXX, XXX """ import sys import numpy as np from tqdm import tqdm import sklearn.preprocessing as prep from RecSysFramework.Recommender.MatrixFactorization import BaseMatrixFactorizationRecommender from RecSysFramework.Utils.EarlyStop...
# -*- coding: utf-8 -*- ''' NAPALM helpers ============== Helpers for the NAPALM modules. .. versionadded:: 2017.7.0 ''' from __future__ import absolute_import, unicode_literals, print_function # Import python stdlib import inspect import logging log = logging.getLogger(__file__) # import NAPALM utils import salt.u...
# /bin/python3 # This scrip create a LAMMPS input file # based on the SBM model given in input # --- CLASSES --- from functools import reduce from decimal import Decimal from random import randint import math import os # get info about the class CompartmentClass: def __init__(self,model) -> None: ...
from utils import HelperException try: import vapoursynth except ImportError: raise HelperException("VapourSynth is not available, stop importing all commands that need vapoursynth.") import gc import os import argparse import random import tempfile import asyncio import logging import discord import matplotli...
import itertools from uuid import uuid4 try: from collections.abc import Iterable except ImportError: from collections import Iterable from glypy.composition import Composition from glypy.utils import uid, basestring, make_struct from .base import SaccharideBase, SubstituentBase from .constants import UnknownP...
# Copyright 2015 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...
__author__ = '<NAME>' __version__ = '0.03' __date__ = '2018 November 26' """ HISTORY 2018-11-27 transfered from giantradiopulse to nicrabgrp library 2018-10-24 created by T.Enoto """ import os import sys import shutil import glob import yaml import numpy as np import pandas as pd import astropy.io.fits as fi...
# -*- coding: utf-8 -*- """ Created on Thu Apr 29 21:45:02 2021 @author: <NAME> -Spatial structure index value distribution of urban streetscape """ from mayavi import mlab from tvtk.api import tvtk # python wrappers for the C++ vtk ecosystem import numpy as np from mayavi import mlab from tvtk.api import tvtk import...
import ast import math from collections import OrderedDict from configparser import ConfigParser class ExpressionString(object): """A class to safely parse strings into Python datatypes. It also allows to specify constants and functions that are allowed to be parsed. Arguments --------- const...
"""Base for all node resource services.""" import abc import collections import contextlib import errno import functools import glob import importlib import logging import os import select import shutil import socket import struct import tempfile import time import yaml from .. import exc from .. import fs from .. ...
# Note: dank.serverbuilder.py is meant to be run as an .exe by default, if you would like to execute the script, make the below changes... # - uncomment the following line > filepath = os.path.dirname(__file__) # as .py # - comment the following line > filepath = os.path.dirname(sys.argv[0]) # as .exe impo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat May 19 17:53:34 2018 @author: jachi """ import datetime import logging import string from collections import defaultdict from functools import reduce from gc import collect from io import StringIO from itertools import chain from operator import itemget...
#!/usr/bin/python # -*- coding: utf-8 -*- # # The MIT License (MIT) # # Copyright (c) 2016 CNR-ITTIG # # Developed under the Grant Agreement Number 608185 Collaborative Project # EVIDENCE Project # "European Informatics Data Exchange Framework for Courts and Evidence" # # Permission is hereby...
import json import logging from django.conf import settings from django.db import transaction from django.db.models import ( Q, Count, ) from django.utils import timezone from rest_framework import status from rest_framework.parsers import JSONParser, FormParser from audit import AUDIT_TYPE_ATTACH from cases....
"""Tests for ixmp.reporting.""" import os import subprocess import ixmp import numpy as np import pandas as pd from pandas.testing import assert_series_equal import pytest import xarray as xr import ixmp.reporting from ixmp.reporting import ( ComputationError, KeyExistsError, MissingKeyError, Key, ...
# -*- coding: utf-8 -*- """Inception-ResNet-V2 MultiScale-Inception-ResNet-V2 models for Keras. """ import logging import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras.layers import Activation from tensorflow.keras.layers import AvgPool2D from tensorflow.keras.layers import BatchNorm...
import time import telepot import apiai from telepot.loop import MessageLoop from telepot.namedtuple import InlineKeyboardMarkup, InlineKeyboardButton, ReplyKeyboardMarkup, KeyboardButton, ReplyKeyboardRemove from telepot.delegate import pave_event_space, per_chat_id, create_open, include_callback_query_chat_id # use ...
import tokenize import token import io class FunctionDefinition(object): def __init__(self): self.return_type = None self.name = None self.args = {} self.generate_impl = True self.fail_value = None defs = [] FAIL_VALUES = { 'HANDLE':'INVALID_HANDLE_VALUE', 'BOOL':...
# Copyright (c) 2020 PaddlePaddle 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 app...
#!/usr/bin/env python3 # This file is a part of muu and is subject to the the terms of the MIT license. # Copyright (c) <NAME> <<EMAIL>> # See https://github.com/marzer/muu/blob/master/LICENSE for the full license text. # SPDX-License-Identifier: MIT import utils import sys import math import random import decimal fro...
""" Ballot Manifest Data Entry Software The goal of this software is to create an easy to use interface for creating, updating, and removing entries in a ballot manifest that will be used for a Risk Limiting Audit (RLA). This software uses the tkinter module for rendering a graphical user interface (GUI) and uses the...
from collections import deque from typing import List import numpy as np from data_processing.data_processing_constants import SCORES_SIZE, \ ONE_SCORE_SIZE, DORA_INDICATORS_SIZE from evaluation.agents.agent import Agent from evaluation.agents.random_agent import RandomAgent from evaluation.hand_calculation.hand_...
""" Instance Correspondence net model. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import app from absl import flags import os import os.path as osp import numpy as np import torch import torchvision import torch.nn as nn from . import net_...
from sklearn.metrics import roc_curve, roc_auc_score import tensorflow as tf from tensorflow import keras from keras.models import load_model import mtcnn from os import listdir from os.path import isdir from PIL import Image from matplotlib import pyplot from numpy import savez_compressed from numpy import asarray fro...
#!/usr/bin/python import sys from random import randrange, random, choice, seed from math import sqrt import Image, ImageDraw, ImageChops from itertools import combinations from collections import defaultdict MY_ANT = 0 ANTS = 0 DEAD = -1 LAND = -2 FOOD = -3 BARRIER = -4 UNSEEN = -5 BARRIER_COLOR = (128, 128, 128) LA...
#!/usr/bin/env python3.3 import os import socket import numpy as np from scipy import integrate, optimize #for quad or simps or whatever from neo import AxonIO from rig.ipython import embed import pylab as plt import gc from multiprocessing import Process,Pipe def spawn(f): def fun(pipe,x): pipe.send(f(x)...
from mimetypes import init import os import pandas as pd import pyproj import numpy as np import matplotlib.pyplot as plt import seaborn as sns import math from pyevtk.hl import gridToVTK from pyevtk.hl import pointsToVTK import configparser import matplotlib as mpl def main(): settings = '~/settings.ini' prep...
""" """ import os import sys import math import heapq import numpy as np import cv2 from tsp_solver.greedy import solve_tsp import copy from tqdm import tqdm root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(root_path) sys.path.append( os.path.join( root_path, ...
# https://github.com/zeltsi/Bitpy/blob/master/Utils/keyUtils/keys.py # Copyright (C) <NAME> - All Rights Reserved # Unauthorized copying of this file, via any medium is strictly prohibited # Proprietary and confidential # Written by <NAME> <<EMAIL>>, June 2019 import bcrypt import argparse import binascii imp...
# coding=utf-8 ''' Created on 2018年2月28日 @author: heguofeng todo: 用dh 交换,加密 ''' import json import logging import requests import socket import struct import time from queue import Queue from ppnet.common import set_debug, do_wait, of_bytes from ppnet.config import BroadCastId, NAT_TYPE, PP_APPID from ppnet.config...
import math import numpy as np from einops import repeat import torch from torch import nn from .layers import * from utils.utils import instantiate_from_config from .nerf_utils import get_sample_points, volume_render_radiance_field, sample_pdf_2 class StyleGenerator2D(nn.Module): def __init__(self, out_res, ou...
import numpy as np import pandas as pd import json import xml.etree.ElementTree as ET import matplotlib.pyplot as plt import math from finn.core.datatype import DataType import seaborn as sns def extract_data_from_files(resources, finn_estimate_previous_file, finn_estimate_file, hls_estimate_file, svr_estimate_file, s...
from __future__ import print_function, unicode_literals from os.path import exists, join, expanduser, abspath from warnings import warn from pprint import pformat from boto.ec2 import connect_to_region from fabric.api import local, env, abort from awsfabrictasks.conf import awsfab_settings from awsfabrictasks.utils i...
import math from math import fabs from pypy.rlib.objectmodel import specialize from pypy.rlib.rfloat import copysign, asinh, log1p, isinf, isnan from pypy.tool.sourcetools import func_with_new_name from pypy.interpreter.error import OperationError from pypy.interpreter.gateway import NoneNotWrapped from pypy.module.cma...
#tip: SURF AND SIF algorythms are removed from newer opencv releases #pip install opencv-contrib-python==3.4.2.16 or use CMake built opencv library import cv2 try: from SlotBot import errors, imutils except ImportError: pass #for stand-alone usage import numpy as np import re import glob from robot.api im...
#!/usr/bin/env python # -*- coding: utf-8 -*- # <NAME>, <EMAIL>, 17/10/2014 import numpy as np from functions_shared import posdata_data, contraction, symmetrise, throw_error from itertools import chain import copy def zero_force_vectors(posdata): (sphere_sizes, sphere_positions, sphere_rotations, du...
import os import boto3 import yaml import socket import json import sys import requests from urllib import request from datetime import datetime from abc import abstractmethod class EventResponse: def __init__(self, event_type): self.event_type = event_type self.severity = "MEDIUM" # de...
# -*- coding: utf-8 -*- import os import re import json from collections import defaultdict from itertools import product, combinations from pypeg2 import * from .common import chain_to_root telugu_chars = '\u0C00-\u0C7F' arabic_chars = '\u0600-\u06FF\ufb50-\ufdff\ufe70-\ufefc' japanese_chars = '\u3000-\u303f\u3040-...
# -*- coding: utf-8 -*- import os import sys import re import json import random import string import zipfile import shutil import time import base64 from datetime import datetime from io import BytesIO from itertools import islice from contextlib import closing from . import kodi, logger try: from urlparse impor...
"""MIT License Copyright (c) 2018 rongjiewang 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, di...
''' Paper : Class-Incremental Domain Adaptation with Smoothing and Calibration for Surgical Report Generation ''' import os import copy import time import random import argparse import numpy as np import PIL.Image as Image import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import ...
# -------------------------------------------------------- # Pytorch multi-GPU Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by <NAME>; based off <NAME> # -------------------------------------------------------- from __future__ import absolute_import from __future__ import division f...
""" Unit tests for instance catalog parsing code. """ import os import unittest import warnings import tempfile import shutil import numpy as np import galsim import astropy.time import imsim from lsst.afw.cameraGeom import DetectorType from test_batoid_wcs import sphere_dist def sources_from_list(lines, obs_md, phot...
import requests import io import matplotlib.pyplot as plt from PIL import Image import base64 from collections import OrderedDict class Deck: def __init__(self, deck_count=1): self.BASE_URL = 'http://deckofcardsapi.com/api/' endpoint = 'deck/new/shuffle/' parameters = '?deck_count=' + str...
import argparse import csv import ftplib import io import os import shutil import zipfile from copy import copy from datetime import datetime from netrc import netrc from tempfile import TemporaryFile from typing import Dict, Iterable, List, NamedTuple, Optional, Set, Tuple from warnings import warn import osmiter imp...
from ..dataset import DataSet, concatenate, as_instances from ..helpers import to_one_of_n import numpy as np import unittest import tempfile from functools import reduce class TestDataSet(unittest.TestCase): def setUp(self): self.data = np.random.rand(5,3,10) self.labels = np.atleast_2d(7+np.arang...
## Online battery validation import os import glob import pandas as pd import numpy as np import pickle class BESS(object): def __init__(self, max_energy, max_power, init_soc_proc, efficiency): self.soc = init_soc_proc self.max_e_capacity = max_energy self.efficiency = efficiency ...
from __future__ import print_function, division, absolute_import import cobra import pandas from Bio import SeqIO from six import iteritems from cobrame import * def add_transcription_reaction(me_model, TU_name, locus_ids, sequence, update=True): """ Create TranscriptionReacti...
import logging import numpy as np import tensorflow as tf import pandas as pd import os import re from kgcnn.utils.adj import get_angle_indices, coordinates_to_distancematrix, invert_distance, \ define_adjacency_from_distance, sort_edge_indices, get_angle, add_edges_reverse_indices, \ rescale_edge_weights_degr...
# Copyright The PyTorch Lightning team. # # 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 i...
""" Import modis raster data i figure that process outside of postgis then import is better done try to do things in gis. I looked into: st_mapalgebra see if it can work on band, but that was very slow st_translate to project. having hard time to grab correct set of tiles. i tied with gist index having shadow geome...
import re # import CMUTweetTagger #import cPickle from collections import defaultdict import pickle from nltk.corpus import wordnet as wn from itertools import product import spacy from spacy.symbols import * from nltk import Tree from nltk import * import nltk import location_2 as location import time import sys ps_st...
# Copyright (c) 2021 PaddlePaddle 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 appli...
import warnings from pathlib import Path import bottleneck as bn import numpy as np from astropy.io import fits from astropy.wcs import WCS from astropy.nddata import CCDData from astropy.table import Table from astropy.time import Time try: import fitsio HAS_FITSIO = True except ImportError: HAS_FITSIO =...
# coding: utf8 # Copyright (c) 2020 PaddlePaddle 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 req...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import argparse import numpy as np import shutil import random import time import torch import torch.nn as nn import torch.optim as optim from torch.optim imp...
# Copyright 2019 Red Hat, 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...
"""Various helpful bits and pieces without much of a common theme.""" from __future__ import division, absolute_import __copyright__ = "Copyright (C) 2010 <NAME>" __license__ = """ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "S...