

def time_mock_cluster_idle(self, mock_cluster):
    if (_is_cluster_starting(mock_cluster) or _is_cluster_bootstrapping(mock_cluster) or _is_cluster_running(mock_cluster._steps) or _is_cluster_done(mock_cluster)):
        return timedelta(0)
    else:
        return (self.now - _time_last_active(mock_cluster, mock_cluster._steps))

dataset/ETHPy150Open Yelp/mrjob/tests/tools/emr/test_terminate_idle_clusters.py ClusterTerminationTestCase.time_mock_cluster_idle/original