code: def normalize_path_maybe_ignore(
      path: Path,
      root: Path,
      report: Optional[Report] = None,
  ) -> Optional[str]:
      """Normalize `path`. May return `None` if `path` was ignored.
  
      `report` is where "path ignored" output goes.
      """
      try:
          abspath = path if path.is_absolute() else Path.cwd() / path
          normalized_path = abspath.resolve()
          try:
              root_relative_path = normalized_path.relative_to(
                  root
              ).as_posix()
          except ValueError:
              if report:
                  report.path_ignored(
                      path,
                      f"is a symbolic link that points outside {root}",
                  )
              return None
  
      except OSError as e:
          if report:
              report.path_ignored(path, f"cannot be read because {e}")
          return None
  
      return root_relative_path
  
imports: import io
  import os
  import sys
  from functools import lru_cache
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Dict, Iterable, Iterator, List, Optional, Pattern, Sequence, Tuple, Union
  from mypy_extensions import mypyc_attr
  from packaging.specifiers import InvalidSpecifier, Specifier, SpecifierSet
  from packaging.version import InvalidVersion, Version
  from pathspec import PathSpec
  from pathspec.patterns.gitwildmatch import GitWildMatchPatternError
  from black.handle_ipynb_magics import jupyter_dependencies_are_installed
  from black.mode import TargetVersion
  from black.output import err
  from black.report import Report
label_desc: Use image node_id 10 for calling a global function with example usage: normalize_path_maybe_ignore(path, root, report) and returns: root_relative_path, None, None