code: def _get_associated_instancenames(self, inst_name, namespace, assoc_class,
                                        result_class, result_role, role):
          
          instance_repo = self._get_instance_repo(namespace)
          result_classes = self._classnamedict(result_class, namespace)
          assoc_classes = self._classnamedict(assoc_class, namespace)
  
          inst_name.namespace = namespace
          rtn_instpaths = []
          role = role.lower() if role else role
          result_role = result_role.lower() if result_role else result_role
  
          ref_paths = self._get_reference_instnames(inst_name, namespace,
                                                    assoc_class, role)
          # Get associated instance names
          for ref_path in ref_paths:
              inst = self._find_instance(ref_path, instance_repo)[1]
              for prop in six.itervalues(inst.properties):
                  if prop.type == 'reference':
                      if prop.value == inst_name:
                          if assoc_class and inst.classname not in assoc_classes:
                              continue
                          if role and prop.name.lower() != role:
                              continue
                      else:
                          if result_class and (prop.value.classname
                                               not in result_classes):
                              continue
                          if result_role and prop.name.lower() != result_role:
                              continue
                          self._appendpath_unique(rtn_instpaths, prop.value)
  
          return rtn_instpaths
docs: Get the reference instances from the repository for the target
          instname and filtered by the result_class and role parameters.
  
          Returns a list of the reference instance names. The returned list is
          the original, not a copy so the user must copy them