code: def validate_args(args):
      pytorch_translate_options.validate_generation_args(args)
  
      assert args.path is not None, "--path required for generation!"
      if args.source_binary_file != "":
          assert args.target_binary_file != ""
          assert os.path.isfile(args.source_binary_file)
          assert os.path.isfile(args.target_binary_file)
      else:
          assert all(
              (src_file and os.path.isfile(src_file))
              for src_file in args.source_text_file
          ), "Please specify a valid file for --source-text-file"
          assert args.target_text_file and os.path.isfile(
              args.target_text_file
          ), "Please specify a valid file for --target-text-file"
  
imports: import argparse
  import collections
  import os
  import pickle
  from typing import List, NamedTuple, Optional
  import numpy
  import torch
  from fairseq import data, iterative_refinement_generator, options, progress_bar, tasks, utils
  from fairseq.meters import StopwatchMeter, TimeMeter
  from fairseq.models import FairseqEncoderDecoderModel, FairseqMultiModel
  from fairseq.scoring import bleu
  from pytorch_translate import beam_decode, char_aware_hybrid, char_source_hybrid, char_source_model, char_source_transformer_model, hybrid_transformer_rnn, options, rnn, transformer, utils
  from pytorch_translate.constants import CHECKPOINT_PATHS_DELIMITER
  from pytorch_translate.data import data
  from pytorch_translate.dual_learning.dual_learning_models import DualLearningModel
  from pytorch_translate.research.beam_search import competing_completed
  from pytorch_translate.research.multisource import multisource_data, multisource_decode
  from pytorch_translate.tasks.pytorch_translate_multi_task import PyTorchTranslateMultiTask
  from pytorch_translate.tasks.pytorch_translate_task import PytorchTranslateTask
label_desc: Use image node_id 9 for calling a global function with example usage: validate_args(args) without return types