text
stringlengths
6.04k
39.5k
#!/usr/bin/env python3 import rospy import sys import moveit_commander import numpy as np import yaml from eager_core.utils.file_utils import substitute_xml_args from easy_handeye_msgs.srv import ComputeCalibration, ComputeCalibrationRequest, TakeSample from moveit_msgs.srv import GetStateValidityRequest, GetStateVali...
# # MIT License # # (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP # # 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...
''' Utils for io, language, connectivity graphs etc ''' import os import sys import re sys.path.append('build') import MatterSim import string import json import time import math from collections import Counter, defaultdict import numpy as np import networkx as nx import prettytable as pt import logging logger = loggi...
import numpy as np import subprocess import re import logging from astropy.time import Time from vcstools.config import load_config_file logger = logging.getLogger(__name__) # Custom Errors class LittleClipError(Exception): """Raise when not enough data is clipped""" pass class LargeClipError(Exception): ...
""" """ import numpy as np from scipy.signal import convolve2d, fftconvolve import time def attenuation_border_matrix(nz, nx, pad=20, factor=0.015): """A matrix used to avoid reflection on borders. Parameters ---------- nz, nx : int Number of samples in vertical and horizontal directions. N...
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
from aniachi.systemUtils import Welcome as W from wsgiref.simple_server import make_server from pyramid.config import Configurator from pyramid.response import Response from pyramid.httpexceptions import HTTPFound from pyramid.response import FileResponse from pyramid.view import view_config from pyramid.httpexcepti...
#!/usr/bin/env python # -*- coding: utf-8 -*- from typing import Dict, Iterator, List, Optional, Union, Literal, Tuple import pandas as pd import numpy as np from collections import defaultdict from sklearn.cluster import KMeans from sklearn.manifold import SpectralEmbedding from sklearn.metrics import ( mean_squar...
from django.shortcuts import render, redirect from django.contrib import messages from sqlalchemy import inspect import sqlalchemy import pandas as pd import ast import numpy as np from sqlalchemy.sql import exists import xgboost as xgb import plotly.express as px import plotly.io as pio import plotly.graph_objs as po ...
# -*- coding: utf-8 -*- """ Functions for cleaning and processing the AHBA microarray dataset """ import logging from pkg_resources import resource_filename import nibabel as nib import numpy as np import pandas as pd from scipy.spatial.distance import cdist from . import io, utils lgr = logging.getLogger('abagen')...
# -*- coding: utf-8 -*- # Copyright 2015, the xonsh developers. All rights reserved. """Helpers to activate an environment and prepare the environment variables for the kernel. Copied from xonsh""" # Changes from xonsh: # - replace the xonsh environment cache with os.environ # - remove aliases and func handling -> we ...
''' OnionPerf Authored by <NAME>, 2015 Copyright 2015-2020 The Tor Project See LICENSE for licensing information ''' import matplotlib; matplotlib.use('Agg') # for systems without X11 from matplotlib.backends.backend_pdf import PdfPages import time from abc import abstractmethod, ABCMeta import matplotlib.pyp...
# Copyright 2016 Autodesk Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
""" Core libraries for the tracker. """ import time import os import threading import queue import smbus import serial import wiringpi import pynmea2 import pynmea2.types.talker from bme280 import bme280, bme280_i2c from ina219 import INA219, DeviceRangeError import picamera # pylint: disable=import-error class Came...
from Crypto import Random from Crypto.Cipher import AES import PIL.Image import wave from tkinter import * import tkinter as tk from tkinter import filedialog, Text, simpledialog, messagebox import numpy as np import struct import os #AES şifreleme # AES anahtarı key = b'\<KEY>' # gerekli box size için mesaja ekleme...
import pygame from pygame.locals import * import sys import pyganim # used for animations import random import time pygame.init() pygame.mixer.init() pygame.font.init() clock = pygame.time.Clock() # Game Variables running = True killcount = 0 WINDOWWIDTH = 1600 WINDOWHEIGHT = 900 mainwin = p...
import numpy as np import torch import torch.nn as nn import torch.optim import torch.nn.functional as F from torch.autograd import Variable import copy,math,time def clones(module, N): # return a list of copied module return nn.ModuleList([copy.deepcopy(module) for _ in range(N)]) def attention(query,key,val...
""" This module provides different parsers (children of :class:`Parser`) to obtain the necessary data to fill Anki-Cards. Each parser returns a dict, that can directly be used by the :meth:`pt_word.Word.update_from_dict` method of the :class:`pt_word.Word` class. """ import asyncio import re from collections import de...
"""SMF specs from photonics.byu.edu/FiberOpticConnectors.parts/images/smf28.pdf MFD: - 10.4 for Cband - 9.2 for Oband TODO: - verify with lumerical sims - enable mpi run from python """ import sys from functools import partial from typing import Any, Dict, Optional, Tuple import hashlib import time import pathli...
# ___________________________________________________________________________ # # Prescient # Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC # (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain rights in this software. # This software is ...
import numpy as np import cv2 as cv import matplotlib.pyplot as plt import scipy.linalg import scipy.optimize import plotly.graph_objects as go from itertools import combinations from relation import Relation from random import randint from math import atan2, sqrt, sin, cos, acos def calibrate(fname, num_corn, blk_si...
""" ========================================================================= This file is part of LyX Notebook, which works with LyX but is an independent project. License details (MIT) can be found in the file COPYING. Copyright (c) 2012 <NAME> =======================================================================...
# -*- coding: utf-8 -*- #Copyright 2015 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 # # U...
from __future__ import absolute_import from __future__ import division from __future__ import print_function ## to call it from cammand lines import sys import os from argparse import ArgumentParser import shutil from DeepJetCore.DataCollection import DataCollection from DeepJetCore.DJCLosses import * from DeepJet...
import numpy as np import nibabel as nib import torch import csv import shutil import cv2 import matplotlib.pyplot as plt import os from scipy.ndimage.filters import gaussian_filter #import SimpleITK as sitk import matplotlib.pyplot as plt def Draw_rect(img_array, color=[]): s1, s2, s3 = np.shape(img_array) i...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # clever.py # # Compute CLEVER score using collected Lipschitz constants # # Copyright (C) 2017-2018, IBM Corp. # Copyright (C) 2017, <NAME> <<EMAIL>> # and <NAME> <<EMAIL>> # # This program is licenced under the Apache 2.0 licence, # contained in the LICE...
__author__ = "<NAME>" __email__ = "<EMAIL>" import os, copy, uuid, sys import solutiondescription, solution_templates import logging import util import numpy as np def is_PCA_solution(basic_solution): length = len(basic_solution.primitives) python_path = basic_solution.primitives[length-2].metadata.query()['p...
# ------------------------------------------------------------------ # PyTorch implementation of # "ROAM: Recurrently Optimizing Tracking Model", CVPR, 2020 # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> (<EMAIL>) # ------------------------------------------------------------------ fro...
from __future__ import print_function import theano import numpy as np,sys,h5py,cPickle,argparse,subprocess from hyperopt import Trials, STATUS_OK, tpe from hyperas import optim from os.path import join,dirname,basename,exists,realpath,isdir from os import system,chdir,getcwd,listdir,makedirs from keras.models import m...
# The Leginon software is Copyright 2004 # The Scripps Research Institute, La Jolla, CA # For terms of the license agreement # see http://ami.scripps.edu/software/leginon-license # # $Source: /ami/sw/cvsroot/pyleginon/leginon.gui.wx/MosaicClickTargetFinder.py,v $ # $Revision: 1.36 $ # $Name: not supported by cvs2svn $ ...
# -*- coding: utf-8 -*- """ Created on Fri Oct 1 18:00:11 2021 @author: kylei """ # -*- coding: utf-8 -*- """ Created on Sun Jul 18 16:03:21 2021 @author: kylei """ import numpy as np import matplotlib.pyplot as plt import pandas as pd import time from sklearn.model_selection import KFold, train_test_split from sk...
from pprint import pprint from typing import List, Dict from model.DomObject import DomObject from model.IrisClothing import IrisClothing, Skill from service.LxmlScrapingService import LxmlScrapingService from service.ScrapingService import ScrapingService from service.i_database_service import IDataBaseService from s...
import unittest import subprocess import os import shutil import sqlite3 import re from lxml import etree from tempfile import mkdtemp class BaseTest(unittest.TestCase): testdir = 'tests' fixdir = os.path.join(os.getcwd(), testdir, 'fixtures') outdir = os.path.join(os.getcwd(), testdir, 'test_output') ...
import os import sys import re import difflib def is_unfinished_str(term): return term.count('"') % 2 == 1 def remove_empty_str(lis): new_list = [] for i in lis: if len(i) > 0: new_list.append(i) return new_list def term_present(sentence): if 'Grammar' in sentence or 'Entry:' ...
# python imports from typing import List from pathlib import PurePath import os import io from glob import glob import inspect import operator as op from functools import lru_cache from itertools import chain from collections import OrderedDict from contextlib import contextmanager # scipy stack import numpy as np from...
import torch import torch.nn as nn from torch.autograd import Variable import math import torch.nn.functional as F from capreolus.reranker.common import create_emb_layer, SimilarityMatrix, RbfKernelBank from capreolus.utils.loginit import get_logger from capreolus.reranker import Reranker logger = get_logger(__name_...
""" Module defining source surface-brightness distributions. ---- .. include license and copyright .. include:: ../include/copy.rst ---- .. include common links, assuming primary doc root is up one directory .. include:: ../include/links.rst """ import warnings import numpy from scipy import signal, special, inte...
# Authors # Original: https://github.com/zcaceres/spec_augment # Improved: https://github.com/bobchennan/sparse_image_warp_pytorch import random import torch import torchaudio from torchaudio import transforms import os import numpy as np def sparse_image_warp(img_tensor, source_control_poin...
import argparse import os, sys import numpy as np import itertools import datetime import time import signal import torchvision.transforms as transforms from torchvision.transforms.functional import InterpolationMode from torchvision.utils import save_image, make_grid from torch.utils.data import DataLoader from tor...
from __future__ import division, print_function, absolute_import import argparse import functools import json import logging import math import os import random import numpy as np import pandas as pd import tensorflow as tf import tqdm try: tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) except: ...
# Copyright 2018-2020 Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH # 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/LICENS...
#!/usr/bin/env python from __future__ import print_function import os import ssl import time import sys import logging import contextlib import concurrent.futures import threading import multiprocessing import six from irods.data_object import iRODSDataObject from irods.exception import DataObjectDoesNotExist import ...
import yaml import logging import argparse import numpy as np from pathlib import Path from copy import deepcopy from sklearn.metrics.cluster import adjusted_rand_score import sys sys.path.append("..") from mudcod.dcbm import MuSDynamicDCBM # noqa: E402 from mudcod.muspces import MuSPCES # noqa: E402 from mudcod.p...
# Load and dump a CAN database in SYM format. import re import logging from collections import OrderedDict as odict from decimal import Decimal import textparser from textparser import Sequence from textparser import choice from textparser import ZeroOrMore from textparser import ZeroOrMoreDict from textparser import...
# Copyright Contributors to the Testing Farm project. # SPDX-License-Identifier: Apache-2.0 import re import gluetool from gluetool.utils import cached_property, IncompatibleOptionsError, normalize_path, normalize_shell_option, \ PatternMap, render_template from gluetool.log import log_blob, log_dict import...
############################################################################## # # Copyright (c) 2015 Twist Bioscience # # File: app/routes/spreadsheet.py # # These are the handlers for all spreadsheet related # JSON/REST API routes used by this application. # ###########################################################...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from os import stat import unicodedata import os.path from functools import reduce import numpy import pkg_resources import regex as re import unicodecsv as csv from panphon import featuretable from . import xsampa fr...
"""Unit tests for orbitpy.propagator module. """ import json import os, shutil import sys import unittest import random import numpy as np import pandas as pd from orbitpy.util import OrbitState, Spacecraft from orbitpy.propagator import PropagatorFactory, PropagatorOutputInfo, J2AnalyticalPropagator import orbitpy.pr...
""" Copyright 2021 Objectiv B.V. """ import re from dataclasses import dataclass from typing import Optional, Union, TYPE_CHECKING, List, Dict, Tuple, Set, Sequence from sqlalchemy.engine import Dialect from sql_models.model import escape_raw_sql from sql_models.util import quote_string, quote_identifier if TYPE_CHE...
#The MIT License # #Copyright (c) 2017 DYNI machine learning & bioacoustics team - Univ. Toulon # #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 limitatio...
import logging import math import time import traceback from struct import pack, unpack from threading import Thread from pylgbst.constants import PORTS, MSG_SENSOR_SUBSCRIBE, COLOR_NONE, COLOR_BLACK, COLORS, MSG_SET_PORT_VAL, PORT_AB, \ MSG_DEVICE_INFO, INFO_BUTTON_STATE, INFO_ACTION_SUBSCRIBE, INFO_ACTION_UNSUBS...
from tempfile import mkdtemp from typing import Iterable, Union, Tuple, Sequence import numpy # Skipping coverage count - can't test properly try: # pragma: no cover import pycuda.driver as pycuda_driver import pycuda.compiler as pycuda_compiler except ImportError: # pragma: no cover # these variables are...
import typing import weakref from abc import ABC from jvm.util import decode_cp_constant from jvm.util import pop_sized from jvm.util import pop_u1 from jvm.util import pop_u2 from jvm.util import pop_u4 from jvm.util import U2 from jvm.util import U4 from jvm.JavaExceptionStack import StackCollectingException import ...
import os import zipfile import pandas as pd import pymongo as pym import time from datetime import datetime import numpy as np infty = 1000000 def printGtfsDate(directoryGTFS): print("interval of validity of the gtfs files") for filename in os.listdir(directoryGTFS): if filename.endswith(".zip"): ...
# -*- coding: utf-8 -*- """ Created on Wed Jul 7 16:01:12 2021 @author: misae """ import numpy as np import matplotlib.pyplot as plt import numba as nb import scipy.interpolate from scipy import integrate from shapely.geometry import Point, Polygon # Graphs configuration import locale locale.setlocale(locale.LC_N...
"""Module dedicated to the visualization of a Decision Tree.""" import typing as t import inspect import collections import sklearn.tree import sklearn.ensemble import sklearn.metrics import sklearn.preprocessing import sklearn.impute import sklearn.base import numpy as np import scipy.cluster.hierarchy import pymfe.m...
from datetime import datetime as dt from random import * import ipaddress import json import math import string import uuid DEBUG = False NET_SUMMARY = False def update_timestamps(nodes): for node in nodes: node['record']['timestamp'] = str(dt.now()) def _randstring(size): return ''.join(choice(str...
from dataclasses import dataclass from unittest import expectedFailure from fffw.encoding import filters, codecs, ffmpeg, inputs, outputs from fffw.graph import * from fffw.wrapper import ensure_binary, param from tests.base import BaseTestCase @dataclass class FFMPEG(ffmpeg.FFMPEG): realtime: bool = param(name=...
import torch import torch.nn as nn import torch.nn.functional as F import math class BasicConv2d(nn.Module): def __init__( self, in_planes, out_planes, kernel_size, stride=1, padding=0, dilation=1 ): super(BasicConv2d, self).__init__() self.conv = nn.Conv2d( in_planes, ...
#!/usr/bin/python # -*- coding: utf-8 -*- import pycrfsuite import os import re import warnings from collections import OrderedDict import string from .ratios import ratios from .abbrevs import job_abbrevs, street_abbrevs from .known_jobs import job_freqs # _____________________ # |1. CONFIGURE LABELS! | # |________...
import os import os.path as osp import re import sys import enum import typing as tp import itertools as it from typing import Union, List, Tuple, Dict, Sequence, Iterable, TypeVar, Any, Callable, Sized, NamedTuple, Optional from functools import partial import bk_ds_libs.bk_data_processing import bk_general_libs.bk_...
import appdirs import atexit import os import shelve import pickle import glob import logging import tkinter as tk from pathlib import Path from collections import defaultdict from hoverset.data.utils import make_path from hoverset.ui.dialogs import MessageDialog from hoverset.ui.widgets import * __all__ = ( "Sha...
# Copyright 2021 The Scenic Authors. # # 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...
# new version 28/11/2018 import math import os import random import sys import pygame as pg import numpy as np import matplotlib.pyplot as plt from peepo.playground.hawk.Raptor_model import RaptorModel from peepo.playground.hawk.Pigeon import PigeonActor vec = pg.math.Vector2 CAPTION = "Raptor 's World" SCREEN_SIZE =...
import numpy as np import matplotlib.pyplot as plt import scipy import scipy.signal def dynet_ar2pdc(KF,srate,freqs,metric = 'sPDC',univ = 0,flow = 1,PSD = 0, gauss_filt=False): """ Obtain PDC, sPDC, info-PDC from tvAR coeffients M.Rubega, D.Pascucci, 17.10.2018 ...
import torch import torch.nn as nn import torch.optim as optim from torch.distributions import Categorical from network.teacher_model.teacher_mlp import teacher_mlp from network.student_model.resnet import resnet32, _weights_init from dataset.data_loader import data_loader_func from utils.setseed import setup_seed fr...
# 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 # d...
import sqlalchemy as sa import www.database as db from sqlalchemy.orm.attributes import flag_modified import bcrypt # for passwords import hashlib # for invitation tokens import string # Template from json import dumps, loads from sqlalchemy.ext.mutable import Mutable #class JSON_Mutable(sa.types.TypeDecorator, Mu...
from cs50 import SQL from flask import Flask, jsonify, redirect, render_template, request, session from flask_session import Session from tempfile import mkdtemp from werkzeug.exceptions import default_exceptions, HTTPException, InternalServerError from werkzeug.security import check_password_hash, generate_password_ha...
import os import sys import numpy as np import torch import argparse import _pickle as pkl from pathlib import Path import matplotlib.pylab as plt from matplotlib import rcParams import seaborn as sea sea.set_style("whitegrid") import random from random import uniform from .Protein import Protein from .Complex impo...
import json import numpy as np import scipy as sp from math import sqrt from scipy.linalg import solve from scipy.linalg import lstsq from spatial import make_othro_array from spatial import point_array_distance from spatial import make_spatial_matix from spatial import point_to_points_distance from plotting import p...
from enum import IntEnum from itertools import chain from typing import List from ...utils.byte_io_mdl import ByteIO from ..common import Matrix, CTransform from .base_block import DataBlock class KeyValueDataType(IntEnum): STRUCT = 1 ENUM = 2 POINTER = 3 STRING = 4 UBYTE = 10 BYTE = 11 ...
from base64 import b64decode from random import choice, randint from typing import Any, Dict, List, Optional, Tuple, Union from algosdk import account, encoding, mnemonic from algosdk.future import transaction from algosdk.kmd import KMDClient from algosdk.logic import get_application_address from algosdk.v2client.alg...
import pronotepy import os from datetime import date from datetime import timedelta import json import logging import math import ent #Variables #studentname="demo" #nom de votre enfant - ne sert que pour le nom du fichier json #prefix_url = "....." # sert au prefix de l'url https://PREFIX.index-education.net/pronot...
import tensorflow as tf import math import numpy as np def gaussian_kernel(x, precision=None, normalizer=None): ''' A multi-dimensional symmetric gaussian kernel ''' dimension = x.get_shape().as_list()[1] kernel = tf.scalar_mul(tf.pow(tf.abs(precision), dimension), tf.exp(- tf.scalar_mul(tf.pow(pre...
import time import wandb import os import numpy as np from itertools import chain import torch import imageio from onpolicy.utils.util import update_linear_schedule from onpolicy.runner.shared.base_runner import Runner from pathlib import Path import copy def _t2n(x): return x.detach().cpu().numpy() class Highway...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This Parameters module is a container for all possible parameters and all ways in which they are adapted by various optimization methods. """ from __future__ import absolute_import, division, print_function, unicode_literals __author__ = '<NAME> <<EMAIL>>' from modea....
''' Tablut states evaluation functions ''' import tablut_player.utils as utils import tablut_player.game_utils as gutils import tablut_player.config as conf from tablut_player.game import TablutGame from tablut_player.board import TablutBoard from tablut_player.game_utils import ( TablutBoardPosition as TBPos, ...
# Copyright [2017-2021] [IBM Corporation] # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 28 00:27:52 2018 @author: work """ import numpy as np import cv2 import time from cv2 import GaussianBlur from skimage.segmentation import find_boundaries import pandas as pd from load import load_from_cache,save_to_cache, get_ax, k2 from params im...
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
#!/usr/bin/env python r""" This module provides functions which are useful to plug-ins call-point programs that wish to make external robot program calls. """ import sys import os import subprocess import re import time import imp import gen_print as gp import gen_valid as gv import gen_misc as gm import gen_cmd as ...
############################################## # This code is based on samples from pytorch # ############################################## # Writer: <NAME> from __future__ import print_function import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # see issue #152 os.environ["CUDA_VISIBLE_DEVICES"] = "0" impo...
"""Documenter module docstring.""" import ast import importlib import inspect import os import re import textwrap from collections import namedtuple from functools import lru_cache from types import ModuleType from typing import Any, Callable, Dict, GenericMeta, List, Optional, Pattern, Tuple, Type, Union RECURSIVE_N...
from copy import copy as shallow_copy from dataclasses import dataclass, field import collections.abc import functools import inspect from contextlib import contextmanager from itertools import count from typing import TypeVar, Generic, Optional, List, Tuple, Sequence, Iterable, Iterator, Any, Callable, Dict def get...
#!/usr/bin/python import time from datetime import datetime import threading from flask import Flask, Response, jsonify import requests import os import math import sys import busio import digitalio import board from collections import OrderedDict import json import graphyte # Adafruit Modules # MCP 3008 import ada...
#!usr/bin/env python # -*- coding: utf-8 -*- # author: kuangdd # date: 2019/11/30 """ ### audio_griffinlim griffinlim声码器,线性频谱转语音,梅尔频谱转语音,TensorFlow版本转语音,梅尔频谱和线性频谱相互转换。 """ from pathlib import Path import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(Path(__file__).stem) import librosa imp...
# encoding:UTF-8 import json import os import platform import sys import time from Queue import Queue from threading import Thread from time import sleep import requests # 首先获取漫画的基本信息 from pyquery import PyQuery as pq from requests.exceptions import ConnectionError, ReadTimeout, TooManyRedirects, RequestException imp...
from PyQt5.QtWidgets import QWidget, QGridLayout, QLabel, QCheckBox, QLineEdit, QComboBox,\ QListWidget, QListWidgetItem, QPushButton from PyQt5.QtGui import QFont, QPicture, QPainter from PyQt5.QtCore import Qt, QPointF, QRectF import numpy as np import pyqtgraph as pg import stockstats fro...
# -*- coding: utf-8 -*- from .constants import * import numpy as np import scipy.io as sio import csv PARITY_MAT = np.array([[1,1,1,0,1,1,0,0,0,1,1,1,1,1,0,0,1,1,0,1,0,0,1,0], [0,1,1,1,0,1,1,0,0,0,1,1,1,1,1,0,0,1,1,0,1,0,0,1], [1,0,1,1,1,0,1,1,0,0,0,1,1,1,1,1,0,0,1,1,0,1...
# import time import pandas import itertools import numpy import json import sqlalchemy from tinkoff_api.quotes_loader import call_them_all from m_utils.transform import lag_it, percent_it, fill_it def sql_formatting(x): return str(x).replace('[', '').replace(']', '').replace("'", '') class Loader: def __...
import tkinter as tk from tkinter import Label, StringVar, Variable, filedialog, Text, Scrollbar, Checkbutton, IntVar, Button, Entry from tkinter.constants import HORIZONTAL, LEFT from tkinter.font import Font from tkinter import ttk import time # from classes.folder_organizer_v2 import FolderOrganizer # ===...
import torch import torch.nn as nn import torch.nn.functional as F import math from mflow.models.hyperparams import Hyperparameters from mflow.models.glow import Glow, GlowOnGraph def gaussian_nll(x, mean, ln_var, reduce='sum'): """Computes the negative log-likelihood of a Gaussian distribution. Given two va...
import copy import json import unittest from typing import Any, Dict import avro.schema # type: ignore from wicker import schema from wicker.core.errors import WickerSchemaException from wicker.schema import dataloading, dataparsing, serialization from wicker.schema.schema import PRIMARY_KEYS_TAG from wicker.testing...
import numpy as np import time import corner from joblib import Parallel, delayed from astropy.io import fits start_time = time.time() model = '6d_coarse' output_map = 'bestfit' sou_model = 'radex_model/' sou_data = 'data_image/' nobs = 6 # Apply mask or set up constraints if using priors (optional) # mask = np.loa...
#! /usr/bin/env python import json, os, sys, csv, pimms, glob import nibabel as nib output_dir = '/flywheel/v0/output' input_dir = '/flywheel/v0/input' config_file = os.path.join(input_dir, 'config.json') bids_dir = os.path.join(input_dir, 'BIDS') # bids_link = '/running/out' # Fix so that it works in Singula...
from HiParTIPy.PtiCffi import pti,PTI import HiParTIPy.Vector as vec from math import sqrt import os as os import sys class COOMatrix: def __init__(self): self.address = pti.new("ptiSparseMatrix *") self.nthreads = (int)(os.popen('grep -c cores /proc/cpuinfo').read()) self.map = None ...
import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import joblib import plotly.graph_objs as go import dash_table import dash_bootstrap_components as dbc from sklearn import svm from sklearn.neighbors import KNeighborsRegressor from sklearn.ens...
import os import json from maya import cmds as mc from maya import OpenMaya as legacy from maya.api import OpenMaya as om from itertools import chain from . import dagutils import logging logging.basicConfig() log = logging.getLogger(__name__) log.setLevel(logging.INFO) COLOUR_RGB = {0: [1.0, 1.0, 0.0], 1: [0.0, 0...
import abc from copy import deepcopy from typing import List, Tuple, Optional import mlflow import numpy import torch from torch import Tensor from torch.nn import Module, Linear, Parameter from torch.nn.init import eye_, zeros_, xavier_uniform_ from torch.optim import Optimizer, Adam from torch.utils.data import Tens...