class_docstr: A data structure to represent a parse tree
class_docstr_tok: ["A","data","structure","to","represent","a","parse","tree"]
docstr: Copies the tree with some labels replaced.
  
  Labels in the map are replaced with the mapped value.
  Labels not in the map are unchanged.
docstr_tok: ["Copies","the","tree","with","some","labels","replaced",".","Labels","in","the","map","are","replaced","with","the","mapped","value",".","Labels","not","in","the","map","are","unchanged","."]
code: def remap_constituent_labels(self, label_map):
      """
      Copies the tree with some labels replaced.
  
      Labels in the map are replaced with the mapped value.
      Labels not in the map are unchanged.
      """
      if self.is_leaf():
          return Tree(self.label)
      if self.is_preterminal():
          return Tree(self.label, Tree(self.children[0].label))
      new_label = label_map.get(self.label, self.label)
      return Tree(
          new_label,
          [
              child.remap_constituent_labels(label_map)
              for child in self.children
          ],
      )
  
imports: from collections import deque, Counter
  from enum import Enum
  from io import StringIO
  import itertools
  import re
  import warnings
  from stanza.models.common.stanza_object import StanzaObject
label_desc: Use image node_id 24 for calling the Tree obj's underlying member method code with example usage: obj.remap_constituent_labels(label_map) and returns: Tree, Tree, Tree