def METHOD_NAME(definitions: dict[str, dict[str, Any]], definitions_raw: dict[str, list[Tuple[int, str]]]) -> dict[str, dict[str, Any]]:
    definitions_context: dict[str, dict[str, Any]] = {}
    resources = [e.value for e in ResourceType]
    # iterate on the files
    for file_path, file_path_definitions in definitions.items():
        # iterate on the definitions (Parameters, Resources, Outputs...)
        for file_path_definition, definition in file_path_definitions.items():
            if isinstance(file_path_definition, str) and file_path_definition in resources:
                # iterate on the actual objects of each definition
                if isinstance(definition, dict):
                    for attribute, attr_value in definition.items():
                        if isinstance(attr_value, dict):
                            start_line = attr_value['__startline__']
                            end_line = attr_value['__endline__']
                        elif isinstance(attr_value, str) and '__startline__' in definition and '__endline__' in definition:
                            start_line = definition['__startline__']
                            end_line = definition['__endline__']
                        else:
                            continue
                        code_lines = definitions_raw[file_path][start_line - 1: end_line - 1]
                        dpath.new(
                            definitions_context,
                            [file_path, str(file_path_definition), str(attribute)],
                            {"start_line": start_line, "end_line": end_line, "code_lines": code_lines},
                        )
                elif isinstance(definition, (str, list)):
                    for line_tuple in definitions_raw[file_path]:
                        if file_path_definition in line_tuple[1] and definition_locator_helper(definition, line_tuple[1]):
                            code_lines = definitions_raw[file_path][line_tuple[0] - 1:line_tuple[0]]
                            dpath.new(
                                definitions_context,
                                [file_path, str(file_path_definition), str(definition)],
                                {"start_line": line_tuple[0], "end_line": line_tuple[0] + 1, "code_lines": code_lines},
                            )
                            break
    return definitions_context