'Returns the location for an origin and position tuple as name
and lineno.'

def get_location(self, origin, position):

    if hasattr(origin, 'source'):
        source = origin.source
        name = '<unknown    source>'
    else:
        source = origin.loader(origin.loadname, origin.dirs)[0]
        name = origin.loadname
    lineno = (len(_newline_re.findall(source[:position[0]])) + 1)
    return (name, lineno)
