<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def load(istream, strict=True):
    "Deserialize a patch object."
    try:
        diff = json.load(istream)
        if strict:
            jsonschema.validate(diff, SCHEMA)
    except ValueError:
        raise InvalidPatchError('patch is not valid JSON')

    except jsonschema.exceptions.ValidationError as e:
        raise InvalidPatchError(e.message)

    return diff