code: def build_code(self):
      index, columns, freq, agg = (
          self.cfg.get(p) for p in ["index", "columns", "freq", "agg"]
      )
      code = []
      if columns is not None:
          code.append(
              "df = df.set_index('{}')['{}'].resample('{}').{}()".format(
                  index, "', '".join(columns), freq, agg
              )
          )
      else:
          code.append(
              "df = df.set_index('{}').resample('{}').{}()".format(
                  index, freq, agg
              )
          )
      if not columns or len(columns) > 1:
          code.append(
              "df.columns = [' '.join([str(c) for c in col]).strip() for col in df.columns.values]"
          )
      return "\n".join(code)
  
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 3 for calling the ResampleBuilder obj's underlying member method code with example usage: obj.build_code() and returns: str