code: def _remove_repeated_whitespace(encoded):
      batch_token_idxs = []
      batch_tokens = []
      batch_char_ends = []
      batch_char_starts = []
      for token_ids, tokens, token_ends, token_starts in zip(
          encoded.token_ids,
          encoded.tokens,
          encoded.token_ends,
          encoded.token_starts,
      ):
          mask = [
              i != 0
              and token.strip(" ") == tokens[i - 1].strip(" ") == ""
              for i, token in enumerate(tokens)
          ]
          batch_token_idxs.append(
              [x for x, c in zip(token_ids, mask) if not c]
          )
          batch_tokens.append(
              [x for x, c in zip(tokens, mask) if not c]
          )
          batch_char_ends.append(
              [x for x, c in zip(token_ends, mask) if not c]
          )
          batch_char_starts.append(
              [x for x, c in zip(token_starts, mask) if not c]
          )
  
      return EncodedOutput(
          token_ids=batch_token_idxs,
          tokens=batch_tokens,
          token_ends=batch_char_ends,
          token_starts=batch_char_starts,
      )
  
imports: import warnings
  import functools
  from collections import namedtuple, Counter, OrderedDict
  import spacy
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: _remove_repeated_whitespace(encoded) and returns: EncodedOutput