<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_temp_file(self, content, filename=None, mode='w'):
 """Write content to a temporary file. Args: content (bytes|str):
 The file content. If passing binary data the mode needs to be set to 'wb'. filename (str, optional):
 The filename to use when writing the file. mode (str, optional):
 The file write mode which could be either 'w' or 'wb'. Returns: str: Fully qualified path name for the file. """

        if filename is None:
            filename = str(uuid.uuid4())
        fqpn = os.path.join(self.tcex.default_args.tc_temp_path, filename)
        with open(fqpn, mode) as fh:
            fh.write(content)
        return fqpn