<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_panes(pymux, variables):
 """ Display a list of all the panes. """

    w = pymux.arrangement.get_active_window()
    active_pane = w.active_pane

    result = []

    for i, p in enumerate(w.panes):
        process = p.process

        result.append('%i: [%sx%s] [history %s/%s] %s' % (
            i, process.sx, process.sy,
            min(pymux.history_limit, process.screen.line_offset + process.sy),
            pymux.history_limit,
            ('(active)' if p == active_pane else '')))

    # Display help in pane.
    result = '\n'.join(sorted(result))
    pymux.get_client_state().layout_manager.display_popup('list-keys', result)