def check_args(args):
if not os.path.exists(args.fd):<EOL><INDENT>print("<STR_LIT>", args.fd, file=ERROR_LOG)<EOL>return [], [], False<EOL><DEDENT>if args.fl is not None:<EOL><INDENT>file_line = args.fl.readline()<EOL>amr_ids = file_line.strip().split()<EOL><DEDENT>elif args.f is None:<EOL><INDENT>print("<STR_LIT>", file=ERROR_LOG)<EOL>return [], [], False<EOL><DEDENT>else:<EOL><INDENT>amr_ids = args.f<EOL><DEDENT>names = []<EOL>check_name = True<EOL>if args.p is None:<EOL><INDENT>names = get_names(args.fd, amr_ids)<EOL>check_name = False<EOL>if len(names) == <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT>", file=ERROR_LOG)<EOL>return [], [], False<EOL><DEDENT>else:<EOL><INDENT>names = args.p<EOL><DEDENT><DEDENT>if len(names) == <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT>", file=ERROR_LOG)<EOL>return [], [], False<EOL><DEDENT>if len(names) == <NUM_LIT:1>:<EOL><INDENT>print("<STR_LIT>", file=ERROR_LOG)<EOL>return [], [], False<EOL><DEDENT>if "<STR_LIT>" in names:<EOL><INDENT>con_index = names.index("<STR_LIT>")<EOL>names.pop(con_index)<EOL>names.append("<STR_LIT>")<EOL><DEDENT>if check_name:<EOL><INDENT>pop_name = []<EOL>for i, name in enumerate(names):<EOL><INDENT>for amr in amr_ids:<EOL><INDENT>amr_path = args.fd + name + "<STR_LIT:/>" + amr + "<STR_LIT>"<EOL>if not os.path.exists(amr_path):<EOL><INDENT>print("<STR_LIT>", name, "<STR_LIT>", amr, file=ERROR_LOG)<EOL>pop_name.append(i)<EOL>break<EOL><DEDENT><DEDENT><DEDENT>if len(pop_name) != <NUM_LIT:0>:<EOL><INDENT>pop_num = <NUM_LIT:0><EOL>for p in pop_name:<EOL><INDENT>print("<STR_LIT>", names[p - pop_num], "<STR_LIT>", file=ERROR_LOG)<EOL>names.pop(p - pop_num)<EOL>pop_num += <NUM_LIT:1><EOL><DEDENT><DEDENT>if len(names) < <NUM_LIT:2>:<EOL><INDENT>print("<STR_LIT>", file=ERROR_LOG)<EOL>return "<STR_LIT>", "<STR_LIT>", False<EOL><DEDENT><DEDENT>return amr_ids, names, True<EOL>
Parse arguments and check if the arguments are valid