<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def deserialize(serialized_material_description):
 # type: (dynamodb_types.BINARY_ATTRIBUTE) -> Dict[Text, Text] """Deserialize a serialized material description attribute into a material description dictionary. :param dict serialized_material_description: DynamoDB attribute value containing serialized material description. :returns: Material description dictionary :rtype: dict :raises InvalidMaterialDescriptionError: if malformed version :raises InvalidMaterialDescriptionVersionError: if unknown version is found """

    try:
        _raw_material_description = serialized_material_description[Tag.BINARY.dynamodb_tag]

        material_description_bytes = io.BytesIO(_raw_material_description)
        total_bytes = len(_raw_material_description)
    except (TypeError, KeyError):
        message = "Invalid material description"
        _LOGGER.exception(message)
        raise InvalidMaterialDescriptionError(message)
    # We don't currently do anything with the version, but do check to make sure it is the one we know about.
    _read_version(material_description_bytes)

    material_description = {}
    try:
        while material_description_bytes.tell() < total_bytes:
            name = to_str(decode_value(material_description_bytes))
            value = to_str(decode_value(material_description_bytes))
            material_description[name] = value
    except struct.error:
        message = "Invalid material description"
        _LOGGER.exception(message)
        raise InvalidMaterialDescriptionError(message)
    return material_description