class_docstr: Validator that can be switched on/off according to
  a filter. (This wraps around another validator.)
class_docstr_tok: ["Validator","that","can","be","switched","on\/off","according","to","a","filter",".","(","This","wraps","around","another","validator",".",")"]
code: def validate(self, document: Document) -> None:
      # Call the validator only if the filter is active.
      if self.filter():
          self.validator.validate(document)
  
imports: from __future__ import annotations
  from abc import ABCMeta, abstractmethod
  from typing import Callable
  from prompt_toolkit.eventloop import run_in_executor_with_context
  from .document import Document
  from .filters import FilterOrBool, to_filter
label_desc: Use image node_id 2 for calling the ConditionalValidator obj's underlying member method code with example usage: obj.validate(document) without return types