code: def deepgetattr(obj, name, default=_UNSPECIFIED):
      
      try:
          if '.' in name:
              attr, subname = name.split('.', 1)
              return deepgetattr(getattr(obj, attr), subname, default)
          else:
              return getattr(obj, name)
      except AttributeError:
          if default is _UNSPECIFIED:
              raise
          else:
              return default
docs: Try to retrieve the given attribute of an object, digging on '.'.
  
      This is an extended getattr, digging deeper if '.' is found.
  
      Args:
          obj (object): the object of which an attribute should be read
          name (str): the name of an attribute to look up.
          default (object): the default value to use if the attribute wasn't found
  
      Returns:
          the attribute pointed to by 'name', splitting on '.'.
  
      Raises:
          AttributeError: if obj has no 'name' attribute.