def parse_args(<EOL>bels: list, char_locs: CharLocs, parsed: Parsed, errors: Errors<EOL>) -> Tuple[Parsed, Errors]:
commas = char_locs["<STR_LIT>"]<EOL>for span in parsed:<EOL><INDENT>if parsed[span]["<STR_LIT:type>"] != "<STR_LIT>" or "<STR_LIT>" not in parsed[span]:<EOL><INDENT>continue  <EOL><DEDENT>sp, ep = parsed[span]["<STR_LIT>"]<EOL>if ep == -<NUM_LIT:1>:  <EOL><INDENT>args_end = len(bels) - <NUM_LIT:1>  <EOL><DEDENT>else:<EOL><INDENT>args_end = ep - <NUM_LIT:1>  <EOL><DEDENT>args = []<EOL>arg_start = sp + <NUM_LIT:1><EOL>each_arg_end_list = sorted([end - <NUM_LIT:1> for end in commas.get(sp, [])] + [args_end])<EOL>for arg_end in each_arg_end_list:<EOL><INDENT>while arg_start < args_end and bels[arg_start] == "<STR_LIT:U+0020>":<EOL><INDENT>arg_start += <NUM_LIT:1><EOL><DEDENT>trimmed_arg_end = arg_end<EOL>while trimmed_arg_end > arg_start and bels[trimmed_arg_end] == "<STR_LIT:U+0020>":<EOL><INDENT>trimmed_arg_end -= <NUM_LIT:1><EOL><DEDENT>if trimmed_arg_end < arg_start:<EOL><INDENT>trimmed_arg_end = arg_start<EOL><DEDENT>arg = "<STR_LIT>".join(bels[arg_start : trimmed_arg_end + <NUM_LIT:1>])<EOL>args.append({"<STR_LIT>": arg, "<STR_LIT>": (arg_start, trimmed_arg_end)})<EOL>arg_start = arg_end + <NUM_LIT:2><EOL><DEDENT>parsed[span]["<STR_LIT:args>"] = args<EOL><DEDENT>return parsed, errors<EOL>
Parse arguments from functions

    Args:
        bels: BEL string as list of chars
        char_locs: char locations for parens, commas and quotes
        parsed: function locations
        errors: error messages

    Returns:
        (functions, errors): function and arg locations plus error messages