code: def test_nuts_tuning():
      with pm.Model():
          pm.Normal("mu", mu=0, sigma=1)
          step = pm.NUTS()
          with warnings.catch_warnings():
              warnings.filterwarnings(
                  "ignore", ".*number of samples.*", UserWarning
              )
              idata = pm.sample(
                  10,
                  step=step,
                  tune=5,
                  discard_tuned_samples=False,
                  progressbar=False,
                  chains=1,
              )
  
      assert not step.tune
      ss_tuned = idata.warmup_sample_stats["step_size"][0, -1]
      ss_posterior = idata.sample_stats["step_size"][0, :]
      np.testing.assert_array_equal(ss_posterior, ss_tuned)
  
file_path: pymc/tests/step_methods/hmc/test_hmc.py
imports: import warnings
  import numpy
  import numpy.testing
  import pytest
  import pymc
  from pymc.blocking import DictToArrayBijection, RaveledVars
  from pymc.pytensorf import floatX
  from pymc.step_methods.hmc import HamiltonianMC
  from pymc.step_methods.hmc.base_hmc import BaseHMC
  from tests import models
  from tests.helpers import RVsAssignmentStepsTester, StepMethodTester
label_desc: Use image node_id 2 for calling a global function with example usage: test_nuts_tuning() without return types