class_docstr: Collects rooted random-walk based subgraphs for each node in the graph,
  as described in the `"From Stars to Subgraphs: Uplifting Any GNN with Local
  Structure Awareness" <https://arxiv.org/abs/2110.03753>`_ paper.
  
  Args:
      walk_length (int): the length of the random walk.
      repeat (int, optional): The number of times of repeating the random
          walk to reduce randomness. (default: :obj:`1`)
class_docstr_tok: ["Collects","rooted","random-walk","based","subgraphs","for","each","node","in","the","graph",",","as","described","in","the","`","``","From","Stars","to","Subgraphs",":","Uplifting","Any","GNN","with","Local","Structure","Awareness","''","<","https",":","\/\/arxiv.org\/abs\/2110.03753",">","`","_","paper",".","Args",":","walk_length","(","int",")",":","the","length","of","the","random","walk",".","repeat","(","int",",","optional",")",":","The","number","of","times","of","repeating","the","random","walk","to","reduce","randomness",".","(","default",":",":","obj",":","`","1","`",")"]
code: def extract(
      self,
      data: Data,
  ) -> Tuple[Tensor, Tensor, Tensor, Tensor, Tensor]:
      from torch_cluster import random_walk
  
      assert data.edge_index is not None
      num_nodes = data.num_nodes
      assert num_nodes is not None
  
      start = torch.arange(num_nodes, device=data.edge_index.device)
      start = start.view(-1, 1).repeat(1, self.repeat).view(-1)
      walk = random_walk(
          data.edge_index[0],
          data.edge_index[1],
          start,
          self.walk_length,
          num_nodes=data.num_nodes,
      )
  
      n_mask = torch.zeros(
          (num_nodes, num_nodes), dtype=torch.bool, device=walk.device
      )
      start = (
          start.view(-1, 1).repeat(1, (self.walk_length + 1)).view(-1)
      )
      n_mask[start, walk.view(-1)] = True
  
      return self.map(data, n_mask)
  
imports: import copy
  from abc import ABC, abstractmethod
  from typing import Any, Tuple
  import torch
  from torch import Tensor
  from torch_geometric.data import Data
  from torch_geometric.transforms import BaseTransform
  from torch_geometric.utils import to_torch_csc_tensor
label_desc: Use image node_id 2 for calling the RootedRWSubgraph obj's underlying member method code with example usage: obj.extract(data) and returns: self