def memory_index(indices, t):
 (memlen, itemsize, ndim, shape, strides, offset) = t
 p = offset
 for i in range(ndim):
  p += (strides[i] * indices[i])
 return p

def memory_index ( indices , t ) : ( memlen , itemsize , ndim , shape , strides , offset ) = t p = offset for i in range ( ndim ) : p += ( strides [ i ] * indices [ i ] ) return p
location of an item in the underlying memory .