<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_window():
 """Get IDA's top level window."""

    tform = idaapi.get_current_tform()

    # Required sometimes when closing IDBs and not IDA.
    if not tform:
        tform = idaapi.find_tform("Output window")

    widget = form_to_widget(tform)
    window = widget.window()
    return window