code: def tokenize(self, tokenizer):
      tokenized = tokenizer.tokenize(self.text)
      split_text = self.text.split(" ")  # CCG data is space-tokenized
      input_flat_stripped = tokenization_utils.input_flat_strip(
          split_text
      )
      flat_stripped, indices = tokenization_utils.flat_strip(
          tokens=tokenized,
          tokenizer=tokenizer,
          return_indices=True,
      )
      assert flat_stripped == input_flat_stripped
      positions = tokenization_utils.map_tags_to_token_position(
          flat_stripped=flat_stripped,
          indices=indices,
          split_text=split_text,
      )
      labels, label_mask = tokenization_utils.convert_mapped_tags(
          positions=positions,
          tag_ids=self.tag_ids,
          length=len(tokenized),
      )
  
      return TokenizedExample(
          guid=self.guid,
          text=tokenizer.tokenize(self.text),
          labels=labels,
          label_mask=label_mask,
      )
  
imports: import numpy
  import torch
  from dataclasses import dataclass
  from typing import List, Union
  from jiant.tasks.core import BaseExample, BaseTokenizedExample, BaseDataRow, BatchMixin, Task, TaskTypes
  from jiant.tasks.lib.templates.shared import labels_to_bimap, create_input_set_from_tokens_and_segments, construct_single_input_tokens_and_segment_ids, pad_single_with_feat_spec
  from jiant.tasks.lib.templates import hacky_tokenization_matching
  from jiant.utils.python.io import read_json
label_desc: Use image node_id 1 for calling the Example obj's underlying member method code with example usage: obj.tokenize(tokenizer) and returns: TokenizedExample