def METHOD_NAME(data: Any) -> str:
    """Infers the copy mode to use given the data type.
    Args:
        data: The data whose type will be used to infer the copy mode.
    Returns:
        One of "copy", "assign" or "deepcopy" as the copy mode to use.
    """
    # noqa: import-outside-toplevel
    try:
        import pandas as pd
    except ImportError:  # pragma: no cover
        pd = None  # pragma: no cover
    try:
        import numpy as np
    except ImportError:  # pragma: no cover
        np = None  # pragma: no cover
    if pd and isinstance(data, pd.DataFrame) or np and isinstance(data, np.ndarray):
        copy_mode = "copy"
    elif type(data).__name__ == "DataFrame":
        copy_mode = "assign"
    else:
        copy_mode = "deepcopy"
    return copy_mode