code: def test_encode_features_matches_calculate_feature_matrix():
      df = pd.DataFrame({"category": ["b", "c", "d", "e"]}).astype(
          {"category": "category"},
      )
  
      pd_es = EntitySet("test")
      pd_es.add_dataframe(
          dataframe_name="a",
          dataframe=df,
          index="index",
          make_index=True,
      )
      features, feature_defs = dfs(
          entityset=pd_es,
          target_dataframe_name="a",
          max_depth=1,
      )
  
      features_enc, feature_defs_enc = encode_features(
          features,
          feature_defs,
          to_encode=["category"],
      )
  
      features_calc = calculate_feature_matrix(
          feature_defs_enc, entityset=pd_es
      )
  
      pd.testing.assert_frame_equal(features_enc, features_calc)
      assert features_calc.ww._schema == features_enc.ww._schema
  
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 11 for calling a global function with example usage: test_encode_features_matches_calculate_feature_matrix() without return types