from course_utils.example import utility_function
utility_function(2)4
The supporting python package is available in the rendering environment, so it can be imported like any other installed package.
In this case the function of utility_function is trivial but it is useful to hide details that are not relevant or that risk being too complicated.
If later you want to show the details one can do
If #| echo: false was to be added to this block it would just show the function definition.
Others can install the Python package in their environment, for example for a Jupyter environment (e.g. Google Colab)