code: def test_encodes_features(pd_es):
      f1 = IdentityFeature(pd_es["log"].ww["product_id"])
      f2 = IdentityFeature(pd_es["log"].ww["purchased"])
      f3 = IdentityFeature(pd_es["log"].ww["value"])
  
      features = [f1, f2, f3]
      feature_matrix = calculate_feature_matrix(
          features,
          pd_es,
          instance_ids=[0, 1, 2, 3, 4, 5],
      )
  
      _, features_encoded = encode_features(feature_matrix, features)
      assert len(features_encoded) == 6
  
      _, features_encoded = encode_features(
          feature_matrix, features, top_n=2
      )
      assert len(features_encoded) == 5
  
      _, features_encoded = encode_features(
          feature_matrix,
          features,
          include_unknown=False,
      )
      assert len(features_encoded) == 5
  
file_path: featuretools/featuretools/tests/synthesis/test_encode_features.py
imports: import pandas
  import pytest
  from featuretools import EntitySet, calculate_feature_matrix, dfs
  from featuretools.feature_base import Feature, IdentityFeature
  from featuretools.primitives import NMostCommon
  from featuretools.synthesis import encode_features
label_desc: Use image node_id 1 for calling a global function with example usage: test_encodes_features(pd_es) without return types