code: def merge(self, m, tables):
      assert len(tables) == len(m.duplicateGlyphsPerFont)
      for i, (table, dups) in enumerate(
          zip(tables, m.duplicateGlyphsPerFont)
      ):
          if not dups:
              continue
          if table is None or table is NotImplemented:
              log.warning(
                  "Have non-identical duplicates to resolve for '%s' but no GSUB. Are duplicates intended?: %s",
                  m.fonts[i]._merger__name,
                  dups,
              )
              continue
  
          synthFeature = None
          synthLookup = None
          for script in table.table.ScriptList.ScriptRecord:
              if script.ScriptTag == "DFLT":
                  continue  # XXX
              for langsys in [script.Script.DefaultLangSys] + [
                  l.LangSys for l in script.Script.LangSysRecord
              ]:
                  if langsys is None:
                      continue  # XXX Create!
                  feature = [
                      v
                      for v in langsys.FeatureIndex
                      if v.FeatureTag == "locl"
                  ]
                  assert len(feature) <= 1
                  if feature:
                      feature = feature[0]
                  else:
                      if not synthFeature:
                          synthFeature = otTables.FeatureRecord()
                          synthFeature.FeatureTag = "locl"
                          f = synthFeature.Feature = otTables.Feature()
                          f.FeatureParams = None
                          f.LookupCount = 0
                          f.LookupListIndex = []
                          table.table.FeatureList.FeatureRecord.append(
                              synthFeature
                          )
                          table.table.FeatureList.FeatureCount += 1
                      feature = synthFeature
                      langsys.FeatureIndex.append(feature)
                      langsys.FeatureIndex.sort(
                          key=lambda v: v.FeatureTag
                      )
  
                  if not synthLookup:
                      subtable = otTables.SingleSubst()
                      subtable.mapping = dups
                      synthLookup = otTables.Lookup()
                      synthLookup.LookupFlag = 0
                      synthLookup.LookupType = 1
                      synthLookup.SubTableCount = 1
                      synthLookup.SubTable = [subtable]
                      if table.table.LookupList is None:
                          # mtiLib uses None as default value for LookupList,
                          # while feaLib points to an empty array with count 0
                          # TODO: make them do the same
                          table.table.LookupList = otTables.LookupList()
                          table.table.LookupList.Lookup = []
                          table.table.LookupList.LookupCount = 0
                      table.table.LookupList.Lookup.append(synthLookup)
                      table.table.LookupList.LookupCount += 1
  
                  if feature.Feature.LookupListIndex[:1] != [
                      synthLookup
                  ]:
                      feature.Feature.LookupListIndex[:0] = [
                          synthLookup
                      ]
                      feature.Feature.LookupCount += 1
  
      DefaultTable.merge(self, m, tables)
      return self
  
imports: from fontTools import ttLib
  from fontTools.ttLib.tables.DefaultTable import DefaultTable
  from fontTools.ttLib.tables import otTables
  from fontTools.merge.base import add_method, mergeObjects
  from fontTools.merge.util import *
  import logging
label_desc: Use image node_id 7 for calling a global function with example usage: merge(m, tables) and returns: self