code: def test_model_with_potential_fn(run_mcmc_cls):
      init_params = {"z": torch.tensor(0.0)}
  
      def potential_fn(params):
          return params["z"]
  
      run_mcmc_cls(
          data=None,
          kernel=HMC(potential_fn=potential_fn),
          num_samples=10,
          warmup_steps=10,
          initial_params=init_params,
      )
  
imports: import os
  from functools import partial
  import pytest
  import torch
  import pyro
  import pyro.distributions
  from pyro import poutine
  from pyro.infer.mcmc import HMC, NUTS
  from pyro.infer.mcmc.api import MCMC, StreamingMCMC, _MultiSampler, _UnarySampler
  from pyro.infer.mcmc.mcmc_kernel import MCMCKernel
  from pyro.infer.mcmc.util import initialize_model, select_samples
  from pyro.ops.streaming import StackStats, StatsOfDict
  from pyro.util import optional
  from tests.common import assert_close
label_desc: Use image node_id 11 for calling a global function with example usage: test_model_with_potential_fn(run_mcmc_cls) and returns: params