def reflect_set(typ, val, c):
    """
    Reflect the native set's contents into the Python object.
    """
    if not typ.reflected:
        return
    inst = setobj.SetInstance(c.context, c.builder, typ, val)
    payload = inst.payload

    with c.builder.if_then(payload.dirty, likely=False):
        obj = inst.parent
        # XXX errors are not dealt with below
        c.pyapi.set_clear(obj)

        # Build a new Python list and then update the set with that
        ok, listobj = _native_set_to_python_list(typ, payload, c)
        with c.builder.if_then(ok, likely=True):
            c.pyapi.set_update(obj, listobj)
            c.pyapi.decref(listobj)

        # Mark the set clean, in case it is reflected twice
        inst.set_dirty(False)

    Reflect the native set's contents into the Python object.
    
numba/core/new_boxing.py