def METHOD_NAME(args):
    if len(args.paths) == 0:
        int_dir = args.intermediate_dir
        assert int_dir.exists()
        files = list(sorted(int_dir.glob('*.sqlite*')))
        files = files[-args.last:]
    else:
        files = [Path(p) for p in args.paths]
    return files