code: def text_length(
      name: str, query: Optional[str] = None
  ) -> MetricSummary:
      """Computes the input text length metrics for a dataset
  
      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 text length metric summary
  
      Examples:
          >>> from argilla.metrics.commons import text_length
          >>> summary = text_length(name="example-dataset")
          >>> summary.visualize() # will plot an histogram with results
          >>> summary.data # returns the raw result data
      """
      metric = singleton.active_api().compute_metric(
          name, metric="text_length", query=query
      )
  
      return MetricSummary.new_summary(
          data=metric.results,
          visualization=lambda: helpers.histogram(
              data=metric.results, title=metric.description
          ),
      )
  
imports: from typing import Optional
  from argilla.client import singleton
  from argilla.metrics import helpers
  from argilla.metrics.models import MetricSummary
label_desc: Use image node_id 1 for calling a global function with example usage: text_length(name, query) and returns: MetricSummary