code: def make_source_mask(lengths: torch.Tensor) -> torch.Tensor:
      """Create source mask for given lengths.
  
      Reference: https://github.com/k2-fsa/icefall/blob/master/icefall/utils.py
  
      Args:
          lengths: Sequence lengths. (B,)
  
      Returns:
          : Mask for the sequence lengths. (B, max_len)
  
      """
      max_len = lengths.max()
      batch_size = lengths.size(0)
  
      expanded_lengths = (
          torch.arange(max_len).expand(batch_size, max_len).to(lengths)
      )
  
      return expanded_lengths >= lengths.unsqueeze(1)
  
file_path: espnet/espnet2/asr_transducer/utils.py
imports: from typing import List, Tuple, Union
  import torch
label_desc: Use image node_id 4 for calling a global function with example usage: make_source_mask(lengths) and returns: unknown