#NEWLINE# def get_host_info( node_info , host ) : #NEWLINE# #INDENT# "\n    Simple callback that takes the node info from `/_cluster/nodes` and a\n    parsed connection information and return the connection information. If\n    `None` is returned this node will be skipped.\n\n    Useful for filtering nodes (by proximity for example) or if additional\n    information needs to be provided for the :class:`~elasticsearch.Connection`\n    class. By default master only nodes are filtered out since they shouldn't\n    typically be used for API operations.\n\n    :arg node_info: node information from `/_cluster/nodes`\n    :arg host: connection information (host, port) extracted from the node info\n    " #NEWLINE# attrs = node_info . get ( 'attributes' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( ( attrs . get ( 'data' , 'true' ) == 'false' ) and ( attrs . get ( 'client' , 'false' ) == 'false' ) and ( attrs . get ( 'master' , 'true' ) == 'true' ) ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# return node_info