def _pd_to_text(
      self,
      data: pd.DataFrame,
      add_time: bool = False,
      sort_by_time: bool = True,
  ) -> Sequence[str]:
    """Formats a dataframe into list of strings.

    Args:
      data: the dataframe to process
      add_time: whether to add time
      sort_by_time: whether to sort by time

    Returns:
      A list of strings, one for each memory
    """
    if sort_by_time:
      data = data.sort_values('time', ascending=True)

    if add_time and not data.empty:
      if self._interval:
        this_time = data['time']
        next_time = data['time'] + self._interval

        interval = this_time.dt.strftime(
            '%d %b %Y [%H:%M:%S  '
        ) + next_time.dt.strftime('- %H:%M:%S]: ')
        output = interval + data['text']
      else:
        output = data['time'].dt.strftime('[%d %b %Y %H:%M:%S] ') + data['text']
    else:
      output = data['text']

    return output.tolist()
Formats a dataframe into list of strings.

    Args:
      data: the dataframe to process
      add_time: whether to add time
      sort_by_time: whether to sort by time

    Returns:
      A list of strings, one for each memory
    
concordia/associative_memory/deprecated/associative_memory.py