code: def is_directory(f: Any) -> TypeGuard[bytes | str | Path]:
      """Checks if an object is a string, and that it points to a directory."""
      return is_path(f) and os.path.isdir(f)
  
file_path: pillow/src/PIL/_util.py
imports: from __future__ import annotations
  import os
  from pathlib import Path
  from typing import Any, NoReturn
  from ._typing import TypeGuard
label_desc: Use image node_id 2 for calling a global function with example usage: is_directory(f) and returns: unknown