def METHOD_NAME(
    attribute_name: Text,
    analysis: Analysis
) -> Union[None, Text]:
  """Check whether the cardinality exceeds the predefined threshold
  Args:
      attribute_name: (string),
      analysis: (analysis_entity_pb2.Analysis), analysis that contain the result
      of cardinality
  Returns:
    Union[None, string]
  """
  metrics = analysis.smetrics
  cardinality = 0
  for item in metrics:
    if item.name == ScalarMetric.CARDINALITY:
      cardinality = item.value
  if cardinality > CARDINALITY_THRESHOLD:
    return template.HIGH_CARDINALITY.format(
        name=attribute_name,
        value=cardinality
    )
  return None