code: def remove_duplicates(
      out: SamplerOutput,
      node: Tensor,
      batch: Optional[Tensor] = None,
      disjoint: bool = False,
  ) -> Tuple[Tensor, Tensor, Optional[Tensor], Optional[Tensor]]:
      num_nodes = node.numel()
      node_combined = torch.cat([node, out.node])
  
      if not disjoint:
          _, idx = np.unique(
              node_combined.cpu().numpy(), return_index=True
          )
          idx = torch.from_numpy(idx).to(node.device).sort().values
  
          node = node_combined[idx]
          src = node[num_nodes:]
  
          return (src, node, None, None)
  
      else:
          batch_combined = torch.cat([batch, out.batch])
          node_batch = torch.stack(
              [batch_combined, node_combined], dim=0
          )
  
          _, idx = np.unique(
              node_batch.cpu().numpy(), axis=1, return_index=True
          )
          idx = torch.from_numpy(idx).to(node.device).sort().values
  
          batch = batch_combined[idx]
          node = node_combined[idx]
          src_batch = batch[num_nodes:]
          src = node[num_nodes:]
  
          return (src, node, src_batch, batch)
  
file_path: pytorch_geometric/torch_geometric/distributed/utils.py
imports: from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from torch import Tensor
  from torch_geometric.data import HeteroData
  from torch_geometric.distributed import LocalFeatureStore, LocalGraphStore
  from torch_geometric.sampler import SamplerOutput
  from torch_geometric.typing import EdgeType, NodeType
label_desc: Use image node_id 1 for calling a global function with example usage: remove_duplicates(out, node, batch, disjoint) and returns: src,  node,  None,  None, src,  node,  src_batch,  batch