def _prepare_index_for_memoryview(i, j, x=None):
 if (i.dtype > j.dtype):
  j = j.astype(i.dtype)
 elif (i.dtype < j.dtype):
  i = i.astype(j.dtype)
 if ((not i.flags.writeable) or (i.dtype not in (np.int32, np.int64))):
  i = i.astype(np.intp)
 if ((not j.flags.writeable) or (j.dtype not in (np.int32, np.int64))):
  j = j.astype(np.intp)
 if (x is not None):
  if (not x.flags.writeable):
   x = x.copy()
  return (i, j, x)
 else:
  return (i, j)

def _prepare_index_for_memoryview ( i , j , x = None ) : if ( i . dtype > j . dtype ) : j = j . astype ( i . dtype ) elif ( i . dtype < j . dtype ) : i = i . astype ( j . dtype ) if ( ( not i . flags . writeable ) or ( i . dtype not in ( np . int32 , np . int64 ) ) ) : i = i . astype ( np . intp ) if ( ( not j . flags . writeable ) or ( j . dtype not in ( np . int32 , np . int64 ) ) ) : j = j . astype ( np . intp ) if ( x is not None ) : if ( not x . flags . writeable ) : x = x . copy ( ) return ( i , j , x ) else : return ( i , j )
convert index and data arrays to form suitable for passing to the cython fancy getset routines .