code: def _compute_char_shifts(tokens):
      """Compute the shifts in characters that occur when comparing the
      tokens string with the string consisting of all tokens separated with a
      space
  
      For instance, if "hello?world" is tokenized in ["hello", "?", "world"],
      then the character shifts between "hello?world" and "hello ? world" are
      [0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 2]
      """
      characters_shifts = []
      if not tokens:
          return characters_shifts
  
      current_shift = 0
      for token_index, token in enumerate(tokens):
          if token_index == 0:
              previous_token_end = 0
              previous_space_len = 0
          else:
              previous_token_end = tokens[token_index - 1].end
              previous_space_len = 1
          offset = (
              token.start - previous_token_end
          ) - previous_space_len
          current_shift -= offset
          token_len = token.end - token.start
          index_shift = token_len + previous_space_len
          characters_shifts += [
              current_shift for _ in range(index_shift)
          ]
      return characters_shifts
  
imports: from __future__ import unicode_literals
  import json
  import operator
  from copy import deepcopy
  from pathlib import Path
  from future.utils import iteritems, viewvalues
  from snips_nlu.common.utils import json_string
  from snips_nlu.constants import END, ENTITIES, LANGUAGE, MATCHING_STRICTNESS, START, UTTERANCES, LICENSE_INFO
  from snips_nlu.entity_parser.builtin_entity_parser import is_builtin_entity
  from snips_nlu.entity_parser.custom_entity_parser_usage import CustomEntityParserUsage
  from snips_nlu.entity_parser.entity_parser import EntityParser
  from snips_nlu.preprocessing import stem, tokenize, tokenize_light
  from snips_nlu.result import parsed_entity
label_desc: Use image node_id 4 for calling a global function with example usage: _compute_char_shifts(tokens) and returns: characters_shifts, characters_shifts