def _is_cluster_done(cluster):
    """Return True if the given cluster is done running."""
    return bool(cluster['Status']['State'] == 'TERMINATING' or
                cluster['Status']['Timeline'].get('EndDateTime'))