code: def on_nav(
      nav: Navigation,
      *,
      config: MkDocsConfig,
      files: Files,
      **kwargs: Any,
  ) -> Navigation:
      new_items = generate_renamed_section_items(
          nav.items, config=config
      )
      return Navigation(items=new_items, pages=nav.pages)
  
file_path: fastapi/scripts/mkdocs_hooks.py
imports: from functools import lru_cache
  from pathlib import Path
  from typing import Any, List, Union
  import material
  from mkdocs.config.defaults import MkDocsConfig
  from mkdocs.structure.files import File, Files
  from mkdocs.structure.nav import Link, Navigation, Section
  from mkdocs.structure.pages import Page
label_desc: Use image node_id 8 for calling a global function with example usage: on_nav(nav) and returns: Navigation