code: def invalidate_value(
          cls,
          value: Any,
          exc: Type[Exception]=EncodingTypeError,
          msg: Optional[str]=None,
      ) -> None:
          
          raise exc(
              "Value `{rep}` of type {typ} cannot be encoded by {cls}{msg}".format(
                  rep=abbr(value),
                  typ=type(value),
                  cls=cls.__name__,
                  msg="" if msg is None else (": " + msg),
              )
          )
docs: Throws a standard exception for when a value is not encodable by an
          encoder.