text
stringlengths
6.04k
39.5k
# Copyright (c) 2021-2022 <NAME> # Licensed under the zlib/libpng License # https://opensource.org/licenses/Zlib #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | # ...
from math import cos, sin, atan2 from lib.utility import gravitational_constant, pi, range_setter, time_difference from datetime import datetime as dt import json from functools import lru_cache class Focus: """Object around which satellite will orbit""" name: str mass: float satellite_list: list ...
#!/usr/bin/env python import os import shutil import sys import subprocess import json import yaml import inflect from scaffold.custom_fields import * from scaffold.modules.replace_string import replace_string, \ new_route_string, menu_string, js_src_string, test_script_string, conf_js_string from scaffold.modules.erro...
from enum import Enum from threading import Lock from exceptions import NoBlockException from types import GeneratorType class Action(Enum): Bomb = 'BOMB' Discard = 'DISCARD' class Direction(Enum): """ Possible directions to move a block, plus dropping. """ Left = 'LEFT' Ri...
from __future__ import print_function import sys if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest import inspect import json import os import time import tempfile from textwrap import dedent from . import resource_suite from .. import test from . import settings from .. import ...
r""" Routines for displacing a molecular geometry by translation or proper/improper rotation. :: 1 | 4 / \ 2 3 Example axes for displacements: 1. X1X4 stretch: :math:`r_{14}` 2. X1X4 torsion: :math:`r_{14}` (for motion of 2, 3) 3. X1X4X2 bend: :math:`r_{14} \times r...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import, division, print_function, unicode_literals import sys import logging import numpy as np from collections import OrderedDict import subprocess from astropy.table import Table from astropy.utils import lazyproperty fro...
# -*- coding: utf-8 -*- """ @file @brief Defines a sphinx extension to give a title to a todo, inspired from `todo.py <https://github.com/sphinx-doc/sphinx/blob/master/sphinx/ext/todo.py>`_. """ import os from docutils import nodes from docutils.parsers.rst import directives from docutils.frontend import Values import...
#!/usr/bin/env python3 # # 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 ...
from skdecide.builders.discrete_optimization.generic_tools.graph_api import Graph from skdecide.builders.discrete_optimization.rcpsp.rcpsp_model import RCPSPSolution, RCPSPModel, RCPSPModelCalendar from typing import List, Union import matplotlib.pyplot as plt from copy import deepcopy import numpy as np from shapely.g...
# 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 agree...
# Lint as: python3 # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
""" author: <NAME> & <NAME> Implementation of the climate data-utils for our training framework (i.e. on synthetic SDE data). This is mainly a copy of the data_utils.py file from the official implementation of GRU-ODE-Bayes: https://github.com/edebrouwer/gru_ode_bayes. """ import torch import pandas as pd import num...
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence from collections import defaultdict from torch.autograd import Variable from .tacotron_layers import LinearNorm, Prenet, Attention, get_mask_from_lengths, Postnet import math impor...
#!/usr/bin/env python3 # coding=utf-8 """ @author: guoyanfeng @software: PyCharm @time: 2020/3/1 上午12:00 """ from typing import (Dict, List, MutableMapping, Optional, Union) import aelog from aiomysql.sa import exc # noinspection PyProtectedMember from aiomysql.sa.connection import _distill_params, noop # noinspecti...
""" Created on Sat Dec 30 14:54:23 2017 @author: <NAME> Contains functions for embedding a text watermark into a host image and extracting the watermark from a watermarked image """ import numpy as np import cv2 import pywt import projutils def lsb_embed(wmText, hostImage): """Embeds a watermark text into a hos...
"""Parser utils.""" import os import re from io import StringIO from pathlib import Path from itertools import zip_longest import numpy as np import pandas as pd import chardet _COLUMN_LENGTH = 13 IGNORE_SECTIONS = ['ARITHMETIC', 'COPY', 'MULTIPLY', 'RPTISOL', 'RPTPROPS', 'RPTREGS', ...
import os import pickle import re from abc import ABCMeta, abstractproperty from itertools import chain from numbers import Number from types import MethodType from typing import Dict, Generator, Iterable, List, Optional, Tuple, Union from typing_extensions import Literal from urllib.request import urlretrieve from odi...
# Import kivy tools from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout from kivy.uix.recycleboxlayout import RecycleBoxLayout from kivy.uix.label import Label from kivy.uix.button import Button from kivy.uix.checkbox import CheckBox from kivy.uix.spinner import ...
# The piwheels project # Copyright (c) 2017 <NAME> <https://github.com/bennuttall> # Copyright (c) 2017 <NAME> <<EMAIL>> # # 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 ...
import datetime import os import warnings from hashlib import md5 from time import sleep from typing import Tuple, Dict, Optional, TYPE_CHECKING, List from urllib.parse import urlparse import psycopg3 import sqlalchemy as sa from sqlalchemy import text, Index from airflow import AirflowException from airflow.hooks.pos...
from __future__ import division import numpy as np import tensorflow as tf ''' This file aims to solve the end to end communication problem in Rayleigh fading channel ''' ''' The condition of channel GAN is the encoding and information h ''' ''' We should compare with baseline that equalizor of Rayleigh fading''' def ...
import logging import numpy as np import bz2 import gzip from numpy.random import RandomState from ..base.constants import MAX_SEED from ..base.utilities import rename from ..database.models import Interaction from ..database.utilities import ( full_training_network, training_interactions, interactome_interac...
#!/usr/bin/env python3 from test_framework.authproxy import AuthServiceProxy, JSONRPCException import os import random import sys import time import subprocess import shutil from decimal import * from pdb import set_trace ELEMENTSPATH="" BITCOINPATH="" if len(sys.argv) == 2: ELEMENTSPATH=sys.argv[0] BITCOINPA...
# ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. # Written by <NAME> (<EMAIL>) # ------------------------------------------------------------------------------ from __future__ import absolute_import from __future__ import divis...
#!/usr/bin/env python3 # # This script checks for updates to zcashd's dependencies. # # The SOURCE_ROOT constant specifies the location of the zcashd codebase to # check, and the GITHUB_API_* constants specify a personal access token for the # GitHub API, which need not have any special privileges. # # All dependencies...
import copy import numpy as np from numpy import random class NumberArray: # Define the Number array ints = [] # Define the number of array entries n = 0 # Create std class methods def __init__(self, setup) -> None: if isinstance(setup, np.ndarray): self.ints = setup ...
#!/usr/bin/env python # # This file is part of snmpsim software. # # Copyright (c) 2010-2018, <NAME> <<EMAIL>> # License: http://snmplabs.com/snmpsim/license.html # # SNMP Simulator MIB to data file converter # import getopt import sys import os import time import socket import struct import bisect import traceback tr...
from asyncio import TimeoutError import json import discord from discord.ext import commands from discord import Member, Role from sql.sql import sql_cur, sql_con from messages import track ''' -----Permission offsets----- ''' # Note: each permission has a corresponding 'deny' flag at <code>+1, e.g. # 'deny_interact...
"""Tools for running experiments with Garage.""" import collections import datetime import enum import functools import gc import inspect import json import os import pathlib import subprocess import warnings import weakref import dateutil.tz import dowel from dowel import logger import numpy as np import __main__ as...
import datetime import io import json import logging from django.conf import settings from django.contrib import messages from django.http import Http404 from django.shortcuts import redirect from django.template.loader import render_to_string from django.urls import reverse from django.utils.decorators import method_...
import csv import glob import gensim import nltk import numpy as np from typing import Dict, List, TextIO from sklearn.preprocessing import OrdinalEncoder from sklearn.utils import shuffle from collections import Counter import json # nltk.download('punkt') # When calling the function the user must decide if he/she w...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re import os import json import shutil import tempfile import subprocess import itertools import operator import click __all__ = ['check', 'parse_dep'] # https://github.com/davglass/license-checker#custom-format LICENSE_CHECKER_FORMAT_KEYS = [...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from inferelator_prior.processor.gtf import GTF_GENENAME, GTF_CHROMOSOME, SEQ_START, SEQ_STOP from inferelator_prior.motifs.motif_scan import MotifScan from inferelator_prior.motifs import INFO_COL, MOTIF_COL, LEN_COL, SCAN_SCORE_COL, MOTIF_NAME_COL, SCORE_PER_BASE import pandas as pd import numpy as np import pathos....
# Author: <NAME> # Current Revision: 3.0 # Revision 1 - May 2, 2021 - First draft # Revision 2 - May 4, 2021 - Added Swapfile # Revision 2.1 - May 7, 2021 - Added Tkinter install when Tkinter does not exist in the device # - Added print colors # Revision 2.2 - May 12, 2021 - Added folder template creation for jet...
# Create your views here. import json import logging from os import path from django.core.files.storage import default_storage from django.http import HttpResponse, HttpResponseNotFound, HttpResponseBadRequest, HttpResponseNotAllowed, JsonResponse from kawalc1 import settings from django.views.static import serve as ...
import datetime from starlette.testclient import TestClient import main from ..utilities import sample_data_utility client = TestClient(main.app) def test_read_financing_statement_with_root_object_details(): fin_stmt = sample_data_utility.create_test_financing_statement(type_code='SA', years=5) rv = cli...
""" Kafka Admin client: create, view, alter, delete topics and resources. """ from ..cimpl import (KafkaException, # noqa _AdminClientImpl, NewTopic, NewPartitions, CONFIG_SOURCE_UNKNOWN_CONFIG, CONFIG_SOURCE_DYNAMI...
import numpy as np import torch import logging import sys import os from datetime import datetime import copy import argparse import tensorboardX from tensorboardX import SummaryWriter import shutil import pickle import pandas as pd import joblib import yaml import random def seed_all(seed=None): """Set seed for ...
"Functions specific to GenX outputs" from itertools import product import logging from pathlib import Path from typing import Dict import pandas as pd from powergenome.external_data import ( load_policy_scenarios, load_demand_segments, load_user_genx_settings, ) from powergenome.load_profiles import make_...
# -*- coding: utf-8 -*- """ flask_dialogflow.integrations.actions_on_google ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The integration conversation class for the Actions-on-Google integration. :copyright: (c) 2018 ONSEI GmbH :license: Proprietary """ import json from datetime import datetime, tim...
"""Module for constructing RNN Cells.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import math from tensorflow.contrib.compiler import jit from tensorflow.contrib.layers.python.layers import layers from tensorflow.contrib.rnn.python...
''' Module containing functions for managing cache structures .. autosummary:: :nosignatures: cached_property cached_method hash_mutable hash_readable make_serializer make_unserializer DictFiniteCapacity SerializedDict .. codeauthor:: <NAME> <<EMAIL>> ''' from __future__ import division ...
import sys import os import argparse import random from config import device, modify_K from util import * from prednet_mo import PredNetMO from calc import * from spo import getopt_spo from torch.optim import Adam, SGD, RMSprop, Adagrad, Adadelta, Adamax import torch.nn as nn from tqdm import tqdm from synthesize impor...
#!/usr/bin/env python ''' This QR detection algorithm is intended to be used in the ROS environment on UTD's autonomous vehicle project, project Como. The project is helmed by students <NAME> and <NAME> under Dr. <NAME>. This particular script subscribes to a ROS node containing an Image. The QR code is detected with...
#encoding: utf-8 """ feedback.py -- Feedback figure showing phase-code retrieval due to single cues Created by <NAME> on 2010-10-12. Copyright (c) 2009-2011 Johns Hopkins University. All rights reserved. This software is provided AS IS under the terms of the Open Source MIT License. See http://www.opensource.org/li...
''' File taken from <NAME>'s github, 2020-12-9. Credit for original development goes to <NAME>. Modifications made by <NAME>. ''' import numpy as np import math import pickle from scipy.io import readsav def get_sigma(oom,nlev): sigma=np.empty([nlev])*0.0 if oom==0: stp=1.0/(nlev+1.) sigma[nl...
from __future__ import unicode_literals import glob import json import os import re import sys import time import traceback from builtins import open from time import sleep from tqdm import tqdm from . import secret from .browser import Browser from .exceptions import RetryException from .fetch import fetch_caption ...
# -*- coding: utf-8 -*- ### Insert Current Path import os, sys, inspect cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0])) cmd_folder+="/" if cmd_folder not in sys.path: sys.path.insert(0, cmd_folder) ### from PIL import Image import skimage.io import matplotl...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import io import json import os import shutil import numpy as np from PIL import Image import tensorflow as tf tf1 = tf.compat.v1 __metaclass__ = type DECODERS = { 'png': {'decoder': tf1.image.decode_pn...
import multiprocessing as mp from pathlib import Path import numpy as np import pyregion import yaml from astropy.io import fits from astropy.wcs import WCS from numpy.core.defchararray import array from scipy.stats import sem import src.calculate_magnetic_fields import src.helper as helper import src.math_functions ...
""" geodata.py: contains functions to process geodata @author: <NAME>, <NAME> """ import os import osr import glob import gdal import numpy as np import pandas as pd import rasterio from rasterio.plot import show import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib import colors import matplotlib.p...
# Copyright 2021-2022 NVIDIA Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
""" pdb_eda multiple structure analysis mode command-line interface Analyzes multiple pdb entries. Usage: pdb_eda multiple -h | --help pdb_eda multiple <pdbid-file> <out-result-file> [--params=<params-file>] [--out-format=<format>] [--testing] [--time-out=<seconds>] [--silent] pdb_eda multiple <in-result...
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 (at your option) any later version. # # This program is distrib...
# vim: expandtab:ts=4:sw=4 from __future__ import absolute_import import numpy as np from sklearn.utils.linear_assignment_ import linear_assignment import EKF import pdb from mbest_ilp import new_m_best_sol from multiprocessing import Pool from functools import partial #from mbest_ilp import m_best_sol as new_m_best_so...
from __future__ import annotations import logging import operator import sys from abc import ABC, abstractmethod from functools import reduce from itertools import zip_longest from pathlib import Path from typing import Optional, Union import freqtrade.vendor.qtpylib.indicators as qta from freqtrade.strategy import C...
#!/usr/bin/env python from __future__ import print_function import os from os.path import splitext, join, isfile, isdir, basename import argparse import numpy as np # from scipy import misc, ndimage import tensorflow.keras.backend as K from tensorflow.keras.models import model_from_json, load_model import tensorflow as...
# -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.6.0 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- #...
from collections import OrderedDict import torch from torch import nn import torch.nn.functional as F from torchvision.ops import MultiScaleRoIAlign from torchvision.ops import boxes as box_ops from lib.misc.rpn import AnchorGenerator, RPNHead, RegionProposalNetwork from lib.misc.transform import GeneralizedRCNNTrans...
#!/usr/bin/env python """This module accesses several airtable 'views' that contain records that need some additional processing.""" import re import time import requests from bs4 import BeautifulSoup from cloudinary import uploader from common import airtab_intakes as airtab from common import cloudinary, dc, wrap_...
import os import sys import numpy as np import statistics as stats from astropy.io import fits from sklearn.neighbors import NearestNeighbors from matplotlib.collections import PatchCollection import matplotlib.pyplot as plt import matplotlib as mpl def plot_Bins(Bins,x_min,x_max,y_min,y_max,StN_Target,fil...
import os import matplotlib.widgets as widgets import matplotlib.pyplot as plt import numpy as np import easygui import shutil from PIL import Image from tkinter import Tk, filedialog from Utility.AnalyzeOutputUI import setupOptionsUI def longestContinuousLengthPerLine(whitePixelsDict): longestContinuousLengthPer...
#!/usr/bin/python # Copyright (C) 2012 Ion Torrent Systems, Inc. All Rights Reserved __version__ = filter(str.isdigit, "$Revision$") import os import sys import ConfigParser import StringIO import datetime import shutil import socket import subprocess import time import traceback import json import ion sys.path.appe...
from osgeo import gdal import math import matplotlib.pyplot as plt import numpy as np import os from osgeo import gdal_array import pandas as pd import uuid import warnings from .pipesegment import PipeSegment, LoadSegment, MergeSegment class Image: def __init__(self, data, name='image', metadata={}): se...
# schema.py # Copyright (C) 2012 the ColanderAlchemy authors and contributors # <see AUTHORS file> # # This module is part of ColanderAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import logging import itertools import colander from colander import (Mapping, ...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2015-2018 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Licen...
""" Copyright (c) 2020, salesforce.com, inc. All rights reserved. SPDX-License-Identifier: BSD-3-Clause For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause BRIDGE Text-to-SQL model (Lin et. al. 2020). Highlights: 1. BRIDGE is a Seeq2Seq fram...
import collections import datetime import functools import getpass import gzip import os import psutil import re import shutil import stat import tarfile import time from functools import partial import click from . import artefact from . import datomic from . import log from . import notifications from . import pseu...
import anndata import pandas as pd import xarray as xr import numpy as np from pybedtools import BedTool import dask import re import warnings import pathlib import glob from .utilities import highly_variable_methylation_feature, calculate_posterior_mc_frac from ..plot.qc_plots import cutoff_vs_cell_remain, plot_disper...
# pytorchを使ったVAEの実装 # ae_torchとは使用方法が異なる. その内統一したい # class VAEについて, 余分に思えるメソッドがあるがこれは継承することを考慮して書いている import numpy as np import os import matplotlib.pyplot as plt import json import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright © 2018 <NAME> """ Container class for optical usage information .. Created on Thu Jan 25 11:01:04 2018 .. codeauthor: <NAME> """ import math import numpy as np from rayoptics.parax.firstorder import compute_first_order, list_parax_trace from rayoptics.raytr...
import importlib import logging import os import random import numpy as np from glob import glob from colorama import Style, Fore from profane.config_option import ConfigOption from profane.exceptions import PipelineConstructionError, InvalidConfigError, InvalidModuleError from profane.frozendict import FrozenDict im...
#https://github.com/arita37/mlmodels/blob/dev/mlmodels/model_gluon/gluonts_model.py # -*- coding: utf-8 -*- #### New version new = True """ Advanded GlutonTS models """ import os, copy import pandas as pd, numpy as np import importlib import math import matplotlib.pyplot as plt from pathlib import Path import jso...
# -*- coding: utf-8 -*- import os import json from collections import OrderedDict import itertools import requests from datetime import date from io import StringIO import django_rq import pysolr from django.core.management.base import BaseCommand, CommandError from django.core.mail import EmailMultiAlternatives fr...
"""Utility functions for ray computation.""" import math import numpy as np from scipy.spatial.transform import Rotation as R import box_utils import torch def apply_batched_transformations(inputs, transformations): """Batched transformation of inputs. Args: inputs: List of [R, S, 3] transfor...
from gmspython import * from Production import pr_static import gams_production class inv_dynamic(gmspython): def __init__(self,nt=None,pickle_path=None,work_folder=None,gs_v='gs_v1',pw='pricewedge',gs_vals={},kwargs_ns={},kwargs_st = {},**kwargs_gs): databases = None if nt is None else [nt.database.copy()] super...
#!/usr/bin/env python3 """ preprocess.py Authors: <NAME>, <NAME> Wrapper functions for preprocessing idats and soft files, and functions to prepare data and valid sheet files for R analysis. Prepares SOFT data for by-GSM input to MetaSRA-pipeline, and runs the pipeline. Functions: ...
''' Warning: this module requires Python 3.2 or higher This is a set of classes to represent what I have most commonly needed when working on dozens (eukaryotic) or hundreds (prokaryotic) of annotation projects. If you have other attributes that you'd like to see supported, please add an 'issue' on the biocode GitHub...
import jax.numpy as jnp from jax import grad, vmap, hessian from jax.config import config config.update("jax_enable_x64", True) # numpy import numpy as onp from numpy import random import argparse import logging import datetime from time import time import os # solving -grad(a*grad u) + alpha u^m = f def get_parse...
"""channelmgnt.py - Sopel Channel Management Plugin.""" import re import time from MirahezeBots_jsonparser import jsonparser as jp from sopel import formatting from sopel.config.types import StaticSection, ValidatedAttribute from sopel.plugin import ( OP, commands, event, example, priority, require_admin, requir...
#!/usr/bin/env python3 import argparse import array import asyncio as aio import base64 import itertools import logging import random import statistics from abc import ABCMeta, abstractmethod from asyncio import DatagramTransport, Lock, StreamReader, StreamWriter, Task from types import TracebackType from typing import...
#!/usr/bin/env python3 import sys import os import re import json import merger import datetime import pathlib class Object: pass class GrowingList( list ): def __getitem__( self, index ): if index >= len(self): self.extend( [0] * ( index + 1 - len( self ) ) ) return list.__getite...
from typing import Optional, AsyncGenerator import mimetypes import shutil import json from stat import S_ISDIR from pathlib import Path import aiofiles from aiofiles.os import stat as aio_stat from asgi_webdav.constants import ( DAVPath, DAVDepth, DAVPropertyIdentity, DAVPropertyPatches, DAVProp...
############################################################################## # Copyright 2017-2018 Rigetti Computing # # 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...
import argparse import datetime as dt import gzip import os import pickle from random import shuffle import sys from typing import IO, List, Optional, Tuple, cast import colorama from joblib import Parallel, delayed import numpy as np from numpy.linalg import inv, lstsq, solve import pandas as pd from phillips_ouliari...
# -*- coding: utf-8 -*- """ .. _ex_comp: Example: Comparison to other methods ======================================== We are training and testing both MRC and CMRC methods with a variety of different settings and comparing their performance both error-wise and time-wise to other usual classification methods. We will...
from threading import Thread from itertools import chain from socket import * from datetime import datetime from time import sleep, time, mktime import codecs import uuid import requests import hashlib import random import struct import base64 import re import os import sys requests.packages.urllib3.disable_warnings()...
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from net.utils.graph import Graph class Model(nn.Module): def __init__(self, in_channels, num_class, graph_args, edge_importance_weighting, **kwargs): super().__init__() self....
# build CNN model import os import sys import datetime import logging import logging.handlers as handlers import json import numpy as np import tensorflow as tf physical_devices = tf.config.list_physical_devices('GPU') tf.config.experimental.set_memory_growth(physical_devices[0], enable=True) tf.keras.backend.set_float...
"""Rotation-based Outlier Detector (ROD)""" # Author: <NAME> <<EMAIL>> # License: BSD 2 clause from __future__ import division, print_function import multiprocessing from itertools import combinations as com from multiprocessing import Pool import numba import numpy as np from sklearn.preprocessing import MinMaxScaler...
# Python implementation of the C4.5 Algorithm # Uses Pandas dataFrames for managing the dataset # and can be run by running the main in this file ''' based on: https://github.com/ddivad195/PyC4.5 no ''' import pandas as pd import numpy as np import random as rnd import Node import InputOutput as rg from time ...
from collections import defaultdict import inspect import warnings from dataclasses import dataclass, field, fields from typing import Callable, List, Dict, Union import re import json import os import numpy as np from sklearn.metrics import accuracy_score, precision_recall_fscore_support from torch import negative f...
import os import time import subprocess import numpy as np import fitsio from pyrecon.multigrid import OriginalMultiGridReconstruction, MultiGridReconstruction from pyrecon.utils import distance, MemoryMonitor def get_random_catalog(size=100000, boxsize=1000., seed=None): rng = np.random.RandomState(seed=seed) ...
# importing packages import math import numpy as np import pandas as pd import scipy.stats as stats import sklearn import imblearn import matplotlib.pyplot as plt import seaborn as sns plt.style.use('ggplot') from imblearn.over_sampling import RandomOverSampler from sklearn.model_selection import train_test_split from...
""" Class for interfacing with the Primesense Carmine RGBD sensor Author: <NAME> """ import copy import logging import numpy as np import os from .constants import MM_TO_METERS, INTR_EXTENSION try: from primesense import openni2 except: logging.warning('Unable to import openni2 driver. Python-only Primesense d...
#!/usr/bin/env python # -*- coding: utf-8 -*- import pandas as pd from datetime import datetime, timedelta import numpy as np from scipy.stats import pearsonr import matplotlib.font_manager as fm import netCDF4 as nc from netCDF4 import Dataset import os from pyproj import Proj import ast #----------------------------...
import numpy as np import matplotlib.pyplot as plt class Gridworld(): def __init__(self, width, height, start): # start --> tuple of integers defining agent's start position self.width = width self.height = height # the coodinates of the start position self.i = start[0] self.j = start[1] def set(...
# Copyright (C) 2017 <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 3 of the License, or # (at your option) any later version. # # This program is distribute...