def time_job_flow_idle(self, jf):
     if (is_job_flow_bootstrapping(jf) or
         is_job_flow_running(jf) or
         is_job_flow_done(jf)):
         return timedelta(0)
     else:
         return self.now - time_last_active(jf)
 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)