code: def check_file_content(file, term):
      """Check if term is present in file and not linked to glossary."""
      skip_if = [
          ":alt:",
          "<div",
          ".. ",
          ":start-after:",
          ":end-before:",
          ":ref:",
          "#    ",
      ]
  
      separator_rendered_block = ["# %%", "#############"]
  
      count = 0
  
      with open(file, encoding="utf-8") as f:
          if file.suffix == ".py":
              is_rendered_section = False
              is_docstring = False
  
          for i, line in enumerate(f.readlines()):
              if any(line.strip().startswith(s) for s in skip_if):
                  continue
  
              # Python files
              if file.suffix == ".py":
                  if any(
                      line.strip().startswith(s)
                      for s in separator_rendered_block
                  ):
                      is_rendered_section = True
  
                  if (
                      is_rendered_section
                      and not line.strip().startswith("#")
                  ):
                      is_rendered_section = False
                      continue
  
                  if line.strip().startswith('"""'):
                      is_docstring = not is_docstring
  
                  if not is_docstring and not is_rendered_section:
                      continue
  
                  elif check_string(line, term):
                      print(f"'{term}' in {file}:{i + 1}")
                      count += 1
  
              elif check_string(line, term):
                  print(f"'{term}' in {file}:{i + 1}")
                  count += 1
  
      return count
  
file_path: nilearn/maint_tools/check_glossary_term.py
imports: from __future__ import annotations
  import ast
  from pathlib import Path
  from docstring_parser import parse
  from docstring_parser.common import DocstringStyle
  from rich import print
label_desc: Use image node_id 5 for calling a global function with example usage: check_file_content(file, term) and returns: count