code: def GetAttributes(self):
      
      for attribute_name, attribute_value in iter(self.__dict__.items()):
        # Not using startswith to improve performance.
        if attribute_name[0] == '_' or attribute_value is None:
          continue
  
        yield attribute_name, attribute_value
docs: Retrieves the attribute names and values.
  
      Attributes that are set to None are ignored.
  
      Yields:
        tuple[str, object]: attribute name and value.