class_docstr: Offer a similar interface as WorkloadResponseInterceptor, except let send() yield a whole
  progression of RUN_STEP and COMPUTE_VALIDATION_METRICS, and let result() return the accumulated
  metrics from each.
class_docstr_tok: ["Offer","a","similar","interface","as","WorkloadResponseInterceptor",",","except","let","send","(",")","yield","a","whole","progression","of","RUN_STEP","and","COMPUTE_VALIDATION_METRICS",",","and","let","result","(",")","return","the","accumulated","metrics","from","each","."]
code: def __init__(
      self, request_stop_step_id: Optional[int] = None
  ) -> None:
      self._training_metrics = (
          None
      )  # type: Optional[List[Dict[str, Any]]]
      self._avg_training_metrics = (
          None
      )  # type: Optional[List[Dict[str, Any]]]
      self._validation_metrics = (
          None
      )  # type: Optional[List[Dict[str, Any]]]
      self.request_stop_step_id = request_stop_step_id
      self._steps_completed = 0
  
imports: import importlib
  import os
  import pathlib
  import re
  import unittest.mock
  from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type
  import numpy
  import pytest
  from mypy_extensions import DefaultNamedArg
  import determined
  from determined import core, gpu, workload
  from determined.common import util
label_desc: Use image node_id 1 to create a new TrainAndValidate object  with example: obj = TrainAndValidate(request_stop_step_id)