code: def splitCubic(pt1, pt2, pt3, pt4, where, isHorizontal):
      """Split a cubic Bezier curve at a given coordinate.
  
      Args:
          pt1,pt2,pt3,pt4: Control points of the Bezier as 2D tuples.
          where: Position at which to split the curve.
          isHorizontal: Direction of the ray splitting the curve. If true,
              ``where`` is interpreted as a Y coordinate; if false, then
              ``where`` is interpreted as an X coordinate.
  
      Returns:
          A list of two curve segments (each curve segment being four 2D tuples)
          if the curve was successfully split, or a list containing the original
          curve.
  
      Example::
  
          >>> printSegments(splitCubic((0, 0), (25, 100), (75, 100), (100, 0), 150, False))
          ((0, 0), (25, 100), (75, 100), (100, 0))
          >>> printSegments(splitCubic((0, 0), (25, 100), (75, 100), (100, 0), 50, False))
          ((0, 0), (12.5, 50), (31.25, 75), (50, 75))
          ((50, 75), (68.75, 75), (87.5, 50), (100, 0))
          >>> printSegments(splitCubic((0, 0), (25, 100), (75, 100), (100, 0), 25, True))
          ((0, 0), (2.29379, 9.17517), (4.79804, 17.5085), (7.47414, 25))
          ((7.47414, 25), (31.2886, 91.6667), (68.7114, 91.6667), (92.5259, 25))
          ((92.5259, 25), (95.202, 17.5085), (97.7062, 9.17517), (100, 1.77636e-15))
      """
      a, b, c, d = calcCubicParameters(pt1, pt2, pt3, pt4)
      solutions = solveCubic(
          a[isHorizontal],
          b[isHorizontal],
          c[isHorizontal],
          d[isHorizontal] - where,
      )
      solutions = sorted(t for t in solutions if 0 <= t < 1)
      if not solutions:
          return [(pt1, pt2, pt3, pt4)]
      return _splitCubicAtT(a, b, c, d, *solutions)
  
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 17 for calling a global function with example usage: splitCubic(pt1, pt2, pt3, pt4, where, isHorizontal) and returns: _splitCubicAtT, list