code: def _create_masks(att_mask, max_audio_length, padding_length):
      # pad_mask is the masking to be used to ignore paddings
      pad_mask = torch.arange(0, max_audio_length).expand(
          padding_length.size(0), -1
      ) < padding_length.unsqueeze(-1)
  
      # pad_mask_for_att_mask is the mask which helps to ignore paddings
      pad_mask_for_att_mask = pad_mask.unsqueeze(1).repeat(
          [1, max_audio_length, 1]
      )
      pad_mask_for_att_mask = torch.logical_and(
          pad_mask_for_att_mask, pad_mask_for_att_mask.transpose(1, 2)
      )
      # att_mask is the masking to be used by the MHA layers to ignore the tokens not supposed to be visible
      att_mask = att_mask[:, :max_audio_length, :max_audio_length]
      # paddings should also get ignored, so pad_mask_for_att_mask is used to ignore their corresponding scores
      att_mask = torch.logical_and(
          pad_mask_for_att_mask,
          att_mask.to(pad_mask_for_att_mask.device),
      )
  
      pad_mask = ~pad_mask
      att_mask = ~att_mask
  
      return pad_mask, att_mask
  
imports: import pytest
  import torch
  from nemo.collections.asr.parts.submodules import adapters
  from nemo.core.classes.mixins import adapter_mixin_strategies
  from nemo.utils import config_utils
label_desc: Use image node_id 1 for calling a global function with example usage: _create_masks(att_mask, max_audio_length, padding_length) and returns: pad_mask,  att_mask