'Return the appropriate set of autocomplete completions for
the given element. Typically this is just one, but can be more for
\'*\'-imports'

def _members_from_elem(self, elem, allowed_cplns):

    members = set()
    if (elem.tag == 'import'):
        symbol_name = elem.get('symbol')
        module_name = elem.get('module')
        if (module_name is None):
            if (symbol_name in self._visited_blobs):
                return members
            self._visited_blobs[symbol_name] = None
            hits = self._hits_from_citdl(symbol_name)
            for hit in hits:
                for child in hit[0]:
                    members.update(self._members_from_elem(child, allowed_cplns))
        elif ((symbol_name is not None) and self.citadel):
            if (module_name in self._visited_blobs):
                return members
            self._visited_blobs[module_name] = None
            import_handler = self.citadel.import_handler_from_lang(self.trg.lang)
            try:
                self.debug('_members_from_elem:    about    to    call    import_handler.import_blob_name(module_name=%r),    symbol_name=%r', module_name, symbol_name)
                blob = import_handler.import_blob_name(module_name, self.libs, self.ctlr)
            except CodeIntelError:
                self.warn('_members_from_elem:    limitation    in    handling    imports    in    imported    modules')
                return members
            for blob_child in blob.getchildren():
                imported_name = blob_child.get('name')
                if (imported_name is None):
                    continue
                if ((symbol_name == '*') or (symbol_name == imported_name)):
                    try:
                        member_type = (blob_child.get('ilk') or blob_child.tag)
                        if (symbol_name == '*'):
                            if (self._elem_classification(blob_child) & allowed_cplns):
                                members.add((member_type, imported_name))
                        elif ((member_type == 'class') and (allowed_cplns & _CPLN_METHODS_INST)):
                            for child_elem in blob_child:
                                if (self._elem_classification(child_elem) & allowed_cplns):
                                    members.add((child_elem.get('ilk'), child_elem.get('name')))
                                else:
                                    self.debug("Not    adding    from    %s:    %s    isn't    allowed", imported_name, child_elem.get('name'))
                                    pass
                        else:
                            self.debug('Not    adding    from    %s:    member_type=%s    or    not    fabricated', imported_name, member_type)
                            pass
                    except CodeIntelError as ex:
                        self.warn("_members_from_elem:    %s    (can't    look    up    member    %r    in    blob    %r)", ex, imported_name, blob)
        elif (allowed_cplns & _CPLN_MODULES):
            cpln_name = module_name.split('/', 1)[0]
            members.add(('module', cpln_name))
    elif (self._elem_classification(elem) & allowed_cplns):
        members.add(((elem.get('ilk') or elem.tag), elem.get('name')))
    return members
