code: def reshape(self, data):
      index, columns, values, aggfunc = (
          self.cfg.get(p)
          for p in ["index", "columns", "values", "aggfunc"]
      )
      pivot_data = pd.pivot_table(
          data,
          values=values,
          index=index,
          columns=columns,
          aggfunc=aggfunc,
      )
      if len(values) == 1:
          pivot_data.columns = pivot_data.columns.droplevel(0)
      if self.cfg.get("columnNameHeaders", False):
          pivot_data.columns = flatten_columns(
              pivot_data, columns=columns
          )
      else:
          pivot_data.columns = flatten_columns(pivot_data)
      pivot_data = pivot_data.rename_axis(None, axis=1)
      return pivot_data
  
imports: import pandas
  from scipy import stats
  import dtale.global_state
  import dtale.pandas_util
  from dtale.query import run_query
  from dtale.utils import make_list
label_desc: Use image node_id 2 for calling the PivotBuilder obj's underlying member method code with example usage: obj.reshape(data) and returns: pivot_data