code: def promote_pathlike_directory(
      directory: typing.Union[os.PathLike, str, None],
      /,
      *,
      default: typing.Union[os.PathLike, str, None] = None,
  ) -> pathlib.Path:
      """Return path-like object ``directory`` promoted into a path object (default to ``os.curdir``).
  
      See also:
          https://docs.python.org/3/glossary.html#term-path-like-object
      """
      return pathlib.Path(
          directory if directory is not None else default or os.curdir
      )
  
file_path: graphviz/graphviz/_tools.py
imports: import functools
  import inspect
  import itertools
  import logging
  import os
  import pathlib
  import typing
  import warnings
label_desc: Use image node_id 8 for calling a global function with example usage: promote_pathlike_directory() and returns: pathlib