def is_datasource(tool_xml):
 return (tool_xml.getroot().attrib.get('tool_type', '') == 'data_source')

def is_datasource ( tool_xml ) : return ( tool_xml . getroot ( ) . attrib . get ( 'tool_type' , '' ) == 'data_source' )
returns true if the tool is a datasource tool .