class_docstr: Defines characters to render boxes.
  
  ┌─┬┐ top
  │ ││ head
  ├─┼┤ head_row
  │ ││ mid
  ├─┼┤ row
  ├─┼┤ foot_row
  │ ││ foot
  └─┴┘ bottom
  
  Args:
      box (str): Characters making up box.
      ascii (bool, optional): True if this box uses ascii characters only. Default is False.
class_docstr_tok: ["Defines","characters","to","render","boxes",".","\u250c\u2500\u252c\u2510","top","\u2502","\u2502\u2502","head","\u251c\u2500\u253c\u2524","head_row","\u2502","\u2502\u2502","mid","\u251c\u2500\u253c\u2524","row","\u251c\u2500\u253c\u2524","foot_row","\u2502","\u2502\u2502","foot","\u2514\u2500\u2534\u2518","bottom","Args",":","box","(","str",")",":","Characters","making","up","box",".","ascii","(","bool",",","optional",")",":","True","if","this","box","uses","ascii","characters","only",".","Default","is","False","."]
docstr: Substitute this box for another if it won't render due to platform issues.
  
  Args:
      options (ConsoleOptions): Console options used in rendering.
      safe (bool, optional): Substitute this for another Box if there are known problems
          displaying on the platform (currently only relevant on Windows). Default is True.
  
  Returns:
      Box: A different Box or the same Box.
docstr_tok: ["Substitute","this","box","for","another","if","it","wo","n't","render","due","to","platform","issues",".","Args",":","options","(","ConsoleOptions",")",":","Console","options","used","in","rendering",".","safe","(","bool",",","optional",")",":","Substitute","this","for","another","Box","if","there","are","known","problems","displaying","on","the","platform","(","currently","only","relevant","on","Windows",")",".","Default","is","True",".","Returns",":","Box",":","A","different","Box","or","the","same","Box","."]
code: def substitute(
      self, options: "ConsoleOptions", safe: bool = True
  ) -> "Box":
      """Substitute this box for another if it won't render due to platform issues.
  
      Args:
          options (ConsoleOptions): Console options used in rendering.
          safe (bool, optional): Substitute this for another Box if there are known problems
              displaying on the platform (currently only relevant on Windows). Default is True.
  
      Returns:
          Box: A different Box or the same Box.
      """
      box = self
      if options.legacy_windows and safe:
          box = LEGACY_WINDOWS_SUBSTITUTIONS.get(box, box)
      if options.ascii_only and not box.ascii:
          box = ASCII
      return box
  
file_path: rich/rich/box.py
imports: import sys
  from typing import TYPE_CHECKING, Iterable, List
  from ._loop import loop_last
label_desc: Use image node_id 4 for calling the Box obj's underlying member method code with example usage: obj.substitute(options, safe) and returns: box