text
stringlengths
6.04k
39.5k
# Copyright 2021 Huawei Technologies Co., Ltd # # 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...
#!/usr/bin/python3 # -*- coding: utf8 -*- import re from urllib.parse import unquote import requests from bs4 import BeautifulSoup from insightMedium.model import User, Post, Publication, Tag, Image, OutputFormat, to_dict from insightMedium.constant import ROOT_URL, HTML_PARSER from selenium.webdriver.common.by imp...
from .memoize import Memoize from . import stdops #Needed for travis import random def collect(exp, fn): rv = set() def _collect(exp): if fn(exp): rv.add(exp) return exp exp.walk(_collect) return rv def _replace_one(expr, match, repl): vals = Wild...
import argparse import bpy import gin import numpy as np import os import sys import time import paths, util C = bpy.context D = bpy.data MAX_OBJS = 20 color_ref = None obj_ref = [None for _ in range(MAX_OBJS)] obj_classes = None cached_obj_scale = [None for _ in range(MAX_OBJS)] @gin.configurable('rendering') de...
#!/usr/bin/env python3 import sys, random from PyQt5.QtWidgets import QWidget, QApplication, QPushButton, QGridLayout, \ QLabel, QDialog, QStatusBar, QMainWindow, QButtonGroup from PyQt5.QtGui import QPainter, QColor, QPen, QBrush, QIcon, QImage from PyQt5.QtCore import Qt, QSize from enum import Enum import loggin...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import gzip import hashlib import math import os import requests import shutil import sys import tarfile import time import zipfile from six.moves import urllib def _get_google_confirm_id_token(url, session)...
# Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved. # # 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,...
#!/usr/bin/env python3 """ Utility to list AnomalyDB service resources """ import argparse import json import os import paramiko import sys import subprocess import threading import time from paramiko.client import SSHClient """ ENTER YOUR JUMPBOX IP ADDRESS HERE """ JUMPBOX_IP = "X.X.X.X" args = None aliases = { ...
# Delayed RTAC # standard library imports from copy import deepcopy from dataclasses import dataclass from functools import reduce # third-party imports import pandas import torch from torch.nn.functional import mse_loss # local imports import tmrl.sac from tmrl.drtac_models import Mlp from tmrl.nn import exponentia...
from PySide2.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout, QHBoxLayout,\ QPushButton, QLineEdit, QSizePolicy, QMessageBox, QStyle, QToolBar, QMenu, QWidgetAction from PySide2.QtCore import Qt from PySide2.QtGui import QIcon, QWindow, QPalette from qasync import QEventLoop, QThreadExecutor import threa...
# ****************************************************************************** # Copyright 2017-2019 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apa...
#!/usr/bin/env python # -*- coding: iso-8859-15 -*- ######################## -*- coding: utf-8 -*- """Usage: python ./check_mom_budget.py """ import sys, os import matplotlib.pyplot as plt import numpy as np try: from MITgcmutils import rdmds except: # this hack to make sure that MITgcmutils.rdmds is available...
# -*- coding: utf-8 -*- """ Created on Thu Apr 12 23:00:28 2018 @author: wangshuai """ import urllib import urllib.request as urllib2 import time import http.cookiejar as cookielib import io import os import sys import gzip import lxml.html from selenium import webdriver from opencc import OpenCC import warnings warnin...
''' Elaborato Programmazione di Reti a.a. 2020/2021 <NAME> Matricola: 887714 Traccia 2 ''' #!/bin/env python import sys, signal import http.server import socketserver #new imports import threading #manage the wait witout busy waiting waiting_refre...
#!/usr/bin/env python from OpenGL.GL import * from OpenGL.GLU import * import pygame from pygame.locals import * import serial import re import math import time ser = serial.Serial('/dev/ttyACM1', 115200, timeout=1) ax, ay, az, mx, my, mz, gx, gy, gz = ( 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 1, 1, 1) Mmag = 1 soft_iron ...
import random as r import math #import matplotlib.pyplot as plotter import numpy import scipy from scipy import stats # Rideshare service simulation model that includes rider choice # Author: <NAME> # SOURCES AND DERIVATIONS FROM V2: # In 2019 and 2020, there were 5 million Uber drivers and 18.7 million trips per d...
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 from django.utils.translation import ugettext as _ from django.http import HttpResponse from django.template.loader import render_to_string from datetime import datetime, date, timedelta """Shared report methods. These are for domains that share forms (or have ve...
from tkinter import * from tkinter import filedialog from tkinter import messagebox import rubik import blockdefinitions # root for main window root = Tk(className=" SkeleType") textArea = Text(root, width=100, height=20) textArea.grid(row=0, column=0, sticky=NSEW) scroll = Scrollbar(root) scroll.grid(row=0, column=1,...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' PxUSBm.py (Partition Expansion USB mount) This module is a marriage of code to do partition expansion during the first power on (formerly expandFS.py) and code to monitor USB activity to mount and unmount USB sticks as they are added and removed from USB ports o...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Software dvae-speech Copyright Inria Year 2020 Contact : <EMAIL> License agreement in LICENSE.txt The code in this file is based on: - “A recurrent variational autoencoder for speech enhancement” ICASSP, 2020, <NAME> """ from torch import nn import torch from collec...
import sys sys.path.append('../') from generator.savp_generator import video_generator, discriminator_loader, generator_loader, encoder_loader from generator.savp_generator import discriminator_data, generator_data, encoder_data from models.savp_models import trial_predictor, encoder, generator, build_graph from model...
#!/usr/bin/env python from __future__ import unicode_literals, division, print_function import argparse import functools import hashlib import json import io import os import re import shutil import sys import zlib from sreq_common import OPERATORS, OPERATORS_FUNC try: import text_histogram except ImportError: ...
# # Copyright (c) 2018-2022 <NAME> <<EMAIL>> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIM...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
from __future__ import print_function import argparse import os import random import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data import torchvision.datasets as dset import torchvision.transforms as transforms import torchv...
# Copyright Amazon.com, Inc. or its affiliates. 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...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright(C) 2017-2020 T.WKVER | </MATRIX>. All rights reserved. # code by </MATRIX>@<NAME>(LeaderN) # # dataload.py # Original Author: <NAME>(<EMAIL>/<EMAIL>), 2018-3-10 # # PixivCrawlerIII component # T.WKVER crawler data handler loader for PixivCrawlerIII project #...
from Bio.Alphabet.IUPAC import IUPACAmbiguousDNA from PositionMatrix import PositionMatrix as PM from matplotlib.figure import Figure import matplotlib.pyplot as plt from Bio.Restriction import * import PositionMatrix as pm from Bio.Seq import Seq from Bio import SeqIO from numba import jit import pandas as pd...
#!/usr/bin/env python import os import rospy import tensorflow as tf import time import math from object_detection.utils import label_map_util from object_detection.utils import visualization_utils as vis_util import numpy as np import cv2 import sys from pylibfreenect2 import Freenect2, SyncMultiFrameListener from ...
# import packages required import sys import random import time from datetime import datetime, timedelta # import styles from qtmodernEdited import styles, windows # helper functions from db import * from graphs_bar import * from graphs_pie import * from send_mail import * # pyQt5 widgets from PyQt5....
# Copyright (c) 2020-2021 <NAME> │ # Licensed under the MIT license │ # ───────────────────────────────────────────┘ import sublime_plugin import sublime from json import dump as json_dump from re import match as re_match, sub as re_sub from subprocess import Popen from copy import deepcopy from time im...
#!/usr/bin/env python __all__ = ['sron_colors', 'sron_colours', 'sron_maps'] def ylorbr(x): """ Eq. 1 of sron_colourschemes.pdf """ r = 1.0 - 0.392*(1.0 + erf((x - 0.869)/ 0.255)) g = 1.021 - 0.456*(1.0 + erf((x - 0.527)/ 0.376)) b = 1.0 - 0.493*(1.0 + erf((x - 0.272)/ 0.309)) return r, g, b def ...
""" Code to study the result of sequence experiments, where a randomly chosen cell is repeateadly activated. The main function to post-process simulation results is: compute_sequence_details_batch """ import numpy as np import pandas as pd import scipy.stats as st from pathlib import Path from tqdm.auto import tq...
import logging import os from rucio.common.exception import DataIdentifierNotFound from ..prodtask.models import ProductionDataset, ProductionTask from ..getdatasets.models import TaskProdSys1 from ..settings import dq2client as dq2_settings from rucio.client import Client _logger = logging.getLogger('prodtaskwebu...
import glob import gzip import json import os.path import sys from pathlib import Path from typing import Protocol, List, Union from PySide2.QtCore import Slot, QThreadPool, QObject, Signal, QSize, QUrl, Property from PySide2.QtQuick import QQuickView from PySide2.QtWidgets import QApplication from sqlalchemy import o...
from encodings.utf_8 import encode from enum import auto from re import M from tensorflow.keras import Model from tensorflow.keras.layers import Input, Conv2D, Conv2DTranspose, ReLU, BatchNormalization, Flatten, Dense, Reshape, Activation, Concatenate, Dropout, Multiply from tensorflow.keras import backend as K from te...
import csv import random import re import time from datetime import date, datetime, timedelta from typing import Set, List, Tuple, Sequence, Dict, Any, Generator import itertools import requests from scrapy import Selector from spider_project.asynchronous.qiutan.config import CATCH_LIST, COMPANY_LIST, CSV_FILED, DELA...
from decimal import Decimal from django.http import HttpResponse from django.shortcuts import get_object_or_404 from django.utils import timezone from rest_framework.views import APIView, status from rest_framework.response import Response from rest_framework import viewsets, mixins, decorators, generics from rest_fram...
# Copyright 2021 <NAME> # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software...
import math import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter import scipy.sparse as sp from deeprobust.graph.defense import GraphConvolution import deeprobust.graph.utils as utils import torch.optim as optim from sklearn.metrics.pai...
from type4py.data_loaders import select_data, TripletDataset, load_training_data_per_model from type4py.vectorize import AVAILABLE_TYPES_NUMBER, W2V_VEC_LENGTH from type4py.eval import eval_type_embed from type4py.utils import load_json from type4py import logger, MIN_DATA_POINTS, KNN_TREE_SIZE from torch.utils.data im...
# -*- coding: utf-8 -*- # # Licensed under the terms of the Qwt License # Copyright (c) 2002 <NAME>, for the original C++ code # Copyright (c) 2015 <NAME>, for the Python translation/optimization # (see LICENSE file for more details) """ QwtPainterClass --------------- .. autoclass:: QwtPainterClass :members: """ ...
import socket import time from contextlib import closing as closing_context from .library import libstore from .log import LoggerFactory from .threadmgr import threader from .gossip import gossiper from .kv import kvmgr from .topic import topiker, TOPIC_CONFIGURATION_AUTOMATION from .jsonmgr import jsoner from .util i...
""" test_studio_5.py : Test live streaming, recording and playback in Qt Copyright 2017-2021 <NAME> Authors: <NAME> This file is part of the Valkka Python3 examples library Valkka Python3 examples library is free software: you can redistribute it and/or modify it under the terms of the MIT License. This code is di...
import json from collections import defaultdict from gensim import corpora from gensim.models import TfidfModel from sklearn.manifold import TSNE import matplotlib.pyplot as plt from umap import UMAP from lib2vec.corpus_iterators import CorpusDocumentIterator from lib2vec.corpus_structure import Corpus from lib2vec.v...
# -*- coding: utf-8 -*- """ Created on Thu Feb 18 07:45:38 2021 @author: <NAME> """ import matplotlib.pyplot as plt import matplotlib.patches as patches import numpy as np import os import hashlib import gc import skimage.color import skimage.filters import skimage.io import skimage.viewer import skimage.measure imp...
import numpy as np from extra_data.components import AGIPD1M import dask.array as da import xarray as xr from dask.distributed import Client, progress import warnings import h5py as h5 import bottleneck as bn import pdb class Calibrator: """Calibrate AGIPD dataset""" adu_per_photon = 66 mask = np.ones((...
#!/usr/bin/env python #ADAPTED FROM #https://github.com/bio-ontology-research-group/deepgoplus/blob/master/evaluate_deepgoplus.py import numpy as np import pandas as pd import click as ck from sklearn.metrics import classification_report from sklearn.metrics.pairwise import cosine_similarity import sys from collection...
#!/usr/bin/env python # * coding: utf8 * """ cloudb Usage: cloudb enable extensions cloudb create schema [--schemas=<name>] cloudb create admin-user cloudb create read-only-user cloudb create indexes cloudb drop schema [--schemas=<name>] cloudb import [--missing --dry-run --skip-if-exists] cloudb trim ...
#-----------------------------------------------------------------# #-----------------------------------------------------------------# #-------- Project On Intelligent Time Table Preparation ----------# #---------- Course Title :- Artificial Intelligence --------------# #----------- Course Code :- INT 404 --------...
"""Implementation of the kafkaefd aioload commands for testing latency in Kafka production and consumption under different loads (topic volume and frequency). """ __all__ = ('aioload',) import asyncio import datetime from io import BytesIO import json import logging from pathlib import Path import aiohttp import aio...
# coding=utf-8 # flake8: noqa from itertools import islice from typing import List from oeis import ( abundant, arithmetic, buttered_croissant, catalan, centered_decagonal, centered_dodecagonal, centered_hendecagonal, centered_heptagonal, centered_hexagonal, centered_nonagonal, ...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Main test file Possible candidate environments(Continual action space and continual state space): LunarLanderContinuous-v2 BipedalWalker-v2 BipedalWalkerHardcore-v2 CarRacing-v0 """ import numpy as np import tensorflow as tf import roboschool import gym import sys impor...
""" Solve a potentially over-determined system with uncertainty in the values. Given: A x = y +/- dy Use: s = wsolve(A,y,dy) wsolve uses the singular value decomposition for increased accuracy. Estimates the uncertainty for the solution from the scatter in the data. The returned model object s provides: s.x ...
import os import re from os.path import exists import dash_table from dash import dcc, html from dash.dependencies import ALL, MATCH, Input, Output, State from dash.exceptions import PreventUpdate from bsbetl import app_helpers, g from bsbetl.app import app from bsbetl.app_helpers import init_page_size_input, ov_data...
import discord import asyncio import os from discord.ext import commands import urllib from urllib.request import URLError from urllib.request import HTTPError from urllib.request import urlopen from urllib.request import Request, urlopen from bs4 import BeautifulSoup from urllib.parse import quote import re # Regex fo...
import argparse import numpy as np import os import random import gym import torch import torch.nn.functional as F from torch.optim import Adam from torch.autograd import Variable from learner.state_with_delay import MultiAgentStateWithDelay from learner.replay_buffer import ReplayBuffer from learner.replay_buffer im...
# Copyright 2018 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...
__author__ = 'ikibardin' import os import multiprocessing from typing import List, Dict import numpy as np import pandas as pd import cv2 import skimage.io import torch from torch.utils.data import Dataset import albumentations as A from albumentations.pytorch import ToTensor from power_fist.common_utils import Se...
# tests grabbed from: # https://github.com/tidyverse/dplyr/blob/master/tests/testthat/test-join.r from pandas.core.frame import DataFrame import pytest from pandas.testing import assert_frame_equal from datar.all import * def test_mutating_joins_preserve_row_and_column_order(): df1 = tibble(a=[1,2,3]) df2 = ti...
import os from cs50 import SQL from flask import Flask, flash, jsonify, redirect, render_template, request, session, url_for from flask_session import Session from tempfile import mkdtemp from werkzeug.exceptions import default_exceptions, HTTPException, InternalServerError from werkzeug.security import check_password...
import errno import fcntl import os import signal import subprocess import sys import tempfile import time import mock import unittest2 import testlib from testlib import Popen__terminate import mitogen.parent def wait_for_child(pid, timeout=1.0): deadline = time.time() + timeout while timeout < time.time()...
# # Copyright (c) 2011-2014 The developers of Aqualid project - http://aqualid.googlecode.com # # 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 limitati...
import tensorflow as tf import numpy as np import ast import re from tensorflow import keras import time import os import pickle import io def scaled_dot_product_attention(query, key, value, mask): """Calculate the attention weights. """ matmul_qk = tf.matmul(query, key, transpose_b=True) # scale matmul_q...
import torch import torch.nn as nn import torch.nn.functional as F import math import re def get_str(cls): name = cls.actv.__class__.__name__ _str_act = '{}'.format(name) if name == 'LeakyReLU': _str_act += '{}'.format(cls.actv.negative_slope) if hasattr(cls, 'norm1'): try: ...
import pickle import time from typing import List, Tuple, Optional, Set, Dict, Callable import os from numba import njit, jit import numpy as np import pandas as pd import ruck from ruck.external.deap import select_nsga2 from ruck import * from ruck.external.ray import * from Benchmark import Warehouse from MAPD.To...
import cv2 import dlib import matplotlib.pyplot as plt import numpy as np from scipy.optimize import least_squares glob_neutral_tmp_LM = np.array( [[143, 214], [146, 244], [151, 273], [158, 302], [168, 328], [184, 352], [205, 371], [229, 386], [259, 390], [287, 385], [311, 371], [331, 352], [347, 329], [356, ...
import base64, discord, hashlib, math, os, requests, time, traceback, youtube_dl from discord.utils import get from utils.datautils import config, data, default, discard, save_data, set_client from utils.discordbot import BotClient, emoji_shorthand, send from utils.errors import BotError from utils.logging import log...
from __future__ import annotations from typing import List, Optional, Tuple, cast import numpy as np from ...math.matrix import Matrix from ...common.config import Config from ...geometry.geom_algo import GeomAlgo2D from ...geometry.shape import Capsule, Circle, Edge, Ellipse, Point from ...geometry.shape import Poly...
import math from math import pi, sin, cos import matplotlib.pyplot as plt import numpy as np from .utilities import spot_micro_kinematics as smk from .utilities import transformations d2r = pi/180 r2d = 180/pi class SpotMicroLeg(object): '''Encapsulates a spot micro leg that consists of 3 links and 3 joint angles...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2018 <NAME> <<EMAIL>> # # Distributed under terms of the MIT license. """Run an experiment varying a number of variables.""" import logging import os import shutil import subprocess import sys from collections import ChainMap from itertoo...
# # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. # Copyright (C) 2018-2021 UAVCAN Development Team <uavcan.org> # This software is distributed under the terms of the MIT License. # import datetime import inspect import logging import types import typing import nunavut.lang from ..template...
""" mathEX.py @author: <NAME> @email: <EMAIL> Math-related functions, extensions. """ import numpy as np def change_to_multi_class(label_set, num_of_labels): """ change the input prediction y to array-wise multi_class classifiers. :param label_set:input prediction y, numpy arrays :param num_of_label...
######################################################################################################################## # Module: inference/proposal.py # Description: Proposal mechanisms to extend particles (series of positions/edges/distances) and re-weight # in light of a newly received observation. # #...
# -*- coding: utf-8 -*- """ @author:XuMing(<EMAIL>) @description: 智能标注 """ import os from time import time import cleanlab import numpy as np from cleanlab.pruning import get_noise_indices from scipy.sparse import csr_matrix from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train...
import logging from app.models import Rc, Button, Node, Arduino, Radio from app import db from datetime import datetime class RcHelper: def __init__(self, rc_id = None): self.set(rc_id) def get(self): return self.rc def set(self, rc_id): self.rc = Rc.query.filter_by(id = rc_id).f...
import logging import uuid from abc import ABC, abstractmethod from concurrent.futures import ProcessPoolExecutor from datetime import datetime from functools import partial from pathlib import Path import pandas as pd from dateutil.parser import parse from jade.utils.utils import load_data from opendssdirect._versio...
from gisele.functions import * from shapely.geometry import Point,box from gisele import Steinerman, Spiderman, dijkstra,initialization def routing(Clusters,gisele_dir,case_study,crs,resolution_MV,Roads_option,roads_weight,simplify_road_coef_inside,Rivers_option,line_bc): dir_output = '/Case studies/' + case_study...
# -*- coding: utf-8 -*- """ Created on Wed Apr 11 14:11:26 2018 @author: JHodges """ import subprocess import os import behavePlus as bp import numpy as np import datetime import queryLandFire as qlf import geopandas as gpd from shapely.geometry import Polygon, Point import matplotlib.pyplot as plt import rasterio fr...
import numpy as np import tifffile import subprocess import os import csv from tabulate import tabulate from types import SimpleNamespace from pathlib import Path from itertools import zip_longest from glob import glob from scipy import ndimage from scipy.ndimage import label, zoom from scipy....
"""Type embeddings.""" import logging import os import time import pandas as pd import torch import ujson as json from bootleg import log_rank_0_debug, log_rank_0_info from bootleg.embeddings import EntityEmb from bootleg.layers.helper_modules import PositionAwareAttention from bootleg.utils import data_utils, model...
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tqdm import tqdm_notebook # Local modules from data_loader import load_json, load_npy from preprocessing import img_preprocess, ann_preprocess from preprocessing import resize_arr, split_data, stack_exp from preprocessing import stack_ex...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Interpolation of Amplitude and Phase using the interpolant derived by <NAME>. For details see - https://doi.org/10.1007/s10236-017-1122-8 This new update to algorithm tries to minimize the time of interpolation from a large grid. The previous approach was to build the...
from IPython import embed import numpy as np import random import pymysql import datetime import os def get_password(): if not os.path.exists("./db_password.txt"): return "" with open("./db_password.txt", "r") as file: db_password = file.read() return db_password password = get_password(...
import calendar import copy import datetime import decimal import json import types import uuid from schematics.models import Model from schematics import types as fields from botocore.exceptions import ClientError from . import exceptions from .config import get_config from .log import log_data from .table import g...
#!/usr/bin/python from numpy import savetxt, loadtxt, array from deap import base, creator, tools from scipy import interpolate from pickle import load, dump from os import system, access, remove, path from time import sleep from glob import glob from queue import Queue, Empty from threading import Thread fro...
# //////////////////////////////////////////////////////////////////////////// # // This file is part of NIID-Net. For more information # // see <https://github.com/zju3dv/NIID-Net>. # // If you use this code, please cite the corresponding publications as # // listed on the above website. # // # // Copyright (c) Z...
#!/usr/local/bin/python3 # # Import all necessary libraries # import argparse import json import time from datetime import datetime from datetime import date from datetime import timedelta # # Define some global constants # VERSION= '0.0.3' SECONDS_PER_MINUTE= 60 MINUTES_PER_HOUR= 60 HOURS_PER_DAY= 24 MINUTES_PE...
"""The main Optimiser class.""" import biopharma as bp from biopharma.server.tasks import SoftTimeLimitExceeded from biopharma.specs import Value, Table, in_units from .individual import Individual, Variable from .util import get_item, with_units import numbers import random from enum import Enum import deap.base im...
import os import math import copy import torch import torch.nn.functional as F from torch import nn from stft_core.layers import Scale from stft_core.layers import DFConv2d from stft_core.layers import DeformConv from .inference import make_fcos_stft_postprocessor from .loss import make_fcos_stft_loss_evaluator clas...
# ====================================================================== # Copyright CERFACS (October 2018) # Contributor: <NAME> (<EMAIL>) # # This software is governed by the CeCILL-B license under French law and # abiding by the rules of distribution of free software. You can use, # modify and/or redistribute ...
import numpy as np import torch import os import sys from matplotlib import pyplot as plt import torch.nn as nn from xplain.attr import LayerIntegratedGradients, LayerGradientXActivation import skimage.io import torchvision import pickle import pandas as pd import scipy.interpolate as interpolate from torch.utils.data ...
import numpy as np import MeshFEM, mesh import registration import os import pickle, gzip def load(path): """ load a pickled gzip object """ return pickle.load(gzip.open(path, 'rb')) def save(obj, path): """ save an object to a pickled gzip """ pickle.dump(obj, gzip.open(path, 'wb')) ...
# Why does this file exist, and why not put this in `__main__`? # # You might be tempted to import things from `__main__` later, # but that will cause problems: the code will get executed twice: # # - When you run `python -m aria2p` python will execute # `__main__.py` as a script. That means there won't be any # `a...
import sys import copy from aiida.backends.utils import load_dbenv, is_dbenv_loaded import math if not is_dbenv_loaded(): load_dbenv() from aiida.common.exceptions import InputValidationError,ValidationError, WorkflowInputValidationError from aiida.orm import load_node from aiida.orm.data.upf import get_pseudos_...
from enum import Enum as PyEnum import glob import os import yaml from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO from . import expressions from . import logger log = logger.getStatusLogger("Kaitai") KSY_DIR = os.path.join(os.path.realpath(os.path.dirname(__file__)), 'kaitai_defs') DEFS = {} class ...
#!/usr/bin/env python from __future__ import division, print_function import re import glob import subprocess import time import random import datetime import numpy as np import yaml import markdown from jinja2 import Environment, FileSystemLoader, StrictUndefined from .benchmarks.basicmatops import BasicMatOps fro...
import argparse import os import torch from attrdict import AttrDict from sgan.data.loader import data_loader from sgan.models import TrajectoryGenerator from sgan.losses import displacement_error, final_displacement_error from sgan.utils import relative_to_abs, get_dset_path import collections import pickle impor...
#!/usr/bin/env python """Implementation of a router class that has approvals-based ACL checks.""" from grr.gui import api_call_router from grr.gui import api_call_router_without_checks from grr.lib import access_control from grr.lib import rdfvalue from grr.lib.aff4_objects import cronjobs from grr.lib.aff4_object...
import os, sys import numpy as np import json from sklearn.cluster import DBSCAN from functools import reduce from tqdm import tqdm from collections import OrderedDict from joblib import Parallel, delayed from .. import pipeline as pipe from .. import utils # rank the candidatess / clusters according to the following ...