code: def testSpanDrivenEvaluatorInputs_EvaluationTrainingOffset(self):
      actual = self._span_driven_evaluator(
          self.models,
          self.examples,
          evaluation_training_offset=0,
      )
      expected = {
          ops_utils.MODEL_KEY: [self.model_5],
          ops_utils.EXAMPLES_KEY: [self.examples_10],
      }
      self.assertArtifactMapsEqual(actual, expected)
  
      actual = self._span_driven_evaluator(
          self.models,
          self.examples,
          evaluation_training_offset=1,
      )
      expected = {
          ops_utils.MODEL_KEY: [self.model_5],
          ops_utils.EXAMPLES_KEY: [self.examples_10],
      }
      self.assertArtifactMapsEqual(actual, expected)
  
      # max_span for _get_model_to_evaluate will be 10 - 4 = 6 and Model 4 is the
      # latest model not trained on span 6.
      actual = self._span_driven_evaluator(
          self.models,
          self.examples,
          evaluation_training_offset=4,
      )
      expected = {
          ops_utils.MODEL_KEY: [self.model_4],
          ops_utils.EXAMPLES_KEY: [self.examples_10],
      }
      self.assertArtifactMapsEqual(actual, expected)
  
      actual = self._span_driven_evaluator(
          self.models,
          self.examples,
          evaluation_training_offset=-1,
      )
      expected = {
          ops_utils.MODEL_KEY: [self.model_5],
          ops_utils.EXAMPLES_KEY: [self.examples_10],
      }
      self.assertArtifactMapsEqual(actual, expected)
  
      # max_span for _get_model_to_evaluate will be 6 - (-1) = 7 and Model 5 is
      # latest model not trained on span 7.
      actual = self._span_driven_evaluator(
          self.models,
          self.examples[:6],
          evaluation_training_offset=-1,
      )
      expected = {
          ops_utils.MODEL_KEY: [self.model_5],
          ops_utils.EXAMPLES_KEY: [self.examples_6],
      }
      self.assertArtifactMapsEqual(actual, expected)
  
      # max_span for _get_model_to_evaluate will be 3 - (-2) = 5 and Model 3 is
      # latest model not trained on span 5.
      actual = self._span_driven_evaluator(
          self.models,
          self.examples[:3],
          evaluation_training_offset=-2,
      )
      expected = {
          ops_utils.MODEL_KEY: [self.model_3],
          ops_utils.EXAMPLES_KEY: [self.examples_3],
      }
      self.assertArtifactMapsEqual(actual, expected)
  
      # max_span for _get_model_to_evaluate will be 10 - (-50) = 55 and Model 5 is
      # latest model not trained on span 55.
      actual = self._span_driven_evaluator(
          self.models,
          self.examples,
          evaluation_training_offset=-50,
      )
      expected = {
          ops_utils.MODEL_KEY: [self.model_5],
          ops_utils.EXAMPLES_KEY: [self.examples_10],
      }
      self.assertArtifactMapsEqual(actual, expected)
  
      with self.assertRaises(exceptions.SkipSignal):
          # max_span will be 10 - 8 = 2 and no model was trained on a span < 2.
          actual = self._span_driven_evaluator(
              self.models,
              self.examples,
              evaluation_training_offset=8,
          )
  
          # max_span will be < 1
          actual = self._span_driven_evaluator(
              self.models,
              self.examples,
              evaluation_training_offset=50,
          )
  
imports: from typing import List, Optional
  import tensorflow
  from tfx import types
  from tfx.dsl.input_resolution.ops import ops
  from tfx.dsl.input_resolution.ops import ops_utils
  from tfx.dsl.input_resolution.ops import test_utils
  from tfx.orchestration.portable.input_resolution import exceptions
label_desc: Use image node_id 10 for calling the SpanDrivenEvaluatorInputsOpTest obj's underlying member method code with example usage: obj.testSpanDrivenEvaluatorInputs_EvaluationTrainingOffset() without return types