code: def bound(val: float, bounds: tuple[float, float]) -> float:
      """Bounds a value between a low and high
  
      .. code:: python
  
          x = bound(14, low=0, high=13.1)
          # x == 13.1
  
      Parameters
      ----------
      val : float
          The value to bound
  
      bounds: tuple[foat, float]
          The bounds to bound the value between (low, high)
  
      Returns
      -------
      float
          The bounded value
      """
      return max(bounds[0], min(val, bounds[1]))
  
file_path: auto-sklearn/autosklearn/util/functional.py
imports: from __future__ import annotations
  from typing import Callable, Hashable, Iterable, Iterator, TypeVar
  from functools import reduce
  from itertools import chain, cycle, islice, tee
label_desc: Use image node_id 4 for calling a global function with example usage: bound(val, bounds) and returns: max