code: def save_heterographs(filename, g_list, labels, formats):
      """Save heterographs into file"""
      if labels is None:
          labels = {}
      if isinstance(g_list, DGLGraph):
          g_list = [g_list]
      assert all(
          [type(g) == DGLGraph for g in g_list]
      ), "Invalid DGLGraph in g_list argument"
      gdata_list = [HeteroGraphData.create(g) for g in g_list]
      if formats is None:
          formats = []
      elif isinstance(formats, str):
          formats = [formats]
      _CAPI_SaveHeteroGraphData(
          filename,
          gdata_list,
          tensor_dict_to_ndarray_dict(labels),
          formats,
      )
  
file_path: dgl/python/dgl/data/heterograph_serialize.py
imports: from __future__ import absolute_import
  from ..None import backend
  from .._ffi.function import _init_api
  from .._ffi.object import ObjectBase, register_object
  from ..container import convert_to_strmap
  from ..frame import Frame
  from ..heterograph import DGLGraph
label_desc: Use image node_id 2 for calling a global function with example usage: save_heterographs(filename, g_list, labels, formats) without return types