code: def register_decoder(name):
      """Encoder register that can be used to add new encoder class."""
  
      def register_decoder_cls(cls):
          if name in str2dec:
              raise ValueError(
                  "Cannot register duplicate decoder ({})".format(name)
              )
          if not issubclass(cls, DecoderBase):
              raise ValueError(
                  f"decoder ({name}: {cls.__name_}) must extend DecoderBase"
              )
          str2dec[name] = cls
          __all__.append(cls.__name__)  # added to be complete
          return cls
  
      return register_decoder_cls
  
imports: import os
  import importlib
  from onmt.decoders.decoder import DecoderBase, InputFeedRNNDecoder, StdRNNDecoder
  from onmt.decoders.transformer import TransformerDecoder, TransformerLMDecoder
  from onmt.decoders.cnn_decoder import CNNDecoder
label_desc: Use image node_id 2 for calling a global function with example usage: register_decoder(name) and returns: register_decoder_cls, cls