from typing import Callable


def extract_name(callable: Callable) -> str:
    """ Given a callable that could be either a class or a function, retrieve
        its name at runtime for subsequent use

    Args:
        callable (Callable): Callable whose name is to be extracted
    Return:
        Name of callable (str)
    """
    try:
        return callable.__name__
    except:
        return type(callable).__class__.__name__