def DeserializeAttributesFromJsonDict(json_dict, instance, attributes):
  """Sets a list of |attributes| in |instance| according to their value in
    |json_dict|.

  Args:
    json_dict: (dict) Dict containing values dumped by
               SerializeAttributesToJsonDict.
    instance: (object) instance to modify.
    attributes: ([str]) List of attributes to set.

  Raises:
    AttributeError if one of the attribute doesn't exist in |instance|.

  Returns:
    instance
  """
  for attr in attributes:
    getattr(instance, attr) # To raise AttributeError if attr doesn't exist.
    setattr(instance, attr, json_dict[attr])
  return instance