# Path: virtool/config/cls.py
# class Config:
#     db_connection_string: str
#     db_name: str
#     dev: bool
#     postgres_connection_string: str
#     redis_connection_string: str
#     b2c_client_id: str = None
#     b2c_client_secret: str = None
#     b2c_tenant: str = None
#     b2c_user_flow: str = None
#     base_url: str = ""
#     data_path: Path = None
#     fake: bool = False
#     fake_path: Path = None
#     force_version: str = None
#     host: str = None
#     no_check_files: bool = False
#     no_check_db: bool = False
#     no_fetching: bool = False
#     no_sentry: bool = False
#     port: int = 9950
#     proxy: str = None
#     use_b2c: bool = False
#     verbose: bool = False
#     sentry_dsn: str = "https://9a2f8d1a3f7a431e873207a70ef3d44d:ca6db07b82934005beceae93560a6794@sentry.io/220532"


import io
import json
import re
import aiohttp
import virtool.errors
from logging import getLogger
from typing import Tuple
from zipfile import ZipFile
from virtool.config.cls import Config
from virtool.http.proxy import ProxyRequest
        "masking": result.get("query_masking"),
    }


def format_blast_hit(hit: dict) -> dict:
    """
    Format a BLAST hit from NCBI into a format more usable by Virtool.

    :param hit: the BLAST hit
    :return: the formatted hit

    """
    cleaned = {
        key: hit["description"][0].get(key, "")
        for key in ["accession", "taxid", "title"]
    }

    hsps = {
        key: hit["hsps"][0][key]
        for key in ["identity", "evalue", "align_len", "score", "bit_score", "gaps"]
    }

    return {
        **cleaned,
        **hsps,
        "name": hit["description"][0].get("sciname", "No name"),
        "len": hit["len"],
    }



# Path: virtool/config/cls.py
# class Config:
#     db_connection_string: str
#     db_name: str
#     dev: bool
#     postgres_connection_string: str
#     redis_connection_string: str
#     b2c_client_id: str = None
#     b2c_client_secret: str = None
#     b2c_tenant: str = None
#     b2c_user_flow: str = None
#     base_url: str = ""
#     data_path: Path = None
#     fake: bool = False
#     fake_path: Path = None
#     force_version: str = None
#     host: str = None
#     no_check_files: bool = False
#     no_check_db: bool = False
#     no_fetching: bool = False
#     no_sentry: bool = False
#     port: int = 9950
#     proxy: str = None
#     use_b2c: bool = False
#     verbose: bool = False
#     sentry_dsn: str = "https://9a2f8d1a3f7a431e873207a70ef3d44d:ca6db07b82934005beceae93560a6794@sentry.io/220532"


# Path: virtool/blast/utils.py
import io
import json
import re
import aiohttp
import virtool.errors
from logging import getLogger
from typing import Tuple
from zipfile import ZipFile
from virtool.config.cls import Config
from virtool.http.proxy import ProxyRequest

        "masking": result.get("query_masking"),
    }


def format_blast_hit(hit: dict) -> dict:
    """
    Format a BLAST hit from NCBI into a format more usable by Virtool.

    :param hit: the BLAST hit
    :return: the formatted hit

    """
    cleaned = {
        key: hit["description"][0].get(key, "")
        for key in ["accession", "taxid", "title"]
    }

    hsps = {
        key: hit["hsps"][0][key]
        for key in ["identity", "evalue", "align_len", "score", "bit_score", "gaps"]
    }

    return {
        **cleaned,
        **hsps,
        "name": hit["description"][0].get("sciname", "No name"),
        "len": hit["len"],
    }



async def check_rid(config: Config, rid: str) -> bool: