def infer_layout(val):
 if (sys.version_info >= (3,)):
  return ('C' if val.c_contiguous else ('F' if val.f_contiguous else 'A'))
 if ((val.ndim == 1) and (val.strides[0] == val.itemsize)):
  return 'C'
 return 'A'

def infer_layout ( val ) : if ( sys . version_info >= ( 3 , ) ) : return ( 'C' if val . c_contiguous else ( 'F' if val . f_contiguous else 'A' ) ) if ( ( val . ndim == 1 ) and ( val . strides [ 0 ] == val . itemsize ) ) : return 'C' return 'A'
infer layout of the given memoryview *val* .