Sync with numpy's feature: partition

First version of partition method, waiting to verify its correctness.
`shape_hint` in line 131 should be aligned with `array` in line 130