code: def repeat_interleave(
      repeats: List[int],
      device: Optional[torch.device] = None,
  ) -> Tensor:
      outs = [
          torch.full((n,), i, device=device)
          for i, n in enumerate(repeats)
      ]
      return torch.cat(outs, dim=0)
  
file_path: pytorch_geometric/torch_geometric/data/collate.py
imports: from collections import defaultdict
  from collections.abc import Mapping, Sequence
  from typing import Any, Dict, Iterable, List, Optional, Tuple, Type, TypeVar, Union
  import torch
  from torch import Tensor
  import torch_geometric.typing
  from torch_geometric import EdgeIndex
  from torch_geometric.data.data import BaseData
  from torch_geometric.data.storage import BaseStorage, NodeStorage
  from torch_geometric.edge_index import SortOrder
  from torch_geometric.typing import SparseTensor, TensorFrame, torch_frame, torch_sparse
  from torch_geometric.utils import cumsum, is_sparse, is_torch_sparse_tensor
  from torch_geometric.utils.sparse import cat
label_desc: Use image node_id 4 for calling a global function with example usage: repeat_interleave(repeats, device) and returns: torch