def listObjectsForPolicy(policyName):
     listRelatedNodes = list()
     policyObj = Policy.nodes.filter(name=policyName)
     if type(policyObj) is NodeSet:
         policyObj = policyObj.first_or_none()
     if policyObj:
         travDefn = dict(direction=EITHER, relation_type=None, model=None)
         trav = Traversal(policyObj, Policy.__label__, travDefn)
         listRelatedNodes.append(trav.all())
     return listRelatedNodes
 def listRelatedObjsFor(objName, objType):
     listRelatedNodes = list()
     obj = objType.nodes.filter(name=objName)
     if type(obj) is NodeSet:
         obj = obj.first_or_none()
     if obj:
         travDefn = dict(direction=EITHER, relation_type=None, model=None)
         trav = Traversal(obj, objType.__label__, travDefn)
         listRelatedNodes.append(trav.all())
     return listRelatedNodes