code: def keep_recent_datasets(max_dataset_history, info=None):
      
      history = settings.value('recent_recordings', [])
      if isinstance(history, str):
          history = [history]
  
      if info is not None and info.filename is not None:
          new_dataset = info.filename
  
          if new_dataset in history:
              lg.debug(new_dataset + ' already present, will be replaced')
              history.remove(new_dataset)
          if len(history) > max_dataset_history:
              lg.debug('Removing last dataset ' + history[-1])
              history.pop()
  
          lg.debug('Adding ' + new_dataset + ' to list of recent datasets')
          history.insert(0, new_dataset)
          settings.setValue('recent_recordings', history)
          return None
  
      else:
          return history
docs: Keep track of the most recent recordings.
  
      Parameters
      ----------
      max_dataset_history : int
          maximum number of datasets to remember
      info : str, optional TODO
          path to file
  
      Returns
      -------
      list of str
          paths to most recent datasets (only if you don't specify
          new_dataset)