code: def sortFeatureList(table):
      """Sort the feature list by feature tag, and remap the feature indices
      elsewhere. This is needed after the feature list has been modified.
      """
      # decorate, sort, undecorate, because we need to make an index remapping table
      tagIndexFea = [
          (fea.FeatureTag, index, fea)
          for index, fea in enumerate(table.FeatureList.FeatureRecord)
      ]
      tagIndexFea.sort()
      table.FeatureList.FeatureRecord = [
          fea for tag, index, fea in tagIndexFea
      ]
      featureRemap = dict(
          zip(
              [index for tag, index, fea in tagIndexFea],
              range(len(tagIndexFea)),
          )
      )
  
      # Remap the feature indices
      remapFeatures(table, featureRemap)
  
imports: from fontTools.misc.dictTools import hashdict
  from fontTools.misc.intTools import bit_count
  from fontTools.ttLib import newTable
  from fontTools.ttLib.tables import otTables
  from fontTools.ttLib.ttVisitor import TTVisitor
  from fontTools.otlLib.builder import buildLookup, buildSingleSubstSubtable
  from collections import OrderedDict
  from .errors import VarLibError, VarLibValidationError
label_desc: Use image node_id 18 for calling a global function with example usage: sortFeatureList(table) without return types