code: def cmRecall(
      cm: ConfusionMatrix, average: bool = True
  ) -> MetricsLambda:
      """
      Calculates recall using :class:`~ignite.metrics.confusion_matrix.ConfusionMatrix` metric.
      Args:
          cm: instance of confusion matrix metric
          average: if True metric value is averaged over all classes
      Returns:
          MetricsLambda
      """
  
      # Increase floating point precision and pass to CPU
      cm = cm.to(torch.double)
      recall: MetricsLambda = cm.diag() / (cm.sum(dim=1) + 1e-15)
      if average:
          mean: MetricsLambda = recall.mean()
          return mean
      return recall
  
imports: import numbers
  from typing import Callable, Optional, Sequence, Tuple, Union
  import torch
  from ignite.exceptions import NotComputableError
  from ignite.metrics.metric import Metric, reinit__is_reduced, sync_all_reduce
  from ignite.metrics.metrics_lambda import MetricsLambda
label_desc: Use image node_id 5 for calling a global function with example usage: cmRecall(cm, average) and returns: recall, mean