code: 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 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
docs: Deserialize a patch object.