code: def create_all_commands(intermediate_results_dir):
      """Creates commands for all stages to be executed later."""
      check_flags()
      commands = []
      post_process_commands = []
      report_commands = []
  
      # make_examples
      nonvariant_site_tfrecord_path = None
      if _OUTPUT_GVCF_CHILD.value is not None:
          nonvariant_site_tfrecord_path = "{}.{}".format(
              nonvariant_site_tfrecord_common_suffix(
                  intermediate_results_dir
              ),
              examples_common_suffix(_NUM_SHARDS.value),
          )
  
      if _LOGGING_DIR.value and _RUNTIME_REPORT.value:
          runtime_directory = os.path.join(
              _LOGGING_DIR.value, "make_examples_runtime_by_region"
          )
          if not os.path.isdir(runtime_directory):
              logging.info(
                  "Creating a make_examples runtime by region directory in %s",
                  runtime_directory,
              )
              os.makedirs(runtime_directory)
          # The path to runtime metrics output is sharded just like the examples.
          runtime_by_region_path = os.path.join(
              runtime_directory,
              "make_examples_runtime@{}.tsv".format(_NUM_SHARDS.value),
          )
      else:
          runtime_by_region_path = None
  
      # If _USE_CANDIDATE_PARTITION is set add a call to make_examples to generate
      # candidates.
      # If _USE_CANDIDATE_PARTITION is set we generate two make_examples commands.
      # The first one to generate candidate_positions. The second command is for
      # generating DeepVariant examples. _USE_CANDIDATE_PARTITION is an option that
      # helps to better distribute the work between shards.
  
      candidate_partition_modes = [None]
      # In DeepTrio PacBio and ONT mode, we always enable use_candidate_partition
      # because otherwise it can run out of memory.
      use_candidate_partition = False
      if _USE_CANDIDATE_PARTITION.value or _MODEL_TYPE.value in [
          "PACBIO",
          "ONT",
      ]:
          use_candidate_partition = True
          candidate_partition_modes = [
              CandidatePartitionCommand.SWEEP,
              CandidatePartitionCommand.CANDIDATE_PARTITION_INFERENCE,
          ]
  
      for candidate_partition_mode in candidate_partition_modes:
          commands.append(
              _make_examples_command(
                  _REF.value,
                  _READS_CHILD.value,
                  _READS_PARENT1.value,
                  _READS_PARENT2.value,
                  examples_common_name(
                      intermediate_results_dir, _NUM_SHARDS.value
                  ),
                  _SAMPLE_NAME_CHILD.value,
                  _SAMPLE_NAME_PARENT1.value,
                  _SAMPLE_NAME_PARENT2.value,
                  runtime_by_region_path=runtime_by_region_path,
                  extra_args=_MAKE_EXAMPLES_EXTRA_ARGS.value,
                  candidate_positions_path=_candidate_positions_common_name(
                      intermediate_results_dir, _NUM_SHARDS.value
                  ),
                  candidate_partition_mode=candidate_partition_mode
                  if use_candidate_partition
                  else None,
                  # kwargs:
                  gvcf=nonvariant_site_tfrecord_path,
                  regions=_REGIONS.value,
              )
          )
  
      # Calling variants for child sample
      model_ckpt = get_model_ckpt(
          _MODEL_TYPE.value + "_child", _CUSTOMIZED_MODEL_CHILD.value
      )
      commands.append(
          generate_call_variants_command(
              CHILD, model_ckpt, intermediate_results_dir
          )
      )
  
      # Calling variants for parent1 sample
      model_ckpt = get_model_ckpt(
          _MODEL_TYPE.value + "_parent", _CUSTOMIZED_MODEL_PARENT.value
      )
      if _READS_PARENT1.value is not None:
          commands.append(
              generate_call_variants_command(
                  PARENT1, model_ckpt, intermediate_results_dir
              )
          )
      if _READS_PARENT2.value is not None:
          commands.append(
              generate_call_variants_command(
                  PARENT2, model_ckpt, intermediate_results_dir
              )
          )
  
      # postprocess_variants for child
      post_process_commands.append(
          generate_postprocess_variants_command(
              CHILD,
              intermediate_results_dir,
              _OUTPUT_VCF_CHILD.value,
              _OUTPUT_GVCF_CHILD.value,
          )
      )
      if _VCF_STATS_REPORT.value:
          report_commands.append(
              vcf_stats_report_command(vcf_path=_OUTPUT_VCF_CHILD.value)
          )
  
      if _READS_PARENT1.value is not None:
          post_process_commands.append(
              generate_postprocess_variants_command(
                  PARENT1,
                  intermediate_results_dir,
                  _OUTPUT_VCF_PARENT1.value,
                  _OUTPUT_GVCF_PARENT1.value,
              )
          )
          if _VCF_STATS_REPORT.value:
              report_commands.append(
                  vcf_stats_report_command(
                      vcf_path=_OUTPUT_VCF_PARENT1.value
                  )
              )
  
      if _READS_PARENT2.value is not None:
          post_process_commands.append(
              generate_postprocess_variants_command(
                  PARENT2,
                  intermediate_results_dir,
                  _OUTPUT_VCF_PARENT2.value,
                  _OUTPUT_GVCF_PARENT2.value,
              )
          )
          if _VCF_STATS_REPORT.value:
              report_commands.append(
                  vcf_stats_report_command(
                      vcf_path=_OUTPUT_VCF_PARENT2.value
                  )
              )
  
      # runtime-by-region
      if _LOGGING_DIR.value and _RUNTIME_REPORT.value:
          report_commands.append(
              runtime_by_region_vis_command(runtime_by_region_path)
          )
  
      return commands, post_process_commands, report_commands
  
imports: import enum
  import os
  import subprocess
  import sys
  import tempfile
  from typing import List, Optional
  from absl import app
  from absl import flags
  from absl import logging
  import tensorflow
label_desc: Use image node_id 26 for calling a global function with example usage: create_all_commands(intermediate_results_dir) and returns: commands,  post_process_commands,  report_commands