def __set_current_image(ax, img):
if ax is None:<EOL><INDENT>import matplotlib.pyplot as plt<EOL>plt.sci(img)<EOL><DEDENT>
Helper to set the current image in pyplot mode.

    If the provided `ax` is not `None`, then we assume that the user is using the object API.
    In this case, the pyplot current image is not set.