def manage_folder(self, group, folder=None):
        """Context manager to use when modifying the folder contents.

        You can use manager's :py:meth:`FolderManager.bail_out` classmethod to end and discard the
        changes done inside the with block. This context manager does not give the manager as a
        value to the with block so you have to import and use the :py:class:`FolderManager` class
        manually.

        Args:
            group: User group.
            folder: Which folder to manage. If None, top-level will be managed.
        Returns: Context-managed :py:class:`widgetastic_manageiq.FolderManager` instance
        """
        view = self.go_to_group(group)
        if folder is None:
            view.reports_tree.click_path("Top Level")
        else:
            view.reports_tree.click_path("Top Level", folder)
        try:
            yield view.manager
        except FolderManager._BailOut:
            view.manager.discard()
        except Exception:
            # In case of any exception, nothing will be saved
            view.manager.discard()
            raise  # And reraise the exception
        else:
            # If no exception happens, save!
            view.manager.commit()
            view.save_button.click()