code: def _validate_expected_value(
      expected_values: _Dict[str, _Any],
      name: str,
      config: ModuleOptimizationConfig,
      param_names: _List[str],
  ):
      if expected_values is None:
          expected_values = {
              param_name: getattr(config, param_name)
              for param_name in param_names
          }
      for param_name, expected_val in expected_values.items():
          val = getattr(config, param_name)
          if val != expected_val:
              raise ValueError(
                  f"Value of parameter {param_name} cannot "
                  f"be different between different module level configs."
                  f"Expected value: {expected_val}, received: {val} "
                  f"for config {name}."
              )
      return expected_values
  
imports: from collections import OrderedDict
  from typing import IO
  from typing import Any
  from typing import Callable
  from typing import Dict
  from typing import List
  from typing import Optional
  from typing import Type
  from typing import Union
  import cattrs
  import torch
  import yaml
  from attr import Factory
  from attr import asdict
  from attr import define
label_desc: Use image node_id 9 for calling the OptimizationConfig obj's underlying member method code with example usage: obj._validate_expected_value(expected_values, name, config, param_names) and returns: expected_values