class_docstr: A data interface for private data with meta information.
class_docstr_tok: ["A","data","interface","for","private","data","with","meta","information","."]
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
  
imports: import collections
  import logging
  import sys
  from collections import defaultdict
  import numpy
  import pandas
  from sklearn.preprocessing import LabelEncoder
  from dice_ml.data_interfaces.base_data_interface import _BaseData
label_desc: Use image node_id 21 for calling the PrivateData obj's underlying member method code with example usage: obj.query_instance_to_df(query_instance) and returns: test