def _nonresident_page_regions(status_bytes, incore_mask, max_region_len=None):
 assert ((max_region_len is None) or (max_region_len > 0))
 start = None
 for (i, x) in enumerate(status_bytes):
  in_core = (x & incore_mask)
  if (start is None):
   if (not in_core):
    start = i
  else:
   count = (i - start)
   if in_core:
    (yield (start, count))
    start = None
   elif (max_region_len and (count >= max_region_len)):
    (yield (start, count))
    start = i
 if (start is not None):
  (yield (start, (len(status_bytes) - start)))

def _nonresident_page_regions ( status_bytes , incore_mask , max_region_len = None ) : assert ( ( max_region_len is None ) or ( max_region_len > 0 ) ) start = None for ( i , x ) in enumerate ( status_bytes ) : in_core = ( x & incore_mask ) if ( start is None ) : if ( not in_core ) : start = i else : count = ( i - start ) if in_core : ( yield ( start , count ) ) start = None elif ( max_region_len and ( count >= max_region_len ) ) : ( yield ( start , count ) ) start = i if ( start is not None ) : ( yield ( start , ( len ( status_bytes ) - start ) ) )
return pairs in ascending start_page order for each contiguous region of nonresident pages indicated by the mincore() status_bytes .