code: def fit_to_block_size(sequence, block_size, pad_token_id):
      """Adapt the source and target sequences' lengths to the block size.
      If the sequence is shorter we append padding token to the right of the sequence.
      """
      if len(sequence) > block_size:
          return sequence[:block_size]
      else:
          sequence.extend([pad_token_id] * (block_size - len(sequence)))
          return sequence
  
imports: import re
  import html
  import logging
  import pandas
  import os
  import random
  import torch
  from pathlib import Path
  import pickle
  import shutil
  from collections import deque, namedtuple
  from torch.utils.data import Dataset, DataLoader, SequentialSampler
  from tokenizers import BertWordPieceTokenizer
  from transformers import BertTokenizer
label_desc: Use image node_id 6 for calling a global function with example usage: fit_to_block_size(sequence, block_size, pad_token_id) and returns: sequence, sequence