class_docstr: Some expand functions require all the packages to already be discovered before
  they run, e.g. :func:`read_attr`, :func:`resolve_class`, :func:`cmdclass`.
  
  Therefore in some cases we will need to run autodiscovery during the evaluation of
  the configuration. However, it is better to postpone calling package discovery as
  much as possible, because some parameters can influence it (e.g. ``package_dir``),
  and those might not have been processed yet.
class_docstr_tok: ["Some","expand","functions","require","all","the","packages","to","already","be","discovered","before","they","run",",","e.g",".",":","func",":","`","read_attr","`",",",":","func",":","`","resolve_class","`",",",":","func",":","`","cmdclass","`",".","Therefore","in","some","cases","we","will","need","to","run","autodiscovery","during","the","evaluation","of","the","configuration",".","However",",","it","is","better","to","postpone","calling","package","discovery","as","much","as","possible",",","because","some","parameters","can","influence","it","(","e.g",".","``","package_dir","``",")",",","and","those","might","not","have","been","processed","yet","."]
code: def _get_package_dir(self) -> Mapping[str, str]:
      self()
      pkg_dir = self._dist.package_dir
      return {} if pkg_dir is None else pkg_dir
  
imports: import ast
  import importlib
  import os
  import pathlib
  import sys
  from glob import iglob
  from configparser import ConfigParser
  from importlib.machinery import ModuleSpec
  from itertools import chain
  from typing import TYPE_CHECKING, Callable, Dict, Iterable, Iterator, List, Mapping, Optional, Tuple, TypeVar, Union, cast
  from pathlib import Path
  from types import ModuleType
  from distutils.errors import DistutilsOptionError
  from .._path import same_path
  from ..warnings import SetuptoolsWarning
label_desc: Use image node_id 5 for calling the EnsurePackagesDiscovered obj's underlying member method code with example usage: obj._get_package_dir() and returns: unknown