class_docstr: The neighbor sampler from the `"Inductive Representation Learning on
  Large Graphs" <https://arxiv.org/abs/1706.02216>`_ literature, which allows
  for mini-batch training of GNNs on large-scale graphs where full-batch
  training is not feasible.
  
  Arguments
  ------------
  edge_index:
      A :obj:`torch.LongTensor` that defines the underlying graph
      connectivity/message passing flow.
      :obj:`edge_index` holds the indices of a (sparse) adjacency matrix.
      If :obj:`edge_index` is of type :obj:`torch.LongTensor`, its shape
      must be defined as :obj:`[2, num_edges]`, where messages from nodes
      :obj:`edge_index[0]` are sent to nodes in :obj:`edge_index[1]`
      (in case :obj:`flow="source_to_target"`).
  target_nodes_indexes:
      indexes of target nodes to learn representation.
  sampling_sizes:
      The number of neighbors to sample for each node in each layer.
      If set to :obj:`sampling_sizes[l] = -1`, all neighbors are included in layer :obj:`l`.
  batch_size:
      number of target nodes for each mini-batch.
  num_workers:
      num_workers argument for inner :class:`torch.utils.data.DataLoader`
  shuffle:
      whether to shuffle target nodes for mini-batches.
code: def _transform(
      self,
      batch_size: int,
      n_id: torch.LongTensor,
      adj_or_adj_list: _typing.Union[
          _typing.Sequence[
              _typing.Tuple[
                  torch.LongTensor,
                  torch.LongTensor,
                  _typing.Tuple[int, int],
              ]
          ],
          _typing.Tuple[
              torch.LongTensor,
              torch.LongTensor,
              _typing.Tuple[int, int],
          ],
      ],
  ) -> TargetDependantSampledData:
      if (
          isinstance(adj_or_adj_list[0], _typing.Tuple)
          and isinstance(adj_or_adj_list, _typing.Sequence)
          and not isinstance(adj_or_adj_list, _typing.Tuple)
      ):
          return TargetDependantSampledData(
              [
                  (
                      current_layer[0],
                      current_layer[1],
                      self.__edge_weight[current_layer[1]],
                  )
                  for current_layer in adj_or_adj_list
              ],
              (
                  torch.arange(batch_size, dtype=torch.long).long(),
                  n_id[:batch_size],
              ),
              n_id,
          )
      elif (
          isinstance(adj_or_adj_list, _typing.Tuple)
          and type(adj_or_adj_list[0]) == torch.Tensor
      ):
          adj_or_adj_list: _typing.Tuple[
              torch.LongTensor,
              torch.LongTensor,
              _typing.Tuple[int, int],
          ] = adj_or_adj_list
          return TargetDependantSampledData(
              [
                  (
                      adj_or_adj_list[0],
                      adj_or_adj_list[1],
                      self.__edge_weight[adj_or_adj_list[1]],
                  )
              ],
              (
                  torch.arange(batch_size, dtype=torch.long).long(),
                  n_id[:batch_size],
              ),
              n_id,
          )
  
file_path: AutoGL/autogl/module/train/sampling/sampler/neighbor_sampler.py
imports: import typing
  import torch.utils.data
  import torch_geometric
  from .target_dependant_sampler import TargetDependantSampler, TargetDependantSampledData
label_desc: Use image node_id 3 for calling the NeighborSampler obj's underlying member method code with example usage: obj._transform(batch_size, n_id, adj_or_adj_list) and returns: TargetDependantSampledData, TargetDependantSampledData