Sync with numpy's feature: partition

First version of partition method, waiting to verify its correctness.
Why do we have to do this?