def METHOD_NAME(
    arr: np.ndarray,
    overflow_method: OverflowMethod,
    clip_min: int = 0,
    clip_max: int = 255,
) -> np.ndarray:
    """
    Trim NumPy array values to be in [0, 255] range with option of
    clipping or scaling.
    """
    if overflow_method == OverflowMethod.CLIP:
        scaled = np.clip(arr, clip_min, clip_max)
    else:
        scale_range = (max([arr.min(), clip_min]), min([arr.max(), clip_max]))
        scaled = min_max_scale(arr, new_range=scale_range)
    return scaled