code: def assemble_concatenated_meta(concated_meta_dfs, remove_all_metadata_fields):
      
      # Concatenate the concated_meta_dfs
      if remove_all_metadata_fields:
          for df in concated_meta_dfs:
              df.drop(df.columns, axis=1, inplace=True)
  
      all_concated_meta_df = pd.concat(concated_meta_dfs, axis=0)
  
      # Sanity check: the number of rows in all_concated_meta_df should correspond
      # to the sum of the number of rows in the input dfs
      n_rows = all_concated_meta_df.shape[0]
      logger.debug("all_concated_meta_df.shape[0]: {}".format(n_rows))
      n_rows_cumulative = sum([df.shape[0] for df in concated_meta_dfs])
      assert n_rows == n_rows_cumulative
  
      # Sort the index and columns
      all_concated_meta_df_sorted = all_concated_meta_df.sort_index(axis=0).sort_index(axis=1)
  
      return all_concated_meta_df_sorted
docs: Assemble the concatenated metadata dfs together. For example,
      if horizontally concatenating, the concatenated metadata dfs are the
      column metadata dfs. Both indices are sorted.
  
      Args:
          concated_meta_dfs (list of pandas dfs)
  
      Returns:
          all_concated_meta_df_sorted (pandas df)