<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate_file(parser, arg):
 """Validates that `arg` is a valid file."""

    if not os.path.isfile(arg):
        parser.error("%s is not a file." % arg)
    return arg