def is_valid_file(parser, file_name):
 if (not os.path.exists(file_name)):
  parser.error("The file '{}' does not exist!".format(file_name))
  sys.exit(1)

def is_valid_file ( parser , file_name ) : if ( not os . path . exists ( file_name ) ) : parser . error ( "The file '{}' does not exist!" . format ( file_name ) ) sys . exit ( 1 )
ensure that the input_file exists .