code: def run_validator(
      validator: ModelValidator__Union,
      training_output: RLTrainingOutput,
  ) -> RLTrainingOutput:
      assert (
          training_output.validation_result is None
      ), f"validation_output was set to f{training_output.validation_output}"
      model_validator = validator.value
      validation_result = model_validator.validate(training_output)
      return dataclasses.replace(
          training_output, validation_result=validation_result
      )
  
imports: import dataclasses
  import logging
  import time
  from typing import Dict, Optional
  import torch
  from reagent.core.parameters import NormalizationData
  from reagent.core.tensorboardX import summary_writer_context
  from reagent.data.manual_data_module import get_sample_range
  from reagent.data.oss_data_fetcher import OssDataFetcher
  from reagent.model_managers.model_manager import ModelManager
  from reagent.model_managers.union import ModelManager__Union
  from reagent.publishers.union import ModelPublisher__Union
  from reagent.validators.union import ModelValidator__Union
  from reagent.workflow.env import get_new_named_entity_ids, get_workflow_id
  from reagent.workflow.types import Dataset, ModuleNameToEntityId, ReaderOptions, RecurringPeriod, ResourceOptions, RewardOptions, RLTrainingOutput, TableSpec
  from torch.utils.tensorboard import SummaryWriter
label_desc: Use image node_id 4 for calling a global function with example usage: run_validator(validator, training_output) and returns: dataclasses