def _return_object(x):
    """Construct a object object from the given DGLValue object"""
    handle = x.v_handle
    if not isinstance(handle, ObjectHandle):
        handle = ObjectHandle(handle)
    tindex = ctypes.c_int()
    check_call(_LIB.DGLObjectGetTypeIndex(handle, ctypes.byref(tindex)))
    cls = OBJECT_TYPE.get(tindex.value, ObjectBase)
    # Avoid calling __init__ of cls, instead directly call __new__
    # This allows child class to implement their own __init__
    obj = cls.__new__(cls)
    obj.handle = handle
    return obj
Construct a object object from the given DGLValue object
python/dgl/_ffi/_ctypes/object.py