from typing import NoReturn


def todo(what: str = "") -> NoReturn:
  """
  A placeholder for code that needs to be implemented.
  Raises a NotImplementedError with a descriptive message about the call site.
  Can be inserted anywhere in the code where functionality is yet to be implemented, without basedpyright screaming warnings.
  """
  import inspect
  import sys

  # Temporarily suppress the traceback to show a cleaner error message.
  sys.tracebacklimit = 0
  caller_frame = inspect.stack()[1]
  message = (
    f"\n\nTODO: {'Implementation needed' if not what else f'{f"Implement {what}" if not what.startswith("Implement") else what}'}\n"
    f"      in function '{caller_frame.function}'\n"
    f"      at {caller_frame.filename}:{caller_frame.lineno}\n"
  )
  raise NotImplementedError(message)
