code: def check_nan_losses(loss):
      """
      Determine whether the loss is NaN (not a number).
      Args:
          loss (loss): loss to check whether is NaN.
      """
      if math.isnan(loss):
          raise RuntimeError(
              "ERROR: Got NaN losses {}".format(datetime.now())
          )
  
imports: import json
  import logging
  import math
  import numpy
  import os
  from datetime import datetime
  import psutil
  import torch
  import torchvision.io
  from fvcore.nn.activation_count import activation_count
  from fvcore.nn.flop_count import flop_count
  from matplotlib import pyplot
  from torch import nn
  from torchvision.utils import make_grid
  import slowfast.utils.logging
  import slowfast.utils.multiprocessing
  from slowfast.datasets.utils import pack_pathway_output
  from slowfast.models.batchnorm_helper import SubBatchNorm3d
  from slowfast.utils.env import pathmgr
label_desc: Use image node_id 1 for calling a global function with example usage: check_nan_losses(loss) without return types