def iter_ret(opts, ret):
 if (not opts['ext_job_cache']):
  raise StopIteration
 get_load = '{0}.get_load'.format(opts['ext_job_cache'])
 get_jid = '{0}.get_jid'.format(opts['ext_job_cache'])
 get_jids = '{0}.get_jids'.format(opts['ext_job_cache'])
 if (get_load not in ret):
  raise StopIteration
 else:
  get_load = ret[get_load]
 if (get_jid not in ret):
  raise StopIteration
 else:
  get_jid = ret[get_jid]
 if (get_jids not in ret):
  raise StopIteration
 else:
  get_jids = ret[get_jids]
 for jid in get_jids():
  jids = {}
  jids['load'] = get_load(jid)
  jids['ret'] = get_jid(jid)
  jids['jid'] = jid
  (yield jids)

def iter_ret ( opts , ret ) : if ( not opts [ 'ext_job_cache' ] ) : raise StopIteration get_load = '{0}.get_load' . format ( opts [ 'ext_job_cache' ] ) get_jid = '{0}.get_jid' . format ( opts [ 'ext_job_cache' ] ) get_jids = '{0}.get_jids' . format ( opts [ 'ext_job_cache' ] ) if ( get_load not in ret ) : raise StopIteration else : get_load = ret [ get_load ] if ( get_jid not in ret ) : raise StopIteration else : get_jid = ret [ get_jid ] if ( get_jids not in ret ) : raise StopIteration else : get_jids = ret [ get_jids ] for jid in get_jids ( ) : jids = { } jids [ 'load' ] = get_load ( jid ) jids [ 'ret' ] = get_jid ( jid ) jids [ 'jid' ] = jid ( yield jids )
yield returner data if the external job cache is enabled .