code: def test_constrained_layout10():
      """Test for handling legend outside axis"""
      fig, axs = plt.subplots(2, 2, layout="constrained")
      for ax in axs.flat:
          ax.plot(np.arange(12), label="This is a label")
      ax.legend(loc="center left", bbox_to_anchor=(0.8, 0.5))
  
imports: import gc
  import numpy
  import pytest
  import matplotlib
  from matplotlib.testing.decorators import image_comparison
  import matplotlib.pyplot
  import matplotlib.transforms
  from matplotlib import gridspec, ticker
label_desc: Use image node_id 13 for calling a global function with example usage: test_constrained_layout10() without return types