def _get_array_mmap(array):
 if isinstance(array, mmap.mmap):
  return array
 base = array
 while (hasattr(base, 'base') and (base.base is not None)):
  if isinstance(base.base, mmap.mmap):
   return base.base
  base = base.base

def _get_array_mmap ( array ) : if isinstance ( array , mmap . mmap ) : return array base = array while ( hasattr ( base , 'base' ) and ( base . base is not None ) ) : if isinstance ( base . base , mmap . mmap ) : return base . base base = base . base
if the array has an mmap .