code: def assemble_data(data_dfs, concat_direction):
      if concat_direction == "horiz":
          all_data_df = pd.concat(data_dfs, axis=1)
          n_cols = all_data_df.shape[1]
          logger.debug("all_data_df.shape[1]: {}".format(n_cols))
          n_cols_cumulative = sum([df.shape[1] for df in data_dfs])
          assert n_cols == n_cols_cumulative
      elif concat_direction == "vert":
          all_data_df = pd.concat(data_dfs, axis=0)
          n_rows = all_data_df.shape[0]
          logger.debug("all_data_df.shape[0]: {}".format(n_rows))
          n_rows_cumulative = sum([df.shape[0] for df in data_dfs])
          assert n_rows == n_rows_cumulative
      all_data_df_sorted = all_data_df.sort_index(axis=0).sort_index(axis=1)
      return all_data_df_sorted