def get_root_node(cur):
    sql = """
        SELECT
          *
        FROM
          nodes
        WHERE
          parent IS NULL;
    """
    cur.execute(sql)
    result = cur.fetchone()

    if result is None:
        raise ValueError('No root node.')
    else:
        return NodeData(**result)
Strip comments from a json-with-comments string.
dataset/ETHPy150Open conceptsandtraining/libtree/libtree/core/query.py/get_root_node--crossover with--dataset/ETHPy150Open google/apis-client-generator/src/googleapis/codegen/utilities/json_with_comments.py/_StripComments