code: def set_parent(self, child, parent):
          
          parents = cmds.listConnections("%s.parent" % child, plugs=True, source=True)
          if parents:
              # there is only one parent at a time
              cmds.disconnectAttr("%s.parent" % child, "%s" % parents[0])
          if parent:
              cmds.connectAttr("%s.parent" % child, "%s.children" % parent, force=True, nextAvailable=True)
docs: Set the parent of the child reftrack node
  
          :param child: the child reftrack node
          :type child: str
          :param parent: the parent reftrack node
          :type parent: str
          :returns: None
          :rtype: None
          :raises: None