code: def trio_samples_from_flags(add_flags=True, flags_obj=None):
      """Collects sample-related options into a list of samples."""
      # Sample-specific options.
      child_sample_name = make_examples_core.assign_sample_name(
          sample_name_flag=SAMPLE_NAME_.value,
          reads_filenames=READS_.value,
      )
  
      parent1_sample_name = make_examples_core.assign_sample_name(
          sample_name_flag=SAMPLE_NAME_PARENT1_.value,
          reads_filenames=READS_PARENT1_.value,
      )
  
      parent2_sample_name = make_examples_core.assign_sample_name(
          sample_name_flag=SAMPLE_NAME_PARENT2_.value,
          reads_filenames=READS_PARENT2_.value,
      )
  
      parent1_options = deepvariant_pb2.SampleOptions(
          role="parent1",
          name=parent1_sample_name,
          variant_caller_options=make_examples_core.make_vc_options(
              sample_name=parent1_sample_name, flags_obj=flags_obj
          ),
          order=[0, 1, 2],
          pileup_height=dt_constants.PILEUP_DEFAULT_HEIGHT_PARENT,
          skip_output_generation=_SKIP_PARENT_CALLING.value,
      )
      child_options = deepvariant_pb2.SampleOptions(
          role="child",
          name=child_sample_name,
          variant_caller_options=make_examples_core.make_vc_options(
              sample_name=child_sample_name, flags_obj=flags_obj
          ),
          order=[0, 1, 2],
          pileup_height=dt_constants.PILEUP_DEFAULT_HEIGHT_CHILD,
      )
      parent2_options = deepvariant_pb2.SampleOptions(
          role="parent2",
          name=parent2_sample_name,
          variant_caller_options=make_examples_core.make_vc_options(
              sample_name=parent2_sample_name, flags_obj=flags_obj
          ),
          # Swap the two parents when calling on parent2.
          order=[2, 1, 0],
          pileup_height=dt_constants.PILEUP_DEFAULT_HEIGHT_PARENT,
          skip_output_generation=_SKIP_PARENT_CALLING.value,
      )
  
      # If --sample_name_to_train is not set, train on the child.
      # This is for backward compatibility.
      sample_role_to_train = "child"
  
      if add_flags:
          if READS_.value:
              child_options.reads_filenames.extend(
                  READS_.value.split(",")
              )
          if READS_PARENT1_.value:
              parent1_options.reads_filenames.extend(
                  READS_PARENT1_.value.split(",")
              )
          if READS_PARENT2_.value:
              parent2_options.reads_filenames.extend(
                  READS_PARENT2_.value.split(",")
              )
  
          if CANDIDATE_POSITIONS_.value:
              child_options.candidate_positions = (
                  CANDIDATE_POSITIONS_.value
              )
  
          if PROPOSED_VARIANTS_CHILD_.value:
              child_options.proposed_variants_filename = (
                  PROPOSED_VARIANTS_CHILD_.value
              )
          if PROPOSED_VARIANTS_PARENT1_.value:
              parent1_options.proposed_variants_filename = (
                  PROPOSED_VARIANTS_PARENT1_.value
              )
          if PROPOSED_VARIANTS_PARENT2_.value:
              parent2_options.proposed_variants_filename = (
                  PROPOSED_VARIANTS_PARENT2_.value
              )
  
          if DOWNSAMPLE_FRACTION_CHILD_.value != NO_DOWNSAMPLING:
              child_options.downsample_fraction = (
                  DOWNSAMPLE_FRACTION_CHILD_.value
              )
          if DOWNSAMPLE_FRACTION_PARENTS_.value != NO_DOWNSAMPLING:
              parent1_options.downsample_fraction = (
                  DOWNSAMPLE_FRACTION_PARENTS_.value
              )
              parent2_options.downsample_fraction = (
                  DOWNSAMPLE_FRACTION_PARENTS_.value
              )
  
          if PILEUP_IMAGE_HEIGHT_CHILD_.value:
              child_options.pileup_height = (
                  PILEUP_IMAGE_HEIGHT_CHILD_.value
              )
          if PILEUP_IMAGE_HEIGHT_PARENT_.value:
              parent1_options.pileup_height = (
                  parent2_options.pileup_height
              ) = PILEUP_IMAGE_HEIGHT_PARENT_.value
  
          if SAMPLE_NAME_TO_TRAIN_.value:
              if SAMPLE_NAME_TO_TRAIN_.value == SAMPLE_NAME_.value:
                  sample_role_to_train = child_options.role
              elif (
                  SAMPLE_NAME_TO_TRAIN_.value
                  == SAMPLE_NAME_PARENT1_.value
              ):
                  sample_role_to_train = parent1_options.role
              else:
                  errors.log_and_raise(
                      (
                          "--sample_name_to_train must match either --sample_name or "
                          "--sample_name_parent1, or it can be unset to default to "
                          "--sample_name."
                      ),
                      errors.CommandLineError,
                  )
  
      # Ordering here determines the default order of samples, and when a sample
      # above has a custom .order, then this is the list those indices refer to.
      samples_in_order = [
          parent1_options,
          child_options,
          parent2_options,
      ]
      return samples_in_order, sample_role_to_train
  
file_path: deepvariant/deeptrio/make_examples.py
imports: import os
  from absl import app
  from absl import flags
  from deeptrio import dt_constants
  from deepvariant import logging_level
  from deepvariant import make_examples_core
  from deepvariant import make_examples_options
  from deepvariant.protos import deepvariant_pb2
  from third_party.nucleus.io.python import hts_verbose
  from third_party.nucleus.util import errors
  from third_party.nucleus.util import proto_utils
label_desc: Use image node_id 1 for calling a global function with example usage: trio_samples_from_flags(add_flags, flags_obj) and returns: samples_in_order,  sample_role_to_train