code: def test_handle_features_with_few_shot_prompt_config(
      backend, retrieval_kwargs, ray_cluster_2cpu
  ):
      prompt_config = PromptConfig.from_dict(
          {
              "task": (
                  "Given the sample input, complete this sentence by replacing XXXX: "
                  "The label is XXXX. Choose one value in this list: [1, 2, 3]."
              ),
              "retrieval": retrieval_kwargs,
          }
      ).to_dict()  # convert back-and-forth to validate and add defaults
  
      input_features = [
          text_feature(
              encoder={TYPE: "passthrough"},
          )
      ]
      output_features = [
          category_feature(
              output_feature=True,
              decoder={TYPE: "category_extractor"},
          )
      ]
      input_feature_name = input_features[0][NAME]
      output_feature_name = output_features[0][NAME]
  
      config = {
          MODEL_TYPE: MODEL_LLM,
          BASE_MODEL: "gpt2",
          INPUT_FEATURES: input_features,
          OUTPUT_FEATURES: output_features,
          PROMPT: prompt_config,
      }
      config = ModelConfig.from_dict(config).to_dict()
  
      df = generate_data_as_dataframe(
          input_features, output_features, 10, with_split=True
      )  # retrieval needs fixed split
      if backend == "ray":
          import dask.dataframe as dd
  
          df = dd.from_pandas(df, npartitions=2)
  
      split_col = df[SPLIT]
      feature_configs = config[INPUT_FEATURES] + config[OUTPUT_FEATURES]
  
      if backend == "local":
          context = mock.patch(
              "ludwig.models.retrieval.SemanticRetrieval._encode",
              side_effect=lambda row_strs, _: np.random.rand(
                  len(row_strs), 16
              ).astype(np.float32),
          )
      else:
          # TODO: figure out how to get mocks to work with Ray backend
          context = contextlib.nullcontext()
  
      with context:
          backend = initialize_backend(backend)
          dataset_cols = handle_features_with_prompt_config(
              config,
              df,
              feature_configs,
              backend=backend,
              split_col=split_col,
          )
  
          assert len(dataset_cols) == 1
          assert input_feature_name in dataset_cols
  
          # Inspect the generated prompts
          col = backend.df_engine.compute(
              dataset_cols[input_feature_name]
          )
          for prompt in col:
              # input_feature_name and output_feature_name should be in the prompt because
              # labeled samples are provided by the context
              assert input_feature_name in prompt
              assert output_feature_name in prompt
  
imports: import contextlib
  import copy
  import logging
  import os
  import random
  import string
  from unittest import mock
  import numpy
  import pandas
  import pytest
  from PIL import Image
  from transformers import AutoTokenizer
  import ludwig
  from ludwig.api import LudwigModel
  from ludwig.backend import initialize_backend
  from ludwig.callbacks import Callback
  from ludwig.constants import BASE_MODEL, BATCH_SIZE, COLUMN, DECODER, EPOCHS, FULL, INPUT_FEATURES, MODEL_ECD, MODEL_LLM, MODEL_TYPE, NAME, OUTPUT_FEATURES, PREPROCESSING, PROC_COLUMN, PROMPT, SPLIT, TRAINER, TYPE
  from ludwig.data.concatenate_datasets import concatenate_df
  from ludwig.data.preprocessing import handle_features_with_prompt_config, preprocess_for_prediction
  from ludwig.schema.llms.prompt import PromptConfig
  from ludwig.schema.model_types.base import ModelConfig
  from tests.integration_tests.utils import assert_preprocessed_dataset_shape_and_dtype_for_feature, audio_feature, binary_feature, category_feature, generate_data, generate_data_as_dataframe, image_feature, LocalTestBackend, number_feature, sequence_feature, text_feature
label_desc: Use image node_id 25 for calling a global function with example usage: test_handle_features_with_few_shot_prompt_config(backend, retrieval_kwargs, ray_cluster_2cpu) without return types