code: def is_out_of_memory_error(exception: BaseException) -> bool:
      """Returns True if an exception is due to an OOM based on error message"""
      return is_out_of_cpu_memory(exception) or is_out_of_cuda_memory(
          exception
      )
  
file_path: tnt/torchtnt/utils/oom.py
imports: import logging
  import os
  import pickle
  from typing import Any, Callable, Dict, Optional, Union
  import torch
  from torchtnt.utils.distributed import get_global_rank
  from torchtnt.utils.fsspec import get_filesystem
  from torchtnt.utils.version import is_torch_version_geq_2_0
label_desc: Use image node_id 3 for calling a global function with example usage: is_out_of_memory_error(exception) and returns: unknown