code: def test_active(self):
      nav_cfg = [
          {"Home": "index.md"},
          {
              "API Guide": [
                  {"Running": "api-guide/running.md"},
                  {"Testing": "api-guide/testing.md"},
                  {"Debugging": "api-guide/debugging.md"},
                  {
                      "Advanced": [
                          {"Part 1": "api-guide/advanced/part-1.md"},
                      ]
                  },
              ]
          },
          {
              "About": [
                  {"Release notes": "about/release-notes.md"},
                  {"License": "about/license.md"},
              ]
          },
      ]
      cfg = load_config(nav=nav_cfg, site_url="http://example.com/")
      fs = [
          "index.md",
          "api-guide/running.md",
          "api-guide/testing.md",
          "api-guide/debugging.md",
          "api-guide/advanced/part-1.md",
          "about/release-notes.md",
          "about/license.md",
      ]
      files = Files(
          [
              File(
                  s, cfg.docs_dir, cfg.site_dir, cfg.use_directory_urls
              )
              for s in fs
          ]
      )
      site_navigation = get_navigation(files, cfg)
      # Confirm nothing is active
      self.assertTrue(
          all(page.active is False for page in site_navigation.pages)
      )
      self.assertTrue(
          all(item.active is False for item in site_navigation.items)
      )
      # Activate
      site_navigation.items[1].children[3].children[0].active = True
      # Confirm ancestors are activated
      self.assertTrue(
          site_navigation.items[1].children[3].children[0].active
      )
      self.assertTrue(site_navigation.items[1].children[3].active)
      self.assertTrue(site_navigation.items[1].active)
      # Confirm non-ancestors are not activated
      self.assertFalse(site_navigation.items[0].active)
      self.assertFalse(site_navigation.items[1].children[0].active)
      self.assertFalse(site_navigation.items[1].children[1].active)
      self.assertFalse(site_navigation.items[1].children[2].active)
      self.assertFalse(site_navigation.items[2].active)
      self.assertFalse(site_navigation.items[2].children[0].active)
      self.assertFalse(site_navigation.items[2].children[1].active)
      # Deactivate
      site_navigation.items[1].children[3].children[0].active = False
      # Confirm ancestors are deactivated
      self.assertFalse(
          site_navigation.items[1].children[3].children[0].active
      )
      self.assertFalse(site_navigation.items[1].children[3].active)
      self.assertFalse(site_navigation.items[1].active)
  
imports: import sys
  import unittest
  from mkdocs.structure.files import File, Files, set_exclusions
  from mkdocs.structure.nav import Section, _get_by_type, get_navigation
  from mkdocs.structure.pages import Page
  from mkdocs.tests.base import dedent, load_config
label_desc: Use image node_id 16 for calling the SiteNavigationTests obj's underlying member method code with example usage: obj.test_active() without return types