code: def __call__(
      self,
      dgl_graph: dgl.DGLGraph,
      as_universal_storage_format: _typing.Optional[bool] = ...,
      *__args,
      **__kwargs,
  ) -> GeneralStaticGraph:
      if not (
          as_universal_storage_format in (Ellipsis, None)
          or isinstance(as_universal_storage_format, bool)
      ):
          raise TypeError
      _as_universal_storage_format: bool = (
          as_universal_storage_format
          if isinstance(as_universal_storage_format, bool)
          else self._as_universal_storage_format
      )
  
      if not _as_universal_storage_format:
          general_static_graph: GeneralStaticGraph = _general_static_graph_dgl_implementation.GeneralStaticGraphDGLImplementation(
              dgl_graph
          )
  
      else:
          general_static_graph: GeneralStaticGraph = _general_static_graph_generator.GeneralStaticGraphGenerator.create_heterogeneous_static_graph(
              dict(
                  [
                      (node_type, dgl_graph.nodes[node_type].data)
                      for node_type in dgl_graph.ntypes
                  ]
              ),
              dict(
                  [
                      (
                          canonical_edge_type,
                          (
                              torch.vstack(
                                  dgl_graph.edges(
                                      etype=canonical_edge_type
                                  )
                              ),
                              dgl_graph.edges[canonical_edge_type].data,
                          ),
                      )
                      for canonical_edge_type in dgl_graph.canonical_etypes
                  ]
              ),
          )
      if hasattr(dgl_graph, "graph_data") and isinstance(
          getattr(dgl_graph, "graph_data"), _typing.Mapping
      ):
          graph_data: _typing.Mapping[str, torch.Tensor] = getattr(
              dgl_graph, "graph_data"
          )
          for k, v in graph_data.items():
              if (
                  isinstance(k, str)
                  and " " not in k
                  and isinstance(v, torch.Tensor)
              ):
                  general_static_graph.data[k] = v
      for k in ("gf",):
          if hasattr(dgl_graph, k) and isinstance(
              getattr(dgl_graph, k), torch.Tensor
          ):
              general_static_graph.data[k] = getattr(dgl_graph, k)
      return general_static_graph
  
file_path: AutoGL/autogl/data/graph/_general_static_graph/utils/conversion/_dgl.py
imports: import dgl
  import torch
  import typing
  from ..._general_static_graph import GeneralStaticGraph
  from ...None import _general_static_graph_generator, _general_static_graph_dgl_implementation
label_desc: Use image node_id 2 for calling the DGLGraphToGeneralStaticGraph obj's underlying member method code with example usage: obj.__call__(dgl_graph, as_universal_storage_format) and returns: general_static_graph