class_docstr: A class representing a Trial object.
  
  A Trial object is usually obtained from :func:`determined.experimental.client.get_trial`.
  Trial reference class used for querying relevant :class:`~determined.experimental.Checkpoint`
  instances.
  
  Attributes:
      trial_id: ID of trial.
      session: HTTP request session.
      experiment_id: (Mutable, Optional[int]) ID of the experiment this trial belongs to.
      hparams: (Mutable, Optional[Dict]) Dict[name, value] of the trial's hyperparameters.
          This is an instance of the hyperparameter space defined by the experiment.
      state: (Mutable, Optional[TrialState]) Trial state (ex: ACTIVE, PAUSED, COMPLETED).
      summary_metrics: (Mutable, Optional[Dict]) Summary metrics for the trial. Includes
          aggregated metrics for training and validation steps for each reported metric name.
          Example:
  
          .. code::
  
              {
                  "avg_metrics": {
                      "loss": {
                          "count": 100,
                          "last": 0.2,
                          "max": 0.4,
                          "min", 0.2,
                          "sum": 1.2,
                          "type": "number",
                      }
              }
  
  Note:
      All attributes are cached by default.
  
      The :attr:`hparams` and :attr:`summary_metrics` attributes are mutable and may be changed
      by methods that update these values, either automatically or explicitly with :meth:`reload`.
class_docstr_tok: ["A","class","representing","a","Trial","object",".","A","Trial","object","is","usually","obtained","from",":","func",":","`","determined.experimental.client.get_trial","`",".","Trial","reference","class","used","for","querying","relevant",":","class",":","`","~determined.experimental.Checkpoint","`","instances",".","Attributes",":","trial_id",":","ID","of","trial",".","session",":","HTTP","request","session",".","experiment_id",":","(","Mutable",",","Optional","[","int","]",")","ID","of","the","experiment","this","trial","belongs","to",".","hparams",":","(","Mutable",",","Optional","[","Dict","]",")","Dict","[","name",",","value","]","of","the","trial","'s","hyperparameters",".","This","is","an","instance","of","the","hyperparameter","space","defined","by","the","experiment",".","state",":","(","Mutable",",","Optional","[","TrialState","]",")","Trial","state","(","ex",":","ACTIVE",",","PAUSED",",","COMPLETED",")",".","summary_metrics",":","(","Mutable",",","Optional","[","Dict","]",")","Summary","metrics","for","the","trial",".","Includes","aggregated","metrics","for","training","and","validation","steps","for","each","reported","metric","name",".","Example",":","..","code",":",":","{","``","avg_metrics","''",":","{","``","loss","''",":","{","``","count","''",":","100",",","``","last","''",":","0.2",",","``","max","''",":","0.4",",","``","min","''",",","0.2",",","``","sum","''",":","1.2",",","``","type","''",":","``","number","''",",","}","}","Note",":","All","attributes","are","cached","by","default",".","The",":","attr",":","`","hparams","`","and",":","attr",":","`","summary_metrics","`","attributes","are","mutable","and","may","be","changed","by","methods","that","update","these","values",",","either","automatically","or","explicitly","with",":","meth",":","`","reload","`","."]
docstr: Returns an iterator of sorted :class:`~determined.experimental.Checkpoint` instances.
  
  Requires either both `sort_by` and `order_by` to be defined, or neither. If neither are
  specified, will default to sorting by the experiment's configured searcher metric, and
  ordering by `smaller_is_better`.
  
  Only checkpoints in a ``COMPLETED`` state with a matching ``COMPLETED`` validation
  are considered.
  
  Arguments:
      sort_by: (Optional) Parameter to sort checkpoints by. Accepts either
          ``checkpoint.CheckpointSortBy`` or a string representing a validation metric name.
      order_by: (Optional) Order of sorted checkpoints (ascending or descending).
      max_results: (Optional) Maximum number of results to return. Defaults to no maximum.
  
  Returns:
      A list of sorted and ordered checkpoints.
code: def list_checkpoints(
      self,
      sort_by: Optional[Union[str, checkpoint.CheckpointSortBy]] = None,
      order_by: Optional[OrderBy] = None,
      max_results: Optional[int] = None,
  ) -> List[checkpoint.Checkpoint]:
      """Returns an iterator of sorted :class:`~determined.experimental.Checkpoint` instances.
  
      Requires either both `sort_by` and `order_by` to be defined, or neither. If neither are
      specified, will default to sorting by the experiment's configured searcher metric, and
      ordering by `smaller_is_better`.
  
      Only checkpoints in a ``COMPLETED`` state with a matching ``COMPLETED`` validation
      are considered.
  
      Arguments:
          sort_by: (Optional) Parameter to sort checkpoints by. Accepts either
              ``checkpoint.CheckpointSortBy`` or a string representing a validation metric name.
          order_by: (Optional) Order of sorted checkpoints (ascending or descending).
          max_results: (Optional) Maximum number of results to return. Defaults to no maximum.
  
      Returns:
          A list of sorted and ordered checkpoints.
      """
      if (sort_by is None) != (order_by is None):
          raise AssertionError(
              "sort_by and order_by must be either both set, or neither."
          )
  
      if sort_by and not isinstance(
          sort_by, (checkpoint.CheckpointSortBy, str)
      ):
          raise ValueError(
              "sort_by must be of type CheckpointSortBy or str"
          )
  
      if not sort_by:
          sort_by = checkpoint.CheckpointSortBy.SEARCHER_METRIC
  
      def get_trial_checkpoints(
          offset: int,
      ) -> bindings.v1GetTrialCheckpointsResponse:
          return bindings.get_GetTrialCheckpoints(
              self._session,
              id=self.id,
              orderBy=order_by._to_bindings() if order_by else None,
              sortByAttr=sort_by._to_bindings()
              if isinstance(sort_by, checkpoint.CheckpointSortBy)
              else None,
              sortByMetric=sort_by
              if isinstance(sort_by, str)
              else None,
              offset=offset,
              limit=max_results,
          )
  
      resps = api.read_paginated(
          get_with_offset=get_trial_checkpoints,
          pages=api.PageOpts.single
          if max_results
          else api.PageOpts.all,
      )
  
      return [
          checkpoint.Checkpoint._from_bindings(c, self._session)
          for r in resps
          for c in r.checkpoints
      ]
  
imports: import datetime
  import enum
  import inspect
  import warnings
  from typing import Any, Dict, Iterable, List, Optional, Union
  from determined.common import api, util
  from determined.common.api import bindings, logs
  from determined.common.experimental import checkpoint, metrics
  from determined.common.experimental._util import OrderBy
label_desc: Use image node_id 5 for calling the Trial obj's underlying member method code with example usage: obj.list_checkpoints(sort_by, order_by, max_results) and returns: unknown, bindings