Finish the nd.as_numpy() function to support the allow_copy parameter