def test_add_background_image():
    import matplotlib.pyplot as plt
    rng = np.random.RandomState(0)
    f, axs = plt.subplots(1, 2)
    x, y = rng.randn(2, 10)
    im = rng.randn(10, 10)
    axs[0].scatter(x, y)
    axs[1].scatter(y, x)
    for ax in axs:
        ax.set_aspect(1)

    # Background without changing aspect
    ax_im = add_background_image(f, im)
    assert_true(ax_im.get_aspect() == 'auto')
    for ax in axs:
        assert_true(ax.get_aspect() == 1)

    # Background with changing aspect
    ax_im_asp = add_background_image(f, im, set_ratios='auto')
    assert_true(ax_im_asp.get_aspect() == 'auto')
    for ax in axs:
        assert_true(ax.get_aspect() == 'auto')
Initialize the lru cache and the static mappings.
dataset/ETHPy150Open mne-tools/mne-python/mne/viz/tests/test_utils.py/test_add_background_image--crossover with--dataset/ETHPy150Open retresco/Spyder/src/spyder/core/dnscache.py/DnsCache.__init__