code: def is_undefined(obj: t.Any) -> bool:
      """Check if the object passed is undefined.  This does nothing more than
      performing an instance check against :class:`Undefined` but looks nicer.
      This can be used for custom filters or tests that want to react to
      undefined variables.  For example a custom default filter can look like
      this::
  
          def default(var, default=''):
              if is_undefined(var):
                  return default
              return var
      """
      from .runtime import Undefined
  
      return isinstance(obj, Undefined)
  
imports: import enum
  import json
  import os
  import re
  import typing
  from collections import abc
  from collections import deque
  from random import choice
  from random import randrange
  from threading import Lock
  from types import CodeType
  from urllib.parse import quote_from_bytes
  import markupsafe
label_desc: Use image node_id 5 for calling a global function with example usage: is_undefined(obj) and returns: isinstance