code: def test_spawn_densitydist_bound_method():
      N = 100
      with pm.Model() as model:
          mu = pm.Normal("mu", 0, 1)
  
          def logp(x, mu):
              normal_dist = pm.Normal.dist(mu, 1, size=N)
              out = pm.logp(normal_dist, x)
              return out
  
          obs = pm.CustomDist(
              "density_dist",
              mu,
              logp=logp,
              observed=np.random.randn(N),
              size=N,
          )
          with warnings.catch_warnings():
              warnings.filterwarnings(
                  "ignore", ".*number of samples.*", UserWarning
              )
              pm.sample(
                  draws=10,
                  tune=10,
                  step=pm.Metropolis(),
                  cores=2,
                  mp_ctx="spawn",
              )
  
imports: import multiprocessing
  import os
  import platform
  import sys
  import warnings
  import cloudpickle
  import numpy
  import pytensor
  import pytensor.tensor
  import pytest
  from pytensor.compile.ops import as_op
  from pytensor.tensor.type import TensorType
  import pymc
  import pymc.sampling.parallel
  from pymc.pytensorf import floatX
label_desc: Use image node_id 9 for calling a global function with example usage: test_spawn_densitydist_bound_method() and returns: out