'Return hits for an argument of a function based on its caller
@param elem The argument; must have ilk=argument
@param scoperef The scope containing the element
@returns list of hits'

def _hits_from_argument(self, elem, scoperef):

    assert (elem.get('ilk') == 'argument'), ('_hits_from_argument    expects    an    argument,    got    a    %r' % elem.get('ilk'))
    hits = []
    scope = self._elem_from_scoperef(scoperef)
    args = [arg for arg in scope.findall('variable') if (arg.get('ilk') == 'argument')]
    for pos in range(len(args)):
        if (args[pos].get('name') == elem.get('name')):
            break
    else:
        return []
    for caller in scope.getiterator('caller'):
        citdl = caller.get('citdl')
        caller_pos = int((caller.get('pos') or 0))
        if ((citdl is None) or (caller_pos < 1)):
            continue
        for caller_hit in self._hits_from_citdl(citdl, scoperef):
            caller_func = caller_hit[0]
            if (caller_func.get('ilk') != 'function'):
                continue
            caller_args = [arg for arg in caller_func.getiterator('variable') if (arg.get('ilk') == 'argument')]
            if (caller_pos > len(caller_args)):
                continue
            caller_arg = caller_args[(caller_pos - 1)]
            citdl = caller_arg.get('citdl')
            if (not citdl):
                continue
            for citdl_hit in self._hits_from_citdl(citdl, caller_hit[1]):
                func = citdl_hit[0]
                if (func.get('ilk') != 'function'):
                    continue
                args = [arg for arg in func.getiterator('variable') if (arg.get('ilk') == 'argument')]
                if (pos >= len(args)):
                    continue
                citdl = args[pos].get('citdl')
                if (not citdl):
                    continue
                hits += self._hits_from_citdl(citdl, citdl_hit[1])
    return hits
