text
stringlengths
6.04k
39.5k
# Copyright 2022 The Forte Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
import getpass import os import sys import errno import signal import select import termios import tty if sys.version_info.major >= 3: # For mypy PEP-484 static typing validation from six import text_type # NOQA from typing import Dict # NOQA from typing import List # NOQA from typing import Tup...
#!/usr/bin/env python """ WorkupT1T2BRAINSCut.py =========================== Description: Author: Usage: """ from builtins import str import nipype.pipeline.engine as pe # pypeline engine from nipype.interfaces.semtools import * from nipype.interfaces.utility import Merge, Function, IdentityInterface from PipeLin...
import warnings import napari from napari.layers import Labels from PyQt5 import QtWidgets from qtpy.QtWidgets import QWidget, QPushButton, QLabel, QHBoxLayout, QVBoxLayout, QComboBox from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt5agg import Navigati...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function, unicode_literals) import argparse import requests import time import datetime import pandas as pd from bs4 import BeautifulSoup from dateutil.parser import parse from collections import defaultdict try: from urllib import urlencode...
# -*- coding: utf-8 -*- """ Custom sensor component to access another custom data logger (`enerweb`) It updates sensor last values accessing them directly via remote MYSQL DB. ``` SQL_ALCHEMY URI: mysql+cymysql://{}:{}@{}/data_enerweb SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = "{}" ...
"""Script to create index, date and tag pages. """ import codecs import datetime import os import sys import time from functools import total_ordering from docutils.core import publish_parts from docutils.writers.html4css1 import Writer from jinja2 import Environment from jinja2 import FileSystemLoader from create_ta...
import math import numpy as np import tensorflow as tf from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework import random_seed from tensorflow.python.ops import array_ops from tensorflow.python.ops import control_flow_ops from tensorflow.python.ops ...
### File: JohnsonTrotter.py ### Author: <NAME> ### CSCI 0262 Algorithms ### ### ### ### Modification Log: ### ### import time ### --------------------------------------------------- ### ### PART A, CLASSES AND METHODS ### ### --------------------------------------------------- ### # The El...
from .data import * from .tf_util import * from .util import delete_if_exists, ensure_dir from .config import PinkyConfig from .optimize import Optimizer from . import plot import functools import tensorflow as tf import tempfile from pyrocko import guts, util as putil, io from pyrocko import trace from pyrocko.guts i...
#!/usr/bin/env python # coding: utf-8 # <!-- Copyright 2020 InterDigital Communications, 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...
from __future__ import annotations import enum from dataclasses import dataclass from datetime import date from typing import ( AbstractSet, FrozenSet, Mapping, NamedTuple, Optional, Sequence, Set, Tuple, Union, ) import orjson from pocketutils.core.dot_dict import NestedDotDict fr...
#!/usr/bin/env python3 import argparse import base64 import html import http.server import mimetypes import os import posixpath import re import shutil import ssl import sys import urllib.error import urllib.parse import urllib.request from http.server import HTTPServer from io import BytesIO class UploadHTTPRequest...
from __future__ import absolute_import, division, print_function from collections import defaultdict import fnmatch from functools import partial from glob import glob import io import locale import re import os import stat from subprocess import call, check_output import sys try: from os import readlink except Im...
#!/usr/bin/env python # Copyright (c) 2014 Cloudera, Inc. 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 requi...
import pymysql as sql import boto3 from datetime import datetime, timedelta import pickle import sys import time from multiprocessing import Manager, Process, Lock import os, signal import re from .capture import * from .communications import ComManager from .analytics import _get_capture_replay_list #db_id = "pi" #...
# -*- coding: utf-8 -*- import os import logging import glob import json import argparse import math import codecs from collections import OrderedDict from tqdm import tqdm, trange import numpy as np import torch import random import pickle import sys sys.path.append('/data/private/chenyutong/VLP/') sys.path.append('/d...
import json import math import matplotlib #matplotlib.use("TkAgg") import matplotlib.pyplot as plt try: import NNModels except: import speedcom.NNModels as NNModels import numpy as np import os import pandas as pd from rdkit import Chem import rdkit.Chem.Draw as draw #import speedcom #import core #import rdki...
import cv2 import os import numpy as np import random import math from deap import base from deap import creator from deap import tools from deap.tools.support import HallOfFame from drawer import * from joblib import Parallel, delayed from joblib import parallel_backend import logging as logging import matplotlib...
import pandas as pd import numpy as np import tensorflow as tf import time import re import pickle news = pd.read_excel("data/news.xlsx") news.drop(['Source ', 'Time ', 'Publish Date'], axis=1, inplace=True) document = news['Short'] summary = news['Headline'] # for decoder sequence summary = summary.apply(lambda x:...
# Z80 Smart Disassembler # by <NAME> # with some code from https://github.com/deadsy/py_z80/blob/master/z80da.py # Disark Documentaiton: http://julien-nevo.com/disark/ #TODO/FIXME: # Using external symbol files for dot graph from z80da import disassemble from z80cpc import checkFirmwareVector import subprocess import ...
import json import logging import re from collections import defaultdict from urllib.parse import parse_qs, urlencode, urlparse from django.conf import settings from django.db.models import Case, Value, When from django.http import HttpResponse, JsonResponse from django.shortcuts import redirect from django.urls impor...
import torch import torch.nn as nn import torch.utils.data as data from torch.utils.data import DataLoader from tqdm import tqdm import random import logging logger = logging.getLogger() # from transformers import BertTokenizer # bert_tokenizer = BertTokenizer.from_pretrained('bert-base-cased') from src.config impor...
#!/usr/bin/python3 # Author: GMFTBY # Time: 2019.9.15 import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils import clip_grad_norm_ import torch.optim as optim import random import numpy as np import argparse import math import pickle from tqdm import tqdm from torch.utils.tensorboard i...
import math import random import numpy as np from easydict import EasyDict as edict # coco joints kps_sigmas = np.array([ .26, .25, .25, .35, .35, .79, .79, .72, .72, .62, .62, 1.07, 1.07, .87, .87, .89, .89]) / 10.0 num_kps = 17 kps_symmetry = ((1, 2), (3, 4), (5, 6), (7, 8), (9, 10), (11, 12), (13, 14)...
from enum import Enum from string import Template import typing as tp from racketinterpreter.classes import data as d from racketinterpreter.classes import tokens as t # The function kwargs.get() is used instead of the selector kwargs[] to make sure that the error message never fails, # regardless of if the correct ke...
#!/usr/bin/env python # coding:utf-8 #---------------------------------------------------------------------------- # Copyright (c) Huawei Technologies Co., Ltd. 2018-2020. All rights reserved. # iTrustee licensed under the Mulan PSL v2. # You can use this software according to the terms and conditions of the Mulan # PS...
from __future__ import print_function from securityhandlerhelper import securityhandlerhelper dateTimeFormat = '%Y-%m-%d %H:%M' import arcrest from arcrest.agol import FeatureLayer from arcrest.agol import FeatureService from arcrest.ags import FeatureService from arcrest.hostedservice import AdminFeatureService fr...
""" this module is for parsing and executing boolean queries Author : <NAME> 2021/10/23 19:10 pm """ from typing import List import abc from utils import LimitedList from time import sleep from nltk.sem.logic import ( AndExpression, OrExpression, IndividualVariableExpression as TermExpression, Negated...
import unittest import tempfile from unittest import mock from pathlib import PurePosixPath, Path import json from requests import HTTPError import numpy as np from one.api import ONE import iblutil.io.params as iopar from ibllib.oneibl import patcher, registration import ibllib.io.extractors.base from ibllib.misc im...
import gzip import json import csv import re import os from collections import defaultdict import io import celery from celery import chord from celery.result import allow_join_result from celery.utils.log import get_task_logger from django.conf import settings from django.db import IntegrityError, DatabaseError from ...
#!/usr/bin/env python __author__ = 'anthony <<EMAIL>>' from collections import defaultdict from collections import OrderedDict from copy import deepcopy from django.utils import timezone from django.conf import settings from django.http import HttpResponseRedirect from django.shortcuts import render from django.core.ur...
import pygame import random from connect_4 import CR_GREEN, CR_RED DEEP = 5 def max_list(l_in): l_out = [] for item in l_in: if len(l_out) == 0 or item[0] > l_out[0][0]: l_out = [item] elif item[0] == l_out[0][0]: l_out.append(item) return l_out def min_list(l_...
import torch import torch.nn as nn # Number of bottlenecks num_bn = 3 # The depth is half of the actual values in the paper because bottleneck blocks # are used which contain two convlutional layers depth = 16 multi_block_depth = depth // 2 growth_rate = 24 n = 256 n_prime = 512 decoder_conv_filters = 256 gru_hidden_...
# general import os from collections import Counter import heapq # Visualization import matplotlib.font_manager as fm import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sn from matplotlib.collections import QuadMesh from nltk.corpus import stopwords from nltk.stem import PorterSte...
"""This module contains utilities for methods.""" import logging from math import ceil from typing import Union import matplotlib.pyplot as plt import numpy as np import scipy.stats as ss import elfi.model.augmenter as augmenter from elfi.clients.native import Client from elfi.model.elfi_model import ComputationCont...
#!/usr/bin/env python # # <EMAIL> # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 # from __future__ import division import j...
import getopt import logging import multiprocessing import os import re import shlex import tempfile import time from urllib import parse import requests from PIL import Image from bs4 import BeautifulSoup, Tag from dogbot.cqsdk import CQImage from mongoengine import QuerySet, Q from selenium import webdriver from co...
#!/usr/bin/env python3 # ---------------------------------------------------------------------------- # Loading OSM data and doing routing with it # node_lat, node_lon = Router().data.rnodes[node_id][0], Router().data.rnodes[node_id][1] # ---------------------------------------------------------------------------- # Co...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from collections import OrderedDict from .operations_define import MSOPS,MSOPS_NO,NORMALSIZE,REDUCESIZE,get_OPs_for from .real_operation_module import ReLUConvBN,FactorizedReduce,AdaptiveBatchNorm2d def channel_shuffle(x,...
"""Calculate traffic light score, ORPs.""" # import csv import datetime import numpy as np import pandas as pd # parameters: first date first_date = '2020-03-16' # read data from UZIS url = "https://onemocneni-aktualne.mzcr.cz/api/v2/covid-19/orp.csv" df = pd.read_csv(url, delimiter=",") # correct ORP codes from UZ...
""" @name = 'roberta_wwm_ext_large' @author = 'zhangxinrui' @time = '2019/11/15' roberta_wwm_ext_large 的baseline版本 coding=utf-8 Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team. Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. Licensed under the Apache License, Version 2.0 ...
# import the necessary packages from __future__ import print_function import numpy as np import argparse import datetime import json import imutils import device_config as CONFIG import cv2 import time import pt_config2 import requests from threading import Thread from threading import Lock import prototy...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # %% imports import collections import glob import os import warnings import joblib import matplotlib.pyplot as plt import numpy as np from astropy import table from astropy.io import fits from twodspec import thar from twodspec.aperture import Aperture from twodspec.pol...
#!/usr/bin/env python # -*- coding: utf-8 -*- # author: <NAME> """ This section is dedicated to group all the components created for the Ares main web pages. They are all in this module to ensure that any change of them will not impact the user section. If you are a user and for some reason you are looking at...
from openvr import * import time import numpy as np #import pyshtools from pyquaternion import Quaternion from tracking import osc_input import matplotlib import matplotlib.pyplot as plt class Device(): def __init__(self, type, id, is_available=False, is_active = False): self.type = type self.id =...
import tensorflow as tf import numpy as np import HP from sklearn.metrics import roc_auc_score import logging from Embedding import Embedding from multiprocessing import Pool # log for the project logging.basicConfig(filename=HP.log_file_name, level=logging.INFO, format='%(asctime)s %(message)s') def generate_token_...
#!/usr/bin/env python from __future__ import (absolute_import, division, print_function, unicode_literals) import sys import os import argparse import subprocess import logging import shutil from Bio import SeqIO from amptk import amptklib class MyFormatter(argparse.ArgumentDefaultsHelpFormatt...
from copy import deepcopy import torch import math import os import re import shutil import glob import csv import operator import logging import numpy as np from collections import OrderedDict try: from apex import amp has_apex = True except ImportError: amp = None has_apex = False from torch import ...
import collections import ctypes import numpy import six from chainer import cuda from chainer import function from chainer.functions import concat from chainer.utils import conv from chainer.utils import type_check if cuda.cudnn_enabled: cudnn = cuda.cudnn libcudnn = cudnn.cudnn def _pair(x): if isins...
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 compliance with the License. # You may obtain a cop...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. """Class for storing training data for neural renderer training""" import numpy as np import os import sys import cv2 import glob import pickle import ntpath import json from collections import OrderedDict from sklearn.mixture import...
from typing import List import os from utils.merge_two_datastream import * from utils.hand_orientation import * from utils.orientation_mapping import * from annotations.CONSTANTS import * # LEFT_WRIST = 'leftwrist' # RIGHT_WRIST = 'rightwrist' # ax_left_filename = 'left-wrist-accelx.csv' # ay_left_filename = 'left-wri...
# Copyright (c) 2016 Civic Knowledge. This file is licensed under the terms of the # Revised BSD License, included in this distribution as LICENSE """ Create Markdown and HTML of datasets. most importantly, Create a documentation context data structure, a data structure that can be used to generate documentation, such...
# This script contains the base class of all examProject classes, and some # auxiliary methods. import os import copy import shutil import glob import _pickle as pickle from datetime import datetime from babel.dates import format_date import matplotlib.pyplot as plt import csv import pandas as pd impo...
import torch import matplotlib.pyplot as plt import os import math import numpy as np import pykeops import pickle from .dataset_utils import registration_pipeline, context_voxel_center from utils import (load_las, co_unit_sphere, extract_area, rotate_xy,get_voxe...
# ########################################################## # FlatCAM: 2D Post-processing for Manufacturing # # File Author: <NAME> (c) # # Date: 2/14/2020 # # MIT Licence # # ############################...
import os import cv2 as cv import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as patches from math import floor import argparse structure = np.array([5, 7, 6, 5]) * 2 # amount of chromosomes for each line chromosome_tags = np.array(range(1,24)) # basically the name that the ordered chromosome...
############################################################################### from functools import partial from math import sqrt from copy import deepcopy import operator, sys import json import pickle import pandas as pd import numpy as np from scipy.io import arff from sklearn.preprocessing import StandardScaler...
#!/usr/bin/python ################################################################################ # Filename: T2CFR.py # Created: ?? May 2017 # Author : <NAME> # Purpose: Take a text string from "Speech to Text" and use TextRazor to # convert to CFR format. #################################################...
""" Statistical model giving likelihoods for detecting a spectrum given a benchmark to compare it with. """ import os from sys import platform import numericalunits as nu import numpy as np from immutabledict import immutabledict from dddm import utils from dddm.priors import get_priors from dddm.recoil_rates import h...
#!/usr/bin/env python3 # # Copyright 2017 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unittests for input HTTP plugin.""" import http.client import logging import os import queue import shutil import tempfile im...
# -*- coding: utf-8 -*- """ Created on Tue Apr 5 11:05:56 2022 @author: olivi """ # %% Dependencies import os, fnmatch, socket, subprocess, re from pathlib import PurePosixPath, PureWindowsPath from datetime import datetime import numpy as np from fitness.private.struct import struct # %% class definitions class c...
from __future__ import absolute_import # -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> and <NAME> # -------------------------------------------------------- # -------------------------...
""" This module contains class definitions for memories used during training of the Q-network. """ import os import numpy as np import h5py import shutil class ScreenHistory(object): """A simple class to store the last N screen images in the batch. When we actually do train, we use the replay memory, this cl...
import random import string import traceback from ._types import Tweet, UserTweets, Media,ShortUser,User,Search,Trends,UserLegacy,Card from bs4 import BeautifulSoup as bs import requests as s UserTweets = UserTweets User = User Search = Search Trends = Trends UserLegacy = UserLegacy Card = Card def proxyFactory() -...
import pytest from datetime import datetime # from unittest import mock from xml.etree.ElementTree import fromstring from ..types.family import ( Family, add_to_clinic_notes, affected_xml_to_phenotypic_features, annotations_xml_ref_to_clinic_notes, cause_of_death_xml_to_phenotype, create_family...
# -*- coding: utf-8 -*- from skimage import io,transform import tensorflow as tf import numpy as np import glob import os from imgaug import augmenters as iaa # 定义一个函数,按批次取数据 def mini_batches(inputs=None, targets=None, batch_size=None, shuffle=False): assert len(inputs) == len(targets) if shuffle: indices = np.ara...
import concurrent.futures as futures import io import os from pathlib import Path import pickle import tqdm from PIL import Image import fire import skimage import numpy as np from second.core import box_np_ops from second.core import camera_transforms as cam_transforms class SynthiaVideoDataset: def __init__(s...
#!/usr/bin/env python # coding: utf-8 # In[2]: import numpy as np import pandas as pd import random import matplotlib.pyplot as plt from scipy.stats import multivariate_normal from sklearn.metrics import confusion_matrix # # Problem 1 (K-means) # In[2]: pi = [0.2,0.5,0.3] num_obs = 500 # In[3]: mean = np.ar...
from os.path import realpath, basename, isdir, splitext, join from os import walk, rename from math import floor, log, sqrt from random import choices, random import numpy as np import librosa from scipy.signal import get_window from sklearn.neighbors import NearestNeighbors from progress.bar import IncrementalBar from...
from torch_geometric.data import DataLoader import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.nn import Sequential, Linear, ReLU from torch_geometric.nn import (GINConv,global_mean_pool,GATConv,ChebConv,GCNConv) from libs.spect_conv import SpectConv,ML3Layer from libs.uti...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ EXTERNAL FILTER for Communigate Pro Server. The plugin is designed to integrate with DrWeb virus and spam detection services via Rspamd HTTP protocol The plugin is launched in CommuniGate Pro as External Filters. Tested with: drweb-mail-servers 11.1.0-1902252019 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from fipy import * import numpy as np import scipy.sparse as sp import scipy.sparse.linalg as la from scipy import signal as sign from scipy import optimize as opt from matplotlib import pyplot as plt import cma import parameterFunctions.immuneResponse as delt import param...
import gym import numpy as np import random import types import math import enum import warnings from collections import namedtuple import jsbgym_flex.properties as prp from jsbgym_flex import assessors, rewards, utils from jsbgym_flex.simulation import Simulation from jsbgym_flex.properties import BoundedProperty, Pro...
from dataclasses import dataclass from enum import Enum from typing import Mapping, Union from ..cose import COSECRV, COSEAlgorithmIdentifier from ..exceptions import InvalidTPMPubAreaStructure ################ # # A whole lotta domain knowledge is captured here, with hazy connections to source # documents. Good plac...
#!/usr/bin/env python3 import base64 import ctypes import io import json import os import subprocess import time import traceback from collections import Counter from datetime import datetime, date from multiprocessing import Pool from pathlib import Path import pandas as pd from geographiclib.geodesic import Geodesic...
import sys import os import time import shlex import urllib import urllib2 from urllib2 import URLError import re from functools import partial if os.name == 'posix' and sys.version_info[0] < 3: import subprocess32 as subprocess else: import subprocess from multiprocessing import Process import click from dae...
# Copyright (c) 2019, MD2K Center of Excellence # - <NAME> <<EMAIL>>, <NAME> <<EMAIL>> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above co...
# This script assumes taht the freesurfer csv for the BANC data has already been generated import os import pandas as pd import numpy as np import pdb import seaborn as sns sns.set() import matplotlib.pyplot as plt from BayOptPy.helperfunctions import get_paths, get_data, drop_missing_features def visualise_missing_...
#!/usr/bin/env python3 import datetime import fnmatch import glob import logging import os import os.path import shutil import zipfile from json import loads as load_json, dumps as dump_json from re import findall as regex_findall from time import sleep import requests from Vaulter import Vaulter from git import Repo...
import numpy as np import logging import os import csv from datetime import datetime import tensorflow as tf from tensorflow.contrib.layers.python.layers import initializers import tensorflow.contrib.slim as slim from tensorflow.python.ops import control_flow_ops from tensorflow.python.ops import init_ops from ipec.ip....
# -*- coding: utf-8 -*- """ Velocity calculation methods: used in locomotion and in path features """ from __future__ import division import warnings import numpy as np __ALL__ = ['get_angles', 'get_partition_angles', 'h__computeAngularSpeed', 'compute_speed', 'get_frames_...
# TODO Throw away potoo.bq and rename this to replace it (potoo.bqq -> potoo.bq) import dataclasses from dataclasses import dataclass, field from datetime import datetime import inspect import logging import random import re import textwrap import time from typing import Callable, List, Mapping, Optional, Tuple, Union...
# -*- coding: utf-8 -*- """ Created on Fri Aug 26 00:26:50 2016 @author: JD """ # Modification of JD's code. This version don't allow reconnection from __future__ import print_function import sys from PyQt5 import QtGui, Qt, QtCore, QtWidgets #import numpy as np import UDPRedPitayaDiscovery import time from RP_P...
# Copyright (C) 2019 <NAME> (ghcollin) # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE.txt file for details. import numpy as np from . import msgpack_ext from .msgpack_ext import msgpack_registry import sys _PYTHON3 = sys.version_info > (3, 0) if _PYTHON3: ...
''' Created on 30 de aug de 2016 @author: romuere ''' import numpy as np import math import csv from skimage.io import imread import glcm, histogram,lbp,hog_rom from skimage.color import rgb2gray from glob import glob import matplotlib matplotlib.use("Agg") from matplotlib import pyplot as plt from matplotlib.gridspec...
import calendar import html import http.cookiejar import json import os import sys import re import requests import time import traceback import urllib.parse from threading import Thread from queue import Queue import sling import sling.flags as flags flags.define("--crawldb", help="database for crawled n...
# define the search api here with the help of NNI import json import os from collections import OrderedDict from functools import reduce import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from monodepth.utils.sync_batchnorm import convert_model, patch_replication_callback from monode...
# -*- coding: utf-8 -*- """ Module for storage ring calculations; all sizes and divergences are in RMS """ import numpy as np from datastorage import DataStorage as ds from scipy.special import erf from .utils.conversion import energy_to_wavelength, wavelength_to_energy def ebs_minibeta(beta_h=6.8,beta_v=2.7): ep...
# Copyright 2021 Open Source Robotics Foundation, 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...
import pickle from tqdm import tqdm import numpy as np import pandas as pd from nltk.util import ngrams from nltk import word_tokenize from nltk.tokenize.treebank import TreebankWordDetokenizer from nltk.lm.preprocessing import padded_everygram_pipeline, pad_both_ends from nltk.lm import NgramCounter, Vocabulary, MLE...
# Copyright (c) 2016 by <NAME> and the other collaborators on GitHub at # https://github.com/rmjarvis/Piff All rights reserved. # # Piff is free software: Redistribution and use in source and binary forms # with or without modification, are permitted provided that the following # conditions are met: # # 1. Redistribut...
import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit from scipy.interpolate import UnivariateSpline from specutils import Spectrum1D from astropy import units as u from astropy.nddata import StdDevUncertainty __all__ = ['trace', 'BoxcarExtract'] def _gaus(x, a, b, x0, sigma): "...
import numpy as np import threading import time import nep import time import cv2 import sys from PIL import Image import sharo show_image = 1 model = "yolo3-320" try: model = sys.argv[1] print ("Model:" + model) show_image = int(sys.argv[2]) print ("Show image: " + str(show_image)) except: pass ...
#!/usr/bin/env pytest import pytest import pickle import datetime import textwrap import json import os import classad # to guarantee correct evaluation semantics import htcondor # this test replicates python_bindings_classad.run @pytest.fixture def ad(): """A fresh, blank Python ClassAd.""" return clas...
import sys import serial import equation import datetime from ledwidget import LedWidget import time import math from PyQt5 import QtCore, QtWidgets from PyQt5.QtCore import Qt, pyqtSlot, QObject, pyqtSignal from PyQt5.QtWidgets import (QApplication, QCheckBox, QGridLayout, QGroupBox, QLabel, QLineEdit, QComboBox, QDou...
""" Defines classes for variable nodes, factor nodes and edges and factor graph. """ import numpy as np import scipy.linalg from utils.gaussian import NdimGaussian class FactorGraph: def __init__(self, nonlinear_factors=True, eta_damping=0.0, beta=None, ...
from __future__ import division import torch import torch.nn as nn import torch.backends.cudnn as cudnn import torchvision import torchvision.transforms as transforms import argparse from tensorboardX import SummaryWriter from tqdm import tqdm import os import numpy as np import datasets.cifar as cifar import datasets....
#!/usr/bin/env python3 """ Given a python file, this script finds all ranges of line nummbers of function signatures (excluding the function body) using ast """ import argparse import ast import io import os import sys import tokenize from collections import namedtuple from enum import Enum from typing import * impo...