code: def check_initializers(
      initializers: Mapping[str, Initializer],
      expected_keys: Iterable[str],
  ):
      """Checks a dictionary of initializers only contains the given keys."""
      if initializers is None:
          return {}
  
      if not isinstance(initializers, collections.abc.Mapping):
          raise TypeError("Initializers must be a dict-like object.")
  
      extra_keys = frozenset(initializers) - frozenset(expected_keys)
      if extra_keys:
          raise KeyError(
              "Invalid initializer keys {}, initializers can only "
              "be provided for {}".format(
                  ", ".join(map(repr, extra_keys)),
                  ", ".join(map(repr, expected_keys)),
              )
          )
  
      return initializers
  
imports: import abc
  import collections
  from typing import Iterable, Mapping, Optional, Union
  import numpy
  from sonnet.src import types
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: check_initializers(initializers, expected_keys) and returns: initializers, dict