code: def get_graph_masks(graph, mask="train"):
      if isinstance(graph, GeneralStaticGraph):
          if f"{mask}_mask" in graph.nodes.data:
              return graph.nodes.data[f"{mask}_mask"]
          return None
      if BACKEND == "pyg" and hasattr(graph, f"{mask}_mask"):
          return getattr(graph, f"{mask}_mask")
      if BACKEND == "dgl" and f"{mask}_mask" in graph.ndata:
          return graph.ndata[f"{mask}_mask"]
      return None
  
imports: import random
  import typing
  import torch
  import torch.backends.cudnn
  import numpy
  import pandas
  from ..backend import DependentBackend
  from ..data import Dataset
  from ..data.graph import GeneralStaticGraph
  from ..utils import get_logger
label_desc: Use image node_id 4 for calling a global function with example usage: get_graph_masks(graph, mask) and returns: None, None, getattr, graph, graph