menus.*: comprehensions, infix if/else, shortcut or

MenuPool.get_menus_by_attribute():
The value parameter shouldn't be None so the hasattr() call was dropped.
cms.utils.plugins: builtins and std library refactors

import iterative filter/filterfalse

requires_reload(): any()
downcast_plugins(): list comp

assign_plugins():
Moved invariant toolbar conditionals to top level. Pulled plugin placeholder_id
check loop into an all() inside a new disjoint_placeholders filter. The
build_plugin_tree query near the end was simplified since it can now accept an
iterable.

create_default_plugins():
    _can_add_plugin():
nested "partial" predicate extracted from both previous create_default_plugins
functions
    _create_default_plugins():
New recursive auxillary function that provides the core logic common to both
previous create_default_plugins functions. Nesting the function allows
parameter simplification since request and lang stay constant. The add_plugin()
call now provides parent plugins as the target keyword, simplifying the logic
and halving the save() method calls.
The continue statements inside the core placeholders loop were transformed into
declarative filters/generator expressions feeding the core placeholders
iteration.

create_default_children_plugins():
merged into create_default_plugins as a nested auxillary function

build_plugin_tree():
Reworked to do a groupby query and documentation added. Now also accepts an
iterable. Python3 requires partitioning roots and nonroots to sort on the
parent_id attribute. Sorting the nonroots allows grouping and guarantees the
children tuples are sorted.