text
stringlengths
6.04k
39.5k
import numpy as np from app.data import datasets from app.preferences import * # decay constants are in __all__ from app import preferences from app.datatypes import Columns from app.widgets.ViewWidget import ARViewWidget from app.widgets.ControlWidget import PlotControlWidget from app.widgets.QCPItemRichText import Q...
# pragma.py # By mparisi20 # github.com/mparisi20/pragma_processor # #pragma regswap usage: # #pragma regswap start end regA regB startFile # start: absolute address of start of affected region (hex) # end: absolute address of end of affected region (hex) # regA: register to swap (r0-r31 or f0-f31) # regB:...
""" Finds the extension and its dependencies. The details of this are in the document folder. """ from typing import Sequence, List, Tuple, Dict, Set, Optional, Iterable from ...errors import ( PetroniaExtensionNotFound, PetroniaNoCompatibleExtensionFound, ) from ...base import ( TRACE, DEBUG, VERBOSE, l...
import mmcv import numpy as np import os.path as osp from mmcv.parallel import DataContainer as DC from torch.utils.data import Dataset from .transforms import GroupImageTransform, GroupMultiScaleCrop from .utils import to_tensor class RawFramesSegmentedRecord(object): def __init__(self, row): self._data...
'''This script is used to generate dummy CSD sources, to test the various kCSD methods ''' import numpy as np from numpy import exp, isfinite from functools import wraps def repeatUntilValid(f): """ A decorator (wrapper). If output of `f(..., seed)` contains either NaN or infinite, repeats calculati...
# -*- coding: utf-8 -*- """This module contains the custom parser for RDF.""" import json import rdflib from .utils import convert_to_nx from ..utils import parse_rdf """RDF CUSTOM PARSER FUNCTIONS""" """URI Parsers""" def parse_id_uri(uri): """Get the components of a given uri (with identifier at the last ...
import os import pprint import random import time from collections import OrderedDict import numpy as np import torch import torch.multiprocessing as mp import torch.nn as nn import torch.nn.functional as F class DotDict(dict): """ Example: m = Map({'first_name': 'Eduardo'}, last_name='P...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function from flask import Flask, Response from flask import render_template from flask import request from flask import url_for, redirect, jsonify, make_response import requests import json import sys import sqlite3 import time import datetime...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the PyMVPA package for the # copyright and license terms. # ### ### ### ### ###...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. """ This code file defines two typical network structures proposed by [1], namely R3D and R(2+1)D. R3D means that all 2D-conv ops are replaced by 3D-conv ops. R(2+1)D means that the 3D-conv is decoupled into a 1D temporal con...
import csv import sys import os import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F import torchvision from pytorch_lightning import LightningModule, seed_everything, Trainer from pytorch_lightning.callbacks import LearningRateMonitor from pytorch_lightning.callbac...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Mar 12 08:42:02 2021 @author: root """ import jax.numpy as np from jax import jit,grad,ops from jax.config import config config.update("jax_enable_x64", True) from jax.experimental.optimizers import adam,sm3,adagrad,make_schedule,optimizer import pick...
from __future__ import annotations import dataclasses import logging import os import subprocess import sys import time import tkinter from concurrent.futures import ThreadPoolExecutor from functools import partial from pathlib import Path from tkinter import ttk from typing import Any, Callable, Dict, Iterator, List,...
# Copyright (C) 2018 <NAME> <<EMAIL>> # Copyright (C) 2018 Electrum Technologies GmbH # # This file is licensed under the MIT license. See LICENCE file for more information. # from electrum.bitcoin import is_address from . import utils from . import gui from electrum import WalletStorage, Wallet from electrum.util impo...
import torch from ..geometry.conversions import pi from .color.hsv import rgb_to_hsv, hsv_to_rgb __all__ = [ "adjust_brightness", "adjust_contrast", "adjust_gamma", "adjust_hue", "adjust_saturation", "adjust_hue_raw", "adjust_saturation_raw", "solarize", "equalize", "equalize3...
from Synthetic_Dataset import Synthetic_Dataset import random import numpy as np import math import torch import torch.nn as nn import matplotlib.pyplot as plt import torchvision.utils as vutils from torch.nn import functional as F from torch.utils.data import DataLoader from torchvision import transforms from torchv...
''' GUI for editing notification events. NotificationView is the main TreeList control which lists notifications. ''' from __future__ import with_statement import wx from copy import deepcopy from util import dictadd from gui.treelist import TreeList, TreeListModel from gui.toolbox import build_button_si...
""" LLUV backend author: <NAME> CSH:(jpotter) """ import subprocess import configparser import shlex import math import sys import threading import os from time import sleep import lluv.lluv_classes as lc def check_config() -> bool: """ function to check for lluvrc in the users home dir if its not there,...
import numpy as np import cv2 from utils import downsample,downsample_keepdim,bartlett_blurring from data import BSDS500 from sklearn.decomposition import PCA from scipy.spatial.distance import pdist def BGR2CIELUV(bgr_img): var_bgr = bgr_img / 255.0 transform_mat = np.array([[0.180423, 0.072169, 0.950227], ...
''' Created on 07.02.2013 @author: philkraf ''' import sys from datetime import datetime, timedelta from .. import db from glob import glob from odmf.tools import Path import os.path as op import os from configparser import RawConfigParser from io import StringIO from math import isnan import typing import chardet im...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jun 18 14:39:07 2020 @author: gustav """ from __future__ import print_function, division import nibabel from scipy import ndimage import numpy as np import torch import matplotlib.pyplot as plt import math class LoadNifti(object): def __call_...
import logging import numpy as np import theano import theano.tensor as tt # Don't let pymc3 play with this setting! _ctv = tt.config.compute_test_value import pymc3 as pm tt.config.compute_test_value = _ctv from warnings import warn from multipledispatch import dispatch from unification.utils import transitive_ge...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # # # RMG Website - A Django-powered website for Reaction Mechanism Generator # # ...
from osgeo.osr import SpatialReference, CoordinateTransformation import numpy as np import xarray as xr EPSG_CODES = dict( wgs84=4326, utm29n=32629, utm30n=32630, utm31n=32631, utm32n=32632, utm33n=32633, utm34n=32634, utm35n=32635, utm36n=32636, etrs89=4258, etrs89_utm29n=...
import collections import itertools import multiprocessing import os import random import re import signal import sys import threading import time import traceback import click import numpy import pandas as pd from tqdm import tqdm from estee.common import imode from estee.schedulers import WorkStealingScheduler from...
import abc import warnings from typing import Type import pandas as pd import numpy as np import statsmodels.api as sm from sklearn.preprocessing import MinMaxScaler, OneHotEncoder from sklearn.utils.multiclass import type_of_target from .doubly_robust import DoublyRobust as BaseDoublyRobust from causallib.estimation...
import cv2 import numpy as np import threading import queue import io from kivy.logger import Logger import time from statistics import mean from os.path import join from imageProcessing.CNN import CNN import picamera import picamera.array def get_image_mask(img, imaging_parameters): img = cv2.cvtColor(img, cv...
import json import operator import pytest from ichnaea.api.exceptions import ( DailyLimitExceeded, InvalidAPIKey, LocationNotFound, ParseError, ) from ichnaea.api.locate.constants import ( BLUE_MIN_ACCURACY, BLUE_MAX_ACCURACY, CELL_MIN_ACCURACY, CELL_MAX_ACCURACY, CELLAREA_MIN_ACCU...
#! /usr/bin/python # -*- coding: utf-8 -*- import os import time import socks import socket import urllib.request import urllib.parse import numpy as np from random import randint import tensorflow as tf import tensorlayer as tl from tensorlayer.layers import * from tensorflow.python import debug as tfdebug """ Noti...
# -*- coding: utf-8 -*- """ @author: 杨涛 """ import pymysql import os import random import threading import time import requests from bs4 import BeautifulSoup import json import pandas as pd import numpy as np import matplotlib.pyplot as plt from datetime import datetime from pandas import Series, DataFr...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division import numpy as np import swordfish as sf import scipy.sparse.linalg as la import pylab as plt import harpix as hp import scipy.sparse as sp import healpy from operator import mul class BkgComponent(object): def __init__(self, B, x0 = No...
''' This file support Train + Test SSD model with vgg/resnet/mobilev1/mobilev2 backbone on VOC/XL/WEISHI/COCO dataset (Use VOC dataset by default) Train + Test SSD model with vgg backbone Execute: python3 train_test_vrmSSD.py --evaluate True (testing while training) Execute: python3 train_test_vrmS...
""" Jobs are: folders under ./jobs_folder Created by generators (pgen) Runs are: Sub-folders of jobs Contain plaster_run.yaml files May contain plaster_output/ folders """ from munch import Munch import time import sys import hashlib import os import uuid from functools import cmp_to_key from plumb...
# Consider a collection of (finite) line segments scattered on a # two-dimensional (finite) window. This code finds the points where the # segments intersect with a rectangular box with its parallel to the # Cartesian axes. # # The intersection points are found by first deriving the linear equations # (with form y=mx+c...
#! /usr/bin/python # # Simple script to update a set of common directories that are needed as dependencies of the current project # Usage: # fetch_dependencies.py [--latest] [--binary-path <path-to-rga_dependencies-zip-file>] # # If "--latest" is specified, the latest commit will be checked out. # Otherwise, the repo...
#!/usr/bin/python2 # -*- coding:UTF-8 -*- """ tmake cmakelist """ import os import re # 存储左括号和右括号 import core import shutil OPEN_BRACKETS = '(' CLOSE_BRACKETS = ')' # 映射左右括号便于出栈判断 BRACKETS_MAP = {')': '('} # CMakeLists.txt文件名 CMAKELISTS = "CMakeLists.txt" CMAKELISTS_BACKUP = "CMakeLists_backup.txt" #pattern_tempel...
# Copyright 2021 DeepMind Technologies Limited # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
import logging import os import sentry_sdk from celery.schedules import crontab from configurations import Configuration, values from django.core import validators from sentry_sdk.integrations.celery import CeleryIntegration from sentry_sdk.integrations.django import DjangoIntegration from sentry_sdk.integrations.redi...
#!/usr/bin/env python3 from marshmallow import Schema, fields, ValidationError import json from six.moves import configparser import io class MustNotExist(fields.Field): """ Custom field used to mark fields that should never exist to avoid validating """ def _deserialize(self, value, attr, data): ...
""" ## On the funny (temporary) name 'into': Constructing "into" this Clef, from the s-expr Clef. I.e. from s-expr notes to form_analysis clef. This is different from construct.py, which constructs from notes to structures. Should this be part of the s-expr module or the current one? Object Oriented programmers wou...
import random import tkinter import time width = 900 height = 800 boids = [] preds = [] def initBoids(numBoids): for i in range(numBoids): boids.append( { "x": random.random() * width, "y": random.random() * height, "dx": random.random() * 10 - 5, "dy": ra...
# Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD (3-clause) import os.path as op import inspect import pytest import numpy as np from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_...
#!/usr/bin/env python3 # # @file analysis.py # @brief Plotting and analysis tool to determine IMU parameters. # @author <NAME> # import argparse import csv import matplotlib.pyplot as plt import numpy as np from scipy.optimize import curve_fit def line_func(x, m, b): return m * x + b def get_intercept(x, y,...
# -*- coding: utf-8 -*- """ Created on Sun May 12 17:38:51 2019 # FCN网络用语预测N年生存概率(二分类或多分类问题。) @author: liuhuaqing """ from __future__ import print_function import numpy as np import matplotlib.pyplot as plt #from sklearn import metrics #from sklearn.preprocessing import label_binarize import time import os import ten...
# -*- coding: utf-8 -*- """ Copyright 2020 <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 w...
# Copyright (c) Facebook, Inc. and its affiliates. import colorsys import numpy as np from enum import Enum, unique import cv2 import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.colors as mplc import matplotlib.figure as mplfigure import pycocotools.mask as mask_util from matplotlib.backends.bac...
# Ref: https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BMP280-DS001.pdf # Accession: G00028 import logging import asyncio from ....support.data_logger import DataLogger from ... import * from ...interface.i2c_master import I2CMasterApplet REG_CAL_T1 = 0x88 # 16-bit unsigned REG_CAL_T2 =...
############################################################################## # # Copyright (c) 2015-2018 by The University of Queensland # http://www.uq.edu.au # # Primary Business: Queensland, Australia # Licensed under the Apache License, version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # # Development unti...
from ..base import * from ..button import * from ..toolbar import * from ..dialogs import * class TransformButtons(ToggleButtonGroup): def __init__(self, buttons): ToggleButtonGroup.__init__(self) def toggle_on_default(): GD["active_transform_type"] = "" Mgr.update_app(...
# -*- coding: utf-8 -*- # pylint: disable=import-outside-toplevel,unbalanced-tuple-unpacking """Utility functions for pyIEM package This module contains utility functions used by various parts of the codebase. """ import os import sys import time import random import logging from datetime import timezone, datetime imp...
""" Test management commands that are under the clubs app here. These management commands can be executed with "./manage.py <command>". """ import csv import datetime import io import os import tempfile import uuid from unittest import mock from django.conf import settings from django.contrib.auth import get_user_mod...
from __future__ import unicode_literals import json import re import shutil import subprocess from distutils.spawn import find_executable from functools import partial from itertools import chain from typing import Text, Iterable, Union, Dict, Set, Sequence, Any import six import yaml from time import time from attr ...
#==================================================================== # Powerplant class that "holds" all powerplants in dictionaries # Note: need not be present but highly unlikely you leave without it #==================================================================== import numpy from turboshaft import turbosha...
#!/usr/bin/python # project-memoria-detector -- detection tool for vulnerable embedded TCP/IP stacks # see https://www.forescout.com/research-labs/amnesia33/ # Copyright (C) 2020 Forescout Technologies, Inc. # Program License # "The Program" refers to any copyrightable work licensed under this License. Each...
# Copyright 2022 Multiscale Modeling of Fluid Materials, TU Munich # # 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 appl...
import os import torch torch.backends.cudnn.benchmark=True import torch.utils.data as data import torch.nn.functional as F from torch.autograd import Variable from tqdm import tqdm from distutils.version import LooseVersion import sys sys.path.append(os.path.abspath('.')) from datasets.synthia_Dataset imp...
import os import unittest import requests from parameterized import parameterized_class from urllib3._collections import HTTPHeaderDict from tests import test_utils from tests.test_utils import assert_large_dict_equal from utils import file_utils, tornado_utils from utils.collection_utils import put_multivalue, find_...
"""<NAME>., 2019 - 2020. All rights reserved.""" from __future__ import print_function import csv import sys import subprocess import shutil import os import json import xml.etree.ElementTree as ETree import argparse from guardrail_globals import GuardrailGlobals # pylint: disable=E0401 import guardrails_log as cl ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # weatherBot # Copyright 2015 <NAME> under the MIT license # See the GitHub repository: https://github.com/bman4789/weatherBot from datetime import datetime from datetime import timedelta import sys import time import random import logging import json import os from os.pa...
import sys import numpy from PyQt5.QtWidgets import QApplication, QMessageBox, QSizePolicy from orangewidget import gui from orangewidget.settings import Setting from oasys.widgets import gui as oasysgui, congruence from oasys.widgets.exchange import DataExchangeObject from orangecontrib.xoppy.util.xoppy_xraylib_util ...
#!/usr/bin/env python # _*_ coding: utf-8 _*_ """ @author : lightnine @site : https://ligntnine.github.io @version : 1.0 @file : regression.py @software : PyCharm @time : 2018/8/11 15:59 """ import numpy as np import matplotlib.pyplot as plt def load_data_set(filename): """ 读取文件内容,\t分隔,返回数据和标签,都是数组 :par...
from argparse import ArgumentParser from urllib.parse import urlparse from os.path import expanduser, dirname from typing import Dict, List from . import livy_api, hdfs_api from pprint import pprint, pformat import json import os import shlex import sys import pdb import logging import time CONFIG_PATH_ENV_VAR = "LIV...
# Copyright 2021 MosaicML. All Rights Reserved. import logging from abc import ABC from dataclasses import asdict, dataclass from typing import Any, Callable, Dict, List, Optional, Sequence, Union import torch import yahp as hp from torch.optim.lr_scheduler import (CosineAnnealingLR, CosineAnnealingWarmRestarts, Expo...
import contextlib import copy import io import itertools import numpy as np import os import datetime import time from collections import defaultdict from pycocotools.cocoeval import COCOeval import pycocotools.mask as maskUtils from collections import OrderedDict import torch from fvcore.common.file_io import PathMana...
import argparse import os import time # import subprocess # proc1 = subprocess.Popen(['scontrol', 'show', 'job', os.environ['SLURM_JOBID'], '-d'], stdout=subprocess.PIPE) # process = subprocess.run(['grep', '-oP', 'GRES=.*IDX:\K\d'], stdin=proc1.stdout, capture_output=True, text=True) # os.environ['EGL_DEVICE_ID'] = p...
# Copyright 2016-2017 Spirent Communications. # # 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 ...
# -*- coding: utf-8 -*- """ Web frontend interface, displays statistics from a database. --quiet prints out nothing @author <NAME> @created 06.04.2015 @modified 12.02.2021 """ import collections import datetime import math import os import re import sys import bottle from bottle impo...
import itertools from typing import Callable import torch from catalyst.dl import Callback, RunnerState, CallbackOrder from pytorch_toolbelt.utils import plot_confusion_matrix, render_figure_to_tensor from pytorch_toolbelt.utils.catalyst import get_tensorboard_logger from pytorch_toolbelt.utils.distributed import all_...
import pandas as pd import numpy as np import yfinance as yf import matplotlib.pyplot as plt import requests from bs4 import BeautifulSoup from numba import njit from datetime import datetime, timedelta from sklearn.metrics import mean_squared_error from sklearn.model_selection import train_test_split from sklearn.ne...
import os import traceback import numpy as np from OpenGL.GL import * from PyEngine3D.Common import logger from PyEngine3D.App import CoreManager from PyEngine3D.OpenGLContext import CreateVertexArrayBuffer, VertexArrayBuffer, UniformMatrix4 from PyEngine3D.Utilities import * from .Skeleton import Skeleton from .Anim...
import numpy as np from models.base_gru_net import BaseGRUNetHypernet from lib.layers import SoftmaxWithLoss3D import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F from torch.nn import Linear, Conv2d, MaxPool2d, \ LeakyReLU, Conv3d, Tanh, Sigmoid ...
""" lipydomics/identification/__init__.py <NAME> 2019/10/04 description: Module for performing identification of individual lipid features """ from sqlite3 import connect import os import pickle from lipydomics.identification.id_levels import ( id_feat_any, id_feat_meas_mz_rt_ccs, id_fe...
#!/usr/bin/env python3 ##@package openzgy.impl.compress import math import sys import numpy as np from collections import namedtuple from ..impl import enum as impl_enum from ..exception import * CompressionResult = namedtuple("Compression", "cdata csize isize signal noise ctime dtime snr_result snr_wanted snr_roun...
import json import logging import re from copy import copy from typing import List from actstream import action from django.db.models import Prefetch from dashboard.internet_nl_dashboard.models import Account, UrlList, UrlListReport log = logging.getLogger(__name__) def get_recent_reports(account: Account) -> List...
import sys import csv import pandas as pd import ctdcal.sbe_reader as sbe_rd import ctdcal.sbe_equations_dict as sbe_eq import gsw DEBUG = False #lookup table for sensor data ###DOUBLE CHECK TYPE IS CORRECT### short_lookup = { '55':{'short_name': 'CTDTMP', 'long_name':'SBE 3+ Temperature', 'units': 'ITS-90', 'typ...
#!/usr/bin/env python3 # coding=utf-8 import os as os import csv as csv import gzip as gz import sys as sys import traceback as trb import argparse as argp import operator as op import collections as col import difflib as diffl import io as io import re as re import json as js def det_open_mode(fp, read=True): "...
from __future__ import print_function import os import sys import itertools import time import numpy as np import pandas import pysam import pybedtools def tag_bedpe(b, beds, verbose=False): """ Tag each end of a BEDPE with a set of (possibly many) query BED files. For example, given a BEDPE of interacti...
from neo4j.v1 import GraphDatabase import sys import logging from ArbitragePath import ArbitragePath from OrderBook import OrderBookPrice, Asset logger = logging.getLogger('CryptoArbitrageApp') class AssetState: def __init__(self, amount): self.amount = amount class GraphDB(object): def __init__(self...
import numpy as np def expect(expected: np.ndarray, result: np.ndarray, rtol=1.e-4, **kwargs): assert expected.dtype == result.dtype assert expected.shape == result.shape assert np.allclose(expected, result, rtol=rtol, **kwargs) class GRU_Helper(): def __init__(self, **params): # GRU Input N...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Apr 10 18:34:50 2018 HOMEWORK 2: ML Pipeline @author: elenabg """ import sys import time import numpy as np import pandas as pd from pandas.plotting import table import matplotlib import matplotlib.pyplot as plt from matplotlib import interactive import ...
# -*- coding: utf-8 -*- # # This file is part of Radicale Server - Calendar Server # Copyright © 2008 <NAME> # Copyright © 2008 <NAME> # Copyright © 2008-2015 <NAME> # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free...
import numpy as np import cv2 import matplotlib.pyplot as plt import matplotlib.image as mpimg import pickle def abs_sobel_thresh(img, orient='x', sobel_kernel=3, thresh=(0,255)): # Apply the following steps to img # 1) Convert to grayscale gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY) # 2) Take th...
from __future__ import division import torch import torch.nn as nn import numpy as np from pcdet.models.model_utils.basic_block_2d import BasicBlock2D #from torch_scatter import scatter_mean from itertools import repeat class PointToBEV(nn.Module): def __init__(self, model_cfg, grid_size, pc_range, disc_cfg): ...
import ctypes, random, abc from functools import lru_cache, reduce """ Python module that works to manipulate IPv4/6 addresses, calculate Network/IP addresses. What you get: 1. ip validation by class or ip version 2. Generate IPv4/6, and Mac address bit by bit 3. Calculate IPv4/6 4. Light and fast You can...
### Plotting script. # --------------------------------------------------------------------------- # ### Import packages into environment. import pandas as pd from plotly.offline import plot import plotly.graph_objs as go from wordcloud import WordCloud import matplotlib.pyplot as plt from flask import session from ...
from __future__ import absolute_import, print_function import math import time import socket from operator import itemgetter from dpark.utils.tdigest import TDigest from dpark.utils.log import ( get_logger, make_progress_bar ) from dpark.hostatus import TaskHostManager from dpark.task import TaskState, TaskEndReas...
import numpy as np import datetime import math import torch from torch import nn from torch.utils.data import DataLoader, Dataset, TensorDataset import torch.optim as optim import torch.nn.functional as F from torch.nn.utils.weight_norm import WeightNorm from sklearn import metrics from sklearn.model_selection import...
from luna.datatypes.dimensional import PhysicalData, TimePoint, TimeSlot from luna.datatypes.dimensional import DataTimeSeries, PhysicalDataTimePoint, PhysicalDataTimeSlot, DataTimePoint, DataPoint, DataTimeSlot from luna.datatypes.dimensional import DataTimeSeries as DataTimePointSeries from luna.storages import Stora...
# Copyright 2020 by <NAME> <<EMAIL>>. # All rights reserved. # This file is part of the Intsa Term Client - X2Go terminal client for Windows, # and is released under the "MIT License Agreement". Please see the LICENSE # file that should have been included as part of this package. import paramiko from TunServer import ...
# noqa: E501 # surpress info logs of TF , level 2: no warnings, level 3 no errors import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1' import tensorflow as tf # dynamically allocate GPU memory physical_devices = tf.config.list_physical_devices('GPU') try: tf.config.experimental.set_memory_growth(physical_devices[0], Tr...
# -*- coding: utf-8 -*- # """*********************************************************************************************""" # Author [ <NAME> ] """*********************************************************************************************""" # The following code is modified from the # Self-Supervised Speec...
"""View file for Pynuts.""" import flask import jinja2 from flask_wtf import Form from wtforms import TextField from wtforms.fields.core import UnboundField from functools import wraps from werkzeug.utils import cached_property from werkzeug.datastructures import FileStorage from sqlalchemy.orm import class_mapper fro...
"""Assemble the Factor Graph model with neural scoring factors. Train the model with Sample Rank loss and inference with Gibbs Sampling. """ import os import time import copy import logging import uuid from typing import Dict, List, Tuple, Callable, Union import torch from torch import Tensor import torch.nn as nn imp...
import logging import math import random import time from datetime import timedelta, datetime, date from typing import Generator, Iterable, Tuple, Dict, Callable, Union from common.enums.entity import Entity from common.enums.jobtype import JobType, detect_job_type from common.enums.reporttype import ReportType from ...
# pycrypto library # https://pypi.python.org/pypi/pycrypto/ # https://pythonhosted.org/pycrypto/ import base64 import itertools # import secrets import os # TODO use Python 3.6 secrets import random from Crypto.Cipher import AES import util import xor BLOCK_SIZE = 16 def pkcs7pad(text, length): # Common paddi...
#!/usr/bin/env python # Copyrigh 2018 <EMAIL> # MIT Licence from __future__ import print_function import os, sys, argparse, datetime, shutil import numpy as np import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.nn.utils.rnn import pack_padded_sequence, pad_pac...
#!/usr/bin/env python3 # coding: utf-8 # Copyright 2020 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 ...
import glob import cv2 import numpy as np from Line import Line src_points = np.float32([[576, 464], [710, 464], [1045, 677], [267, 677]]) dst_points = np.float32([[200, 0], [1000, 0], [1000, 700], [200, 700]]) ym_per_pix = 30 / 720 # meters per pixel in y dimension xm_per_pix = 3.7 / 800 # meters per pixel in x d...
import pandas as pd import numpy as np from understatapi import UnderstatClient understat = UnderstatClient() import warnings warnings.filterwarnings('ignore') import random random.seed = 2 big_data_set = pd.read_csv('big_matches_set.csv') other_matches = pd.read_csv('next_games.csv') def get_first_team(s): ...
#!/usr/bin/env python3.8 # -*- coding: utf-8 -*- import sys import os import re from time import sleep, time as now from ipaddress import ip_address, ip_network, ip_interface, IPv4Network from io import StringIO from subprocess import getoutput, getstatusoutput from pkg_resources import parse_version from functools im...