code: def lens_to_mask(lens: List[int], max_len: int, device: str = None):
      """
      outputs masking labels for list of lengths of audio features, with max length of any
      mask as max_len
      input:
          lens: list of lens
          max_len: max length of any audio feature
      output:
          mask: masked labels
          num_values: sum of mask values for each feature (useful for computing statistics later)
      """
      lens_mat = torch.arange(max_len).to(device)
      mask = lens_mat[:max_len].unsqueeze(0) < lens.unsqueeze(1)
      mask = mask.unsqueeze(1)
      num_values = torch.sum(mask, dim=2, keepdim=True)
      return mask, num_values
  
imports: from typing import List
  import torch
  from numpy import inf
  from torch import nn
  from torch.nn import functional
  from nemo.collections.asr.parts.submodules.jasper import get_same_padding, init_weights
label_desc: Use image node_id 2 for calling a global function with example usage: lens_to_mask(lens, max_len, device) and returns: mask,  num_values