code: def sort_by_dimension(nodes: List[Node], i: int) -> None:
      r"""Sorts the list of nodes in-place by the specified objective.
  
      Args:
          nodes: A list of Nodes
          i: The index of the objective to sort by
  
      """
      # build a list of tuples of (point[i], node)
      decorated = [
          (node.data[i], index, node)
          for index, node in enumerate(nodes)
      ]
      # sort by this value
      decorated.sort()
      # write back to original list
      nodes[:] = [node for (_, _, node) in decorated]
  
imports: from __future__ import annotations
  import warnings
  from copy import deepcopy
  from itertools import combinations
  from typing import Callable, List, Optional, Union
  import torch
  from botorch.acquisition.cached_cholesky import CachedCholeskyMCSamplerMixin
  from botorch.acquisition.multi_objective.objective import MCMultiOutputObjective
  from botorch.acquisition.multi_objective.utils import prune_inferior_points_multi_objective
  from botorch.exceptions.errors import BotorchError, BotorchTensorDimensionError, UnsupportedError
  from botorch.exceptions.warnings import BotorchWarning
  from botorch.models.model import Model
  from botorch.sampling.base import MCSampler
  from botorch.utils.multi_objective.box_decompositions.box_decomposition_list import BoxDecompositionList
  from botorch.utils.multi_objective.box_decompositions.dominated import DominatedPartitioning
  from botorch.utils.multi_objective.box_decompositions.non_dominated import FastNondominatedPartitioning, NondominatedPartitioning
  from botorch.utils.multi_objective.box_decompositions.utils import _pad_batch_pareto_frontier
  from botorch.utils.objective import compute_feasibility_indicator
  from botorch.utils.torch import BufferDict
  from torch import Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: sort_by_dimension(nodes, i) without return types