class_docstr: IODescriptor describes the input/output data format of an InferenceAPI defined
  in a :code:`bentoml.Service`. This is an abstract base class for extending new HTTP
  endpoint IO descriptor types in BentoServer.
class_docstr_tok: ["IODescriptor","describes","the","input\/output","data","format","of","an","InferenceAPI","defined","in","a",":","code",":","`","bentoml.Service","`",".","This","is","an","abstract","base","class","for","extending","new","HTTP","endpoint","IO","descriptor","types","in","BentoServer","."]
code: def __init_subclass__(
      cls,
      *,
      descriptor_id: str | None = None,
      proto_fields: tuple[ProtoField] | None = None,
  ):
      if descriptor_id is not None:
          if descriptor_id in IO_DESCRIPTOR_REGISTRY:
              raise ValueError(
                  f"Descriptor ID {descriptor_id} already registered to {IO_DESCRIPTOR_REGISTRY[descriptor_id]}."
              )
          IO_DESCRIPTOR_REGISTRY[descriptor_id] = cls
      cls.descriptor_id = descriptor_id
      cls.proto_fields = proto_fields or t.cast("tuple[ProtoField]", ())
  
      cls._sample: IOType | None = None
  
      def _() -> F:
          def impl(
              cl_: type[IODescriptor[t.Any]],
              sample: t.Any,
              **kwargs: t.Any,
          ) -> IODescriptor[t.Any]:
              klass = cl_(**kwargs)
              klass.sample = klass._from_sample(sample)
              return klass
  
          impl.__doc__ = cls._from_sample.__doc__
          return update_wrapper(impl, cls._from_sample)
  
      cls.from_sample = classmethod(_())
  
imports: from __future__ import annotations
  import typing
  from abc import ABC
  from abc import abstractmethod
  from functools import update_wrapper
  from ...exceptions import InvalidArgument
label_desc: Use image node_id 1 for calling the IODescriptor obj's underlying member method code with example usage: obj.__init_subclass__(cls) and returns: update_wrapper, klass