code: def get_match_array(
      pipeline, dataset_properties, include=None, exclude=None
  ):
      sparse = dataset_properties.get("sparse")
      signed = dataset_properties.get("signed")
  
      # Duck typing, not sure if it's good...
      node_i_is_choice = []
      node_i_choices = []
      node_i_choices_names = []
      all_nodes = []
      for node_name, node in pipeline:
          all_nodes.append(node)
          is_choice = hasattr(node, "get_available_components")
          node_i_is_choice.append(is_choice)
  
          node_include = (
              include.get(node_name) if include is not None else None
          )
          node_exclude = (
              exclude.get(node_name) if exclude is not None else None
          )
  
          if is_choice:
              node_i_choices_names.append(
                  list(
                      node.get_available_components(
                          dataset_properties,
                          include=node_include,
                          exclude=node_exclude,
                      ).keys()
                  )
              )
              node_i_choices.append(
                  list(
                      node.get_available_components(
                          dataset_properties,
                          include=node_include,
                          exclude=node_exclude,
                      ).values()
                  )
              )
  
          else:
              node_i_choices.append([node])
  
      matches_dimensions = [len(choices) for choices in node_i_choices]
      # Start by allowing every combination of nodes. Go through all
      # combinations/pipelines and erase the illegal ones
      matches = np.ones(matches_dimensions, dtype=int)
  
      pipeline_idxs = [range(dim) for dim in matches_dimensions]
      for pipeline_instantiation_idxs in itertools.product(
          *pipeline_idxs
      ):
          pipeline_instantiation = [
              node_i_choices[i][idx]
              for i, idx in enumerate(pipeline_instantiation_idxs)
          ]
  
          data_is_sparse = sparse
          dataset_is_signed = signed
          for node in pipeline_instantiation:
              node_input = node.get_properties()["input"]
              node_output = node.get_properties()["output"]
  
              # First check if these two instantiations of this node can work
              # together. Do this in multiple if statements to maintain
              # readability
              if (
                  (data_is_sparse and SPARSE not in node_input)
                  or not data_is_sparse
                  and DENSE not in node_input
              ):
                  matches[pipeline_instantiation_idxs] = 0
                  break
              # No need to check if the node can handle SIGNED_DATA; this is
              # always assumed to be true
              elif (
                  not dataset_is_signed
                  and UNSIGNED_DATA not in node_input
              ):
                  matches[pipeline_instantiation_idxs] = 0
                  break
  
              if (
                  (
                      INPUT in node_output
                      and DENSE not in node_output
                      and SPARSE not in node_output
                  )
                  or PREDICTIONS in node_output
                  or (
                      not data_is_sparse
                      and DENSE in node_input
                      and DENSE in node_output
                  )
                  or (
                      data_is_sparse
                      and SPARSE in node_input
                      and SPARSE in node_output
                  )
              ):
                  # Don't change the data_is_sparse flag
                  pass
              elif data_is_sparse and DENSE in node_output:
                  data_is_sparse = False
              elif not data_is_sparse and SPARSE in node_output:
                  data_is_sparse = True
              else:
                  print(node)
                  print("Data is sparse", data_is_sparse)
                  print(node_input, node_output)
                  raise ValueError("This combination is not allowed!")
  
              if PREDICTIONS in node_output:
                  pass
              elif (
                  INPUT in node_output
                  and SIGNED_DATA not in node_output
                  and UNSIGNED_DATA not in node_output
              ):
                  pass
              elif SIGNED_DATA in node_output:
                  dataset_is_signed = True
              elif UNSIGNED_DATA in node_output:
                  dataset_is_signed = False
              else:
                  print(node)
                  print("Data is signed", dataset_is_signed)
                  print(node_input, node_output)
                  raise ValueError("This combination is not allowed!")
  
      return matches
  
imports: import itertools
  import numpy
  from ConfigSpace.forbidden import ForbiddenAndConjunction, ForbiddenEqualsClause
  from autosklearn.pipeline.constants import DENSE, INPUT, PREDICTIONS, SIGNED_DATA, SPARSE, UNSIGNED_DATA
label_desc: Use image node_id 1 for calling a global function with example usage: get_match_array(pipeline, dataset_properties, include, exclude) and returns: matches