def get_stuck_jobs(recency_msecs):
 threshold_time = (datetime.datetime.utcnow() - datetime.timedelta(0, 0, 0, recency_msecs))
 shard_state_model_class = mapreduce_model.ShardState
 recent_job_models = shard_state_model_class.all()
 stuck_jobs = []
 for job_model in recent_job_models:
  if ((job_model.update_time > threshold_time) and (job_model.retries > 0)):
   stuck_jobs.append(job_model)
 return stuck_jobs

def get_stuck_jobs ( recency_msecs ) : threshold_time = ( datetime . datetime . utcnow ( ) - datetime . timedelta ( 0 , 0 , 0 , recency_msecs ) ) shard_state_model_class = mapreduce_model . ShardState recent_job_models = shard_state_model_class . all ( ) stuck_jobs = [ ] for job_model in recent_job_models : if ( ( job_model . update_time > threshold_time ) and ( job_model . retries > 0 ) ) : stuck_jobs . append ( job_model ) return stuck_jobs
returns a list of jobs which were last updated at most recency_msecs milliseconds ago and have experienced more than one retry .