<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_tree(profile, sha, recursive=True):
 """Fetch a tree. Args: profile A profile generated from ``simplygithub.authentication.profile``. Such profiles tell this module (i) the ``repo`` to connect to, and (ii) the ``token`` to connect with. sha The SHA of the tree to fetch. recursive If ``True``, traverse all subtrees and their subtrees, all the way down. That will return a list of all objects in the tree, all levels deep. Returns: A dict with data about the tree. """

    resource = "/trees/" + sha
    if recursive:
        resource += "?recursive=1"
    data = api.get_request(profile, resource)
    return prepare(data)