code: def uncompress_archives(file_names, temp_dir):
      
      result = []
      for filename in file_names:
          if filename.endswith(".tar") or filename.endswith(".tar.gz") or filename.endswith(".tar.bz2"):
              obj = tarfile.open(filename, "r")
              extracted_file_names = []
              for j, member in enumerate(obj.getmembers()):
                  obj.extract(member, temp_dir)
                  extracted_filename = os.path.join(temp_dir, obj.getnames()[j])
                  extracted_file_names.append(extracted_filename)
                  archives[extracted_filename] = filename
              result.extend(extracted_file_names[:])
          elif filename.endswith(".zip"):
              obj = zipfile.ZipFile(filename)
              extracted_file_names = []
              for j, info in enumerate(obj.infolist()):
                  obj.extract(info, path=temp_dir)
                  extracted_filename = os.path.join(temp_dir, obj.namelist()[j])
                  extracted_file_names.append(extracted_filename)
                  archives[extracted_filename] = filename
              result.extend(extracted_file_names[:])
          else:
              result.append(filename)
  
      return result
docs: Extract each archive from the list of filenames.
      Normal files stay untouched.
      Add all files to the Recent Files.
      :type file_names: list of str
      :type temp_dir: str
      :rtype: list of str