code: def document_matches_filter(
      filters: Dict[str, Any], document: Document
  ) -> bool:
      """
      Return whether `filters` match the Document.
      For a detailed specification of the filters, refer to the DocumentStore.filter_documents() protocol documentation.
      """
      if "field" in filters:
          return _comparison_condition(filters, document)
      return _logic_condition(filters, document)
  
imports: from typing import List, Any, Union, Dict
  from dataclasses import fields
  from datetime import datetime
  import pandas
  from haystack.dataclasses import Document
  from haystack.errors import FilterError
label_desc: Use image node_id 1 for calling a global function with example usage: document_matches_filter(filters, document) and returns: _logic_condition, _comparison_condition