We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
deprecate bokeh.models.layouts HBox and VBox


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `bokeh/models/layouts.py`
Content:
```
1 ''' Various kinds of layout components.
2 
3 '''
4 from __future__ import absolute_import
5 
6 import logging
7 logger = logging.getLogger(__name__)
8 
9 from ..core.enums import SizingMode
10 from ..core.has_props import abstract
11 from ..core.properties import Bool, Enum, Int, Instance, List, Seq, String
12 from ..core.validation import warning
13 from ..core.validation.warnings import BOTH_CHILD_AND_ROOT, EMPTY_LAYOUT
14 from ..embed import notebook_div
15 from ..model import Model
16 
17 @abstract
18 class LayoutDOM(Model):
19     ''' An abstract base class for layout components.
20 
21     '''
22 
23     width = Int(help="""
24     An optional width for the component (in pixels).
25     """)
26 
27     height = Int(help="""
28     An optional height for the component (in pixels).
29     """)
30 
31     disabled = Bool(False, help="""
32     Whether the widget will be disabled when rendered. If ``True``,
33     the widget will be greyed-out, and not respond to UI events.
34     """)
35 
36     sizing_mode = Enum(SizingMode, default="fixed", help="""
37     How the item being displayed should size itself. Possible values are
38     ``"fixed"``, ``"scale_width"``, ``"scale_height"``, ``"scale_both"``, and
39     ``"stretch_both"``.
40 
41     ``"stretch_both"`` elements are completely responsive (independently in width and height) and
42     will resize to occupy all available space, even if this changes the aspect ratio of the element.
43     This is sometimes called outside-in, and is a typical behavior for desktop applications.
44 
45     ``"fixed"`` elements are not responsive. They will retain their original width and height
46     regardless of any subsequent browser window resize events.
47 
48     ``"scale_width"`` elements will responsively resize to fit to the width available, *while
49     maintaining the original aspect ratio*. This is a typical behavior for modern websites. For a
50     ``Plot``, the aspect ratio ``plot_width/plot_height`` is maintained.
51 
52     ``"scale_height"`` elements will responsively resize to fit to the height available, *while
53     maintaining the original aspect ratio*. For a ``Plot``, the aspect ratio
54     ``plot_width/plot_height`` is maintained. A plot with ``"scale_height"`` mode needs
55     to be wrapped in a ``Row`` or ``Column`` to be responsive.
56 
57     ``"scale_both"`` elements will responsively resize to for both the width and height available,
58     *while maintaining the original aspect ratio*.
59 
60     """)
61 
62     css_classes = Seq(String, help="""
63     A list of css class names to add to this DOM element. Note: the class names are
64     simply added as-is, no other guarantees are provided.
65     """)
66 
67     @property
68     def html(self):
69         from IPython.core.display import HTML
70         return HTML(notebook_div(self))
71 
72 
73 class Spacer(LayoutDOM):
74     ''' A container for space used to fill an empty spot in a row or column.
75 
76     '''
77 
78 
79 class WidgetBox(LayoutDOM):
80     ''' A container for widgets that are part of a layout.
81 
82     '''
83     def __init__(self, *args, **kwargs):
84         if len(args) > 0 and "children" in kwargs:
85             raise ValueError("'children' keyword cannot be used with positional arguments")
86         elif len(args) > 0:
87             kwargs["children"] = list(args)
88         super(WidgetBox, self).__init__(**kwargs)
89 
90     @warning(EMPTY_LAYOUT)
91     def _check_empty_layout(self):
92         from itertools import chain
93         if not list(chain(self.children)):
94             return str(self)
95 
96     @warning(BOTH_CHILD_AND_ROOT)
97     def _check_child_is_also_root(self):
98         problems = []
99         for c in self.children:
100             if c.document is not None and c in c.document.roots:
101                 problems.append(str(c))
102         if problems:
103             return ", ".join(problems)
104         else:
105             return None
106 
107     children = List(Instance('bokeh.models.widgets.Widget'), help="""
108     The list of widgets to put in the layout box.
109     """)
110 
111 
112 @abstract
113 class Box(LayoutDOM):
114     ''' Abstract base class for Row and Column. Do not use directly.
115 
116     '''
117 
118     def __init__(self, *args, **kwargs):
119 
120         if len(args) > 0 and "children" in kwargs:
121             raise ValueError("'children' keyword cannot be used with positional arguments")
122         elif len(args) > 0:
123             kwargs["children"] = list(args)
124 
125         unwrapped_children = kwargs.get("children", [])
126         kwargs["children"] = self._wrap_children(unwrapped_children)
127         super(Box, self).__init__(**kwargs)
128 
129     def _wrap_children(self, children):
130         ''' Wrap any Widgets of a list of child layouts in a WidgetBox.
131         This allows for the convenience of just spelling Row(button1, button2).
132         '''
133         from .widgets.widget import Widget
134         wrapped_children = []
135         for child in children:
136             if isinstance(child, Widget):
137                 child = WidgetBox(
138                     children=[child],
139                     sizing_mode=child.sizing_mode,
140                     width=child.width,
141                     height=child.height,
142                     disabled=child.disabled
143                 )
144             wrapped_children.append(child)
145         return wrapped_children
146 
147     @warning(EMPTY_LAYOUT)
148     def _check_empty_layout(self):
149         from itertools import chain
150         if not list(chain(self.children)):
151             return str(self)
152 
153     @warning(BOTH_CHILD_AND_ROOT)
154     def _check_child_is_also_root(self):
155         problems = []
156         for c in self.children:
157             if c.document is not None and c in c.document.roots:
158                 problems.append(str(c))
159         if problems:
160             return ", ".join(problems)
161         else:
162             return None
163 
164     #TODO Debating the following instead to prevent people adding just a plain
165     #     widget into a box, which sometimes works and sometimes looks disastrous
166     #children = List(
167     #    Either(
168     #        Instance('bokeh.models.layouts.Row'),
169     #        Instance('bokeh.models.layouts.Column'),
170     #        Instance('bokeh.models.plots.Plot'),
171     #        Instance('bokeh.models.layouts.WidgetBox')
172     #    ), help="""
173     #    The list of children, which can be other components including plots, rows, columns, and widgets.
174     #""")
175     children = List(Instance(LayoutDOM), help="""
176     The list of children, which can be other components including plots, rows, columns, and widgets.
177     """)
178 
179 
180 class Row(Box):
181     ''' Lay out child components in a single horizontal row.
182 
183     Children can be specified as positional arguments, as a single argument
184     that is a sequence, or using the ``children`` keyword argument.
185     '''
186 
187 
188 class Column(Box):
189     ''' Lay out child components in a single vertical row.
190 
191     Children can be specified as positional arguments, as a single argument
192     that is a sequence, or using the ``children`` keyword argument.
193     '''
194 
195 
196 def HBox(*args, **kwargs):
197     ''' Lay out child components in a single horizontal row.
198 
199     Children can be specified as positional arguments, as a single argument
200     that is a sequence, or using the ``children`` keyword argument.
201 
202     Returns a Row instance.
203     '''
204     return Row(*args, **kwargs)
205 
206 
207 def VBox(*args, **kwargs):
208     ''' Lay out child components in a single vertical row.
209 
210     Children can be specified as positional arguments, as a single argument
211     that is a sequence, or using the ``children`` keyword argument.
212 
213     Returns a Column instance.
214     '''
215     return Column(*args, **kwargs)
216
```

