def run_func_until_ret_arg(fun, kwargs, fun_call=None, argument_being_watched=None, required_argument_response=None):
 status = None
 while (status != required_argument_response):
  f_result = fun(kwargs, call=fun_call)
  r_set = {}
  for d in f_result:
   if isinstance(d, list):
    d0 = d[0]
    if isinstance(d0, dict):
     for (k, v) in six.iteritems(d0):
      r_set[k] = v
  status = _unwrap_dict(r_set, argument_being_watched)
  log.debug('Function: {0}, Watched arg: {1}, Response: {2}'.format(str(fun).split(' ')[1], argument_being_watched, status))
  time.sleep(5)
 return True

def run_func_until_ret_arg ( fun , kwargs , fun_call = None , argument_being_watched = None , required_argument_response = None ) : status = None while ( status != required_argument_response ) : f_result = fun ( kwargs , call = fun_call ) r_set = { } for d in f_result : if isinstance ( d , list ) : d0 = d [ 0 ] if isinstance ( d0 , dict ) : for ( k , v ) in six . iteritems ( d0 ) : r_set [ k ] = v status = _unwrap_dict ( r_set , argument_being_watched ) log . debug ( 'Function: {0}, Watched arg: {1}, Response: {2}' . format ( str ( fun ) . split ( ' ' ) [ 1 ] , argument_being_watched , status ) ) time . sleep ( 5 ) return True
waits until the function retrieves some required argument .