docstr: Creates a Node from tree assuming the utterance is a concatenation of the
  tokens by whitespaces. The function does not necessarily reproduce the original
  utterance as extra whitespaces can be introduced.
docstr_tok: ["Creates","a","Node","from","tree","assuming","the","utterance","is","a","concatenation","of","the","tokens","by","whitespaces",".","The","function","does","not","necessarily","reproduce","the","original","utterance","as","extra","whitespaces","can","be","introduced","."]
code: def tree_to_metric_node(tree: Tree) -> Node:
      """
      Creates a Node from tree assuming the utterance is a concatenation of the
      tokens by whitespaces. The function does not necessarily reproduce the original
      utterance as extra whitespaces can be introduced.
      """
      return CompositionalMetricReporter.node_to_metrics_node(
          tree.root.children[0]
      )
  
imports: from typing import Dict, List, Set, Union
  from pytext.common.constants import BatchContext, DatasetFieldName, Stage
  from pytext.data import CommonMetadata
  from pytext.data.data_structures.annotation import Intent, REDUCE, SHIFT, Slot, Token, Tree, TreeBuilder
  from pytext.data.tensorizers import Tensorizer
  from pytext.data.tokenizers import Tokenizer
  from pytext.metrics.intent_slot_metrics import compute_all_metrics, FramePredictionPair, Node, Span
  from .channel import Channel, ConsoleChannel, FileChannel
  from .metric_reporter import MetricReporter
label_desc: Use image node_id 12 for calling the CompositionalMetricReporter obj's underlying member method code with example usage: obj.tree_to_metric_node(tree) and returns: CompositionalMetricReporter