class_docstr: Checker with methods for validate data related options.
docstr: Check options relate to vocab.
docstr_tok: ["Check","options","relate","to","vocab","."]
code: def _validate_vocab_opts(cls, opt, build_vocab_only=False):
      """Check options relate to vocab."""
  
      if build_vocab_only:
          if not opt.share_vocab:
              assert (
                  opt.tgt_vocab
              ), "-tgt_vocab is required if not -share_vocab."
          return
      # validation when train:
      cls._validate_file(opt.src_vocab, info="src vocab")
      if not opt.share_vocab:
          cls._validate_file(opt.tgt_vocab, info="tgt vocab")
  
      if opt.dump_transforms:
          assert (
              opt.save_data
          ), "-save_data should be set if set \
                  -dump_transforms."
      # Check embeddings stuff
      if opt.both_embeddings is not None:
          assert (
              opt.src_embeddings is None and opt.tgt_embeddings is None
          ), "You don't need -src_embeddings or -tgt_embeddings \
                  if -both_embeddings is set."
  
      if any(
          [
              opt.both_embeddings is not None,
              opt.src_embeddings is not None,
              opt.tgt_embeddings is not None,
          ]
      ):
          assert (
              opt.embeddings_type is not None
          ), "You need to specify an -embedding_type!"
          assert (
              opt.save_data
          ), "-save_data should be set if use \
                  pretrained embeddings."
  
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 6 for calling the DataOptsCheckerMixin obj's underlying member method code with example usage: obj._validate_vocab_opts(cls, opt, build_vocab_only) without return types