text
stringlengths
8.04k
46.5k
from collections import OrderedDict import numpy as np import torch import torch.optim as optim from torch import nn as nn import math import rlkit.torch.pytorch_util as ptu from rlkit.core.eval_util import create_stats_ordered_dict from rlkit.core.tool_rl_algorithm import MetaRLAlgorithm from pytorch3d.transforms im...
# django-adv-cache-tag / Copyright Stephane "Twidi" Angel <<EMAIL>> / MIT License import hashlib import logging import pickle import re import zlib from django import VERSION as django_version from django.conf import settings from django.utils.encoding import smart_str, force_bytes from django.utils.http import urlqu...
#!/usr/bin/env python import argparse import json import logging import os import shutil import threading import boto.dynamodb2.layer1 import datetime import errno import sys import time import re from boto.dynamodb2.layer1 import DynamoDBConnection JSON_INDENT = 2 AWS_SLEEP_INTERVAL = 10 # seconds LOCAL_SLEEP_INTERV...
""" Lunch Money - Transactions https://lunchmoney.dev/#transactions """ import datetime from enum import Enum import logging from typing import Any, Dict, List, Optional, Union from pydantic import BaseModel, Field from lunchable import LunchMoneyError from lunchable._config import APIConfig from lunchable.models._...
import torch import random import numpy as np import numbers import OpenEXR, Imath from PIL import Image # PyTorch likes PIL instead of cv2 import cv2 import imgaug as ia import imgaug.augmenters as iaa import utils.seg_utils as seg_utils import constants ##### Useful Utilities ##### def exr_loader(exr_path, ndim=3)...
from collections import deque class Counter: def __init__(self, n): self.value = n def __iadd__(self, n): self.value += n return self def __imul__(self, n): self.value *= n return self def __str__(self): return str(self.value) class Constr: pass class Conj(Constr): def __init_...
# im='Calib-LOAO-NGC3367-20131023-123229-R-60.fits' ''' seconfigdir ='/data7/cschoi/code/cspy/sex.config/' seconfig ='se1.sex' separam ='se1.param' separam_noPSF = 'se1_noPSF.param' growthparam = 'growth.param' seconv ='default.conv' sennw ='default.nnw' DETECT_MINAREA = str(5) DETECT_THRESH = str(3)...
# Importing necessary package import glob import os import time import json import keras from keras import * import keras.backend as K import numpy as np import pandas as pd import sklearn from sklearn.model_selection import train_test_split def read_file(filename, X_var, Y_var): """ The function takes name o...
import sys, os, re import glob import numpy as np import json import csv from pkg_resources import resource_filename from astropy.table import Table, vstack import fitsio import bokeh.plotting as bk from bokeh.layouts import gridplot, column, row from bokeh.models import TapTool as TapTool from bokeh.models import Ope...
#!/usr/bin/python # -*- coding: utf-8 -*- """ graph_reader.py: Reads graph datasets. Usage: """ from .logg import get_logger import numpy as np import networkx as nx import random import argparse from rdkit import Chem from rdkit.Chem import ChemicalFeatures from rdkit import RDConfig import os from os import li...
# # Copyright (c) 2013-2014, PagerDuty, Inc. <<EMAIL>> # 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 lis...
import sys import threading from typing import Any, Tuple import warnings with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=FutureWarning) import h5py # import h5py #put this back in after the h5py package has a new update on pip. See <https://github.com/h5py/h5py/issues/995> import m...
# The MIT License # # Copyright (c) 2008 <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 use, copy, modify, merg...
import os from typing import Tuple, Union import numpy as np from scipy.spatial import ConvexHull import scipy.ndimage as ndi from skimage import filters, exposure, measure, morphology, transform from skimage.feature import peak_local_max from skimage.segmentation import watershed from skimage.util import img...
# -*- coding: utf-8 -*- from . import data_simulator as ds from . import space_updater as su from . import models, utils, cosmic_params, plotter, evaluate from decimal import Decimal import numpy as np import torch import time #%% ANN class ANN(plotter.Plotters): """Estimating (cosmological) parameters with Arti...
#!/usr/bin/env python # -*- coding: utf-8 -*- # lm.py """ A python implementation of Levenberg–Marquardt. exposes a drop in replacement for scipy.curve_fit and allows the user to fit their function by maximizing the maximum likelihood for poisson deviates rather than for gaussian deviates, requires the jacobian to be ...
import cv2 import traceback import imagehash import numpy as np from matplotlib import pyplot as plt from PIL import Image, ImageDraw, ImageFont from .log import logger from .recognize import RecognizeError from ..data.agent import agent_list from ..data.ocr import ocr_error from ..ocr import ocrhandle from .image imp...
# -*- coding: utf-8 -*- """ BSD 3-Clause License Copyright 2021 National Technology & Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights in this software. Redistribution and use in source and binary forms, with or without...
#from re import M #from this import s from random import random import numpy as np import scipy.sparse as sp import torch import pandas as pd import os import sys import pickle import pdb from sklearn import preprocessing import matplotlib.pyplot as plt from torch.utils.data import DataLoader, ConcatDataset from torch...
import os import logging from pathlib import Path import zipfile import numpy as np import pandas as pd from sklearn.model_selection import train_test_split import tensorflow as tf import tensorflow_federated as tff from tensorflow_federated.python.simulation import hdf5_client_data from source.constants import ROOT_LO...
import argparse import torch import numpy as np import time from matplotlib import cm import matplotlib as mp try: mp.use("Qt5Agg") except: pass mp.rc('text', usetex=True) mp.rcParams['text.latex.preamble'] = [r"\usepackage{amsmath}"] import matplotlib.pyplot as plt import matplotlib.patches as mpatches from deep_di...
# # Copyright 2019 Xilinx Inc. # # 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 writi...
import warnings from abc import ABCMeta, abstractmethod import numpy as np # FIXME from joblib import Parallel, delayed from sklearn.base import clone, is_classifier from sklearn.exceptions import ConvergenceWarning from sklearn.linear_model._base import SparseCoefMixin from sklearn.linear_model._sgd_fast import ( #...
import argparse import collections import csv from dataclasses import dataclass, field import functools import itertools import sys from typing import Any, Callable, cast, Dict, Iterable, Iterator, Optional, Sequence, TextIO, Tuple from .workload import Access, BytesRate, Task from .workload.models.pags import ( buil...
import torch from torch import nn from torch.autograd import Variable from modelVQContext import GRASSDecoder from draw3dOBB import showGenshape from chairDataset import ChairDataset import util from torchfoldext import FoldExt from modelVQContext import GRASSMerge from chairDataset import Tree import math f...
'''In this file, we write an unsupervised domain adaptation algorithm to decrease the error of estimating the foot placements of target subject''' from __future__ import print_function import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import numpy as np import time import o...
# -*- coding: utf-8 -*- # Copyright (c) 2020, <NAME> and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document # from erpnext.setup.utils import get_exchange_rate from frappe.utils import getdate, now_datetime, no...
from pdfminer.psparser import literal_name, LIT, PSLiteral from pdfminer.pdftypes import list_value, dict_value, stream_value, int_value, num_value, resolve1 from pdfminer.latin_enc import ENCODING from pdfminer.cmapdb import CMapDB, CMapParser, FileUnicodeMap, IdentityCMap import struct from fontTools import ttLib, ...
# -*- coding: utf-8 -*- # # Copyright 2018 Dynatrace 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
""" Copyright (c) 2019 Microsoft Corporation. All rights reserved. MIT License 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 ...
import argparse as ap import numpy as np import cv2 import matplotlib from matplotlib import pyplot as plt import scipy as sp from scipy.optimize import leastsq matplotlib.use("Agg") # *** COMMAND LINE INTERFACE SETUP *** # initial message for program msg = 'This program creates a synthetic .avi movie for use with D...
"""Add RunModel Revision ID: a5c06aa9ef30 Revises: <PASSWORD> Create Date: 2021-03-11 17:14:26.240507 """ import enum from collections import defaultdict from datetime import datetime from typing import TYPE_CHECKING import sqlalchemy as sa from alembic import op from sqlalchemy import ( Boolean, Column, ...
import math import itertools import random from abc import abstractmethod from collections import defaultdict from decimal import Decimal from functools import reduce import GPy import numpy as np from mass_spec_utils.data_import.mzmine import PickedBox from mass_spec_utils.library_matching.spectral_scoring_functions ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import time import heapq import signal import socket import fnmatch import asyncio import logging from typing import Any from typing import Set from typing import Dict from typing import List from typing import Tuple from typing import Union from typing import Callable f...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' This module simulates a sailboat with 6 degrees of freedom. ''' ################################################################################################### # Standard import from sys import argv from math import pi, sin, cos, atan, atan2, sqrt,...
# Copyright (c) 2017 <NAME> # Copyright (c) 2018 <NAME> # Copyright (c) 2018 <NAME> # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) import ast import re import phylanx import inspect from phylanx.exceptions import ...
""" SQL Server LocalDB instance management for Python. WINDOWS ONLY! This module provides a wrapper for the Windows command line application SQLLocalDB.exe. This allows you to manage LocalDB instances on your computer. Classes: CmdExecutor: Interface to the Windows sqllocaldb.exe command line tool. Do ...
import os, glob, gc, time, yaml, shutil, random import addict import argparse from collections import defaultdict from tqdm import tqdm import numpy as np import pandas as pd from sklearn.metrics import accuracy_score, roc_auc_score from sklearn.preprocessing import StandardScaler, LabelEncoder, QuantileTransformer...
"""This module enables nucleus instance segmentation.""" import uuid from typing import Callable, List, Union # replace with the sql database once the PR in place import joblib import numpy as np import torch import tqdm from shapely.geometry import box as shapely_box from shapely.strtree import STRtree from tiatool...
#!/usr/bin/env python # -*- coding: utf-8 -* """UdPyBlog Tests""" from webtest import TestApp import unittest from main import app from google.appengine.ext import testbed from google.appengine.api import memcache, apiproxy_stub_map, datastore_file_stub from google.appengine.api.app_identity import app_identity_stub ...
import numpy as np from pymatgen.core import Element from pymatgen.io.cif import CifParser from itertools import chain from warnings import warn class Centerings(object): def __init__(self, centering='P', primitive=False): self.centering = centering conventional_transformations = {'I': np.array([[...
# -*- coding: utf-8 -*- from __future__ import print_function import os import imp import traceback import sys import optparse import time import itertools import subprocess PY3 = (sys.version_info[0] == 3) if PY3: xrange = range # note: python 3 do not have xrange from .configurationmanager import configmgr fro...
import re from abc import ABCMeta, abstractmethod from copy import copy from itertools import chain from collections import defaultdict, OrderedDict import numpy as np from .errors import Error, DtypeError, MissingError, MissingDataType, ShapeError, IllegalLinkError, IncorrectDataType from .errors import ExpectedArra...
""" 2019 (c) piteren some encoders """ from ptools.neuralmess.get_tf import tf from ptools.neuralmess.base_elements import my_initializer, list_of_layers from ptools.neuralmess.layers import zeroes, lay_dense, lay_conv1D, attn, tf_drop # TODO: probably in tf 1.15.2 histogram 'family=' should be replaced with ...
import streamlit as st import os import pandas as pd import numpy as np import datetime import plotly.express as px import plotly as plty import seaborn as sns import country_converter as coco from bokeh.io import output_file, show, output_notebook, save from bokeh.plotting import figure from bokeh.models import Colum...
""" This file implements the Job class for pegasus-monitord. """ ## # Copyright 2007-2012 University Of Southern California # # 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://ww...
import codecs import numpy as np import copy import time import random 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 import operator # operator模块输出一系列对应Python内部操作符的函数 entities2id = {} relat...
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import time import datetime import json from frappe.model.document import Document from frappe.utils import flt, comma_or,...
import os import re from collections import OrderedDict import nipype.interfaces.ants as ants import nipype.interfaces.fsl as fsl import nipype.interfaces.utility as util import nipype.pipeline.engine as pe from nipype.interfaces import afni from CPAC.nuisance.utils.compcor import calc_compcor_components from CPAC.nu...
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 """ Mini Pyro --------- This file contains a minimal implementation of the Pyro Probabilistic Programming Language. The API (method signatures, etc.) match that of the full implementation as closely as possible. This file is independe...
"""Support for switches which integrates with other components.""" import logging import homeassistant.helpers.config_validation as cv import homeassistant.util.dt as dt_util import voluptuous as vol from homeassistant.components.media_player import ( ENTITY_ID_FORMAT, PLATFORM_SCHEMA, MediaPlayerEntity, )...
from django import template from ib.models import Post import datetime from os.path import split, join, splitext from django.db.models import Count, Case, When, Max from django.db.models import Q from django.core.cache import cache from pytz import timezone tz = timezone('America/Sao_Paulo') def post_made_in_last_x...
#!/usr/bin/python3 # # Copyright (C) 2011 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright notice, # this list o...
""" This file contains routines necessary to create input files for the ptm simulation. See in-line comments for the description of various parameters. Usage: The simplest case is used to generate a single particle drift trace for a pre-defined test: import ptm_input p = ptm_input.ptm_input_creator() ...
"""This module creaes the data for plotting used by plot.py. The different methods return the respective data and information for plotting such as axes labels, titles, additional info which may be shown on hover in the plot encapsulated in a dictionary. """ import numpy as np import logging import warnings from paila...
# -*- mode: python; coding: utf-8 -*- # Copyright 2012-2014 <NAME> <<EMAIL>> and collaborators. # Licensed under the MIT License. """pwkit.ndshow_gtk2 - visualize data arrays with the Gtk+2 toolkit. Functions: view - Show a GUI visualizing a 2D array. cycle - Show a GUI cycling through planes of a 3D array. ...
#! /usr/bin/env/ python # _*_ coding:utf-8 _*_ import re import os import sys import copy import itertools import subprocess def isParenthese(ch): if( ch=='(' or ch==')' ): return True else: return False def matchRNAStructure( RNAStructure ): RNALen = len(RNAStructure) #first define ...
# -*- coding: utf-8 -*- """ Created on Wed Nov 29 14:51:03 2017 @author: felipenanini """ import sys from PyQt5.QtWidgets import (QLabel, QWidget, QVBoxLayout, QHBoxLayout, QSplashScreen, QGridLayout, QComboBox, QGroupBox, QPushButton, QApplication, QSlider, QMainWindow, qApp, QL...
#!/bin/python3 class KPOINT: x = y = z = w = 0 bands = [] def Print(self): print(self.x,self.y,self.z,self.w) for i in range(len(self.bands)): print(i+1,"\t",self.bands[i]) def __init__(self): self.x = self.y = self.z = 0 self.bands = [] def Coord(self): a = [self.x,self.y,self.z,se...
# yuzu_ism.py # Author: <NAME> <<EMAIL>> """ This code includes the functions and utilities for the compressed sensing ISM approach as well as the precomputation step. """ import time import numpy import torch from .models import Flatten from .models import Unsqueeze from .utils import safe_to_device from .utils im...
import os import sys import random import time import math import torchvision from torch import optim import io from PIL import Image import visdom vis = visdom.Visdom() import matplotlib.ticker as ticker import socket hostname = socket.gethostname() from src.python.pssm2go_model import * from src.python.basel...
#!/usr/bin/env python2 # -*- coding: UTF-8 -*- # colorizer.py is part of kanji-colorize which makes KanjiVG data # into colored stroke order diagrams # # Copyright 2012 <NAME> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
from __future__ import annotations from collections import defaultdict, namedtuple from django.contrib.auth.models import AbstractUser, AnonymousUser from django.db.models.base import Model from django.db.models.deletion import CASCADE, SET_DEFAULT, SET_NULL from django.db.models.expressions import Col from django.db...
#!/usr/bin/python """ Compares different classifier models that predict whether or not a peak will occur within 60 minutes. This makes it easier to train regressor models for calculating the specific time at which the peak will come """ import argparse from datetime import date, datetime, time, timedelta from matplotl...
# Copyright (C) 2010, 2011 <NAME> (<EMAIL>) and contributors # # This module is part of GitDB and is released under # the New BSD License: http://www.opensource.org/licenses/bsd-license.php """Contains basic c-functions which usually contain performance critical code Keeping this code separate from the beginning makes ...
import argparse import os import random import shutil import time import warnings import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.distributed as dist import torch.optim import torch.utils.data import torch.utils.data.distributed import torchvision.transform...
import numpy as np import tensorflow as tf from tensorflow.keras.optimizers import Adam, SGD import tensorflow_probability as tfp from tensorflow_probability import distributions as tfd tf.keras.backend.set_floatx('float64') def sample_gumbel(shape, eps=1e-20): U = tf.random.uniform(shape,minval=0,maxval=1) #...
#################################################################################################### # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root for license information. ####################################################################...
#---------------------------------------------------------------------------- # Do NOT modify or remove this copyright # # Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License...
# -*- coding: utf8 -*- """ ====================================== Project Name: NLP File Name: train_and_valid Author: czh Create Date: 2021/9/28 -------------------------------------- Change Activity: ====================================== """ import os import re from glob import glob import json ...
from enum import IntEnum from typing import Callable, cast, Optional import numpy as np import moderngl from ..audio import AudioSource from .shaders import SignalVA, GridVA, LineVA, TextureVA # TODO temporary from ..tape.loader import Loader class TriggerEdge(IntEnum): Positive = 0 Negative = 1 class Tr...
#!/usr/bin/env python3 """TS editor""" import sys import struct import argparse # CHUNK_SIZE = 10000 TS_PACKET_SIZE = 188 STREAM_ID_PROGRAM_STREAM_MAP = 0b10111100 STREAM_ID_PRIVATE_STREAM_1 = 0b10111101 STREAM_ID_PADDING_STREAM = 0b10111110 STREAM_ID_PRIVATE_STREAM_2 = 0b10111111 STREAM_ID_AUDIO_STREAM_0 = 0b11000...
from itemmultipliers import equipmentMultipliers as equipMultipliers levelMultiplier = { 'hp': 3, 'sp': 0, 'atk': 2, 'def': 2, 'mag': 2, 'mnd': 2, 'spd': 2 } statOrder = [ 'hp', 'sp', 'tp', 'atk', 'def', 'mag', 'mnd', 'spd', 'eva', 'fir', 'cld', 'wnd', 'ntr', 'mys', 'spi' ] def readAsInteger(f, nbytes): data...
#!/usr/bin/env python # # test_helpers.py - Unit test cases for COT.helpers submodule. # # February 2015, <NAME> # Copyright (c) 2014-2017 the COT project developers. # See the COPYRIGHT.txt file at the top-level directory of this distribution # and at https://github.com/glennmatthews/cot/blob/master/COPYRIGHT.txt. # #...
import torch from torch import nn, optim import torch.nn.functional as F import numpy as np import os import sys import time import shutil import random import pandas as pd from tqdm import tqdm import networkx as nx import torch_geometric import matplotlib.pyplot as plt import argparse import scipy.sparse as sp from t...
''' This script contains functions for running the primary evaluations from the paper ''' import os, sys, csv, time import numpy as np import torch import torch.nn.functional as F from tk3dv.extern import quaternions sys.path.append('.') from .torch_utils import torch_to_numpy from .pcl_viewer import viz_pcl_seq...
""" A set of tests that demonstrate Array structure support """ import logging import cocotb from cocotb.clock import Clock from cocotb.handle import ( ConstantObject, HierarchyArrayObject, HierarchyObject, ModifiableObject, NonHierarchyIndexableObject, ) from cocotb.triggers import Timer SIM_NAM...
''' datecreated: 191123 objective: use random forest classifier to ID flowers in iris dataset based on 4 parameters. for more information see iris_nn.py. NOTES: * there's a lot of non-matrix operations to do, so will need to break things down in pieces * seems like some use ordered dicts to generate random for...
"""Module containing common methods for properties""" import warnings import resqpy.property version = '24th November 2021' import logging log = logging.getLogger(__name__) import numpy as np import resqpy.olio.uuid as bu import resqpy.olio.xml_et as rqet import resqpy.weights_and_measures as bwam #from .property...
################################################################################ # Filename: Modularity.py # # License: Public Domain # # Author: <NAME> # # Descrip...
import numpy as np import matplotlib.pyplot as plt #import mpl_toolkits.mplot3d.axes3d as p3 from mpl_toolkits.mplot3d import Axes3D import matplotlib.animation as animation from matplotlib import cm import dill import pickle from scipy.linalg import expm from numpy.linalg import norm from scipy.optimize impo...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * import os import sys import shutil import tempfile import time from datetime import datetime, timedelta from ferenda.compat import unittest #SUT from ferenda imp...
# dependencys python-piexif(ARCH-Linux AUR) # python-pymediainfo(ARCH-Linux AUR) import sys import piexif import shutil from pymediainfo import MediaInfo from datetime import datetime import os import platform print(piexif.__file__) class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' ...
import numpy as np import sys import copy from aux.aux import * def from_equation_to_feature(eq): return eq[3]*np.asarray([[eq[0]], [eq[1]], [eq[2]]]) def from_feature_to_equation(Z): d = np.linalg.norm(Z) a = Z[0,0]/d b = Z[1,0]/d c = Z[2,0]/d return [a,b,c,d] def from_any_to_feature(Z): ...
""" Copyright 2009 <NAME> Additional contributors: <NAME> LaTeX2WP version 0.6.2 This file is part of LaTeX2WP, a program that converts a LaTeX document into a format that is ready to be copied and pasted into WordPress. You are free to redistribute and/or modify LaTeX2WP under the terms of the GNU General ...
""" CGP stands for Cartesian Genetic Programming, and is a network that represents a function. It is defined by a gene and an operation table. The operation table is a list of mathematical operations (for example [+, -, *, cos]). The gene consists of n nodes and an ouput node. Each node, except for the output, consist...
""" Created by <NAME> 2022 Github: https://github.com/AlexsanderRST """ from math import sin from urllib import request, error from os import remove as os_remove from webbrowser import open as open_url from pygame.locals import * import pygame import threading version = '2.3.1' pygame.init() pygame.font.init() # f...
# -*- coding: utf-8 -*- """This file includes all required openEO response schemas """ from typing import List, Tuple, Optional # from flask import make_response # import re # from datetime import datetime from openeo_grass_gis_driver.models.schema_base import JsonableObject, EoLink # from openeo_grass_gis_driver.model...
""" Misc Utility functions """ import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable import itertools import torch import torch.nn.functional as F import copy import math import tqdm import os import logging import datetime import numpy as np im...
''' --------------------------------------------------------------------------- Copyright (c) 1998-2008, <NAME>, Worcester, UK. All rights reserved. LICENSE TERMS The redistribution and use of this software (with or without changes) is allowed without the payment of fees or royalties provided that: 1. source code d...
from kivy.app import App from kivy.uix.widget import Widget from kivy.uix.label import Label from kivy.graphics import Color, Ellipse, Line, Triangle, Rectangle, Point from kivy.clock import Clock from kivy.config import Config from orbits import PhysicsObject, RK4Orbit from Vector import Vector3 import time import thr...
# (c) 2020 <NAME>; redistribution granted per MIT License # (http://github.com/swork/wsgidav/LICENSE) # Derived from wsgidav, which carries this notice: # (c) 2009-2020 <NAME> and contributors; # see WsgiDAV https://github.com/mar10/wsgidav # Original PyFileServer (c) 2005 <NAME>. # Licensed under the MIT license: # h...
import os import argparse import numpy as np from PIL import Image import random import pickle from collections import defaultdict import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader, ConcatDataset from torch.utils.data.sampler import WeightedRandomSampler from torchvision impo...
"""CBMA methods from the multilevel kernel density analysis (MKDA) family.""" import logging import multiprocessing as mp import numpy as np import pandas as pd from scipy import special from statsmodels.sandbox.stats.multicomp import multipletests from tqdm.auto import tqdm from ... import references from ...due imp...
import copy import inspect import os import sys import threading import traceback from collections import namedtuple, defaultdict from .common import fail, warn from .constopt import ConstantOptBase from .errors import Errors, Warnings, InterpretError from .env import env from .graph import Graph from .ir import Ctx, L...
import logging import numpy as np from tqdm import tqdm logger = logging.getLogger(__name__) from tqdm import tqdm import random import torch from torch.utils.data import Dataset class MultiTaskDataset(Dataset): def __init__( self, examples,label_list, args, tokenizer ): super().__init__() s...
""" This file provide data loading for phase 1 development. We could ground truth scene graph from this file. Need to refactor the graph loading components out. """ import os import sys import pickle import pathlib import json import torch import Constants import numpy as np import torch_geometric import torchtext #...
import re, json, base64 from .utils import _perform_request, format_datetime, format_utc, markdown_table_row, add_user_mapping, is_admin, set_admin_permission from .config import _get_user_id CONF = None class IssueThread: """ Everything related to an issue in GitLab, e.g. the issue itself and subsequent co...
from transformers.backend import keras, K, mask_sequences from keras.layers import * import tensorflow as tf class Layer(keras.layers.Layer): """重定义层,支持mask """ def __init__(self, **kwargs): super(Layer, self).__init__(**kwargs) self.supports_masking = True keras.layers.Layer = Layer c...
#Topology Substation 9-18-23 #!/usr/bin/python from mininet.net import Mininet from mininet.node import Node, Controller, RemoteController, OVSSwitch, OVSKernelSwitch, Host from mininet.cli import CLI from mininet.link import Intf, TCLink from mininet.log import setLogLevel, info from mininet.node import Node,...