code: def poll_result(
      self, trace_id: str, quiet: bool = False, check_fit: bool = False
  ) -> "SearchTask":
      completed_statuses = {"COMPLETED", "VALIDATION_COMPLETED"}
      failed_statuses = {
          "FAILED",
          "VALIDATION_FAILED",
          "EMPTY_INTERSECTION",
      }
      submitted_statuses = {"SUBMITTED", "VALIDATION_SUBMITTED"}
      if not quiet:
          print(
              bundle.get("polling_search_task").format(
                  self.search_task_id
              )
          )
          if is_demo_api_key(self.api_key):
              print(bundle.get("polling_unregister_information"))
      search_task_id = (
          self.initial_search_task_id
          if self.initial_search_task_id is not None
          else self.search_task_id
      )
  
      try:
          with Spinner():
              if self.PROTECT_FROM_RATE_LIMIT:
                  time.sleep(
                      1
                  )  # this is neccesary to avoid requests rate limit restrictions
              self.summary = get_rest_client(
                  self.endpoint, self.api_key
              ).search_task_summary_v2(trace_id, search_task_id)
              while self.summary.status not in completed_statuses and (
                  not check_fit
                  or "VALIDATION" not in self.summary.status
              ):
                  time.sleep(self.POLLING_DELAY_SECONDS)
                  self.summary = get_rest_client(
                      self.endpoint, self.api_key
                  ).search_task_summary_v2(trace_id, search_task_id)
                  if self.summary.status in failed_statuses:
                      self.logger.error(
                          f"Search {search_task_id} failed with status {self.summary.status}"
                      )
                      raise RuntimeError(
                          bundle.get("search_task_failed_status")
                      )
                  if (
                      self.summary.status in submitted_statuses
                      and len(
                          self._get_provider_summaries(self.summary)
                      )
                      == 0
                  ):
                      self.logger.error(
                          f"No provider summaries for search {search_task_id}"
                      )
                      raise RuntimeError(
                          bundle.get("no_one_provider_respond")
                      )
                  time.sleep(self.POLLING_DELAY_SECONDS)
      except KeyboardInterrupt as e:
          if not check_fit:
              print(bundle.get("search_stopping"))
              get_rest_client(
                  self.endpoint, self.api_key
              ).stop_search_task_v2(trace_id, search_task_id)
              self.logger.warning(
                  f"Search {search_task_id} stopped by user"
              )
              print(bundle.get("search_stopped"))
          raise e
      print()
  
      has_completed_provider_task = False
      for provider_summary in self._get_provider_summaries(
          self.summary
      ):
          if provider_summary.status == "COMPLETED":
              has_completed_provider_task = True
  
      if not has_completed_provider_task and not check_fit:
          error_messages = [
              self._error_message(x)
              for x in self._get_provider_summaries(self.summary)
          ]
          if len(error_messages) == 1 and (
              error_messages[0] is None
              or error_messages[0].endswith("Internal error")
          ):
              self.logger.error(
                  f"Search failed with error: {error_messages[0]}"
              )
              raise RuntimeError(bundle.get("all_providers_failed"))
          else:
              self.logger.error(
                  f"Search failed with errors: {','.join(error_messages)}"
              )
              raise RuntimeError(
                  bundle.get("all_providers_failed_with_error").format(
                      ",".join(error_messages)
                  )
              )
  
      if self.summary.status in [
          "COMPLETED",
          "VALIDATION_COMPLETED",
      ] or (check_fit and "VALIDATION" in self.summary.status):
          self.provider_metadata_v2 = []
          self.unused_features_for_generation = []
          for (
              provider_summary
          ) in self.summary.initial_important_providers:
              if provider_summary.status == "COMPLETED":
                  self.provider_metadata_v2.append(
                      get_rest_client(
                          self.endpoint, self.api_key
                      ).get_provider_search_metadata_v3(
                          provider_summary.ads_search_task_id, trace_id
                      )
                  )
                  if (
                      provider_summary.unused_features_for_generation
                      is not None
                  ):
                      self.unused_features_for_generation.extend(
                          provider_summary.unused_features_for_generation
                      )
  
      return self
  
imports: import tempfile
  import time
  from functools import lru_cache
  from typing import Dict, List, Optional
  import pandas
  from upgini import dataset
  from upgini.http import LoggerFactory, ProviderTaskSummary, SearchProgress, SearchTaskSummary, get_rest_client, is_demo_api_key
  from upgini.metadata import SYSTEM_RECORD_ID, FeaturesMetadataV2, FileMetadata, GeneratedFeatureMetadata, ModelTaskType, ProviderTaskMetadataV2, RuntimeParameters
  from upgini.resource_bundle import bundle
  from upgini.spinner import Spinner
label_desc: Use image node_id 3 for calling the SearchTask obj's underlying member method code with example usage: obj.poll_result(trace_id, quiet, check_fit) and returns: self