<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def top(self):
 """ list of processes in a running container :return: None or list of dicts """

        # 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 []]