code: def promote_pathlike(
      filepath: typing.Union[os.PathLike, str, None]
  ) -> typing.Optional[pathlib.Path]:
      """Return path-like object ``filepath`` promoted into a path object.
  
      See also:
          https://docs.python.org/3/glossary.html#term-path-like-object
      """
      return pathlib.Path(filepath) if filepath is not None else None
  
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 7 for calling a global function with example usage: promote_pathlike(filepath) and returns: unknown