<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def construct_optional_traversal_tree(complex_optional_roots, location_to_optional_roots):
 """Return a tree of complex optional root locations. Args: complex_optional_roots: list of @optional locations (location immmediately preceding an @optional Traverse) that expand vertex fields location_to_optional_roots: dict mapping from location -> optional_roots where location is within some number of @optionals and optional_roots is a list of optional root locations preceding the successive @optional scopes within which the location resides Returns: OptionalTraversalTree object representing the tree of complex optional roots """

    tree = OptionalTraversalTree(complex_optional_roots)
    for optional_root_locations_stack in six.itervalues(location_to_optional_roots):
        tree.insert(list(optional_root_locations_stack))

    return tree