code: def find_spaces(sentence):
      # TODO: there are some sentences where there is only one quote,
      # and some of them should be attached to the previous word instead
      # of the next word.  Training should work this way, though
      odd_quotes = False
  
      spaces = []
      for word_idx, word in enumerate(sentence):
          space = True
          # Quote period at the end of a sentence needs to be attached
          # to the rest of the text.  Some sentences have `"... text`
          # in the middle, though, so look for that
          if (
              word_idx < len(sentence) - 2
              and sentence[word_idx + 1] == '"'
          ):
              if sentence[word_idx + 2] == ".":
                  space = False
              elif (
                  word_idx == len(sentence) - 3
                  and sentence[word_idx + 2] == "..."
              ):
                  space = False
          if word_idx < len(sentence) - 1:
              if sentence[word_idx + 1] in (
                  ",",
                  ".",
                  "!",
                  "?",
                  ")",
                  ":",
                  ";",
                  "”",
                  "…",
                  "...",
                  "/",
                  "%",
              ):
                  space = False
          if word in ("(", "“", "/"):
              space = False
          if word == '"':
              if odd_quotes:
                  # already saw one quote.  put this one at the end of the PREVIOUS word
                  # note that we know there must be at least one word already
                  odd_quotes = False
                  spaces[word_idx - 1] = False
              else:
                  odd_quotes = True
                  space = False
          spaces.append(space)
      return spaces
  
imports: import os
label_desc: Use image node_id 1 for calling a global function with example usage: find_spaces(sentence) and returns: spaces