def retrieve_trace(self, filename=None, dir=None):
if hasattr(self, "<STR_LIT>") and self.applicationTrace is not None:<EOL><INDENT>logger.debug("<STR_LIT>" + self.applicationTrace)<EOL>if not filename:<EOL><INDENT>filename = _file_name('<STR_LIT>', self.id, '<STR_LIT>')<EOL><DEDENT>return self.rest_client._retrieve_file(self.applicationTrace, filename, dir, '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT>
Retrieves the application trace files for this PE
        and saves them as a plain text file.

        An existing file with the same name will be overwritten.

        Args:
            filename (str): name of the created file. Defaults to `pe_<id>_<timestamp>.trace` where `id` is the PE identifier and `timestamp` is the number of seconds since the Unix epoch, for example ``pe_83_1511995995.trace``.
            dir (str): a valid directory in which to save the file. Defaults to the current directory.

        Returns:
            str: the path to the created file, or None if retrieving a job's logs is not supported in the version of streams to which the job is submitted.

        .. versionadded:: 1.9