code: def marginal_mixture_moment(op, rv, rng, weights, *components):
      ndim_supp = components[0].owner.op.ndim_supp
      weights = pt.shape_padright(weights, ndim_supp)
      mix_axis = -ndim_supp - 1
  
      if len(components) == 1:
          moment_components = moment(components[0])
  
      else:
          moment_components = pt.stack(
              [moment(component) for component in components],
              axis=mix_axis,
          )
  
      mix_moment = pt.sum(weights * moment_components, axis=mix_axis)
      if components[0].dtype in discrete_types:
          mix_moment = pt.round(mix_moment)
      return mix_moment
  
imports: import warnings
  import numpy
  import pytensor
  import pytensor.tensor
  from pytensor.graph.basic import Node, equal_computations
  from pytensor.tensor import TensorVariable
  from pytensor.tensor.random.op import RandomVariable
  from pymc.distributions import transforms
  from pymc.distributions.continuous import Gamma, LogNormal, Normal, get_tau_sigma
  from pymc.distributions.discrete import Binomial, NegativeBinomial, Poisson
  from pymc.distributions.dist_math import check_parameters
  from pymc.distributions.distribution import DiracDelta, Distribution, SymbolicRandomVariable, _moment, moment
  from pymc.distributions.shape_utils import _change_dist_size, change_dist_size
  from pymc.distributions.transforms import _default_transform
  from pymc.distributions.truncated import Truncated
  from pymc.logprob.abstract import _logcdf, _logcdf_helper, _logprob
  from pymc.logprob.basic import logp
  from pymc.logprob.transforms import IntervalTransform
  from pymc.pytensorf import floatX
  from pymc.util import check_dist_not_registered
  from pymc.vartypes import continuous_types, discrete_types
label_desc: Use image node_id 4 for calling a global function with example usage: marginal_mixture_moment(op, rv, rng, weights) and returns: mix_moment