docs: def bar(msg='', width=40, position=None):
      r"""
      Returns a string with text centered in a bar caption.
  
      Examples:
      >>> bar('test', width=10)
      '== test =='
      >>> bar(width=10)
      '=========='
      >>> bar('Richard Dean Anderson is...', position='top', width=50)
      '//========= Richard Dean Anderson is... ========\\\\'
      >>> bar('...MacGyver', position='bottom', width=50)
      '\\\\================= ...MacGyver ================//'
      """
      if position == 'top':
          start_bar = '//'
          end_bar = r'\\'
      elif position == 'bottom':
          start_bar = r'\\'
          end_bar = '//'
      else:
          start_bar = end_bar = '=='
  
      if msg:
          msg = ' ' + msg + ' '
  
      width -= 4
  
      return start_bar + msg.center(width, '=') + end_bar