code: def calcCubicArcLength(pt1, pt2, pt3, pt4, tolerance=0.005):
      """Calculates the arc length for a cubic Bezier segment.
  
      Whereas :func:`approximateCubicArcLength` approximates the length, this
      function calculates it by "measuring", recursively dividing the curve
      until the divided segments are shorter than ``tolerance``.
  
      Args:
          pt1,pt2,pt3,pt4: Control points of the Bezier as 2D tuples.
          tolerance: Controls the precision of the calcuation.
  
      Returns:
          Arc length value.
      """
      return calcCubicArcLengthC(
          complex(*pt1),
          complex(*pt2),
          complex(*pt3),
          complex(*pt4),
          tolerance,
      )
  
imports: from fontTools.misc.arrayTools import calcBounds, sectRect, rectArea
  from fontTools.misc.transform import Identity
  import math
  from collections import namedtuple
  from math import sqrt, acos, cos, pi
label_desc: Use image node_id 1 for calling a global function with example usage: calcCubicArcLength(pt1, pt2, pt3, pt4, tolerance) and returns: calcCubicArcLengthC