Path 1: 99 calls (0.8)

1def refresh(self) -> None:
2        """Update the display of the Live Render."""
3        with self._lock:
4            self._live_render.set_renderable(self.renderable)
5            if self.console.is_jupyter:  # pragma: no cover
6                try:
7                    from IPython.display import display
8                    from ipywidgets import Output
9                except ImportError:
10                    import warnings
11
12                    warnings.warn('install "ipywidgets" for Jupyter support')
13                else:
14                    if self.ipy_widget is None:
15                        self.ipy_widget = Output()
16                        display(self.ipy_widget)
17
18                    with self.ipy_widget:
19                        self.ipy_widget.clear_output(wait=True)
20                        self.console.print(self._live_render.renderable)
21            elif self.console.is_terminal and not self.console.is_dumb_terminal:
22                with self.console:
23                    self.console.print(Control())
24            elif (
25                not self._started and not self.transient
26            ):  # if it is finished allow files or dumb-terminals to see final result
27                with self.console:
28                    self.console.print(Control())
            

Path 2: 18 calls (0.15)

1def refresh(self) -> None:
2        """Update the display of the Live Render."""
3        with self._lock:
4            self._live_render.set_renderable(self.renderable)
5            if self.console.is_jupyter:  # pragma: no cover
6                try:
7                    from IPython.display import display
8                    from ipywidgets import Output
9                except ImportError:
10                    import warnings
11
12                    warnings.warn('install "ipywidgets" for Jupyter support')
13                else:
14                    if self.ipy_widget is None:
15                        self.ipy_widget = Output()
16                        display(self.ipy_widget)
17
18                    with self.ipy_widget:
19                        self.ipy_widget.clear_output(wait=True)
20                        self.console.print(self._live_render.renderable)
21            elif self.console.is_terminal and not self.console.is_dumb_terminal:
22                with self.console:
23                    self.console.print(Control())
24            elif (
25                not self._started and not self.transient
26            ):  # if it is finished allow files or dumb-terminals to see final result
27                with self.console:
28                    self.console.print(Control())
            

Path 3: 6 calls (0.05)

1def refresh(self) -> None:
2        """Update the display of the Live Render."""
3        with self._lock:
4            self._live_render.set_renderable(self.renderable)
5            if self.console.is_jupyter:  # pragma: no cover
6                try:
7                    from IPython.display import display
8                    from ipywidgets import Output
9                except ImportError:
10                    import warnings
11
12                    warnings.warn('install "ipywidgets" for Jupyter support')
13                else:
14                    if self.ipy_widget is None:
15                        self.ipy_widget = Output()
16                        display(self.ipy_widget)
17
18                    with self.ipy_widget:
19                        self.ipy_widget.clear_output(wait=True)
20                        self.console.print(self._live_render.renderable)
21            elif self.console.is_terminal and not self.console.is_dumb_terminal:
22                with self.console:
23                    self.console.print(Control())
24            elif (
25                not self._started and not self.transient
26            ):  # if it is finished allow files or dumb-terminals to see final result
27                with self.console:
28                    self.console.print(Control())