nodes: 0, module; 1, function_definition; 2, function_name:assemble_concatenated_meta; 3, parameters; 4, block; 5, identifier:concated_meta_dfs; 6, identifier:remove_all_metadata_fields; 7, expression_statement; 8, comment:# Concatenate the concated_meta_dfs; 9, if_statement; 10, expression_statement; 11, comment:# Sanity check: the number of rows in all_concated_meta_df should correspond; 12, comment:# to the sum of the number of rows in the input dfs; 13, expression_statement; 14, expression_statement; 15, expression_statement; 16, assert_statement; 17, comment:# Sort the index and columns; 18, expression_statement; 19, return_statement; 20, comment:""" 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)
  
      """; 21, identifier:remove_all_metadata_fields; 22, block; 23, assignment; 24, assignment; 25, call; 26, assignment; 27, comparison_operator:n_rows == n_rows_cumulative; 28, assignment; 29, identifier:all_concated_meta_df_sorted; 30, for_statement; 31, identifier:all_concated_meta_df; 32, call; 33, identifier:n_rows; 34, subscript; 35, attribute; 36, argument_list; 37, identifier:n_rows_cumulative; 38, call; 39, identifier:n_rows; 40, identifier:n_rows_cumulative; 41, identifier:all_concated_meta_df_sorted; 42, call; 43, identifier:df; 44, identifier:concated_meta_dfs; 45, block; 46, attribute; 47, argument_list; 48, attribute; 49, integer:0; 50, identifier:logger; 51, identifier:debug; 52, call; 53, identifier:sum; 54, argument_list; 55, attribute; 56, argument_list; 57, expression_statement; 58, identifier:pd; 59, identifier:concat; 60, identifier:concated_meta_dfs; 61, keyword_argument; 62, identifier:all_concated_meta_df; 63, identifier:shape; 64, attribute; 65, argument_list; 66, list_comprehension; 67, call; 68, identifier:sort_index; 69, keyword_argument; 70, call; 71, identifier:axis; 72, integer:0; 73, string:"all_concated_meta_df.shape[0]: {}"; 74, identifier:format; 75, identifier:n_rows; 76, subscript; 77, for_in_clause; 78, attribute; 79, argument_list; 80, identifier:axis; 81, integer:1; 82, attribute; 83, argument_list; 84, attribute; 85, integer:0; 86, identifier:df; 87, identifier:concated_meta_dfs; 88, identifier:all_concated_meta_df; 89, identifier:sort_index; 90, keyword_argument; 91, identifier:df; 92, identifier:drop; 93, attribute; 94, keyword_argument; 95, keyword_argument; 96, identifier:df; 97, identifier:shape; 98, identifier:axis; 99, integer:0; 100, identifier:df; 101, identifier:columns; 102, identifier:axis; 103, integer:1; 104, identifier:inplace; 105, True
code: def assemble_concatenated_meta(concated_meta_dfs, remove_all_metadata_fields):
      """ 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)
  
      """
      # 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