def is_private(obj) -> bool:
    """Is the object private, i.e. _func(x)?"""
    assert hasattr(obj, "__name__")

    obj_name = obj.__name__
    typical_private = obj_name.startswith("_") and obj_name[1] != "_"
    private_subpackage = "._" in obj_name

    return typical_private or private_subpackage