code: def change_data_format(in_file, out_file):
      with open(out_file, "w") as f_out:
          with open(in_file, "r") as f_in:
              for line in f_in.readlines():
                  line_parts = line.strip().split("\t")
                  if len(line_parts) != 2:
                      logging.error("line error")
                  else:
                      label = line_parts[0].split(" ")
                      text = line_parts[1]
                      new_label = [x for x in label]
                      ind = 0
                      while ind < len(label):
                          if label[ind] == "X":
                              start, end = ind, ind + 1
                              while (
                                  end < len(label) and label[end] == "X"
                              ):
                                  end += 1
                              label_parts = label[ind - 1].split("-")
                              if len(label_parts) == 2:
                                  _, type = (
                                      label_parts[0],
                                      label_parts[1],
                                  )
                                  for i in range(start, end):
                                      new_label[i] = "I-" + type
                              elif len(label_parts) == 1:
                                  for i in range(start, end):
                                      new_label[i] = label_parts[0]
                              else:
                                  logging.error("label error")
                              ind = end + 1
                          else:
                              ind += 1
                      assert len(new_label) == len(text.split(" "))
                      new_line = (
                          " ".join(new_label) + "\t" + text + "\n"
                      )
                      f_out.write(new_line)
  
imports: import sys
  from absl import logging
  from bert import tokenization
label_desc: Use image node_id 2 for calling a global function with example usage: change_data_format(in_file, out_file) without return types