code: def get_dataset_labels(dataset):
      if isinstance(dataset[0], GeneralStaticGraph):
          return torch.LongTensor(
              [
                  d.data["label" if BACKEND == "dgl" else "y"]
                  for d in dataset
              ]
          )
      if BACKEND == "pyg":
          try:
              return dataset.data.y
          except AttributeError:
              return torch.LongTensor([d.y for d in dataset])
      else:
          return torch.LongTensor([d[1] for d in dataset])
  
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 6 for calling a global function with example usage: get_dataset_labels(dataset) and returns: torch, torch, dataset, torch