code: def deserialize_payload(json_string: str) -> pd.DataFrame:
      """This function performs the inverse of the serialize_payload function and rebuilds the object represented in
      json_string to a pandas DataFrame.
  
      Args:
          json_string: representing object to be rebuilt.
  
      Returns: pandas.DataFrame
      """
      payload_dict = json.loads(json_string)
  
      # extract raw data from json string
      raw_data_dict = json.loads(payload_dict["raw_data"])
      # rebuild based on original data source
      if payload_dict["source_type"] == "dataframe":
          # reconstitute the pandas dataframe
          df = pd.DataFrame.from_dict(raw_data_dict, orient="columns")
      elif payload_dict["source_type"] == "series":
          # reconstitute series into single row dataframe
          df = pd.DataFrame(pd.Series(raw_data_dict)).T
      else:
          ValueError(
              'Unknown "source_type" found.  Valid values are "dataframe" or '
              '"series".  Instead found {}'.format(
                  payload_dict["source_type"]
              )
          )
  
      # if source has ndarrays, rebuild those from list and set
      # original dtype.
      if payload_dict["ndarray_dtype"]:
          # yes, now covert list representation to ndarray representation
          for col in payload_dict["ndarray_dtype"]:
              dtype = payload_dict["ndarray_dtype"][col]
              df[col] = df[col].apply(
                  lambda x: np.array(x).astype(dtype)
              )
  
      return df
  
file_path: ludwig/ludwig/utils/server_utils.py
imports: import json
  import os
  import tempfile
  from typing import Any, Dict, Union
  import numpy
  import pandas
  from starlette.datastructures import UploadFile
  from starlette.responses import JSONResponse
  from ludwig.utils.data_utils import NumpyEncoder
label_desc: Use image node_id 3 for calling a global function with example usage: deserialize_payload(json_string) and returns: df