def METHOD_NAME(dtype) -> Union[np.finfo, np.iinfo]:
    """
    Return an appropriate 'np.iinfo' or 'np.finfo' object corresponding to
    the specified Numpy dtype.
    'dtype' must be a value that 'numpy.dtype(...)' can handle.
    """
    np_dtype = np.dtype(dtype)
    kind = np_dtype.kind
    if kind == "f":
        return np.finfo(np_dtype)
    elif kind == "i":
        return np.iinfo(np_dtype)
    else:
        raise TypeError(f"dtype ({dtype}) must indicate some floating-point or integral data type")