code: def validate_experiment_config(items: ExpConf) -> ExpConf:
      """Check that the input is either a list of valid experiment configs or a valid
      expansion itself. Returns the list/dict or throws an exception if invalid.
  
      """
  
      # Validate the compound keys before expansion
      if isinstance(items, list) or isinstance(items, dict):
          validate_compound_keys(items)
      else:
          raise argparse.ArgumentTypeError(
              "The experiment config is invalid! \
      The JSON file must contain either a dict or a list."
          )
  
      for item in expand_experiment_config(items):
          validate_expansion(item)
      return items
  
imports: from __future__ import absolute_import, division, print_function
  import argparse
  import itertools
  import re
  import sys
  from collections import ChainMap
  from typing import Any, Dict, List, Optional, Tuple, Union
  import commentjson
  import caliban.util
  import caliban.util.argparse
  import caliban.util.schema
label_desc: Use image node_id 11 for calling a global function with example usage: validate_experiment_config(items) and returns: items