code: def run_validation(self, value: object) -> int:
      if not isinstance(value, str):
          raise base.ValidationError(
              f"Expected a string, but a {type(value)} was given."
          )
      try:
          return self.levels[value]
      except KeyError:
          raise base.ValidationError(
              f"Expected one of {list(self.levels)}, got {value!r}"
          )
  
file_path: mkdocs/mkdocs/config/defaults.py
imports: from __future__ import annotations
  import logging
  from typing import IO, Dict, Mapping
  from mkdocs.config import base
  from mkdocs.config import config_options
  from mkdocs.structure.pages import Page, _AbsoluteLinksValidationValue
  from mkdocs.utils.yaml import get_yaml_loader, yaml_load
label_desc: Use image node_id 1 for calling the _LogLevel obj's underlying member method code with example usage: obj.run_validation(value) and returns: self