@classmethod<EOL><INDENT>def _fill_instance_with_attributes(cls, instance, attributes):<DEDENT>
for attribute_name, attribute_value in attributes.items():<EOL><INDENT>attribute = instance.get_attribute_infos(attribute_name)<EOL>if attribute is None:<EOL><INDENT>Printer.raise_error("<STR_LIT>" % (attribute_name, instance.rest_name))<EOL><DEDENT>try:<EOL><INDENT>if attribute.attribute_type is bool:<EOL><INDENT>value = cls._parse_bool(attribute_value)<EOL><DEDENT>else:<EOL><INDENT>value = attribute.attribute_type(attribute_value)<EOL><DEDENT>setattr(instance, attribute_name, value)<EOL><DEDENT>except Exception as e:<EOL><INDENT>Printer.raise_error("<STR_LIT>" % (attribute_name, attribute_value, e))<EOL><DEDENT><DEDENT>
Fill the given instance with attributes

            Args:
                instance: the instance to fill
                attributes: the dictionary of attributes

            Returns:
                The instance filled or throw an exception