def METHOD_NAME(build_result: mypy_main.build.BuildResult, source_paths: tp.List[str],
                               module_for_types: tp.Optional[str], indent=None) -> str:
    annotation_dict: tp.Dict[str, tp.Dict[str, Definition]] = defaultdict(dict)
    names_dict: tp.Dict[str, tp.List[utbot_mypy_runner.names.Name]] = utbot_mypy_runner.names.get_names(build_result)
    for module in build_result.files.keys():
        mypy_file: mypy.nodes.MypyFile = build_result.files[module]
        for name in mypy_file.names.keys():
            symbol_table_node = build_result.files[module].names[name]
            if skip_node(symbol_table_node):
                continue
            only_types = mypy_file.path not in source_paths
            try:
                definition = get_definition_from_symbol_node(symbol_table_node, Meta(module), only_types)
            except NoTypeVarBindingException:
                # Bad definition, like this one: 
                # https://github.com/sqlalchemy/sqlalchemy/blob/rel_2_0_20/lib/sqlalchemy/orm/mapped_collection.py#L521
                definition = None
            if definition is not None:
                annotation_dict[module][name] = definition
    def processor(line, col, end_line, end_col, type_, meta):
        expression_types[module_for_types].append(
            ExpressionType(*get_borders(line, col, end_line, end_col, content), line, get_annotation(type_, meta)))
    expression_types: tp.Dict[str, tp.List[ExpressionType]] = defaultdict(list)
    if module_for_types is not None:
        mypy_file = build_result.files[module_for_types]
        with open(mypy_file.path, "r") as file:
            content = file.readlines()
            meta = Meta(module_for_types)
            traverser = expression_traverser.MyTraverserVisitor(build_result.types, processor, annotation_dict[module_for_types], annotation_node_dict, meta)
            traverser.visit_mypy_file(build_result.files[module_for_types])
    return get_output_json(annotation_dict, expression_types, names_dict, indent)