'Get lineage for `tool_id`.
By preference the lineage for a version-agnostic tool_id is returned.
Falls back to fetching the lineage only when this fails.
This happens when the tool_id does not contain a version.'

def get(self, tool_id):

    lineage = self._get_versionless(tool_id)
    if lineage:
        return lineage
    if (tool_id not in self.lineage_map):
        tool = self.app.toolbox._tools_by_id.get(tool_id)
        if tool:
            lineage = ToolLineage.from_tool(tool)
        if lineage:
            self.lineage_map[tool_id] = lineage
    return self.lineage_map.get(tool_id)
