code: def _test_figure_leak():
      import gc
      import sys
  
      import psutil
      from matplotlib import pyplot as plt
  
      # Second argument is pause length, but if zero we should skip pausing
      t = float(sys.argv[1])
      p = psutil.Process()
  
      # Warmup cycle, this reasonably allocates a lot
      for _ in range(2):
          fig = plt.figure()
          if t:
              plt.pause(t)
          plt.close(fig)
      mem = p.memory_info().rss
      gc.collect()
  
      for _ in range(5):
          fig = plt.figure()
          if t:
              plt.pause(t)
          plt.close(fig)
          gc.collect()
      growth = p.memory_info().rss - mem
  
      print(growth)
  
imports: import functools
  import importlib
  import importlib.util
  import inspect
  import json
  import os
  import platform
  import signal
  import subprocess
  import sys
  import tempfile
  import time
  import urllib.request
  from PIL import Image
  import pytest
  import matplotlib
  from matplotlib import _c_internal_utils
  from matplotlib.backend_tools import ToolToggleBase
  from matplotlib.testing import subprocess_run_helper
label_desc: Use image node_id 24 for calling a global function with example usage: _test_figure_leak() without return types