code: def process_semfin_node(
      sentences,
      sync_waiting,
      has_speech,
      concept,
      concept_open,
      n,
      time,
      time_end,
  ):
      """
      Parse SemFin nodes from the xml files of MEDIA.
  
      Arguments
      ---------
      sentences: dictionnary of str
          All sentences being extracted from the turn.
      sync_waiting: bool
          Used to keep track of sync nodes, to cut blank audio signal.
          True if a sync node has been processed without text in it.
          False if no sync nodes have been processed, or text has been parsed after one.
      has_speech: bool
          Used to keep track of the existency of speech in the turn's sentence.
          True if speech is present in the turn.
          False if no speech is present yet in the turn.
      concept: str
          Concept of the node being processed.
          Will be "null" if no concept is linked to this node.
      concept_open: bool
          Used to know if a concept has been used but not its closing tag ">".
          True if closing tag not seen yet and concept has been used.
          False if clossing tag put or concept not used.
      task: str, optional
          Either 'slu' or 'asr'.
          'slu' Parse SLU data.
          'asr' Parse ASR data.
      n: int
          Used to keep track of the number of sentences in the turn.
      time: str
          Current time given by the sync node.
      time_end: str
          Last time given by the turn, after last speech.
  
      Returns
      -------
      dictionnary of str, str, bool, bool, bool, int
      """
  
      # Prevent adding a closing concept
      # If Sync followed by SemFin generate a new segment without speech yet
      if concept_open:
          sentences[n][0] += "> "
          sentences[n][1] += "> _ "
      concept = "null"  # Indicate there is no currently open concept
      concept_open = False
      if sync_waiting:
          sentences[n][3] = time
          sentences.append(["", "", time, time_end])
          has_speech = False
          sync_waiting = False
          n += 1
      return (
          sentences,
          concept,
          concept_open,
          has_speech,
          sync_waiting,
          n,
      )
  
imports: import xml.dom.minidom
  from tqdm import tqdm
  import logging
  import subprocess
  import csv
  import os
  import glob
  import re
label_desc: Use image node_id 10 for calling a global function with example usage: process_semfin_node(sentences, sync_waiting, has_speech, concept, concept_open, n, time, time_end) and returns: sentences,  concept,  concept_open,  has_speech,  sync_waiting,  n