code: def test_stacking_multi(pd_es):
      threecommon = NMostCommon(3)
      tc = Feature(
          pd_es["log"].ww["product_id"],
          parent_dataframe_name="sessions",
          primitive=threecommon,
      )
  
      stacked = []
      for i in range(3):
          stacked.append(
              Feature(
                  tc[i],
                  parent_dataframe_name="customers",
                  primitive=NumUnique,
              ),
          )
  
      fm = calculate_feature_matrix(
          stacked, entityset=pd_es, instance_ids=[0, 1, 2]
      )
  
      correct_vals = [[3, 2, 1], [2, 1, 0], [0, 0, 0]]
      correct_vals1 = [[3, 1, 1], [2, 1, 0], [0, 0, 0]]
      # either of the above can be correct, and the outcome depends on the sorting of
      # two values in the initial n most common function, which changes arbitrarily.
  
      for i in range(3):
          f = (
              "NUM_UNIQUE(sessions.N_MOST_COMMON(log.product_id)[%d])"
              % i
          )
          cols = fm.columns
          assert f in cols
          assert (
              fm[cols[i]].tolist() == correct_vals[i]
              or fm[cols[i]].tolist() == correct_vals1[i]
          )
  
imports: from datetime import datetime
  from inspect import isclass
  from math import isnan
  import numpy
  import pandas
  import pytest
  from woodwork.column_schema import ColumnSchema
  from woodwork.logical_types import Datetime
  from featuretools import AggregationFeature, Feature, IdentityFeature, Timedelta, calculate_feature_matrix, dfs, primitives
  from featuretools.entityset.relationship import RelationshipPath
  from featuretools.feature_base.cache import feature_cache
  from featuretools.primitives import Count, Max, Mean, Median, NMostCommon, NumTrue, NumUnique, Sum, TimeSinceFirst, TimeSinceLast, get_aggregation_primitives
  from featuretools.primitives.base import AggregationPrimitive
  from featuretools.synthesis.deep_feature_synthesis import DeepFeatureSynthesis, match
  from featuretools.tests.testing_utils import backward_path, feature_with_name, to_pandas
  from featuretools.utils.gen_utils import Library
label_desc: Use image node_id 24 for calling a global function with example usage: test_stacking_multi(pd_es) without return types