def METHOD_NAME(inp, class_names: List[str], return_original=False):
    if isinstance(inp, np.integer):
        idx = int(inp)
        if idx < len(class_names):
            return class_names[idx]
        return idx if return_original else None
    return [METHOD_NAME(item, class_names) for item in inp]