def apply_delayed_types(
    type_map=annotated_class_list, fnlist=annotated_function_list
):  # pylint: disable=dangerous-default-value
    """
    Apply all delayed types. See annotate()
    """
    # pylint: disable=no-member
    # type name is a dict from str to type
    for func in fnlist:
        if (
            hasattr(func, "return_type")
            and isinstance(func.return_type, str)
            and func.return_type in type_map
        ):
            func.return_type = type_map[func.return_type]
        if hasattr(func, "type_annotations"):
            for key in func.type_annotations:
                if func.type_annotations[key] in type_map:
                    func.type_annotations[key] = type_map[func.type_annotations[key]]

    Apply all delayed types. See annotate()
    
coremltools/converters/mil/mil/types/annotate.py