def METHOD_NAME(array: Union[np.ndarray, pd.Series, pd.Index]) -> bool:
    """
    Return true if the (U)INT array values can be safely cast to int32.  We allow size reducing
    casts (ie, int64 to int32) if no actual values require the larger size (ie, actual values
    can be represented by the smaller type).
    """
    assert array.dtype.kind in ["u", "i"]
    if np.can_cast(array.dtype, np.int32):
        return True
    if array.size == 0:
        return True
    int32_machine_limits = np.iinfo(np.int32)
    if array.min() >= int32_machine_limits.min and array.max() <= int32_machine_limits.max:
        return True
    return False