text
stringlengths
6.04k
39.5k
import abc import asyncio import boto3 import concurrent import itertools from collections import defaultdict from functools import partial from grapher.core import driver from grapher.core.constants import LINKS_WITH_CYCLE from grapher.aws.exceptions import ClientError, EndpointConnectionError, ExceptionWrapper from...
#!/usr/bin/python3 import matplotlib.pyplot as plt import numpy as np #N,C.E.,MultiP.0,T.0,TDS.1,MultiP.1,T.1,TDS.2,MultiP.2,T.2,time,arduino N,comm,. #1,0,4.58,20.6,0,7.36,20,0,3.46,20.1,7:20 AM,14-Jan,, #2,92.773,639,20.2,297.852,184.4,20.2,214.844,254,20.3,7:34,15-23,"Se agrega súp SEP = ',' # `data`: N, C.E,...
from typing import Dict, List, Tuple, Union, Any, TypeVar from scipy.sparse.csr import csr_matrix from numpy import memmap from sqlitedict import SqliteDict from tempfile import mkdtemp from DocumentFeatureSelection.init_logger import logger from numpy import ndarray, int32, int64 import pickle import json import csv i...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import os import logging import argparse import random from tqdm import tqdm, trange import dill from collections import defaultdict import numpy as np import pandas as pd import torch from torch.ut...
# -*- coding:utf-8 -*- import trdb2py.trading2_pb2 from trdb2py.utils import str2asset, asset2str from datetime import datetime import time import pandas as pd import numpy as np import math from trdb2py.timeutils import str2timestamp, getDayInYear, getYearDays, calcYears CtrlTypeStr = [ 'INIT', 'BUY', 'SE...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # ade: # Asynchronous Differential Evolution. # # Copyright (C) 2018-19 by <NAME>, # http://edsuom.com/ade # # See edsuom.com for API documentation as well as information about # Ed's background and other projects, software and otherwise. # # Licensed under the Apache Li...
import numpy as np import copy import cv2 import os import PIL.Image as Image from PIL import ImageDraw import lmdb from tqdm import tqdm import carla from collect_pm import CollectPerspectiveImage, InversePerspectiveMapping config = dict( env=dict( simulator=dict( disable_two_wheels=True, ...
"""Toy cluttered table domain. This environment is created to test our planner's ability to handle failures reported by the environment. """ from typing import Dict, List, Optional, Sequence, Set import matplotlib import matplotlib.pyplot as plt import numpy as np from gym.spaces import Box from predicators.src imp...
import pandas as pd import os import metabolights from remotezip import RemoteZip import requests import requests_cache requests_cache.install_cache('requests_cache', expire_after=86400) def get_dataset_files(accession, metadata_source, dataset_password="", metadata_option=None): """This gives a pandas dataframe ...
#!/usr/bin/python3 import colorsys import copy from matplotlib import pyplot as plt import numpy as np import pickle import pygame from pygame import surfarray import random import scipy.misc import PIL from PIL import Image from scipy.stats import logistic pygame.init() plt.ion() # gui = 'console' # gui = 'headles...
""" defines: - clear_out_solids(bdf_filename, bdf_filename_out=None, equivalence=True, renumber=True, equivalence_tol=0.01) - nastran_to_surf(bdf_filename, pid_to_element_flags, surf_filename, renumber_pids=None, line_map=None, scale=1.0, tol=1e-10, ...
#!/usr/bin/env python # # Copyright 2010 Google 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 o...
from __future__ import print_function from .backtrack import mfe, boltzmann_sample, enumerative_backtrack from .parameters import get_params from .util.wrapped_array import WrappedArray, initialize_matrix from .util.secstruct_util import * from .util.output_util import _show_results, _show_matrices from .util.sequ...
from common.models import Grid5, Species from django.contrib.auth import get_user_model from django.contrib.gis.db import models from django.contrib.gis.geos import Point from django.db.models import F, Sum, Count from django.template.defaultfilters import slugify from django.urls import reverse from .FN0_tables impo...
import logging import uuid import re logger = logging.getLogger(__name__) DEFAULT_TRUSTZONE = "b61d6911-338d-46a8-9f39-8dcd24abfe91" def format_source_objects(source_objects): if not isinstance(source_objects, list): source_objects = [source_objects] return source_objects def get_mappings_for_name...
from dataclasses import dataclass from typing import ClassVar, Dict, List, Optional import resotolib.logger from resotolib.baseresources import ( BaseAccount, BaseDatabase, BaseInstance, BaseIPAddress, BaseLoadBalancer, BaseNetwork, BaseRegion, BaseResource, BaseSnapshot, BaseVo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Apr 15 11:15:29 2020 @author: Dr. <NAME> European Space Agency (ESA) European Space Research and Technology Centre (ESTEC) Keplerlaan 1, 2201 AZ Noordwijk, The Netherlands Email: <EMAIL> GitHub: mnguenther Twitter: m_n_guenther Web: www.mnguenther.com "...
"""Basic tests for functions in project euler library.""" import pytest import lib_project_euler as lpe def test_validate_integers(): """Test function validate_integers.""" pytest.raises(TypeError, lpe.validate_integers, 'abc') pytest.raises(TypeError, lpe.validate_integers, 4.1) pytest.raises(TypeE...
""" API integration for osu! Adds Mods enums with raw value calculations and some request functions. """ import asyncio from datetime import datetime import json import logging import os import re from collections import namedtuple from enum import Enum from pcbot import utils api_url = "https://osu.ppy.sh/a...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2021 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
# coding=utf-8 from __future__ import division from search_module.python_from_feng.se.config import root import pickle import time import jieba, math import jieba.posseg as pseg class Subject: #subs = [{"code": '0828', "k": 36}, {"code": '0829', "k": 14}] #self.subs = subs #self.Subject_for_teacher = {sub[...
# # This file is part of LiteX. # # Copyright (c) 2016-2017 <NAME> <<EMAIL>> # Copyright (c) 2019-2020 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause """ IBM's 8b/10b Encoding This scheme is used by a large number of protocols including Display Port, PCI Express, Gigabit Ethernet, SATA and USB 3. The encod...
# File: VMTranslator.py # ----- # Author: <NAME> (<EMAIL>) # Date: 31 May 2020 # Course: Nand to Tetris, Part 2 # Project: 8 # # Summary: Virtual Machine Translator that takes a .vm file and creates a .asm file. # import os import sys class Parser: """Hack File Parser Loads the given VM file and provides he...
from __future__ import annotations import warnings import numpy as np import napari import os from ..arrays import * from ..frame import * from .._const import Const from ..core import imread, lazy_imread def copy_layer(layer): args, kwargs, *_ = layer.as_layer_data_tuple() # linear interpolation is valid onl...
import argparse import collections import io import itertools import logging import os.path import pathlib import re import sys import zlib import ass import ebmlite from fontTools.ttLib import ttFont from fontTools.misc import encodingTools logging.basicConfig(format="%(name)s: %(message)s") TAG_PATTERN = re.compi...
""" This module provides the `PerformanceMetrics` class and supporting functionality for tracking and computing model performance. """ from collections import defaultdict, namedtuple import logging import os import warnings import pandas as pd import numpy as np from sklearn.metrics import average_precision_score from...
from __future__ import print_function, division import hashlib from copy import deepcopy import h5py import numpy as np from ..util.meshgrid import meshgrid_nd from ..util.functions import FreezableClass, is_numpy_array, monotonically_increasing, link_or_copy from astropy import log as logger from .grid_helpers impo...
import copy import pickle import numpy as np from pcdet.utils import box_utils, common_utils from pcdet.datasets.dataset import DatasetTemplate from pcdet.datasets.robosense import robosense_utils class RobosenseDataset(DatasetTemplate): def __init__(self, dataset_cfg, class_names, training=True, root_path=None...
#Note #CNN used #XRMB Dataset # had to degrade numpy to 1.11.0 as 1.13.0 doesn't support float index type in arrays # myarray = np.fromfile('BinaryData.dat',dtype=float) import sys import math import random import warnings import numpy as np from sklearn import svm import keras.backend as K from keras...
#import os #import subprocess #import sys import numpy as np from cereal import car from common.kalman.simple_kalman import KF1D from selfdrive.config import Conversions as CV from selfdrive.can.parser import CANParser from selfdrive.car.modules.UIBT_module import UIButtons,UIButton from selfdrive.car.modules.UIEV_modu...
# ********************************************************************************* # REopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions a...
import copy import operator import itertools import scipy.stats import numpy as np import pandas as pd import plum.util.data import scipy.optimize import sklearn.metrics from plum.models.modelABC import Model #from plum.util.cpruning import getNodeProbs, getNodeProbs_prior_weighted from plum.util.cpruning import cgetN...
# # Collective Knowledge (classify image using various models such as DNN) # # See CK LICENSE.txt for licensing details # See CK COPYRIGHT.txt for copyright details # # Developer: <NAME>, <EMAIL>, http://fursin.net # cfg={} # Will be updated by CK (meta description of this module) work={} # Will be updated by CK (tem...
import random import time import algorithms # local module import pandas as pd from graphics import graphic as simulation_graphic from process import Process from pathlib import Path def get_cpu_time_unit(): """ a unit of time independent on cpu run this code for simulating time """ started_at = ti...
import copy import torch import torch.nn as nn import torchvision import sys import os import time from torch.nn import functional as F from torch.utils.data import DataLoader from tqdm import tqdm device = 1 batch_size = 16 num_workers = 1 sys.path.append(os.getcwd()) from fusions.common_fusions import Concat from u...
# Copyright 2012 OpenStack Foundation # Copyright 2015 Metaswitch Networks # 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/li...
''' CenterMask : Real-Time Anchor-Free Instance Segmentation https://github.com/youngwanLEE/vovnet-detectron2/blob/master/vovnet/vovnet.py ''' import os import sys BASE_DIR = os.path.dirname( os.path.dirname(os.path.dirname(os.path.dirname( os.path.abspath(__file__))))) sys.path.append(BASE_DIR) from simp...
#!/usr/bin/python import numpy import theano import theano.tensor as T from theano.tensor.nnet import conv import theano.sandbox.neighbours as TSN class HiddenLayer(object): def __init__(self, rng, n_in, n_out, W=None, b=None, activation=T.tanh, name=""): """ Typical hidden layer ...
#!/usr/bin/env python # Copyright 2016 <NAME> # 2016 Johns Hopkins University (author: <NAME>) # Apache 2.0 from __future__ import print_function import argparse from random import randint import sys import os from collections import defaultdict parser = argparse.ArgumentParser(description=""" This scri...
# 1) Escribe un programa muestre por pantalla “Hello World”. print("Hello World") #2) Escribe un programa que escriba en la pantalla el resultado de sumar 3 + 5. print(3+5) #3) Escribe un programa que pida el nombre del usuario y escriba un texto que diga “Hola nombreUsuario” nombreUsuario = input("Ingrese el nomb...
import logging from flow.utils.flow_warnings import deprecation_warning class SumoParams: def __init__(self, port=None, sim_step=0.1, emission_path=None, lateral_resolution=None, no_step_log=True, sumo_binary="s...
"""Tests of the core package.""" import numpy as np import pandas as pd import pint import pytest import xarray as xr from weldx.constants import Q_, U_ from weldx.core import MathematicalExpression, TimeSeries from weldx.tests._helpers import get_test_name from weldx.time import Time # ----------------------------...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from...
# -*- coding: utf-8 -*- import functools import os import sys import time from operator import itemgetter import warnings from threading import Lock import asyncio import sqlalchemy from sqlalchemy import event, inspect, orm from sqlalchemy.engine.url import make_url from sqlalchemy.ext.declarative import DeclarativeMe...
# -*- coding: utf-8 -*- # Copyright (c) 2022 by <NAME> import os import sys import glob import torch import random import timeit import configs import logging import numpy as np import pandas as pd import transformers from tqdm import tqdm, trange from adapt_mrc_model import AdaptMRCModel from data_generator import QA...
import logging import os import astropy.units as u import numpy as np from astropy.coordinates import SkyCoord, AltAz from astropy.coordinates.erfa_astrom import ErfaAstromInterpolator, erfa_astrom from astropy.io import fits from astropy.table import Table, QTable from astropy.time import Time from lstchain.__init__...
import torch.nn as nn # type: ignore import torch # type: ignore import torch.nn.init # type: ignore import math # type: ignore from collections import OrderedDict #import models use_relu = False use_bn = True def conv3x3(in_planes, out_planes, stride=1): "3x3 convolution with padding" global use_bn ...
#!/usr/bin/env python import struct import random import subprocess import os import sys pipe = subprocess.PIPE #https://github.com/cloudburst/pyptrace/blob/master/defines.py PTRACE_TRACEME = 0 # Return the word in the process's text space at address ADDR. PTRACE_PEEKTEXT = 1 # Return the word in the process...
import abc import collections import functools import heapq import io import itertools import operator import os import random import sys import time import typing as ta from . import callables from . import check from . import lang from . import properties from . import toolz T = ta.TypeVar('T') map_ = map filter...
'''training utils for trainign survtrace model. ''' from collections import defaultdict import pdb import os import math import numpy as np import torch from torch.optim import Optimizer from torch.nn.utils import clip_grad_norm_ from torch import optim from .losses import NLLPCHazardLoss class EarlyStopping: """...
""" Class ScenarioCategory Creation date: 2018 10 30 Author(s): <NAME> To do: Add "comprises" method based on the "fall_into" method that is defined for Scenario. Modifications: 2018 11 05: Make code PEP8 compliant. 2018 11 07: Change use of models. 2018 11 22: Enable instantiation using JSON code. 2018 11 29: Add f...
## mine information from web pages ## # import from pyquery import PyQuery as pq from lxml import html from lxml import etree import re # constants wiki_base = "http://en.wikipedia.org" wiki = wiki_base + "/wiki/Category:Video_game_lists_by_platform" wiki2 = wiki_base + "/w/index.php?title=Category:Vid...
import socket from scapy.all import * import time # Constants: TFTP_PORT = 69 # TFTP works over UDP on its port 69 IP_PROXY = "192.168.40.80" IP_SERVER = "192.168.30.90" INTERFACE_NETWORK_PROXY = "enp0s3.30" POS_OPCODE = 1 # According to RFC 1350 OPCODE_READING = 1 # According to RFC 1350 OPCODE_WRITING = 2 # Accordi...
import numpy as np from PIL import Image import cv2 import io import time import pandas as pd from random import randint import os import selenium from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys import tensorflow as tf from tensorflo...
import sys hoomd_path = str(sys.argv[4]) gsd_path = str(sys.argv[5]) # need to extract values from filename (pa, pb, xa) for naming part_perc_a = int(sys.argv[3]) part_frac_a = float(part_perc_a) / 100.0 pe_a = int(sys.argv[1]) pe_b = int(sys.argv[2]) sys.path.append(hoomd_path) import hoomd from hoomd import md fr...
# encoding: utf-8 """ @author: liaoxingyu @contact: <EMAIL> """ import copy import torch from torch import nn from .backbones.resnet import ResNet, BasicBlock, Bottleneck from .backbones.senet import SENet, SEResNetBottleneck, SEBottleneck, SEResNeXtBottleneck from .backbones.resnet_ibn_a import resnet50_ibn_a from ....
# ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. # Written by <NAME> (<EMAIL>) # ------------------------------------------------------------------------------ from __future__ import absolute_import from __future__ import divis...
import math from typing import Union import numpy as np def rotation_matrix(axis, theta): """ Return the rotation matrix associated with counterclockwise rotation about the given axis by theta radians. """ axis = np.asarray(axis) axis = axis / math.sqrt(np.dot(axis, axis)) a = math.cos(th...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "<NAME>" __email__ = "<EMAIL>" __description__ = ''' Experiments with multiple D415, T265 cameras. ''' import sys import os import io import pyrealsense2 as rs import cv2 import numpy as np from pprint import pprint try: from PIL import ImageFont, Imag...
"""Lattice module. In this module the lattice of the corresponding accelerator is defined. """ import math as _math from pyaccel import lattice as _pyacc_lat, elements as _pyacc_ele, \ accelerator as _pyacc_acc, optics as _pyacc_opt from . import segmented_models as _segmented_models energy = 0.150e9 # [eV] def...
import sys reload(sys) sys.setdefaultencoding('utf8') import pandas as pd import tools import numpy as np import uts from gensim.models import Word2Vec from nltk import tokenize from Sastrawi.Stemmer.StemmerFactory import StemmerFactory factory = StemmerFactory() stemmer = factory.create_stemmer() from nltk.metrics ...
import traversalHelper as tr from itertools import combinations import helper as hr import math, time import multiprocessing from multiprocessing import Pool, Manager from functools import partial import numpy as np from statistics import mean import json, sys, os from collections import defaultdict class helperFunc: ...
# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """ Conversion methods from Ledger API Protobuf-generated types to dazl/Pythonic types. """ from dataclasses import dataclass from datetime import datetime from typing import TYP...
# -*- coding: utf-8 -*- """ This module defines built-in evaluation functions for segmentation applications Segmentations can be evaluated at several scales: 'foreground' refering to metrics computed once for a foreground label 'label' refering to metrics computed once for each label (including background) 'cc' referr...
import math import select import struct from socket import socket, gethostbyname, AF_INET, SOCK_DGRAM, SOL_SOCKET, SO_REUSEADDR from collections import deque import numpy as np from operator import xor import cv2 import imutils import time import scipy.io as sio from scipy import linalg import math from ma...
""" rcpod.device A more pythonically-happy wrapper around the rcpod device. Handles library initialization at import time, provides a function for enumerating attached rcpod devices, and a class encapsulating the device. """ # # Remote Controlled PIC of Doom # Copyright (C) 2003 <NAME> <<EMAIL>> # # This library is f...
"""Script defining SMALMesh, an object capable of rendering a mesh version of the SMAL Model, for optimising the fit to other, existing meshes. With modifications now to work with: - newest SMAL Model - Newly define scale factor parameters""" from absl import flags from pytorch3d.structures import Meshes import sys, ...
# --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: percent # format_version: '1.2' # jupytext_version: 1.0.4 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # %% {"_uuid": "8f2839f25d086af736a60e9eeb907d3b93b6e...
from openpredict.openpredict_model import get_predictions, get_similarities, load_similarity_embeddings, load_treatment_classifier, load_treatment_embeddings import requests import os import re def is_accepted_id(id_to_check): if id_to_check.lower().startswith('omim') or id_to_check.lower().startswith('drugbank')...
#!/usr/bin/env python3 """ .. codeauthor:: <NAME> <<EMAIL>> """ import os import sys from textwrap import dedent from typing import Dict, Tuple import appconfigpy import click import msgfy import path import pytablereader as ptr import simplejson as json import simplesqlite as sqlite import typepy from loguru import...
#!/usr/bin/env python import sys, json, re, time from dateutil.relativedelta import relativedelta from snimpy.snmp import SNMPException from walt.common.tools import get_mac_address from walt.server import const from walt.server.threads.main import snmp from walt.server.threads.main.devices.grouper import Grouper fro...
# %% # Models and tokenizers import joblib from sklearn.model_selection import train_test_split from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences import keras.backend as K from tensorflow.keras.utils import to_categorical from keras.callbacks import ModelCheckpoint, ...
import asyncio import secrets import random import os import traceback import io from PIL import Image, ImageEnhance, ImageOps from pyrogram import filters from pyrogram.types import InputMediaPhoto, InputMediaVideo from bot import alemiBot from util import batchify from util.permission import is_allowed, is_superu...
""" DNN Layers. """ from __future__ import division import minpy.numpy as np import minpy.numpy.random as random # pylint: disable=fixme, invalid-name, too-many-arguments, too-many-locals, no-member def affine(x, w, b): """ Computes the forward pass for an affine (fully-connected) layer. The input x ha...
import json import logging from abc import abstractmethod from json import dumps as json_dumps from typing import List, Callable, Any, Optional from inoft_vocal_framework.dummy_object import DummyObject from inoft_vocal_framework.exceptions import raise_if_value_not_in_list, raise_if_variable_not_expected_type from i...
#!/usr/bin/env python3 """Supporting utilities. Classes ------- .. autosummary:: ProgressBar OptionReader Routines -------- .. autosummary:: read_param round_up evaluate_ratio humansize humantime ---- """ from __future__ import absolute_import from __future__ import division from __fut...
# coding=utf-8 """ Implements PowerManagement functions using IOPowerSources. Requires Mac OS X 10.6+ See doc/darwin for platform-specific details. """ import weakref import warnings import objc from Foundation import * from power import common # Generated in Mac OS X 10.8.2 using the following command: # gen_bridge_...
# -*- coding: utf-8 -*- from tests import msg from uamobile import * from uamobile.nonmobile import NonMobileUserAgent as NonMobile def test_detect_fast(): assert detect_fast('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1') == 'nonmobile' def test_empty_useragent(): ...
import torch from torch import nn from torch.nn import functional as F import xtils, os from xmodules.eff_utils import ( relu_fn, round_filters, round_repeats, drop_connect, Conv2dSamePadding, get_model_params, efficientnet_params, load_pretrained_weights, ) class MBConvBlock(nn.Modul...
import json import os import os.path import sys from datetime import datetime from pathlib import Path from typing import Dict, List, NamedTuple, Optional, Tuple, Union import napari.utils.theme import numpy as np from napari.resources import get_stylesheet from napari.utils.theme import template as napari_template fr...
import os import numpy as np import random from sklearn.utils import shuffle import scipy.io import matlab.engine import time import glob import argparse from utils_noisescope import * import logging import joblib random.seed(6666) eng = matlab.engine.start_matlab() def extract_fingerpint_via_clustering(all_res_path...
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 <NAME> <<EMAIL>> # Copyright (C) 2014-2017 <NAME> <<EMAIL>> # Copyright (C) 2014-2017 <NAME> <<EMAIL>> # Copyright (C) 2014-2017 <NAME> <<EMAIL>> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public...
import datetime import time import pandas as pd import pandas_ta as ta from datetime import timedelta import numpy as np from alpaca_trade_api.rest import REST APCA_API_KEY_ID = 'replace with yours' APCA_API_SECRET_KEY = 'replace with yours' APCA_API_BASE_URL = r'https://paper-api.alpaca.markets' # paper trading cl...
import numpy as np from enum import Enum, auto class SolverState(Enum): PRESOLVE = auto() PHASE1_STEP = auto() DRIVEOUT_STEP = auto() PHASE2_STEP = auto() DONE = auto() class SimplexSolver: def __stripReturnChar(self, str): if str[-1] == '\n': return str[:-1] return st...
#!/usr/bin/env python import sys import os from datetime import datetime import time import json import sandboxclient as sbclient import platformclient as pltclient import monitorclient as monclient from client.rest import ApiException from pprint import pprint from client.models.event_mobility import EventMobility ...
import torch from torch.utils.tensorboard import SummaryWriter import matplotlib.pyplot as plt import numpy as np import os import json from symop_utils import get_aug from loss_func import LogLoss, FracLoss, DOSLoss from lr_utils import Cosine_Scheduler def evaluate_model(args, dataloader, model, device, predmodel =...
from __future__ import print_function from __future__ import absolute_import from __future__ import division import os import json import glob import h5py import numpy as np import pickle from PIL import Image, ImageOps import torch from torchmeta.utils.data.task import Task, ConcatTask, SubsetTask from collections i...
from __future__ import print_function import boto3 from boto3.dynamodb.conditions import Key, Attr from datetime import datetime from datetime import timedelta from collections import defaultdict import json import re import os aws_feed_tbl = os.environ['awslaunchdetails_tbl'] dynamo_tbl = boto3.resource('dynamodb'...
# Copyright (c) Facebook, Inc. and its affiliates. import copy import json import os import contextlib import io import logging import pycocotools.mask as mask_util from detectron2.data import DatasetCatalog, MetadataCatalog from detectron2.utils.file_io import PathManager from fvcore.common.timer import Timer from io...
from gen.javaLabeled.JavaLexer import JavaLexer try: import understand as und except ImportError as e: print(e) from antlr4 import * from antlr4.TokenStreamRewriter import TokenStreamRewriter from gen.javaLabeled.JavaParserLabeled import JavaParserLabeled from gen.javaLabeled.JavaParserLabeledListener import...
from astropy.coordinates import SkyCoord, Distance import astropy.units as u from astropy.time import Time from astroquery.ned import Ned from astroquery.simbad import Simbad import matplotlib.pyplot as plt from scipy.interpolate import interp1d import os import numpy as np from spectractor import parameters from spe...
"""Perplexity Sampled mC4 dataset based on Common Crawl.""" import gzip import json import datasets import kenlm # pip install https://github.com/kpu/kenlm/archive/master.zip import numpy as np from numpy.random import default_rng logger = datasets.logging.get_logger(__name__) _DESCRIPTION = """\ A colossal, cle...
# Leo colorizer control file for sql mode. # This file is in the public domain. # Properties for sql mode. properties = { "commentEnd": "*/", "commentStart": "/*", "lineComment": "--", } # Attributes dict for sql_main ruleset. sql_main_attributes_dict = { "default": "null", "digit_re": "", "es...
#!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. """ Detection Training Script. This scripts reads a given config file and runs the training or evaluation. It is an entry point that is made to train standard models in detectron2. In order to let one script support training of many models, this...
import random import time import warnings import json import re import requests import chromedriver_autoinstaller from bs4 import BeautifulSoup from selenium import webdriver from selenium.common.exceptions import (ElementClickInterceptedException, NoSuchElementException) from ...
from tkinter import * import tkinter.font as tkFont import random import numpy as np import queue import copy import time import threading import sys import os #生成资源文件目录访问路径 def resource_path(relative_path): if getattr(sys, 'frozen', False): #是否Bundle Resource base_path = sys._MEIPASS else: bas...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Dec 22 11:30:32 2018 @author: jkp """ import pandas as pd import numpy as np import matplotlib.pyplot as plt data=pd.read_csv("/home/sysadm/Desktop/JKP BSPro/Used_startup_funding.csv") #***Basic/General/Normal Information data.head() data.dtypes data....
"""Implementations for the debug VM.""" from copy import copy from functools import reduce from typing import Callable import numpy as np import math from .. import dtype as types from ..dtype import Number, Float, Bool from ..utils import Registry, overload from . import ops as primops py_registry: Registry[primo...
""" This module contains the Detector class, which defines the detector and it's response to a plasma. This modules also contains classes and methods related to the response function (S-curves, absorprion from Si, transmission through Be, and charge-sharing). """ from __future__ import division import os import cPickle...
import RutishauserLabtoNWB.events.newolddelay.python.analysis.helper as helper import scipy.stats as stats import logging import os import matplotlib.pyplot as plt import numpy as np def plot_behavioral_graphs(NWBFilePath): """ Behavioral analysis, plotting six graphs: 1. Probability of responses 2. RO...