code: def _features_from_primitive(
      primitive: PrimitiveBase,
      feature_collection: FeatureCollection,
  ) -> List[LiteFeature]:
      """
      For a given primitive, creates all engineered features
  
      Args:
          primitive (Type[PrimitiveBase])
          feature_collection (FeatureCollection):
              An indexed feature collection object for efficient querying of features
  
      Returns:
          List[List[LiteFeature]]
              List of feature sets
  
      Examples:
          .. code-block:: python
  
              from featuretools.feature_discovery.feature_discovery import get_matching_columns
              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"],
              }
  
              feature_sets = _features_from_primitive(AddNumeric, feature_groups)
  
              [
                  ["f1", "f2"],
                  ["f1", "f3"],
                  ["f2", "f3"]
              ]
      """
      assert isinstance(primitive, PrimitiveBase)
  
      features: List[LiteFeature] = []
      feature_sets = _get_matching_features(
          feature_collection=feature_collection,
          primitive=primitive,
      )
      for feature_set in feature_sets:
          if primitive.number_output_features > 1:
              related_features: Set[LiteFeature] = set()
              for n in range(primitive.number_output_features):
                  feature = LiteFeature(
                      primitive=primitive,
                      base_features=feature_set,
                      idx=n,
                  )
  
                  related_features.add(feature)
  
              for f in related_features:
                  f.related_features = related_features - {f}
                  features.append(f)
          else:
              features.append(
                  LiteFeature(
                      primitive=primitive,
                      base_features=feature_set,
                  ),
              )
      return features
  
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 5 for calling a global function with example usage: _features_from_primitive(primitive, feature_collection) and returns: features