class_docstr: Computes minimum label position.
code: def add_input(
      self, accumulator: _State, query_fpl: query_types.QueryFPL
  ) -> _State:
      weight = 1.0
      if self._weight_key:
          weights = [
              float(_get_feature_value(fpl, self._weight_key))
              for fpl in query_fpl.fpls
          ]
          if weights:
              if min(weights) != max(weights):
                  raise ValueError(
                      "weights were not identical for all examples in the "
                      "query. query_id was: %s, weights were: %s"
                      % (query_fpl.query_id, weights)
                  )
              weight = weights[0]
  
      min_label_pos = None
      for pos, fpl in enumerate(query_fpl.fpls):
          if self._get_label(fpl) > 0:
              min_label_pos = pos + 1  # Use 1-indexed positions
              break
  
      state_to_add = _State(min_pos_sum=0.0, weight_sum=0.0)
      if min_label_pos:
          state_to_add = _State(
              min_pos_sum=min_label_pos, weight_sum=weight
          )
  
      return self._add_states(accumulator, state_to_add)
  
file_path: model-analysis/tensorflow_model_analysis/evaluators/query_metrics/min_label_position.py
imports: from typing import Any, Dict, Iterable, NamedTuple
  import apache_beam
  from tensorflow_model_analysis.eval_saved_model import constants
  from tensorflow_model_analysis.eval_saved_model import util
  from tensorflow_model_analysis.evaluators.query_metrics import query_types
  from tensorflow_model_analysis.post_export_metrics import metric_keys
label_desc: Use image node_id 5 for calling the MinLabelPositionCombineFn obj's underlying member method code with example usage: obj.add_input(accumulator, query_fpl) and returns: self