code: def visit(visitor, obj, attr, variations):
      # VarComposites are a pain to handle :-(
      glyfTable = visitor.font["glyf"]
  
      for glyphName, varlist in variations.items():
          glyph = glyfTable[glyphName]
          isVarComposite = glyph.isVarComposite()
          for var in varlist:
              coordinates = var.coordinates
  
              if not isVarComposite:
                  for i, xy in enumerate(coordinates):
                      if xy is None:
                          continue
                      coordinates[i] = visitor.scale(
                          xy[0]
                      ), visitor.scale(xy[1])
                  continue
  
              # VarComposite glyph
  
              i = 0
              for component in glyph.components:
                  if (
                      component.flags
                      & VarComponentFlags.AXES_HAVE_VARIATION
                  ):
                      i += len(component.location)
                  if component.flags & (
                      VarComponentFlags.HAVE_TRANSLATE_X
                      | VarComponentFlags.HAVE_TRANSLATE_Y
                  ):
                      xy = coordinates[i]
                      coordinates[i] = visitor.scale(
                          xy[0]
                      ), visitor.scale(xy[1])
                      i += 1
                  if component.flags & VarComponentFlags.HAVE_ROTATION:
                      i += 1
                  if component.flags & (
                      VarComponentFlags.HAVE_SCALE_X
                      | VarComponentFlags.HAVE_SCALE_Y
                  ):
                      i += 1
                  if component.flags & (
                      VarComponentFlags.HAVE_SKEW_X
                      | VarComponentFlags.HAVE_SKEW_Y
                  ):
                      i += 1
                  if component.flags & (
                      VarComponentFlags.HAVE_TCENTER_X
                      | VarComponentFlags.HAVE_TCENTER_Y
                  ):
                      xy = coordinates[i]
                      coordinates[i] = visitor.scale(
                          xy[0]
                      ), visitor.scale(xy[1])
                      i += 1
  
              # Phantom points
              assert i + 4 == len(coordinates)
              for i in range(i, len(coordinates)):
                  xy = coordinates[i]
                  coordinates[i] = visitor.scale(xy[0]), visitor.scale(
                      xy[1]
                  )
  
imports: from fontTools.ttLib.ttVisitor import TTVisitor
  import fontTools.ttLib
  import fontTools.ttLib.tables.otBase
  import fontTools.ttLib.tables.otTables
  from fontTools.cffLib import VarStoreData
  import fontTools.cffLib.specializer
  from fontTools.varLib import builder
  from fontTools.misc.fixedTools import otRound
  from fontTools.ttLib.tables._g_l_y_f import VarComponentFlags
label_desc: Use image node_id 5 for calling a global function with example usage: visit(visitor, obj, attr, variations) without return types