def _set_attributes_on_managed_object(self, managed_object, attributes):
for attribute_name, attribute_value in six.iteritems(attributes):<EOL><INDENT>object_type = managed_object._object_type<EOL>if self._attribute_policy.is_attribute_applicable_to_object_type(<EOL>attribute_name,<EOL>object_type):<EOL><INDENT>self._set_attribute_on_managed_object(<EOL>managed_object,<EOL>(attribute_name, attribute_value)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>name = object_type.name<EOL>raise exceptions.InvalidField(<EOL>"<STR_LIT>".format(<EOL>attribute_name,<EOL>'<STR_LIT>'.join([x.capitalize() for x in name.split('<STR_LIT:_>')])<EOL>)<EOL>)<EOL><DEDENT><DEDENT>
Given a kmip.pie object and a dictionary of attributes, attempt to set
the attribute values on the object.