code: def setattrdeep(obj, attr, val):
      'Set dotted attr (like "a.b.c") on obj to val.'
      attrs = attr.split('.')
  
      for a in attrs[:-1]:
          obj = getattr(obj, a)
      setattr(obj, attrs[-1], valf setattrdeep(obj, attr, val):
      'Set dotted attr (like "a.b.c") on obj to val.'
      attrs = attr.split('.')
  
      for a in attrs[:-1]:
          obj = getattr(obj, a)
      setattr(obj, attrs[-1], val)
docs: Set dotted attr (like "a.b.c") on obj to val.