code: def listener(
      dataset: str,
      query: Optional[str] = None,
      metrics: Optional[List[str]] = None,
      condition: Optional[ListenerCondition] = None,
      with_records: bool = True,
      execution_interval_in_seconds: int = 30,
      **query_params,
  ):
      """
      Configures the decorated function as an argilla listener.
  
      Args:
          dataset: The dataset name.
          query: The query string.
          metrics: Required metrics for listener condition.
          condition: Defines condition over search and metrics that launch action when is satisfied.
          with_records: Include records as part of action arguments. If ``False``,
              only the listener context ``RGListenerContext`` will be passed. Default: ``True``.
          execution_interval_in_seconds: Define the execution interval in seconds when listener
              iteration will be executed.
          **query_params: Dynamic parameters used in the query. These parameters will be available
              via the listener context and can be updated for subsequent queries.
      """
  
      def inner_decorator(func):
          return RGDatasetListener(
              dataset=dataset,
              action=func,
              condition=condition,
              query=query,
              query_params=query_params,
              metrics=metrics,
              query_records=with_records,
              interval_in_seconds=execution_interval_in_seconds,
          )
  
      return inner_decorator
  
imports: import copy
  import dataclasses
  import functools
  import logging
  import threading
  import time
  from typing import Any, Dict, List, Optional
  import schedule
  import argilla
  from argilla.client import singleton
  from argilla.client.sdk.commons.errors import NotFoundApiError
  from argilla.listeners.models import ListenerAction, ListenerCondition, Metrics, RGListenerContext, Search
label_desc: Use image node_id 1 for calling a global function with example usage: listener(dataset, query, metrics, condition, with_records, execution_interval_in_seconds) and returns: inner_decorator, RGDatasetListener