# Path: scvelo/logging.py
# _VERBOSITY_LEVELS_FROM_STRINGS = {"error": 0, "warn": 1, "info": 2, "hint": 3}
# def info(*args, **kwargs):
# def error(*args, **kwargs):
# def warn(*args, **kwargs):
# def hint(*args, **kwargs):
# def _settings_verbosity_greater_or_equal_than(v):
# def msg(
#     *msg,
#     v=None,
#     time=False,
#     memory=False,
#     reset=False,
#     end="\n",
#     no_indent=False,
#     t=None,
#     m=None,
#     r=None,
# ):
# def _write_log(*msg, end="\n"):
# def _sec_to_str(t, show_microseconds=False):
# def get_passed_time():
# def print_passed_time():
# def timeout(func, args=(), timeout_duration=2, default=None, **kwargs):
#         def __init__(self):
#         def run(self):
# def get_latest_pypi_version():
# def check_if_latest_version():
# def print_version():
# def print_versions():
# def get_date_string():
# def switch_verbosity(mode="on", module=None):
#     def __init__(self, total, interval=3):
#     def update(self):
#     def finish(self):
# def profiler(command, filename="profile.stats", n_stats=10):
#     class InterruptableThread(threading.Thread):
# class ProgressReporter:
# 
# Path: scvelo/core/_arithmetic.py
# def sum(a: Union[ndarray, spmatrix], axis: Optional[int] = None) -> ndarray:
#     """Sum array elements over a given axis.
# 
#     Arguments
#     ---------
#     a
#         Elements to sum.
#     axis
#         Axis along which to sum elements. If `None`, all elements will be summed.
#         Defaults to `None`.
# 
#     Returns
#     -------
#     ndarray
#         Sum of array along given axis.
#     """
# 
#     if a.ndim == 1:
#         axis = 0
# 
#     with warnings.catch_warnings():
#         warnings.simplefilter("ignore")
#         return a.sum(axis=axis).A1 if issparse(a) else a.sum(axis=axis)


import re
import numpy as np
import pandas as pd
from typing import List, Optional, Union
from typing_extensions import Literal
from numpy import ndarray
from pandas import DataFrame
from pandas.api.types import is_categorical_dtype
from scipy.sparse import csr_matrix, issparse, spmatrix
from anndata import AnnData
from scvelo import logging as logg
from ._arithmetic import sum

    mean_abundances = [
        np.mean(counts_per_cell / counts_per_cell_sum)
        for counts_per_cell in counts_layers
    ]

    print(f"Abundance of {layers_keys}: {np.round(mean_abundances, 2)}")


def var_df(adata: AnnData, keys: List[str], layer: Optional[str] = None):
    """Extract layer as Pandas DataFrame indexed by features.

    Arguments
    ---------
    adata
        Annotated data matrix (reference data set).
    keys
        Observations for which to extract data.
    layer
        Name of layer to turn into a Pandas DataFrame.

    Returns
    -------
    DataFrame
        DataFrame indexed by features. Columns correspond to observations of specified
        layer.
    """

    lookup_keys = [k for k in keys if k in adata.obs_names]
    if len(lookup_keys) < len(keys):

# Path: scvelo/logging.py
# _VERBOSITY_LEVELS_FROM_STRINGS = {"error": 0, "warn": 1, "info": 2, "hint": 3}
# def info(*args, **kwargs):
# def error(*args, **kwargs):
# def warn(*args, **kwargs):
# def hint(*args, **kwargs):
# def _settings_verbosity_greater_or_equal_than(v):
# def msg(
#     *msg,
#     v=None,
#     time=False,
#     memory=False,
#     reset=False,
#     end="\n",
#     no_indent=False,
#     t=None,
#     m=None,
#     r=None,
# ):
# def _write_log(*msg, end="\n"):
# def _sec_to_str(t, show_microseconds=False):
# def get_passed_time():
# def print_passed_time():
# def timeout(func, args=(), timeout_duration=2, default=None, **kwargs):
#         def __init__(self):
#         def run(self):
# def get_latest_pypi_version():
# def check_if_latest_version():
# def print_version():
# def print_versions():
# def get_date_string():
# def switch_verbosity(mode="on", module=None):
#     def __init__(self, total, interval=3):
#     def update(self):
#     def finish(self):
# def profiler(command, filename="profile.stats", n_stats=10):
#     class InterruptableThread(threading.Thread):
# class ProgressReporter:
# 
# Path: scvelo/core/_arithmetic.py
# def sum(a: Union[ndarray, spmatrix], axis: Optional[int] = None) -> ndarray:
#     """Sum array elements over a given axis.
# 
#     Arguments
#     ---------
#     a
#         Elements to sum.
#     axis
#         Axis along which to sum elements. If `None`, all elements will be summed.
#         Defaults to `None`.
# 
#     Returns
#     -------
#     ndarray
#         Sum of array along given axis.
#     """
# 
#     if a.ndim == 1:
#         axis = 0
# 
#     with warnings.catch_warnings():
#         warnings.simplefilter("ignore")
#         return a.sum(axis=axis).A1 if issparse(a) else a.sum(axis=axis)


# Path: scvelo/core/_anndata.py
import re
import numpy as np
import pandas as pd
from typing import List, Optional, Union
from typing_extensions import Literal
from numpy import ndarray
from pandas import DataFrame
from pandas.api.types import is_categorical_dtype
from scipy.sparse import csr_matrix, issparse, spmatrix
from anndata import AnnData
from scvelo import logging as logg
from ._arithmetic import sum


    mean_abundances = [
        np.mean(counts_per_cell / counts_per_cell_sum)
        for counts_per_cell in counts_layers
    ]

    print(f"Abundance of {layers_keys}: {np.round(mean_abundances, 2)}")


def var_df(adata: AnnData, keys: List[str], layer: Optional[str] = None):
    """Extract layer as Pandas DataFrame indexed by features.

    Arguments
    ---------
    adata
        Annotated data matrix (reference data set).
    keys
        Observations for which to extract data.
    layer
        Name of layer to turn into a Pandas DataFrame.

    Returns
    -------
    DataFrame
        DataFrame indexed by features. Columns correspond to observations of specified
        layer.
    """

    lookup_keys = [k for k in keys if k in adata.obs_names]
    if len(lookup_keys) < len(keys):

        logg.warn(