def enhance_function_signatures(spec_dict: Mapping[str, Any]) -> Mapping[str, Any]:
for func in spec_dict["<STR_LIT>"]["<STR_LIT>"]:<EOL><INDENT>for i, sig in enumerate(spec_dict["<STR_LIT>"]["<STR_LIT>"][func]["<STR_LIT>"]):<EOL><INDENT>args = sig["<STR_LIT>"]<EOL>req_args = []<EOL>pos_args = []<EOL>opt_args = []<EOL>mult_args = []<EOL>for arg in args:<EOL><INDENT>if arg.get("<STR_LIT>", False):<EOL><INDENT>if arg["<STR_LIT:type>"] in ["<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>mult_args.extend(arg.get("<STR_LIT>", []))<EOL><DEDENT>elif arg["<STR_LIT:type>"] in ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>mult_args.append(arg["<STR_LIT:type>"])<EOL><DEDENT><DEDENT>elif arg.get("<STR_LIT>", False) and arg.get("<STR_LIT>", False):<EOL><INDENT>if arg["<STR_LIT:type>"] in ["<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>pos_args.append(arg.get("<STR_LIT>", []))<EOL><DEDENT>elif arg["<STR_LIT:type>"] in ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>pos_args.append(arg["<STR_LIT:type>"])<EOL><DEDENT><DEDENT>elif arg.get("<STR_LIT>", False):<EOL><INDENT>if arg["<STR_LIT:type>"] in ["<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>opt_args.extend(arg.get("<STR_LIT>", []))<EOL><DEDENT>elif arg["<STR_LIT:type>"] in ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>opt_args.append(arg["<STR_LIT:type>"])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if arg["<STR_LIT:type>"] in ["<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>req_args.append(arg.get("<STR_LIT>", []))<EOL><DEDENT>elif arg["<STR_LIT:type>"] in ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>req_args.append(arg["<STR_LIT:type>"])<EOL><DEDENT><DEDENT><DEDENT>spec_dict["<STR_LIT>"]["<STR_LIT>"][func]["<STR_LIT>"][i]["<STR_LIT>"] = copy.deepcopy(<EOL>req_args<EOL>)<EOL>spec_dict["<STR_LIT>"]["<STR_LIT>"][func]["<STR_LIT>"][i]["<STR_LIT>"] = copy.deepcopy(<EOL>pos_args<EOL>)<EOL>spec_dict["<STR_LIT>"]["<STR_LIT>"][func]["<STR_LIT>"][i]["<STR_LIT>"] = copy.deepcopy(<EOL>opt_args<EOL>)<EOL>spec_dict["<STR_LIT>"]["<STR_LIT>"][func]["<STR_LIT>"][i][<EOL>"<STR_LIT>"<EOL>] = copy.deepcopy(mult_args)<EOL><DEDENT><DEDENT>return spec_dict<EOL>
Enhance function signatures

    Add required and optional objects to signatures objects for semantic validation
    support.

    Args:
        spec_dict (Mapping[str, Any]): bel specification dictionary

    Returns:
        Mapping[str, Any]: return enhanced bel specification dict