def i_chain2(trees, iterator_type=Tree.ipreorder, mapping=None, tree_filter=None):
nrt = (trees if tree_filter is None<EOL>else filter(tree_filter, trees))<EOL>chain_it = chain.from_iterable(map(iterator_type, nrt))<EOL>return chain_it if mapping is None else map(mapping, chain_it)<EOL>
Returns a mapped iterator to a collection of trees
    Provides access to all the elements of all the trees
    in one iteration sequence.
    Parameters:
        trees: iterator or iterable of tree objects
        iterator_type: type of the iteration (segment, section, triplet...)
        mapping: optional function to apply to the iterator's target.
        tree_filter: optional top level filter on properties of tree objects.