code: def check_all_same_schema_for_keys(schemas, keys, name):
      """Check the list of schemas are the same on the given keys."""
      if len(schemas) == 0:
          return
  
      head = None
      keys = set(keys)
      for i, schema in enumerate(schemas):
          if not keys.issubset(schema.keys()):
              raise DGLError(
                  "Expect all graphs to have keys {} on {}, "
                  "but graph {} got keys {}.".format(
                      keys, name, i, schema.keys()
                  )
              )
  
          if head is None:
              head = {k: schema[k] for k in keys}
          else:
              target = {k: schema[k] for k in keys}
              if target != head:
                  raise DGLError(
                      "Expect all graphs to have the same schema for keys {} on {}, "
                      "but graph {} got \n\t{}\n which is different from\n\t{}.".format(
                          keys, name, i, target, head
                      )
                  )
  
file_path: dgl/python/dgl/utils/checks.py
imports: from __future__ import absolute_import, division
  from collections.abc import Mapping
  from ..None import backend
  from .._ffi.function import _init_api
  from ..base import DGLError
label_desc: Use image node_id 9 for calling a global function with example usage: check_all_same_schema_for_keys(schemas, keys, name) without return types