<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(cls, value, output=None, **kwargs):
 """Deserialize the HAL structure into the output value. :param value: Dict of already loaded json which will be deserialized by schema attributes. :param output: If present, the output object will be updated instead of returning the deserialized data. :returns: Dict of deserialized value for attributes. Where key is name of schema's attribute and value is deserialized value from value dict. :raises: ValidationError. """

        errors = []
        result = {}
        for attr in cls.__attrs__.values():
            try:
                result[attr.name] = attr.deserialize(value, **kwargs)
            except NotImplementedError:
                # Links don't support deserialization
                continue
            except ValueError as e:
                errors.append(exceptions.ValidationError(e, attr.name))
            except exceptions.ValidationError as e:
                e.attr = attr.name
                errors.append(e)
            except (KeyError, AttributeError):
                if attr.required:
                    errors.append(exceptions.ValidationError("Missing attribute.", attr.name))

        if errors:
            raise exceptions.ValidationError(errors)

        if output is None:
            return result
        for attr in cls.__attrs__.values():
            if attr.name in result:
                attr.accessor.set(output, result[attr.name])