def METHOD_NAME(arg: np.ndarray):
    if np.issubdtype(arg.dtype, int):
        return arg.tolist()
    if np.issubdtype(arg.dtype, np.floating):
        b = np.array(arg, dtype=object)
        b[np.isnan(arg)] = "Nan"
        b[np.isposinf(arg)] = "Infinity"
        b[np.isneginf(arg)] = "-Infinity"
        return b.tolist()
    return _encode_json_list(arg.tolist())