<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_filenames(dirname):
 """Return all model output filenames inside a model output directory, sorted by iteration number. Parameters dirname: str A path to a directory. Returns ------- filenames: list[str] Paths to all output files inside `dirname`, sorted in order of increasing iteration number. """

    filenames = glob.glob('{}/*.pkl'.format(dirname))
    return sorted(filenames, key=_f_to_i)