class_docstr: This is a contextual dataset that is constructed from either a single
  dateset containing overall outcome or a list of datasets that each corresponds
  to a context breakdown.
docstr: Sort the outcome names according to the order of context buckets.
code: def _sort_outcome_names(self) -> List[str]:
      """Sort the outcome names according to the order of context buckets."""
      outcome_names = list(self.datasets.keys())
      if len(outcome_names) == 1:
          return outcome_names
      else:
          context_outcome_map = {}
          for context in self.context_buckets:
              for outcome_name in outcome_names:
                  if outcome_name in self.metric_decomposition[context]:
                      if (
                          context_outcome_map.get(context, None)
                          is not None
                      ):
                          raise ValueError(
                              f"{context} bucket contains multiple outcomes"
                          )
                      context_outcome_map[context] = outcome_name
      return [
          context_outcome_map[context]
          for context in self.context_buckets
      ]
  
imports: from __future__ import annotations
  import collections
  import warnings
  from typing import Any, Dict, List, Optional, Union
  import torch
  from botorch.exceptions.errors import InputDataError, UnsupportedError
  from botorch.utils.containers import BotorchContainer, SliceContainer
  from torch import long, ones, Tensor
label_desc: Use image node_id 5 for calling the ContextualDataset obj's underlying member method code with example usage: obj._sort_outcome_names() and returns: unknown, outcome_names