# 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:


import os
import numpy as np
            import ipywidgets  # noqa
from multiprocessing import Manager
from threading import Thread
from typing import Any, Callable, Optional, Sequence, Union
from joblib import delayed, Parallel
from scipy.sparse import issparse, spmatrix
from scvelo import logging as logg
                from tqdm.notebook import tqdm
                from tqdm import tqdm_notebook as tqdm




_msg_shown = False


def get_n_jobs(n_jobs):
    if n_jobs is None or (n_jobs < 0 and os.cpu_count() + 1 + n_jobs <= 0):
        return 1
    elif n_jobs > os.cpu_count():
        return os.cpu_count()
    elif n_jobs < 0:
        return os.cpu_count() + 1 + n_jobs

# 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/_parallelize.py
import os
import numpy as np
            import ipywidgets  # noqa
from multiprocessing import Manager
from threading import Thread
from typing import Any, Callable, Optional, Sequence, Union
from joblib import delayed, Parallel
from scipy.sparse import issparse, spmatrix
from scvelo import logging as logg
                from tqdm.notebook import tqdm
                from tqdm import tqdm_notebook as tqdm





_msg_shown = False


def get_n_jobs(n_jobs):
    if n_jobs is None or (n_jobs < 0 and os.cpu_count() + 1 + n_jobs <= 0):
        return 1
    elif n_jobs > os.cpu_count():
        return os.cpu_count()
    elif n_jobs < 0:
        return os.cpu_count() + 1 + n_jobs

    else: