Sync with numpy's feature: partition

First version of partition method, waiting to verify its correctness.