code: def filter_matches_by_options(
      matches, options, groupby=False, commutative=False
  ):
      # If more than one option, than need to handle each for each input
      if len(options) > 1:
  
          def is_valid_match(match):
              if all(
                  [
                      column_filter(m, option, groupby)
                      for m, option in zip(match, options)
                  ],
              ):
                  return True
              else:
                  return False
  
      else:
  
          def is_valid_match(match):
              if all(
                  [column_filter(f, options[0], groupby) for f in match]
              ):
                  return True
              else:
                  return False
  
      valid_matches = set()
      for match in matches:
          if is_valid_match(match):
              valid_matches.add(match)
          elif commutative:
              for order in permutations(match):
                  if is_valid_match(order):
                      valid_matches.add(order)
                      break
  
      return sorted(
          valid_matches,
          key=lambda features: (
              [feature.unique_name() for feature in features]
          ),
      )
  
file_path: featuretools/featuretools/primitives/options_utils.py
imports: import logging
  import warnings
  from itertools import permutations
  from featuretools import primitives
  from featuretools.feature_base import IdentityFeature
label_desc: Use image node_id 10 for calling a global function with example usage: filter_matches_by_options(matches, options, groupby, commutative) and returns: sorted, True, False, True, False