code: def validate_exception_and_warning_placement(
      file_path: str, file_content: str, errors: set[str]
  ) -> None:
      tree = ast.parse(file_content)
      visitor = Visitor(file_path, errors)
      visitor.visit(tree)
  
      misplaced_exceptions = visitor.found_exceptions.difference(errors)
  
      # If misplaced_exceptions isn't an empty list then there exists
      # pandas-defined Exception or Warnings outside of pandas/errors/__init__.py, so
      # we should flag them.
      if misplaced_exceptions:
          msg = ERROR_MESSAGE.format(
              errors=", ".join(misplaced_exceptions)
          )
          sys.stdout.write(msg)
          sys.exit(1)
  
file_path: pandas/scripts/validate_exception_location.py
imports: from __future__ import annotations
  import argparse
  import ast
  import pathlib
  import sys
  from typing import TYPE_CHECKING
label_desc: Use image node_id 2 for calling a global function with example usage: validate_exception_and_warning_placement(file_path, file_content, errors) without return types