@_with_element
def code(self, element, body, language='python'):
    'Display a code block with optional syntax highlighting.\n\n        (This is a convenience wrapper around `st.markdown()`)\n\n        Parameters\n        ----------\n        body : str\n            The string to display as code.\n\n        language : str\n            The language that the code is written in, for syntax highlighting.\n            If omitted, the code will be unstyled.\n\n        Example\n        -------\n        >>> code = \'\'\'def hello():\n        ...     print("Hello, Streamlit!")\'\'\'\n        >>> st.code(code, language=\'python\')\n\n        .. output::\n           https://share.streamlit.io/0.27.0-kBtt/index.html?id=VDRnaCEZWSBCNUd5gNQZv2\n           height: 100px\n\n        '
    markdown = ('```%(language)s\n%(body)s\n```' % {'language': (language or ''), 'body': body})
    element.markdown.body = _clean_text(markdown)
Display a code block with optional syntax highlighting.

(This is a convenience wrapper around `st.markdown()`)

Parameters
----------
body : str
    The string to display as code.

language : str
    The language that the code is written in, for syntax highlighting.
    If omitted, the code will be unstyled.

Example
-------
>>> code = '''def hello():
...     print("Hello, Streamlit!")'''
>>> st.code(code, language='python')

.. output::
   https://share.streamlit.io/0.27.0-kBtt/index.html?id=VDRnaCEZWSBCNUd5gNQZv2
   height: 100px
@_with_element
def code(self, element, body, language='python'):
    'Display a code block with optional syntax highlighting.\n\n        (This is a convenience wrapper around `st.markdown()`)\n\n        Parameters\n        ----------\n        body : str\n            The string to display as code.\n\n        language : str\n            The language that the code is written in, for syntax highlighting.\n            If omitted, the code will be unstyled.\n\n        Example\n        -------\n        >>> code = \'\'\'def hello():\n        ...     print("Hello, Streamlit!")\'\'\'\n        >>> st.code(code, language=\'python\')\n\n        .. output::\n           https://share.streamlit.io/0.27.0-kBtt/index.html?id=VDRnaCEZWSBCNUd5gNQZv2\n           height: 100px\n\n        '
    markdown = ('```%(language)s\n%(body)s\n```' % {'language': (language or ), 'body': body})
    element.markdown.body = _clean_text(markdown)