<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def external_commands(self):
 """Get the external commands from the daemon Use a lock for this function to protect :return: serialized external command list :rtype: str """

        res = []
        with self.app.external_commands_lock:
            for cmd in self.app.get_external_commands():
                res.append(cmd.serialize())
        return res