class_docstr: An AttrTree offers convenient, multi-level attribute access for
  collections of objects. AttrTree objects may also be combined
  together using the update method or merge classmethod. Here is an
  example of adding a ViewableElement to an AttrTree and accessing it:
  
  >>> t = AttrTree()
  >>> t.Example.Path = 1
  >>> t.Example.Path                             #doctest: +ELLIPSIS
  1
class_docstr_tok: ["An","AttrTree","offers","convenient",",","multi-level","attribute","access","for","collections","of","objects",".","AttrTree","objects","may","also","be","combined","together","using","the","update","method","or","merge","classmethod",".","Here","is","an","example","of","adding","a","ViewableElement","to","an","AttrTree","and","accessing","it",":",">",">",">","t","=","AttrTree","(",")",">",">",">","t.Example.Path","=","1",">",">",">","t.Example.Path","#","doctest",":","+ELLIPSIS","1"]
docstr: Set the given value at the supplied path where path is either
  a tuple of strings or a string in A.B.C format.
docstr_tok: ["Set","the","given","value","at","the","supplied","path","where","path","is","either","a","tuple","of","strings","or","a","string","in","A.B.C","format","."]
code: def set_path(self, path, val):
      """
      Set the given value at the supplied path where path is either
      a tuple of strings or a string in A.B.C format.
      """
      path = (
          tuple(path.split("."))
          if isinstance(path, str)
          else tuple(path)
      )
  
      disallowed = [
          p for p in path if not type(self)._sanitizer.allowable(p)
      ]
      if any(disallowed):
          raise Exception(
              "Attribute strings in path elements cannot be "
              "correctly escaped : %s"
              % ",".join(repr(el) for el in disallowed)
          )
      if len(path) > 1:
          attrtree = self.__getattr__(path[0])
          attrtree.set_path(path[1:], val)
      else:
          self.__setattr__(path[0], val)
  
imports: from .None import util
  from .pprint import PrettyPrinter
label_desc: Use image node_id 9 for calling the AttrTree obj's underlying member method code with example usage: obj.set_path(path, val) without return types