code: def _unify_metadata_filters_with_filter(
      metadata_filters: List[MetadataFilter], filter: Optional[Filter]
  ) -> Filter:
      filters = []
      if filter:
          filters.append(filter)
  
      for metadata_filter in metadata_filters:
          metadata_scope = MetadataFilterScope(
              metadata_property=metadata_filter.metadata_property.name
          )
          if isinstance(metadata_filter, TermsMetadataFilter):
              new_filter = TermsFilter(
                  scope=metadata_scope, values=metadata_filter.values
              )
          elif isinstance(
              metadata_filter,
              (IntegerMetadataFilter, FloatMetadataFilter),
          ):
              new_filter = RangeFilter(
                  scope=metadata_scope,
                  ge=metadata_filter.ge,
                  le=metadata_filter.le,
              )
          else:
              raise ValueError(
                  f"Cannot process request for metadata filter {metadata_filter}"
              )
          filters.append(new_filter)
  
      return AndFilter(filters=filters)
  
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 16 for calling a global function with example usage: _unify_metadata_filters_with_filter(metadata_filters, filter) and returns: AndFilter