def is_undefined(obj):
 from jinja2.runtime import Undefined
 return isinstance(obj, Undefined)

def is_undefined ( obj ) : from jinja2 . runtime import Undefined return isinstance ( obj , Undefined )
check if the object passed is undefined .