code: def list_container_processes(container):
      
      cmd = ['ps', 'ax', '-o', ','.join(PsRow.columns())]
      ps_lines = output_lines(container.exec_run(cmd))
  
      header = ps_lines.pop(0)
      # We can't trust the header alignment because different ps implementations
      # use different alignments, some of which depend on the alignment of the
      # columns. Instead, we assume that all columns are whitespace-separated and
      # that only the last column may contain spaces.
      maxsplit = len(header.strip().split()) - 1
      ps_entries = [line.strip().split(None, maxsplit) for line in ps_lines]
  
      # Convert to PsRows
      ps_rows = [PsRow(*entry) for entry in ps_entries]
  
      # Filter out the row for ps itself
      cmd_string = ' '.join(cmd)
      ps_rows = [row for row in ps_rows if row.args != cmd_string]
  
      return ps_rows
docs: List the processes running inside a container.
      We use an exec rather than `container.top()` because we want to run 'ps'
      inside the container. This is because we want to get PIDs and usernames in
      the container's namespaces. `container.top()` uses 'ps' from outside the
      container in the host's namespaces. Note that this requires the container
      to have a 'ps' that responds to the arguments we give it-- we use BusyBox's
      (Alpine's) 'ps' as a baseline for available functionality.
      :param container: the container to query
      :return: a list of PsRow objects