# 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
        adata.obsm[modality] = new_value

    if not inplace:
        return adata


def show_proportions(
    adata: AnnData, layers: Optional[str] = None, use_raw: bool = True
) -> None:
    """Proportions of abundances of modalities in layers.

    The proportions are printed.

    Arguments
    ---------
    adata
        Annotated data matrix.
    layers
        Layers to consider.
    use_raw
        Use initial sizes, i.e., raw data, to determine proportions.

    Returns
    -------
    None
    """

    if layers is None:
        layers = ["spliced", "unspliced", "ambigious"]
    layers_keys = [key for key in layers if key in adata.layers.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

        adata.obsm[modality] = new_value

    if not inplace:
        return adata


def show_proportions(
    adata: AnnData, layers: Optional[str] = None, use_raw: bool = True
) -> None:
    """Proportions of abundances of modalities in layers.

    The proportions are printed.

    Arguments
    ---------
    adata
        Annotated data matrix.
    layers
        Layers to consider.
    use_raw
        Use initial sizes, i.e., raw data, to determine proportions.

    Returns
    -------
    None
    """

    if layers is None:
        layers = ["spliced", "unspliced", "ambigious"]
    layers_keys = [key for key in layers if key in adata.layers.keys()]

    counts_layers = [sum(adata.layers[key], axis=1) for key in layers_keys]