class_docstr: Interface for abstract model to executor HPO runs
docstr: Prepare data as pickle files for hpo trials.
  If path_prefix is a s3 url, will store to s3. Otherwise, store in local disk
  
  Parameters
  ----------
  X: pd.DataFrame
      Training data
  y: pd.Series
      Training label
  X_val: pd.DataFrame
      Validation data
  y_val: pd.Series
      Validation label
  path_prefix: str
      path prefix to store the data artifacts
  
  Return
  ------
  Tuple[str, str]:
      Path to both the training and validation data
docstr_tok: ["Prepare","data","as","pickle","files","for","hpo","trials",".","If","path_prefix","is","a","s3","url",",","will","store","to","s3",".","Otherwise",",","store","in","local","disk","Parameters","--","--","--","--","--","X",":","pd.DataFrame","Training","data","y",":","pd.Series","Training","label","X_val",":","pd.DataFrame","Validation","data","y_val",":","pd.Series","Validation","label","path_prefix",":","str","path","prefix","to","store","the","data","artifacts","Return","--","--","--","Tuple","[","str",",","str","]",":","Path","to","both","the","training","and","validation","data"]
code: def prepare_data(
      self,
      X: pd.DataFrame,
      y: pd.Series,
      X_val: pd.DataFrame,
      y_val: pd.Series,
      path_prefix: str,
  ) -> Tuple[str, str]:
      """
      Prepare data as pickle files for hpo trials.
      If path_prefix is a s3 url, will store to s3. Otherwise, store in local disk
  
      Parameters
      ----------
      X: pd.DataFrame
          Training data
      y: pd.Series
          Training label
      X_val: pd.DataFrame
          Validation data
      y_val: pd.Series
          Validation label
      path_prefix: str
          path prefix to store the data artifacts
  
      Return
      ------
      Tuple[str, str]:
          Path to both the training and validation data
      """
  
      def save_data(data: Any, path_prefix: str, filename: str) -> str:
          if is_s3_url(path_prefix):
              path = (
                  path_prefix + filename
                  if path_prefix.endswith("/")
                  else path_prefix + f"/{filename}"
              )
          else:
              path = os.path.join(path_prefix, filename)
          save_pkl.save(path=path, object=data, verbose=False)
          return path
  
      dataset_train_filename = "dataset_train.pkl"
      dataset_val_filename = "dataset_val.pkl"
      train_path = save_data(
          data=(X, y),
          path_prefix=path_prefix,
          filename=dataset_train_filename,
      )
      val_path = save_data(
          data=(X_val, y_val),
          path_prefix=path_prefix,
          filename=dataset_val_filename,
      )
  
      return train_path, val_path
  
imports: from __future__ import annotations
  import copy
  import logging
  import math
  import os
  import time
  from abc import ABC, abstractmethod
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union
  import pandas
  from autogluon.common import space
  from autogluon.common.utils.resource_utils import ResourceManager
  from autogluon.common.utils.s3_utils import is_s3_url
  from ..ray.resources_calculator import ResourceCalculator
  from ..scheduler.scheduler_factory import scheduler_factory
  from ..utils.savers import save_pkl
  from .constants import CUSTOM_BACKEND, RAY_BACKEND
  from .exceptions import EmptySearchSpace
label_desc: Use image node_id 8 for calling the HpoExecutor obj's underlying member method code with example usage: obj.prepare_data(X, y, X_val, y_val, path_prefix) and returns: train_path,  val_path, path