code: def _primitive_to_columnsets(
      primitive: PrimitiveBase,
  ) -> List[List[ColumnSchema]]:
      column_sets = primitive.input_types
      assert column_sets is not None
      if not isinstance(column_sets[0], list):
          column_sets = [primitive.input_types]
  
      column_sets = cast(List[List[ColumnSchema]], column_sets)
  
      # Some primitives are commutative, yet have explicit versions of commutative pairs (eg. MultiplyNumericBoolean),
      # which would create multiple versions, so this resolved that.
      if primitive.commutative:
          existing = set()
          uniq_column_sets = []
          for column_set in column_sets:
              key = "_".join(sorted([x.__repr__() for x in column_set]))
              if key not in existing:
                  uniq_column_sets.append(column_set)
                  existing.add(key)
  
          column_sets = uniq_column_sets
  
      return column_sets
  
file_path: featuretools/featuretools/feature_discovery/feature_discovery.py
imports: import inspect
  from collections import defaultdict
  from itertools import combinations, permutations, product
  from typing import Iterable, List, Set, Tuple, Type, Union, cast
  from woodwork.column_schema import ColumnSchema
  from woodwork.logical_types import LogicalType
  from woodwork.table_schema import TableSchema
  from featuretools.feature_discovery.FeatureCollection import FeatureCollection
  from featuretools.feature_discovery.LiteFeature import LiteFeature
  from featuretools.feature_discovery.utils import column_schema_to_keys
  from featuretools.primitives.base.primitive_base import PrimitiveBase
  from featuretools.tests.testing_utils.generate_fake_dataframe import flatten_list
label_desc: Use image node_id 3 for calling a global function with example usage: _primitive_to_columnsets(primitive) and returns: column_sets