class_docstr: The [`Evaluator`] class is the class from which all evaluators inherit. Refer to this class for methods shared across
  different evaluators.
  Base class implementing evaluator operations.
class_docstr_tok: ["The","[","`","Evaluator","`","]","class","is","the","class","from","which","all","evaluators","inherit",".","Refer","to","this","class","for","methods","shared","across","different","evaluators",".","Base","class","implementing","evaluator","operations","."]
docstr: Prepare metric.
  
  Args:
      metric (`str` or [`EvaluationModule`], defaults to `None`):
          Specifies the metric we use in evaluator. If it is of type `str`, we treat it as the metric name, and
          load it. Otherwise we assume it represents a pre-loaded metric.
  
  Returns:
      The loaded metric.
  
  Example:
  
  ```py
  >>> from evaluate import evaluator
  >>> evaluator("text-classification").prepare_metric("accuracy")
  ```
docstr_tok: ["Prepare","metric",".","Args",":","metric","(","`","str","`","or","[","`","EvaluationModule","`","]",",","defaults","to","`","None","`",")",":","Specifies","the","metric","we","use","in","evaluator",".","If","it","is","of","type","`","str","`",",","we","treat","it","as","the","metric","name",",","and","load","it",".","Otherwise","we","assume","it","represents","a","pre-loaded","metric",".","Returns",":","The","loaded","metric",".","Example",":","``","`","py",">",">",">","from","evaluate","import","evaluator",">",">",">","evaluator","(","``","text-classification","''",")",".prepare_metric","(","``","accuracy","''",")","``","`"]
code: def prepare_metric(self, metric: Union[str, EvaluationModule]):
      """
      Prepare metric.
  
      Args:
          metric (`str` or [`EvaluationModule`], defaults to `None`):
              Specifies the metric we use in evaluator. If it is of type `str`, we treat it as the metric name, and
              load it. Otherwise we assume it represents a pre-loaded metric.
  
      Returns:
          The loaded metric.
  
      Example:
  
      ```py
      >>> from evaluate import evaluator
      >>> evaluator("text-classification").prepare_metric("accuracy")
      ```
      """
      # Prepare metric.
      if metric is None:
          if self.default_metric_name is None:
              raise ValueError(
                  "`Evaluator` doesn't specify a default metric. Please specify a valid `metric` argument."
              )
          metric = load(self.default_metric_name)
      elif isinstance(metric, str):
          metric = load(metric)
  
      return metric
  
imports: from abc import ABC, abstractmethod
  from numbers import Number
  from typing import Any, Callable, Dict, List, Optional, Union
  from datasets import Dataset, load_dataset
  from evaluate.evaluator.utils import choose_split
  from time import perf_counter
  from typing_extensions import Literal
  from ..loading import load
  from ..module import EvaluationModule
  from ..utils.logging import get_logger
  from .utils import DatasetColumn
label_desc: Use image node_id 13 for calling the Evaluator obj's underlying member method code with example usage: obj.prepare_metric(metric) and returns: metric