def main(args=None):
if args is None:<EOL><INDENT>parser = get_argument_parser()<EOL>args = parser.parse_args()<EOL><DEDENT>experiment_file = args.experiment_file<EOL>output_file = args.output_file<EOL>host = '<STR_LIT>'<EOL>user = '<STR_LIT>'<EOL>password = '<STR_LIT>'<EOL>experiments = misc.read_single(experiment_file)<EOL>runs = []<EOL>with ftputil.FTPHost(host, user, password) as ftp_host:<EOL><INDENT>for exp in experiments:<EOL><INDENT>exp_dir = '<STR_LIT>'% (exp[:<NUM_LIT:6>], exp)<EOL>ftp_host.chdir(exp_dir)<EOL>run_folders = ftp_host.listdir(ftp_host.curdir)<EOL>for folder in run_folders:<EOL><INDENT>files = ftp_host.listdir(folder)<EOL>assert len(files) == <NUM_LIT:1><EOL>runs.append((exp, folder))<EOL><DEDENT><DEDENT><DEDENT>with open(output_file, '<STR_LIT:wb>') as ofh:<EOL><INDENT>writer = csv.writer(ofh, dialect='<STR_LIT>',<EOL>lineterminator=os.linesep,<EOL>quoting=csv.QUOTE_NONE)<EOL>for r in runs:<EOL><INDENT>writer.writerow(r)<EOL><DEDENT><DEDENT>return <NUM_LIT:0><EOL>
Download all .sra from NCBI SRA for a given experiment ID.

    Parameters
    ----------
    args: argparse.Namespace object, optional
        The argument values. If not specified, the values will be obtained by
        parsing the command line arguments using the `argparse` module.

    Returns
    -------
    int
        Exit code (0 if no error occurred).