class_docstr: Checker with methods for validate data related options.
code: def _validate_language_model_compatibilities_opts(cls, opt):
      if opt.model_task != ModelTask.LANGUAGE_MODEL:
          return
  
      logger.info("encoder is not used for LM task")
  
      assert opt.share_vocab and (
          opt.tgt_vocab is None
      ), "vocab must be shared for LM task"
  
      assert (
          opt.decoder_type == "transformer"
      ), "Only transformer decoder is supported for LM task"
  
imports: import configargparse
  import os
  import torch
  import onmt.opts
  from onmt.utils.logging import logger
  from onmt.constants import CorpusName, ModelTask
  from onmt.transforms import AVAILABLE_TRANSFORMS
label_desc: Use image node_id 7 for calling the DataOptsCheckerMixin obj's underlying member method code with example usage: obj._validate_language_model_compatibilities_opts(cls, opt) without return types