code: def check_arg_compatibility(args: argparse.Namespace):
      """
      Check if some arguments are incompatible with each other.
  
      :param args: Arguments as returned by argparse.
      """
  
      # Require at least one stopping criteria
      check_condition(
          any(
              (
                  args.max_samples,
                  args.max_updates,
                  args.max_seconds,
                  args.max_checkpoints,
                  args.max_num_epochs,
                  args.max_num_checkpoint_not_improved,
              )
          ),
          "Please specify at least one stopping criteria: --max-samples --max-updates --max-checkpoints "
          "--max-num-epochs --max-num-checkpoint-not-improved",
      )
  
      # Check and possibly adapt the parameters for source factors
      n_source_factors = len(args.validation_source_factors)
      if len(args.source_factors_combine) > 1:
          check_condition(
              n_source_factors == len(args.source_factors_combine),
              "The number of combination strategies for source "
              "factors does not match the number of source factors.",
          )
      else:
          # Length 1: expand the list to the appropriate length
          args.source_factors_combine = (
              args.source_factors_combine * n_source_factors
          )
      if len(args.source_factors_share_embedding) > 1:
          check_condition(
              n_source_factors
              == len(args.source_factors_share_embedding),
              "The number of vocabulary sharing flags for source "
              "factors does not match the number of source factors.",
          )
      else:
          # Length 1: expand the list to the appropriate length
          args.source_factors_share_embedding = (
              args.source_factors_share_embedding * n_source_factors
          )
  
      # Check and possibly adapt the parameters for target factors
      n_target_factors = len(args.validation_target_factors)
      if len(args.target_factors_combine) > 1:
          check_condition(
              n_target_factors == len(args.target_factors_combine),
              "The number of combination strategies for target "
              "factors does not match the number of target factors.",
          )
      else:
          # Length 1: expand the list to the appropriate length
          args.target_factors_combine = (
              args.target_factors_combine * n_target_factors
          )
      if len(args.target_factors_share_embedding) > 1:
          check_condition(
              n_target_factors
              == len(args.target_factors_share_embedding),
              "The number of vocabulary sharing flags for target "
              "factors does not match the number of target factors.",
          )
      else:
          # Length 1: expand the list to the appropriate length
          args.target_factors_share_embedding = (
              args.target_factors_share_embedding * n_target_factors
          )
  
      check_condition(
          not (args.amp and args.apex_amp),
          "Use either --amp (safer) or --apex-amp (faster).",
      )
  
      if args.dtype != C.DTYPE_FP32:
          logger.warning(
              "Specifying a non-float32 dtype to sockeye.train has no effect. For 16-bit or mixed precision "
              "training, use one of the following: --amp --apex-amp --deepspeed-fp16 --deepspeed-bf16"
          )
  
      if args.local_rank is not None:
          check_condition(
              not args.amp and not args.apex_amp,
              "DeepSpeed mode does not support --amp or --apex-amp. "
              "Use --deepspeed-fp16 or --deepspeed-bf16.",
          )
          check_condition(
              not (
                  args.learning_rate_scheduler_type
                  == C.LR_SCHEDULER_PLATEAU_REDUCE
                  and not args.no_reload_on_learning_rate_reduce
              ),
              "DeepSpeed mode does not support learning rate schedulers that reload checkpoints. Use a "
              "different --learning-rate-scheduler-type or specify --no-reload-on-learning-rate-reduce.",
          )
  
imports: from .None import initial_setup
  import argparse
  import gc
  import logging
  import os
  import shutil
  import sys
  import tempfile
  from typing import Any, cast, Callable, Optional, Dict, List, Tuple, Type
  import torch
  import torch.distributed
  import torch.distributed.elastic.multiprocessing.errors
  from .None import arguments
  from .None import checkpoint_decoder
  from .None import constants
  from .None import convert_deepspeed
  from .None import data_io
  from .None import encoder
  from .None import layers
  from .None import loss
  from .None import lr_scheduler
  from .None import model
  from .None import optimizers
  from .None import training
  from .None import transformer
  from .None import utils
  from .None import vocab
  from .config import Config
  from .log import setup_main_logger
  from .utils import check_condition
label_desc: Use image node_id 4 for calling a global function with example usage: check_arg_compatibility(args) without return types