How to trim curves in GhPython

You can implement Curve.Trim :