code: def find_spans(raw):
      """
      Return spans of text which don't contain <PAD> and are split by <PAD>
      """
      pads = [idx for idx, char in enumerate(raw) if char == "<PAD>"]
      if len(pads) == 0:
          spans = [(0, len(raw))]
      else:
          prev = 0
          spans = []
          for pad in pads:
              if pad != prev:
                  spans.append((prev, pad))
              prev = pad + 1
          if prev < len(raw):
              spans.append((prev, len(raw)))
      return spans
  
imports: from collections import Counter
  from copy import copy
  import json
  import numpy
  import re
  import logging
  import os
  from torch.utils.data import DataLoader
  import stanza.utils.default_paths
  from stanza.models.common.utils import ud_scores, harmonic_mean
  from stanza.models.common.doc import Document
  from stanza.utils.conll import CoNLL
  from stanza.models.common.doc import *
  from stanza.models.tokenization.data import SortedDataset
label_desc: Use image node_id 6 for calling a global function with example usage: find_spans(raw) and returns: spans