code: def check_options_are_valid(
      options: deepvariant_pb2.MakeExamplesOptions,
      main_sample_index: int,
  ):
      """Checks that all the options chosen make sense together."""
  
      # Check arguments that apply to any mode.
      if not options.reference_filename:
          errors.log_and_raise(
              "ref argument is required.", errors.CommandLineError
          )
  
      if not options.examples_filename:
          errors.log_and_raise(
              "examples argument is required.", errors.CommandLineError
          )
      if options.n_cores != 1:
          errors.log_and_raise(
              "Currently only supports n_cores == 1 but got {}.".format(
                  options.n_cores
              ),
              errors.CommandLineError,
          )
  
      main_sample = options.sample_options[main_sample_index]
      if not main_sample.reads_filenames:
          errors.log_and_raise(
              "reads argument is required.", errors.CommandLineError
          )
  
      if make_examples_core.in_candidate_sweep_mode(options):
          # In candidate_sweep mode there is nothing to check here.
          pass
      elif make_examples_core.in_training_mode(options):
          if not options.truth_variants_filename:
              errors.log_and_raise(
                  "truth_variants is required when in training mode.",
                  errors.CommandLineError,
              )
          if not options.confident_regions_filename:
              if (
                  options.variant_caller
                  == deepvariant_pb2.MakeExamplesOptions.VCF_CANDIDATE_IMPORTER
              ):
                  logging.info(
                      "Note: --confident_regions is optional with "
                      "vcf_candidate_importer. "
                      "You did not specify --confident_regions, which means "
                      "examples will be generated for the whole region."
                  )
              else:
                  errors.log_and_raise(
                      "confident_regions is required when in training mode.",
                      errors.CommandLineError,
                  )
          if options.gvcf_filename:
              errors.log_and_raise(
                  "gvcf is not allowed in training mode.",
                  errors.CommandLineError,
              )
          if (
              options.variant_caller
              == deepvariant_pb2.MakeExamplesOptions.VCF_CANDIDATE_IMPORTER
              and main_sample.proposed_variants_filename
          ):
              errors.log_and_raise(
                  (
                      "--proposed_variants* should not be used with "
                      "vcf_candidate_importer in training mode. "
                      "Use --truth_variants to pass in the candidates "
                      "with correct labels for training."
                  ),
                  errors.CommandLineError,
              )
      else:
          # Check for argument issues specific to calling mode.
          for sample in options.sample_options:
              # If there are reads, there must be a sample name too.
              if sample.reads_filenames:
                  if (
                      sample.variant_caller_options.sample_name
                      == _UNKNOWN_SAMPLE
                  ):
                      errors.log_and_raise(
                          "sample_name must be specified for all samples in calling mode.",
                          errors.CommandLineError,
                      )
          if main_sample.variant_caller_options.gq_resolution < 1:
              errors.log_and_raise(
                  "gq_resolution must be a positive integer.",
                  errors.CommandLineError,
              )
  
          if options.truth_variants_filename:
              errors.log_and_raise(
                  "Do not specify --truth_variants in calling mode.",
                  errors.CommandLineError,
              )
  
          if (
              options.variant_caller
              == deepvariant_pb2.MakeExamplesOptions.VCF_CANDIDATE_IMPORTER
          ):
              if any(
                  o.proposed_variants_filename is None
                  for o in options.sample_options
              ):
                  errors.log_and_raise(
                      (
                          "--proposed_variants* is required with vcf_candidate_importer"
                          " in calling mode."
                      ),
                      errors.CommandLineError,
                  )
  
      multiplier = _VSC_MIN_FRACTION_MULTIPLIER.value
      if (multiplier <= 0 or multiplier > 1.0) and multiplier != float(
          "inf"
      ):
          errors.log_and_raise(
              "--vsc_min_fraction_multiplier must be within (0-1] interval, or set "
              "inf to only use candidates from the target sample. "
              "Currently set to: {}".format(multiplier),
              errors.CommandLineError,
          )
  
      total_pileup_height = sum(
          [sample.pileup_height for sample in options.sample_options]
      )
      # Height constraint for Slim InceptionV3 implementation.
      if total_pileup_height < 75 or total_pileup_height > 362:
          errors.log_and_raise(
              "Total pileup image heights must be between 75-362."
          )
  
file_path: deepvariant/deepvariant/make_examples_options.py
imports: import re
  from absl import flags
  from absl import logging
  from deepvariant import dv_constants
  from deepvariant import exclude_contigs
  from deepvariant import make_examples_core
  from deepvariant import pileup_image
  from deepvariant.protos import deepvariant_pb2
  from deepvariant.realigner import realigner
  from tensorflow.python.platform import gfile
  from third_party.nucleus.io import sharded_file_utils
  from third_party.nucleus.io.python import hts_verbose
  from third_party.nucleus.protos import reads_pb2
  from third_party.nucleus.util import errors
label_desc: Use image node_id 2 for calling a global function with example usage: check_options_are_valid(options, main_sample_index) without return types