code: def bezier_bounding_box(bez):
      
  
      # begin arc support block ########################
      try:
          bla = bez.large_arc
          return bez.bbox()  # added to support Arc objects
      except:
          pass
      # end arc support block ##########################
  
      if len(bez) == 4:
          xmin, xmax = bezier_real_minmax([p.real for p in bez])
          ymin, ymax = bezier_real_minmax([p.imag for p in bez])
          return xmin, xmax, ymin, ymax
      poly = bezier2polynomial(bez, return_poly1d=True)
      x = real(poly)
      y = imag(poly)
      dx = x.deriv()
      dy = y.deriv()
      x_extremizers = [0, 1] + polyroots(dx, realroots=True,
                                      condition=lambda r: 0 < r < 1)
      y_extremizers = [0, 1] + polyroots(dy, realroots=True,
                                      condition=lambda r: 0 < r < 1)
      x_extrema = [x(t) for t in x_extremizers]
      y_extrema = [y(t) for t in y_extremizers]
      return min(x_extrema), max(x_extrema), min(y_extrema), max(y_extrema)
docs: returns the bounding box for the segment in the form
      (xmin, xmax, ymin, ymax).
      Warning: For the non-cubic case this is not particularly efficient.