<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(ident_hash, baked=False):
 """Return a tree structure of the Collection"""

    id, version = get_id_n_version(ident_hash)

    stmt = _get_sql('get-tree.sql')
    args = dict(id=id, version=version, baked=baked)

    with db_connect() as db_conn:
        with db_conn.cursor() as cursor:
            cursor.execute(stmt, args)
            try:
                tree = cursor.fetchone()[0]
            except TypeError:
                raise NotFound(ident_hash)
    if tree is None:
        raise NotFound(ident_hash)

    return tree