<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def insert(self, inst):
 """Insert a vdata or a vgroup in the vgroup. Args:: inst vdata or vgroup instance to add Returns:: index of the inserted vdata or vgroup (0 based) C library equivalent : Vinsert """


        if isinstance(inst, VD):
            id = inst._id
        elif isinstance(inst, VG):
            id = inst._id
        else:
            raise HDF4Error("insrt: bad argument")

        index = _C.Vinsert(self._id, id)
        _checkErr('insert', index, "cannot insert in vgroup")
        return index