code: def write_mandarin_only_text(data_dict, file, char_file1, char_file2):
      """write Mandarin text data"""
  
      counter = collections.Counter()
      with open(file, "w") as fp:
          for idx, content in data_dict.items():
              if "train" == content["split"]:
                  text = normalize_text(content["text"])
                  text = text.replace("<noise>", "")
                  text = text.replace("<unk>", "")
                  text = remove_redundant_whitespaces(text)
                  text = extract_mandarin_only(text)
                  counter.update(text)
                  if text != "":
                      fp.write(text + "\n")
  
      vocab_list = sorted(counter.keys())
      print(f"=> Mandarin vocab size = {len(vocab_list)}")
  
      with open(char_file1, "w") as fp:
          fp.write("\n".join(vocab_list))
      with open(char_file2, "w") as fp:
          fp.write(
              'bpe_nlsyms="<noise>,▁' + ",▁".join(vocab_list) + '"\n'
          )
          fp.write(f"man_chars={len(vocab_list)}")
  
imports: import argparse
  import collections
  import itertools
  import os
  import random
  import re
  import sys
label_desc: Use image node_id 20 for calling a global function with example usage: write_mandarin_only_text(data_dict, file, char_file1, char_file2) without return types