'Check whether a node is ready to send more requests.
In addition to connection-level checks, this method also is used to
block additional requests from being sent during a metadata refresh.
Arguments:
node_id (int): id of the node to check
metadata_priority (bool): Mark node as not-ready if a metadata
refresh is required. Default: True
Returns:
bool: True if the node is ready and metadata is not refreshing'

def is_ready(self, node_id, metadata_priority=True):

    if (not self._can_send_request(node_id)):
        return False
    if metadata_priority:
        if self._metadata_refresh_in_progress:
            return False
        if (self.cluster.ttl() == 0):
            return False
    return True
