code: def output_categorical_numeric(
      categorical_numeric_types: Mapping[
          types.FeaturePath, "schema_pb2.FeatureType"
      ],
      feature_path: types.FeaturePath,
      feature_type: Optional[int],
  ) -> bool:
      """Check if a feature path should be treated as a numeric categorical.
  
      Args:
        categorical_numeric_types: A mapping from feature path to schema feature
          type.
        feature_path: The path of a feature.
        feature_type: Either a statistics_pb2.FeatureNameStatistics.Type or None.
  
      Returns:
        True feature_type is INT and feature_path was expressed in the schema as an
        INT.
      """
      if feature_path not in categorical_numeric_types:
          return False
      schema_type = categorical_numeric_types[feature_path]
  
      # Only output categorical numeric if the feature was declared categorical
      # numeric and the Arrow type (INT/FLOAT) matches the schema type (INT/FLOAT).
      if (
          feature_type == statistics_pb2.FeatureNameStatistics.INT
          and schema_type == schema_pb2.INT
      ):
          return True
      if (
          feature_type == statistics_pb2.FeatureNameStatistics.FLOAT
          and schema_type == schema_pb2.FLOAT
      ):
          return True
  
      return False
  
file_path: data-validation/tensorflow_data_validation/utils/top_k_uniques_stats_util.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import List, Mapping, Optional, Union
  import apache_beam
  import six
  from tensorflow_data_validation import constants
  from tensorflow_data_validation import types
  from tensorflow_data_validation.utils import stats_util
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
  from tfx_bsl.types import tfx_namedtuple
label_desc: Use image node_id 7 for calling a global function with example usage: output_categorical_numeric(categorical_numeric_types, feature_path, feature_type) and returns: False, False, True, True