<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def elem_wrap(self, tree, debug=False, root_id=None):
 """takes a DGParentedTree and puts a nucleus or satellite on top, depending on the nuclearity of the root element of the tree. """

        if root_id is None:
            root_id = tree.root_id

        elem = self.elem_dict[root_id]
        if elem['nuclearity'] == 'nucleus':
            return n_wrap(tree, debug=debug, root_id=root_id)
        else:
            return s_wrap(tree, debug=debug, root_id=root_id)