<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def gather_data(self):
 """ Gather data about files which may be recovered. The data is stored in self.data as a list of tuples with the data pertaining to the original file and the autosave file. Each element of the tuple is a dict as returned by gather_file_data(). """

        self.data = []
        try:
            FileNotFoundError
        except NameError:  # Python 2
            FileNotFoundError = OSError
        # In Python 3, easier to use os.scandir()
        try:
            for name in os.listdir(self.autosave_dir):
                full_name = osp.join(self.autosave_dir, name)
                if osp.isdir(full_name):
                    continue
                for orig, autosave in self.autosave_mapping.items():
                    if autosave == full_name:
                        orig_dict = gather_file_data(orig)
                        break
                else:
                    orig_dict = None
                autosave_dict = gather_file_data(full_name)
                self.data.append((orig_dict, autosave_dict))
        except FileNotFoundError:  # autosave dir does not exist
            pass
        self.data.sort(key=recovery_data_key_function)
        self.num_enabled = len(self.data)