code: def entity_capitalness(
      name: str,
      query: Optional[str] = None,
      compute_for: Union[str, ComputeFor] = Predictions,
  ) -> MetricSummary:
      """Computes the entity capitalness. The entity capitalness splits the entity mention shape in 4 groups:
  
          ``UPPER``: All characters in entity mention are upper case.
  
          ``LOWER``: All characters in entity mention are lower case.
  
          ``FIRST``: The first character in the mention is upper case.
  
          ``MIDDLE``: First character in the mention is lower case and at least one other character is upper case.
  
      Args:
          name: The dataset name.
          query: An ElasticSearch query with the
              `query string syntax <https://docs.argilla.io/en/latest/practical_guides/filter_dataset.html>`_
          compute_for: Metric can be computed for annotations or predictions. Accepted values are
              ``Annotations`` and ``Predictions``. Default to ``Predictions``.
      Returns:
          The summary entity capitalness distribution
  
      Examples:
          >>> from argilla.metrics.token_classification import entity_capitalness
          >>> summary = entity_capitalness(name="example-dataset")
          >>> summary.visualize()
      """
      metric = singleton.active_api().compute_metric(
          name,
          metric=f"{_check_compute_for(compute_for)}_entity_capitalness",
          query=query,
      )
  
      return MetricSummary.new_summary(
          data=metric.results,
          visualization=lambda: helpers.bar(
              metric.results,
              title=metric.description,
          ),
      )
  
imports: import warnings
  from enum import Enum
  from typing import Optional, Set, Union
  import deprecated
  from argilla.client import singleton
  from argilla.metrics import helpers
  from argilla.metrics.models import MetricSummary
label_desc: Use image node_id 9 for calling a global function with example usage: entity_capitalness(name, query, compute_for) and returns: MetricSummary