class_docstr: Adds additional edge types similar to :class:`AddMetaPaths`.
  The key difference is that the added edge type is given by
  multiple random walks along the metapath.
  One might want to increase the number of random walks
  via :obj:`walks_per_node` to achieve competitive performance with
  :class:`AddMetaPaths`.
  
  Args:
      metapaths (List[List[Tuple[str, str, str]]]): The metapaths described
          by a list of lists of
          :obj:`(src_node_type, rel_type, dst_node_type)` tuples.
      drop_orig_edge_types (bool, optional): If set to :obj:`True`, existing
          edge types will be dropped. (default: :obj:`False`)
      keep_same_node_type (bool, optional): If set to :obj:`True`, existing
          edge types between the same node type are not dropped even in case
          :obj:`drop_orig_edge_types` is set to :obj:`True`.
          (default: :obj:`False`)
      drop_unconnected_node_types (bool, optional): If set to :obj:`True`,
          will drop node types not connected by any edge type.
          (default: :obj:`False`)
      walks_per_node (int, List[int], optional): The number of random walks
          for each starting node in a metapth. (default: :obj:`1`)
      sample_ratio (float, optional): The ratio of source nodes to start
          random walks from. (default: :obj:`1.0`)
code: def __init__(
      self,
      metapaths: List[List[EdgeType]],
      drop_orig_edge_types: bool = False,
      keep_same_node_type: bool = False,
      drop_unconnected_node_types: bool = False,
      walks_per_node: Union[int, List[int]] = 1,
      sample_ratio: float = 1.0,
  ):
      for path in metapaths:
          assert len(path) >= 2, f"Invalid metapath '{path}'"
          assert all(
              [j[-1] == path[i + 1][0] for i, j in enumerate(path[:-1])]
          ), f"Invalid sequence of node types in '{path}'"
  
      self.metapaths = metapaths
      self.drop_orig_edge_types = drop_orig_edge_types
      self.keep_same_node_type = keep_same_node_type
      self.drop_unconnected_node_types = drop_unconnected_node_types
      self.sample_ratio = sample_ratio
      if isinstance(walks_per_node, int):
          walks_per_node = [walks_per_node] * len(metapaths)
      assert len(walks_per_node) == len(metapaths)
      self.walks_per_node = walks_per_node
  
imports: import warnings
  from typing import List, Optional, Tuple, Union, cast
  import torch
  from torch import Tensor
  from torch_geometric import EdgeIndex
  from torch_geometric.data import HeteroData
  from torch_geometric.data.datapipes import functional_transform
  from torch_geometric.transforms import BaseTransform
  from torch_geometric.typing import EdgeType
  from torch_geometric.utils import coalesce, degree
label_desc: Use image node_id 1 to create a new AddRandomMetaPaths object from inherited base classes: BaseTransform with example: obj = AddRandomMetaPaths(metapaths, drop_orig_edge_types, keep_same_node_type, drop_unconnected_node_types, walks_per_node, sample_ratio)