if you use a double colon after example, then you can omit ".. code-block:: python" and syntax highlighting should automatically work (assuming no syntax errors or undefined variables)