docstr: The method for OutputData from multiple parent nodes prepares a field
  with encoded values. This allows distinguishing the source ancestor to
  which the data was attached.
  
  For example, a mask for two ancestors, each giving predictions
  in the form of tabular data with two columns will look like this:
  {'input_ids': [0, 0, 1, 1], 'flow_lens': [2, 2, 1, 1]}
  
  Similarly, for images the mask will specify where the channels came from.
  Mask for two images (1st with 2 channels and the 2nd with 3) will look like:
  {'input_ids': [0, 0, 1, 1, 1], 'flow_lens': [1, 1, 3, 3, 3]}
  
  :return features_mask: dict with mask for features/channels.
  A composite ID of two lists is used:
      - index of parent operation
      - dataflow length (number of nodes that data visited)
docstr_tok: ["The","method","for","OutputData","from","multiple","parent","nodes","prepares","a","field","with","encoded","values",".","This","allows","distinguishing","the","source","ancestor","to","which","the","data","was","attached",".","For","example",",","a","mask","for","two","ancestors",",","each","giving","predictions","in","the","form","of","tabular","data","with","two","columns","will","look","like","this",":","{","'input_ids","'",":","[","0",",","0",",","1",",","1","]",",","'flow_lens","'",":","[","2",",","2",",","1",",","1","]","}","Similarly",",","for","images","the","mask","will","specify","where","the","channels","came","from",".","Mask","for","two","images","(","1st","with","2","channels","and","the","2nd","with","3",")","will","look","like",":","{","'input_ids","'",":","[","0",",","0",",","1",",","1",",","1","]",",","'flow_lens","'",":","[","1",",","1",",","3",",","3",",","3","]","}",":","return","features_mask",":","dict","with","mask","for","features\/channels",".","A","composite","ID","of","two","lists","is","used",":","-","index","of","parent","operation","-","dataflow","length","(","number","of","nodes","that","data","visited",")"]
code: def prepare_parent_mask(self) -> Dict:
      """The method for OutputData from multiple parent nodes prepares a field
      with encoded values. This allows distinguishing the source ancestor to
      which the data was attached.
  
      For example, a mask for two ancestors, each giving predictions
      in the form of tabular data with two columns will look like this:
      {'input_ids': [0, 0, 1, 1], 'flow_lens': [2, 2, 1, 1]}
  
      Similarly, for images the mask will specify where the channels came from.
      Mask for two images (1st with 2 channels and the 2nd with 3) will look like:
      {'input_ids': [0, 0, 1, 1, 1], 'flow_lens': [1, 1, 3, 3, 3]}
  
      :return features_mask: dict with mask for features/channels.
      A composite ID of two lists is used:
          - index of parent operation
          - dataflow length (number of nodes that data visited)
      """
      input_ids = []
      flow_lens = []
      for input_id, output in enumerate(self.outputs):
          # Get number of features (for tables and series) or channels (for images)
          table_shape = output.predict.shape
          if len(table_shape) > 1:
              num_features = table_shape[-1]  # we need last dimension
          else:
              num_features = 1
  
          # Each index specifies the source of the feature
          id_mask = [input_id] * num_features
          input_ids.extend(id_mask)
  
          # Keep dataflow length for each feature separately
          flow_mask = [
              output.supplementary_data.data_flow_length
          ] * num_features
          flow_lens.extend(flow_mask)
  
      features_mask = {"input_ids": input_ids, "flow_lens": flow_lens}
      return features_mask
  
file_path: FEDOT/fedot/core/data/merge/supplementary_data_merger.py
imports: from typing import Dict, List
  import numpy
  from golem.core.log import default_log
  from fedot.core.data.data import OutputData
  from fedot.core.data.supplementary_data import SupplementaryData
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.preprocessing.data_types import TableTypesCorrector
label_desc: Use image node_id 5 for calling the SupplementaryDataMerger obj's underlying member method code with example usage: obj.prepare_parent_mask() and returns: features_mask