code: def gen_nested_compat_files(
      output_dir: str,
      output_package: str,
      api_version: int,
      symbols_by_module: Mapping[str, set[_Entrypoint]],
      generated_imports_by_module: Mapping[str, set[str]],
      docs_by_module: Mapping[str, str],
      root_template_path: str,
      file_prefixes_to_strip: Sequence[str],
      use_lazy_loading: bool,
      compat_versions: Sequence[int],
      module_prefix: str,
      output_files: Set[str],
  ):
      """Generates the nested compat __init__.py files."""
      nested_compat_symbols_by_module: dict[str, set[_Entrypoint]] = {}
      nested_generated_imports_by_module: dict[str, set[str]] = {}
      compat_module = f"{output_package}.compat"
      # The nested compat files should only generate imports for the nested root
      # package, and its corresponding compat package.
      if output_package in symbols_by_module:
          nested_compat_symbols_by_module[
              output_package
          ] = symbols_by_module[output_package]
      if compat_module in symbols_by_module:
          nested_compat_symbols_by_module[
              compat_module
          ] = symbols_by_module[compat_module]
      if output_package in generated_imports_by_module:
          nested_generated_imports_by_module[
              output_package
          ] = generated_imports_by_module[output_package]
      if compat_module in generated_imports_by_module:
          nested_generated_imports_by_module[
              compat_module
          ] = generated_imports_by_module[compat_module]
  
      _gen_init_files(
          output_dir,
          output_package,
          api_version,
          nested_compat_symbols_by_module,
          nested_generated_imports_by_module,
          docs_by_module,
          root_template_path,
          file_prefixes_to_strip,
          use_lazy_loading,
          module_prefix,
          output_files,
          f"{compat_module}.v{api_version}",
      )
  
      for compat_version in compat_versions:
          nested_generated_imports_by_module[compat_module].add(
              f"{output_package}.compat.v{compat_version}"
          )
  
imports: import collections
  from collections.abc import Mapping, Sequence, Set
  import dataclasses
  import os
  from typing import Optional
  from absl import app
  from absl import flags
  from tensorflow.python.tools.api.generator2.shared import exported_api
label_desc: Use image node_id 11 for calling a global function with example usage: gen_nested_compat_files(output_dir, output_package, api_version, symbols_by_module, generated_imports_by_module, docs_by_module, root_template_path, file_prefixes_to_strip, use_lazy_loading, compat_versions, module_prefix, output_files) without return types