class_docstr: Dataset containing sentences and their blocks for an inverse cloze task.
class_docstr_tok: ["Dataset","containing","sentences","and","their","blocks","for","an","inverse","cloze","task","."]
docstr: Concat with special tokens and pad sequence to self.max_seq_length
docstr_tok: ["Concat","with","special","tokens","and","pad","sequence","to","self.max_seq_length"]
code: def concat_and_pad_tokens(self, tokens, title=None):
      """Concat with special tokens and pad sequence to self.max_seq_length"""
      tokens = list(tokens)
      if title is None:
          tokens = [self.cls_id] + tokens + [self.sep_id]
      else:
          title = list(title)
          tokens = (
              [self.cls_id]
              + title
              + [self.sep_id]
              + tokens
              + [self.sep_id]
          )
      assert len(tokens) <= self.max_seq_length
  
      num_pad = self.max_seq_length - len(tokens)
      pad_mask = [1] * len(tokens) + [0] * num_pad
      tokens += [self.pad_id] * num_pad
  
      return np.array(tokens), np.array(pad_mask)
  
file_path: ColossalAI/examples/tutorial/sequence_parallel/data/datasets/ict_dataset.py
imports: import itertools
  import random
  import numpy
  from megatron import get_args, get_tokenizer
  from megatron.data.dataset_utils import get_indexed_dataset_
  from megatron.data.realm_dataset_utils import get_block_samples_mapping
  from torch.utils.data import Dataset
label_desc: Use image node_id 6 for calling the ICTDataset obj's underlying member method code with example usage: obj.concat_and_pad_tokens(tokens, title) and returns: np,  np