human
Complete this python program:
def arrayPermutation(permutation):
assistant
#Here is the Python code you requested.

    """Return a permutation function.
    The function permutes any array as specified by the supplied permutation.
    """
    assert (permutation.ndim == 1), 'Only    one    dimensional    permutaton    arrays    are    supported'
    def permute(arr):
        assert (arr.ndim == 1), 'Only    one    dimensional    arrays    are    supported'
        assert (arr.shape == permutation.shape), "Array    shapes    don't    match"
        return array([arr[i] for i in permutation])
    return permute