docstr: Insert a multi-element container.
  
  Inserts an invisible container into your app that can be used to hold
  multiple elements. This allows you to, for example, insert multiple
  elements into your app out of order.
  
  To add elements to the returned container, you can use "with" notation
  (preferred) or just call methods directly on the returned object. See
  examples below.
  
  Parameters
  ----------
  height : int or None
      Desired height of the container expressed in pixels. If None (default)
      the container grows to fit its content. If a fixed height, scrolling is
      enabled for large content, and a grey border is shown around the container
      to visually separate its scroll surface from the rest of the app.
  
      .. note::
          Use containers with scroll sparingly. If you do, try to keep
          the height small (below 500 pixels). Otherwise, the scroll
          surface of the container might cover the majority of the screen
          on mobile devices, which makes it hard to scroll the rest of the app.
  
  border : bool or None
      Whether to show a border around the container. If None (default), a
      border is shown automatically if the container is set to a fixed height,
      so you can visually distinguish the scroll surfaces.
  
  
  Examples
  --------
  Inserting elements using "with" notation:
  
  >>> import streamlit as st
  >>>
  >>> with st.container():
  ...    st.write("This is inside the container")
  ...
  ...    # You can call any Streamlit command, including custom components:
  ...    st.bar_chart(np.random.randn(50, 3))
  ...
  >>> st.write("This is outside the container")
  
  .. output ::
      https://doc-container1.streamlit.app/
      height: 520px
  
  Inserting elements out of order:
  
  >>> import streamlit as st
  >>>
  >>> container = st.container(border=True)
  >>> container.write("This is inside the container")
  >>> st.write("This is outside the container")
  >>>
  >>> # Now insert some more in the container
  >>> container.write("This is inside too")
  
  .. output ::
      https://doc-container2.streamlit.app/
      height: 300px
  
  Using ``height`` to make a grid:
  
  >>> import streamlit as st
  >>>
  >>> row1 = st.columns(3)
  >>> row2 = st.columns(3)
  >>>
  >>> for col in row1 + row2:
  >>>     tile = col.container(height=120, border=True)
  >>>     tile.title(":balloon:")
  
  .. output ::
      https://doc-container3.streamlit.app/
      height: 350px
  
  Using ``height`` to create a scrolling container for long content:
  
  >>> import streamlit as st
  >>>
  >>> long_text = "Lorem ipsum. " * 1000
  >>>
  >>> with st.container(height=300):
  >>>     st.markdown(long_text)
  
  .. output ::
      https://doc-container4.streamlit.app/
      height: 400px
code: def container(
      self, *, height: int | None = None, border: bool | None = None
  ) -> "DeltaGenerator":
      """Insert a multi-element container.
  
      Inserts an invisible container into your app that can be used to hold
      multiple elements. This allows you to, for example, insert multiple
      elements into your app out of order.
  
      To add elements to the returned container, you can use "with" notation
      (preferred) or just call methods directly on the returned object. See
      examples below.
  
      Parameters
      ----------
      height : int or None
          Desired height of the container expressed in pixels. If None (default)
          the container grows to fit its content. If a fixed height, scrolling is
          enabled for large content, and a grey border is shown around the container
          to visually separate its scroll surface from the rest of the app.
  
          .. note::
              Use containers with scroll sparingly. If you do, try to keep
              the height small (below 500 pixels). Otherwise, the scroll
              surface of the container might cover the majority of the screen
              on mobile devices, which makes it hard to scroll the rest of the app.
  
      border : bool or None
          Whether to show a border around the container. If None (default), a
          border is shown automatically if the container is set to a fixed height,
          so you can visually distinguish the scroll surfaces.
  
  
      Examples
      --------
      Inserting elements using "with" notation:
  
      >>> import streamlit as st
      >>>
      >>> with st.container():
      ...    st.write("This is inside the container")
      ...
      ...    # You can call any Streamlit command, including custom components:
      ...    st.bar_chart(np.random.randn(50, 3))
      ...
      >>> st.write("This is outside the container")
  
      .. output ::
          https://doc-container1.streamlit.app/
          height: 520px
  
      Inserting elements out of order:
  
      >>> import streamlit as st
      >>>
      >>> container = st.container(border=True)
      >>> container.write("This is inside the container")
      >>> st.write("This is outside the container")
      >>>
      >>> # Now insert some more in the container
      >>> container.write("This is inside too")
  
      .. output ::
          https://doc-container2.streamlit.app/
          height: 300px
  
      Using ``height`` to make a grid:
  
      >>> import streamlit as st
      >>>
      >>> row1 = st.columns(3)
      >>> row2 = st.columns(3)
      >>>
      >>> for col in row1 + row2:
      >>>     tile = col.container(height=120, border=True)
      >>>     tile.title(":balloon:")
  
      .. output ::
          https://doc-container3.streamlit.app/
          height: 350px
  
      Using ``height`` to create a scrolling container for long content:
  
      >>> import streamlit as st
      >>>
      >>> long_text = "Lorem ipsum. " * 1000
      >>>
      >>> with st.container(height=300):
      >>>     st.markdown(long_text)
  
      .. output ::
          https://doc-container4.streamlit.app/
          height: 400px
  
      """
      block_proto = BlockProto()
      block_proto.allow_empty = False
      block_proto.vertical.border = border or False
      if height:
          # Activate scrolling container behavior:
          block_proto.allow_empty = True
          block_proto.vertical.height = height
          if border is None:
              # If border is None, we activated the
              # border as default setting for scrolling
              # containers.
              block_proto.vertical.border = True
  
      return self.dg._block(block_proto)
  
file_path: streamlit/lib/streamlit/elements/layouts.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, List, Literal, Optional, Sequence, Union, cast
  from streamlit.errors import StreamlitAPIException
  from streamlit.proto.Block_pb2 import Block
  from streamlit.runtime.metrics_util import gather_metrics
label_desc: Use image node_id 1 for calling the LayoutsMixin obj's underlying member method code with example usage: obj.container() and returns: self