code: def do_reset_ids(concatenated_meta_df, data_df, concat_direction):
      
      if concat_direction == "horiz":
  
          # Make sure cids agree between data_df and concatenated_meta_df
          assert concatenated_meta_df.index.equals(data_df.columns), (
              "cids in concatenated_meta_df do not agree with cids in data_df.")
  
          # Reset cids in concatenated_meta_df
          reset_ids_in_meta_df(concatenated_meta_df)
  
          # Replace cids in data_df with the new ones from concatenated_meta_df
          # (just an array of unique integers, zero-indexed)
          data_df.columns = pd.Index(concatenated_meta_df.index.values)
  
      elif concat_direction == "vert":
  
          # Make sure rids agree between data_df and concatenated_meta_df
          assert concatenated_meta_df.index.equals(data_df.index), (
              "rids in concatenated_meta_df do not agree with rids in data_df.")
  
          # Reset rids in concatenated_meta_df
          reset_ids_in_meta_df(concatenated_meta_df)
  
          # Replace rids in data_df with the new ones from concatenated_meta_df
          # (just an array of unique integers, zero-indexed)
          data_df.index = pd.Index(concatenated_meta_df.index.values)
docs: Reset ids in concatenated metadata and data dfs to unique integers and
      save the old ids in a metadata column.
  
      Note that the dataframes are modified in-place.
  
      Args:
          concatenated_meta_df (pandas df)
          data_df (pandas df)
          concat_direction (string): 'horiz' or 'vert'
  
      Returns:
          None (dfs modified in-place)