code: 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
  
file_path: dgl/python/dgl/_ffi/_ctypes/object.py
imports: from __future__ import absolute_import
  import ctypes
  from ..base import _LIB, c_str, check_call
  from ..object_generic import _set_class_object_base
  from .types import _wrap_arg_func, C_TO_PY_ARG_SWITCH, DGLValue, RETURN_SWITCH, TypeCode
label_desc: Use image node_id 2 for calling a global function with example usage: _return_object(x) and returns: obj