code: def validate_key(self, key):
          
          if not key:
              name = self.__class__.__name__
              msg = "%s response missing %s" % (name, self.key_name)
              raise ValidationException(msg, self)
          elif not isinstance(key, str):
              msg = "Response contains invalid %s type" % self.key_name
              raise ValidationException(msg, type(key))
docs: Called if the key_name class attribute is not None.