code: def query_instance_to_df(self, query_instance):
      if isinstance(query_instance, list):
          if isinstance(
              query_instance[0], dict
          ):  # prepare a list of query instances
              test = pd.DataFrame(
                  query_instance, columns=self.feature_names
              )
  
          else:  # prepare a single query instance in list
              query_instance = {"row1": query_instance}
              test = pd.DataFrame.from_dict(
                  query_instance,
                  orient="index",
                  columns=self.feature_names,
              )
  
      elif isinstance(query_instance, dict):
          test = pd.DataFrame(
              {k: [v] for k, v in query_instance.items()},
              columns=self.feature_names,
          )
  
      elif isinstance(query_instance, pd.DataFrame):
          test = query_instance.copy()
  
      else:
          raise ValueError(
              "Query instance should be a dict, a pandas dataframe, a list, or a list of dicts"
          )
      return test
  
file_path: DiCE/dice_ml/data_interfaces/base_data_interface.py
imports: from abc import ABC, abstractmethod
  import pandas
  from raiutils.exceptions import UserConfigValidationException
  from dice_ml.utils.exception import SystemException
label_desc: Use image node_id 8 for calling the _BaseData obj's underlying member method code with example usage: obj.query_instance_to_df(query_instance) and returns: test