code: def test_whitespace_handling(self):
      # Newline complications
      finetunex = [
          [
              "Train:",
              "\n\n\n and test",
              " tokenization must be",
              " equivalent",
          ]
      ]
      finetuney = [[("1",), ("1", "2"), ("2",), ("<PAD>",)]]
      expectedx = [
          "Train:\n\n\n and test tokenization must be equivalent"
      ]
      expectedy = [
          [
              {
                  "start": 0,
                  "end": 18,
                  "label": "1",
                  "text": "Train:\n\n\n and test",
              },
              {
                  "start": 10,
                  "end": 39,
                  "label": "2",
                  "text": "and test tokenization must be",
              },
          ]
      ]
      indicox_pred, indicoy_pred = finetune_to_indico_sequence(
          expectedx,
          finetunex,
          finetuney,
          none_value="<PAD>",
          subtoken_predictions=False,
      )
      self.assertEqual(indicox_pred, expectedx)
      self.assertEqual(indicoy_pred, expectedy)
  
      expectedx = ["Train and test tokenization must be equivalent"]
      expectedy = [
          [
              {
                  "start": 0,
                  "end": 14,
                  "label": "1",
                  "text": "Train and test",
              },
              {
                  "start": 6,
                  "end": 35,
                  "label": "2",
                  "text": "and test tokenization must be",
              },
          ]
      ]
  
      # Spaces before labels
      finetunex = [
          ["Train", " and test", " tokenization must be", " equivalent"]
      ]
      finetuney = [[("1",), ("1", "2"), ("2",), ("<PAD>",)]]
  
      indicox_pred, indicoy_pred = finetune_to_indico_sequence(
          expectedx,
          finetunex,
          finetuney,
          none_value="<PAD>",
          subtoken_predictions=False,
      )
      self.assertEqual(indicox_pred, expectedx)
      self.assertEqual(indicoy_pred, expectedy)
  
      # Spaces after labels
      finetunex = [
          ["Train ", "and test ", "tokenization must be ", "equivalent"]
      ]
      finetuney = [[("1",), ("1", "2"), ("2",), ("<PAD>",)]]
  
      indicox_pred, indicoy_pred = finetune_to_indico_sequence(
          expectedx,
          finetunex,
          finetuney,
          none_value="<PAD>",
          subtoken_predictions=False,
      )
      self.assertEqual(indicox_pred, expectedx)
      self.assertEqual(indicoy_pred, expectedy)
  
      # Whitespace anarchy
      finetunex = [
          ["Train", " and test ", "tokenization must be", " equivalent"]
      ]
      finetuney = [[("1",), ("1", "2"), ("2",), ("<PAD>",)]]
  
      indicox_pred, indicoy_pred = finetune_to_indico_sequence(
          expectedx,
          finetunex,
          finetuney,
          none_value="<PAD>",
          subtoken_predictions=False,
      )
      self.assertEqual(indicox_pred, expectedx)
      self.assertEqual(indicoy_pred, expectedy)
  
imports: import unittest
  from collections import Counter
  import pytest
  import numpy
  import tensorflow
  import unicodedata
  from finetune.encoding.sequence_encoder import finetune_to_indico_sequence
  from finetune.optimizers.gradient_accumulation import get_grad_accumulation_optimizer
  from finetune.util.imbalance import compute_class_weights
  from finetune.util.optimize_loss import OPTIMIZERS
  from finetune.util.timing import ProgressBar
  from finetune.errors import FinetuneError
  from finetune import Classifier, SequenceLabeler
  from finetune.base_models.gpt.encoder import GPTEncoder
  from finetune.base_models.gpt2.encoder import GPT2Encoder
  from finetune.base_models.bert.roberta_encoder import RoBERTaEncoderV2, RoBERTaEncoder, RoBERTaEncoderSlow
  from finetune.base_models.bert.encoder import BERTEncoderMultuilingal, BERTEncoder
  from finetune.base_models.oscar.encoder import GPCEncoder
  from finetune.scheduler import Scheduler
label_desc: Use image node_id 2 for calling the TestFinetuneIndicoConverters obj's underlying member method code with example usage: obj.test_whitespace_handling() without return types