How does one get an array from python consisting of the elements at positions given by an array of indices which may have length greater than the array and may include dupli