code: def _put(self, key_path, value, append=False):
      key_elt = key_path[0]
      if len(key_path) == 1:
          # if value to set does not exist, override
          # if they are both configs then merge
          # if not then override
          if (
              key_elt in self
              and isinstance(self[key_elt], ConfigTree)
              and isinstance(value, ConfigTree)
          ):
              if self.root:
                  new_value = ConfigTree.merge_configs(
                      ConfigTree(), self[key_elt], copy_trees=True
                  )
                  new_value = ConfigTree.merge_configs(
                      new_value, value, copy_trees=True
                  )
                  self._push_history(key_elt, new_value)
                  self[key_elt] = new_value
              else:
                  ConfigTree.merge_configs(self[key_elt], value)
          elif append:
              # If we have t=1
              # and we try to put t.a=5 then t is replaced by {a: 5}
              l_value = self.get(key_elt, None)
              if isinstance(l_value, ConfigValues):
                  l_value.tokens.append(value)
                  l_value.recompute()
              elif isinstance(l_value, ConfigTree) and isinstance(
                  value, ConfigValues
              ):
                  value.overriden_value = l_value
                  value.tokens.insert(0, l_value)
                  value.recompute()
                  value.parent = self
                  value.key = key_elt
                  self._push_history(key_elt, value)
                  self[key_elt] = value
              elif isinstance(l_value, list) and isinstance(
                  value, ConfigValues
              ):
                  self._push_history(key_elt, value)
                  value.overriden_value = l_value
                  value.parent = self
                  value.key = key_elt
                  self[key_elt] = value
              elif isinstance(l_value, list):
                  self[key_elt] = l_value + value
                  self._push_history(key_elt, l_value)
              elif l_value is None:
                  self._push_history(key_elt, value)
                  self[key_elt] = value
  
              else:
                  raise ConfigWrongTypeException(
                      "Cannot concatenate the list {key}: {value} to {prev_value} of {type}".format(
                          key=".".join(key_path),
                          value=value,
                          prev_value=l_value,
                          type=l_value.__class__.__name__,
                      )
                  )
          else:
              # if there was an override keep overide value
              if isinstance(value, ConfigValues):
                  value.parent = self
                  value.key = key_elt
                  value.overriden_value = self.get(key_elt, None)
              self._push_history(key_elt, value)
              self[key_elt] = value
      else:
          next_config_tree = super(ConfigTree, self).get(key_elt)
          if not isinstance(next_config_tree, ConfigTree):
              # create a new dictionary or overwrite a previous value
              next_config_tree = ConfigTree()
              self._push_history(key_elt, next_config_tree)
              self[key_elt] = next_config_tree
          next_config_tree._put(key_path[1:], value, append)
  
imports: from collections import OrderedDict
  from pyparsing import lineno
  from pyparsing import col
  import re
  import copy
  from .exceptions import ConfigException, ConfigWrongTypeException, ConfigMissingException
label_desc: Use image node_id 3 for calling the ConfigTree obj's underlying member method code with example usage: obj._put(key_path, value, append) without return types