code: def validate_utf8(file):
      base_name = basename(file)
      text = b""
      with open(file, "rb") as f:
          for i, line in enumerate(f):
              if i < 1000:
                  text += line
              else:
                  break
      results = charset_normalizer.from_bytes(text).best()
      if not (
          results.encoding == "utf-8" and results.coherence >= 0.99
      ):
          warn(
              message=f"File {file} should encoding with UTF-8", level=1
          )
          sys.exit(1)
      with open(file, "r") as f:
          content = f.read()
      normalized_nfc_content = Text(content)
      if normalized_nfc_content != content:
          warn(
              message=f"File {base_name} should normalized to NFC",
              error_type="Format nfc-normalized-failed",
              file=base_name,
              level=1,
          )
  
file_path: underthesea/underthesea/corpus/validate_corpus.py
imports: import sys
  from os import listdir
  from os.path import join, basename
  import charset_normalizer
  from underthesea.feature_engineering.text import Text
  from underthesea.file_utils import DATASETS_FOLDER
  from underthesea.pipeline.word_tokenize import tokenize
label_desc: Use image node_id 4 for calling a global function with example usage: validate_utf8(file) without return types