Path: `bokeh/models/widgets/panels.py`
Content:
```
1 ''' Various kinds of panel widgets.
2 
3 '''
4 from __future__ import absolute_import
5 
6 from ...core.properties import Bool, Instance, Int, List, String
7 
8 from ..callbacks import Callback
9 from ..layouts import LayoutDOM
10 
11 from .widget import Widget
12 
13 class Panel(Widget):
14     ''' A single-widget container with title bar and controls.
15 
16     '''
17 
18     title = String(default="", help="""
19     An optional text title of the panel.
20     """)
21 
22     child = Instance(LayoutDOM, help="""
23     The child widget. If you need more children, use a layout widget,
24     e.g. ``HBox`` or ``VBox``.
25     """)
26 
27     closable = Bool(False, help="""
28     Whether this panel is closeable or not. If True, an "x" button will
29     appear.
30     """)
31 
32 class Tabs(Widget):
33     ''' A panel widget with navigation tabs.
34 
35     '''
36 
37     __example__ = "sphinx/source/docs/user_guide/examples/interaction_tab_panes.py"
38 
39     tabs = List(Instance(Panel), help="""
40     The list of child panel widgets.
41     """)
42 
43     active = Int(0, help="""
44     The index of the active tab.
45     """)
46 
47     callback = Instance(Callback, help="""
48     A callback to run in the browser whenever the button is activated.
49     """)
50
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/bokeh/models/layouts.py b/bokeh/models/layouts.py
--- a/bokeh/models/layouts.py
+++ b/bokeh/models/layouts.py
@@ -13,6 +13,7 @@
 from ..core.validation.warnings import BOTH_CHILD_AND_ROOT, EMPTY_LAYOUT
 from ..embed import notebook_div
 from ..model import Model
+from ..util.deprecation import deprecated
 
 @abstract
 class LayoutDOM(Model):
@@ -201,6 +202,7 @@
 
     Returns a Row instance.
     '''
+    deprecated((0, 12, 5), 'bokeh.models.HBox', 'bokeh.models.Row')
     return Row(*args, **kwargs)
 
 
@@ -212,4 +214,5 @@
 
     Returns a Column instance.
     '''
+    deprecated((0, 12, 5), 'bokeh.models.VBox', 'bokeh.models.Column')
     return Column(*args, **kwargs)
diff --git a/bokeh/models/widgets/panels.py b/bokeh/models/widgets/panels.py
--- a/bokeh/models/widgets/panels.py
+++ b/bokeh/models/widgets/panels.py
@@ -21,7 +21,7 @@
 
     child = Instance(LayoutDOM, help="""
     The child widget. If you need more children, use a layout widget,
-    e.g. ``HBox`` or ``VBox``.
+    e.g. ``Row`` or ``Column``.
     """)
 
     closable = Bool(False, help="""

{"golden_diff": "diff --git a/bokeh/models/layouts.py b/bokeh/models/layouts.py\n--- a/bokeh/models/layouts.py\n+++ b/bokeh/models/layouts.py\n@@ -13,6 +13,7 @@\n from ..core.validation.warnings import BOTH_CHILD_AND_ROOT, EMPTY_LAYOUT\n from ..embed import notebook_div\n from ..model import Model\n+from ..util.deprecation import deprecated\n \n @abstract\n class LayoutDOM(Model):\n@@ -201,6 +202,7 @@\n \n     Returns a Row instance.\n     '''\n+    deprecated((0, 12, 5), 'bokeh.models.HBox', 'bokeh.models.Row')\n     return Row(*args, **kwargs)\n \n \n@@ -212,4 +214,5 @@\n \n     Returns a Column instance.\n     '''\n+    deprecated((0, 12, 5), 'bokeh.models.VBox', 'bokeh.models.Column')\n     return Column(*args, **kwargs)\ndiff --git a/bokeh/models/widgets/panels.py b/bokeh/models/widgets/panels.py\n--- a/bokeh/models/widgets/panels.py\n+++ b/bokeh/models/widgets/panels.py\n@@ -21,7 +21,7 @@\n \n     child = Instance(LayoutDOM, help=\"\"\"\n     The child widget. If you need more children, use a layout widget,\n-    e.g. ``HBox`` or ``VBox``.\n+    e.g. ``Row`` or ``Column``.\n     \"\"\")\n \n     closable = Bool(False, help=\"\"\"\n", "issue": "deprecate bokeh.models.layouts HBox and VBox\n\n", "before_files": [{"content": "''' Various kinds of layout components.\n\n'''\nfrom __future__ import absolute_import\n\nimport logging\nlogger = logging.getLogger(__name__)\n\nfrom ..core.enums import SizingMode\nfrom ..core.has_props import abstract\nfrom ..core.properties import Bool, Enum, Int, Instance, List, Seq, String\nfrom ..core.validation import warning\nfrom ..core.validation.warnings import BOTH_CHILD_AND_ROOT, EMPTY_LAYOUT\nfrom ..embed import notebook_div\nfrom ..model import Model\n\n@abstract\nclass LayoutDOM(Model):\n    ''' An abstract base class for layout components.\n\n    '''\n\n    width = Int(help=\"\"\"\n    An optional width for the component (in pixels).\n    \"\"\")\n\n    height = Int(help=\"\"\"\n    An optional height for the component (in pixels).\n    \"\"\")\n\n    disabled = Bool(False, help=\"\"\"\n    Whether the widget will be disabled when rendered. If ``True``,\n    the widget will be greyed-out, and not respond to UI events.\n    \"\"\")\n\n    sizing_mode = Enum(SizingMode, default=\"fixed\", help=\"\"\"\n    How the item being displayed should size itself. Possible values are\n    ``\"fixed\"``, ``\"scale_width\"``, ``\"scale_height\"``, ``\"scale_both\"``, and\n    ``\"stretch_both\"``.\n\n    ``\"stretch_both\"`` elements are completely responsive (independently in width and height) and\n    will resize to occupy all available space, even if this changes the aspect ratio of the element.\n    This is sometimes called outside-in, and is a typical behavior for desktop applications.\n\n    ``\"fixed\"`` elements are not responsive. They will retain their original width and height\n    regardless of any subsequent browser window resize events.\n\n    ``\"scale_width\"`` elements will responsively resize to fit to the width available, *while\n    maintaining the original aspect ratio*. This is a typical behavior for modern websites. For a\n    ``Plot``, the aspect ratio ``plot_width/plot_height`` is maintained.\n\n    ``\"scale_height\"`` elements will responsively resize to fit to the height available, *while\n    maintaining the original aspect ratio*. For a ``Plot``, the aspect ratio\n    ``plot_width/plot_height`` is maintained. A plot with ``\"scale_height\"`` mode needs\n    to be wrapped in a ``Row`` or ``Column`` to be responsive.\n\n    ``\"scale_both\"`` elements will responsively resize to for both the width and height available,\n    *while maintaining the original aspect ratio*.\n\n    \"\"\")\n\n    css_classes = Seq(String, help=\"\"\"\n    A list of css class names to add to this DOM element. Note: the class names are\n    simply added as-is, no other guarantees are provided.\n    \"\"\")\n\n    @property\n    def html(self):\n        from IPython.core.display import HTML\n        return HTML(notebook_div(self))\n\n\nclass Spacer(LayoutDOM):\n    ''' A container for space used to fill an empty spot in a row or column.\n\n    '''\n\n\nclass WidgetBox(LayoutDOM):\n    ''' A container for widgets that are part of a layout.\n\n    '''\n    def __init__(self, *args, **kwargs):\n        if len(args) > 0 and \"children\" in kwargs:\n            raise ValueError(\"'children' keyword cannot be used with positional arguments\")\n        elif len(args) > 0:\n            kwargs[\"children\"] = list(args)\n        super(WidgetBox, self).__init__(**kwargs)\n\n    @warning(EMPTY_LAYOUT)\n    def _check_empty_layout(self):\n        from itertools import chain\n        if not list(chain(self.children)):\n            return str(self)\n\n    @warning(BOTH_CHILD_AND_ROOT)\n    def _check_child_is_also_root(self):\n        problems = []\n        for c in self.children:\n            if c.document is not None and c in c.document.roots:\n                problems.append(str(c))\n        if problems:\n            return \", \".join(problems)\n        else:\n            return None\n\n    children = List(Instance('bokeh.models.widgets.Widget'), help=\"\"\"\n    The list of widgets to put in the layout box.\n    \"\"\")\n\n\n@abstract\nclass Box(LayoutDOM):\n    ''' Abstract base class for Row and Column. Do not use directly.\n\n    '''\n\n    def __init__(self, *args, **kwargs):\n\n        if len(args) > 0 and \"children\" in kwargs:\n            raise ValueError(\"'children' keyword cannot be used with positional arguments\")\n        elif len(args) > 0:\n            kwargs[\"children\"] = list(args)\n\n        unwrapped_children = kwargs.get(\"children\", [])\n        kwargs[\"children\"] = self._wrap_children(unwrapped_children)\n        super(Box, self).__init__(**kwargs)\n\n    def _wrap_children(self, children):\n        ''' Wrap any Widgets of a list of child layouts in a WidgetBox.\n        This allows for the convenience of just spelling Row(button1, button2).\n        '''\n        from .widgets.widget import Widget\n        wrapped_children = []\n        for child in children:\n            if isinstance(child, Widget):\n                child = WidgetBox(\n                    children=[child],\n                    sizing_mode=child.sizing_mode,\n                    width=child.width,\n                    height=child.height,\n                    disabled=child.disabled\n                )\n            wrapped_children.append(child)\n        return wrapped_children\n\n    @warning(EMPTY_LAYOUT)\n    def _check_empty_layout(self):\n        from itertools import chain\n        if not list(chain(self.children)):\n            return str(self)\n\n    @warning(BOTH_CHILD_AND_ROOT)\n    def _check_child_is_also_root(self):\n        problems = []\n        for c in self.children:\n            if c.document is not None and c in c.document.roots:\n                problems.append(str(c))\n        if problems:\n            return \", \".join(problems)\n        else:\n            return None\n\n    #TODO Debating the following instead to prevent people adding just a plain\n    #     widget into a box, which sometimes works and sometimes looks disastrous\n    #children = List(\n    #    Either(\n    #        Instance('bokeh.models.layouts.Row'),\n    #        Instance('bokeh.models.layouts.Column'),\n    #        Instance('bokeh.models.plots.Plot'),\n    #        Instance('bokeh.models.layouts.WidgetBox')\n    #    ), help=\"\"\"\n    #    The list of children, which can be other components including plots, rows, columns, and widgets.\n    #\"\"\")\n    children = List(Instance(LayoutDOM), help=\"\"\"\n    The list of children, which can be other components including plots, rows, columns, and widgets.\n    \"\"\")\n\n\nclass Row(Box):\n    ''' Lay out child components in a single horizontal row.\n\n    Children can be specified as positional arguments, as a single argument\n    that is a sequence, or using the ``children`` keyword argument.\n    '''\n\n\nclass Column(Box):\n    ''' Lay out child components in a single vertical row.\n\n    Children can be specified as positional arguments, as a single argument\n    that is a sequence, or using the ``children`` keyword argument.\n    '''\n\n\ndef HBox(*args, **kwargs):\n    ''' Lay out child components in a single horizontal row.\n\n    Children can be specified as positional arguments, as a single argument\n    that is a sequence, or using the ``children`` keyword argument.\n\n    Returns a Row instance.\n    '''\n    return Row(*args, **kwargs)\n\n\ndef VBox(*args, **kwargs):\n    ''' Lay out child components in a single vertical row.\n\n    Children can be specified as positional arguments, as a single argument\n    that is a sequence, or using the ``children`` keyword argument.\n\n    Returns a Column instance.\n    '''\n    return Column(*args, **kwargs)\n", "path": "bokeh/models/layouts.py"}, {"content": "''' Various kinds of panel widgets.\n\n'''\nfrom __future__ import absolute_import\n\nfrom ...core.properties import Bool, Instance, Int, List, String\n\nfrom ..callbacks import Callback\nfrom ..layouts import LayoutDOM\n\nfrom .widget import Widget\n\nclass Panel(Widget):\n    ''' A single-widget container with title bar and controls.\n\n    '''\n\n    title = String(default=\"\", help=\"\"\"\n    An optional text title of the panel.\n    \"\"\")\n\n    child = Instance(LayoutDOM, help=\"\"\"\n    The child widget. If you need more children, use a layout widget,\n    e.g. ``HBox`` or ``VBox``.\n    \"\"\")\n\n    closable = Bool(False, help=\"\"\"\n    Whether this panel is closeable or not. If True, an \"x\" button will\n    appear.\n    \"\"\")\n\nclass Tabs(Widget):\n    ''' A panel widget with navigation tabs.\n\n    '''\n\n    __example__ = \"sphinx/source/docs/user_guide/examples/interaction_tab_panes.py\"\n\n    tabs = List(Instance(Panel), help=\"\"\"\n    The list of child panel widgets.\n    \"\"\")\n\n    active = Int(0, help=\"\"\"\n    The index of the active tab.\n    \"\"\")\n\n    callback = Instance(Callback, help=\"\"\"\n    A callback to run in the browser whenever the button is activated.\n    \"\"\")\n", "path": "bokeh/models/widgets/panels.py"}], "after_files": [{"content": "''' Various kinds of layout components.\n\n'''\nfrom __future__ import absolute_import\n\nimport logging\nlogger = logging.getLogger(__name__)\n\nfrom ..core.enums import SizingMode\nfrom ..core.has_props import abstract\nfrom ..core.properties import Bool, Enum, Int, Instance, List, Seq, String\nfrom ..core.validation import warning\nfrom ..core.validation.warnings import BOTH_CHILD_AND_ROOT, EMPTY_LAYOUT\nfrom ..embed import notebook_div\nfrom ..model import Model\nfrom ..util.deprecation import deprecated\n\n@abstract\nclass LayoutDOM(Model):\n    ''' An abstract base class for layout components.\n\n    '''\n\n    width = Int(help=\"\"\"\n    An optional width for the component (in pixels).\n    \"\"\")\n\n    height = Int(help=\"\"\"\n    An optional height for the component (in pixels).\n    \"\"\")\n\n    disabled = Bool(False, help=\"\"\"\n    Whether the widget will be disabled when rendered. If ``True``,\n    the widget will be greyed-out, and not respond to UI events.\n    \"\"\")\n\n    sizing_mode = Enum(SizingMode, default=\"fixed\", help=\"\"\"\n    How the item being displayed should size itself. Possible values are\n    ``\"fixed\"``, ``\"scale_width\"``, ``\"scale_height\"``, ``\"scale_both\"``, and\n    ``\"stretch_both\"``.\n\n    ``\"stretch_both\"`` elements are completely responsive (independently in width and height) and\n    will resize to occupy all available space, even if this changes the aspect ratio of the element.\n    This is sometimes called outside-in, and is a typical behavior for desktop applications.\n\n    ``\"fixed\"`` elements are not responsive. They will retain their original width and height\n    regardless of any subsequent browser window resize events.\n\n    ``\"scale_width\"`` elements will responsively resize to fit to the width available, *while\n    maintaining the original aspect ratio*. This is a typical behavior for modern websites. For a\n    ``Plot``, the aspect ratio ``plot_width/plot_height`` is maintained.\n\n    ``\"scale_height\"`` elements will responsively resize to fit to the height available, *while\n    maintaining the original aspect ratio*. For a ``Plot``, the aspect ratio\n    ``plot_width/plot_height`` is maintained. A plot with ``\"scale_height\"`` mode needs\n    to be wrapped in a ``Row`` or ``Column`` to be responsive.\n\n    ``\"scale_both\"`` elements will responsively resize to for both the width and height available,\n    *while maintaining the original aspect ratio*.\n\n    \"\"\")\n\n    css_classes = Seq(String, help=\"\"\"\n    A list of css class names to add to this DOM element. Note: the class names are\n    simply added as-is, no other guarantees are provided.\n    \"\"\")\n\n    @property\n    def html(self):\n        from IPython.core.display import HTML\n        return HTML(notebook_div(self))\n\n\nclass Spacer(LayoutDOM):\n    ''' A container for space used to fill an empty spot in a row or column.\n\n    '''\n\n\nclass WidgetBox(LayoutDOM):\n    ''' A container for widgets that are part of a layout.\n\n    '''\n    def __init__(self, *args, **kwargs):\n        if len(args) > 0 and \"children\" in kwargs:\n            raise ValueError(\"'children' keyword cannot be used with positional arguments\")\n        elif len(args) > 0:\n            kwargs[\"children\"] = list(args)\n        super(WidgetBox, self).__init__(**kwargs)\n\n    @warning(EMPTY_LAYOUT)\n    def _check_empty_layout(self):\n        from itertools import chain\n        if not list(chain(self.children)):\n            return str(self)\n\n    @warning(BOTH_CHILD_AND_ROOT)\n    def _check_child_is_also_root(self):\n        problems = []\n        for c in self.children:\n            if c.document is not None and c in c.document.roots:\n                problems.append(str(c))\n        if problems:\n            return \", \".join(problems)\n        else:\n            return None\n\n    children = List(Instance('bokeh.models.widgets.Widget'), help=\"\"\"\n    The list of widgets to put in the layout box.\n    \"\"\")\n\n\n@abstract\nclass Box(LayoutDOM):\n    ''' Abstract base class for Row and Column. Do not use directly.\n\n    '''\n\n    def __init__(self, *args, **kwargs):\n\n        if len(args) > 0 and \"children\" in kwargs:\n            raise ValueError(\"'children' keyword cannot be used with positional arguments\")\n        elif len(args) > 0:\n            kwargs[\"children\"] = list(args)\n\n        unwrapped_children = kwargs.get(\"children\", [])\n        kwargs[\"children\"] = self._wrap_children(unwrapped_children)\n        super(Box, self).__init__(**kwargs)\n\n    def _wrap_children(self, children):\n        ''' Wrap any Widgets of a list of child layouts in a WidgetBox.\n        This allows for the convenience of just spelling Row(button1, button2).\n        '''\n        from .widgets.widget import Widget\n        wrapped_children = []\n        for child in children:\n            if isinstance(child, Widget):\n                child = WidgetBox(\n                    children=[child],\n                    sizing_mode=child.sizing_mode,\n                    width=child.width,\n                    height=child.height,\n                    disabled=child.disabled\n                )\n            wrapped_children.append(child)\n        return wrapped_children\n\n    @warning(EMPTY_LAYOUT)\n    def _check_empty_layout(self):\n        from itertools import chain\n        if not list(chain(self.children)):\n            return str(self)\n\n    @warning(BOTH_CHILD_AND_ROOT)\n    def _check_child_is_also_root(self):\n        problems = []\n        for c in self.children:\n            if c.document is not None and c in c.document.roots:\n                problems.append(str(c))\n        if problems:\n            return \", \".join(problems)\n        else:\n            return None\n\n    #TODO Debating the following instead to prevent people adding just a plain\n    #     widget into a box, which sometimes works and sometimes looks disastrous\n    #children = List(\n    #    Either(\n    #        Instance('bokeh.models.layouts.Row'),\n    #        Instance('bokeh.models.layouts.Column'),\n    #        Instance('bokeh.models.plots.Plot'),\n    #        Instance('bokeh.models.layouts.WidgetBox')\n    #    ), help=\"\"\"\n    #    The list of children, which can be other components including plots, rows, columns, and widgets.\n    #\"\"\")\n    children = List(Instance(LayoutDOM), help=\"\"\"\n    The list of children, which can be other components including plots, rows, columns, and widgets.\n    \"\"\")\n\n\nclass Row(Box):\n    ''' Lay out child components in a single horizontal row.\n\n    Children can be specified as positional arguments, as a single argument\n    that is a sequence, or using the ``children`` keyword argument.\n    '''\n\n\nclass Column(Box):\n    ''' Lay out child components in a single vertical row.\n\n    Children can be specified as positional arguments, as a single argument\n    that is a sequence, or using the ``children`` keyword argument.\n    '''\n\n\ndef HBox(*args, **kwargs):\n    ''' Lay out child components in a single horizontal row.\n\n    Children can be specified as positional arguments, as a single argument\n    that is a sequence, or using the ``children`` keyword argument.\n\n    Returns a Row instance.\n    '''\n    deprecated((0, 12, 5), 'bokeh.models.HBox', 'bokeh.models.Row')\n    return Row(*args, **kwargs)\n\n\ndef VBox(*args, **kwargs):\n    ''' Lay out child components in a single vertical row.\n\n    Children can be specified as positional arguments, as a single argument\n    that is a sequence, or using the ``children`` keyword argument.\n\n    Returns a Column instance.\n    '''\n    deprecated((0, 12, 5), 'bokeh.models.VBox', 'bokeh.models.Column')\n    return Column(*args, **kwargs)\n", "path": "bokeh/models/layouts.py"}, {"content": "''' Various kinds of panel widgets.\n\n'''\nfrom __future__ import absolute_import\n\nfrom ...core.properties import Bool, Instance, Int, List, String\n\nfrom ..callbacks import Callback\nfrom ..layouts import LayoutDOM\n\nfrom .widget import Widget\n\nclass Panel(Widget):\n    ''' A single-widget container with title bar and controls.\n\n    '''\n\n    title = String(default=\"\", help=\"\"\"\n    An optional text title of the panel.\n    \"\"\")\n\n    child = Instance(LayoutDOM, help=\"\"\"\n    The child widget. If you need more children, use a layout widget,\n    e.g. ``Row`` or ``Column``.\n    \"\"\")\n\n    closable = Bool(False, help=\"\"\"\n    Whether this panel is closeable or not. If True, an \"x\" button will\n    appear.\n    \"\"\")\n\nclass Tabs(Widget):\n    ''' A panel widget with navigation tabs.\n\n    '''\n\n    __example__ = \"sphinx/source/docs/user_guide/examples/interaction_tab_panes.py\"\n\n    tabs = List(Instance(Panel), help=\"\"\"\n    The list of child panel widgets.\n    \"\"\")\n\n    active = Int(0, help=\"\"\"\n    The index of the active tab.\n    \"\"\")\n\n    callback = Instance(Callback, help=\"\"\"\n    A callback to run in the browser whenever the button is activated.\n    \"\"\")\n", "path": "bokeh/models/widgets/panels.py"}]}