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'])
 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)