class_docstr: A console renderable that draws a border around its contents.
  
  Example:
      >>> console.print(Panel("Hello, World!"))
  
  Args:
      renderable (RenderableType): A console renderable object.
      box (Box, optional): A Box instance that defines the look of the border (see :ref:`appendix_box`.
          Defaults to box.ROUNDED.
      safe_box (bool, optional): Disable box characters that don't display on windows legacy terminal with *raster* fonts. Defaults to True.
      expand (bool, optional): If True the panel will stretch to fill the console
          width, otherwise it will be sized to fit the contents. Defaults to True.
      style (str, optional): The style of the panel (border and contents). Defaults to "none".
      border_style (str, optional): The style of the border. Defaults to "none".
      width (Optional[int], optional): Optional width of panel. Defaults to None to auto-detect.
      height (Optional[int], optional): Optional height of panel. Defaults to None to auto-detect.
      padding (Optional[PaddingDimensions]): Optional padding around renderable. Defaults to 0.
      highlight (bool, optional): Enable automatic highlighting of panel title (if str). Defaults to False.
class_docstr_tok: ["A","console","renderable","that","draws","a","border","around","its","contents",".","Example",":",">",">",">","console.print","(","Panel","(","``","Hello",",","World","!","''",")",")","Args",":","renderable","(","RenderableType",")",":","A","console","renderable","object",".","box","(","Box",",","optional",")",":","A","Box","instance","that","defines","the","look","of","the","border","(","see",":","ref",":","`","appendix_box","`",".","Defaults","to","box.ROUNDED",".","safe_box","(","bool",",","optional",")",":","Disable","box","characters","that","do","n't","display","on","windows","legacy","terminal","with","*","raster","*","fonts",".","Defaults","to","True",".","expand","(","bool",",","optional",")",":","If","True","the","panel","will","stretch","to","fill","the","console","width",",","otherwise","it","will","be","sized","to","fit","the","contents",".","Defaults","to","True",".","style","(","str",",","optional",")",":","The","style","of","the","panel","(","border","and","contents",")",".","Defaults","to","``","none","''",".","border_style","(","str",",","optional",")",":","The","style","of","the","border",".","Defaults","to","``","none","''",".","width","(","Optional","[","int","]",",","optional",")",":","Optional","width","of","panel",".","Defaults","to","None","to","auto-detect",".","height","(","Optional","[","int","]",",","optional",")",":","Optional","height","of","panel",".","Defaults","to","None","to","auto-detect",".","padding","(","Optional","[","PaddingDimensions","]",")",":","Optional","padding","around","renderable",".","Defaults","to","0.","highlight","(","bool",",","optional",")",":","Enable","automatic","highlighting","of","panel","title","(","if","str",")",".","Defaults","to","False","."]
code: def __rich_measure__(
      self, console: "Console", options: "ConsoleOptions"
  ) -> "Measurement":
      _title = self._title
      _, right, _, left = Padding.unpack(self.padding)
      padding = left + right
      renderables = (
          [self.renderable, _title] if _title else [self.renderable]
      )
  
      if self.width is None:
          width = (
              measure_renderables(
                  console,
                  options.update_width(options.max_width - padding - 2),
                  renderables,
              ).maximum
              + padding
              + 2
          )
      else:
          width = self.width
      return Measurement(width, width)
  
file_path: rich/rich/panel.py
imports: from typing import TYPE_CHECKING, Optional
  from .align import AlignMethod
  from .box import ROUNDED, Box
  from .cells import cell_len
  from .jupyter import JupyterMixin
  from .measure import Measurement, measure_renderables
  from .padding import Padding, PaddingDimensions
  from .segment import Segment
  from .style import Style, StyleType
  from .text import Text, TextType
label_desc: Use image node_id 6 for calling the Panel obj's underlying member method code with example usage: obj.__rich_measure__(console, options) and returns: Measurement