code: def cmAccuracy(cm: ConfusionMatrix) -> MetricsLambda:
      """Calculates accuracy using :class:`~ignite.metrics.metric.ConfusionMatrix` metric.
  
      Args:
          cm: instance of confusion matrix metric
  
      Returns:
          MetricsLambda
      """
      # Increase floating point precision and pass to CPU
      cm = cm.to(torch.double)
      accuracy: MetricsLambda = cm.diag().sum() / (cm.sum() + 1e-15)
      return accuracy
  
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 3 for calling a global function with example usage: cmAccuracy(cm) and returns: accuracy