docstr: Parameters
  ----------
  partial_index
      Get the result precision until a certain index.
      For example, if the result has precisions ``[0.1, 0.5, 0.95]`` and ``partial_index=1``, this will
      return ``0.5``.
  
  Returns
  -------
  precision
      Anchor precision.
code: def precision(self, partial_index: Optional[int] = None) -> float:
      """
      Parameters
      ----------
      partial_index
          Get the result precision until a certain index.
          For example, if the result has precisions ``[0.1, 0.5, 0.95]`` and ``partial_index=1``, this will
          return ``0.5``.
  
      Returns
      -------
      precision
          Anchor precision.
      """
      precision = self.exp_map["precision"]
      if len(precision) == 0:
          return self.exp_map["all_precision"]
      if partial_index is not None:
          return precision[partial_index]
      else:
          return precision[-1]
  
file_path: alibi/alibi/explainers/anchors/anchor_explanation.py
imports: from typing import Optional, Union
  import numpy
label_desc: Use image node_id 4 for calling the AnchorExplanation obj's underlying member method code with example usage: obj.precision(partial_index) and returns: self, precision, precision