code: def test_custom_primitive_multiple_inputs(pd_es):
      class MeanSunday(AggregationPrimitive):
          name = "mean_sunday"
          input_types = [
              ColumnSchema(semantic_tags={"numeric"}),
              ColumnSchema(logical_type=Datetime),
          ]
          return_type = ColumnSchema(semantic_tags={"numeric"})
  
          def get_function(self):
              def mean_sunday(numeric, datetime):
                  """
                  Finds the mean of non-null values of a feature that occurred on Sundays
                  """
                  days = pd.DatetimeIndex(datetime).weekday.values
                  df = pd.DataFrame({"numeric": numeric, "time": days})
                  return df[df["time"] == 6]["numeric"].mean()
  
              return mean_sunday
  
      fm, features = dfs(
          entityset=pd_es,
          target_dataframe_name="sessions",
          agg_primitives=[MeanSunday],
          trans_primitives=[],
      )
      mean_sunday_value = pd.Series([None, None, None, 2.5, 7, None])
      iterator = zip(
          fm["MEAN_SUNDAY(log.value, datetime)"], mean_sunday_value
      )
      for x, y in iterator:
          assert (pd.isnull(x) and pd.isnull(y)) or (x == y)
  
      pd_es.add_interesting_values()
      mean_sunday_value_priority_0 = pd.Series(
          [None, None, None, 2.5, 0, None]
      )
      fm, features = dfs(
          entityset=pd_es,
          target_dataframe_name="sessions",
          agg_primitives=[MeanSunday],
          trans_primitives=[],
          where_primitives=[MeanSunday],
      )
      where_feat = (
          "MEAN_SUNDAY(log.value, datetime WHERE priority_level = 0)"
      )
      for x, y in zip(fm[where_feat], mean_sunday_value_priority_0):
          assert (pd.isnull(x) and pd.isnull(y)) or (x == y)
  
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 20 for calling a global function with example usage: test_custom_primitive_multiple_inputs(pd_es) and returns: mean_sunday, df