code: def _should_run(
      categorical_numeric_types: Mapping[
          types.FeaturePath, "schema_pb2.FeatureType"
      ],
      feature_path: types.FeaturePath,
      feature_type: Optional[int],
  ) -> bool:
      """Check if top-k analysis should run on a feature."""
      # if it's not a categorical int feature nor a string feature, we don't
      # bother with topk stats.
      if feature_type == statistics_pb2.FeatureNameStatistics.STRING:
          return True
      if top_k_uniques_stats_util.output_categorical_numeric(
          categorical_numeric_types, feature_path, feature_type
      ):
          # This top-k uniques generator implementation only supports categorical
          # INT.
          if feature_type == statistics_pb2.FeatureNameStatistics.INT:
              return True
          else:
              logging.error(
                  "Categorical float feature %s not supported for TopKUniquesStatsGenerator",
                  feature_path,
              )
          return (
              feature_type == statistics_pb2.FeatureNameStatistics.INT
          )
      return False
  
imports: import logging
  from typing import Any, FrozenSet, Iterable, Iterator, Mapping, Optional, Text, Tuple, Union
  import apache_beam
  import numpy
  import pandas
  import pyarrow
  from tensorflow_data_validation import types
  from tensorflow_data_validation.arrow import arrow_util
  from tensorflow_data_validation.statistics.generators import stats_generator
  from tensorflow_data_validation.utils import schema_util
  from tensorflow_data_validation.utils import stats_util
  from tensorflow_data_validation.utils import top_k_uniques_stats_util
  from tensorflow_data_validation.utils.example_weight_map import ExampleWeightMap
  from tfx_bsl.arrow import array_util
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 2 for calling a global function with example usage: _should_run(categorical_numeric_types, feature_path, feature_type) and returns: False, True, unknown, True