code: def reshape(self, data):
      index, columns, freq, agg = (
          self.cfg.get(p) for p in ["index", "columns", "freq", "agg"]
      )
      t_data = data.set_index(index)
      if columns is not None:
          t_data = t_data[columns]
      t_data = getattr(t_data.resample(freq), agg)()
      if not columns or len(columns) > 1:
          t_data.columns = flatten_columns(t_data)
      t_data.index.name = "{}_{}".format(index, freq)
      t_data = t_data.reset_index()
      return t_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 ResampleBuilder obj's underlying member method code with example usage: obj.reshape(data) and returns: t_data