code: def es_bool_query(
      *,
      must_not: Optional[List[dict]] = None,
      should: Optional[List[dict]] = None,
      minimum_should_match: Optional[Union[int, str]] = None,
  ) -> Dict[str, Any]:
      bool_query = {}
  
      if should:
          bool_query["should"] = should
      if must_not:
          bool_query["must_not"] = must_not
  
      if not bool_query:
          raise ValueError(
              "Cannot build a boolean query without any clause"
          )
  
      if minimum_should_match:
          bool_query["minimum_should_match"] = minimum_should_match
  
      return {"bool": bool_query}
  
imports: import dataclasses
  from abc import abstractmethod
  from typing import Any, Dict, Iterable, List, Optional, Union
  from uuid import UUID
  from argilla.server.enums import FieldType, MetadataPropertyType, RecordSortField, ResponseStatusFilter, SimilarityOrder
  from argilla.server.models import Dataset, Field, MetadataProperty, Question, QuestionType, Record, Response, ResponseStatus, Suggestion, Vector, VectorSettings
  from argilla.server.search_engine.base import AndFilter, Filter, FilterScope, FloatMetadataFilter, FloatMetadataMetrics, IntegerMetadataFilter, IntegerMetadataMetrics, MetadataFilter, MetadataFilterScope, MetadataMetrics, Order, RangeFilter, RecordFilterScope, ResponseFilterScope, SearchEngine, SearchResponseItem, SearchResponses, SortBy, SuggestionFilterScope, TermsFilter, TermsMetadataFilter, TermsMetadataMetrics, TextQuery, UserResponseStatusFilter
label_desc: Use image node_id 4 for calling a global function with example usage: es_bool_query() and returns: dict