text
stringlengths
3.07k
22.1k
import os from pathlib import Path from collections import namedtuple from time import time import pyautogui as pag import cv2 import numpy as np from itertools import chain from copy import deepcopy Box = namedtuple("Box", ["left", "top", "width", "height"]) Card = namedtuple("Card", ["val", "box"]) def ranges_over...
#!/usr/bin/env python3 import json import argparse import os import sys import subprocess from check_if_done import check_state_comet import time import shutil from write_submit_script_comet import write_submit_comet import re ''' Submit 2DAssess job to comet. Will loop through all the subdirectories in the 2DClass fo...
# Copyright (c) 2021 - Jojo#7791 # Licensed under MIT # This file contains some code from TrustyJAID's retrigger cog, which is licensed under MIT # https://github.com/TrustyJAID/trusty-cogs/ # MIT License # Copyright (c) 2017 TrustyJAID # Permission is hereby granted, free of charge, to any person obtaining a copy #...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jul 26 16:31:41 2020 @author: <NAME> """ #%% import math, torch, gym, argparse, ptan, time, numpy as np import torch.nn as nn import torch.nn.functional as F from types import SimpleNamespace from tensorboardX import SummaryWriter class DQN(nn.Module)...
# Copyright (C) 2020 Xilinx, 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...
# Copyright 2015 Google 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 required by applicable law or a...
from mpi4py import MPI import os.path as osp import gym import logging from baselines import logger from baselines.ppo1.mlp_policy import MlpPolicy from baselines.common.mpi_fork import mpi_fork from baselines import bench from baselines.trpo_mpi import trpo_mpi import tensorflow as tf from my_dataset import FeatureDa...
# Copyright 2019 Mycroft AI 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 writin...
import glob import os import numpy as np from sklearn.utils import shuffle from scipy import misc from PIL import Image import pandas as pd import matplotlib from matplotlib import pyplot as plt import tensorflow as tf #matplotlib.interactive(True) random_seed = 90210 np.random.seed(random_seed) img_w, img_h = 64,...
# -*- coding: utf-8 -*- import operator import warnings from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.models.query_utils import Q from django.template import TemplateSyntaxError, NodeList, Variable, Context, Template, engines from django.template.base import Va...
#!/usr/bin/env python import os import sys import stat from os.path import join as pjoin, exists as pexists, realpath import numpy as np """#---------------------------------#---------------------------------#--------------------------------- The following script helps you generating job files for processing the lar...
import time import smtplib from django.db import transaction from django.core.cache import cache from rest_framework.views import APIView from rest_framework.response import Response from .settings import Rest, AUTH_TYPE from .serializers import UserProfileSerializer from .models import UserAuthModel, UserProfileModel ...
from dataclasses import dataclass from datetime import datetime, timedelta from typing import List import pandas as pd import pytest from feast.infra.offline_stores.offline_store import RetrievalJob from feast.type_map import python_type_to_feast_value_type from feast.value_type import ValueType from tests.data.data_...
import torch.nn as nn from mmcv.cnn import ConvModule, bias_init_with_prob, normal_init from ..builder import HEADS from .anchor_head import AnchorHead from mmdet.core import (force_fp32, images_to_levels, multi_apply, multiclass_nms, unmap, vectorize_labels) import torch from mmdet.models.los...
# -*- coding: utf-8 -*- # 14-8-8 # create by: snower ''' MySQL asynchronous client pool. ''' import sys import time from collections import deque from . import platform from .client import Client from . import log from .util import py3, text_type class ConnectionPoolClosedError(Exception): pass class Connecti...
""" Example Pierce diode calculation. Hot plate source emitting singly ionized potassium """ from warp import * # --- Set four-character run id, comment lines, user's name. top.pline2 = "Pierce diode example" top.pline1 = "Injected beam. Semi-Gaus." top.runmaker = "<NAME>" # --- Invoke setup routine for the plott...
from qiskit import QuantumCircuit, transpile from typing import List, Union from collections import OrderedDict import itertools import multiprocessing as mp from collections import Counter from math import pi from scipy.special import logsumexp import numpy as np from abc import ABC, abstractmethod from qiskit import ...
import pytest from flaskr.utils.my_calendar import Month, Week, Day """ November 2020 starts on Sunday. datetime weeks start on Monday So this test month needs 6 weeks. We will test Weeks below [0, 0, 0, 0, 0, 0, 1] [2, 3, 4, 5, 6, 7, 8] [9, 10, 11, 12, 13, 14, 15] [16, 17, 18, 19, 20, 21, 22] [23, 24, 25, 26, 27, 28,...
#!/usr/bin/env python3 """This script will remove the overlapping nucleotides of two factors from the factor ranges Computational time: ranges from 30 minutes (H. sapiens/M. musculus) to instant. """ from Bio import SeqIO import sys import glob import os.path import shutil from joblib import Parallel, delayed __autho...
"""Utilities for the discord.py library. If you're using the discord.py library, you can use the functions provided by this module to your advantage. Instead of having to manually send the voice server updates, you can call `add_voice_server_update_handler` once and be done with it. All events received by discord.py w...
import json from policy_storage import Policy_Storage def validate_access_policies(resource_id, user_name): mongo = Policy_Storage('mongodb') data = mongo.get_policy_from_resource_id(str(resource_id)) operations = ['AND', 'OR'] if isinstance(data, list): for i in range(0, len(data)): ...
#!/usr/bin/env python3 # author: <NAME> (github.com/perlinm) import sys, glob import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt data_dir = "./mlrecon_data/" circuit_type = "clustered" qubit_min = 8 qubit_max = 20 log10_shots_default = 6 qubits_default = 18 # labels, colors, and markers f...
#!/usr/bin/env python3 ########################################################################################## # Copyright 2020 Adobe. All rights reserved. # This file is licensed to you under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. You may ...
""" The wntr.morph.skel module contains functions to skeletonize water network models. """ import logging import itertools import networkx as nx from wntr.network.elements import Pipe, Junction from wntr.sim.core import WNTRSimulator from wntr.sim import EpanetSimulator from wntr.morph.node import _deepcopy_wn lo...
from telegram.ext import ConversationHandler, CommandHandler, MessageHandler, Filters from telegram import ReplyKeyboardMarkup, ReplyKeyboardRemove, KeyboardButton, Location, ChatAction from threading import Timer import users, hints, math, logging GETNAME, START, QUEST1, QUEST2, QUEST3, QUEST4, QUEST5, QUEST6, QUEST7...
import os, sys import json sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from gcd_data_manipulation import load_data, data_aggregation from data_loader import LoadGoogleDataset from torch.utils.data import DataLoader from sklearn.preprocessing import MinMaxScaler from transformer_model im...
import html import json from urllib.parse import quote import jsonpath import requests from lunar_python import Solar # 以json格式读取文件 lang = open('./lang.json', 'r', encoding='utf8') lang_json = json.load(lang) config = open('./config.json') config_json = json.load(config) calTemplate = open('cal.html', 'r', encoding...
from typing import Callable, Tuple, List import torch import torch.nn.functional as F from torch.utils.data import Dataset import os import numpy as np import misc import augmentation from typing import Callable, Tuple, List import torch import torch.nn.functional as F from torch.utils.data import Dataset from PIL ...
# (C) Copyright 2020 ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergovernmenta...
# -*- coding: utf-8 -*- from openpyxl import Workbook from openpyxl.utils import get_column_letter from openpyxl.styles import Border, Side, PatternFill, Font, Alignment, Color, Fill from datetime import datetime from operator import itemgetter import os import re # from typing import List file_pattern = ( r'(?P<...
from hutch_python.utils import safe_load import subprocess import sys from ophyd import Device, Component as Cpt, EpicsSignal, EpicsSignalRO, AreaDetector from pcdsdevices.device_types import PulsePicker import matplotlib.pyplot as plt from time import sleep import statistics as stat from pcdsdevices.device_types im...
#!/usr/bin/env python """ Spyk is a Spec emulator, providing Spec-like scanning functions to Larch spec = SpykScan() spec.add_motors(x='XX:m1', y='XX:m2') spec.add_detector('XX:scaler1') spec.set_scanfile(outputfile) spec.ascan('x', start, finish, npts, time) spec.a2scan('x', s1, f1, 'y', s1, ...
# Copyright 2021 VMware, Inc. # SPDX-License-Identifier: Apache-2.0 import pathlib from abc import ABCMeta from abc import abstractmethod from typing import Any from typing import List from typing import Optional class IProperties: """ Allows for Data Job to store state (key-value pairs) across job runs. ...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import os import math from pathlib import Path from random import randrange from typing import List, Tuple, Union import torch from torch.utils.data import Dataset, Subset, DataLoader import xml.etree.ElementTree as ET from ...
#!/usr/bin/python3 import datetime, os, unittest from slippi import Game, parse from slippi.id import CSSCharacter, InGameCharacter, Item, Stage from slippi.log import log from slippi.metadata import Metadata from slippi.event import Buttons, Direction, End, Frame, Position, Start, Triggers, Velocity from slippi.pars...
#!/usr/bin/env python """gitchangelog: Generate a change log based on closed pull requests.""" from __future__ import unicode_literals __version__ = '1.6.0' import six from six.moves import input import sys import os import os.path import json import codecs import argparse import re from pygithub3 import Github cl...
from collections import defaultdict import urllib import http import ast import socket from urllib.parse import urlencode import urllib3 import classes from newsplease import NewsPlease import langdetect import lxml for_encoding = 'é' WAYBACK_CDX_SERVER = 'http://web.archive.org/cdx/search/cdx?' def generate_waybac...
# Copyright 2019 The Bazel 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 la...
#!/usr/bin/env python """Lecture re-encoder helper script.""" import argparse import os import subprocess import sys def get_audio_encoding(file): p = subprocess.Popen( ['ffprobe', '-v', 'error', '-select_streams', 'a:0', '-show_entries', 'stream=codec_name', '-of', 'default=noprint_wrappers=1:n...
"""The scaled dot-product attention mechanism defined in Vaswani et al. (2017). The attention energies are computed as dot products between the query vector and the key vector. The query vector is scaled down by the square root of its dimensionality. This attention function has no trainable parameters. See arxiv.org/...
import os import time import sys import math import numpy as np import functools import re import logging import glob import paddle import paddle.fluid as fluid from models.resnet import ResNet101 from datasets.readers import ReaderConfig # import cv2 # import skimage # import matplotlib.pyplot as plt # from paddle.f...
import matlab.engine import pickle import numpy as np import os ''' This code propagates rays through the PICO-60 geometry. The jar volume is partitioned into 3x3x3 cm boxes, and files containing all rays passing through each box are saved in the folder './partitions'. The files can be read using pickle.load, and e...
import backports import isodate import itertools import pandas as pd import pytz import tzlocal from backports.datetime_fromisoformat import MonkeyPatch from bson.codec_options import CodecOptions from bson.objectid import ObjectId from datetime import date, datetime, timedelta from girderformindlogger.models.applet im...
# Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import tempfile import os from PIL import Image from django.contrib.auth import get_user_model from django.urls import reverse from django.test import TestCase from rest_framework.test import APIClient from rest_framework import status from core.models import Recipe, Tag, Ingredient from recipe.serializer import Re...
# """ Useful python tools for working with the MIRI MRS. This version of the tools uses the JWST pipeline implementation of the distortion solution to do the transformations, and hooks into offline versions of the CRDS reference files contained within this github repository. Convert JWST v2,v3 locations (in arcsec) t...
# pylint: skip-file # lots of stuff pylint doesn't like in here that is particular to these tests from unittest.mock import patch, MagicMock import pytest from asynctest import CoroutineMock from atlassian import Confluence from requests import RequestException from tellus.configuration import ( CONFLUENCE_URL...
import pandas as pd import numpy as np import datetime from geclass.util.questionnaire_prepare import RemoveUnneededCols, \ RemoveUnfinished, RemoveMissingStudentAndCourse, \ CleanData, AddValidity, PrepareData def test_removing_cols(): x = { "data_id": [1], "survey_key": [1], ...
""" FlashXmodem Implementation.""" import ctypes, time import ArduinoFlashHardValues, ArduinoFlashSerial BLK_SIZE = 128 MAX_RETRIES = 20 code = [0x09, 0x48, 0x0a, 0x49, 0x0a, 0x4a, 0x02, 0xe0, 0x08, 0xc9, 0x08, 0xc0, 0x01, 0x3a, 0x00, 0x2a,0xfa, 0xd1, 0x04, 0x48, 0x00, 0x28, 0x01, 0xd1, 0x01, 0x48, 0x85, 0x46, 0x70, 0...
# Made by @venaxyt on Github (helped by @IDRALOU) # >>> https://github.com/venaxyt/mysterium # Checking if needed modules are installed try: import threading, requests, gratient, zipfile, signal, fade, sys, os except: import os; os.system("py -m pip install -r requirements.txt >nul") # Mysterium top ...
#!/usr/bin/python # # This is a free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that i...
import os from shlex import quote from .utils import run_cmd, get_abs_path_subfiles, exit_if_dir_is_empty, safe_mkdir, evaluate_condition from .printing import * from .compatibility import * from .config import get_config from pathlib import Path from shutil import copytree, copyfile, copy # NOTE: Naming convention is...
from scipy import signal from scipy.interpolate import CubicSpline from devito import Dimension from devito.function import SparseTimeFunction from cached_property import cached_property import numpy as np try: import matplotlib.pyplot as plt except: plt = None __all__ = ['PointSource', 'Receiver', 'Shot', '...
# Copyright (c) 2013 eBay Inc. # Copyright (c) 2013 OpenStack Foundation # # 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 # # ...
""" Functions dealing with passive task """ import numpy as np from brainbox.processing import bincount2D from scipy.linalg import svd def get_on_off_times_and_positions(rf_map): """ Prepares passive receptive field mapping into format for analysis Parameters ---------- rf_map: outp...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Kalman filter implementation. 1. Bicycle model 2. Unicycle model """ import numpy as np import math class Filter(object): def __init__(self, debug=False): self.debug = debug self._X = None self._P = None self._Q = None ...
""" Pooling modules. """ from __future__ import annotations from typing import Any, Dict, List, Optional, Union import torch from torch import nn from nntrainer import typext from nntrainer.models.activations import ActivationConfig, make_activation_module from nntrainer.typext import INF def make_p...
# # Functions for interacting with the interfaces table in the database # # <NAME> <<EMAIL>> # Copyright (C) 2006 The Trustees of Princeton University # import socket import struct from PLC.Faults import * from PLC.Parameter import Parameter from PLC.Filter import Filter from PLC.Debug import profile from PLC.Table i...
import itertools import json import logging import math import os import string import time from datetime import datetime from mimetypes import types_map import bs4 import requests from django.conf import settings from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.geos import GEOSException...
# Copyright 2019 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
import gc import os from matplotlib import pyplot as plt import pandas as pd from src.graph_transformer.data_processing import * from src.graph_transformer.model_utils import * import tensorflow as tf from sklearn.model_selection import KFold gc.enable() os.environ["CUDA_VISIBLE_DEVICES"] = "0" # Code for training t...
import json import os #from os import makedirs, rename from os.path import exists, basename, splitext import copy import random import matplotlib from glob import glob import time from shutil import copyfile, rmtree matplotlib.use('TkAgg') import matplotlib.pyplot as plt import matplotlib.cm as cm from properties im...
import json import requests import time from terminaltables import AsciiTable from datetime import datetime import csv from pprint import pprint import threading # outbound information outbound_airport = ['GVA'] outbound_date = '2019-11-08' outbound_depart_time = '15:00' outbound_arrival_time = '23:59' # inbound inf...
from argparse import ArgumentParser from PIL import Image import os import glob import time import numpy as np from multiprocessing import Pool import matplotlib.pyplot as plt import sys res = 128 def get_args(): parser = ArgumentParser() parser.add_argument('--gts', default="/ssd_scratch/cvit/girish.varma/da...
# Copyright 2021 The NetKet 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 ...
#!/usr/bin/env python3 import os.path import tensorflow as tf from tensorflow.contrib.layers import flatten import helper import warnings from distutils.version import LooseVersion import time import datetime ts = time.time() st = datetime.datetime.fromtimestamp(ts).strftime('%Y_%m_%d__%H_%M_%S') # Check TensorFlow V...
from decimal import Decimal as D import pytest from liberapay.constants import CURRENCIES, DONATION_LIMITS, STANDARD_TIPS from liberapay.i18n.currencies import Money, MoneyBasket from liberapay.payin.stripe import int_to_Money, Money_to_int from liberapay.testing import EUR, JPY, USD, Harness class TestCurrencies(H...
import gensim import gensim.downloader as gloader from typing import List, Callable, Dict import tqdm import collections from settings_file import * from keras.utils.np_utils import to_categorical from keras.preprocessing.text import Tokenizer def extract_numpy_structures(input_set): x_question = input_set['quest...
""" File Input and Output. """ import os import csv import pickle from socket import gethostname # INSPECT ---------------------------------------------------------------------- def list_fnames(dirpath=''): """Walk directory and gather list of filenames""" if not dirpath: dirpath='.' return next(o...
#!/usr/bin/env python3 import importlib import bpy import numpy as np import blendernc.python_functions as bnc_pyfunc NODE_TYPE = "ShaderNodeValToRGB" def divide_cmap(n, step): return (n - 1) * (1 / (step - 1)), int((n - 1) * (256 // (step - 1))) def update_fill_value(node, context): colorramp = node.nod...
import random import numpy as np from tkinter import * from grid import CellGrid from pedestrian import Pedestrian def set_person(grid, row, col): """ Set a pedestrian in a specific cell in a specific grid """ grid.draw_person() cell = grid.grid[row][col] cell.switch() cell.draw(grid.FILLED_COLOR_...
import numpy as np import random import tensorflow as tf import datetime import logging from multiprocessing import Process, Pipe #################### #### Utils ######### #################### def get_experiment_name(): x = datetime.datetime.now() return 'experiment-%d-%d-%d-%d-%d-%d'% (x.year, x.month, x.day,...
#!/usr/bin/env python import datetime import logging import os import re from urllib.parse import urljoin from utils import utils, inspector # https://www.treasury.gov/tigta/publications_semi.shtml archive = 1999 # options: # standard since/year options for a year range to fetch from. # # Notes for IG's web team:...
from __future__ import ( absolute_import, division, print_function, unicode_literals) import six from six.moves import (zip, filter, map, reduce, input, range) import random from nose.tools import nottest import networkx as nx from waldo.network.tests import test_graph as tg from waldo.network import Graph ...
#!/usr/bin/python #Copyright IBM Corp. 2018. #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,...
try: from ipdb import set_trace except ImportError: from pdb import set_trace import logging import os import pandas as pd from falconet import annotators from falconet.utils import fatal_exception from falconet.utils import ensure_folder from falconet.utils import get_hour_str_from_date_with_utc_offset from f...
######################################################## ### Project 3 - Conway's Game of Life ### ######################################################## __author__ = "<NAME> (<NAME>)" __copyright__ = "Copyright 2014, DS @NYUSH" __email__ = "<EMAIL>" import pygame from pygame.locals import * import r...
# @Time : 2020/7/7 # @Author : <NAME> # @Email : <EMAIL> # UPDATE # @Time : 2020/9/9, 2020/9/29 # @Author : <NAME>, <NAME> # @email : <EMAIL>, <EMAIL> """ recbole.data.dataloader.general_dataloader ################################################ """ import numpy as np import torch from recbole.data.dataloade...
#!/usr/bin/env python import argparse import sys import re import os import pandas # Define the way we retrieve arguments sent to the script. parser = argparse.ArgumentParser(description='Add Headers to Individual Textfile') parser.add_argument('--overwrite', action='store_true') parser.add_argument('--directory', ac...
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-present Rapptz 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 rights t...
""" compatibility OpenTimelineIO 0.12.0 and newer """ import os import re import sys import ast import opentimelineio as otio from . import utils import hiero.core import hiero.ui self = sys.modules[__name__] self.track_types = { hiero.core.VideoTrack: otio.schema.TrackKind.Video, hiero.core.AudioTrack: otio....
from ._util import * def expectatedCapacityFactorFromWeibull( powerCurve, meanWindspeed=5, weibullShape=2 ): """Computes the expected capacity factor of a wind turbine based on an assumed Weibull distribution of observed wind speeds """ from scipy.special import gamma from scipy.stats import exponweib ...
# -*- coding: utf-8 -*- """QGIS Unit tests for edit widgets. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __au...
import torch import torch.nn.functional as F from rlpyt.utils.tensor import infer_leading_dims, restore_leading_dims from rlpyt.models.conv2d import Conv2dHeadModel from rlpyt.models.params import CONVNET_IMPALA_LARGE # Used by IOC from rlpyt.models.utils import layer_init, conv2d_output_shape, Dummy from rlpyt.mode...
import random import signal import sqlite3 import subprocess import sys import time from abc import ABCMeta, abstractmethod from pathlib import Path import yaml from dhalsim.py3_logger import get_logger class Error(Exception): """Base class for exceptions in this module.""" class DatabaseError(Error): """...
import random # Include random library import math # Include math library import time # Include time library import sys # Include System library [3.63] Grid = [3,4]; # 3 * 4 is default | Numbers Can't Be ...
import sys import logging import traceback import numpy as np import cv2 from math import exp as exp from label_map import coco_80_category_map, coco_90_category_map, voc_category_map from OpenVINO_Config import Output_Format, Input_Format, color_list, CV2_Draw_Info class YoloParams: def __init__(self, param, side...
from datetime import datetime from io import StringIO import pytest from ionex.ionex_file import IonexV1, Grid, MapGridDef from ionex.ionex_file import Latitude, Longitude, Height, Map @pytest.fixture def ionex_header(): return StringIO('''\ 1.0 IONOSPHERE MAPS MIX IONEX VERS...
# encoding: utf-8 from logging import getLogger import six from ckan.common import json, config import ckan.plugins as p import ckan.plugins.toolkit as toolkit from ckan.plugins.toolkit import _ log = getLogger(__name__) ignore_empty = p.toolkit.get_validator('ignore_empty') natural_number_validator = p.toolkit.get...
from __future__ import print_function import argparse from math import log10 import sys import shutil import os import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.nn.functional as F import skimage import pdb import numpy as np from ...
import os import io import pysam from kleat.misc.apautils import fetch_seq REF_FA_FILE = os.path.join( os.path.dirname(os.path.dirname(__file__)), 'test_hexamer', 'mock_seq.fa') REF_FA = pysam.FastaFile(REF_FA_FILE) def test_fetch_seq_for_circular_DNA_with_positive_beginning_and_ending_less_than_contig_length(...
import logging from decimal import Decimal import boto3 import pandas as pd import pyarrow as pa import pyodbc import pytest import awswrangler as wr from ._utils import ensure_data_types, get_df logging.getLogger("awswrangler").setLevel(logging.DEBUG) @pytest.fixture(scope="module", autouse=True) def create_sql_...
"""Detection evaluation code. The prediction and ground truth are expected in scalabel format. The evaluation results are from the COCO toolkit. """ import argparse import datetime import json from typing import Dict, List, Optional import numpy as np from pycocotools.coco import COCO from pycocotools.cocoeval import...
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Pull a sandwich run's output directory's metrics from traces into a CSV. python pull_sandwich_metrics.py -h """ import collections import json import lo...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `scopus.AuthorRetrieval` module.""" import warnings from collections import Counter, namedtuple from nose.tools import assert_equal, assert_true from pybliometrics.scopus import AuthorRetrieval warnings.simplefilter("always") au = AuthorRetrieval("700421277...
import datetime import re import tweepy import requests from bs4 import BeautifulSoup from textblob import TextBlob import matplotlib from fuzzywuzzy import fuzz import matplotlib.pyplot as plt #newspaper3k from newspaper import Article import nltk nltk.download('punkt') # Twitter Access Tokens from config import * ...
from dataclasses import dataclass import os import time import numpy as np import pandas as pd import collections from typing import List import multiprocessing from functools import partial import matplotlib.pyplot as plt import torch from tqdm import tqdm ''' Epicardial-ChristiniVC DatasetNo : 10,000 x 70 = 700...
import numpy as np import wfdb import os import pandas as pd import random random.seed(42) def dynamic_replace(df): curr_aux = df['aux'].loc[0] for idx, x in enumerate(df['aux']): if x != '': curr_aux = x df.loc[idx, 'aux'] = curr_aux return df def create_index_df(desired_seg...
import cv2 import numpy as np import math import pyautogui import sys img_path = "./img/sample.png" # windowの左上角の座標を取得する window_position = pyautogui.position() # ダブりを消す処理 def getUniqueList(seq): seen = [] return [x for x in seq if x not in seen and not seen.append(x)] # 繋げられる距離のツムをグループ化する # param 色ごとにグループ化した...
############################################################################ # # Copyright (C) 2016 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. # # Commercial License Usage # Licensees holding valid commercial Qt licenses may use this file in # accordance with the co...