def write_to_local(self, filepath_from, filepath_to, mtime_dt=None):
self.__log.debug("<STR_LIT>" % (filepath_from, <EOL>filepath_to))<EOL>with SftpFile(self, filepath_from, '<STR_LIT:r>') as sf_from:<EOL><INDENT>with open(filepath_to, '<STR_LIT:wb>') as file_to:<EOL><INDENT>while <NUM_LIT:1>:<EOL><INDENT>part = sf_from.read(MAX_MIRROR_WRITE_CHUNK_SIZE)<EOL>file_to.write(part)<EOL>if len(part) < MAX_MIRROR_WRITE_CHUNK_SIZE:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if mtime_dt is None:<EOL><INDENT>mtime_dt = datetime.now()<EOL><DEDENT>mtime_epoch = mktime(mtime_dt.timetuple())<EOL>utime(filepath_to, (mtime_epoch, mtime_epoch))<EOL>
Open a remote file and write it locally.