code: def create_supervision(input_lengths: torch.Tensor) -> torch.Tensor:
      """Creates a special supervisions tensor from input lengths.
      These supervisions are required for some k2 methods.
      """
      supervisions = torch.stack(
          (
              torch.tensor(range(input_lengths.shape[0])),
              torch.zeros(input_lengths.shape[0]),
              input_lengths.cpu(),
          ),
          1,
      ).to(dtype=torch.int32)
      # the duration column has to be sorted in decreasing order
      return supervisions[
          torch.argsort(supervisions[:, -1], descending=True)
      ]
  
imports: import os
  import struct
  from pickle import UnpicklingError
  from typing import List, Optional, Tuple, Union
  import torch
  from nemo.core.utils.k2_guard import k2
  from nemo.utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: create_supervision(input_lengths) and returns: supervisions