code: def set_reference(self, refobj, reference):
          
          refnodeattr = "%s.referencenode" % refobj
          if reference:
              cmds.connectAttr("%s.message" % reference, refnodeattr, force=True)
              ns = cmds.referenceQuery(reference, namespace=True)
              cmds.setAttr("%s.namespace" % refobj, ns, type="string")
          else:
              conns = cmds.listConnections(refnodeattr, plugs=True)
              if not conns:
                  return
              for c in conns:
                  cmds.disconnectAttr(c, refnodeattr)
docs: Connect the given reftrack node with the given refernce node
  
          :param refobj: the reftrack node to update
          :type refobj: str
          :param reference: the reference node
          :type reference: str
          :returns: None
          :rtype: None
          :raises: None