@scope.define_pure
def idxs_take(idxs, vals, which):
 assert (len(idxs) == len(vals))
 table = dict(list(zip(idxs, vals)))
 return np.asarray([table[w] for w in which])

@ scope . define_pure def idxs_take ( idxs , vals , which ) : assert ( len ( idxs ) == len ( vals ) ) table = dict ( list ( zip ( idxs , vals ) ) ) return np . asarray ( [ table [ w ] for w in which ] )
return vals[which] where which is a subset of idxs .