code: def _f1(cm: _ConfusionMatrix):
      precision = _precision(cm)
      recall = _recall(cm)
      return safe_divide(2 * precision * recall, precision + recall)
  
imports: from collections.abc import Iterable, Sequence
  import dataclasses
  import enum
  import itertools
  from typing import Any
  import numpy
  from numpy import typing
  from tensorflow_model_analysis.experimental.lazytf import api
label_desc: Use image node_id 4 for calling a global function with example usage: _f1(cm) and returns: safe_divide