code: def _add_metric_variables(  # pylint: disable=invalid-name
      left: types.MetricVariablesType, right: types.MetricVariablesType
  ) -> types.MetricVariablesType:
      """Returns left and right metric variables combined."""
      if left is not None and right is not None:
          if len(left) != len(right):
              raise ValueError(
                  "metric variables lengths should match, but got "
                  "%d and %d" % (len(left), len(right))
              )
          return [x + y for x, y in zip(left, right)]
      elif left is not None:
          return left
      else:
          return right
  
imports: from typing import Any, Dict, Iterable, List, Optional
  import apache_beam
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_metrics_graph import eval_metrics_graph
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.utils import model_util
  from tensorflow_model_analysis.utils import size_estimator
label_desc: Use image node_id 2 for calling a global function with example usage: _add_metric_variables(left, right) and returns: unknown, left, right