code: def token_length(
      name: str, query: Optional[str] = None
  ) -> MetricSummary:
      """Computes the token size distribution in terms of number of characters
  
      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>`_
  
      Returns:
          The summary for token length distribution
  
      Examples:
          >>> from argilla.metrics.token_classification import token_length
          >>> summary = token_length(name="example-dataset")
          >>> summary.visualize() # will plot a histogram with results
          >>> summary.data # The token length distribution
      """
      warnings.warn(
          message=_UNUSED_METRIC_WARNING_MESSAGE,
          category=DeprecationWarning,
      )
  
      metric = singleton.active_api().compute_metric(
          name, metric="token_length", query=query
      )
  
      return MetricSummary.new_summary(
          data=metric.results,
          visualization=lambda: helpers.histogram(
              metric.results,
              title=metric.description,
              x_legend="# chars",
          ),
      )
  
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 3 for calling a global function with example usage: token_length(name, query) and returns: MetricSummary