code: def get_seqs_and_padding_mask(
      data: SequenceData, device: Optional[Device] = None
  ) -> Tuple[Tensor, Optional[PaddingMask]]:
      """Return the sequences along with their padding mask from ``data``.
  
      :returns:
          - The sequences (i.e. `data["seqs"]`)
          - The padding mask of the returned sequences.
      """
      seqs = data["seqs"]
  
      if device is not None:
          seqs = seqs.to(device)
  
      if not data["is_ragged"]:
          return seqs, None
  
      seq_lens = data["seq_lens"]
  
      if device is not None:
          seq_lens = seq_lens.to(device)
  
      return seqs, PaddingMask(seq_lens, batch_seq_len=seqs.size(1))
  
file_path: fairseq2/src/fairseq2/nn/padding.py
imports: from __future__ import annotations
  from typing import Any, Optional, Sequence, Tuple, cast
  import torch
  from torch import Tensor
  from fairseq2.data import Collater, SequenceData
  from fairseq2.typing import Device
label_desc: Use image node_id 3 for calling a global function with example usage: get_seqs_and_padding_mask(data, device) and returns: seqs,  PaddingMask, seqs,  None