code: def check_brat_annotation_and_text_compatibility(brat_folder):
      """
      Check if brat annotation and text files are compatible.
      """
      dataset_type = os.path.basename(brat_folder)
      print(
          "Checking the validity of BRAT-formatted {0} set... ".format(
              dataset_type
          ),
          end="",
      )
      text_filepaths = sorted(
          glob.glob(os.path.join(brat_folder, "*.txt"))
      )
      for text_filepath in text_filepaths:
          base_filename = os.path.splitext(
              os.path.basename(text_filepath)
          )[0]
          annotation_filepath = os.path.join(
              os.path.dirname(text_filepath), base_filename + ".ann"
          )
          # check if annotation file exists
          if not os.path.exists(annotation_filepath):
              raise IOError(
                  "Annotation file does not exist: {0}".format(
                      annotation_filepath
                  )
              )
          text, entities = get_entities_from_brat(
              text_filepath, annotation_filepath
          )
      print("Done.")
  
file_path: NeuroNER/neuroner/brat_to_conll.py
imports: import codecs
  import glob
  import json
  import os
  from pycorenlp import StanfordCoreNLP
  import spacy
  from neuroner import utils_nlp
label_desc: Use image node_id 6 for calling a global function with example usage: check_brat_annotation_and_text_compatibility(brat_folder) without return types