code: def __init__(
      self,
      data: Union[Data, HeteroData],
      has_val: bool,
      has_test: bool,
      loader: str = "neighbor",
      graph_sampler: Optional[BaseSampler] = None,
      eval_loader_kwargs: Optional[Dict[str, Any]] = None,
      **kwargs: Any,
  ) -> None:
      kwargs.setdefault("batch_size", 1)
      kwargs.setdefault("num_workers", 0)
  
      if graph_sampler is not None:
          loader = "custom"
  
      # For full-batch training, we use reasonable defaults for a lot of
      # data-loading options:
      if loader not in ["full", "neighbor", "link_neighbor", "custom"]:
          raise ValueError(
              f"Undefined 'loader' option (got '{loader}')"
          )
  
      if loader == "full" and kwargs["batch_size"] != 1:
          warnings.warn(
              f"Re-setting 'batch_size' to 1 in "
              f"'{self.__class__.__name__}' for loader='full' "
              f"(got '{kwargs['batch_size']}')"
          )
          kwargs["batch_size"] = 1
  
      if loader == "full" and kwargs["num_workers"] != 0:
          warnings.warn(
              f"Re-setting 'num_workers' to 0 in "
              f"'{self.__class__.__name__}' for loader='full' "
              f"(got '{kwargs['num_workers']}')"
          )
          kwargs["num_workers"] = 0
  
      if loader == "full" and kwargs.get("sampler") is not None:
          warnings.warn(
              "'sampler' option is not supported for " "loader='full'"
          )
          kwargs.pop("sampler", None)
  
      if loader == "full" and kwargs.get("batch_sampler") is not None:
          warnings.warn(
              "'batch_sampler' option is not supported for "
              "loader='full'"
          )
          kwargs.pop("batch_sampler", None)
  
      super().__init__(has_val, has_test, **kwargs)
  
      if loader == "full":
          if kwargs.get("pin_memory", False):
              warnings.warn(
                  f"Re-setting 'pin_memory' to 'False' in "
                  f"'{self.__class__.__name__}' for loader='full' "
                  f"(got 'True')"
              )
          self.kwargs["pin_memory"] = False
  
      self.data = data
      self.loader = loader
  
      # Determine sampler and loader arguments ##############################
  
      if loader in ["neighbor", "link_neighbor"]:
          # Define a new `NeighborSampler` to be re-used across data loaders:
          sampler_kwargs, self.loader_kwargs = split_kwargs(
              self.kwargs,
              NeighborSampler,
          )
          sampler_kwargs.setdefault(
              "share_memory", self.kwargs["num_workers"] > 0
          )
          self.graph_sampler: BaseSampler = NeighborSampler(
              data, **sampler_kwargs
          )
  
      elif graph_sampler is not None:
          sampler_kwargs, self.loader_kwargs = split_kwargs(
              self.kwargs,
              graph_sampler.__class__,
          )
          if len(sampler_kwargs) > 0:
              warnings.warn(
                  f"Ignoring the arguments "
                  f"{list(sampler_kwargs.keys())} in "
                  f"'{self.__class__.__name__}' since a custom "
                  f"'graph_sampler' was passed"
              )
          self.graph_sampler = graph_sampler
  
      else:
          assert loader == "full"
          self.loader_kwargs = self.kwargs
  
      # Determine validation sampler and loader arguments ###################
  
      self.eval_loader_kwargs = copy.copy(self.loader_kwargs)
      if eval_loader_kwargs is not None:
          # If the user wants to override certain values during evaluation,
          # we shallow-copy the graph sampler and update its attributes.
          if hasattr(self, "graph_sampler"):
              self.eval_graph_sampler = copy.copy(self.graph_sampler)
  
              eval_sampler_kwargs, eval_loader_kwargs = split_kwargs(
                  eval_loader_kwargs,
                  self.graph_sampler.__class__,
              )
              for key, value in eval_sampler_kwargs.items():
                  setattr(self.eval_graph_sampler, key, value)
  
          self.eval_loader_kwargs.update(eval_loader_kwargs)
  
      elif hasattr(self, "graph_sampler"):
          self.eval_graph_sampler = self.graph_sampler
  
      self.eval_loader_kwargs.pop("sampler", None)
      self.eval_loader_kwargs.pop("batch_sampler", None)
  
imports: import copy
  import inspect
  import warnings
  from typing import Any, Dict, Optional, Tuple, Type, Union
  import torch
  from torch_geometric.data import Data, Dataset, HeteroData
  from torch_geometric.loader import DataLoader, LinkLoader, NodeLoader
  from torch_geometric.sampler import BaseSampler, NeighborSampler
  from torch_geometric.typing import InputEdges, InputNodes, OptTensor
label_desc: Use image node_id 1 to create a new LightningData object from inherited base classes: LightningDataModule with example: obj = LightningData(data, has_val, has_test, loader, graph_sampler, eval_loader_kwargs)