code: def pytest_collect_directory(
      path: Path, parent: "Collector"
  ) -> "Optional[Collector]":
      """Create a :class:`~pytest.Collector` for the given directory, or None if
      not relevant.
  
      .. versionadded:: 8.0
  
      For best results, the returned collector should be a subclass of
      :class:`~pytest.Directory`, but this is not required.
  
      The new node needs to have the specified ``parent`` as a parent.
  
      Stops at first non-None result, see :ref:`firstresult`.
  
      :param path: The path to analyze.
  
      See :ref:`custom directory collectors` for a simple example of use of this
      hook.
      """
  
imports: from pathlib import Path
  from typing import Any
  from typing import Dict
  from typing import List
  from typing import Mapping
  from typing import Optional
  from typing import Sequence
  from typing import Tuple
  from typing import TYPE_CHECKING
  from typing import Union
  from pluggy import HookspecMarker
label_desc: Use image node_id 12 for calling a global function with example usage: pytest_collect_directory(path, parent) without return types