def fully_qualified_classname(class_or_instance):
    """Get the fully qualified Python path of a class (or instance).

    Parameters
    ----------
    class_or_instance : any
        The class (or instance of a class) to work on

    Returns
    -------
    str
        The fully qualified, dotted Python path of that class or instance.
    """
    if isinstance(class_or_instance, type):
        # operating on a class (NOT an instance!)
        return ".".join([class_or_instance.__module__, class_or_instance.__qualname__])

    # operating on an instance
    return ".".join(
        [
            class_or_instance.__class__.__module__,
            class_or_instance.__class__.__qualname__,
        ]
    )