code: def rotate(curve, degs, origin=None):
      
      def transform(z):
          return exp(1j*radians(degs))*(z - origin) + origin
  
      if origin is None:
          if isinstance(curve, Arc):
              origin = curve.center
          else:
              origin = curve.point(0.5)
  
      if isinstance(curve, Path):
          return Path(*[rotate(seg, degs, origin=origin) for seg in curve])
      elif is_bezier_segment(curve):
          return bpoints2bezier([transform(bpt) for bpt in curve.bpoints()])
      elif isinstance(curve, Arc):
          new_start = transform(curve.start)
          new_end = transform(curve.end)
          new_rotation = curve.rotation + degs
          return Arc(new_start, radius=curve.radius, rotation=new_rotation,
                     large_arc=curve.large_arc, sweep=curve.sweep, end=new_end)
      else:
          raise TypeError("Input `curve` should be a Path, Line, "
                          "QuadraticBezier, CubicBezier, or Arc object.")
docs: Returns curve rotated by `degs` degrees (CCW) around the point `origin`
      (a complex number).  By default origin is either `curve.point(0.5)`, or in
      the case that curve is an Arc object, `origin` defaults to `curve.center`.