code: def _setCoordinates(glyph, coord, glyfTable, *, recalcBounds=True):
      # Handle phantom points for (left, right, top, bottom) positions.
      assert len(coord) >= 4
      leftSideX = coord[-4][0]
      rightSideX = coord[-3][0]
      topSideY = coord[-2][1]
      bottomSideY = coord[-1][1]
  
      for _ in range(4):
          del coord[-1]
  
      if glyph.isComposite():
          assert len(coord) == len(glyph.components)
          glyph.components = [
              copy(comp) for comp in glyph.components
          ]  # Shallow copy
          for p, comp in zip(coord, glyph.components):
              if hasattr(comp, "x"):
                  comp.x, comp.y = p
      elif glyph.isVarComposite():
          glyph.components = [
              copy(comp) for comp in glyph.components
          ]  # Shallow copy
          for comp in glyph.components:
              coord = comp.setCoordinates(coord)
          assert not coord
      elif glyph.numberOfContours == 0:
          assert len(coord) == 0
      else:
          assert len(coord) == len(glyph.coordinates)
          glyph.coordinates = coord
  
      if recalcBounds:
          glyph.recalcBounds(glyfTable)
  
      horizontalAdvanceWidth = otRound(rightSideX - leftSideX)
      verticalAdvanceWidth = otRound(topSideY - bottomSideY)
      leftSideBearing = otRound(glyph.xMin - leftSideX)
      topSideBearing = otRound(topSideY - glyph.yMax)
      return (
          horizontalAdvanceWidth,
          leftSideBearing,
          verticalAdvanceWidth,
          topSideBearing,
      )
  
imports: from abc import ABC, abstractmethod
  from collections.abc import Mapping
  from contextlib import contextmanager
  from copy import copy
  from types import SimpleNamespace
  from fontTools.misc.fixedTools import otRound
  from fontTools.misc.loggingTools import deprecateFunction
  from fontTools.misc.transform import Transform
  from fontTools.pens.transformPen import TransformPen, TransformPointPen
  from fontTools.pens.recordingPen import DecomposingRecordingPen, lerpRecordings, replayRecording
label_desc: Use image node_id 1 for calling a global function with example usage: _setCoordinates(glyph, coord, glyfTable) and returns: horizontalAdvanceWidth,  leftSideBearing,  verticalAdvanceWidth,  topSideBearing