code: def _get_all_validation_raw_features_cached(
      endpoint: Optional[str],
      api_key: Optional[str],
      trace_id: str,
      search_task_id: str,
      metrics_calculation=False,
      protect_from_rate_limit: bool = True,
  ) -> Optional[pd.DataFrame]:
      if protect_from_rate_limit:
          time.sleep(
              1
          )  # this is neccesary to avoid requests rate limit restrictions
      features_response = get_rest_client(
          endpoint, api_key
      ).get_search_features_v2(
          trace_id, search_task_id, metrics_calculation
      )
      result_df = None
      for feature_block in features_response[
          "adsSearchTaskFeaturesDTO"
      ]:
          if feature_block["searchType"] == "VALIDATION":
              features_id = feature_block["adsSearchTaskFeaturesId"]
              if protect_from_rate_limit:
                  time.sleep(
                      1
                  )  # this is neccesary to avoid requests rate limit restrictions
              features_df = _download_features_file(
                  endpoint,
                  api_key,
                  trace_id,
                  features_id,
                  metrics_calculation,
              )
              if result_df is None:
                  result_df = features_df
              else:
                  result_df = pd.merge(
                      result_df,
                      features_df,
                      how="outer",
                      on=SYSTEM_RECORD_ID,
                  )
  
      return result_df
  
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 2 for calling a global function with example usage: _get_all_validation_raw_features_cached(endpoint, api_key, trace_id, search_task_id, metrics_calculation, protect_from_rate_limit) and returns: result_df