code: def _make_examples_command(
      ref,
      reads_child,
      reads_parent1,
      reads_parent2,
      examples,
      sample_name_child,
      sample_name_parent1,
      sample_name_parent2,
      runtime_by_region_path,
      candidate_positions_path,
      extra_args,
      candidate_partition_mode=None,
      **kwargs,
  ):
      """Returns a make_examples command for subprocess.check_call.
  
      Args:
        ref: Input FASTA file.
        reads_child: Input BAM file for child.
        reads_parent1: Input BAM file for parent1.
        reads_parent2: Input BAM file for parent2.
        examples: Output tfrecord files suffix.
        sample_name_child: Sample name to use for child.
        sample_name_parent1: Sample name for parent1.
        sample_name_parent2: Sample name for parent2.
        runtime_by_region_path: Path for runtime statistics output.
        candidate_positions_path: Path to candidate positions file.
        extra_args: Comma-separated list of flag_name=flag_value.
        candidate_partition_mode: If set adds extra parameters to allow candidate
          partition.
        **kwargs: Additional arguments to pass in for make_examples.
  
      Returns:
        (string) A command to run.
      """
      command = [
          "time",
          "seq 0 {} |".format(_NUM_SHARDS.value - 1),
          "parallel -q --halt 2 --line-buffer",
          "/opt/deepvariant/bin/deeptrio/make_examples",
      ]
      if candidate_partition_mode == CandidatePartitionCommand.SWEEP:
          command.extend(["--mode", "candidate_sweep"])
      elif (
          candidate_partition_mode
          == CandidatePartitionCommand.CANDIDATE_PARTITION_INFERENCE
      ):
          command.extend(["--mode", "calling"])
      elif candidate_partition_mode is None:
          command.extend(["--mode", "calling"])
      else:
          raise ValueError("Invalid value of candidate_partition_mode.")
  
      command.extend(["--ref", '"{}"'.format(ref)])
      if _READS_PARENT1.value is not None:
          command.extend(
              ["--reads_parent1", '"{}"'.format(reads_parent1)]
          )
      if _READS_PARENT2.value is not None:
          command.extend(
              ["--reads_parent2", '"{}"'.format(reads_parent2)]
          )
      command.extend(["--reads", '"{}"'.format(reads_child)])
      command.extend(["--examples", '"{}"'.format(examples)])
      command.extend(
          ["--sample_name", '"{}"'.format(sample_name_child)]
      )
      if _SAMPLE_NAME_PARENT1.value is not None:
          command.extend(
              [
                  "--sample_name_parent1",
                  '"{}"'.format(sample_name_parent1),
              ]
          )
      if _SAMPLE_NAME_PARENT2.value is not None:
          command.extend(
              [
                  "--sample_name_parent2",
                  '"{}"'.format(sample_name_parent2),
              ]
          )
      special_args = {}
      special_args[
          "pileup_image_height_child"
      ] = DEEP_TRIO_WGS_PILEUP_HEIGHT_CHILD
      special_args[
          "pileup_image_height_parent"
      ] = DEEP_TRIO_WGS_PILEUP_HEIGHT_PARENT
  
      if runtime_by_region_path is not None:
          command.extend(
              [
                  "--runtime_by_region",
                  '"{}"'.format(runtime_by_region_path),
              ]
          )
  
      if _MODEL_TYPE.value == "PACBIO":
          special_args["pileup_image_width"] = 199
          special_args["realign_reads"] = False
          special_args["vsc_min_fraction_indels"] = 0.12
          special_args["alt_aligned_pileup"] = "diff_channels"
          special_args["add_hp_channel"] = True
          special_args["min_mapping_quality"] = 1
          special_args["track_ref_reads"] = True
          special_args[
              "pileup_image_height_child"
          ] = DEEP_TRIO_PACBIO_PILEUP_HEIGHT_CHILD
          special_args[
              "pileup_image_height_parent"
          ] = DEEP_TRIO_PACBIO_PILEUP_HEIGHT_PARENT
          special_args["phase_reads"] = True
          if (
              candidate_partition_mode
              != CandidatePartitionCommand.SWEEP
          ):
              special_args["partition_size"] = 25000
          special_args["sort_by_haplotypes"] = True
          special_args["parse_sam_aux_fields"] = True
          special_args["discard_non_dna_regions"] = True
          special_args["max_reads_for_dynamic_bases_per_region"] = 200
          kwargs = _update_kwargs_with_warning(kwargs, special_args)
  
      if _MODEL_TYPE.value == "ONT":
          special_args["pileup_image_width"] = 199
          special_args["realign_reads"] = False
          special_args["vsc_min_fraction_indels"] = 0.12
          special_args["alt_aligned_pileup"] = "diff_channels"
          special_args["add_hp_channel"] = True
          special_args["min_mapping_quality"] = 5
          special_args["track_ref_reads"] = True
          special_args[
              "pileup_image_height_child"
          ] = DEEP_TRIO_ONT_PILEUP_HEIGHT_CHILD
          special_args[
              "pileup_image_height_parent"
          ] = DEEP_TRIO_ONT_PILEUP_HEIGHT_PARENT
          special_args["phase_reads"] = True
          if (
              candidate_partition_mode
              != CandidatePartitionCommand.SWEEP
          ):
              special_args["partition_size"] = 25000
          special_args["sort_by_haplotypes"] = True
          special_args["parse_sam_aux_fields"] = True
          special_args["discard_non_dna_regions"] = True
          special_args["max_reads_for_dynamic_bases_per_region"] = 200
          special_args["max_reads_per_partition"] = 500
          kwargs = _update_kwargs_with_warning(kwargs, special_args)
  
      if _MODEL_TYPE.value == "WES":
          special_args[
              "pileup_image_height_child"
          ] = DEEP_TRIO_WES_PILEUP_HEIGHT_CHILD
          special_args[
              "pileup_image_height_parent"
          ] = DEEP_TRIO_WES_PILEUP_HEIGHT_PARENT
          special_args["channels"] = "insert_size"
  
      if _MODEL_TYPE.value == "WGS":
          special_args["channels"] = "insert_size"
  
      if candidate_partition_mode == CandidatePartitionCommand.SWEEP:
          special_args[
              "partition_size"
          ] = 10000  # Should be approximately read
          # length to avoid having high
          # coverage intervals in multiple shards at a time
          special_args["candidate_positions"] = candidate_positions_path
  
      if (
          candidate_partition_mode
          == CandidatePartitionCommand.CANDIDATE_PARTITION_INFERENCE
      ):
          special_args["candidate_positions"] = candidate_positions_path
  
      if special_args:
          kwargs = _update_kwargs_with_warning(kwargs, special_args)
  
      # Extend the command with all items in kwargs and extra_args.
      kwargs = _update_kwargs_with_warning(
          kwargs, _extra_args_to_dict(extra_args)
      )
      command = _extend_command_by_args_dict(command, kwargs)
  
      command.extend(["--task {}"])
  
      if _LOGGING_DIR.value:
          log_filename = "make_examples.log"
          if (
              candidate_partition_mode
              == CandidatePartitionCommand.SWEEP
          ):
              log_filename = "make_examples_sweep.log"
          command.extend(
              [
                  "2>&1 | tee {}/{}".format(
                      _LOGGING_DIR.value, log_filename
                  )
              ]
          )
  
      return " ".join(command)
  
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 15 for calling a global function with example usage: _make_examples_command(ref, reads_child, reads_parent1, reads_parent2, examples, sample_name_child, sample_name_parent1, sample_name_parent2, runtime_by_region_path, candidate_positions_path, extra_args, candidate_partition_mode) and returns: str