code: def simulator_logp(op, values, *inputs, **kwargs):
      (value,) = values
  
      # Use a new rng to avoid non-randomness in parallel sampling
      # TODO: Model rngs should be updated prior to multiprocessing split,
      #  in which case this would not be needed. However, that would have to be
      #  done for every sampler that may accommodate Simulators
      rng = pytensor.shared(
          np.random.default_rng(), name="simulator_rng"
      )
      # Create a new simulatorRV with identical inputs as the original one
      sim_value = op.make_node(rng, *inputs[1:]).default_output()
      sim_value.name = "simulator_value"
  
      return op.distance(
          op.epsilon,
          op.sum_stat(value),
          op.sum_stat(sim_value),
      )
  
imports: import logging
  import numpy
  import pytensor
  import pytensor.tensor
  from pytensor.graph.op import Apply, Op
  from pytensor.tensor.random.op import RandomVariable
  from pytensor.tensor.variable import TensorVariable
  from scipy.spatial import cKDTree
  from pymc.distributions.distribution import Distribution, _moment
  from pymc.logprob.abstract import _logprob
  from pymc.pytensorf import floatX
label_desc: Use image node_id 2 for calling a global function with example usage: simulator_logp(op, values) and returns: op