docstr: Creates an object that raises the wrapped exception ``ex`` when used,
  and casts it to :py:obj:`~typing.Any` type.
docstr_tok: ["Creates","an","object","that","raises","the","wrapped","exception","``","ex","``","when","used",",","and","casts","it","to",":","py",":","obj",":","`","~typing.Any","`","type","."]
code: def new(ex: BaseException) -> Any:
      """
      Creates an object that raises the wrapped exception ``ex`` when used,
      and casts it to :py:obj:`~typing.Any` type.
      """
      return DeferredError(ex)
  
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 3 for calling the DeferredError obj's underlying member method code with example usage: obj.new(ex) and returns: DeferredError