def download(self, job_id, files, **kwargs):
check_jobid(job_id)<EOL>if not files:<EOL><INDENT>return<EOL><DEDENT>if isinstance(files, string_types):<EOL><INDENT>files = [files]<EOL><DEDENT>directory = False<EOL>recursive = kwargs.pop('<STR_LIT>', True)<EOL>if '<STR_LIT>' in kwargs and '<STR_LIT>' in kwargs:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>elif '<STR_LIT>' in kwargs:<EOL><INDENT>destination = Path(kwargs.pop('<STR_LIT>'))<EOL>if len(files) != <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>elif '<STR_LIT>' in kwargs:<EOL><INDENT>destination = Path(kwargs.pop('<STR_LIT>'))<EOL>directory = True<EOL><DEDENT>if kwargs:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>status, target, result = self.status(job_id)<EOL>scp_client = self.get_scp_client()<EOL>for filename in files:<EOL><INDENT>logger.info("<STR_LIT>", target / filename)<EOL>if directory:<EOL><INDENT>scp_client.get(str(target / filename),<EOL>str(destination / filename),<EOL>recursive=recursive)<EOL><DEDENT>else:<EOL><INDENT>scp_client.get(str(target / filename),<EOL>str(destination),<EOL>recursive=recursive)<EOL><DEDENT><DEDENT>
Downloads files from server.