class_docstr: Representation of an SSH connection.
      
class_docstr_tok: ["Representation","of","an","SSH","connection","."]
docstr: Copies source file/folder from remote to a local destination.
  
  Note: this method performs escaping of filenames to an extent that
  moderately weird ones should work (spaces, quotes, pipes, other
  characters with special shell meaning), but more complicated cases
  might require appropriate external preprocessing of filenames.
  
  Parameters
  ----------
  source : str or list
    file/folder path(s) to copy from the remote host
  destination : str
    file/folder path to copy to on the local host
  recursive : bool
    flag to enable recursive copying of given sources
  preserve_attrs : bool
    preserve modification times, access times, and modes from the
    original file
  
  Returns
  -------
  str
    stdout, stderr of the copy operation.
code: def get(
      self, source, destination, recursive=False, preserve_attrs=False
  ):
      """Copies source file/folder from remote to a local destination.
  
      Note: this method performs escaping of filenames to an extent that
      moderately weird ones should work (spaces, quotes, pipes, other
      characters with special shell meaning), but more complicated cases
      might require appropriate external preprocessing of filenames.
  
      Parameters
      ----------
      source : str or list
        file/folder path(s) to copy from the remote host
      destination : str
        file/folder path to copy to on the local host
      recursive : bool
        flag to enable recursive copying of given sources
      preserve_attrs : bool
        preserve modification times, access times, and modes from the
        original file
  
      Returns
      -------
      str
        stdout, stderr of the copy operation.
      """
      # make sure we have an open connection, will test if action is needed
      # by itself
      self.open()
      scp_cmd = self._get_scp_command_spec(recursive, preserve_attrs)
      # add source filepath(s) to scp command, prefixed with the remote host
      scp_cmd += [
          "%s:%s" % (self.sshri.hostname, self._quote_filename(s))
          for s in ensure_list(source)
      ]
      # add destination path
      scp_cmd += [destination]
      out = self.runner.run(scp_cmd, protocol=StdOutErrCapture)
      return out["stdout"], out["stderr"]
  
imports: import fasteners
  import os
  import logging
  from socket import gethostname
  from hashlib import md5
  from subprocess import Popen
  import tempfile
  import threading
  from datalad.utils import quote_cmdlinearg
  from datalad.support.exceptions import CapturedException, CommandError, ConnectionOpenFailedError
  from datalad.support.external_versions import external_versions
  from datalad.utils import auto_repr, Path, ensure_list, on_windows
  from datalad.cmd import NoCapture, StdOutErrCapture, WitlessRunner
  from ..None import cfg
label_desc: Use image node_id 13 for calling the BaseSSHConnection obj's underlying member method code with example usage: obj.get(source, destination, recursive, preserve_attrs) and returns: out,  out