def get_attribute_dict(class_instance):
  """Gets a dict of attributeds of a class instance."""
  # first start by grabbing the Class items
  attribute_dict = dict((x, y)
                        for x, y in class_instance.__class__.__dict__.items()
                        if x[:2] != "__")
  # then update the class items with the instance items
  attribute_dict.update(class_instance.__dict__)
  return attribute_dict