code: def decompile(self, data, ttFont):
      totalLength = len(data)
      indextable = ttFont[self.indextable]
      for indices, isExtra in zip(
          (indextable.indices, indextable.extra_indices), (False, True)
      ):
          programs = {}
          for i, (glyphID, textLength, textOffset) in enumerate(
              indices
          ):
              if isExtra:
                  name = self.extras[glyphID]
              else:
                  name = ttFont.getGlyphName(glyphID)
              if textOffset > totalLength:
                  self.log.warning(
                      "textOffset > totalLength; %r skipped" % name
                  )
                  continue
              if textLength < 0x8000:
                  # If the length stored in the record is less than 32768, then use
                  # that as the length of the record.
                  pass
              elif textLength == 0x8000:
                  # If the length is 32768, compute the actual length as follows:
                  isLast = i == (len(indices) - 1)
                  if isLast:
                      if isExtra:
                          # For the last "extra" record (the very last record of the
                          # table), the length is the difference between the total
                          # length of the TSI1 table and the textOffset of the final
                          # record.
                          nextTextOffset = totalLength
                      else:
                          # For the last "normal" record (the last record just prior
                          # to the record containing the "magic number"), the length
                          # is the difference between the textOffset of the record
                          # following the "magic number" (0xFFFE) record (i.e. the
                          # first "extra" record), and the textOffset of the last
                          # "normal" record.
                          nextTextOffset = indextable.extra_indices[0][
                              2
                          ]
                  else:
                      # For all other records with a length of 0x8000, the length is
                      # the difference between the textOffset of the record in
                      # question and the textOffset of the next record.
                      nextTextOffset = indices[i + 1][2]
                  assert (
                      nextTextOffset >= textOffset
                  ), "entries not sorted by offset"
                  if nextTextOffset > totalLength:
                      self.log.warning(
                          "nextTextOffset > totalLength; %r truncated"
                          % name
                      )
                      nextTextOffset = totalLength
                  textLength = nextTextOffset - textOffset
              else:
                  from fontTools import ttLib
  
                  raise ttLib.TTLibError(
                      "%r textLength (%d) must not be > 32768"
                      % (name, textLength)
                  )
              text = data[textOffset : textOffset + textLength]
              assert len(text) == textLength
              text = tostr(text, encoding="utf-8")
              if text:
                  programs[name] = text
          if isExtra:
              self.extraPrograms = programs
          else:
              self.glyphPrograms = programs
  
file_path: catboost/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I__1.py
imports: from .None import DefaultTable
  from fontTools.misc.loggingTools import LogMixin
  from fontTools.misc.textTools import strjoin, tobytes, tostr
label_desc: Use image node_id 1 for calling the table_T_S_I__1 obj's underlying member method code with example usage: obj.decompile(data, ttFont) without return types