code: def _build_loss_mask(self, processed_example):
      if self.answer_only_loss:
          seq_boundaries = processed_example["seq_boundaries"]
          return np.concatenate(
              [
                  processed_example["loss_mask"][
                      seq_boundaries[i] + 1 : seq_boundaries[i + 1]
                  ]
                  for i in range(len(seq_boundaries) - 1)
              ]
          )
      return [1.0] * (
          len(processed_example["input_ids"])
          - len(processed_example["seq_boundaries"])
          + 1
      )
  
imports: import re
  from typing import List, Mapping, Optional
  import datasets
  import numpy
  import torch
  from datasets import load_dataset
  from nemo.collections.common.tokenizers.tokenizer_spec import TokenizerSpec
  from nemo.collections.nlp.data.language_modeling.megatron.dataset_utils import get_samples_mapping
  from nemo.collections.nlp.data.language_modeling.text_memmap_dataset import JSONLMemMapDataset
  from nemo.core.classes import Dataset
  from nemo.utils import logging
label_desc: Use image node_id 5 for calling the GPTSFTPackedDataset obj's underlying member method code with example usage: obj._build_loss_mask(processed_example) and returns: unknown, np