<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def infiles(fnames, progress, leave=True):
 """Get input file paths. Parameters fnames : `list` of `str` File paths. progress : `bool` Show progress bar. leave : `bool`, optional Leave progress bar (default: True). Returns ------- `generator` of `str` Input file paths. """

    if progress:
        if fnames:
            fnames = tqdm(fnames, desc='Loading', unit='file',
                          bar_format=BAR_FORMAT,
                          leave=leave, dynamic_ncols=True)
        else:
            progress = False

    yield fnames

    if progress:
        fnames.close()