<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_info(decision_tree, feature_names=None, **export_graphviz_kwargs):
 """ Convert DecisionTreeClassifier or DecisionTreeRegressor to an inspectable object. """

    return TreeInfo(
        criterion=decision_tree.criterion,
        tree=_get_root_node_info(decision_tree, feature_names),
        graphviz=tree2dot(decision_tree,
                          feature_names=feature_names,
                          **export_graphviz_kwargs),
        is_classification=isinstance(decision_tree, ClassifierMixin),
    )