code: def test_base_of_and_stack_on_heuristic(
      es, test_aggregation_primitive
  ):
      child = Feature(
          es["sessions"].ww["id"],
          parent_dataframe_name="customers",
          primitive=Count,
      )
      test_aggregation_primitive.stack_on = []
      child.primitive.base_of = []
      assert not can_stack_primitive_on_inputs(
          test_aggregation_primitive(), [child]
      )
  
      test_aggregation_primitive.stack_on = []
      child.primitive.base_of = None
      assert can_stack_primitive_on_inputs(
          test_aggregation_primitive(), [child]
      )
  
      test_aggregation_primitive.stack_on = []
      child.primitive.base_of = [test_aggregation_primitive]
      assert can_stack_primitive_on_inputs(
          test_aggregation_primitive(), [child]
      )
  
      test_aggregation_primitive.stack_on = None
      child.primitive.base_of = []
      assert can_stack_primitive_on_inputs(
          test_aggregation_primitive(), [child]
      )
  
      test_aggregation_primitive.stack_on = None
      child.primitive.base_of = None
      assert can_stack_primitive_on_inputs(
          test_aggregation_primitive(), [child]
      )
  
      test_aggregation_primitive.stack_on = None
      child.primitive.base_of = [test_aggregation_primitive]
      assert can_stack_primitive_on_inputs(
          test_aggregation_primitive(), [child]
      )
  
      test_aggregation_primitive.stack_on = [type(child.primitive)]
      child.primitive.base_of = []
      assert can_stack_primitive_on_inputs(
          test_aggregation_primitive(), [child]
      )
  
      test_aggregation_primitive.stack_on = [type(child.primitive)]
      child.primitive.base_of = None
      assert can_stack_primitive_on_inputs(
          test_aggregation_primitive(), [child]
      )
  
      test_aggregation_primitive.stack_on = [type(child.primitive)]
      child.primitive.base_of = [test_aggregation_primitive]
      assert can_stack_primitive_on_inputs(
          test_aggregation_primitive(), [child]
      )
  
      test_aggregation_primitive.stack_on = None
      child.primitive.base_of = None
      child.primitive.base_of_exclude = [test_aggregation_primitive]
      assert not can_stack_primitive_on_inputs(
          test_aggregation_primitive(), [child]
      )
  
      test_aggregation_primitive.stack_on_exclude = [Count]
      assert not can_stack_primitive_on_inputs(
          test_aggregation_primitive(), [child]
      )
  
      child.primitive.number_output_features = 2
      test_aggregation_primitive.stack_on_exclude = []
      test_aggregation_primitive.stack_on = []
      child.primitive.base_of = []
      assert not can_stack_primitive_on_inputs(
          test_aggregation_primitive(), [child]
      )
  
imports: import os.path
  import re
  import pytest
  from pympler.asizeof import asizeof
  from woodwork.column_schema import ColumnSchema
  from woodwork.logical_types import Datetime, Integer
  from featuretools import Feature, config, feature_base
  from featuretools.feature_base import IdentityFeature
  from featuretools.primitives import Count, Diff, Last, Mode, Negate, NMostCommon, NumUnique, Sum, TransformPrimitive
  from featuretools.synthesis.deep_feature_synthesis import can_stack_primitive_on_inputs
  from featuretools.tests.testing_utils import check_rename
label_desc: Use image node_id 32 for calling a global function with example usage: test_base_of_and_stack_on_heuristic(es, test_aggregation_primitive) without return types