Unlike similar classes such as invoke.runners.Result or
fabric.runners.Result (which have a concept of “warn and return
anyways on failure”) this class has no useful truthiness behavior. If a
file transfer fails, some exception will be raised, either an OSError
or an error from within Paramiko.

If None or another ‘falsey’/empty value is given (the default),
the remote file is downloaded to the current working directory (as
seen by os.getcwd) using its remote filename.

If a string is given, it should be a path to a local directory
or file and is subject to similar behavior as that seen by common
Unix utilities or OpenSSH’s sftp or scp tools.

For example, if the local path is a directory, the remote path’s
base filename will be added onto it (so get('foo/bar/file.txt','/tmp/') would result in creation or overwriting of
/tmp/file.txt).

Note

When dealing with nonexistent file paths, normal Python file
handling concerns come into play - for example, a local
path containing non-leaf directories which do not exist, will
typically result in an OSError.

If a file-like object is given, the contents of the remote file
are simply written into it.

preserve_mode (bool) – Whether to os.chmod the local file so it matches the remote
file’s mode (default: True).