tools/android/native_lib_memory/extract_resident_pages.py
def ParseResidentPages(resident_pages):
  """Parses and converts the residency data into a list where
  the index corresponds to the page number and the value 1 if resident
  and 0 otherwise.

  |resident_pages| contains a string of resident pages:
      0
      1
      ...
      ...
      N

  Args:
    resident_pages: (str) As returned by ReadFileFromDevice()

  Returns:
    (list) Pages list.
  """
  pages_list = []
  expected = 0
  for page in resident_pages.splitlines():
    while expected < int(page):
      pages_list.append(0)
      expected += 1

    pages_list.append(1)
    expected += 1;
  return pages_list
Parses and converts the residency data into a list where
  the index corresponds to the page number and the value 1 if resident
  and 0 otherwise.

  |resident_pages| contains a string of resident pages:
      0
      1
      ...
      ...
      N

  Args:
    resident_pages: (str) As returned by ReadFileFromDevice()

  Returns:
    (list) Pages list.
  
Parses and converts the residency data into a list where
the index corresponds to the page number and the value 1 if resident
and 0 otherwise.

|resident_pages| contains a string of resident pages:
0
1


N
Parses and converts the residency data into a list where the index corresponds to the page number and the value 1 if resident and 0 otherwise . |resident_pages| contains a string of resident pages : 0 1 N
def ParseResidentPages(resident_pages):
  pages_list = []
  expected = 0
  for page in resident_pages.splitlines():
    while expected < int(page):
      pages_list.append(0)
      expected += 1
    pages_list.append(1)
    expected += 1;
  return pages_list
def ParseResidentPages ( resident_pages ) : pages_list = [ ] expected = 0 for page in resident_pages . splitlines ( ) : while expected < int ( page ) : pages_list . append ( 0 ) expected += 1 pages_list . append ( 1 ) expected += 1 ; return pages_list
Parses and converts the residency data into a list where
the index corresponds to the page number and the value 1 if resident
and 0 otherwise.
Parses and converts the residency data into a list where the index corresponds to the page number and the value 1 if resident and 0 otherwise .
"""Parses and converts the residency data into a list where
  the index corresponds to the page number and the value 1 if resident
  and 0 otherwise.

  |resident_pages| contains a string of resident pages:
      0
      1
      ...
      ...
      N

  Args:
    resident_pages: (str) As returned by ReadFileFromDevice()

  Returns:
    (list) Pages list.
  """
(list) Pages list.
( list ) Pages list .
resident_pages
(str) As returned by ReadFileFromDevice()
( str ) As returned by ReadFileFromDevice ()