class_docstr: The final result of a ML training run or a Tune trial.
  
  This is the output produced by ``Trainer.fit``.
  ``Tuner.fit`` outputs a :class:`~ray.tune.ResultGrid` that is a collection
  of ``Result`` objects.
  
  This API is the recommended way to access the outputs such as:
  - checkpoints (``Result.checkpoint``)
  - the history of reported metrics (``Result.metrics_dataframe``, ``Result.metrics``)
  - errors encountered during a training run (``Result.error``)
  
  The constructor is a private API -- use ``Result.from_path`` to create a result
  object from a directory.
  
  Attributes:
      metrics: The latest set of reported metrics.
      checkpoint: The latest checkpoint.
      error: The execution error of the Trainable run, if the trial finishes in error.
      path: Path pointing to the result directory on persistent storage. This can
          point to a remote storage location (e.g. S3) or to a local location (path
          on the head node). The path is accessible via the result's associated
          `filesystem`. For instance, for a result stored in S3 at
          ``s3://bucket/location``, ``path`` will have the value ``bucket/location``.
      metrics_dataframe: The full result dataframe of the Trainable.
          The dataframe is indexed by iterations and contains reported
          metrics. Note that the dataframe columns are indexed with the
          *flattened* keys of reported metrics, so the format of this dataframe
          may be slightly different than ``Result.metrics``, which is an unflattened
          dict of the latest set of reported metrics.
      best_checkpoints: A list of tuples of the best checkpoints and
          their associated metrics. The number of
          saved checkpoints is determined by :class:`~ray.train.CheckpointConfig`
          (by default, all checkpoints will be saved).
class_docstr_tok: ["The","final","result","of","a","ML","training","run","or","a","Tune","trial",".","This","is","the","output","produced","by","``","Trainer.fit","``",".","``","Tuner.fit","``","outputs","a",":","class",":","`","~ray.tune.ResultGrid","`","that","is","a","collection","of","``","Result","``","objects",".","This","API","is","the","recommended","way","to","access","the","outputs","such","as",":","-","checkpoints","(","``","Result.checkpoint","``",")","-","the","history","of","reported","metrics","(","``","Result.metrics_dataframe","``",",","``","Result.metrics","``",")","-","errors","encountered","during","a","training","run","(","``","Result.error","``",")","The","constructor","is","a","private","API","--","use","``","Result.from_path","``","to","create","a","result","object","from","a","directory",".","Attributes",":","metrics",":","The","latest","set","of","reported","metrics",".","checkpoint",":","The","latest","checkpoint",".","error",":","The","execution","error","of","the","Trainable","run",",","if","the","trial","finishes","in","error",".","path",":","Path","pointing","to","the","result","directory","on","persistent","storage",".","This","can","point","to","a","remote","storage","location","(","e.g",".","S3",")","or","to","a","local","location","(","path","on","the","head","node",")",".","The","path","is","accessible","via","the","result","'s","associated","`","filesystem","`",".","For","instance",",","for","a","result","stored","in","S3","at","``","s3",":","\/\/bucket\/location","``",",","``","path","``","will","have","the","value","``","bucket\/location","``",".","metrics_dataframe",":","The","full","result","dataframe","of","the","Trainable",".","The","dataframe","is","indexed","by","iterations","and","contains","reported","metrics",".","Note","that","the","dataframe","columns","are","indexed","with","the","*","flattened","*","keys","of","reported","metrics",",","so","the","format","of","this","dataframe","may","be","slightly","different","than","``","Result.metrics","``",",","which","is","an","unflattened","dict","of","the","latest","set","of","reported","metrics",".","best_checkpoints",":","A","list","of","tuples","of","the","best","checkpoints","and","their","associated","metrics",".","The","number","of","saved","checkpoints","is","determined","by",":","class",":","`","~ray.train.CheckpointConfig","`","(","by","default",",","all","checkpoints","will","be","saved",")","."]
docstr: Construct the representation with specified number of space indent.
docstr_tok: ["Construct","the","representation","with","specified","number","of","space","indent","."]
code: def _repr(self, indent: int = 0) -> str:
      """Construct the representation with specified number of space indent."""
      from ray.tune.result import AUTO_RESULT_KEYS
      from ray.tune.experimental.output import BLACKLISTED_KEYS
  
      shown_attributes = {
          k: getattr(self, k) for k in self._items_to_repr
      }
      if self.error:
          shown_attributes["error"] = type(self.error).__name__
      else:
          shown_attributes.pop("error")
  
      shown_attributes["filesystem"] = shown_attributes[
          "filesystem"
      ].type_name
  
      if self.metrics:
          exclude = set(AUTO_RESULT_KEYS)
          exclude.update(BLACKLISTED_KEYS)
          shown_attributes["metrics"] = {
              k: v for k, v in self.metrics.items() if k not in exclude
          }
  
      cls_indent = " " * indent
      kws_indent = " " * (indent + 2)
  
      kws = [
          f"{kws_indent}{key}={value!r}"
          for key, value in shown_attributes.items()
      ]
      kws_repr = ",\n".join(kws)
      return "{0}{1}(\n{2}\n{0})".format(
          cls_indent, type(self).__name__, kws_repr
      )
  
file_path: ray/python/ray/air/result.py
imports: import os
  import io
  import json
  import pandas
  import pyarrow
  from dataclasses import dataclass
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
  import ray
  from ray.air.constants import EXPR_RESULT_FILE, EXPR_PROGRESS_FILE, EXPR_ERROR_PICKLE_FILE
  from ray.util.annotations import PublicAPI
  import logging
label_desc: Use image node_id 3 for calling the Result obj's underlying member method code with example usage: obj._repr(indent) and returns: str