def GetMaxLayer(docks, dock_direction):
    """
    This is an internal function which returns
    the highest layer inside the specified dock.

    :param `docks`: a list of :class:`AuiDockInfo`;
    :param `dock_direction`: the :class:`AuiDockInfo` docking direction to analyze.
    """
    max_layer = 0
    for dock in docks:
        if (dock.dock_direction == dock_direction and dock.dock_layer >
            max_layer and not dock.fixed):
            max_layer = dock.dock_layer
    return max_layer
