code: def _validator_for_name(validator_name):
      if validator_name not in VALIDATORS:
          msg = f"Invalid validator '{validator_name}' value!\nValid values are: {VALIDATORS}"
          raise ValueError(msg)
  
      for name, module, validator_cls in _VALIDATOR_MAP:
          if module and validator_name == name:
              return validator_cls
      # we always return something.
      msg = f"Missing validator for {validator_name!r}"
      raise ValueError(msg)
  
file_path: nbformat/nbformat/json_compat.py
imports: from __future__ import annotations
  import os
  import fastjsonschema
  import jsonschema
  from fastjsonschema import JsonSchemaException
  from jsonschema import Draft4Validator
  from jsonschema.exceptions import ErrorTree, ValidationError
label_desc: Use image node_id 1 for calling a global function with example usage: _validator_for_name(validator_name) and returns: validator_cls