<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_layout_hook(session, hook_name):
 """Set layout hooks to normalize layout. References: - tmuxp issue: https://github.com/tmux-python/tmuxp/issues/309 - tmux issue: https://github.com/tmux/tmux/issues/1106 tmux 2.6+ requires that the window be viewed with the client before select-layout adjustments can take effect. To handle this, this function creates temporary hook for this session to iterate through all windows and select the layout. In order for layout changes to take effect, a client must at the very least be attached to the window (not just the session). hook_name is provided to allow this to set to multiple scenarios, such as 'client-attached' (which the user attaches the session). You may also want 'after-switch-client' for cases where the user loads tmuxp sessions inside tmux since tmuxp offers to switch for them. Also, the hooks are set immediately unbind after they're invoked via -u. Parameters session : :class:`libtmux.session.Session` session to bind hook to hook_name : str hook name to bind to, e.g. 'client-attached' """

    cmd = ['set-hook', '-t', session.id, hook_name]
    hook_cmd = []
    for window in session.windows:
        # unfortunately, select-layout won't work unless
        # we've literally selected the window at least once
        # with the client
        hook_cmd.append('selectw -t {}'.format(window.id))
        # edit: removed -t, or else it won't respect main-pane-w/h
        hook_cmd.append('selectl'.format(window.id))
        hook_cmd.append('selectw -p'.format(window.id))

    # unset the hook immediately after executing
    hook_cmd.append(
        'set-hook -u -t {target_session} {hook_name}'.format(
            target_session=session.id, hook_name=hook_name
        )
    )

    # join the hook's commands with semicolons
    hook_cmd = '{}'.format('; '.join(hook_cmd))

    # append the hook command
    cmd.append(hook_cmd)

    # create the hook
    session.cmd(*cmd)