'If tool with same lineage already in panel (or section) - find
and return it. Otherwise return None.'

def _lineage_in_panel(self, panel_dict, tool=None, tool_lineage=None):

    if (tool_lineage is None):
        assert (tool is not None)
        tool_lineage = tool.lineage
    if (tool_lineage is not None):
        lineage_tool_versions = reversed(tool_lineage.get_versions())
        for lineage_tool_version in lineage_tool_versions:
            lineage_tool = self._tool_from_lineage_version(lineage_tool_version)
            if lineage_tool:
                lineage_id = lineage_tool.id
                if panel_dict.has_tool_with_id(lineage_id):
                    return panel_dict.get_tool_with_id(lineage_id)
    else:
        log.warning("Could    not    find    lineage    for    tool    '%s'", tool.id)
    return None
