def _ls_task_logs(fs, log_dir_stream, application_id=None, job_id=None):
 stderr_logs = []
 syslogs = []
 for match in _ls_logs(fs, log_dir_stream, _match_task_log_path, application_id=application_id, job_id=job_id):
  if (match['log_type'] == 'stderr'):
   stderr_logs.append(match)
  elif (match['log_type'] == 'syslog'):
   syslogs.append(match)
 key_to_syslog = dict(((_log_key(match), match) for match in syslogs))
 for stderr_log in stderr_logs:
  stderr_log['syslog'] = key_to_syslog.get(_log_key(stderr_log))
 stderr_logs_with_syslog = [m for m in stderr_logs if m['syslog']]
 return (stderr_logs_with_syslog + syslogs)

def _ls_task_logs ( fs , log_dir_stream , application_id = None , job_id = None ) : stderr_logs = [ ] syslogs = [ ] for match in _ls_logs ( fs , log_dir_stream , _match_task_log_path , application_id = application_id , job_id = job_id ) : if ( match [ 'log_type' ] == 'stderr' ) : stderr_logs . append ( match ) elif ( match [ 'log_type' ] == 'syslog' ) : syslogs . append ( match ) key_to_syslog = dict ( ( ( _log_key ( match ) , match ) for match in syslogs ) ) for stderr_log in stderr_logs : stderr_log [ 'syslog' ] = key_to_syslog . get ( _log_key ( stderr_log ) ) stderr_logs_with_syslog = [ m for m in stderr_logs if m [ 'syslog' ] ] return ( stderr_logs_with_syslog + syslogs )
yield matching logs .