code: def arange_sequence(ranges: Tensor) -> Tensor:
      """Returns a sequence of the ranges specified by the argument.
  
      Example:
      [2, 5, 1, 2] -> [0, 1, 0, 1, 2, 3, 4, 0, 0, 1]
      """
      maxcnt = torch.max(ranges).item()
      numuni = ranges.shape[0]
      complete_ranges = (
          torch.arange(maxcnt, device=ranges.device)
          .unsqueeze(0)
          .expand(numuni, -1)
      )
  
      return complete_ranges[complete_ranges < ranges.unsqueeze(-1)]
  
file_path: kornia/kornia/feature/adalam/utils.py
imports: import math
  from typing import Tuple
  import torch
  from kornia.core import Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: arange_sequence(ranges) and returns: complete_ranges