def get_definition(func_ir, name, **kwargs):
    """
    Same as func_ir.get_definition(name), but raise GuardException if
    exception KeyError is caught.
    """
    try:
        return func_ir.get_definition(name, **kwargs)
    except KeyError:
        raise GuardException

    Same as func_ir.get_definition(name), but raise GuardException if
    exception KeyError is caught.
    
numba/core/ir_utils.py