class_docstr: Class for performing pipeline structure exploration.
  The class allows you to convert pipelines into a networkx graph and considers
  all possible paths from primary PipelineNode (or primary PipelineNodes) to root node. If at least
  one of the paths contains an invalid sequence of operations, the search performed
  by this class will detect it
class_docstr_tok: ["Class","for","performing","pipeline","structure","exploration",".","The","class","allows","you","to","convert","pipelines","into","a","networkx","graph","and","considers","all","possible","paths","from","primary","PipelineNode","(","or","primary","PipelineNodes",")","to","root","node",".","If","at","least","one","of","the","paths","contains","an","invalid","sequence","of","operations",",","the","search","performed","by","this","class","will","detect","it"]
docstr: Calculate binary masks for considering path in the graph.
  For example, branch
  UID 584fef54 -> UID 568984edr45 -> UID 4566895ef13
  
  Can be decomposed as follows (if tag_to_check is encoding):
  
      * operations_path:
      imputation -> encoding -> ridge
      Listing the names of the operations in the nodes
  
      * is_appropriate_operation:
      False -> True -> False
      Whether there is an operation with a matching tag in the node or not
  
      * is_independent_operation
      True -> False -> False
      Are there any operations in the branch that can process data without
      errors, even if they have not been previously processed by encoding,
      e.g.
docstr_tok: ["Calculate","binary","masks","for","considering","path","in","the","graph",".","For","example",",","branch","UID","584fef54","-",">","UID","568984edr45","-",">","UID","4566895ef13","Can","be","decomposed","as","follows","(","if","tag_to_check","is","encoding",")",":","*","operations_path",":","imputation","-",">","encoding","-",">","ridge","Listing","the","names","of","the","operations","in","the","nodes","*","is_appropriate_operation",":","False","-",">","True","-",">","False","Whether","there","is","an","operation","with","a","matching","tag","in","the","node","or","not","*","is_independent_operation","True","-",">","False","-",">","False","Are","there","any","operations","in","the","branch","that","can","process","data","without","errors",",","even","if","they","have","not","been","previously","processed","by","encoding",",","e.g","."]
code: def _calculate_binary_paths(
      graph: nx.Graph, path: list, tag_to_check: str
  ) -> Tuple[List[str], List[bool], List[bool]]:
      """
      Calculate binary masks for considering path in the graph.
      For example, branch
      UID 584fef54 -> UID 568984edr45 -> UID 4566895ef13
  
      Can be decomposed as follows (if tag_to_check is encoding):
  
          * operations_path:
          imputation -> encoding -> ridge
          Listing the names of the operations in the nodes
  
          * is_appropriate_operation:
          False -> True -> False
          Whether there is an operation with a matching tag in the node or not
  
          * is_independent_operation
          True -> False -> False
          Are there any operations in the branch that can process data without
          errors, even if they have not been previously processed by encoding,
          e.g.
      """
      ignore_tag = PipelineStructureExplorer._invariant_tags.get(
          tag_to_check
      )
  
      # List with names of operations in the branch
      operations_path = []
      # Is the operation contain desired tag or not
      is_appropriate_operation = []
      # Can operation ignore errors when processing data without applying "desired operation"
      # For example: "desired operation" is imputing. If considering operation can process
      # data with nans in can_be_ignored list "True" will be added
      is_independent_operation = []
      for node_id in path:
          current_node = graph.nodes.get(node_id)
  
          node_tags = current_node["operation"].tags
          if tag_to_check in node_tags:
              is_appropriate_operation.append(True)
          else:
              # Operation in the node is not wanted one
              is_appropriate_operation.append(False)
  
              if ignore_tag is not None:
                  if ignore_tag in node_tags:
                      is_independent_operation.append(True)
                  else:
                      is_independent_operation.append(False)
  
          operations_path.append(current_node["operation"])
  
      return (
          operations_path,
          is_appropriate_operation,
          is_independent_operation,
      )
  
file_path: FEDOT/fedot/preprocessing/structure.py
imports: from typing import Tuple, List, Dict, Any
  import networkx
  import numpy
  import pandas
  from golem.core.dag.convert import graph_structure_as_nx_graph
label_desc: Use image node_id 4 for calling the PipelineStructureExplorer obj's underlying member method code with example usage: obj._calculate_binary_paths(graph, path, tag_to_check) and returns: operations_path,  is_appropriate_operation,  is_independent_operation