<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_args( bels: list, char_locs: CharLocs, parsed: Parsed, errors: Errors ) -> Tuple[Parsed, Errors]: """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 """


    commas = char_locs["commas"]

    # Process each span key in parsed from beginning
    for span in parsed:
        if parsed[span]["type"] != "Function" or "parens_span" not in parsed[span]:
            continue  # Skip if not argument-less
        sp, ep = parsed[span]["parens_span"]

        # calculate args_end position
        if ep == -1:  # supports bel completion
            args_end = len(bels) - 1  # 1
        else:
            args_end = ep - 1  # 1

        # Parse arguments
        args = []
        arg_start = sp + 1
        each_arg_end_list = sorted([end - 1 for end in commas.get(sp, [])] + [args_end])
        for arg_end in each_arg_end_list:
            # log.debug(f'Arg_start: {arg_start}  Arg_end: {arg_end}')

            # Skip blanks at beginning of argument
            while arg_start < args_end and bels[arg_start] == " ":
                arg_start += 1

            # Trim arg_end (e.g. HGNC:AKT1  , HGNC:EGF) - if there are spaces before comma
            trimmed_arg_end = arg_end
            while trimmed_arg_end > arg_start and bels[trimmed_arg_end] == " ":
                trimmed_arg_end -= 1

            if trimmed_arg_end < arg_start:
                trimmed_arg_end = arg_start

            arg = "".join(bels[arg_start : trimmed_arg_end + 1])

            # log.debug(f'Adding arg to args: {arg_start} {trimmed_arg_end}')
            args.append({"arg": arg, "span": (arg_start, trimmed_arg_end)})
            arg_start = arg_end + 2

        parsed[span]["args"] = args

    return parsed, errors