<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(self, value, **kwargs):
 """Deserialize the amount. :param value: Amount in CURRENCYAMOUNT or {"currency": CURRENCY, "amount": AMOUNT} format. For example EUR35.50 or {"currency": "EUR", "amount": "35.50"} :return: A paylogic Amount object. :raises ValidationError: when amount can"t be deserialzied :raises ValidationError: when amount has more than 2 decimal places """

        if value is None:
            return None

        if isinstance(value, six.string_types):
            currency = value[:3]
            amount = value[3:]
        elif isinstance(value, dict):
            if set(value.keys()) != set(("currency", "amount")):
                raise ValueError("Amount object has to have currency and amount fields.")
            amount = value["amount"]
            currency = value["currency"]
        else:
            raise ValueError("Value cannot be parsed to Amount.")

        if currency not in self.currencies:
            raise ValueError(self.err_unknown_currency.format(currency=currency))

        try:
            amount = decimal.Decimal(amount).normalize()
        except decimal.InvalidOperation:
            raise ValueError(u"'{amount}' cannot be parsed to decimal.".format(amount=amount))

        if amount.as_tuple().exponent < - 2:
            raise ValueError(u"'{amount}' has more than 2 decimal places.".format(amount=amount))

        value = self.amount_class(currency=currency, amount=amount)
        return super(Amount, self).deserialize(value)