code: def _get_features(
      feature_collection: FeatureCollection,
      column_keys: Tuple[Tuple[str, int]],
      commutative: bool,
  ) -> List[List[LiteFeature]]:
      """
      Calculates all LiteFeature combinations using the given hashmap of existing features, and the input set of required columns.
  
      Args:
          feature_collection (FeatureCollection):
              An indexed feature collection object for efficient querying of features
          column_keys (List[Tuple[str, int]]):
              List of Column types needed by associated primitive.
          commutative (bool):
              whether or not we need to use product or combinations to create feature sets.
  
      Returns:
          List[List[LiteFeature]]
              A list of LiteFeature sets.
  
      Examples:
          .. code-block:: python
  
              from featuretools.feature_discovery.feature_discovery import _get_features
              from woodwork.column_schema import ColumnSchema
  
              feature_groups = {
                  "ANY": ["f1", "f2", "f3"],
                  "Double": ["f1", "f2", "f3"],
                  "numeric": ["f1", "f2", "f3"],
                  "Double,numeric": ["f1", "f2", "f3"],
              }
              column_set = [ColumnSchema(semantic_tags={"numeric"}), ColumnSchema(semantic_tags={"numeric"})]
              features = _get_features(col_groups, column_set, commutative=False)
      """
  
      prod_iter = []
      for key, count in column_keys:
          relevant_features = list(feature_collection.get_by_key(key))
  
          if commutative:
              prod_iter.append(combinations(relevant_features, count))
          else:
              prod_iter.append(permutations(relevant_features, count))
  
      feature_combinations = product(*prod_iter)
  
      return [flatten_list(x) for x in feature_combinations]
  
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 2 for calling a global function with example usage: _get_features(feature_collection, column_keys, commutative) and returns: unknown