def compose_dynamic_tree(src, target_tree_alias=None, parent_tree_item_alias=None, include_trees=None):
def result(sitetrees=src):<EOL><INDENT>if include_trees is not None:<EOL><INDENT>sitetrees = [tree for tree in sitetrees if tree.alias in include_trees]<EOL><DEDENT>return {<EOL>'<STR_LIT>': src,<EOL>'<STR_LIT>': sitetrees,<EOL>'<STR_LIT>': target_tree_alias,<EOL>'<STR_LIT>': parent_tree_item_alias}<EOL><DEDENT>if isinstance(src, six.string_types):<EOL><INDENT>try:<EOL><INDENT>module = import_app_sitetree_module(src)<EOL>return None if module is None else result(getattr(module, '<STR_LIT>', None))<EOL><DEDENT>except ImportError as e:<EOL><INDENT>if settings.DEBUG:<EOL><INDENT>warnings.warn('<STR_LIT>' % (src, e))<EOL><DEDENT>return None<EOL><DEDENT><DEDENT>return result()<EOL>
Returns a structure describing a dynamic sitetree.utils
    The structure can be built from various sources,

    :param str|iterable src: If a string is passed to `src`, it'll be treated as the name of an app,
        from where one want to import sitetrees definitions. `src` can be an iterable
        of tree definitions (see `sitetree.toolbox.tree()` and `item()` functions).

    :param str|unicode target_tree_alias: Static tree alias to attach items from dynamic trees to.

    :param str|unicode parent_tree_item_alias: Tree item alias from a static tree to attach items from dynamic trees to.

    :param list include_trees: Sitetree aliases to filter `src`.

    :rtype: dict