'See if token is from one of the imports on this <scope> elem.
Returns (<hit>, <num-tokens-consumed>) or (None, None) if not found.'

def _hit_from_elem_imports(self, tokens, elem):

    self.debug('_hit_from_elem_imports::    Checking    imports,    tokens[0]:    %r    ...    imp_elem:    %r', tokens[0], elem)
    import_handler = self.citadel.import_handler_from_lang(self.trg.lang)
    libs = self.buf.libs
    first_token = tokens[0]
    for imp_elem in (i for i in elem if (i.tag == 'import')):
        self.debug("_hit_from_elem_imports::    import    '%s    ...'    from    %r?", tokens[0], imp_elem)
        module_name = imp_elem.get('module')
        try_module_names = [module_name]
        if (module_name[0] == '/'):
            try_module_names.append(module_name[1:])
        for module_name in try_module_names:
            if (module_name not in self._imported_blobs):
                try:
                    blob = import_handler.import_blob_name(module_name, libs, self.ctlr)
                except CodeIntelError:
                    self.debug('_hit_from_elem_imports::    Failed    import:    %s', module_name)
                    pass
                else:
                    self._imported_blobs[module_name] = 1
                    try:
                        (hit, nconsumed) = self._hit_from_getattr(tokens, blob, (blob, []))
                        if hit:
                            return (hit, nconsumed)
                    except CodeIntelError as e:
                        self.debug('_hit_from_elem_imports::    _hit_from_getattr    could    not    resolve:    %r    on    %r', tokens, blob)
                        pass
            else:
                self.debug('_hit_from_elem_imports::    Recursive    import:    Already    imported    module:    %r', module_name)
    self.log('_hit_from_elem_imports::    trying    import    everything:    tokens:    %r', tokens)
    for nconsumed in range(len(tokens), 0, (-1)):
        lpath = tuple(tokens[:nconsumed])
        self.log('_hit_from_elem_imports::    trying    with    lpath:    %r', lpath)
        for lib in self.libs:
            hits = lib.hits_from_lpath(lpath, self.ctlr, curr_buf=self.buf)
            self.log('_hit_from_elem_imports::    ie:    lookup    %r    in    %s    =>    %r', lpath, lib, hits)
            for hit in hits:
                (hit_elem, import_scoperef) = hit
                (hit_blob, hit_lpath) = import_scoperef
                self.log('_hit_from_elem_imports::    ie:    matched    %r    to    %r    in    blob    %r', lpath, hit_elem, hit_blob)
                unique_import_name = ((hit_blob.get('name') + '#') + str(lpath))
                if (unique_import_name not in self._imported_blobs):
                    self._imported_blobs[unique_import_name] = 1
                    try:
                        if (hit and self._return_with_hit(hit, 1)):
                            return (hit, nconsumed)
                    except CodeIntelError as e:
                        self.debug('_hit_from_elem_imports::    ie:    _hit_from_getattr    could    not    resolve:    %r    on    %r', tokens, blob)
                        pass
                else:
                    self.debug('_hit_from_elem_imports::    ie:    Recursive    import:    Already    imported    module:    %r', unique_import_name)
        self.log('_hit_from_elem_imports::    ie:    no    matches    found')
    return (None, None)
