def prefetch(self, file_size=None):
if file_size is None:<EOL><INDENT>file_size = self.stat().st_size<EOL><DEDENT>chunks = []<EOL>n = self._realpos<EOL>while n < file_size:<EOL><INDENT>chunk = min(self.MAX_REQUEST_SIZE, file_size - n)<EOL>chunks.append((n, chunk))<EOL>n += chunk<EOL><DEDENT>if len(chunks) > <NUM_LIT:0>:<EOL><INDENT>self._start_prefetch(chunks)<EOL><DEDENT>
Pre-fetch the remaining contents of this file in anticipation of future
`.read` calls.  If reading the entire file, pre-fetching can
dramatically improve the download speed by avoiding roundtrip latency.
The file's contents are incrementally buffered in a background thread.

The prefetched data is stored in a buffer until read via the `.read`
method.  Once data has been read, it's removed from the buffer.  The
data may be read in a random order (using `.seek`); chunks of the
buffer that haven't been read will continue to be buffered.

:param int file_size:
    When this is ``None`` (the default), this method calls `stat` to
    determine the remote file size. In some situations, doing so can
    cause exceptions or hangs (see `#562
    <https://github.com/paramiko/paramiko/pull/562>`_); as a
    workaround, one may call `stat` explicitly and pass its value in
    via this parameter.

.. versionadded:: 1.5.1
.. versionchanged:: 1.16.0
    The ``file_size`` parameter was added (with no default value).
.. versionchanged:: 1.16.1
    The ``file_size`` parameter was made optional for backwards
    compatibility.