class_docstr: Specified dimension (width/height) of a user control or window.
  
  The layout engine tries to honor the preferred size. If that is not
  possible, because the terminal is larger or smaller, it tries to keep in
  between min and max.
  
  :param min: Minimum size.
  :param max: Maximum size.
  :param weight: For a VSplit/HSplit, the actual size will be determined
                 by taking the proportion of weights from all the children.
                 E.g. When there are two children, one with a weight of 1,
                 and the other with a weight of 2, the second will always be
                 twice as big as the first, if the min/max values allow it.
  :param preferred: Preferred size.
code: def __init__(
      self,
      min: int | None = None,
      max: int | None = None,
      weight: int | None = None,
      preferred: int | None = None,
  ) -> None:
      if weight is not None:
          assert weight >= 0  # Also cannot be a float.
  
      assert min is None or min >= 0
      assert max is None or max >= 0
      assert preferred is None or preferred >= 0
  
      self.min_specified = min is not None
      self.max_specified = max is not None
      self.preferred_specified = preferred is not None
      self.weight_specified = weight is not None
  
      if min is None:
          min = 0  # Smallest possible value.
      if max is None:  # 0-values are allowed, so use "is None"
          max = 1000**10  # Something huge.
      if preferred is None:
          preferred = min
      if weight is None:
          weight = 1
  
      self.min = min
      self.max = max
      self.preferred = preferred
      self.weight = weight
  
      # Don't allow situations where max < min. (This would be a bug.)
      if max < min:
          raise ValueError("Invalid Dimension: max < min.")
  
      # Make sure that the 'preferred' size is always in the min..max range.
      if self.preferred < self.min:
          self.preferred = self.min
  
      if self.preferred > self.max:
          self.preferred = self.max
  
file_path: catboost/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/dimension.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any, Callable, Union
label_desc: Use image node_id 1 to create a new Dimension object  with example: obj = Dimension(min, max, weight, preferred)