code: def test_cum_handles_uses_full_dataframe(pd_es):
      def check(feature):
          feature_set = FeatureSet([feature])
          calculator = FeatureSetCalculator(
              pd_es,
              feature_set=feature_set,
              time_last=None,
          )
          df_1 = calculator.run(np.array([0, 1, 2]))
          df_2 = calculator.run(np.array([2, 4]))
  
          # check that the value for instance id 2 matches
          assert (df_2.loc[2] == df_1.loc[2]).all()
  
      for primitive in [CumSum, CumMean, CumMax, CumMin]:
          check(
              Feature(
                  pd_es["log"].ww["value"],
                  groupby=IdentityFeature(
                      pd_es["log"].ww["session_id"]
                  ),
                  primitive=primitive,
              ),
          )
  
      check(
          Feature(
              pd_es["log"].ww["product_id"],
              groupby=Feature(pd_es["log"].ww["product_id"]),
              primitive=CumCount,
          ),
      )
  
imports: import numpy
  import pandas
  from woodwork.column_schema import ColumnSchema
  from woodwork.logical_types import Datetime
  from featuretools import Feature, GroupByTransformFeature, IdentityFeature, calculate_feature_matrix, feature_base
  from featuretools.computational_backends.feature_set import FeatureSet
  from featuretools.computational_backends.feature_set_calculator import FeatureSetCalculator
  from featuretools.primitives import CumCount, CumMax, CumMean, CumMin, CumSum, Last
  from featuretools.primitives.base import TransformPrimitive
  from featuretools.synthesis import dfs
  from featuretools.tests.testing_utils import feature_with_name
label_desc: Use image node_id 6 for calling a global function with example usage: test_cum_handles_uses_full_dataframe(pd_es) without return types