code: def test_predict_pandas_with_pandas_data():
      """Data batch level predictor test where both input data and prediction
      batch format are pandas dataframes.
      """
      input = pd.DataFrame({"x": [1, 2, 3]})
      with create_dict_checkpoint(
          {"factor": 2.0}, checkpoint_cls=FrameworkCheckpoint
      ) as checkpoint:
          checkpoint.set_preprocessor(DummyPreprocessor())
          predictor = DummyPredictor.from_checkpoint(checkpoint)
  
      actual_output = predictor.predict(input)
      pd.testing.assert_frame_equal(
          actual_output, pd.DataFrame({"predictions": [4.0, 8.0, 12.0]})
      )
      pd.testing.assert_frame_equal(
          predictor.get_preprocessor().inputs[0],
          pd.DataFrame({"x": [1, 2, 3]}),
      )
      pd.testing.assert_frame_equal(
          predictor.get_preprocessor().outputs[0],
          pd.DataFrame({"x": [2, 4, 6]}),
      )
  
      # Test predict with both Numpy and Pandas preprocessor available
      with create_dict_checkpoint(
          {"factor": 2.0}, checkpoint_cls=FrameworkCheckpoint
      ) as checkpoint:
          checkpoint.set_preprocessor(DummyWithNumpyPreprocessor())
          predictor = DummyPredictor.from_checkpoint(checkpoint)
  
      actual_output = predictor.predict(input)
      pd.testing.assert_frame_equal(
          actual_output, pd.DataFrame({"predictions": [4.0, 8.0, 12.0]})
      )
      # This Preprocessor has Numpy as the batch format preference.
      np.testing.assert_array_equal(
          predictor.get_preprocessor().inputs[0], np.array([1, 2, 3])
      )
  
      np.testing.assert_array_equal(
          predictor.get_preprocessor().outputs[0], np.array([2, 4, 6])
      )
  
imports: import uuid
  from typing import Dict, Optional, Union
  from unittest import mock
  import numpy
  import pandas
  import pytest
  import ray
  from ray.air.constants import TENSOR_COLUMN_NAME
  from ray.air.util.data_batch_conversion import BatchFormat
  from ray.data import Preprocessor
  from ray.train._internal.framework_checkpoint import FrameworkCheckpoint
  from ray.train.predictor import Predictor, PredictorNotSerializableException
  from ray.train.tests.util import create_dict_checkpoint, load_dict_checkpoint
label_desc: Use image node_id 3 for calling a global function with example usage: test_predict_pandas_with_pandas_data() without return types