code: def view(
      location: str,
      browser: str | None = None,
      new: BrowserTarget = "same",
      autoraise: bool = True,
  ) -> None:
      """Open a browser to view the specified location.
  
      Args:
          location (str) : Location to open
              If location does not begin with "http:" it is assumed
              to be a file path on the local filesystem.
          browser (str or None) : what browser to use (default: None)
              If ``None``, use the system default browser.
          new (str) : How to open the location. Valid values are:
  
              ``'same'`` - open in the current tab
  
              ``'tab'`` - open a new tab in the current window
  
              ``'window'`` - open in a new window
          autoraise (bool) : Whether to automatically raise the location
              in a new browser window (default: True)
  
      Returns:
          None
  
      """
      try:
          new_id = NEW_PARAM[new]
      except KeyError:
          raise RuntimeError(
              f"invalid 'new' value passed to view: {new!r}, valid values are: 'same', 'window', or 'tab'"
          )
  
      if location.startswith("http"):
          url = location
      else:
          url = "file://" + abspath(location)
  
      try:
          controller = get_browser_controller(browser)
          controller.open(url, new=new_id, autoraise=autoraise)
      except Exception:
          pass
  
file_path: bokeh/src/bokeh/util/browser.py
imports: from __future__ import annotations
  import logging
  import webbrowser
  from os.path import abspath
  from typing import Literal, Protocol, cast
  from ..settings import settings
label_desc: Use image node_id 2 for calling a global function with example usage: view(location, browser, new, autoraise) without return types