class_docstr: Base class for merging a number of OutputData from one or several parent nodes
  into a single InputData for the next level node in the computation graph.
  
  Main method of the interface is `merge` that delegates merge stages to other methods.
  Merge process can be customized for data types by overriding these methods, primarily:
  `merge_targets`, `preprocess_predicts`, `merge_predicts`, `postprocess_predicts'.
  
  :param outputs: list with OutputData from parent nodes for merging
class_docstr_tok: ["Base","class","for","merging","a","number","of","OutputData","from","one","or","several","parent","nodes","into","a","single","InputData","for","the","next","level","node","in","the","computation","graph",".","Main","method","of","the","interface","is","`","merge","`","that","delegates","merge","stages","to","other","methods",".","Merge","process","can","be","customized","for","data","types","by","overriding","these","methods",",","primarily",":","`","merge_targets","`",",","`","preprocess_predicts","`",",","`","merge_predicts","`",",","`","postprocess_predicts","'",".",":","param","outputs",":","list","with","OutputData","from","parent","nodes","for","merging"]
docstr: Returns first output with main target or (if there are
  no main targets) the output with priority secondary target. 
docstr_tok: ["Returns","first","output","with","main","target","or","(","if","there","are","no","main","targets",")","the","output","with","priority","secondary","target","."]
code: def find_main_output(outputs: List["OutputData"]) -> "OutputData":
      """Returns first output with main target or (if there are
      no main targets) the output with priority secondary target."""
      priority_output = next(
          (
              output
              for output in outputs
              if output.supplementary_data.is_main_target
          ),
          None,
      )
      if not priority_output:
          flow_lengths = [
              output.supplementary_data.data_flow_length
              for output in outputs
          ]
          i_priority_secondary = np.argmin(flow_lengths)
          priority_output = outputs[i_priority_secondary]
      return priority_output
  
imports: from typing import List, Iterable, Union, Optional
  import numpy
  from golem.core.log import default_log
  from golem.utilities.data_structures import are_same_length
  from fedot.core.data.array_utilities import find_common_elements, atleast_2d, atleast_4d, flatten_extra_dim
  from fedot.core.data.data import OutputData, InputData
  from fedot.core.data.merge.supplementary_data_merger import SupplementaryDataMerger
  from fedot.core.repository.dataset_types import DataTypesEnum
label_desc: Use image node_id 12 for calling the DataMerger obj's underlying member method code with example usage: obj.find_main_output(outputs) and returns: priority_output