code: def validate_expansion(m: Expansion) -> Expansion:
      """Check that:
  
      - all key are strings
      - all values are either boolean, strings, numbers or lists
      """
  
      def valid_k(k):
          return isinstance(k, str)
  
      def valid_v(v):
          types = [list, bool, str, int, float]
          return any(map(lambda t: isinstance(v, t), types))
  
      for k, v in m.items():
          if not valid_k(k):
              raise argparse.ArgumentTypeError(
                  "Key '{}' is invalid! Keys must be strings.".format(k)
              )
  
          if not valid_v(v):
              raise argparse.ArgumentTypeError(
                  "Value '{}' in the expanded \
  experiment config '{}' is invalid! Values must be strings, \
  lists, ints, floats or bools.".format(
                      v, m
                  )
              )
  
      return m
  
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 10 for calling a global function with example usage: validate_expansion(m) and returns: m, isinstance, any