'download(file_or_directory, local=None)
Download a file or directory from the remote host.
Arguments:
file_or_directory(str): Path to the file or directory to download.
local(str): Local path to store the data.
By default, uses the current directory.'

def download(self, file_or_directory, local=None):

    if (not self.sftp):
        self.error('Cannot    determine    remote    file    type    without    SFTP')
    if (0 == self.system(('test    -d    ' + sh_string(file_or_directory))).wait()):
        self.download_dir(file_or_directory, local)
    else:
        self.download_file(file_or_directory, local)
