text
stringlengths
6.04k
39.5k
import sys from datetime import datetime, timedelta from unittest import skipUnless import django from django.conf import settings from django.contrib import auth from django.contrib.auth.models import User from django.contrib.sessions.backends.base import CreateError from django.core.management import call_command fr...
from common import * from dataset.reader import * from net.layer.box.process import * #post filtering ------------------- #https://www.learnopencv.com/filling-holes-in-an-image-using-opencv-python-c/ def remove_holes(bin): bin_mask = np.copy(bin) h,w = bin.shape[:2] mask = np.zeros((h+2,w+2),np.uint8) ...
import os import random import math from datetime import datetime from collections import Counter import pandas as pd import numpy as np import cv2 from PIL import Image from pathlib import Path import matplotlib.pyplot as plt from matplotlib.patches import Rectangle from sklearn.model_selection import train_test_spli...
# python stdlib dependencies import binascii import os import sys import yaml # external modules from cryptography.exceptions import InvalidTag # local imports from .command import Command from .command import commandlet from .db import Db from .utils import TemporaryDirectory from .utils import hash_pass from .utils...
#!/usr/bin/env python3 # coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in c...
from __future__ import annotations from collections import defaultdict from csv import writer as csv_writer import datetime as dt from enum import Enum from glob import iglob import logging from pathlib import Path import threading from typing import * try: from matplotlib import pyplot as plt except ImportError:...
# Author: <NAME> # Email: <EMAIL> import os import glob import yaml import numpy as np import pandas as pd from opentraj.toolkit.core.trajdataset import TrajDataset, merge_datasets from opentraj.toolkit.loaders.loader_edinburgh import load_edinburgh from opentraj.toolkit.loaders.loader_eth import load_eth from opentr...
from __future__ import print_function, absolute_import import os, sys, subprocess, shlex, tempfile, time, sklearn.base, math import numpy as np import pandas as pd from pandas_extensions import * _vw_default_path = 'utils/lib/vw' class _VW(sklearn.base.BaseEstimator): def __init__(self, logger...
import networkx as nx from math import inf as INFINITY test_input1 = """####### #E..G.# #...#.# #.G.#G# #######""" test_input2 = """####### #.E...# #.....# #...G.# #######""" test_move1 = """######### #G..G..G# #.......# #.......# #G..E..G# #.......# #.......# #G..G..G# #########""" test_move2 = """######### #.G......
''' Created on Jun 27, 2017 @author: danny ''' import os.path, sys, time import unittest import urllib.request, urllib.error, urllib.parse, json, urllib.request, urllib.parse, urllib.error from PIL import ImageFont, Image, ImageDraw ''' Read api key from api.key return api key or -1 if error ''' def getApiKey(file...
""" Module extracts metadata from NetCDF file to complete the required HydroShare NetCDF Science Metadata References reprojection http://gis.stackexchange.com/questions/78838/how-to-convert-projected-coordinates-to- lat-lon-using-python datatype http://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html ...
# ------------------------------------------------------------------------------ # Access to the CodeHawk Binary Analyzer Analysis Results # Author: <NAME> # ------------------------------------------------------------------------------ # The MIT License (MIT) # # Copyright (c) 2016-2020 Kestrel Technology LLC # # Perm...
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ##...
# -*- coding: utf-8 -*- """ Created on Sat Dec 8 23:23:49 2018 This is the flap module for APDCAM @author: <NAME>, Centre for Energy Research <EMAIL> """ import os.path from decimal import * import numpy as np import copy import os import fnmatch import flap from .apdcam_control.apdcam10g_channel_map i...
""" UnifiedSiteInfo module holds helper function to obtain site information. Author: <NAME> <vkuznet [AT] gmail [DOT] com> Original code: https://github.com/CMSCompOps/WmAgentScripts/Unified """ # futures from __future__ import division from future.utils import viewitems # syste modules import json import tempfile f...
# %% [markdown] # # THE MIND OF A MAGGOT # %% [markdown] # ## Imports import os import time import warnings from itertools import chain import colorcet as cc import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.transforms as transforms import networkx as nx import numpy as np import pandas as pd...
"""Generation of the experiments.""" import time from collections import Counter from itertools import combinations import configargparse import autograd.numpy as np from autograd import grad from sklearn.datasets import fetch_mldata from sklearn.model_selection import train_test_split from sklearn.decomposition impor...
""" Prototype/reference implementation for encoding and decoding atom serial numbers and residue sequence numbers in PDB files. PDB ATOM and HETATM records reserve columns 7-11 for the atom serial number. This 5-co...
# coding=utf-8 # Copyright 2021 NVIDIA Corporation. 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...
""" Implement methods plotting and drawing figures. @author: <NAME> (y(dot)meng201011(at)gmail(dot)com)) """ from enum import Enum import numpy as np from utils.csv_headers import IdealModelEvalHeaders as headers import os import matplotlib.pyplot as plt from matplotlib.ticker import FormatStrFormatter from utils.confi...
from photons_control.planner.plans import Skip, NoMessages from photons_app.errors import RunErrors, BadRunWithResults, ProgrammerError from photons_app import helpers as hp from photons_transport.errors import FailedToFindDevice from photons_transport.targets.base import Target from photons_control.script import fin...
"""API Orchestation of Pipellines and Validations.""" import asyncio import logging import shutil import sqlalchemy from flask import Response, jsonify, request, send_file from flask_restful import Api, Resource, fields, marshal_with from werkzeug.exceptions import Conflict, UnprocessableEntity from meltano.api.api_...
import math import joblib import numpy as np import pandas as pd from pathlib import Path def incl_crit(data, subj_col, delta_col, min_data=3, jump_size=6, jump_col='alsfrst', max_year_onset=7): """Filter pandas dataframe by inclusion criteria""" data['Visit_Number'] = data.groupby(subj_col)[delta_col].rank()...
""" 인터넷에서 유용한 정보를 가져옵니다. Class: :obj:`~openpibo.collect.Wikipedia` Functions: :meth:`~openpibo.collect.Wikipedia.search` Class: :obj:`~openpibo.collect.Weather` Functions: :meth:`~openpibo.collect.Weather.search` Class: :obj:`~openpibo.collect.News` Functions: :meth:`~openpibo.collect.News.search` **단어정보, 날씨 정보,...
import abc import autosar.base import xml.sax.saxutils import json import math import collections from autosar.element import DataElement from decimal import Decimal class BaseWriter: def __init__(self, version=3.0, patch=None): self.version=version d = Decimal(float(version)) ...
############################################################################### # # The MIT License (MIT) # # Copyright (c) Crossbar.io Technologies GmbH # # 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 ...
""" A simple version of Proximal Policy Optimization (PPO) using single thread. Based on: 1. Emergence of Locomotion Behaviours in Rich Environments (Google Deepmind): [https://arxiv.org/abs/1707.02286] 2. Proximal Policy Optimization Algorithms (OpenAI): [https://arxiv.org/abs/1707.06347] View more on my tutorial webs...
from argparse import Namespace import math import torch from torch import nn as nn from typing import Union from dglt.models.nn_utils import index_select_ND, get_activation_function class GaussianSampling(nn.Module): """sample elements based on hidden_layer""" def __init__(self, input_size,...
import time import sys import random HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' CLEAR = '\x1b[2J\x1b[H' SAVE_DIR = "." cuts = None ankle = None sprainedWrist = None inHouse = 0 inBathroom = 0 pee = 1 poop = 1 dirtyHand = False def typePrint(m)...
import numpy as np import cv2 import time from pyVideoDatasets.DepthUtils import skel2depth, depth2world, world2depth N_MSR_JOINTS = 20 N_KINECT_JOINTS = 14 def transform_skels(skels, transformation, output='image'): ''' ---Parameters--- skels : list of skeletons in frame 1 transformation : 4x4 tran...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2019 Entrust Datacard Corporation. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = ''' --- module: ecs_domain autho...
# -*- coding: utf-8 -*- """ --- Object --- Subscribe to VSD notification with an Amqp client from activemq. Filter notification Request state engine API --- Author --- <NAME> Alexis <<EMAIL>> --- Version history --- 2018-09-22 - 1.0 --- Usage --- Run 'python event_stream-push_channel.py -h' for an overview --- Docu...
# The model produced by the flowobjspace # this is to be used by the translator mainly. # # the below object/attribute model evolved from # a discussion in Berlin, 4th of october 2003 import types import py from rpython.tool.uid import uid, Hashable from rpython.tool.sourcetools import PY_IDENTIFIER, nice_repr_for_fun...
import argparse import logging import sys import os import numpy as np import time import copy import random os.environ['QT_QPA_PLATFORM']='offscreen' import torch import torch.optim as optim import torch.nn as nn from torch.utils.data import Dataset,DataLoader from torchvision import transforms from tensorboardX imp...
# -*- coding: utf-8 -*- """ Created on Fri May 3 16:04:00 2019 @author: Miranda """ from sympy import mod_inverse as mminv from sympy import isprime as isprime import math import random import time time.time() * 10000 def legendres(dis,p): """legendre symbol""" ls = pow(dis, (p-1)//2, p) ...
# -*- encoding: utf-8 -*- # # Copyright Ericsson AB 2013. All rights reserved # # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # 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 # # ...
import contextlib import ctypes import ctypes.wintypes import io import json import os import re import socket import socketserver import threading import time import typing import click import collections import collections.abc import pydivert import pydivert.consts REDIRECT_API_HOST = "127.0.0.1" REDIRECT_API_PORT ...
from datetime import datetime import os import random import sys from argparse import ArgumentParser, Namespace from pathlib import Path from pprint import pprint import psutil from flatland.utils.rendertools import RenderTool from torch.utils.tensorboard import SummaryWriter import numpy as np import torch from flat...
# Lint as: python3 """LIT wrappers for T5, supporting both HuggingFace and SavedModel formats.""" import re from typing import List import attr from lit_nlp.api import model as lit_model from lit_nlp.api import types as lit_types from lit_nlp.examples.models import model_utils from lit_nlp.lib import utils import ten...
from ctypes import * import ctypes.util import _ctypes import numpy as np from os import system import sys from acados.sim.generate_wrapper import set_function_pointers #import faulthandler #faulthandler.enable() class acados_integrator_model: def __init__(self): self.model_name = 'model' self.type ...
#------------------------------------------------------------------------------- # # Based on joblib/threadpoolctl, with copyright notice as below. # # URL: https://github.com/joblib/threadpoolctl/blob/b7fa4e8/threadpoolctl.py # #------------------------------------------------------------------------------- """thre...
#!/usr/bin/env python import os import re import subprocess import sys import tempfile import numpy as np import scipy.signal from PyQt5 import QtCore, QtWidgets from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT from matplotlib.figure import Figure from .extract_energy_ui import ...
''' The server module takes care of os-level state. Targets POSIX compatibility, tested on Linux/BSD. ''' from __future__ import division, unicode_literals from itertools import tee from os import path from time import sleep import six from six.moves import filterfalse, shlex_quote from pyinfra.api import Function...
#!/usr/bin/env python # Copyright (c) 2018 <NAME> # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ Classes to handle Agent object (player and non-player) Inspired by carla_ros_bridge Carla 0.8.4 """ import math import numpy import prctl import...
import os import time import json import logging import binascii import networkx as nx from copy import deepcopy from networkx import NetworkXNoPath from itertools import islice from threading import Thread, Event from flask import Flask, request, Response, abort from riemann import tx from bitcoind_mock.rpc_errors i...
# -*- coding: utf-8 -*- """ Authors: <NAME>, <NAME>, <NAME>, and <NAME> IHE Delft 2017 Contact: <EMAIL> Repository: https://github.com/gespinoza/hants Module: hants """ from __future__ import division import netCDF4 import pandas as pd import math from .davgis.functions import (Spatial_Reference, Lis...
""" @brief Evaluation metrics for segmentation applications. @author <NAME> (<EMAIL>) @date 30 Oct 2019. """ import numpy as np from scipy import ndimage from evaluation_metrics import lookup_tables def _binarize(seg, fg_class=1): """ Binarize a segmentation with label 1 for pixels/voxels the foreground ...
import os # os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # os.environ["CUDA_VISIBLE_DEVICES"] = "1" import torch import torch.nn as nn from torch import optim from torch.autograd import Variable import torch.nn.functional as F from src.python.dingo_utils2 import * from src.python.preprocess2 import * from src.pyt...
# -*- coding: utf-8 -*- """ Created on Sat Dec 19 09:30:51 2020 @author: Clayton """ import matplotlib.pyplot as plt import json import os.path from os import path from datetime import datetime from datetime import date from dateutil import tz from datetime import timedelta import spotipy from spotipy.oauth2 import S...
import copy import numpy from .neural._classes.model import Model from . import check from .check import equal_axis from . import describe class FunctionLayer(Model): '''Wrap functions into weightless Model instances, for use as network components.''' def __init__(self, begin_update, predict=None, predic...
# -*- coding: utf-8 -*- '''Wrappers for various units of text.''' from __future__ import unicode_literals import sys import json from collections import defaultdict from .packages import nltk from .decorators import cached_property from .utils import lowerstrip, PUNCTUATION_REGEX from .inflect import singularize as _...
import numpy as np import tensorflow as tf from sklearn.model_selection import train_test_split from sklearn.utils.validation import check_array, check_X_y from tensorflow.contrib.distributions import Normal import baselines.common.tf_util as U from remps.model_approx.model_approximator import ModelApproximator from r...
# -*- coding: utf-8 -*- import numpy as np from ..Qt import QtGui, QtCore from ..python2_3 import asUnicode, basestring from .. import metaarray __all__ = ['TableWidget'] def _defersort(fn): def defersort(self, *args, **kwds): # may be called recursively; only the first call needs to block sorting ...
import os import re import textwrap from django.template import Template, Context from django.utils.translation import ugettext_lazy as _ from orchestra.contrib.orchestration import ServiceController from orchestra.contrib.resources import ServiceMonitor from .. import settings from ..utils import normurlpath clas...
import numpy as np import tensorflow as tf import yolo.config as cfg slim = tf.contrib.slim class YOLONet(object): def __init__(self, is_training=True): self.classes = cfg.CLASSES self.num_class = len(self.classes) # C = 20 self.image_size = cfg.IMAGE_SIZE ...
# Copyright 2021 AI Singapore. 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...
#!/usr/bin/env python3 # Northcliff Doorbell Monitor Version 2.6 GEN # Requires Home Manager >= V8.5 import RPi.GPIO as GPIO import time from datetime import datetime import subprocess import http.client import urllib import mmap import requests from threading import Thread import paho.mqtt.client as mqtt import struct...
# -*- coding: utf-8 -*- __author__ = 'mgoetz' import bokeh import bokeh.models import bokeh.palettes import bokeh.plotting import datetime as dt import numpy as np import pandas as pd import scipy.signal import sklearn.cluster import sklearn.grid_search import matplotlib.pyplot as plt import matplotlib.patches impor...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import, division, print_function import os import numpy as np from astropy import units as u from astropy.table import Table, Column, join from astropy.coordinates import SkyCoord from astropy.io import fits import fermipy f...
# -*- coding: utf-8 -*- """ .. codeauthor:: <NAME> <<EMAIL>> .. affiliation:: Laboratory of Protein Design and Immunoengineering <lpdi.epfl.ch> <NAME> <<EMAIL>> .. func:: multiple_distributions """ # Standard Libraries import itertools # External Libraries import numpy as np import pandas as pd import matplo...
import json import requests import sys import argparse from functools import partial import urllib.parse from treelib import Tree from colorama import init, Fore, Back import pandas as pd import traceback import logging from libchebipy._chebi_entity import ChebiEntity logging.basicConfig(level=logging.INFO) logger = l...
"""Linear Algebra Helper Routines.""" from warnings import warn import numpy as np from scipy import sparse from scipy.sparse.linalg import aslinearoperator from scipy.linalg import lapack, get_blas_funcs, eig, svd from .params import set_tol def norm(x, pnorm='2'): """2-norm of a vector. Parameters -...
import re from typing import Sequence, Any, Union, Dict, Optional, Callable from re import split from pathlib import Path import numpy as np from sigpipes.auxtools import type_info, smart_tostring, TimeUnit import h5py import csv class DPath: def __init__(self, root, dir, stem, suffix): self.root = root ...
''' show_cdp.py IOSXE parsers for the following show commands: * 'show cdp neighbors' * 'show cdp neighbors detail' ''' # Python import re # Metaparser from genie.libs.parser.utils.common import Common from genie.metaparser import MetaParser from genie.metaparser.util.schemaengine import Any, Optional c...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # -*- mode: python; -*- import json import logging import os import re import subprocess from glob import glob as glob from common import get_sys_args, read_config, yield_dockerfiles from common import init_logger, counted_error, at_exit CAPABILITIES = { # all linux ...
import pickle import os import sys import colorsys import math import copy import tkinter as tk from collections import namedtuple from tkinter import filedialog, messagebox, simpledialog from tkinter import * from GAEV import * cur_dir = os.getcwd() sets_to_highlight = {} # {"blue": [gene1, gene,2 gen...
import cgi import logging import os import sys import tempfile import threading from http import HTTPStatus from http.server import __version__ as http_version, HTTPServer, SimpleHTTPRequestHandler # noqa # Use from..import for importlib as it needs to bootstrap some stuff before "util" etc works, which import doesn'...
import inspect import logging import json import re from requests import Response import http.client as http from awxkit.utils import PseudoNamespace, is_relative_endpoint, are_same_endpoint, super_dir_set, suppress, is_list_or_tuple, to_str from awxkit.api import utils from awxkit.api.client import Connection from a...
import multiprocessing import random import time import numpy as np import pyBigWig import statsmodels.api as sm from copy import deepcopy from CRADLE.correctbiasutils import vari as commonVari TRAINBIN_SIZE = 1000 def setVariables(args): setRegions(args.r) def setRegions(region): global REGION global overlapR...
from django.shortcuts import get_object_or_404, render from django.http import HttpResponse, HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required from django.http import JsonResponse from django.contrib import messages from easycart.cart import Cart...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """This is the main script for regular usage, call sub-commands ... """ __author__ = '<NAME>' __email__ = '<EMAIL>' __date__ = '2019-10-01' __version__ = '0.0.1' # import hiseq import os import sys import argparse from multiprocessing import Pool from .utils.argsParser...
from numpy import isnan, take, any, all, logical_or, logical_and, logical_not, atleast_1d, \ asarray, argmin, argsort, abs, isfinite, dot#where import numpy as np # for PyPy from openopt.kernel.nonOptMisc import where from bisect import bisect_right from FuncDesigner.Interval import splitDomainForDiscreteVariable tr...
from enum import Enum import random from time import perf_counter from .controller import ControllerTypes from .utils import replace_subarray class SwitchResponses(Enum): NO_DATA = -1 MALFORMED = -2 TOO_SHORT = -3 UNKNOWN_SUBCOMMAND = -4 REQUEST_DEVICE_INFO = 2 SET_SHIPMENT = 0x08 SPI_RE...
from d3m import container, utils as d3m_utils from d3m.base import utils as base_utils from d3m.metadata import base as metadata_base, hyperparams from d3m.primitive_interfaces import base, transformer from d3m.primitive_interfaces.base import CallResult, DockerContainer from typing import cast, Dict, List, Union, Seq...
import bpy, os, importlib, subprocess, sys, threading, platform, aud from . import encoding from . cycles import lightmap, prepare, nodes, cache from . denoiser import integrated, oidn, optix from . filtering import opencv from os import listdir from os.path import isfile, join from time import time, sleep previous_se...
# -*- coding: utf-8 -*- """ Class definitions and functions for definition of damper systems e.g. TMDs Damper systems are not usually analysed in isolation; rather they would normally be appended to another system (e.g. a modal system) """ from __init__ import __version__ as currentVersion # Standard imports import...
# Copyright (c) IBM Corp. 2018. All Rights Reserved. # Project name: Reinforcement Learning Testbed for Power Consumption Optimization # This project is licensed under the MIT License, see LICENSE import gzip import os import shutil import subprocess from argparse import ArgumentParser from glob import glob import nu...
import logging from functools import partial from typing import Optional from qcodes import VisaInstrument, Instrument from qcodes import ChannelList, InstrumentChannel from qcodes.utils import validators as vals import numpy as np from qcodes import MultiParameter, ArrayParameter log = logging.getLogger(__name__) ...
# # 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...
import numpy as np from psd_tools.constants import Tag, BlendMode, ColorMode from psd_tools.api.layers import AdjustmentLayer, Layer from psd_tools.api.numpy_io import EXPECTED_CHANNELS import logging from .blend import BLEND_FUNC, normal from .vector import ( create_fill, create_fill_desc, draw_vector_mask, draw_...
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2018, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
""" Scipy version > 0.18 is needed, due to 'mode' option from scipy.misc.imread function """ import os import glob import h5py import random from math import floor import struct #import tensorflow as tf import tensorflow.compat.v1 as tf tf.disable_v2_behavior() from PIL import Image from scipy.misc import imread i...
#!/usr/bin/env python3 # # Copyright 2021 Graviti. Licensed under MIT License. # """Class Client and method multithread_upload. :class:`Client` can send POST, PUT, and GET requests to the TensorBay Dataset Open API. :meth:`multithread_upload` creates a multi-thread framework for uploading. """ import logging impor...
from __future__ import absolute_import, division, print_function from cctbx import miller from cctbx.array_family import flex from libtbx.utils import Sorry import iotbx.phil import mmtbx.scaling from mmtbx.scaling import absolute_scaling, relative_scaling from mmtbx.scaling import pair_analyses import sys from six.mov...
notice = """ Feature and speed test for a Pure Python graphics library that saves to a bitmap ----------------------------------- | Copyright 2022 by <NAME> | | [<EMAIL>] | |-----------------------------------| | We make absolutely no warranty | | of any kind, expressed or implied | |----------...
# Authors: <NAME> import re from gi.repository import Gtk, GObject, Pango from pychess.System.Log import log from pychess.System.prefix import addDataPrefix from pychess.Utils.const import ARTIFICIAL __title__ = _("Engines") __icon__ = addDataPrefix("glade/panel_engineoutput.svg") white = addDataPrefix("glade/pane...
"""Type checking of attribute access""" from typing import cast, Callable, List, Dict, Optional from mypy.types import ( Type, Instance, AnyType, TupleType, CallableType, FunctionLike, TypeVarId, TypeVarDef, Overloaded, TypeVarType, TypeTranslator, UnionType, PartialType, DeletedType, NoneTyp, TypeType ) ...
from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse, reverse_lazy from django.views import generic from django.utils.text import slugify from django.utils.safestring import mark_safe from django.utils.decorators import method_decorator fro...
"""MVTec Dataset. MVTec This script contains PyTorch Dataset, Dataloader and PyTorch Lightning DataModule for the MVTec dataset. If the dataset is not on the file system, the script downloads and extracts the dataset and create PyTorch data objects. """ # Copyright (C) 2020 Intel Corporation # # Licensed under the A...
#!/usr/bin/python3 from __future__ import division, print_function """ Copyright 2018 Digital Media Professionals 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:/...
# -*- coding: utf-8 -*- """ pyxform utils module. """ import codecs import copy import csv import json import os import re from collections import namedtuple from json.decoder import JSONDecodeError from typing import List, Tuple from xml.dom.minidom import Element, Text, parseString import openpyxl import xlrd from ...
# Copyright (c) 2018 <NAME>. # Cura is released under the terms of the LGPLv3 or higher. from UM.Logger import Logger from UM.i18n import i18nCatalog from UM.Application import Application from UM.Qt.Duration import DurationFormat from UM.PluginRegistry import PluginRegistry from cura.PrinterOutputDevice import Print...
import os import stat import tempfile from pathlib import Path from subprocess import TimeoutExpired from typing import List, Optional from recordclass import RecordClass from seutil import BashUtils, IOUtils, LoggingUtils from tqdm import tqdm from tseval.data.MethodData import MethodData from tseval.Environment imp...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import argparse import codecs from collections import OrderedDict, namedtuple, deque import csv import datetime import gc from math import sqrt import os import random import platform import subprocess import sys from threading import Thread from time impo...
import subprocess import os import shutil from ..helper import thirdparty_binary, make_safe, save_groups, load_scp from ..multiprocessing import run_mp, run_non_mp def mfcc_func(directory, job_name, mfcc_options): log_directory = os.path.join(directory, 'log') raw_mfcc_path = os.path.join(directory, 'raw_mf...
import torch from torch import nn import torch.nn.functional as F from math import exp import numpy as np from segmentl.utils import get_activation_fn from skimage.feature import masked_register_translation from skimage import data, img_as_float from skimage.metrics import structural_similarity as ssim from skimage im...
#!/usr/bin/env python3 # # Copyright (c) 2017 Intel Corporation # Copyright (c) 2020 Nordic Semiconductor NA # # SPDX-License-Identifier: Apache-2.0 """Translate generic handles into ones optimized for the application. Immutable device data includes information about dependencies, e.g. that a particular sensor is cont...
""" Creation of TensorFlow eager models """ from functools import partial from tensorflow import Dimension from tensorflow.python.keras.layers import Embedding, Dense, concatenate, Lambda, TimeDistributed, Masking, \ Bidirectional from tensorflow.python.keras.utils import multi_gpu_model from tensorflow.python.op...
""" Plot ScoCen in (l, b) coordinates, stars for each component with different colours. """ import numpy as np from astropy.table import Table from astropy import units as u import matplotlib.pyplot as plt import matplotlib.ticker as ticker import matplotlib.cm as cm import matplotlib as mpl plt.ion() import copy fro...
import numpy as np import torch import torch.nn.functional as F import torch.nn as nn import sys from torch.autograd import Variable import math def flip(x, dim): xsize = x.size() dim = x.dim() + dim if dim < 0 else dim x = x.contiguous() x = x.view(-1, *xsize[dim:]) x = x.view(x.size(0), x.size(1...