code: def top(self):
          
          # let's get resources from .stats()
          ps_args = "-eo pid,ppid,wchan,args"
          # returns {"Processes": [values], "Titles": [values]}
          # it's easier to play with list of dicts: [{"pid": 1, "ppid": 0}]
          try:
              response = self.d.top(self.container_id, ps_args=ps_args)
          except docker.errors.APIError as ex:
              logger.warning("error getting processes: %r", ex)
              return []
          # TODO: sort?
          logger.debug(json.dumps(response, indent=2))
          return [dict(zip(response["Titles"], process))
                  for process in response["Processes"] or []]
docs: list of processes in a running container
  
          :return: None or list of dicts