code: def test_lognormal_distribution(moment):
      num_samples = 100000
      inputs = OrderedDict(batch=Bint[10])
      loc = random_tensor(inputs)
      scale = random_tensor(inputs).exp()
  
      log_measure = dist.LogNormal(loc, scale)(value="x")
      probe = Variable("x", Real) ** moment
      with MonteCarlo(particle=Bint[num_samples]):
          with xfail_if_not_implemented():
              actual = Integrate(log_measure, probe, frozenset(["x"]))
      actual = actual.reduce(ops.mean, "particle")
  
      _, (loc_data, scale_data) = align_tensors(loc, scale)
      samples = backend_dist.LogNormal(loc_data, scale_data).sample(
          (num_samples,)
      )
      expected = (samples**moment).mean(0)
      assert_close(actual.data, expected, atol=1e-2, rtol=1e-2)
  
imports: import itertools
  import math
  from collections import OrderedDict
  from importlib import import_module
  import numpy
  import pytest
  import funsor.ops
  from funsor.cnf import Contraction
  from funsor.delta import Delta
  from funsor.distribution import BACKEND_TO_DISTRIBUTIONS_BACKEND
  from funsor.domains import Bint, Real, Reals
  from funsor.integrate import Integrate
  from funsor.montecarlo import MonteCarlo
  from funsor.tensor import Tensor, align_tensors
  from funsor.terms import Variable
  from funsor.testing import assert_close, excludes_backend, id_from_inputs, randn, random_gaussian, random_tensor, xfail_if_not_implemented
  from funsor.util import get_backend
label_desc: Use image node_id 8 for calling a global function with example usage: test_lognormal_distribution(moment) without return types