<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def yank_pop(event):
 """ Rotate the kill ring, and yank the new top. Only works following yank or yank-pop. """

    buff = event.current_buffer
    doc_before_paste = buff.document_before_paste
    clipboard = event.cli.clipboard

    if doc_before_paste is not None:
        buff.document = doc_before_paste
        clipboard.rotate()
        buff.paste_clipboard_data(
            clipboard.get_data(), paste_mode=PasteMode.EMACS)