code: def test_deserializer_uses_common_primitive_instances_with_args(
      es, tmp_path
  ):
      # Single argument
      scalar1 = MultiplyNumericScalar(value=1)
      scalar5 = MultiplyNumericScalar(value=5)
      features = dfs(
          entityset=es,
          target_dataframe_name="products",
          features_only=True,
          agg_primitives=["sum"],
          trans_primitives=[scalar1, scalar5],
      )
  
      scalar1_features = [
          f
          for f in features
          if f.primitive.name == "multiply_numeric_scalar"
          and " * 1" in f.get_name()
      ]
      scalar5_features = [
          f
          for f in features
          if f.primitive.name == "multiply_numeric_scalar"
          and " * 5" in f.get_name()
      ]
  
      # Make sure we have multiple features of each type
      assert len(scalar1_features) > 1
      assert len(scalar5_features) > 1
  
      # DFS should use the the passed in primitive instance for all features
      assert all([f.primitive is scalar1 for f in scalar1_features])
      assert all([f.primitive is scalar5 for f in scalar5_features])
  
      file = os.path.join(tmp_path, "features.json")
      save_features(features, file)
      deserialized_features = load_features(file)
  
      new_scalar1_features = [
          f
          for f in deserialized_features
          if f.primitive.name == "multiply_numeric_scalar"
          and " * 1" in f.get_name()
      ]
      new_scalar5_features = [
          f
          for f in deserialized_features
          if f.primitive.name == "multiply_numeric_scalar"
          and " * 5" in f.get_name()
      ]
  
      # After deserialization all features that share a primitive should use the same primitive instance
      new_scalar1_primitive = new_scalar1_features[0].primitive
      new_scalar5_primitive = new_scalar5_features[0].primitive
      assert all(
          [
              f.primitive is new_scalar1_primitive
              for f in new_scalar1_features
          ]
      )
      assert all(
          [
              f.primitive is new_scalar5_primitive
              for f in new_scalar5_features
          ]
      )
      assert new_scalar1_primitive.value == 1
      assert new_scalar5_primitive.value == 5
  
      # Test primitive with multiple args - pandas only due to primitive compatibility
      if es.dataframe_type == Library.PANDAS:
          distance_to_holiday = DistanceToHoliday(
              holiday="Canada Day",
              country="Canada",
          )
          features = dfs(
              entityset=es,
              target_dataframe_name="customers",
              features_only=True,
              agg_primitives=[],
              trans_primitives=[distance_to_holiday],
          )
  
          distance_features = [
              f
              for f in features
              if f.primitive.name == "distance_to_holiday"
          ]
  
          assert len(distance_features) > 1
  
          # DFS should use the the passed in primitive instance for all features
          assert all(
              [
                  f.primitive is distance_to_holiday
                  for f in distance_features
              ]
          )
  
          file = os.path.join(tmp_path, "distance_features.json")
          save_features(distance_features, file)
          new_distance_features = load_features(file)
  
          # After deserialization all features that share a primitive should use the same primitive instance
          new_distance_primitive = new_distance_features[0].primitive
          assert all(
              [
                  f.primitive is new_distance_primitive
                  for f in new_distance_features
              ],
          )
          assert new_distance_primitive.holiday == "Canada Day"
          assert new_distance_primitive.country == "Canada"
  
      # Test primitive with list arg
      is_in = IsIn(list_of_outputs=[5, True, "coke zero"])
      features = dfs(
          entityset=es,
          target_dataframe_name="customers",
          features_only=True,
          agg_primitives=[],
          trans_primitives=[is_in],
      )
  
      is_in_features = [
          f for f in features if f.primitive.name == "isin"
      ]
      assert len(is_in_features) > 1
  
      # DFS should use the the passed in primitive instance for all features
      assert all([f.primitive is is_in for f in is_in_features])
  
      file = os.path.join(tmp_path, "distance_features.json")
      save_features(is_in_features, file)
      new_is_in_features = load_features(file)
  
      # After deserialization all features that share a primitive should use the same primitive instance
      new_is_in_primitive = new_is_in_features[0].primitive
      assert all(
          [
              f.primitive is new_is_in_primitive
              for f in new_is_in_features
          ]
      )
      assert new_is_in_primitive.list_of_outputs == [
          5,
          True,
          "coke zero",
      ]
  
imports: import os
  import boto3
  import pandas
  import pytest
  from pympler.asizeof import asizeof
  from smart_open import open
  from woodwork.column_schema import ColumnSchema
  from featuretools import AggregationFeature, DirectFeature, EntitySet, Feature, GroupByTransformFeature, IdentityFeature, TransformFeature, dfs, feature_base, load_features, primitives, save_features
  from featuretools.feature_base import FeatureOutputSlice
  from featuretools.feature_base.cache import feature_cache
  from featuretools.feature_base.features_deserializer import FeaturesDeserializer
  from featuretools.feature_base.features_serializer import FeaturesSerializer
  from featuretools.primitives import Count, CumSum, Day, DistanceToHoliday, Haversine, IsIn, Max, Mean, Min, Mode, Month, MultiplyNumericScalar, Negate, NMostCommon, NumberOfCommonWords, NumCharacters, NumUnique, NumWords, PercentTrue, Skew, Std, Sum, TransformPrimitive, Weekday, Year
  from featuretools.primitives.base import AggregationPrimitive
  from featuretools.tests.testing_utils import check_names
  from featuretools.utils.gen_utils import Library
  from featuretools.version import ENTITYSET_SCHEMA_VERSION, FEATURES_SCHEMA_VERSION
label_desc: Use image node_id 16 for calling a global function with example usage: test_deserializer_uses_common_primitive_instances_with_args(es, tmp_path) without return types